(() => {
  var __create = Object.create;
  var __defProp = Object.defineProperty;
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  var __getOwnPropNames = Object.getOwnPropertyNames;
  var __getProtoOf = Object.getPrototypeOf;
  var __hasOwnProp = Object.prototype.hasOwnProperty;
  var __esm = (fn, res) => function __init() {
    return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
  };
  var __commonJS = (cb, mod) => function __require() {
    return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
  };
  var __export = (target, all) => {
    for (var name in all)
      __defProp(target, name, { get: all[name], enumerable: true });
  };
  var __copyProps = (to, from, except, desc) => {
    if (from && typeof from === "object" || typeof from === "function") {
      for (let key of __getOwnPropNames(from))
        if (!__hasOwnProp.call(to, key) && key !== except)
          __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
    }
    return to;
  };
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
    // If the importer is in node compatibility mode or this is not an ESM
    // file that has been converted to a CommonJS file using a Babel-
    // compatible transform (i.e. "__esModule" has not been set), then set
    // "default" to the CommonJS "module.exports" for node compatibility.
    isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
    mod
  ));

  // node_modules/tslib/tslib.es6.mjs
  function __rest(s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
      t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
      for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
        if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
          t[p[i]] = s[p[i]];
      }
    return t;
  }
  function __awaiter(thisArg, _arguments, P, generator) {
    function adopt(value) {
      return value instanceof P ? value : new P(function(resolve) {
        resolve(value);
      });
    }
    return new (P || (P = Promise))(function(resolve, reject) {
      function fulfilled(value) {
        try {
          step(generator.next(value));
        } catch (e) {
          reject(e);
        }
      }
      function rejected(value) {
        try {
          step(generator["throw"](value));
        } catch (e) {
          reject(e);
        }
      }
      function step(result) {
        result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
      }
      step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
  }
  function __values(o) {
    var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
    if (m) return m.call(o);
    if (o && typeof o.length === "number") return {
      next: function() {
        if (o && i >= o.length) o = void 0;
        return { value: o && o[i++], done: !o };
      }
    };
    throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
  }
  function __await(v) {
    return this instanceof __await ? (this.v = v, this) : new __await(v);
  }
  function __asyncGenerator(thisArg, _arguments, generator) {
    if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
    var g = generator.apply(thisArg, _arguments || []), i, q = [];
    return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function() {
      return this;
    }, i;
    function awaitReturn(f) {
      return function(v) {
        return Promise.resolve(v).then(f, reject);
      };
    }
    function verb(n, f) {
      if (g[n]) {
        i[n] = function(v) {
          return new Promise(function(a, b) {
            q.push([n, v, a, b]) > 1 || resume(n, v);
          });
        };
        if (f) i[n] = f(i[n]);
      }
    }
    function resume(n, v) {
      try {
        step(g[n](v));
      } catch (e) {
        settle(q[0][3], e);
      }
    }
    function step(r) {
      r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);
    }
    function fulfill(value) {
      resume("next", value);
    }
    function reject(value) {
      resume("throw", value);
    }
    function settle(f, v) {
      if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
    }
  }
  function __asyncDelegator(o) {
    var i, p;
    return i = {}, verb("next"), verb("throw", function(e) {
      throw e;
    }), verb("return"), i[Symbol.iterator] = function() {
      return this;
    }, i;
    function verb(n, f) {
      i[n] = o[n] ? function(v) {
        return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v;
      } : f;
    }
  }
  function __asyncValues(o) {
    if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
    var m = o[Symbol.asyncIterator], i;
    return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
      return this;
    }, i);
    function verb(n) {
      i[n] = o[n] && function(v) {
        return new Promise(function(resolve, reject) {
          v = o[n](v), settle(resolve, reject, v.done, v.value);
        });
      };
    }
    function settle(resolve, reject, d, v) {
      Promise.resolve(v).then(function(v2) {
        resolve({ value: v2, done: d });
      }, reject);
    }
  }
  var init_tslib_es6 = __esm({
    "node_modules/tslib/tslib.es6.mjs"() {
    }
  });

  // node_modules/apache-arrow/util/utf8.mjs
  var decoder, decodeUtf8, encoder, encodeUtf8;
  var init_utf8 = __esm({
    "node_modules/apache-arrow/util/utf8.mjs"() {
      decoder = new TextDecoder("utf-8");
      decodeUtf8 = (buffer) => decoder.decode(buffer);
      encoder = new TextEncoder();
      encodeUtf8 = (value) => encoder.encode(value);
    }
  });

  // node_modules/apache-arrow/util/compat.mjs
  var isNumber, isBoolean, isFunction, isObject, isPromise, isIterable, isAsyncIterable, isArrowJSON, isIteratorResult, isFileHandle, isFetchResponse, isReadableInterop, isWritableDOMStream, isReadableDOMStream, isWritableNodeStream, isReadableNodeStream, isFlatbuffersByteBuffer;
  var init_compat = __esm({
    "node_modules/apache-arrow/util/compat.mjs"() {
      isNumber = (x) => typeof x === "number";
      isBoolean = (x) => typeof x === "boolean";
      isFunction = (x) => typeof x === "function";
      isObject = (x) => x != null && Object(x) === x;
      isPromise = (x) => {
        return isObject(x) && isFunction(x.then);
      };
      isIterable = (x) => {
        return isObject(x) && isFunction(x[Symbol.iterator]);
      };
      isAsyncIterable = (x) => {
        return isObject(x) && isFunction(x[Symbol.asyncIterator]);
      };
      isArrowJSON = (x) => {
        return isObject(x) && isObject(x["schema"]);
      };
      isIteratorResult = (x) => {
        return isObject(x) && "done" in x && "value" in x;
      };
      isFileHandle = (x) => {
        return isObject(x) && isFunction(x["stat"]) && isNumber(x["fd"]);
      };
      isFetchResponse = (x) => {
        return isObject(x) && isReadableDOMStream(x["body"]);
      };
      isReadableInterop = (x) => "_getDOMStream" in x && "_getNodeStream" in x;
      isWritableDOMStream = (x) => {
        return isObject(x) && isFunction(x["abort"]) && isFunction(x["getWriter"]) && !isReadableInterop(x);
      };
      isReadableDOMStream = (x) => {
        return isObject(x) && isFunction(x["cancel"]) && isFunction(x["getReader"]) && !isReadableInterop(x);
      };
      isWritableNodeStream = (x) => {
        return isObject(x) && isFunction(x["end"]) && isFunction(x["write"]) && isBoolean(x["writable"]) && !isReadableInterop(x);
      };
      isReadableNodeStream = (x) => {
        return isObject(x) && isFunction(x["read"]) && isFunction(x["pipe"]) && isBoolean(x["readable"]) && !isReadableInterop(x);
      };
      isFlatbuffersByteBuffer = (x) => {
        return isObject(x) && isFunction(x["clear"]) && isFunction(x["bytes"]) && isFunction(x["position"]) && isFunction(x["setPosition"]) && isFunction(x["capacity"]) && isFunction(x["getBufferIdentifier"]) && isFunction(x["createLong"]);
      };
    }
  });

  // node_modules/apache-arrow/util/buffer.mjs
  var buffer_exports = {};
  __export(buffer_exports, {
    compareArrayLike: () => compareArrayLike,
    joinUint8Arrays: () => joinUint8Arrays,
    memcpy: () => memcpy,
    rebaseValueOffsets: () => rebaseValueOffsets,
    toArrayBufferView: () => toArrayBufferView,
    toArrayBufferViewAsyncIterator: () => toArrayBufferViewAsyncIterator,
    toArrayBufferViewIterator: () => toArrayBufferViewIterator,
    toBigInt64Array: () => toBigInt64Array,
    toBigUint64Array: () => toBigUint64Array,
    toFloat32Array: () => toFloat32Array,
    toFloat32ArrayAsyncIterator: () => toFloat32ArrayAsyncIterator,
    toFloat32ArrayIterator: () => toFloat32ArrayIterator,
    toFloat64Array: () => toFloat64Array,
    toFloat64ArrayAsyncIterator: () => toFloat64ArrayAsyncIterator,
    toFloat64ArrayIterator: () => toFloat64ArrayIterator,
    toInt16Array: () => toInt16Array,
    toInt16ArrayAsyncIterator: () => toInt16ArrayAsyncIterator,
    toInt16ArrayIterator: () => toInt16ArrayIterator,
    toInt32Array: () => toInt32Array,
    toInt32ArrayAsyncIterator: () => toInt32ArrayAsyncIterator,
    toInt32ArrayIterator: () => toInt32ArrayIterator,
    toInt8Array: () => toInt8Array,
    toInt8ArrayAsyncIterator: () => toInt8ArrayAsyncIterator,
    toInt8ArrayIterator: () => toInt8ArrayIterator,
    toUint16Array: () => toUint16Array,
    toUint16ArrayAsyncIterator: () => toUint16ArrayAsyncIterator,
    toUint16ArrayIterator: () => toUint16ArrayIterator,
    toUint32Array: () => toUint32Array,
    toUint32ArrayAsyncIterator: () => toUint32ArrayAsyncIterator,
    toUint32ArrayIterator: () => toUint32ArrayIterator,
    toUint8Array: () => toUint8Array,
    toUint8ArrayAsyncIterator: () => toUint8ArrayAsyncIterator,
    toUint8ArrayIterator: () => toUint8ArrayIterator,
    toUint8ClampedArray: () => toUint8ClampedArray,
    toUint8ClampedArrayAsyncIterator: () => toUint8ClampedArrayAsyncIterator,
    toUint8ClampedArrayIterator: () => toUint8ClampedArrayIterator
  });
  function collapseContiguousByteRanges(chunks) {
    const result = chunks[0] ? [chunks[0]] : [];
    let xOffset, yOffset, xLen, yLen;
    for (let x, y, i = 0, j = 0, n = chunks.length; ++i < n; ) {
      x = result[j];
      y = chunks[i];
      if (!x || !y || x.buffer !== y.buffer || y.byteOffset < x.byteOffset) {
        y && (result[++j] = y);
        continue;
      }
      ({ byteOffset: xOffset, byteLength: xLen } = x);
      ({ byteOffset: yOffset, byteLength: yLen } = y);
      if (xOffset + xLen < yOffset || yOffset + yLen < xOffset) {
        y && (result[++j] = y);
        continue;
      }
      result[j] = new Uint8Array(x.buffer, xOffset, yOffset - xOffset + yLen);
    }
    return result;
  }
  function memcpy(target, source, targetByteOffset = 0, sourceByteLength = source.byteLength) {
    const targetByteLength = target.byteLength;
    const dst = new Uint8Array(target.buffer, target.byteOffset, targetByteLength);
    const src = new Uint8Array(source.buffer, source.byteOffset, Math.min(sourceByteLength, targetByteLength));
    dst.set(src, targetByteOffset);
    return target;
  }
  function joinUint8Arrays(chunks, size) {
    const result = collapseContiguousByteRanges(chunks);
    const byteLength = result.reduce((x, b) => x + b.byteLength, 0);
    let source, sliced, buffer;
    let offset = 0, index = -1;
    const length = Math.min(size || Number.POSITIVE_INFINITY, byteLength);
    for (const n = result.length; ++index < n; ) {
      source = result[index];
      sliced = source.subarray(0, Math.min(source.length, length - offset));
      if (length <= offset + sliced.length) {
        if (sliced.length < source.length) {
          result[index] = source.subarray(sliced.length);
        } else if (sliced.length === source.length) {
          index++;
        }
        buffer ? memcpy(buffer, sliced, offset) : buffer = sliced;
        break;
      }
      memcpy(buffer || (buffer = new Uint8Array(length)), sliced, offset);
      offset += sliced.length;
    }
    return [buffer || new Uint8Array(0), result.slice(index), byteLength - (buffer ? buffer.byteLength : 0)];
  }
  function toArrayBufferView(ArrayBufferViewCtor, input) {
    let value = isIteratorResult(input) ? input.value : input;
    if (value instanceof ArrayBufferViewCtor) {
      if (ArrayBufferViewCtor === Uint8Array) {
        return new ArrayBufferViewCtor(value.buffer, value.byteOffset, value.byteLength);
      }
      return value;
    }
    if (!value) {
      return new ArrayBufferViewCtor(0);
    }
    if (typeof value === "string") {
      value = encodeUtf8(value);
    }
    if (value instanceof ArrayBuffer) {
      return new ArrayBufferViewCtor(value);
    }
    if (value instanceof SharedArrayBuf) {
      return new ArrayBufferViewCtor(value);
    }
    if (isFlatbuffersByteBuffer(value)) {
      return toArrayBufferView(ArrayBufferViewCtor, value.bytes());
    }
    return !ArrayBuffer.isView(value) ? ArrayBufferViewCtor.from(value) : value.byteLength <= 0 ? new ArrayBufferViewCtor(0) : new ArrayBufferViewCtor(value.buffer, value.byteOffset, value.byteLength / ArrayBufferViewCtor.BYTES_PER_ELEMENT);
  }
  function* toArrayBufferViewIterator(ArrayCtor, source) {
    const wrap = function* (x) {
      yield x;
    };
    const buffers = typeof source === "string" ? wrap(source) : ArrayBuffer.isView(source) ? wrap(source) : source instanceof ArrayBuffer ? wrap(source) : source instanceof SharedArrayBuf ? wrap(source) : !isIterable(source) ? wrap(source) : source;
    yield* pump((function* (it) {
      let r = null;
      do {
        r = it.next(yield toArrayBufferView(ArrayCtor, r));
      } while (!r.done);
    })(buffers[Symbol.iterator]()));
    return new ArrayCtor();
  }
  function toArrayBufferViewAsyncIterator(ArrayCtor, source) {
    return __asyncGenerator(this, arguments, function* toArrayBufferViewAsyncIterator_1() {
      if (isPromise(source)) {
        return yield __await(yield __await(yield* __asyncDelegator(__asyncValues(toArrayBufferViewAsyncIterator(ArrayCtor, yield __await(source))))));
      }
      const wrap = function(x) {
        return __asyncGenerator(this, arguments, function* () {
          yield yield __await(yield __await(x));
        });
      };
      const emit = function(source2) {
        return __asyncGenerator(this, arguments, function* () {
          yield __await(yield* __asyncDelegator(__asyncValues(pump((function* (it) {
            let r = null;
            do {
              r = it.next(yield r === null || r === void 0 ? void 0 : r.value);
            } while (!r.done);
          })(source2[Symbol.iterator]())))));
        });
      };
      const buffers = typeof source === "string" ? wrap(source) : ArrayBuffer.isView(source) ? wrap(source) : source instanceof ArrayBuffer ? wrap(source) : source instanceof SharedArrayBuf ? wrap(source) : isIterable(source) ? emit(source) : !isAsyncIterable(source) ? wrap(source) : source;
      yield __await(
        // otherwise if AsyncIterable, use it
        yield* __asyncDelegator(__asyncValues(pump((function(it) {
          return __asyncGenerator(this, arguments, function* () {
            let r = null;
            do {
              r = yield __await(it.next(yield yield __await(toArrayBufferView(ArrayCtor, r))));
            } while (!r.done);
          });
        })(buffers[Symbol.asyncIterator]()))))
      );
      return yield __await(new ArrayCtor());
    });
  }
  function rebaseValueOffsets(offset, length, valueOffsets) {
    if (offset !== 0) {
      valueOffsets = valueOffsets.slice(0, length);
      for (let i = -1, n = valueOffsets.length; ++i < n; ) {
        valueOffsets[i] += offset;
      }
    }
    return valueOffsets.subarray(0, length);
  }
  function compareArrayLike(a, b) {
    let i = 0;
    const n = a.length;
    if (n !== b.length) {
      return false;
    }
    if (n > 0) {
      do {
        if (a[i] !== b[i]) {
          return false;
        }
      } while (++i < n);
    }
    return true;
  }
  var SharedArrayBuf, toInt8Array, toInt16Array, toInt32Array, toBigInt64Array, toUint8Array, toUint16Array, toUint32Array, toBigUint64Array, toFloat32Array, toFloat64Array, toUint8ClampedArray, pump, toInt8ArrayIterator, toInt16ArrayIterator, toInt32ArrayIterator, toUint8ArrayIterator, toUint16ArrayIterator, toUint32ArrayIterator, toFloat32ArrayIterator, toFloat64ArrayIterator, toUint8ClampedArrayIterator, toInt8ArrayAsyncIterator, toInt16ArrayAsyncIterator, toInt32ArrayAsyncIterator, toUint8ArrayAsyncIterator, toUint16ArrayAsyncIterator, toUint32ArrayAsyncIterator, toFloat32ArrayAsyncIterator, toFloat64ArrayAsyncIterator, toUint8ClampedArrayAsyncIterator;
  var init_buffer = __esm({
    "node_modules/apache-arrow/util/buffer.mjs"() {
      init_tslib_es6();
      init_utf8();
      init_compat();
      SharedArrayBuf = typeof SharedArrayBuffer !== "undefined" ? SharedArrayBuffer : ArrayBuffer;
      toInt8Array = (input) => toArrayBufferView(Int8Array, input);
      toInt16Array = (input) => toArrayBufferView(Int16Array, input);
      toInt32Array = (input) => toArrayBufferView(Int32Array, input);
      toBigInt64Array = (input) => toArrayBufferView(BigInt64Array, input);
      toUint8Array = (input) => toArrayBufferView(Uint8Array, input);
      toUint16Array = (input) => toArrayBufferView(Uint16Array, input);
      toUint32Array = (input) => toArrayBufferView(Uint32Array, input);
      toBigUint64Array = (input) => toArrayBufferView(BigUint64Array, input);
      toFloat32Array = (input) => toArrayBufferView(Float32Array, input);
      toFloat64Array = (input) => toArrayBufferView(Float64Array, input);
      toUint8ClampedArray = (input) => toArrayBufferView(Uint8ClampedArray, input);
      pump = (iterator) => {
        iterator.next();
        return iterator;
      };
      toInt8ArrayIterator = (input) => toArrayBufferViewIterator(Int8Array, input);
      toInt16ArrayIterator = (input) => toArrayBufferViewIterator(Int16Array, input);
      toInt32ArrayIterator = (input) => toArrayBufferViewIterator(Int32Array, input);
      toUint8ArrayIterator = (input) => toArrayBufferViewIterator(Uint8Array, input);
      toUint16ArrayIterator = (input) => toArrayBufferViewIterator(Uint16Array, input);
      toUint32ArrayIterator = (input) => toArrayBufferViewIterator(Uint32Array, input);
      toFloat32ArrayIterator = (input) => toArrayBufferViewIterator(Float32Array, input);
      toFloat64ArrayIterator = (input) => toArrayBufferViewIterator(Float64Array, input);
      toUint8ClampedArrayIterator = (input) => toArrayBufferViewIterator(Uint8ClampedArray, input);
      toInt8ArrayAsyncIterator = (input) => toArrayBufferViewAsyncIterator(Int8Array, input);
      toInt16ArrayAsyncIterator = (input) => toArrayBufferViewAsyncIterator(Int16Array, input);
      toInt32ArrayAsyncIterator = (input) => toArrayBufferViewAsyncIterator(Int32Array, input);
      toUint8ArrayAsyncIterator = (input) => toArrayBufferViewAsyncIterator(Uint8Array, input);
      toUint16ArrayAsyncIterator = (input) => toArrayBufferViewAsyncIterator(Uint16Array, input);
      toUint32ArrayAsyncIterator = (input) => toArrayBufferViewAsyncIterator(Uint32Array, input);
      toFloat32ArrayAsyncIterator = (input) => toArrayBufferViewAsyncIterator(Float32Array, input);
      toFloat64ArrayAsyncIterator = (input) => toArrayBufferViewAsyncIterator(Float64Array, input);
      toUint8ClampedArrayAsyncIterator = (input) => toArrayBufferViewAsyncIterator(Uint8ClampedArray, input);
    }
  });

  // node_modules/apache-arrow/io/adapters.mjs
  function* fromIterable(source) {
    let done, threw = false;
    let buffers = [], buffer;
    let cmd, size, bufferLength = 0;
    function byteRange() {
      if (cmd === "peek") {
        return joinUint8Arrays(buffers, size)[0];
      }
      [buffer, buffers, bufferLength] = joinUint8Arrays(buffers, size);
      return buffer;
    }
    ({ cmd, size } = (yield /* @__PURE__ */ (() => null)()) || { cmd: "read", size: 0 });
    const it = toUint8ArrayIterator(source)[Symbol.iterator]();
    try {
      do {
        ({ done, value: buffer } = Number.isNaN(size - bufferLength) ? it.next() : it.next(size - bufferLength));
        if (!done && buffer.byteLength > 0) {
          buffers.push(buffer);
          bufferLength += buffer.byteLength;
        }
        if (done || size <= bufferLength) {
          do {
            ({ cmd, size } = yield byteRange());
          } while (size < bufferLength);
        }
      } while (!done);
    } catch (e) {
      (threw = true) && typeof it.throw === "function" && it.throw(e);
    } finally {
      threw === false && typeof it.return === "function" && it.return(null);
    }
    return null;
  }
  function fromAsyncIterable(source) {
    return __asyncGenerator(this, arguments, function* fromAsyncIterable_1() {
      let done, threw = false;
      let buffers = [], buffer;
      let cmd, size, bufferLength = 0;
      function byteRange() {
        if (cmd === "peek") {
          return joinUint8Arrays(buffers, size)[0];
        }
        [buffer, buffers, bufferLength] = joinUint8Arrays(buffers, size);
        return buffer;
      }
      ({ cmd, size } = (yield yield __await(/* @__PURE__ */ (() => null)())) || { cmd: "read", size: 0 });
      const it = toUint8ArrayAsyncIterator(source)[Symbol.asyncIterator]();
      try {
        do {
          ({ done, value: buffer } = Number.isNaN(size - bufferLength) ? yield __await(it.next()) : yield __await(it.next(size - bufferLength)));
          if (!done && buffer.byteLength > 0) {
            buffers.push(buffer);
            bufferLength += buffer.byteLength;
          }
          if (done || size <= bufferLength) {
            do {
              ({ cmd, size } = yield yield __await(byteRange()));
            } while (size < bufferLength);
          }
        } while (!done);
      } catch (e) {
        (threw = true) && typeof it.throw === "function" && (yield __await(it.throw(e)));
      } finally {
        threw === false && typeof it.return === "function" && (yield __await(it.return(new Uint8Array(0))));
      }
      return yield __await(null);
    });
  }
  function fromDOMStream(source) {
    return __asyncGenerator(this, arguments, function* fromDOMStream_1() {
      let done = false, threw = false;
      let buffers = [], buffer;
      let cmd, size, bufferLength = 0;
      function byteRange() {
        if (cmd === "peek") {
          return joinUint8Arrays(buffers, size)[0];
        }
        [buffer, buffers, bufferLength] = joinUint8Arrays(buffers, size);
        return buffer;
      }
      ({ cmd, size } = (yield yield __await(/* @__PURE__ */ (() => null)())) || { cmd: "read", size: 0 });
      const it = new AdaptiveByteReader(source);
      try {
        do {
          ({ done, value: buffer } = Number.isNaN(size - bufferLength) ? yield __await(it["read"]()) : yield __await(it["read"](size - bufferLength)));
          if (!done && buffer.byteLength > 0) {
            buffers.push(toUint8Array(buffer));
            bufferLength += buffer.byteLength;
          }
          if (done || size <= bufferLength) {
            do {
              ({ cmd, size } = yield yield __await(byteRange()));
            } while (size < bufferLength);
          }
        } while (!done);
      } catch (e) {
        (threw = true) && (yield __await(it["cancel"](e)));
      } finally {
        threw === false ? yield __await(it["cancel"]()) : source["locked"] && it.releaseLock();
      }
      return yield __await(null);
    });
  }
  function fromNodeStream(stream) {
    return __asyncGenerator(this, arguments, function* fromNodeStream_1() {
      const events = [];
      let event = "error";
      let done = false, err = null;
      let cmd, size, bufferLength = 0;
      let buffers = [], buffer;
      function byteRange() {
        if (cmd === "peek") {
          return joinUint8Arrays(buffers, size)[0];
        }
        [buffer, buffers, bufferLength] = joinUint8Arrays(buffers, size);
        return buffer;
      }
      ({ cmd, size } = (yield yield __await(/* @__PURE__ */ (() => null)())) || { cmd: "read", size: 0 });
      if (stream["isTTY"]) {
        yield yield __await(new Uint8Array(0));
        return yield __await(null);
      }
      try {
        events[0] = onEvent(stream, "end");
        events[1] = onEvent(stream, "error");
        do {
          events[2] = onEvent(stream, "readable");
          [event, err] = yield __await(Promise.race(events.map((x) => x[2])));
          if (event === "error") {
            break;
          }
          if (!(done = event === "end")) {
            if (!Number.isFinite(size - bufferLength)) {
              buffer = toUint8Array(stream["read"]());
            } else {
              buffer = toUint8Array(stream["read"](size - bufferLength));
              if (buffer.byteLength < size - bufferLength) {
                buffer = toUint8Array(stream["read"]());
              }
            }
            if (buffer.byteLength > 0) {
              buffers.push(buffer);
              bufferLength += buffer.byteLength;
            }
          }
          if (done || size <= bufferLength) {
            do {
              ({ cmd, size } = yield yield __await(byteRange()));
            } while (size < bufferLength);
          }
        } while (!done);
      } finally {
        yield __await(cleanup(events, event === "error" ? err : null));
      }
      return yield __await(null);
      function cleanup(events2, err2) {
        buffer = buffers = null;
        return new Promise((resolve, reject) => {
          for (const [evt, fn] of events2) {
            stream["off"](evt, fn);
          }
          try {
            const destroy = stream["destroy"];
            destroy && destroy.call(stream, err2);
            err2 = void 0;
          } catch (e) {
            err2 = e || err2;
          } finally {
            err2 != null ? reject(err2) : resolve();
          }
        });
      }
    });
  }
  var adapters_default, pump2, AdaptiveByteReader, onEvent;
  var init_adapters = __esm({
    "node_modules/apache-arrow/io/adapters.mjs"() {
      init_tslib_es6();
      init_buffer();
      adapters_default = {
        fromIterable(source) {
          return pump2(fromIterable(source));
        },
        fromAsyncIterable(source) {
          return pump2(fromAsyncIterable(source));
        },
        fromDOMStream(source) {
          return pump2(fromDOMStream(source));
        },
        fromNodeStream(stream) {
          return pump2(fromNodeStream(stream));
        },
        // @ts-ignore
        toDOMStream(source, options) {
          throw new Error(`"toDOMStream" not available in this environment`);
        },
        // @ts-ignore
        toNodeStream(source, options) {
          throw new Error(`"toNodeStream" not available in this environment`);
        }
      };
      pump2 = (iterator) => {
        iterator.next();
        return iterator;
      };
      AdaptiveByteReader = class {
        constructor(source) {
          this.source = source;
          this.reader = null;
          this.reader = this.source["getReader"]();
          this.reader["closed"].catch(() => {
          });
        }
        get closed() {
          return this.reader ? this.reader["closed"].catch(() => {
          }) : Promise.resolve();
        }
        releaseLock() {
          if (this.reader) {
            this.reader.releaseLock();
          }
          this.reader = null;
        }
        cancel(reason) {
          return __awaiter(this, void 0, void 0, function* () {
            const { reader, source } = this;
            reader && (yield reader["cancel"](reason).catch(() => {
            }));
            source && (source["locked"] && this.releaseLock());
          });
        }
        read(size) {
          return __awaiter(this, void 0, void 0, function* () {
            if (size === 0) {
              return { done: this.reader == null, value: new Uint8Array(0) };
            }
            const result = yield this.reader.read();
            !result.done && (result.value = toUint8Array(result));
            return result;
          });
        }
      };
      onEvent = (stream, event) => {
        const handler = (_) => resolve([event, _]);
        let resolve;
        return [event, handler, new Promise((r) => (resolve = r) && stream["once"](event, handler))];
      };
    }
  });

  // node_modules/apache-arrow/fb/metadata-version.mjs
  var MetadataVersion;
  var init_metadata_version = __esm({
    "node_modules/apache-arrow/fb/metadata-version.mjs"() {
      (function(MetadataVersion2) {
        MetadataVersion2[MetadataVersion2["V1"] = 0] = "V1";
        MetadataVersion2[MetadataVersion2["V2"] = 1] = "V2";
        MetadataVersion2[MetadataVersion2["V3"] = 2] = "V3";
        MetadataVersion2[MetadataVersion2["V4"] = 3] = "V4";
        MetadataVersion2[MetadataVersion2["V5"] = 4] = "V5";
      })(MetadataVersion || (MetadataVersion = {}));
    }
  });

  // node_modules/apache-arrow/fb/union-mode.mjs
  var UnionMode;
  var init_union_mode = __esm({
    "node_modules/apache-arrow/fb/union-mode.mjs"() {
      (function(UnionMode2) {
        UnionMode2[UnionMode2["Sparse"] = 0] = "Sparse";
        UnionMode2[UnionMode2["Dense"] = 1] = "Dense";
      })(UnionMode || (UnionMode = {}));
    }
  });

  // node_modules/apache-arrow/fb/precision.mjs
  var Precision;
  var init_precision = __esm({
    "node_modules/apache-arrow/fb/precision.mjs"() {
      (function(Precision2) {
        Precision2[Precision2["HALF"] = 0] = "HALF";
        Precision2[Precision2["SINGLE"] = 1] = "SINGLE";
        Precision2[Precision2["DOUBLE"] = 2] = "DOUBLE";
      })(Precision || (Precision = {}));
    }
  });

  // node_modules/apache-arrow/fb/date-unit.mjs
  var DateUnit;
  var init_date_unit = __esm({
    "node_modules/apache-arrow/fb/date-unit.mjs"() {
      (function(DateUnit2) {
        DateUnit2[DateUnit2["DAY"] = 0] = "DAY";
        DateUnit2[DateUnit2["MILLISECOND"] = 1] = "MILLISECOND";
      })(DateUnit || (DateUnit = {}));
    }
  });

  // node_modules/apache-arrow/fb/time-unit.mjs
  var TimeUnit;
  var init_time_unit = __esm({
    "node_modules/apache-arrow/fb/time-unit.mjs"() {
      (function(TimeUnit2) {
        TimeUnit2[TimeUnit2["SECOND"] = 0] = "SECOND";
        TimeUnit2[TimeUnit2["MILLISECOND"] = 1] = "MILLISECOND";
        TimeUnit2[TimeUnit2["MICROSECOND"] = 2] = "MICROSECOND";
        TimeUnit2[TimeUnit2["NANOSECOND"] = 3] = "NANOSECOND";
      })(TimeUnit || (TimeUnit = {}));
    }
  });

  // node_modules/apache-arrow/fb/interval-unit.mjs
  var IntervalUnit;
  var init_interval_unit = __esm({
    "node_modules/apache-arrow/fb/interval-unit.mjs"() {
      (function(IntervalUnit2) {
        IntervalUnit2[IntervalUnit2["YEAR_MONTH"] = 0] = "YEAR_MONTH";
        IntervalUnit2[IntervalUnit2["DAY_TIME"] = 1] = "DAY_TIME";
        IntervalUnit2[IntervalUnit2["MONTH_DAY_NANO"] = 2] = "MONTH_DAY_NANO";
      })(IntervalUnit || (IntervalUnit = {}));
    }
  });

  // node_modules/flatbuffers/mjs/constants.js
  var SIZEOF_SHORT, SIZEOF_INT, FILE_IDENTIFIER_LENGTH, SIZE_PREFIX_LENGTH;
  var init_constants = __esm({
    "node_modules/flatbuffers/mjs/constants.js"() {
      SIZEOF_SHORT = 2;
      SIZEOF_INT = 4;
      FILE_IDENTIFIER_LENGTH = 4;
      SIZE_PREFIX_LENGTH = 4;
    }
  });

  // node_modules/flatbuffers/mjs/utils.js
  var int32, float32, float64, isLittleEndian;
  var init_utils = __esm({
    "node_modules/flatbuffers/mjs/utils.js"() {
      int32 = new Int32Array(2);
      float32 = new Float32Array(int32.buffer);
      float64 = new Float64Array(int32.buffer);
      isLittleEndian = new Uint16Array(new Uint8Array([1, 0]).buffer)[0] === 1;
    }
  });

  // node_modules/flatbuffers/mjs/encoding.js
  var Encoding;
  var init_encoding = __esm({
    "node_modules/flatbuffers/mjs/encoding.js"() {
      (function(Encoding2) {
        Encoding2[Encoding2["UTF8_BYTES"] = 1] = "UTF8_BYTES";
        Encoding2[Encoding2["UTF16_STRING"] = 2] = "UTF16_STRING";
      })(Encoding || (Encoding = {}));
    }
  });

  // node_modules/flatbuffers/mjs/byte-buffer.js
  var ByteBuffer;
  var init_byte_buffer = __esm({
    "node_modules/flatbuffers/mjs/byte-buffer.js"() {
      init_constants();
      init_utils();
      init_encoding();
      ByteBuffer = class _ByteBuffer {
        /**
         * Create a new ByteBuffer with a given array of bytes (`Uint8Array`)
         */
        constructor(bytes_) {
          this.bytes_ = bytes_;
          this.position_ = 0;
          this.text_decoder_ = new TextDecoder();
        }
        /**
         * Create and allocate a new ByteBuffer with a given size.
         */
        static allocate(byte_size) {
          return new _ByteBuffer(new Uint8Array(byte_size));
        }
        clear() {
          this.position_ = 0;
        }
        /**
         * Get the underlying `Uint8Array`.
         */
        bytes() {
          return this.bytes_;
        }
        /**
         * Get the buffer's position.
         */
        position() {
          return this.position_;
        }
        /**
         * Set the buffer's position.
         */
        setPosition(position) {
          this.position_ = position;
        }
        /**
         * Get the buffer's capacity.
         */
        capacity() {
          return this.bytes_.length;
        }
        readInt8(offset) {
          return this.readUint8(offset) << 24 >> 24;
        }
        readUint8(offset) {
          return this.bytes_[offset];
        }
        readInt16(offset) {
          return this.readUint16(offset) << 16 >> 16;
        }
        readUint16(offset) {
          return this.bytes_[offset] | this.bytes_[offset + 1] << 8;
        }
        readInt32(offset) {
          return this.bytes_[offset] | this.bytes_[offset + 1] << 8 | this.bytes_[offset + 2] << 16 | this.bytes_[offset + 3] << 24;
        }
        readUint32(offset) {
          return this.readInt32(offset) >>> 0;
        }
        readInt64(offset) {
          return BigInt.asIntN(64, BigInt(this.readUint32(offset)) + (BigInt(this.readUint32(offset + 4)) << BigInt(32)));
        }
        readUint64(offset) {
          return BigInt.asUintN(64, BigInt(this.readUint32(offset)) + (BigInt(this.readUint32(offset + 4)) << BigInt(32)));
        }
        readFloat32(offset) {
          int32[0] = this.readInt32(offset);
          return float32[0];
        }
        readFloat64(offset) {
          int32[isLittleEndian ? 0 : 1] = this.readInt32(offset);
          int32[isLittleEndian ? 1 : 0] = this.readInt32(offset + 4);
          return float64[0];
        }
        writeInt8(offset, value) {
          this.bytes_[offset] = value;
        }
        writeUint8(offset, value) {
          this.bytes_[offset] = value;
        }
        writeInt16(offset, value) {
          this.bytes_[offset] = value;
          this.bytes_[offset + 1] = value >> 8;
        }
        writeUint16(offset, value) {
          this.bytes_[offset] = value;
          this.bytes_[offset + 1] = value >> 8;
        }
        writeInt32(offset, value) {
          this.bytes_[offset] = value;
          this.bytes_[offset + 1] = value >> 8;
          this.bytes_[offset + 2] = value >> 16;
          this.bytes_[offset + 3] = value >> 24;
        }
        writeUint32(offset, value) {
          this.bytes_[offset] = value;
          this.bytes_[offset + 1] = value >> 8;
          this.bytes_[offset + 2] = value >> 16;
          this.bytes_[offset + 3] = value >> 24;
        }
        writeInt64(offset, value) {
          this.writeInt32(offset, Number(BigInt.asIntN(32, value)));
          this.writeInt32(offset + 4, Number(BigInt.asIntN(32, value >> BigInt(32))));
        }
        writeUint64(offset, value) {
          this.writeUint32(offset, Number(BigInt.asUintN(32, value)));
          this.writeUint32(offset + 4, Number(BigInt.asUintN(32, value >> BigInt(32))));
        }
        writeFloat32(offset, value) {
          float32[0] = value;
          this.writeInt32(offset, int32[0]);
        }
        writeFloat64(offset, value) {
          float64[0] = value;
          this.writeInt32(offset, int32[isLittleEndian ? 0 : 1]);
          this.writeInt32(offset + 4, int32[isLittleEndian ? 1 : 0]);
        }
        /**
         * Return the file identifier.   Behavior is undefined for FlatBuffers whose
         * schema does not include a file_identifier (likely points at padding or the
         * start of a the root vtable).
         */
        getBufferIdentifier() {
          if (this.bytes_.length < this.position_ + SIZEOF_INT + FILE_IDENTIFIER_LENGTH) {
            throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");
          }
          let result = "";
          for (let i = 0; i < FILE_IDENTIFIER_LENGTH; i++) {
            result += String.fromCharCode(this.readInt8(this.position_ + SIZEOF_INT + i));
          }
          return result;
        }
        /**
         * Look up a field in the vtable, return an offset into the object, or 0 if the
         * field is not present.
         */
        __offset(bb_pos, vtable_offset) {
          const vtable = bb_pos - this.readInt32(bb_pos);
          return vtable_offset < this.readInt16(vtable) ? this.readInt16(vtable + vtable_offset) : 0;
        }
        /**
         * Initialize any Table-derived type to point to the union at the given offset.
         */
        __union(t, offset) {
          t.bb_pos = offset + this.readInt32(offset);
          t.bb = this;
          return t;
        }
        /**
         * Create a JavaScript string from UTF-8 data stored inside the FlatBuffer.
         * This allocates a new string and converts to wide chars upon each access.
         *
         * To avoid the conversion to string, pass Encoding.UTF8_BYTES as the
         * "optionalEncoding" argument. This is useful for avoiding conversion when
         * the data will just be packaged back up in another FlatBuffer later on.
         *
         * @param offset
         * @param opt_encoding Defaults to UTF16_STRING
         */
        __string(offset, opt_encoding) {
          offset += this.readInt32(offset);
          const length = this.readInt32(offset);
          offset += SIZEOF_INT;
          const utf8bytes = this.bytes_.subarray(offset, offset + length);
          if (opt_encoding === Encoding.UTF8_BYTES)
            return utf8bytes;
          else
            return this.text_decoder_.decode(utf8bytes);
        }
        /**
         * Handle unions that can contain string as its member, if a Table-derived type then initialize it,
         * if a string then return a new one
         *
         * WARNING: strings are immutable in JS so we can't change the string that the user gave us, this
         * makes the behaviour of __union_with_string different compared to __union
         */
        __union_with_string(o, offset) {
          if (typeof o === "string") {
            return this.__string(offset);
          }
          return this.__union(o, offset);
        }
        /**
         * Retrieve the relative offset stored at "offset"
         */
        __indirect(offset) {
          return offset + this.readInt32(offset);
        }
        /**
         * Get the start of data of a vector whose offset is stored at "offset" in this object.
         */
        __vector(offset) {
          return offset + this.readInt32(offset) + SIZEOF_INT;
        }
        /**
         * Get the length of a vector whose offset is stored at "offset" in this object.
         */
        __vector_len(offset) {
          return this.readInt32(offset + this.readInt32(offset));
        }
        __has_identifier(ident) {
          if (ident.length != FILE_IDENTIFIER_LENGTH) {
            throw new Error("FlatBuffers: file identifier must be length " + FILE_IDENTIFIER_LENGTH);
          }
          for (let i = 0; i < FILE_IDENTIFIER_LENGTH; i++) {
            if (ident.charCodeAt(i) != this.readInt8(this.position() + SIZEOF_INT + i)) {
              return false;
            }
          }
          return true;
        }
        /**
         * A helper function for generating list for obj api
         */
        createScalarList(listAccessor, listLength) {
          const ret = [];
          for (let i = 0; i < listLength; ++i) {
            const val = listAccessor(i);
            if (val !== null) {
              ret.push(val);
            }
          }
          return ret;
        }
        /**
         * A helper function for generating list for obj api
         * @param listAccessor function that accepts an index and return data at that index
         * @param listLength listLength
         * @param res result list
         */
        createObjList(listAccessor, listLength) {
          const ret = [];
          for (let i = 0; i < listLength; ++i) {
            const val = listAccessor(i);
            if (val !== null) {
              ret.push(val.unpack());
            }
          }
          return ret;
        }
      };
    }
  });

  // node_modules/flatbuffers/mjs/builder.js
  var Builder;
  var init_builder = __esm({
    "node_modules/flatbuffers/mjs/builder.js"() {
      init_byte_buffer();
      init_constants();
      Builder = class _Builder {
        /**
         * Create a FlatBufferBuilder.
         */
        constructor(opt_initial_size) {
          this.minalign = 1;
          this.vtable = null;
          this.vtable_in_use = 0;
          this.isNested = false;
          this.object_start = 0;
          this.vtables = [];
          this.vector_num_elems = 0;
          this.force_defaults = false;
          this.string_maps = null;
          this.text_encoder = new TextEncoder();
          let initial_size;
          if (!opt_initial_size) {
            initial_size = 1024;
          } else {
            initial_size = opt_initial_size;
          }
          this.bb = ByteBuffer.allocate(initial_size);
          this.space = initial_size;
        }
        clear() {
          this.bb.clear();
          this.space = this.bb.capacity();
          this.minalign = 1;
          this.vtable = null;
          this.vtable_in_use = 0;
          this.isNested = false;
          this.object_start = 0;
          this.vtables = [];
          this.vector_num_elems = 0;
          this.force_defaults = false;
          this.string_maps = null;
        }
        /**
         * In order to save space, fields that are set to their default value
         * don't get serialized into the buffer. Forcing defaults provides a
         * way to manually disable this optimization.
         *
         * @param forceDefaults true always serializes default values
         */
        forceDefaults(forceDefaults) {
          this.force_defaults = forceDefaults;
        }
        /**
         * Get the ByteBuffer representing the FlatBuffer. Only call this after you've
         * called finish(). The actual data starts at the ByteBuffer's current position,
         * not necessarily at 0.
         */
        dataBuffer() {
          return this.bb;
        }
        /**
         * Get the bytes representing the FlatBuffer. Only call this after you've
         * called finish().
         */
        asUint8Array() {
          return this.bb.bytes().subarray(this.bb.position(), this.bb.position() + this.offset());
        }
        /**
         * Prepare to write an element of `size` after `additional_bytes` have been
         * written, e.g. if you write a string, you need to align such the int length
         * field is aligned to 4 bytes, and the string data follows it directly. If all
         * you need to do is alignment, `additional_bytes` will be 0.
         *
         * @param size This is the of the new element to write
         * @param additional_bytes The padding size
         */
        prep(size, additional_bytes) {
          if (size > this.minalign) {
            this.minalign = size;
          }
          const align_size = ~(this.bb.capacity() - this.space + additional_bytes) + 1 & size - 1;
          while (this.space < align_size + size + additional_bytes) {
            const old_buf_size = this.bb.capacity();
            this.bb = _Builder.growByteBuffer(this.bb);
            this.space += this.bb.capacity() - old_buf_size;
          }
          this.pad(align_size);
        }
        pad(byte_size) {
          for (let i = 0; i < byte_size; i++) {
            this.bb.writeInt8(--this.space, 0);
          }
        }
        writeInt8(value) {
          this.bb.writeInt8(this.space -= 1, value);
        }
        writeInt16(value) {
          this.bb.writeInt16(this.space -= 2, value);
        }
        writeInt32(value) {
          this.bb.writeInt32(this.space -= 4, value);
        }
        writeInt64(value) {
          this.bb.writeInt64(this.space -= 8, value);
        }
        writeFloat32(value) {
          this.bb.writeFloat32(this.space -= 4, value);
        }
        writeFloat64(value) {
          this.bb.writeFloat64(this.space -= 8, value);
        }
        /**
         * Add an `int8` to the buffer, properly aligned, and grows the buffer (if necessary).
         * @param value The `int8` to add the buffer.
         */
        addInt8(value) {
          this.prep(1, 0);
          this.writeInt8(value);
        }
        /**
         * Add an `int16` to the buffer, properly aligned, and grows the buffer (if necessary).
         * @param value The `int16` to add the buffer.
         */
        addInt16(value) {
          this.prep(2, 0);
          this.writeInt16(value);
        }
        /**
         * Add an `int32` to the buffer, properly aligned, and grows the buffer (if necessary).
         * @param value The `int32` to add the buffer.
         */
        addInt32(value) {
          this.prep(4, 0);
          this.writeInt32(value);
        }
        /**
         * Add an `int64` to the buffer, properly aligned, and grows the buffer (if necessary).
         * @param value The `int64` to add the buffer.
         */
        addInt64(value) {
          this.prep(8, 0);
          this.writeInt64(value);
        }
        /**
         * Add a `float32` to the buffer, properly aligned, and grows the buffer (if necessary).
         * @param value The `float32` to add the buffer.
         */
        addFloat32(value) {
          this.prep(4, 0);
          this.writeFloat32(value);
        }
        /**
         * Add a `float64` to the buffer, properly aligned, and grows the buffer (if necessary).
         * @param value The `float64` to add the buffer.
         */
        addFloat64(value) {
          this.prep(8, 0);
          this.writeFloat64(value);
        }
        addFieldInt8(voffset, value, defaultValue) {
          if (this.force_defaults || value != defaultValue) {
            this.addInt8(value);
            this.slot(voffset);
          }
        }
        addFieldInt16(voffset, value, defaultValue) {
          if (this.force_defaults || value != defaultValue) {
            this.addInt16(value);
            this.slot(voffset);
          }
        }
        addFieldInt32(voffset, value, defaultValue) {
          if (this.force_defaults || value != defaultValue) {
            this.addInt32(value);
            this.slot(voffset);
          }
        }
        addFieldInt64(voffset, value, defaultValue) {
          if (this.force_defaults || value !== defaultValue) {
            this.addInt64(value);
            this.slot(voffset);
          }
        }
        addFieldFloat32(voffset, value, defaultValue) {
          if (this.force_defaults || value != defaultValue) {
            this.addFloat32(value);
            this.slot(voffset);
          }
        }
        addFieldFloat64(voffset, value, defaultValue) {
          if (this.force_defaults || value != defaultValue) {
            this.addFloat64(value);
            this.slot(voffset);
          }
        }
        addFieldOffset(voffset, value, defaultValue) {
          if (this.force_defaults || value != defaultValue) {
            this.addOffset(value);
            this.slot(voffset);
          }
        }
        /**
         * Structs are stored inline, so nothing additional is being added. `d` is always 0.
         */
        addFieldStruct(voffset, value, defaultValue) {
          if (value != defaultValue) {
            this.nested(value);
            this.slot(voffset);
          }
        }
        /**
         * Structures are always stored inline, they need to be created right
         * where they're used.  You'll get this assertion failure if you
         * created it elsewhere.
         */
        nested(obj) {
          if (obj != this.offset()) {
            throw new TypeError("FlatBuffers: struct must be serialized inline.");
          }
        }
        /**
         * Should not be creating any other object, string or vector
         * while an object is being constructed
         */
        notNested() {
          if (this.isNested) {
            throw new TypeError("FlatBuffers: object serialization must not be nested.");
          }
        }
        /**
         * Set the current vtable at `voffset` to the current location in the buffer.
         */
        slot(voffset) {
          if (this.vtable !== null)
            this.vtable[voffset] = this.offset();
        }
        /**
         * @returns Offset relative to the end of the buffer.
         */
        offset() {
          return this.bb.capacity() - this.space;
        }
        /**
         * Doubles the size of the backing ByteBuffer and copies the old data towards
         * the end of the new buffer (since we build the buffer backwards).
         *
         * @param bb The current buffer with the existing data
         * @returns A new byte buffer with the old data copied
         * to it. The data is located at the end of the buffer.
         *
         * uint8Array.set() formally takes {Array<number>|ArrayBufferView}, so to pass
         * it a uint8Array we need to suppress the type check:
         * @suppress {checkTypes}
         */
        static growByteBuffer(bb) {
          const old_buf_size = bb.capacity();
          if (old_buf_size & 3221225472) {
            throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");
          }
          const new_buf_size = old_buf_size << 1;
          const nbb = ByteBuffer.allocate(new_buf_size);
          nbb.setPosition(new_buf_size - old_buf_size);
          nbb.bytes().set(bb.bytes(), new_buf_size - old_buf_size);
          return nbb;
        }
        /**
         * Adds on offset, relative to where it will be written.
         *
         * @param offset The offset to add.
         */
        addOffset(offset) {
          this.prep(SIZEOF_INT, 0);
          this.writeInt32(this.offset() - offset + SIZEOF_INT);
        }
        /**
         * Start encoding a new object in the buffer.  Users will not usually need to
         * call this directly. The FlatBuffers compiler will generate helper methods
         * that call this method internally.
         */
        startObject(numfields) {
          this.notNested();
          if (this.vtable == null) {
            this.vtable = [];
          }
          this.vtable_in_use = numfields;
          for (let i = 0; i < numfields; i++) {
            this.vtable[i] = 0;
          }
          this.isNested = true;
          this.object_start = this.offset();
        }
        /**
         * Finish off writing the object that is under construction.
         *
         * @returns The offset to the object inside `dataBuffer`
         */
        endObject() {
          if (this.vtable == null || !this.isNested) {
            throw new Error("FlatBuffers: endObject called without startObject");
          }
          this.addInt32(0);
          const vtableloc = this.offset();
          let i = this.vtable_in_use - 1;
          for (; i >= 0 && this.vtable[i] == 0; i--) {
          }
          const trimmed_size = i + 1;
          for (; i >= 0; i--) {
            this.addInt16(this.vtable[i] != 0 ? vtableloc - this.vtable[i] : 0);
          }
          const standard_fields = 2;
          this.addInt16(vtableloc - this.object_start);
          const len = (trimmed_size + standard_fields) * SIZEOF_SHORT;
          this.addInt16(len);
          let existing_vtable = 0;
          const vt1 = this.space;
          outer_loop: for (i = 0; i < this.vtables.length; i++) {
            const vt2 = this.bb.capacity() - this.vtables[i];
            if (len == this.bb.readInt16(vt2)) {
              for (let j = SIZEOF_SHORT; j < len; j += SIZEOF_SHORT) {
                if (this.bb.readInt16(vt1 + j) != this.bb.readInt16(vt2 + j)) {
                  continue outer_loop;
                }
              }
              existing_vtable = this.vtables[i];
              break;
            }
          }
          if (existing_vtable) {
            this.space = this.bb.capacity() - vtableloc;
            this.bb.writeInt32(this.space, existing_vtable - vtableloc);
          } else {
            this.vtables.push(this.offset());
            this.bb.writeInt32(this.bb.capacity() - vtableloc, this.offset() - vtableloc);
          }
          this.isNested = false;
          return vtableloc;
        }
        /**
         * Finalize a buffer, poiting to the given `root_table`.
         */
        finish(root_table, opt_file_identifier, opt_size_prefix) {
          const size_prefix = opt_size_prefix ? SIZE_PREFIX_LENGTH : 0;
          if (opt_file_identifier) {
            const file_identifier = opt_file_identifier;
            this.prep(this.minalign, SIZEOF_INT + FILE_IDENTIFIER_LENGTH + size_prefix);
            if (file_identifier.length != FILE_IDENTIFIER_LENGTH) {
              throw new TypeError("FlatBuffers: file identifier must be length " + FILE_IDENTIFIER_LENGTH);
            }
            for (let i = FILE_IDENTIFIER_LENGTH - 1; i >= 0; i--) {
              this.writeInt8(file_identifier.charCodeAt(i));
            }
          }
          this.prep(this.minalign, SIZEOF_INT + size_prefix);
          this.addOffset(root_table);
          if (size_prefix) {
            this.addInt32(this.bb.capacity() - this.space);
          }
          this.bb.setPosition(this.space);
        }
        /**
         * Finalize a size prefixed buffer, pointing to the given `root_table`.
         */
        finishSizePrefixed(root_table, opt_file_identifier) {
          this.finish(root_table, opt_file_identifier, true);
        }
        /**
         * This checks a required field has been set in a given table that has
         * just been constructed.
         */
        requiredField(table, field) {
          const table_start = this.bb.capacity() - table;
          const vtable_start = table_start - this.bb.readInt32(table_start);
          const ok = field < this.bb.readInt16(vtable_start) && this.bb.readInt16(vtable_start + field) != 0;
          if (!ok) {
            throw new TypeError("FlatBuffers: field " + field + " must be set");
          }
        }
        /**
         * Start a new array/vector of objects.  Users usually will not call
         * this directly. The FlatBuffers compiler will create a start/end
         * method for vector types in generated code.
         *
         * @param elem_size The size of each element in the array
         * @param num_elems The number of elements in the array
         * @param alignment The alignment of the array
         */
        startVector(elem_size, num_elems, alignment) {
          this.notNested();
          this.vector_num_elems = num_elems;
          this.prep(SIZEOF_INT, elem_size * num_elems);
          this.prep(alignment, elem_size * num_elems);
        }
        /**
         * Finish off the creation of an array and all its elements. The array must be
         * created with `startVector`.
         *
         * @returns The offset at which the newly created array
         * starts.
         */
        endVector() {
          this.writeInt32(this.vector_num_elems);
          return this.offset();
        }
        /**
         * Encode the string `s` in the buffer using UTF-8. If the string passed has
         * already been seen, we return the offset of the already written string
         *
         * @param s The string to encode
         * @return The offset in the buffer where the encoded string starts
         */
        createSharedString(s) {
          if (!s) {
            return 0;
          }
          if (!this.string_maps) {
            this.string_maps = /* @__PURE__ */ new Map();
          }
          if (this.string_maps.has(s)) {
            return this.string_maps.get(s);
          }
          const offset = this.createString(s);
          this.string_maps.set(s, offset);
          return offset;
        }
        /**
         * Encode the string `s` in the buffer using UTF-8. If a Uint8Array is passed
         * instead of a string, it is assumed to contain valid UTF-8 encoded data.
         *
         * @param s The string to encode
         * @return The offset in the buffer where the encoded string starts
         */
        createString(s) {
          if (s === null || s === void 0) {
            return 0;
          }
          let utf8;
          if (s instanceof Uint8Array) {
            utf8 = s;
          } else {
            utf8 = this.text_encoder.encode(s);
          }
          this.addInt8(0);
          this.startVector(1, utf8.length, 1);
          this.bb.setPosition(this.space -= utf8.length);
          this.bb.bytes().set(utf8, this.space);
          return this.endVector();
        }
        /**
         * Create a byte vector.
         *
         * @param v The bytes to add
         * @returns The offset in the buffer where the byte vector starts
         */
        createByteVector(v) {
          if (v === null || v === void 0) {
            return 0;
          }
          this.startVector(1, v.length, 1);
          this.bb.setPosition(this.space -= v.length);
          this.bb.bytes().set(v, this.space);
          return this.endVector();
        }
        /**
         * A helper function to pack an object
         *
         * @returns offset of obj
         */
        createObjectOffset(obj) {
          if (obj === null) {
            return 0;
          }
          if (typeof obj === "string") {
            return this.createString(obj);
          } else {
            return obj.pack(this);
          }
        }
        /**
         * A helper function to pack a list of object
         *
         * @returns list of offsets of each non null object
         */
        createObjectOffsetList(list) {
          const ret = [];
          for (let i = 0; i < list.length; ++i) {
            const val = list[i];
            if (val !== null) {
              ret.push(this.createObjectOffset(val));
            } else {
              throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.");
            }
          }
          return ret;
        }
        createStructOffsetList(list, startFunc) {
          startFunc(this, list.length);
          this.createObjectOffsetList(list.slice().reverse());
          return this.endVector();
        }
      };
    }
  });

  // node_modules/flatbuffers/mjs/flatbuffers.js
  var init_flatbuffers = __esm({
    "node_modules/flatbuffers/mjs/flatbuffers.js"() {
      init_constants();
      init_constants();
      init_constants();
      init_constants();
      init_utils();
      init_encoding();
      init_builder();
      init_byte_buffer();
    }
  });

  // node_modules/apache-arrow/fb/body-compression-method.mjs
  var BodyCompressionMethod;
  var init_body_compression_method = __esm({
    "node_modules/apache-arrow/fb/body-compression-method.mjs"() {
      (function(BodyCompressionMethod2) {
        BodyCompressionMethod2[BodyCompressionMethod2["BUFFER"] = 0] = "BUFFER";
      })(BodyCompressionMethod || (BodyCompressionMethod = {}));
    }
  });

  // node_modules/apache-arrow/fb/compression-type.mjs
  var CompressionType;
  var init_compression_type = __esm({
    "node_modules/apache-arrow/fb/compression-type.mjs"() {
      (function(CompressionType2) {
        CompressionType2[CompressionType2["LZ4_FRAME"] = 0] = "LZ4_FRAME";
        CompressionType2[CompressionType2["ZSTD"] = 1] = "ZSTD";
      })(CompressionType || (CompressionType = {}));
    }
  });

  // node_modules/apache-arrow/fb/body-compression.mjs
  var BodyCompression;
  var init_body_compression = __esm({
    "node_modules/apache-arrow/fb/body-compression.mjs"() {
      init_flatbuffers();
      init_body_compression_method();
      init_compression_type();
      BodyCompression = class _BodyCompression {
        constructor() {
          this.bb = null;
          this.bb_pos = 0;
        }
        __init(i, bb) {
          this.bb_pos = i;
          this.bb = bb;
          return this;
        }
        static getRootAsBodyCompression(bb, obj) {
          return (obj || new _BodyCompression()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static getSizePrefixedRootAsBodyCompression(bb, obj) {
          bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
          return (obj || new _BodyCompression()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        /**
         * Compressor library.
         * For LZ4_FRAME, each compressed buffer must consist of a single frame.
         */
        codec() {
          const offset = this.bb.__offset(this.bb_pos, 4);
          return offset ? this.bb.readInt8(this.bb_pos + offset) : CompressionType.LZ4_FRAME;
        }
        /**
         * Indicates the way the record batch body was compressed
         */
        method() {
          const offset = this.bb.__offset(this.bb_pos, 6);
          return offset ? this.bb.readInt8(this.bb_pos + offset) : BodyCompressionMethod.BUFFER;
        }
        static startBodyCompression(builder) {
          builder.startObject(2);
        }
        static addCodec(builder, codec) {
          builder.addFieldInt8(0, codec, CompressionType.LZ4_FRAME);
        }
        static addMethod(builder, method) {
          builder.addFieldInt8(1, method, BodyCompressionMethod.BUFFER);
        }
        static endBodyCompression(builder) {
          const offset = builder.endObject();
          return offset;
        }
        static createBodyCompression(builder, codec, method) {
          _BodyCompression.startBodyCompression(builder);
          _BodyCompression.addCodec(builder, codec);
          _BodyCompression.addMethod(builder, method);
          return _BodyCompression.endBodyCompression(builder);
        }
      };
    }
  });

  // node_modules/apache-arrow/fb/buffer.mjs
  var Buffer2;
  var init_buffer2 = __esm({
    "node_modules/apache-arrow/fb/buffer.mjs"() {
      Buffer2 = class {
        constructor() {
          this.bb = null;
          this.bb_pos = 0;
        }
        __init(i, bb) {
          this.bb_pos = i;
          this.bb = bb;
          return this;
        }
        /**
         * The relative offset into the shared memory page where the bytes for this
         * buffer starts
         */
        offset() {
          return this.bb.readInt64(this.bb_pos);
        }
        /**
         * The absolute length (in bytes) of the memory buffer. The memory is found
         * from offset (inclusive) to offset + length (non-inclusive). When building
         * messages using the encapsulated IPC message, padding bytes may be written
         * after a buffer, but such padding bytes do not need to be accounted for in
         * the size here.
         */
        length() {
          return this.bb.readInt64(this.bb_pos + 8);
        }
        static sizeOf() {
          return 16;
        }
        static createBuffer(builder, offset, length) {
          builder.prep(8, 16);
          builder.writeInt64(BigInt(length !== null && length !== void 0 ? length : 0));
          builder.writeInt64(BigInt(offset !== null && offset !== void 0 ? offset : 0));
          return builder.offset();
        }
      };
    }
  });

  // node_modules/apache-arrow/fb/field-node.mjs
  var FieldNode;
  var init_field_node = __esm({
    "node_modules/apache-arrow/fb/field-node.mjs"() {
      FieldNode = class {
        constructor() {
          this.bb = null;
          this.bb_pos = 0;
        }
        __init(i, bb) {
          this.bb_pos = i;
          this.bb = bb;
          return this;
        }
        /**
         * The number of value slots in the Arrow array at this level of a nested
         * tree
         */
        length() {
          return this.bb.readInt64(this.bb_pos);
        }
        /**
         * The number of observed nulls. Fields with null_count == 0 may choose not
         * to write their physical validity bitmap out as a materialized buffer,
         * instead setting the length of the bitmap buffer to 0.
         */
        nullCount() {
          return this.bb.readInt64(this.bb_pos + 8);
        }
        static sizeOf() {
          return 16;
        }
        static createFieldNode(builder, length, null_count) {
          builder.prep(8, 16);
          builder.writeInt64(BigInt(null_count !== null && null_count !== void 0 ? null_count : 0));
          builder.writeInt64(BigInt(length !== null && length !== void 0 ? length : 0));
          return builder.offset();
        }
      };
    }
  });

  // node_modules/apache-arrow/fb/record-batch.mjs
  var RecordBatch;
  var init_record_batch = __esm({
    "node_modules/apache-arrow/fb/record-batch.mjs"() {
      init_flatbuffers();
      init_body_compression();
      init_buffer2();
      init_field_node();
      RecordBatch = class _RecordBatch {
        constructor() {
          this.bb = null;
          this.bb_pos = 0;
        }
        __init(i, bb) {
          this.bb_pos = i;
          this.bb = bb;
          return this;
        }
        static getRootAsRecordBatch(bb, obj) {
          return (obj || new _RecordBatch()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static getSizePrefixedRootAsRecordBatch(bb, obj) {
          bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
          return (obj || new _RecordBatch()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        /**
         * number of records / rows. The arrays in the batch should all have this
         * length
         */
        length() {
          const offset = this.bb.__offset(this.bb_pos, 4);
          return offset ? this.bb.readInt64(this.bb_pos + offset) : BigInt("0");
        }
        /**
         * Nodes correspond to the pre-ordered flattened logical schema
         */
        nodes(index, obj) {
          const offset = this.bb.__offset(this.bb_pos, 6);
          return offset ? (obj || new FieldNode()).__init(this.bb.__vector(this.bb_pos + offset) + index * 16, this.bb) : null;
        }
        nodesLength() {
          const offset = this.bb.__offset(this.bb_pos, 6);
          return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
        }
        /**
         * Buffers correspond to the pre-ordered flattened buffer tree
         *
         * The number of buffers appended to this list depends on the schema. For
         * example, most primitive arrays will have 2 buffers, 1 for the validity
         * bitmap and 1 for the values. For struct arrays, there will only be a
         * single buffer for the validity (nulls) bitmap
         */
        buffers(index, obj) {
          const offset = this.bb.__offset(this.bb_pos, 8);
          return offset ? (obj || new Buffer2()).__init(this.bb.__vector(this.bb_pos + offset) + index * 16, this.bb) : null;
        }
        buffersLength() {
          const offset = this.bb.__offset(this.bb_pos, 8);
          return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
        }
        /**
         * Optional compression of the message body
         */
        compression(obj) {
          const offset = this.bb.__offset(this.bb_pos, 10);
          return offset ? (obj || new BodyCompression()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
        }
        static startRecordBatch(builder) {
          builder.startObject(4);
        }
        static addLength(builder, length) {
          builder.addFieldInt64(0, length, BigInt("0"));
        }
        static addNodes(builder, nodesOffset) {
          builder.addFieldOffset(1, nodesOffset, 0);
        }
        static startNodesVector(builder, numElems) {
          builder.startVector(16, numElems, 8);
        }
        static addBuffers(builder, buffersOffset) {
          builder.addFieldOffset(2, buffersOffset, 0);
        }
        static startBuffersVector(builder, numElems) {
          builder.startVector(16, numElems, 8);
        }
        static addCompression(builder, compressionOffset) {
          builder.addFieldOffset(3, compressionOffset, 0);
        }
        static endRecordBatch(builder) {
          const offset = builder.endObject();
          return offset;
        }
      };
    }
  });

  // node_modules/apache-arrow/fb/dictionary-batch.mjs
  var DictionaryBatch;
  var init_dictionary_batch = __esm({
    "node_modules/apache-arrow/fb/dictionary-batch.mjs"() {
      init_flatbuffers();
      init_record_batch();
      DictionaryBatch = class _DictionaryBatch {
        constructor() {
          this.bb = null;
          this.bb_pos = 0;
        }
        __init(i, bb) {
          this.bb_pos = i;
          this.bb = bb;
          return this;
        }
        static getRootAsDictionaryBatch(bb, obj) {
          return (obj || new _DictionaryBatch()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static getSizePrefixedRootAsDictionaryBatch(bb, obj) {
          bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
          return (obj || new _DictionaryBatch()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        id() {
          const offset = this.bb.__offset(this.bb_pos, 4);
          return offset ? this.bb.readInt64(this.bb_pos + offset) : BigInt("0");
        }
        data(obj) {
          const offset = this.bb.__offset(this.bb_pos, 6);
          return offset ? (obj || new RecordBatch()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
        }
        /**
         * If isDelta is true the values in the dictionary are to be appended to a
         * dictionary with the indicated id. If isDelta is false this dictionary
         * should replace the existing dictionary.
         */
        isDelta() {
          const offset = this.bb.__offset(this.bb_pos, 8);
          return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
        }
        static startDictionaryBatch(builder) {
          builder.startObject(3);
        }
        static addId(builder, id) {
          builder.addFieldInt64(0, id, BigInt("0"));
        }
        static addData(builder, dataOffset) {
          builder.addFieldOffset(1, dataOffset, 0);
        }
        static addIsDelta(builder, isDelta) {
          builder.addFieldInt8(2, +isDelta, 0);
        }
        static endDictionaryBatch(builder) {
          const offset = builder.endObject();
          return offset;
        }
      };
    }
  });

  // node_modules/apache-arrow/fb/endianness.mjs
  var Endianness;
  var init_endianness = __esm({
    "node_modules/apache-arrow/fb/endianness.mjs"() {
      (function(Endianness2) {
        Endianness2[Endianness2["Little"] = 0] = "Little";
        Endianness2[Endianness2["Big"] = 1] = "Big";
      })(Endianness || (Endianness = {}));
    }
  });

  // node_modules/apache-arrow/fb/dictionary-kind.mjs
  var DictionaryKind;
  var init_dictionary_kind = __esm({
    "node_modules/apache-arrow/fb/dictionary-kind.mjs"() {
      (function(DictionaryKind2) {
        DictionaryKind2[DictionaryKind2["DenseArray"] = 0] = "DenseArray";
      })(DictionaryKind || (DictionaryKind = {}));
    }
  });

  // node_modules/apache-arrow/fb/int.mjs
  var Int;
  var init_int = __esm({
    "node_modules/apache-arrow/fb/int.mjs"() {
      init_flatbuffers();
      Int = class _Int {
        constructor() {
          this.bb = null;
          this.bb_pos = 0;
        }
        __init(i, bb) {
          this.bb_pos = i;
          this.bb = bb;
          return this;
        }
        static getRootAsInt(bb, obj) {
          return (obj || new _Int()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static getSizePrefixedRootAsInt(bb, obj) {
          bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
          return (obj || new _Int()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        bitWidth() {
          const offset = this.bb.__offset(this.bb_pos, 4);
          return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
        }
        isSigned() {
          const offset = this.bb.__offset(this.bb_pos, 6);
          return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
        }
        static startInt(builder) {
          builder.startObject(2);
        }
        static addBitWidth(builder, bitWidth) {
          builder.addFieldInt32(0, bitWidth, 0);
        }
        static addIsSigned(builder, isSigned) {
          builder.addFieldInt8(1, +isSigned, 0);
        }
        static endInt(builder) {
          const offset = builder.endObject();
          return offset;
        }
        static createInt(builder, bitWidth, isSigned) {
          _Int.startInt(builder);
          _Int.addBitWidth(builder, bitWidth);
          _Int.addIsSigned(builder, isSigned);
          return _Int.endInt(builder);
        }
      };
    }
  });

  // node_modules/apache-arrow/fb/dictionary-encoding.mjs
  var DictionaryEncoding;
  var init_dictionary_encoding = __esm({
    "node_modules/apache-arrow/fb/dictionary-encoding.mjs"() {
      init_flatbuffers();
      init_dictionary_kind();
      init_int();
      DictionaryEncoding = class _DictionaryEncoding {
        constructor() {
          this.bb = null;
          this.bb_pos = 0;
        }
        __init(i, bb) {
          this.bb_pos = i;
          this.bb = bb;
          return this;
        }
        static getRootAsDictionaryEncoding(bb, obj) {
          return (obj || new _DictionaryEncoding()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static getSizePrefixedRootAsDictionaryEncoding(bb, obj) {
          bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
          return (obj || new _DictionaryEncoding()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        /**
         * The known dictionary id in the application where this data is used. In
         * the file or streaming formats, the dictionary ids are found in the
         * DictionaryBatch messages
         */
        id() {
          const offset = this.bb.__offset(this.bb_pos, 4);
          return offset ? this.bb.readInt64(this.bb_pos + offset) : BigInt("0");
        }
        /**
         * The dictionary indices are constrained to be non-negative integers. If
         * this field is null, the indices must be signed int32. To maximize
         * cross-language compatibility and performance, implementations are
         * recommended to prefer signed integer types over unsigned integer types
         * and to avoid uint64 indices unless they are required by an application.
         */
        indexType(obj) {
          const offset = this.bb.__offset(this.bb_pos, 6);
          return offset ? (obj || new Int()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
        }
        /**
         * By default, dictionaries are not ordered, or the order does not have
         * semantic meaning. In some statistical, applications, dictionary-encoding
         * is used to represent ordered categorical data, and we provide a way to
         * preserve that metadata here
         */
        isOrdered() {
          const offset = this.bb.__offset(this.bb_pos, 8);
          return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
        }
        dictionaryKind() {
          const offset = this.bb.__offset(this.bb_pos, 10);
          return offset ? this.bb.readInt16(this.bb_pos + offset) : DictionaryKind.DenseArray;
        }
        static startDictionaryEncoding(builder) {
          builder.startObject(4);
        }
        static addId(builder, id) {
          builder.addFieldInt64(0, id, BigInt("0"));
        }
        static addIndexType(builder, indexTypeOffset) {
          builder.addFieldOffset(1, indexTypeOffset, 0);
        }
        static addIsOrdered(builder, isOrdered) {
          builder.addFieldInt8(2, +isOrdered, 0);
        }
        static addDictionaryKind(builder, dictionaryKind) {
          builder.addFieldInt16(3, dictionaryKind, DictionaryKind.DenseArray);
        }
        static endDictionaryEncoding(builder) {
          const offset = builder.endObject();
          return offset;
        }
      };
    }
  });

  // node_modules/apache-arrow/fb/key-value.mjs
  var KeyValue;
  var init_key_value = __esm({
    "node_modules/apache-arrow/fb/key-value.mjs"() {
      init_flatbuffers();
      KeyValue = class _KeyValue {
        constructor() {
          this.bb = null;
          this.bb_pos = 0;
        }
        __init(i, bb) {
          this.bb_pos = i;
          this.bb = bb;
          return this;
        }
        static getRootAsKeyValue(bb, obj) {
          return (obj || new _KeyValue()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static getSizePrefixedRootAsKeyValue(bb, obj) {
          bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
          return (obj || new _KeyValue()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        key(optionalEncoding) {
          const offset = this.bb.__offset(this.bb_pos, 4);
          return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
        }
        value(optionalEncoding) {
          const offset = this.bb.__offset(this.bb_pos, 6);
          return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
        }
        static startKeyValue(builder) {
          builder.startObject(2);
        }
        static addKey(builder, keyOffset) {
          builder.addFieldOffset(0, keyOffset, 0);
        }
        static addValue(builder, valueOffset) {
          builder.addFieldOffset(1, valueOffset, 0);
        }
        static endKeyValue(builder) {
          const offset = builder.endObject();
          return offset;
        }
        static createKeyValue(builder, keyOffset, valueOffset) {
          _KeyValue.startKeyValue(builder);
          _KeyValue.addKey(builder, keyOffset);
          _KeyValue.addValue(builder, valueOffset);
          return _KeyValue.endKeyValue(builder);
        }
      };
    }
  });

  // node_modules/apache-arrow/fb/binary.mjs
  var Binary;
  var init_binary = __esm({
    "node_modules/apache-arrow/fb/binary.mjs"() {
      init_flatbuffers();
      Binary = class _Binary {
        constructor() {
          this.bb = null;
          this.bb_pos = 0;
        }
        __init(i, bb) {
          this.bb_pos = i;
          this.bb = bb;
          return this;
        }
        static getRootAsBinary(bb, obj) {
          return (obj || new _Binary()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static getSizePrefixedRootAsBinary(bb, obj) {
          bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
          return (obj || new _Binary()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static startBinary(builder) {
          builder.startObject(0);
        }
        static endBinary(builder) {
          const offset = builder.endObject();
          return offset;
        }
        static createBinary(builder) {
          _Binary.startBinary(builder);
          return _Binary.endBinary(builder);
        }
      };
    }
  });

  // node_modules/apache-arrow/fb/bool.mjs
  var Bool;
  var init_bool = __esm({
    "node_modules/apache-arrow/fb/bool.mjs"() {
      init_flatbuffers();
      Bool = class _Bool {
        constructor() {
          this.bb = null;
          this.bb_pos = 0;
        }
        __init(i, bb) {
          this.bb_pos = i;
          this.bb = bb;
          return this;
        }
        static getRootAsBool(bb, obj) {
          return (obj || new _Bool()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static getSizePrefixedRootAsBool(bb, obj) {
          bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
          return (obj || new _Bool()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static startBool(builder) {
          builder.startObject(0);
        }
        static endBool(builder) {
          const offset = builder.endObject();
          return offset;
        }
        static createBool(builder) {
          _Bool.startBool(builder);
          return _Bool.endBool(builder);
        }
      };
    }
  });

  // node_modules/apache-arrow/fb/date.mjs
  var Date2;
  var init_date = __esm({
    "node_modules/apache-arrow/fb/date.mjs"() {
      init_flatbuffers();
      init_date_unit();
      Date2 = class _Date {
        constructor() {
          this.bb = null;
          this.bb_pos = 0;
        }
        __init(i, bb) {
          this.bb_pos = i;
          this.bb = bb;
          return this;
        }
        static getRootAsDate(bb, obj) {
          return (obj || new _Date()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static getSizePrefixedRootAsDate(bb, obj) {
          bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
          return (obj || new _Date()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        unit() {
          const offset = this.bb.__offset(this.bb_pos, 4);
          return offset ? this.bb.readInt16(this.bb_pos + offset) : DateUnit.MILLISECOND;
        }
        static startDate(builder) {
          builder.startObject(1);
        }
        static addUnit(builder, unit) {
          builder.addFieldInt16(0, unit, DateUnit.MILLISECOND);
        }
        static endDate(builder) {
          const offset = builder.endObject();
          return offset;
        }
        static createDate(builder, unit) {
          _Date.startDate(builder);
          _Date.addUnit(builder, unit);
          return _Date.endDate(builder);
        }
      };
    }
  });

  // node_modules/apache-arrow/fb/decimal.mjs
  var Decimal;
  var init_decimal = __esm({
    "node_modules/apache-arrow/fb/decimal.mjs"() {
      init_flatbuffers();
      Decimal = class _Decimal {
        constructor() {
          this.bb = null;
          this.bb_pos = 0;
        }
        __init(i, bb) {
          this.bb_pos = i;
          this.bb = bb;
          return this;
        }
        static getRootAsDecimal(bb, obj) {
          return (obj || new _Decimal()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static getSizePrefixedRootAsDecimal(bb, obj) {
          bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
          return (obj || new _Decimal()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        /**
         * Total number of decimal digits
         */
        precision() {
          const offset = this.bb.__offset(this.bb_pos, 4);
          return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
        }
        /**
         * Number of digits after the decimal point "."
         */
        scale() {
          const offset = this.bb.__offset(this.bb_pos, 6);
          return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
        }
        /**
         * Number of bits per value. The only accepted widths are 128 and 256.
         * We use bitWidth for consistency with Int::bitWidth.
         */
        bitWidth() {
          const offset = this.bb.__offset(this.bb_pos, 8);
          return offset ? this.bb.readInt32(this.bb_pos + offset) : 128;
        }
        static startDecimal(builder) {
          builder.startObject(3);
        }
        static addPrecision(builder, precision) {
          builder.addFieldInt32(0, precision, 0);
        }
        static addScale(builder, scale) {
          builder.addFieldInt32(1, scale, 0);
        }
        static addBitWidth(builder, bitWidth) {
          builder.addFieldInt32(2, bitWidth, 128);
        }
        static endDecimal(builder) {
          const offset = builder.endObject();
          return offset;
        }
        static createDecimal(builder, precision, scale, bitWidth) {
          _Decimal.startDecimal(builder);
          _Decimal.addPrecision(builder, precision);
          _Decimal.addScale(builder, scale);
          _Decimal.addBitWidth(builder, bitWidth);
          return _Decimal.endDecimal(builder);
        }
      };
    }
  });

  // node_modules/apache-arrow/fb/duration.mjs
  var Duration;
  var init_duration = __esm({
    "node_modules/apache-arrow/fb/duration.mjs"() {
      init_flatbuffers();
      init_time_unit();
      Duration = class _Duration {
        constructor() {
          this.bb = null;
          this.bb_pos = 0;
        }
        __init(i, bb) {
          this.bb_pos = i;
          this.bb = bb;
          return this;
        }
        static getRootAsDuration(bb, obj) {
          return (obj || new _Duration()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static getSizePrefixedRootAsDuration(bb, obj) {
          bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
          return (obj || new _Duration()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        unit() {
          const offset = this.bb.__offset(this.bb_pos, 4);
          return offset ? this.bb.readInt16(this.bb_pos + offset) : TimeUnit.MILLISECOND;
        }
        static startDuration(builder) {
          builder.startObject(1);
        }
        static addUnit(builder, unit) {
          builder.addFieldInt16(0, unit, TimeUnit.MILLISECOND);
        }
        static endDuration(builder) {
          const offset = builder.endObject();
          return offset;
        }
        static createDuration(builder, unit) {
          _Duration.startDuration(builder);
          _Duration.addUnit(builder, unit);
          return _Duration.endDuration(builder);
        }
      };
    }
  });

  // node_modules/apache-arrow/fb/fixed-size-binary.mjs
  var FixedSizeBinary;
  var init_fixed_size_binary = __esm({
    "node_modules/apache-arrow/fb/fixed-size-binary.mjs"() {
      init_flatbuffers();
      FixedSizeBinary = class _FixedSizeBinary {
        constructor() {
          this.bb = null;
          this.bb_pos = 0;
        }
        __init(i, bb) {
          this.bb_pos = i;
          this.bb = bb;
          return this;
        }
        static getRootAsFixedSizeBinary(bb, obj) {
          return (obj || new _FixedSizeBinary()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static getSizePrefixedRootAsFixedSizeBinary(bb, obj) {
          bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
          return (obj || new _FixedSizeBinary()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        /**
         * Number of bytes per value
         */
        byteWidth() {
          const offset = this.bb.__offset(this.bb_pos, 4);
          return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
        }
        static startFixedSizeBinary(builder) {
          builder.startObject(1);
        }
        static addByteWidth(builder, byteWidth) {
          builder.addFieldInt32(0, byteWidth, 0);
        }
        static endFixedSizeBinary(builder) {
          const offset = builder.endObject();
          return offset;
        }
        static createFixedSizeBinary(builder, byteWidth) {
          _FixedSizeBinary.startFixedSizeBinary(builder);
          _FixedSizeBinary.addByteWidth(builder, byteWidth);
          return _FixedSizeBinary.endFixedSizeBinary(builder);
        }
      };
    }
  });

  // node_modules/apache-arrow/fb/fixed-size-list.mjs
  var FixedSizeList;
  var init_fixed_size_list = __esm({
    "node_modules/apache-arrow/fb/fixed-size-list.mjs"() {
      init_flatbuffers();
      FixedSizeList = class _FixedSizeList {
        constructor() {
          this.bb = null;
          this.bb_pos = 0;
        }
        __init(i, bb) {
          this.bb_pos = i;
          this.bb = bb;
          return this;
        }
        static getRootAsFixedSizeList(bb, obj) {
          return (obj || new _FixedSizeList()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static getSizePrefixedRootAsFixedSizeList(bb, obj) {
          bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
          return (obj || new _FixedSizeList()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        /**
         * Number of list items per value
         */
        listSize() {
          const offset = this.bb.__offset(this.bb_pos, 4);
          return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
        }
        static startFixedSizeList(builder) {
          builder.startObject(1);
        }
        static addListSize(builder, listSize) {
          builder.addFieldInt32(0, listSize, 0);
        }
        static endFixedSizeList(builder) {
          const offset = builder.endObject();
          return offset;
        }
        static createFixedSizeList(builder, listSize) {
          _FixedSizeList.startFixedSizeList(builder);
          _FixedSizeList.addListSize(builder, listSize);
          return _FixedSizeList.endFixedSizeList(builder);
        }
      };
    }
  });

  // node_modules/apache-arrow/fb/floating-point.mjs
  var FloatingPoint;
  var init_floating_point = __esm({
    "node_modules/apache-arrow/fb/floating-point.mjs"() {
      init_flatbuffers();
      init_precision();
      FloatingPoint = class _FloatingPoint {
        constructor() {
          this.bb = null;
          this.bb_pos = 0;
        }
        __init(i, bb) {
          this.bb_pos = i;
          this.bb = bb;
          return this;
        }
        static getRootAsFloatingPoint(bb, obj) {
          return (obj || new _FloatingPoint()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static getSizePrefixedRootAsFloatingPoint(bb, obj) {
          bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
          return (obj || new _FloatingPoint()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        precision() {
          const offset = this.bb.__offset(this.bb_pos, 4);
          return offset ? this.bb.readInt16(this.bb_pos + offset) : Precision.HALF;
        }
        static startFloatingPoint(builder) {
          builder.startObject(1);
        }
        static addPrecision(builder, precision) {
          builder.addFieldInt16(0, precision, Precision.HALF);
        }
        static endFloatingPoint(builder) {
          const offset = builder.endObject();
          return offset;
        }
        static createFloatingPoint(builder, precision) {
          _FloatingPoint.startFloatingPoint(builder);
          _FloatingPoint.addPrecision(builder, precision);
          return _FloatingPoint.endFloatingPoint(builder);
        }
      };
    }
  });

  // node_modules/apache-arrow/fb/interval.mjs
  var Interval;
  var init_interval = __esm({
    "node_modules/apache-arrow/fb/interval.mjs"() {
      init_flatbuffers();
      init_interval_unit();
      Interval = class _Interval {
        constructor() {
          this.bb = null;
          this.bb_pos = 0;
        }
        __init(i, bb) {
          this.bb_pos = i;
          this.bb = bb;
          return this;
        }
        static getRootAsInterval(bb, obj) {
          return (obj || new _Interval()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static getSizePrefixedRootAsInterval(bb, obj) {
          bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
          return (obj || new _Interval()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        unit() {
          const offset = this.bb.__offset(this.bb_pos, 4);
          return offset ? this.bb.readInt16(this.bb_pos + offset) : IntervalUnit.YEAR_MONTH;
        }
        static startInterval(builder) {
          builder.startObject(1);
        }
        static addUnit(builder, unit) {
          builder.addFieldInt16(0, unit, IntervalUnit.YEAR_MONTH);
        }
        static endInterval(builder) {
          const offset = builder.endObject();
          return offset;
        }
        static createInterval(builder, unit) {
          _Interval.startInterval(builder);
          _Interval.addUnit(builder, unit);
          return _Interval.endInterval(builder);
        }
      };
    }
  });

  // node_modules/apache-arrow/fb/large-binary.mjs
  var LargeBinary;
  var init_large_binary = __esm({
    "node_modules/apache-arrow/fb/large-binary.mjs"() {
      init_flatbuffers();
      LargeBinary = class _LargeBinary {
        constructor() {
          this.bb = null;
          this.bb_pos = 0;
        }
        __init(i, bb) {
          this.bb_pos = i;
          this.bb = bb;
          return this;
        }
        static getRootAsLargeBinary(bb, obj) {
          return (obj || new _LargeBinary()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static getSizePrefixedRootAsLargeBinary(bb, obj) {
          bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
          return (obj || new _LargeBinary()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static startLargeBinary(builder) {
          builder.startObject(0);
        }
        static endLargeBinary(builder) {
          const offset = builder.endObject();
          return offset;
        }
        static createLargeBinary(builder) {
          _LargeBinary.startLargeBinary(builder);
          return _LargeBinary.endLargeBinary(builder);
        }
      };
    }
  });

  // node_modules/apache-arrow/fb/large-utf8.mjs
  var LargeUtf8;
  var init_large_utf8 = __esm({
    "node_modules/apache-arrow/fb/large-utf8.mjs"() {
      init_flatbuffers();
      LargeUtf8 = class _LargeUtf8 {
        constructor() {
          this.bb = null;
          this.bb_pos = 0;
        }
        __init(i, bb) {
          this.bb_pos = i;
          this.bb = bb;
          return this;
        }
        static getRootAsLargeUtf8(bb, obj) {
          return (obj || new _LargeUtf8()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static getSizePrefixedRootAsLargeUtf8(bb, obj) {
          bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
          return (obj || new _LargeUtf8()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static startLargeUtf8(builder) {
          builder.startObject(0);
        }
        static endLargeUtf8(builder) {
          const offset = builder.endObject();
          return offset;
        }
        static createLargeUtf8(builder) {
          _LargeUtf8.startLargeUtf8(builder);
          return _LargeUtf8.endLargeUtf8(builder);
        }
      };
    }
  });

  // node_modules/apache-arrow/fb/list.mjs
  var List;
  var init_list = __esm({
    "node_modules/apache-arrow/fb/list.mjs"() {
      init_flatbuffers();
      List = class _List {
        constructor() {
          this.bb = null;
          this.bb_pos = 0;
        }
        __init(i, bb) {
          this.bb_pos = i;
          this.bb = bb;
          return this;
        }
        static getRootAsList(bb, obj) {
          return (obj || new _List()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static getSizePrefixedRootAsList(bb, obj) {
          bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
          return (obj || new _List()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static startList(builder) {
          builder.startObject(0);
        }
        static endList(builder) {
          const offset = builder.endObject();
          return offset;
        }
        static createList(builder) {
          _List.startList(builder);
          return _List.endList(builder);
        }
      };
    }
  });

  // node_modules/apache-arrow/fb/map.mjs
  var Map2;
  var init_map = __esm({
    "node_modules/apache-arrow/fb/map.mjs"() {
      init_flatbuffers();
      Map2 = class _Map {
        constructor() {
          this.bb = null;
          this.bb_pos = 0;
        }
        __init(i, bb) {
          this.bb_pos = i;
          this.bb = bb;
          return this;
        }
        static getRootAsMap(bb, obj) {
          return (obj || new _Map()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static getSizePrefixedRootAsMap(bb, obj) {
          bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
          return (obj || new _Map()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        /**
         * Set to true if the keys within each value are sorted
         */
        keysSorted() {
          const offset = this.bb.__offset(this.bb_pos, 4);
          return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
        }
        static startMap(builder) {
          builder.startObject(1);
        }
        static addKeysSorted(builder, keysSorted) {
          builder.addFieldInt8(0, +keysSorted, 0);
        }
        static endMap(builder) {
          const offset = builder.endObject();
          return offset;
        }
        static createMap(builder, keysSorted) {
          _Map.startMap(builder);
          _Map.addKeysSorted(builder, keysSorted);
          return _Map.endMap(builder);
        }
      };
    }
  });

  // node_modules/apache-arrow/fb/null.mjs
  var Null;
  var init_null = __esm({
    "node_modules/apache-arrow/fb/null.mjs"() {
      init_flatbuffers();
      Null = class _Null {
        constructor() {
          this.bb = null;
          this.bb_pos = 0;
        }
        __init(i, bb) {
          this.bb_pos = i;
          this.bb = bb;
          return this;
        }
        static getRootAsNull(bb, obj) {
          return (obj || new _Null()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static getSizePrefixedRootAsNull(bb, obj) {
          bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
          return (obj || new _Null()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static startNull(builder) {
          builder.startObject(0);
        }
        static endNull(builder) {
          const offset = builder.endObject();
          return offset;
        }
        static createNull(builder) {
          _Null.startNull(builder);
          return _Null.endNull(builder);
        }
      };
    }
  });

  // node_modules/apache-arrow/fb/struct-.mjs
  var Struct_;
  var init_struct = __esm({
    "node_modules/apache-arrow/fb/struct-.mjs"() {
      init_flatbuffers();
      Struct_ = class _Struct_ {
        constructor() {
          this.bb = null;
          this.bb_pos = 0;
        }
        __init(i, bb) {
          this.bb_pos = i;
          this.bb = bb;
          return this;
        }
        static getRootAsStruct_(bb, obj) {
          return (obj || new _Struct_()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static getSizePrefixedRootAsStruct_(bb, obj) {
          bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
          return (obj || new _Struct_()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static startStruct_(builder) {
          builder.startObject(0);
        }
        static endStruct_(builder) {
          const offset = builder.endObject();
          return offset;
        }
        static createStruct_(builder) {
          _Struct_.startStruct_(builder);
          return _Struct_.endStruct_(builder);
        }
      };
    }
  });

  // node_modules/apache-arrow/fb/time.mjs
  var Time;
  var init_time = __esm({
    "node_modules/apache-arrow/fb/time.mjs"() {
      init_flatbuffers();
      init_time_unit();
      Time = class _Time {
        constructor() {
          this.bb = null;
          this.bb_pos = 0;
        }
        __init(i, bb) {
          this.bb_pos = i;
          this.bb = bb;
          return this;
        }
        static getRootAsTime(bb, obj) {
          return (obj || new _Time()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static getSizePrefixedRootAsTime(bb, obj) {
          bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
          return (obj || new _Time()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        unit() {
          const offset = this.bb.__offset(this.bb_pos, 4);
          return offset ? this.bb.readInt16(this.bb_pos + offset) : TimeUnit.MILLISECOND;
        }
        bitWidth() {
          const offset = this.bb.__offset(this.bb_pos, 6);
          return offset ? this.bb.readInt32(this.bb_pos + offset) : 32;
        }
        static startTime(builder) {
          builder.startObject(2);
        }
        static addUnit(builder, unit) {
          builder.addFieldInt16(0, unit, TimeUnit.MILLISECOND);
        }
        static addBitWidth(builder, bitWidth) {
          builder.addFieldInt32(1, bitWidth, 32);
        }
        static endTime(builder) {
          const offset = builder.endObject();
          return offset;
        }
        static createTime(builder, unit, bitWidth) {
          _Time.startTime(builder);
          _Time.addUnit(builder, unit);
          _Time.addBitWidth(builder, bitWidth);
          return _Time.endTime(builder);
        }
      };
    }
  });

  // node_modules/apache-arrow/fb/timestamp.mjs
  var Timestamp;
  var init_timestamp = __esm({
    "node_modules/apache-arrow/fb/timestamp.mjs"() {
      init_flatbuffers();
      init_time_unit();
      Timestamp = class _Timestamp {
        constructor() {
          this.bb = null;
          this.bb_pos = 0;
        }
        __init(i, bb) {
          this.bb_pos = i;
          this.bb = bb;
          return this;
        }
        static getRootAsTimestamp(bb, obj) {
          return (obj || new _Timestamp()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static getSizePrefixedRootAsTimestamp(bb, obj) {
          bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
          return (obj || new _Timestamp()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        unit() {
          const offset = this.bb.__offset(this.bb_pos, 4);
          return offset ? this.bb.readInt16(this.bb_pos + offset) : TimeUnit.SECOND;
        }
        timezone(optionalEncoding) {
          const offset = this.bb.__offset(this.bb_pos, 6);
          return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
        }
        static startTimestamp(builder) {
          builder.startObject(2);
        }
        static addUnit(builder, unit) {
          builder.addFieldInt16(0, unit, TimeUnit.SECOND);
        }
        static addTimezone(builder, timezoneOffset) {
          builder.addFieldOffset(1, timezoneOffset, 0);
        }
        static endTimestamp(builder) {
          const offset = builder.endObject();
          return offset;
        }
        static createTimestamp(builder, unit, timezoneOffset) {
          _Timestamp.startTimestamp(builder);
          _Timestamp.addUnit(builder, unit);
          _Timestamp.addTimezone(builder, timezoneOffset);
          return _Timestamp.endTimestamp(builder);
        }
      };
    }
  });

  // node_modules/apache-arrow/fb/union.mjs
  var Union;
  var init_union = __esm({
    "node_modules/apache-arrow/fb/union.mjs"() {
      init_flatbuffers();
      init_union_mode();
      Union = class _Union {
        constructor() {
          this.bb = null;
          this.bb_pos = 0;
        }
        __init(i, bb) {
          this.bb_pos = i;
          this.bb = bb;
          return this;
        }
        static getRootAsUnion(bb, obj) {
          return (obj || new _Union()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static getSizePrefixedRootAsUnion(bb, obj) {
          bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
          return (obj || new _Union()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        mode() {
          const offset = this.bb.__offset(this.bb_pos, 4);
          return offset ? this.bb.readInt16(this.bb_pos + offset) : UnionMode.Sparse;
        }
        typeIds(index) {
          const offset = this.bb.__offset(this.bb_pos, 6);
          return offset ? this.bb.readInt32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0;
        }
        typeIdsLength() {
          const offset = this.bb.__offset(this.bb_pos, 6);
          return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
        }
        typeIdsArray() {
          const offset = this.bb.__offset(this.bb_pos, 6);
          return offset ? new Int32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
        }
        static startUnion(builder) {
          builder.startObject(2);
        }
        static addMode(builder, mode) {
          builder.addFieldInt16(0, mode, UnionMode.Sparse);
        }
        static addTypeIds(builder, typeIdsOffset) {
          builder.addFieldOffset(1, typeIdsOffset, 0);
        }
        static createTypeIdsVector(builder, data) {
          builder.startVector(4, data.length, 4);
          for (let i = data.length - 1; i >= 0; i--) {
            builder.addInt32(data[i]);
          }
          return builder.endVector();
        }
        static startTypeIdsVector(builder, numElems) {
          builder.startVector(4, numElems, 4);
        }
        static endUnion(builder) {
          const offset = builder.endObject();
          return offset;
        }
        static createUnion(builder, mode, typeIdsOffset) {
          _Union.startUnion(builder);
          _Union.addMode(builder, mode);
          _Union.addTypeIds(builder, typeIdsOffset);
          return _Union.endUnion(builder);
        }
      };
    }
  });

  // node_modules/apache-arrow/fb/utf8.mjs
  var Utf8;
  var init_utf82 = __esm({
    "node_modules/apache-arrow/fb/utf8.mjs"() {
      init_flatbuffers();
      Utf8 = class _Utf8 {
        constructor() {
          this.bb = null;
          this.bb_pos = 0;
        }
        __init(i, bb) {
          this.bb_pos = i;
          this.bb = bb;
          return this;
        }
        static getRootAsUtf8(bb, obj) {
          return (obj || new _Utf8()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static getSizePrefixedRootAsUtf8(bb, obj) {
          bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
          return (obj || new _Utf8()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static startUtf8(builder) {
          builder.startObject(0);
        }
        static endUtf8(builder) {
          const offset = builder.endObject();
          return offset;
        }
        static createUtf8(builder) {
          _Utf8.startUtf8(builder);
          return _Utf8.endUtf8(builder);
        }
      };
    }
  });

  // node_modules/apache-arrow/fb/type.mjs
  var Type;
  var init_type = __esm({
    "node_modules/apache-arrow/fb/type.mjs"() {
      (function(Type3) {
        Type3[Type3["NONE"] = 0] = "NONE";
        Type3[Type3["Null"] = 1] = "Null";
        Type3[Type3["Int"] = 2] = "Int";
        Type3[Type3["FloatingPoint"] = 3] = "FloatingPoint";
        Type3[Type3["Binary"] = 4] = "Binary";
        Type3[Type3["Utf8"] = 5] = "Utf8";
        Type3[Type3["Bool"] = 6] = "Bool";
        Type3[Type3["Decimal"] = 7] = "Decimal";
        Type3[Type3["Date"] = 8] = "Date";
        Type3[Type3["Time"] = 9] = "Time";
        Type3[Type3["Timestamp"] = 10] = "Timestamp";
        Type3[Type3["Interval"] = 11] = "Interval";
        Type3[Type3["List"] = 12] = "List";
        Type3[Type3["Struct_"] = 13] = "Struct_";
        Type3[Type3["Union"] = 14] = "Union";
        Type3[Type3["FixedSizeBinary"] = 15] = "FixedSizeBinary";
        Type3[Type3["FixedSizeList"] = 16] = "FixedSizeList";
        Type3[Type3["Map"] = 17] = "Map";
        Type3[Type3["Duration"] = 18] = "Duration";
        Type3[Type3["LargeBinary"] = 19] = "LargeBinary";
        Type3[Type3["LargeUtf8"] = 20] = "LargeUtf8";
        Type3[Type3["LargeList"] = 21] = "LargeList";
        Type3[Type3["RunEndEncoded"] = 22] = "RunEndEncoded";
      })(Type || (Type = {}));
    }
  });

  // node_modules/apache-arrow/fb/field.mjs
  var Field;
  var init_field = __esm({
    "node_modules/apache-arrow/fb/field.mjs"() {
      init_flatbuffers();
      init_dictionary_encoding();
      init_key_value();
      init_type();
      Field = class _Field {
        constructor() {
          this.bb = null;
          this.bb_pos = 0;
        }
        __init(i, bb) {
          this.bb_pos = i;
          this.bb = bb;
          return this;
        }
        static getRootAsField(bb, obj) {
          return (obj || new _Field()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static getSizePrefixedRootAsField(bb, obj) {
          bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
          return (obj || new _Field()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        name(optionalEncoding) {
          const offset = this.bb.__offset(this.bb_pos, 4);
          return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
        }
        /**
         * Whether or not this field can contain nulls. Should be true in general.
         */
        nullable() {
          const offset = this.bb.__offset(this.bb_pos, 6);
          return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
        }
        typeType() {
          const offset = this.bb.__offset(this.bb_pos, 8);
          return offset ? this.bb.readUint8(this.bb_pos + offset) : Type.NONE;
        }
        /**
         * This is the type of the decoded value if the field is dictionary encoded.
         */
        type(obj) {
          const offset = this.bb.__offset(this.bb_pos, 10);
          return offset ? this.bb.__union(obj, this.bb_pos + offset) : null;
        }
        /**
         * Present only if the field is dictionary encoded.
         */
        dictionary(obj) {
          const offset = this.bb.__offset(this.bb_pos, 12);
          return offset ? (obj || new DictionaryEncoding()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
        }
        /**
         * children apply only to nested data types like Struct, List and Union. For
         * primitive types children will have length 0.
         */
        children(index, obj) {
          const offset = this.bb.__offset(this.bb_pos, 14);
          return offset ? (obj || new _Field()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
        }
        childrenLength() {
          const offset = this.bb.__offset(this.bb_pos, 14);
          return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
        }
        /**
         * User-defined metadata
         */
        customMetadata(index, obj) {
          const offset = this.bb.__offset(this.bb_pos, 16);
          return offset ? (obj || new KeyValue()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
        }
        customMetadataLength() {
          const offset = this.bb.__offset(this.bb_pos, 16);
          return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
        }
        static startField(builder) {
          builder.startObject(7);
        }
        static addName(builder, nameOffset) {
          builder.addFieldOffset(0, nameOffset, 0);
        }
        static addNullable(builder, nullable) {
          builder.addFieldInt8(1, +nullable, 0);
        }
        static addTypeType(builder, typeType) {
          builder.addFieldInt8(2, typeType, Type.NONE);
        }
        static addType(builder, typeOffset) {
          builder.addFieldOffset(3, typeOffset, 0);
        }
        static addDictionary(builder, dictionaryOffset) {
          builder.addFieldOffset(4, dictionaryOffset, 0);
        }
        static addChildren(builder, childrenOffset) {
          builder.addFieldOffset(5, childrenOffset, 0);
        }
        static createChildrenVector(builder, data) {
          builder.startVector(4, data.length, 4);
          for (let i = data.length - 1; i >= 0; i--) {
            builder.addOffset(data[i]);
          }
          return builder.endVector();
        }
        static startChildrenVector(builder, numElems) {
          builder.startVector(4, numElems, 4);
        }
        static addCustomMetadata(builder, customMetadataOffset) {
          builder.addFieldOffset(6, customMetadataOffset, 0);
        }
        static createCustomMetadataVector(builder, data) {
          builder.startVector(4, data.length, 4);
          for (let i = data.length - 1; i >= 0; i--) {
            builder.addOffset(data[i]);
          }
          return builder.endVector();
        }
        static startCustomMetadataVector(builder, numElems) {
          builder.startVector(4, numElems, 4);
        }
        static endField(builder) {
          const offset = builder.endObject();
          return offset;
        }
      };
    }
  });

  // node_modules/apache-arrow/fb/schema.mjs
  var Schema;
  var init_schema = __esm({
    "node_modules/apache-arrow/fb/schema.mjs"() {
      init_flatbuffers();
      init_endianness();
      init_field();
      init_key_value();
      Schema = class _Schema {
        constructor() {
          this.bb = null;
          this.bb_pos = 0;
        }
        __init(i, bb) {
          this.bb_pos = i;
          this.bb = bb;
          return this;
        }
        static getRootAsSchema(bb, obj) {
          return (obj || new _Schema()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static getSizePrefixedRootAsSchema(bb, obj) {
          bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
          return (obj || new _Schema()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        /**
         * endianness of the buffer
         * it is Little Endian by default
         * if endianness doesn't match the underlying system then the vectors need to be converted
         */
        endianness() {
          const offset = this.bb.__offset(this.bb_pos, 4);
          return offset ? this.bb.readInt16(this.bb_pos + offset) : Endianness.Little;
        }
        fields(index, obj) {
          const offset = this.bb.__offset(this.bb_pos, 6);
          return offset ? (obj || new Field()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
        }
        fieldsLength() {
          const offset = this.bb.__offset(this.bb_pos, 6);
          return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
        }
        customMetadata(index, obj) {
          const offset = this.bb.__offset(this.bb_pos, 8);
          return offset ? (obj || new KeyValue()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
        }
        customMetadataLength() {
          const offset = this.bb.__offset(this.bb_pos, 8);
          return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
        }
        /**
         * Features used in the stream/file.
         */
        features(index) {
          const offset = this.bb.__offset(this.bb_pos, 10);
          return offset ? this.bb.readInt64(this.bb.__vector(this.bb_pos + offset) + index * 8) : BigInt(0);
        }
        featuresLength() {
          const offset = this.bb.__offset(this.bb_pos, 10);
          return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
        }
        static startSchema(builder) {
          builder.startObject(4);
        }
        static addEndianness(builder, endianness) {
          builder.addFieldInt16(0, endianness, Endianness.Little);
        }
        static addFields(builder, fieldsOffset) {
          builder.addFieldOffset(1, fieldsOffset, 0);
        }
        static createFieldsVector(builder, data) {
          builder.startVector(4, data.length, 4);
          for (let i = data.length - 1; i >= 0; i--) {
            builder.addOffset(data[i]);
          }
          return builder.endVector();
        }
        static startFieldsVector(builder, numElems) {
          builder.startVector(4, numElems, 4);
        }
        static addCustomMetadata(builder, customMetadataOffset) {
          builder.addFieldOffset(2, customMetadataOffset, 0);
        }
        static createCustomMetadataVector(builder, data) {
          builder.startVector(4, data.length, 4);
          for (let i = data.length - 1; i >= 0; i--) {
            builder.addOffset(data[i]);
          }
          return builder.endVector();
        }
        static startCustomMetadataVector(builder, numElems) {
          builder.startVector(4, numElems, 4);
        }
        static addFeatures(builder, featuresOffset) {
          builder.addFieldOffset(3, featuresOffset, 0);
        }
        static createFeaturesVector(builder, data) {
          builder.startVector(8, data.length, 8);
          for (let i = data.length - 1; i >= 0; i--) {
            builder.addInt64(data[i]);
          }
          return builder.endVector();
        }
        static startFeaturesVector(builder, numElems) {
          builder.startVector(8, numElems, 8);
        }
        static endSchema(builder) {
          const offset = builder.endObject();
          return offset;
        }
        static finishSchemaBuffer(builder, offset) {
          builder.finish(offset);
        }
        static finishSizePrefixedSchemaBuffer(builder, offset) {
          builder.finish(offset, void 0, true);
        }
        static createSchema(builder, endianness, fieldsOffset, customMetadataOffset, featuresOffset) {
          _Schema.startSchema(builder);
          _Schema.addEndianness(builder, endianness);
          _Schema.addFields(builder, fieldsOffset);
          _Schema.addCustomMetadata(builder, customMetadataOffset);
          _Schema.addFeatures(builder, featuresOffset);
          return _Schema.endSchema(builder);
        }
      };
    }
  });

  // node_modules/apache-arrow/fb/message-header.mjs
  var MessageHeader;
  var init_message_header = __esm({
    "node_modules/apache-arrow/fb/message-header.mjs"() {
      (function(MessageHeader2) {
        MessageHeader2[MessageHeader2["NONE"] = 0] = "NONE";
        MessageHeader2[MessageHeader2["Schema"] = 1] = "Schema";
        MessageHeader2[MessageHeader2["DictionaryBatch"] = 2] = "DictionaryBatch";
        MessageHeader2[MessageHeader2["RecordBatch"] = 3] = "RecordBatch";
        MessageHeader2[MessageHeader2["Tensor"] = 4] = "Tensor";
        MessageHeader2[MessageHeader2["SparseTensor"] = 5] = "SparseTensor";
      })(MessageHeader || (MessageHeader = {}));
    }
  });

  // node_modules/apache-arrow/enum.mjs
  var Type2, BufferType;
  var init_enum = __esm({
    "node_modules/apache-arrow/enum.mjs"() {
      init_metadata_version();
      init_union_mode();
      init_precision();
      init_date_unit();
      init_time_unit();
      init_interval_unit();
      init_message_header();
      (function(Type3) {
        Type3[Type3["NONE"] = 0] = "NONE";
        Type3[Type3["Null"] = 1] = "Null";
        Type3[Type3["Int"] = 2] = "Int";
        Type3[Type3["Float"] = 3] = "Float";
        Type3[Type3["Binary"] = 4] = "Binary";
        Type3[Type3["Utf8"] = 5] = "Utf8";
        Type3[Type3["Bool"] = 6] = "Bool";
        Type3[Type3["Decimal"] = 7] = "Decimal";
        Type3[Type3["Date"] = 8] = "Date";
        Type3[Type3["Time"] = 9] = "Time";
        Type3[Type3["Timestamp"] = 10] = "Timestamp";
        Type3[Type3["Interval"] = 11] = "Interval";
        Type3[Type3["List"] = 12] = "List";
        Type3[Type3["Struct"] = 13] = "Struct";
        Type3[Type3["Union"] = 14] = "Union";
        Type3[Type3["FixedSizeBinary"] = 15] = "FixedSizeBinary";
        Type3[Type3["FixedSizeList"] = 16] = "FixedSizeList";
        Type3[Type3["Map"] = 17] = "Map";
        Type3[Type3["Duration"] = 18] = "Duration";
        Type3[Type3["LargeBinary"] = 19] = "LargeBinary";
        Type3[Type3["LargeUtf8"] = 20] = "LargeUtf8";
        Type3[Type3["Dictionary"] = -1] = "Dictionary";
        Type3[Type3["Int8"] = -2] = "Int8";
        Type3[Type3["Int16"] = -3] = "Int16";
        Type3[Type3["Int32"] = -4] = "Int32";
        Type3[Type3["Int64"] = -5] = "Int64";
        Type3[Type3["Uint8"] = -6] = "Uint8";
        Type3[Type3["Uint16"] = -7] = "Uint16";
        Type3[Type3["Uint32"] = -8] = "Uint32";
        Type3[Type3["Uint64"] = -9] = "Uint64";
        Type3[Type3["Float16"] = -10] = "Float16";
        Type3[Type3["Float32"] = -11] = "Float32";
        Type3[Type3["Float64"] = -12] = "Float64";
        Type3[Type3["DateDay"] = -13] = "DateDay";
        Type3[Type3["DateMillisecond"] = -14] = "DateMillisecond";
        Type3[Type3["TimestampSecond"] = -15] = "TimestampSecond";
        Type3[Type3["TimestampMillisecond"] = -16] = "TimestampMillisecond";
        Type3[Type3["TimestampMicrosecond"] = -17] = "TimestampMicrosecond";
        Type3[Type3["TimestampNanosecond"] = -18] = "TimestampNanosecond";
        Type3[Type3["TimeSecond"] = -19] = "TimeSecond";
        Type3[Type3["TimeMillisecond"] = -20] = "TimeMillisecond";
        Type3[Type3["TimeMicrosecond"] = -21] = "TimeMicrosecond";
        Type3[Type3["TimeNanosecond"] = -22] = "TimeNanosecond";
        Type3[Type3["DenseUnion"] = -23] = "DenseUnion";
        Type3[Type3["SparseUnion"] = -24] = "SparseUnion";
        Type3[Type3["IntervalDayTime"] = -25] = "IntervalDayTime";
        Type3[Type3["IntervalYearMonth"] = -26] = "IntervalYearMonth";
        Type3[Type3["DurationSecond"] = -27] = "DurationSecond";
        Type3[Type3["DurationMillisecond"] = -28] = "DurationMillisecond";
        Type3[Type3["DurationMicrosecond"] = -29] = "DurationMicrosecond";
        Type3[Type3["DurationNanosecond"] = -30] = "DurationNanosecond";
      })(Type2 || (Type2 = {}));
      (function(BufferType2) {
        BufferType2[BufferType2["OFFSET"] = 0] = "OFFSET";
        BufferType2[BufferType2["DATA"] = 1] = "DATA";
        BufferType2[BufferType2["VALIDITY"] = 2] = "VALIDITY";
        BufferType2[BufferType2["TYPE"] = 3] = "TYPE";
      })(BufferType || (BufferType = {}));
    }
  });

  // node_modules/apache-arrow/util/pretty.mjs
  var pretty_exports = {};
  __export(pretty_exports, {
    valueToString: () => valueToString
  });
  function valueToString(x) {
    if (x === null) {
      return "null";
    }
    if (x === undf) {
      return "undefined";
    }
    switch (typeof x) {
      case "number":
        return `${x}`;
      case "bigint":
        return `${x}`;
      case "string":
        return `"${x}"`;
    }
    if (typeof x[Symbol.toPrimitive] === "function") {
      return x[Symbol.toPrimitive]("string");
    }
    if (ArrayBuffer.isView(x)) {
      if (x instanceof BigInt64Array || x instanceof BigUint64Array) {
        return `[${[...x].map((x2) => valueToString(x2))}]`;
      }
      return `[${x}]`;
    }
    return ArrayBuffer.isView(x) ? `[${x}]` : JSON.stringify(x, (_, y) => typeof y === "bigint" ? `${y}` : y);
  }
  var undf;
  var init_pretty = __esm({
    "node_modules/apache-arrow/util/pretty.mjs"() {
      undf = void 0;
    }
  });

  // node_modules/apache-arrow/util/bigint.mjs
  function bigIntToNumber(number) {
    if (typeof number === "bigint" && (number < Number.MIN_SAFE_INTEGER || number > Number.MAX_SAFE_INTEGER)) {
      throw new TypeError(`${number} is not safe to convert to a number.`);
    }
    return Number(number);
  }
  function divideBigInts(number, divisor) {
    return bigIntToNumber(number / divisor) + bigIntToNumber(number % divisor) / bigIntToNumber(divisor);
  }
  var init_bigint = __esm({
    "node_modules/apache-arrow/util/bigint.mjs"() {
    }
  });

  // node_modules/apache-arrow/util/bn.mjs
  var bn_exports = {};
  __export(bn_exports, {
    BN: () => BN,
    bigNumToBigInt: () => bigNumToBigInt,
    bigNumToNumber: () => bigNumToNumber,
    bigNumToString: () => bigNumToString,
    isArrowBigNumSymbol: () => isArrowBigNumSymbol
  });
  function BigNum(x, ...xs) {
    if (xs.length === 0) {
      return Object.setPrototypeOf(toArrayBufferView(this["TypedArray"], x), this.constructor.prototype);
    }
    return Object.setPrototypeOf(new this["TypedArray"](x, ...xs), this.constructor.prototype);
  }
  function SignedBigNum(...args) {
    return BigNum.apply(this, args);
  }
  function UnsignedBigNum(...args) {
    return BigNum.apply(this, args);
  }
  function DecimalBigNum(...args) {
    return BigNum.apply(this, args);
  }
  function bigNumToNumber(bn, scale) {
    const { buffer, byteOffset, byteLength, "signed": signed } = bn;
    const words = new BigUint64Array(buffer, byteOffset, byteLength / 8);
    const negative = signed && words.at(-1) & BigInt(1) << BigInt(63);
    let number = BigInt(0);
    let i = 0;
    if (negative) {
      for (const word of words) {
        number |= (word ^ TWO_TO_THE_64_MINUS_1) * (BigInt(1) << BigInt(64 * i++));
      }
      number *= BigInt(-1);
      number -= BigInt(1);
    } else {
      for (const word of words) {
        number |= word * (BigInt(1) << BigInt(64 * i++));
      }
    }
    if (typeof scale === "number") {
      const denominator = BigInt(Math.pow(10, scale));
      const quotient = number / denominator;
      const remainder = number % denominator;
      return bigIntToNumber(quotient) + bigIntToNumber(remainder) / bigIntToNumber(denominator);
    }
    return bigIntToNumber(number);
  }
  function bigNumToString(a) {
    if (a.byteLength === 8) {
      const bigIntArray = new a["BigIntArray"](a.buffer, a.byteOffset, 1);
      return `${bigIntArray[0]}`;
    }
    if (!a["signed"]) {
      return unsignedBigNumToString(a);
    }
    let array = new Uint16Array(a.buffer, a.byteOffset, a.byteLength / 2);
    const highOrderWord = new Int16Array([array.at(-1)])[0];
    if (highOrderWord >= 0) {
      return unsignedBigNumToString(a);
    }
    array = array.slice();
    let carry = 1;
    for (let i = 0; i < array.length; i++) {
      const elem = array[i];
      const updated = ~elem + carry;
      array[i] = updated;
      carry &= elem === 0 ? 1 : 0;
    }
    const negated = unsignedBigNumToString(array);
    return `-${negated}`;
  }
  function bigNumToBigInt(a) {
    if (a.byteLength === 8) {
      const bigIntArray = new a["BigIntArray"](a.buffer, a.byteOffset, 1);
      return bigIntArray[0];
    } else {
      return bigNumToString(a);
    }
  }
  function unsignedBigNumToString(a) {
    let digits = "";
    const base64 = new Uint32Array(2);
    let base32 = new Uint16Array(a.buffer, a.byteOffset, a.byteLength / 2);
    const checks = new Uint32Array((base32 = new Uint16Array(base32).reverse()).buffer);
    let i = -1;
    const n = base32.length - 1;
    do {
      for (base64[0] = base32[i = 0]; i < n; ) {
        base32[i++] = base64[1] = base64[0] / 10;
        base64[0] = (base64[0] - base64[1] * 10 << 16) + base32[i];
      }
      base32[i] = base64[1] = base64[0] / 10;
      base64[0] = base64[0] - base64[1] * 10;
      digits = `${base64[0]}${digits}`;
    } while (checks[0] || checks[1] || checks[2] || checks[3]);
    return digits !== null && digits !== void 0 ? digits : `0`;
  }
  var isArrowBigNumSymbol, TWO_TO_THE_64, TWO_TO_THE_64_MINUS_1, BN;
  var init_bn = __esm({
    "node_modules/apache-arrow/util/bn.mjs"() {
      init_buffer();
      init_bigint();
      isArrowBigNumSymbol = Symbol.for("isArrowBigNum");
      BigNum.prototype[isArrowBigNumSymbol] = true;
      BigNum.prototype.toJSON = function() {
        return `"${bigNumToString(this)}"`;
      };
      BigNum.prototype.valueOf = function(scale) {
        return bigNumToNumber(this, scale);
      };
      BigNum.prototype.toString = function() {
        return bigNumToString(this);
      };
      BigNum.prototype[Symbol.toPrimitive] = function(hint = "default") {
        switch (hint) {
          case "number":
            return bigNumToNumber(this);
          case "string":
            return bigNumToString(this);
          case "default":
            return bigNumToBigInt(this);
        }
        return bigNumToString(this);
      };
      Object.setPrototypeOf(SignedBigNum.prototype, Object.create(Int32Array.prototype));
      Object.setPrototypeOf(UnsignedBigNum.prototype, Object.create(Uint32Array.prototype));
      Object.setPrototypeOf(DecimalBigNum.prototype, Object.create(Uint32Array.prototype));
      Object.assign(SignedBigNum.prototype, BigNum.prototype, { "constructor": SignedBigNum, "signed": true, "TypedArray": Int32Array, "BigIntArray": BigInt64Array });
      Object.assign(UnsignedBigNum.prototype, BigNum.prototype, { "constructor": UnsignedBigNum, "signed": false, "TypedArray": Uint32Array, "BigIntArray": BigUint64Array });
      Object.assign(DecimalBigNum.prototype, BigNum.prototype, { "constructor": DecimalBigNum, "signed": true, "TypedArray": Uint32Array, "BigIntArray": BigUint64Array });
      TWO_TO_THE_64 = BigInt(4294967296) * BigInt(4294967296);
      TWO_TO_THE_64_MINUS_1 = TWO_TO_THE_64 - BigInt(1);
      BN = class _BN {
        /** @nocollapse */
        static new(num, isSigned) {
          switch (isSigned) {
            case true:
              return new SignedBigNum(num);
            case false:
              return new UnsignedBigNum(num);
          }
          switch (num.constructor) {
            case Int8Array:
            case Int16Array:
            case Int32Array:
            case BigInt64Array:
              return new SignedBigNum(num);
          }
          if (num.byteLength === 16) {
            return new DecimalBigNum(num);
          }
          return new UnsignedBigNum(num);
        }
        /** @nocollapse */
        static signed(num) {
          return new SignedBigNum(num);
        }
        /** @nocollapse */
        static unsigned(num) {
          return new UnsignedBigNum(num);
        }
        /** @nocollapse */
        static decimal(num) {
          return new DecimalBigNum(num);
        }
        constructor(num, isSigned) {
          return _BN.new(num, isSigned);
        }
      };
    }
  });

  // node_modules/apache-arrow/type.mjs
  function strideForType(type) {
    const t = type;
    switch (type.typeId) {
      case Type2.Decimal:
        return type.bitWidth / 32;
      case Type2.Interval:
        return 1 + t.unit;
      // case Type.Int: return 1 + +((t as Int_).bitWidth > 32);
      // case Type.Time: return 1 + +((t as Time_).bitWidth > 32);
      case Type2.FixedSizeList:
        return t.listSize;
      case Type2.FixedSizeBinary:
        return t.byteWidth;
      default:
        return 1;
    }
  }
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, DataType, Null2, Int_, Int8, Int16, Int32, Int64, Uint8, Uint16, Uint32, Uint64, Float, Float16, Float32, Float64, Binary2, LargeBinary2, Utf82, LargeUtf82, Bool2, Decimal2, Date_, DateDay, DateMillisecond, Time_, TimeSecond, TimeMillisecond, TimeMicrosecond, TimeNanosecond, Timestamp_, TimestampSecond, TimestampMillisecond, TimestampMicrosecond, TimestampNanosecond, Interval_, IntervalDayTime, IntervalYearMonth, Duration2, DurationSecond, DurationMillisecond, DurationMicrosecond, DurationNanosecond, List2, Struct, Union_, DenseUnion, SparseUnion, FixedSizeBinary2, FixedSizeList2, Map_, getId, Dictionary;
  var init_type2 = __esm({
    "node_modules/apache-arrow/type.mjs"() {
      init_bigint();
      init_enum();
      DataType = class _DataType {
        /** @nocollapse */
        static isNull(x) {
          return (x === null || x === void 0 ? void 0 : x.typeId) === Type2.Null;
        }
        /** @nocollapse */
        static isInt(x) {
          return (x === null || x === void 0 ? void 0 : x.typeId) === Type2.Int;
        }
        /** @nocollapse */
        static isFloat(x) {
          return (x === null || x === void 0 ? void 0 : x.typeId) === Type2.Float;
        }
        /** @nocollapse */
        static isBinary(x) {
          return (x === null || x === void 0 ? void 0 : x.typeId) === Type2.Binary;
        }
        /** @nocollapse */
        static isLargeBinary(x) {
          return (x === null || x === void 0 ? void 0 : x.typeId) === Type2.LargeBinary;
        }
        /** @nocollapse */
        static isUtf8(x) {
          return (x === null || x === void 0 ? void 0 : x.typeId) === Type2.Utf8;
        }
        /** @nocollapse */
        static isLargeUtf8(x) {
          return (x === null || x === void 0 ? void 0 : x.typeId) === Type2.LargeUtf8;
        }
        /** @nocollapse */
        static isBool(x) {
          return (x === null || x === void 0 ? void 0 : x.typeId) === Type2.Bool;
        }
        /** @nocollapse */
        static isDecimal(x) {
          return (x === null || x === void 0 ? void 0 : x.typeId) === Type2.Decimal;
        }
        /** @nocollapse */
        static isDate(x) {
          return (x === null || x === void 0 ? void 0 : x.typeId) === Type2.Date;
        }
        /** @nocollapse */
        static isTime(x) {
          return (x === null || x === void 0 ? void 0 : x.typeId) === Type2.Time;
        }
        /** @nocollapse */
        static isTimestamp(x) {
          return (x === null || x === void 0 ? void 0 : x.typeId) === Type2.Timestamp;
        }
        /** @nocollapse */
        static isInterval(x) {
          return (x === null || x === void 0 ? void 0 : x.typeId) === Type2.Interval;
        }
        /** @nocollapse */
        static isDuration(x) {
          return (x === null || x === void 0 ? void 0 : x.typeId) === Type2.Duration;
        }
        /** @nocollapse */
        static isList(x) {
          return (x === null || x === void 0 ? void 0 : x.typeId) === Type2.List;
        }
        /** @nocollapse */
        static isStruct(x) {
          return (x === null || x === void 0 ? void 0 : x.typeId) === Type2.Struct;
        }
        /** @nocollapse */
        static isUnion(x) {
          return (x === null || x === void 0 ? void 0 : x.typeId) === Type2.Union;
        }
        /** @nocollapse */
        static isFixedSizeBinary(x) {
          return (x === null || x === void 0 ? void 0 : x.typeId) === Type2.FixedSizeBinary;
        }
        /** @nocollapse */
        static isFixedSizeList(x) {
          return (x === null || x === void 0 ? void 0 : x.typeId) === Type2.FixedSizeList;
        }
        /** @nocollapse */
        static isMap(x) {
          return (x === null || x === void 0 ? void 0 : x.typeId) === Type2.Map;
        }
        /** @nocollapse */
        static isDictionary(x) {
          return (x === null || x === void 0 ? void 0 : x.typeId) === Type2.Dictionary;
        }
        /** @nocollapse */
        static isDenseUnion(x) {
          return _DataType.isUnion(x) && x.mode === UnionMode.Dense;
        }
        /** @nocollapse */
        static isSparseUnion(x) {
          return _DataType.isUnion(x) && x.mode === UnionMode.Sparse;
        }
        constructor(typeId) {
          this.typeId = typeId;
        }
      };
      _a = Symbol.toStringTag;
      DataType[_a] = ((proto) => {
        proto.children = null;
        proto.ArrayType = Array;
        proto.OffsetArrayType = Int32Array;
        return proto[Symbol.toStringTag] = "DataType";
      })(DataType.prototype);
      Null2 = class extends DataType {
        constructor() {
          super(Type2.Null);
        }
        toString() {
          return `Null`;
        }
      };
      _b = Symbol.toStringTag;
      Null2[_b] = ((proto) => proto[Symbol.toStringTag] = "Null")(Null2.prototype);
      Int_ = class extends DataType {
        constructor(isSigned, bitWidth) {
          super(Type2.Int);
          this.isSigned = isSigned;
          this.bitWidth = bitWidth;
        }
        get ArrayType() {
          switch (this.bitWidth) {
            case 8:
              return this.isSigned ? Int8Array : Uint8Array;
            case 16:
              return this.isSigned ? Int16Array : Uint16Array;
            case 32:
              return this.isSigned ? Int32Array : Uint32Array;
            case 64:
              return this.isSigned ? BigInt64Array : BigUint64Array;
          }
          throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`);
        }
        toString() {
          return `${this.isSigned ? `I` : `Ui`}nt${this.bitWidth}`;
        }
      };
      _c = Symbol.toStringTag;
      Int_[_c] = ((proto) => {
        proto.isSigned = null;
        proto.bitWidth = null;
        return proto[Symbol.toStringTag] = "Int";
      })(Int_.prototype);
      Int8 = class extends Int_ {
        constructor() {
          super(true, 8);
        }
        get ArrayType() {
          return Int8Array;
        }
      };
      Int16 = class extends Int_ {
        constructor() {
          super(true, 16);
        }
        get ArrayType() {
          return Int16Array;
        }
      };
      Int32 = class extends Int_ {
        constructor() {
          super(true, 32);
        }
        get ArrayType() {
          return Int32Array;
        }
      };
      Int64 = class extends Int_ {
        constructor() {
          super(true, 64);
        }
        get ArrayType() {
          return BigInt64Array;
        }
      };
      Uint8 = class extends Int_ {
        constructor() {
          super(false, 8);
        }
        get ArrayType() {
          return Uint8Array;
        }
      };
      Uint16 = class extends Int_ {
        constructor() {
          super(false, 16);
        }
        get ArrayType() {
          return Uint16Array;
        }
      };
      Uint32 = class extends Int_ {
        constructor() {
          super(false, 32);
        }
        get ArrayType() {
          return Uint32Array;
        }
      };
      Uint64 = class extends Int_ {
        constructor() {
          super(false, 64);
        }
        get ArrayType() {
          return BigUint64Array;
        }
      };
      Object.defineProperty(Int8.prototype, "ArrayType", { value: Int8Array });
      Object.defineProperty(Int16.prototype, "ArrayType", { value: Int16Array });
      Object.defineProperty(Int32.prototype, "ArrayType", { value: Int32Array });
      Object.defineProperty(Int64.prototype, "ArrayType", { value: BigInt64Array });
      Object.defineProperty(Uint8.prototype, "ArrayType", { value: Uint8Array });
      Object.defineProperty(Uint16.prototype, "ArrayType", { value: Uint16Array });
      Object.defineProperty(Uint32.prototype, "ArrayType", { value: Uint32Array });
      Object.defineProperty(Uint64.prototype, "ArrayType", { value: BigUint64Array });
      Float = class extends DataType {
        constructor(precision) {
          super(Type2.Float);
          this.precision = precision;
        }
        get ArrayType() {
          switch (this.precision) {
            case Precision.HALF:
              return Uint16Array;
            case Precision.SINGLE:
              return Float32Array;
            case Precision.DOUBLE:
              return Float64Array;
          }
          throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`);
        }
        toString() {
          return `Float${this.precision << 5 || 16}`;
        }
      };
      _d = Symbol.toStringTag;
      Float[_d] = ((proto) => {
        proto.precision = null;
        return proto[Symbol.toStringTag] = "Float";
      })(Float.prototype);
      Float16 = class extends Float {
        constructor() {
          super(Precision.HALF);
        }
      };
      Float32 = class extends Float {
        constructor() {
          super(Precision.SINGLE);
        }
      };
      Float64 = class extends Float {
        constructor() {
          super(Precision.DOUBLE);
        }
      };
      Object.defineProperty(Float16.prototype, "ArrayType", { value: Uint16Array });
      Object.defineProperty(Float32.prototype, "ArrayType", { value: Float32Array });
      Object.defineProperty(Float64.prototype, "ArrayType", { value: Float64Array });
      Binary2 = class extends DataType {
        constructor() {
          super(Type2.Binary);
        }
        toString() {
          return `Binary`;
        }
      };
      _e = Symbol.toStringTag;
      Binary2[_e] = ((proto) => {
        proto.ArrayType = Uint8Array;
        return proto[Symbol.toStringTag] = "Binary";
      })(Binary2.prototype);
      LargeBinary2 = class extends DataType {
        constructor() {
          super(Type2.LargeBinary);
        }
        toString() {
          return `LargeBinary`;
        }
      };
      _f = Symbol.toStringTag;
      LargeBinary2[_f] = ((proto) => {
        proto.ArrayType = Uint8Array;
        proto.OffsetArrayType = BigInt64Array;
        return proto[Symbol.toStringTag] = "LargeBinary";
      })(LargeBinary2.prototype);
      Utf82 = class extends DataType {
        constructor() {
          super(Type2.Utf8);
        }
        toString() {
          return `Utf8`;
        }
      };
      _g = Symbol.toStringTag;
      Utf82[_g] = ((proto) => {
        proto.ArrayType = Uint8Array;
        return proto[Symbol.toStringTag] = "Utf8";
      })(Utf82.prototype);
      LargeUtf82 = class extends DataType {
        constructor() {
          super(Type2.LargeUtf8);
        }
        toString() {
          return `LargeUtf8`;
        }
      };
      _h = Symbol.toStringTag;
      LargeUtf82[_h] = ((proto) => {
        proto.ArrayType = Uint8Array;
        proto.OffsetArrayType = BigInt64Array;
        return proto[Symbol.toStringTag] = "LargeUtf8";
      })(LargeUtf82.prototype);
      Bool2 = class extends DataType {
        constructor() {
          super(Type2.Bool);
        }
        toString() {
          return `Bool`;
        }
      };
      _j = Symbol.toStringTag;
      Bool2[_j] = ((proto) => {
        proto.ArrayType = Uint8Array;
        return proto[Symbol.toStringTag] = "Bool";
      })(Bool2.prototype);
      Decimal2 = class extends DataType {
        constructor(scale, precision, bitWidth = 128) {
          super(Type2.Decimal);
          this.scale = scale;
          this.precision = precision;
          this.bitWidth = bitWidth;
        }
        toString() {
          return `Decimal[${this.precision}e${this.scale > 0 ? `+` : ``}${this.scale}]`;
        }
      };
      _k = Symbol.toStringTag;
      Decimal2[_k] = ((proto) => {
        proto.scale = null;
        proto.precision = null;
        proto.ArrayType = Uint32Array;
        return proto[Symbol.toStringTag] = "Decimal";
      })(Decimal2.prototype);
      Date_ = class extends DataType {
        constructor(unit) {
          super(Type2.Date);
          this.unit = unit;
        }
        toString() {
          return `Date${(this.unit + 1) * 32}<${DateUnit[this.unit]}>`;
        }
        get ArrayType() {
          return this.unit === DateUnit.DAY ? Int32Array : BigInt64Array;
        }
      };
      _l = Symbol.toStringTag;
      Date_[_l] = ((proto) => {
        proto.unit = null;
        return proto[Symbol.toStringTag] = "Date";
      })(Date_.prototype);
      DateDay = class extends Date_ {
        constructor() {
          super(DateUnit.DAY);
        }
      };
      DateMillisecond = class extends Date_ {
        constructor() {
          super(DateUnit.MILLISECOND);
        }
      };
      Time_ = class extends DataType {
        constructor(unit, bitWidth) {
          super(Type2.Time);
          this.unit = unit;
          this.bitWidth = bitWidth;
        }
        toString() {
          return `Time${this.bitWidth}<${TimeUnit[this.unit]}>`;
        }
        get ArrayType() {
          switch (this.bitWidth) {
            case 32:
              return Int32Array;
            case 64:
              return BigInt64Array;
          }
          throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`);
        }
      };
      _m = Symbol.toStringTag;
      Time_[_m] = ((proto) => {
        proto.unit = null;
        proto.bitWidth = null;
        return proto[Symbol.toStringTag] = "Time";
      })(Time_.prototype);
      TimeSecond = class extends Time_ {
        constructor() {
          super(TimeUnit.SECOND, 32);
        }
      };
      TimeMillisecond = class extends Time_ {
        constructor() {
          super(TimeUnit.MILLISECOND, 32);
        }
      };
      TimeMicrosecond = class extends Time_ {
        constructor() {
          super(TimeUnit.MICROSECOND, 64);
        }
      };
      TimeNanosecond = class extends Time_ {
        constructor() {
          super(TimeUnit.NANOSECOND, 64);
        }
      };
      Timestamp_ = class extends DataType {
        constructor(unit, timezone) {
          super(Type2.Timestamp);
          this.unit = unit;
          this.timezone = timezone;
        }
        toString() {
          return `Timestamp<${TimeUnit[this.unit]}${this.timezone ? `, ${this.timezone}` : ``}>`;
        }
      };
      _o = Symbol.toStringTag;
      Timestamp_[_o] = ((proto) => {
        proto.unit = null;
        proto.timezone = null;
        proto.ArrayType = BigInt64Array;
        return proto[Symbol.toStringTag] = "Timestamp";
      })(Timestamp_.prototype);
      TimestampSecond = class extends Timestamp_ {
        constructor(timezone) {
          super(TimeUnit.SECOND, timezone);
        }
      };
      TimestampMillisecond = class extends Timestamp_ {
        constructor(timezone) {
          super(TimeUnit.MILLISECOND, timezone);
        }
      };
      TimestampMicrosecond = class extends Timestamp_ {
        constructor(timezone) {
          super(TimeUnit.MICROSECOND, timezone);
        }
      };
      TimestampNanosecond = class extends Timestamp_ {
        constructor(timezone) {
          super(TimeUnit.NANOSECOND, timezone);
        }
      };
      Interval_ = class extends DataType {
        constructor(unit) {
          super(Type2.Interval);
          this.unit = unit;
        }
        toString() {
          return `Interval<${IntervalUnit[this.unit]}>`;
        }
      };
      _p = Symbol.toStringTag;
      Interval_[_p] = ((proto) => {
        proto.unit = null;
        proto.ArrayType = Int32Array;
        return proto[Symbol.toStringTag] = "Interval";
      })(Interval_.prototype);
      IntervalDayTime = class extends Interval_ {
        constructor() {
          super(IntervalUnit.DAY_TIME);
        }
      };
      IntervalYearMonth = class extends Interval_ {
        constructor() {
          super(IntervalUnit.YEAR_MONTH);
        }
      };
      Duration2 = class extends DataType {
        constructor(unit) {
          super(Type2.Duration);
          this.unit = unit;
        }
        toString() {
          return `Duration<${TimeUnit[this.unit]}>`;
        }
      };
      _q = Symbol.toStringTag;
      Duration2[_q] = ((proto) => {
        proto.unit = null;
        proto.ArrayType = BigInt64Array;
        return proto[Symbol.toStringTag] = "Duration";
      })(Duration2.prototype);
      DurationSecond = class extends Duration2 {
        constructor() {
          super(TimeUnit.SECOND);
        }
      };
      DurationMillisecond = class extends Duration2 {
        constructor() {
          super(TimeUnit.MILLISECOND);
        }
      };
      DurationMicrosecond = class extends Duration2 {
        constructor() {
          super(TimeUnit.MICROSECOND);
        }
      };
      DurationNanosecond = class extends Duration2 {
        constructor() {
          super(TimeUnit.NANOSECOND);
        }
      };
      List2 = class extends DataType {
        constructor(child) {
          super(Type2.List);
          this.children = [child];
        }
        toString() {
          return `List<${this.valueType}>`;
        }
        get valueType() {
          return this.children[0].type;
        }
        get valueField() {
          return this.children[0];
        }
        get ArrayType() {
          return this.valueType.ArrayType;
        }
      };
      _r = Symbol.toStringTag;
      List2[_r] = ((proto) => {
        proto.children = null;
        return proto[Symbol.toStringTag] = "List";
      })(List2.prototype);
      Struct = class extends DataType {
        constructor(children) {
          super(Type2.Struct);
          this.children = children;
        }
        toString() {
          return `Struct<{${this.children.map((f) => `${f.name}:${f.type}`).join(`, `)}}>`;
        }
      };
      _s = Symbol.toStringTag;
      Struct[_s] = ((proto) => {
        proto.children = null;
        return proto[Symbol.toStringTag] = "Struct";
      })(Struct.prototype);
      Union_ = class extends DataType {
        constructor(mode, typeIds, children) {
          super(Type2.Union);
          this.mode = mode;
          this.children = children;
          this.typeIds = typeIds = Int32Array.from(typeIds);
          this.typeIdToChildIndex = typeIds.reduce((typeIdToChildIndex, typeId, idx) => (typeIdToChildIndex[typeId] = idx) && typeIdToChildIndex || typeIdToChildIndex, /* @__PURE__ */ Object.create(null));
        }
        toString() {
          return `${this[Symbol.toStringTag]}<${this.children.map((x) => `${x.type}`).join(` | `)}>`;
        }
      };
      _t = Symbol.toStringTag;
      Union_[_t] = ((proto) => {
        proto.mode = null;
        proto.typeIds = null;
        proto.children = null;
        proto.typeIdToChildIndex = null;
        proto.ArrayType = Int8Array;
        return proto[Symbol.toStringTag] = "Union";
      })(Union_.prototype);
      DenseUnion = class extends Union_ {
        constructor(typeIds, children) {
          super(UnionMode.Dense, typeIds, children);
        }
      };
      SparseUnion = class extends Union_ {
        constructor(typeIds, children) {
          super(UnionMode.Sparse, typeIds, children);
        }
      };
      FixedSizeBinary2 = class extends DataType {
        constructor(byteWidth) {
          super(Type2.FixedSizeBinary);
          this.byteWidth = byteWidth;
        }
        toString() {
          return `FixedSizeBinary[${this.byteWidth}]`;
        }
      };
      _u = Symbol.toStringTag;
      FixedSizeBinary2[_u] = ((proto) => {
        proto.byteWidth = null;
        proto.ArrayType = Uint8Array;
        return proto[Symbol.toStringTag] = "FixedSizeBinary";
      })(FixedSizeBinary2.prototype);
      FixedSizeList2 = class extends DataType {
        constructor(listSize, child) {
          super(Type2.FixedSizeList);
          this.listSize = listSize;
          this.children = [child];
        }
        get valueType() {
          return this.children[0].type;
        }
        get valueField() {
          return this.children[0];
        }
        get ArrayType() {
          return this.valueType.ArrayType;
        }
        toString() {
          return `FixedSizeList[${this.listSize}]<${this.valueType}>`;
        }
      };
      _v = Symbol.toStringTag;
      FixedSizeList2[_v] = ((proto) => {
        proto.children = null;
        proto.listSize = null;
        return proto[Symbol.toStringTag] = "FixedSizeList";
      })(FixedSizeList2.prototype);
      Map_ = class extends DataType {
        constructor(entries, keysSorted = false) {
          var _y, _z, _0;
          super(Type2.Map);
          this.children = [entries];
          this.keysSorted = keysSorted;
          if (entries) {
            entries["name"] = "entries";
            if ((_y = entries === null || entries === void 0 ? void 0 : entries.type) === null || _y === void 0 ? void 0 : _y.children) {
              const key = (_z = entries === null || entries === void 0 ? void 0 : entries.type) === null || _z === void 0 ? void 0 : _z.children[0];
              if (key) {
                key["name"] = "key";
              }
              const val = (_0 = entries === null || entries === void 0 ? void 0 : entries.type) === null || _0 === void 0 ? void 0 : _0.children[1];
              if (val) {
                val["name"] = "value";
              }
            }
          }
        }
        get keyType() {
          return this.children[0].type.children[0].type;
        }
        get valueType() {
          return this.children[0].type.children[1].type;
        }
        get childType() {
          return this.children[0].type;
        }
        toString() {
          return `Map<{${this.children[0].type.children.map((f) => `${f.name}:${f.type}`).join(`, `)}}>`;
        }
      };
      _w = Symbol.toStringTag;
      Map_[_w] = ((proto) => {
        proto.children = null;
        proto.keysSorted = null;
        return proto[Symbol.toStringTag] = "Map_";
      })(Map_.prototype);
      getId = /* @__PURE__ */ ((atomicDictionaryId) => () => ++atomicDictionaryId)(-1);
      Dictionary = class extends DataType {
        constructor(dictionary, indices, id, isOrdered) {
          super(Type2.Dictionary);
          this.indices = indices;
          this.dictionary = dictionary;
          this.isOrdered = isOrdered || false;
          this.id = id == null ? getId() : bigIntToNumber(id);
        }
        get children() {
          return this.dictionary.children;
        }
        get valueType() {
          return this.dictionary;
        }
        get ArrayType() {
          return this.dictionary.ArrayType;
        }
        toString() {
          return `Dictionary<${this.indices}, ${this.dictionary}>`;
        }
      };
      _x = Symbol.toStringTag;
      Dictionary[_x] = ((proto) => {
        proto.id = null;
        proto.indices = null;
        proto.isOrdered = null;
        proto.dictionary = null;
        return proto[Symbol.toStringTag] = "Dictionary";
      })(Dictionary.prototype);
    }
  });

  // node_modules/apache-arrow/visitor.mjs
  function getVisitFn(visitor, node, throwIfNotFound = true) {
    if (typeof node === "number") {
      return getVisitFnByTypeId(visitor, node, throwIfNotFound);
    }
    if (typeof node === "string" && node in Type2) {
      return getVisitFnByTypeId(visitor, Type2[node], throwIfNotFound);
    }
    if (node && node instanceof DataType) {
      return getVisitFnByTypeId(visitor, inferDType(node), throwIfNotFound);
    }
    if ((node === null || node === void 0 ? void 0 : node.type) && node.type instanceof DataType) {
      return getVisitFnByTypeId(visitor, inferDType(node.type), throwIfNotFound);
    }
    return getVisitFnByTypeId(visitor, Type2.NONE, throwIfNotFound);
  }
  function getVisitFnByTypeId(visitor, dtype, throwIfNotFound = true) {
    let fn = null;
    switch (dtype) {
      case Type2.Null:
        fn = visitor.visitNull;
        break;
      case Type2.Bool:
        fn = visitor.visitBool;
        break;
      case Type2.Int:
        fn = visitor.visitInt;
        break;
      case Type2.Int8:
        fn = visitor.visitInt8 || visitor.visitInt;
        break;
      case Type2.Int16:
        fn = visitor.visitInt16 || visitor.visitInt;
        break;
      case Type2.Int32:
        fn = visitor.visitInt32 || visitor.visitInt;
        break;
      case Type2.Int64:
        fn = visitor.visitInt64 || visitor.visitInt;
        break;
      case Type2.Uint8:
        fn = visitor.visitUint8 || visitor.visitInt;
        break;
      case Type2.Uint16:
        fn = visitor.visitUint16 || visitor.visitInt;
        break;
      case Type2.Uint32:
        fn = visitor.visitUint32 || visitor.visitInt;
        break;
      case Type2.Uint64:
        fn = visitor.visitUint64 || visitor.visitInt;
        break;
      case Type2.Float:
        fn = visitor.visitFloat;
        break;
      case Type2.Float16:
        fn = visitor.visitFloat16 || visitor.visitFloat;
        break;
      case Type2.Float32:
        fn = visitor.visitFloat32 || visitor.visitFloat;
        break;
      case Type2.Float64:
        fn = visitor.visitFloat64 || visitor.visitFloat;
        break;
      case Type2.Utf8:
        fn = visitor.visitUtf8;
        break;
      case Type2.LargeUtf8:
        fn = visitor.visitLargeUtf8;
        break;
      case Type2.Binary:
        fn = visitor.visitBinary;
        break;
      case Type2.LargeBinary:
        fn = visitor.visitLargeBinary;
        break;
      case Type2.FixedSizeBinary:
        fn = visitor.visitFixedSizeBinary;
        break;
      case Type2.Date:
        fn = visitor.visitDate;
        break;
      case Type2.DateDay:
        fn = visitor.visitDateDay || visitor.visitDate;
        break;
      case Type2.DateMillisecond:
        fn = visitor.visitDateMillisecond || visitor.visitDate;
        break;
      case Type2.Timestamp:
        fn = visitor.visitTimestamp;
        break;
      case Type2.TimestampSecond:
        fn = visitor.visitTimestampSecond || visitor.visitTimestamp;
        break;
      case Type2.TimestampMillisecond:
        fn = visitor.visitTimestampMillisecond || visitor.visitTimestamp;
        break;
      case Type2.TimestampMicrosecond:
        fn = visitor.visitTimestampMicrosecond || visitor.visitTimestamp;
        break;
      case Type2.TimestampNanosecond:
        fn = visitor.visitTimestampNanosecond || visitor.visitTimestamp;
        break;
      case Type2.Time:
        fn = visitor.visitTime;
        break;
      case Type2.TimeSecond:
        fn = visitor.visitTimeSecond || visitor.visitTime;
        break;
      case Type2.TimeMillisecond:
        fn = visitor.visitTimeMillisecond || visitor.visitTime;
        break;
      case Type2.TimeMicrosecond:
        fn = visitor.visitTimeMicrosecond || visitor.visitTime;
        break;
      case Type2.TimeNanosecond:
        fn = visitor.visitTimeNanosecond || visitor.visitTime;
        break;
      case Type2.Decimal:
        fn = visitor.visitDecimal;
        break;
      case Type2.List:
        fn = visitor.visitList;
        break;
      case Type2.Struct:
        fn = visitor.visitStruct;
        break;
      case Type2.Union:
        fn = visitor.visitUnion;
        break;
      case Type2.DenseUnion:
        fn = visitor.visitDenseUnion || visitor.visitUnion;
        break;
      case Type2.SparseUnion:
        fn = visitor.visitSparseUnion || visitor.visitUnion;
        break;
      case Type2.Dictionary:
        fn = visitor.visitDictionary;
        break;
      case Type2.Interval:
        fn = visitor.visitInterval;
        break;
      case Type2.IntervalDayTime:
        fn = visitor.visitIntervalDayTime || visitor.visitInterval;
        break;
      case Type2.IntervalYearMonth:
        fn = visitor.visitIntervalYearMonth || visitor.visitInterval;
        break;
      case Type2.Duration:
        fn = visitor.visitDuration;
        break;
      case Type2.DurationSecond:
        fn = visitor.visitDurationSecond || visitor.visitDuration;
        break;
      case Type2.DurationMillisecond:
        fn = visitor.visitDurationMillisecond || visitor.visitDuration;
        break;
      case Type2.DurationMicrosecond:
        fn = visitor.visitDurationMicrosecond || visitor.visitDuration;
        break;
      case Type2.DurationNanosecond:
        fn = visitor.visitDurationNanosecond || visitor.visitDuration;
        break;
      case Type2.FixedSizeList:
        fn = visitor.visitFixedSizeList;
        break;
      case Type2.Map:
        fn = visitor.visitMap;
        break;
    }
    if (typeof fn === "function")
      return fn;
    if (!throwIfNotFound)
      return () => null;
    throw new Error(`Unrecognized type '${Type2[dtype]}'`);
  }
  function inferDType(type) {
    switch (type.typeId) {
      case Type2.Null:
        return Type2.Null;
      case Type2.Int: {
        const { bitWidth, isSigned } = type;
        switch (bitWidth) {
          case 8:
            return isSigned ? Type2.Int8 : Type2.Uint8;
          case 16:
            return isSigned ? Type2.Int16 : Type2.Uint16;
          case 32:
            return isSigned ? Type2.Int32 : Type2.Uint32;
          case 64:
            return isSigned ? Type2.Int64 : Type2.Uint64;
        }
        return Type2.Int;
      }
      case Type2.Float:
        switch (type.precision) {
          case Precision.HALF:
            return Type2.Float16;
          case Precision.SINGLE:
            return Type2.Float32;
          case Precision.DOUBLE:
            return Type2.Float64;
        }
        return Type2.Float;
      case Type2.Binary:
        return Type2.Binary;
      case Type2.LargeBinary:
        return Type2.LargeBinary;
      case Type2.Utf8:
        return Type2.Utf8;
      case Type2.LargeUtf8:
        return Type2.LargeUtf8;
      case Type2.Bool:
        return Type2.Bool;
      case Type2.Decimal:
        return Type2.Decimal;
      case Type2.Time:
        switch (type.unit) {
          case TimeUnit.SECOND:
            return Type2.TimeSecond;
          case TimeUnit.MILLISECOND:
            return Type2.TimeMillisecond;
          case TimeUnit.MICROSECOND:
            return Type2.TimeMicrosecond;
          case TimeUnit.NANOSECOND:
            return Type2.TimeNanosecond;
        }
        return Type2.Time;
      case Type2.Timestamp:
        switch (type.unit) {
          case TimeUnit.SECOND:
            return Type2.TimestampSecond;
          case TimeUnit.MILLISECOND:
            return Type2.TimestampMillisecond;
          case TimeUnit.MICROSECOND:
            return Type2.TimestampMicrosecond;
          case TimeUnit.NANOSECOND:
            return Type2.TimestampNanosecond;
        }
        return Type2.Timestamp;
      case Type2.Date:
        switch (type.unit) {
          case DateUnit.DAY:
            return Type2.DateDay;
          case DateUnit.MILLISECOND:
            return Type2.DateMillisecond;
        }
        return Type2.Date;
      case Type2.Interval:
        switch (type.unit) {
          case IntervalUnit.DAY_TIME:
            return Type2.IntervalDayTime;
          case IntervalUnit.YEAR_MONTH:
            return Type2.IntervalYearMonth;
        }
        return Type2.Interval;
      case Type2.Duration:
        switch (type.unit) {
          case TimeUnit.SECOND:
            return Type2.DurationSecond;
          case TimeUnit.MILLISECOND:
            return Type2.DurationMillisecond;
          case TimeUnit.MICROSECOND:
            return Type2.DurationMicrosecond;
          case TimeUnit.NANOSECOND:
            return Type2.DurationNanosecond;
        }
        return Type2.Duration;
      case Type2.Map:
        return Type2.Map;
      case Type2.List:
        return Type2.List;
      case Type2.Struct:
        return Type2.Struct;
      case Type2.Union:
        switch (type.mode) {
          case UnionMode.Dense:
            return Type2.DenseUnion;
          case UnionMode.Sparse:
            return Type2.SparseUnion;
        }
        return Type2.Union;
      case Type2.FixedSizeBinary:
        return Type2.FixedSizeBinary;
      case Type2.FixedSizeList:
        return Type2.FixedSizeList;
      case Type2.Dictionary:
        return Type2.Dictionary;
    }
    throw new Error(`Unrecognized type '${Type2[type.typeId]}'`);
  }
  var Visitor;
  var init_visitor = __esm({
    "node_modules/apache-arrow/visitor.mjs"() {
      init_enum();
      init_type2();
      Visitor = class {
        visitMany(nodes, ...args) {
          return nodes.map((node, i) => this.visit(node, ...args.map((x) => x[i])));
        }
        visit(...args) {
          return this.getVisitFn(args[0], false).apply(this, args);
        }
        getVisitFn(node, throwIfNotFound = true) {
          return getVisitFn(this, node, throwIfNotFound);
        }
        getVisitFnByTypeId(typeId, throwIfNotFound = true) {
          return getVisitFnByTypeId(this, typeId, throwIfNotFound);
        }
        visitNull(_node, ..._args) {
          return null;
        }
        visitBool(_node, ..._args) {
          return null;
        }
        visitInt(_node, ..._args) {
          return null;
        }
        visitFloat(_node, ..._args) {
          return null;
        }
        visitUtf8(_node, ..._args) {
          return null;
        }
        visitLargeUtf8(_node, ..._args) {
          return null;
        }
        visitBinary(_node, ..._args) {
          return null;
        }
        visitLargeBinary(_node, ..._args) {
          return null;
        }
        visitFixedSizeBinary(_node, ..._args) {
          return null;
        }
        visitDate(_node, ..._args) {
          return null;
        }
        visitTimestamp(_node, ..._args) {
          return null;
        }
        visitTime(_node, ..._args) {
          return null;
        }
        visitDecimal(_node, ..._args) {
          return null;
        }
        visitList(_node, ..._args) {
          return null;
        }
        visitStruct(_node, ..._args) {
          return null;
        }
        visitUnion(_node, ..._args) {
          return null;
        }
        visitDictionary(_node, ..._args) {
          return null;
        }
        visitInterval(_node, ..._args) {
          return null;
        }
        visitDuration(_node, ..._args) {
          return null;
        }
        visitFixedSizeList(_node, ..._args) {
          return null;
        }
        visitMap(_node, ..._args) {
          return null;
        }
      };
      Visitor.prototype.visitInt8 = null;
      Visitor.prototype.visitInt16 = null;
      Visitor.prototype.visitInt32 = null;
      Visitor.prototype.visitInt64 = null;
      Visitor.prototype.visitUint8 = null;
      Visitor.prototype.visitUint16 = null;
      Visitor.prototype.visitUint32 = null;
      Visitor.prototype.visitUint64 = null;
      Visitor.prototype.visitFloat16 = null;
      Visitor.prototype.visitFloat32 = null;
      Visitor.prototype.visitFloat64 = null;
      Visitor.prototype.visitDateDay = null;
      Visitor.prototype.visitDateMillisecond = null;
      Visitor.prototype.visitTimestampSecond = null;
      Visitor.prototype.visitTimestampMillisecond = null;
      Visitor.prototype.visitTimestampMicrosecond = null;
      Visitor.prototype.visitTimestampNanosecond = null;
      Visitor.prototype.visitTimeSecond = null;
      Visitor.prototype.visitTimeMillisecond = null;
      Visitor.prototype.visitTimeMicrosecond = null;
      Visitor.prototype.visitTimeNanosecond = null;
      Visitor.prototype.visitDenseUnion = null;
      Visitor.prototype.visitSparseUnion = null;
      Visitor.prototype.visitIntervalDayTime = null;
      Visitor.prototype.visitIntervalYearMonth = null;
      Visitor.prototype.visitDuration = null;
      Visitor.prototype.visitDurationSecond = null;
      Visitor.prototype.visitDurationMillisecond = null;
      Visitor.prototype.visitDurationMicrosecond = null;
      Visitor.prototype.visitDurationNanosecond = null;
    }
  });

  // node_modules/apache-arrow/util/math.mjs
  var math_exports = {};
  __export(math_exports, {
    float64ToUint16: () => float64ToUint16,
    uint16ToFloat64: () => uint16ToFloat64
  });
  function uint16ToFloat64(h) {
    const expo = (h & 31744) >> 10;
    const sigf = (h & 1023) / 1024;
    const sign2 = Math.pow(-1, (h & 32768) >> 15);
    switch (expo) {
      case 31:
        return sign2 * (sigf ? Number.NaN : 1 / 0);
      case 0:
        return sign2 * (sigf ? 6103515625e-14 * sigf : 0);
    }
    return sign2 * Math.pow(2, expo - 15) * (1 + sigf);
  }
  function float64ToUint16(d) {
    if (d !== d) {
      return 32256;
    }
    f64[0] = d;
    const sign2 = (u32[1] & 2147483648) >> 16 & 65535;
    let expo = u32[1] & 2146435072, sigf = 0;
    if (expo >= 1089470464) {
      if (u32[0] > 0) {
        expo = 31744;
      } else {
        expo = (expo & 2080374784) >> 16;
        sigf = (u32[1] & 1048575) >> 10;
      }
    } else if (expo <= 1056964608) {
      sigf = 1048576 + (u32[1] & 1048575);
      sigf = 1048576 + (sigf << (expo >> 20) - 998) >> 21;
      expo = 0;
    } else {
      expo = expo - 1056964608 >> 10;
      sigf = (u32[1] & 1048575) + 512 >> 10;
    }
    return sign2 | expo | sigf & 65535;
  }
  var f64, u32;
  var init_math = __esm({
    "node_modules/apache-arrow/util/math.mjs"() {
      f64 = new Float64Array(1);
      u32 = new Uint32Array(f64.buffer);
    }
  });

  // node_modules/apache-arrow/visitor/set.mjs
  function wrapSet(fn) {
    return (data, _1, _2) => {
      if (data.setValid(_1, _2 != null)) {
        return fn(data, _1, _2);
      }
    };
  }
  var SetVisitor, setEpochMsToDays, setVariableWidthBytes, setBool, setInt, setFloat, setFloat16, setAnyFloat, setDateDay, setDateMillisecond, setFixedSizeBinary, setBinary, setUtf8, setDate, setTimestampSecond, setTimestampMillisecond, setTimestampMicrosecond, setTimestampNanosecond, setTimestamp, setTimeSecond, setTimeMillisecond, setTimeMicrosecond, setTimeNanosecond, setTime, setDecimal, setList, setMap, _setStructArrayValue, _setStructVectorValue, _setStructMapValue, _setStructObjectValue, setStruct, setUnion, setDenseUnion, setSparseUnion, setDictionary, setIntervalValue, setIntervalDayTime, setIntervalYearMonth, setDurationSecond, setDurationMillisecond, setDurationMicrosecond, setDurationNanosecond, setDuration, setFixedSizeList, instance;
  var init_set = __esm({
    "node_modules/apache-arrow/visitor/set.mjs"() {
      init_vector2();
      init_visitor();
      init_bigint();
      init_utf8();
      init_math();
      init_enum();
      SetVisitor = class extends Visitor {
      };
      setEpochMsToDays = (data, index, epochMs) => {
        data[index] = Math.floor(epochMs / 864e5);
      };
      setVariableWidthBytes = (values, valueOffsets, index, value) => {
        if (index + 1 < valueOffsets.length) {
          const x = bigIntToNumber(valueOffsets[index]);
          const y = bigIntToNumber(valueOffsets[index + 1]);
          values.set(value.subarray(0, y - x), x);
        }
      };
      setBool = ({ offset, values }, index, val) => {
        const idx = offset + index;
        val ? values[idx >> 3] |= 1 << idx % 8 : values[idx >> 3] &= ~(1 << idx % 8);
      };
      setInt = ({ values }, index, value) => {
        values[index] = value;
      };
      setFloat = ({ values }, index, value) => {
        values[index] = value;
      };
      setFloat16 = ({ values }, index, value) => {
        values[index] = float64ToUint16(value);
      };
      setAnyFloat = (data, index, value) => {
        switch (data.type.precision) {
          case Precision.HALF:
            return setFloat16(data, index, value);
          case Precision.SINGLE:
          case Precision.DOUBLE:
            return setFloat(data, index, value);
        }
      };
      setDateDay = ({ values }, index, value) => {
        setEpochMsToDays(values, index, value.valueOf());
      };
      setDateMillisecond = ({ values }, index, value) => {
        values[index] = BigInt(value);
      };
      setFixedSizeBinary = ({ stride, values }, index, value) => {
        values.set(value.subarray(0, stride), stride * index);
      };
      setBinary = ({ values, valueOffsets }, index, value) => setVariableWidthBytes(values, valueOffsets, index, value);
      setUtf8 = ({ values, valueOffsets }, index, value) => setVariableWidthBytes(values, valueOffsets, index, encodeUtf8(value));
      setDate = (data, index, value) => {
        data.type.unit === DateUnit.DAY ? setDateDay(data, index, value) : setDateMillisecond(data, index, value);
      };
      setTimestampSecond = ({ values }, index, value) => {
        values[index] = BigInt(value / 1e3);
      };
      setTimestampMillisecond = ({ values }, index, value) => {
        values[index] = BigInt(value);
      };
      setTimestampMicrosecond = ({ values }, index, value) => {
        values[index] = BigInt(value * 1e3);
      };
      setTimestampNanosecond = ({ values }, index, value) => {
        values[index] = BigInt(value * 1e6);
      };
      setTimestamp = (data, index, value) => {
        switch (data.type.unit) {
          case TimeUnit.SECOND:
            return setTimestampSecond(data, index, value);
          case TimeUnit.MILLISECOND:
            return setTimestampMillisecond(data, index, value);
          case TimeUnit.MICROSECOND:
            return setTimestampMicrosecond(data, index, value);
          case TimeUnit.NANOSECOND:
            return setTimestampNanosecond(data, index, value);
        }
      };
      setTimeSecond = ({ values }, index, value) => {
        values[index] = value;
      };
      setTimeMillisecond = ({ values }, index, value) => {
        values[index] = value;
      };
      setTimeMicrosecond = ({ values }, index, value) => {
        values[index] = value;
      };
      setTimeNanosecond = ({ values }, index, value) => {
        values[index] = value;
      };
      setTime = (data, index, value) => {
        switch (data.type.unit) {
          case TimeUnit.SECOND:
            return setTimeSecond(data, index, value);
          case TimeUnit.MILLISECOND:
            return setTimeMillisecond(data, index, value);
          case TimeUnit.MICROSECOND:
            return setTimeMicrosecond(data, index, value);
          case TimeUnit.NANOSECOND:
            return setTimeNanosecond(data, index, value);
        }
      };
      setDecimal = ({ values, stride }, index, value) => {
        values.set(value.subarray(0, stride), stride * index);
      };
      setList = (data, index, value) => {
        const values = data.children[0];
        const valueOffsets = data.valueOffsets;
        const set = instance.getVisitFn(values);
        if (Array.isArray(value)) {
          for (let idx = -1, itr = valueOffsets[index], end = valueOffsets[index + 1]; itr < end; ) {
            set(values, itr++, value[++idx]);
          }
        } else {
          for (let idx = -1, itr = valueOffsets[index], end = valueOffsets[index + 1]; itr < end; ) {
            set(values, itr++, value.get(++idx));
          }
        }
      };
      setMap = (data, index, value) => {
        const values = data.children[0];
        const { valueOffsets } = data;
        const set = instance.getVisitFn(values);
        let { [index]: idx, [index + 1]: end } = valueOffsets;
        const entries = value instanceof Map ? value.entries() : Object.entries(value);
        for (const val of entries) {
          set(values, idx, val);
          if (++idx >= end)
            break;
        }
      };
      _setStructArrayValue = (o, v) => (set, c, _, i) => c && set(c, o, v[i]);
      _setStructVectorValue = (o, v) => (set, c, _, i) => c && set(c, o, v.get(i));
      _setStructMapValue = (o, v) => (set, c, f, _) => c && set(c, o, v.get(f.name));
      _setStructObjectValue = (o, v) => (set, c, f, _) => c && set(c, o, v[f.name]);
      setStruct = (data, index, value) => {
        const childSetters = data.type.children.map((f) => instance.getVisitFn(f.type));
        const set = value instanceof Map ? _setStructMapValue(index, value) : value instanceof Vector ? _setStructVectorValue(index, value) : Array.isArray(value) ? _setStructArrayValue(index, value) : _setStructObjectValue(index, value);
        data.type.children.forEach((f, i) => set(childSetters[i], data.children[i], f, i));
      };
      setUnion = (data, index, value) => {
        data.type.mode === UnionMode.Dense ? setDenseUnion(data, index, value) : setSparseUnion(data, index, value);
      };
      setDenseUnion = (data, index, value) => {
        const childIndex = data.type.typeIdToChildIndex[data.typeIds[index]];
        const child = data.children[childIndex];
        instance.visit(child, data.valueOffsets[index], value);
      };
      setSparseUnion = (data, index, value) => {
        const childIndex = data.type.typeIdToChildIndex[data.typeIds[index]];
        const child = data.children[childIndex];
        instance.visit(child, index, value);
      };
      setDictionary = (data, index, value) => {
        var _a5;
        (_a5 = data.dictionary) === null || _a5 === void 0 ? void 0 : _a5.set(data.values[index], value);
      };
      setIntervalValue = (data, index, value) => {
        data.type.unit === IntervalUnit.DAY_TIME ? setIntervalDayTime(data, index, value) : setIntervalYearMonth(data, index, value);
      };
      setIntervalDayTime = ({ values }, index, value) => {
        values.set(value.subarray(0, 2), 2 * index);
      };
      setIntervalYearMonth = ({ values }, index, value) => {
        values[index] = value[0] * 12 + value[1] % 12;
      };
      setDurationSecond = ({ values }, index, value) => {
        values[index] = value;
      };
      setDurationMillisecond = ({ values }, index, value) => {
        values[index] = value;
      };
      setDurationMicrosecond = ({ values }, index, value) => {
        values[index] = value;
      };
      setDurationNanosecond = ({ values }, index, value) => {
        values[index] = value;
      };
      setDuration = (data, index, value) => {
        switch (data.type.unit) {
          case TimeUnit.SECOND:
            return setDurationSecond(data, index, value);
          case TimeUnit.MILLISECOND:
            return setDurationMillisecond(data, index, value);
          case TimeUnit.MICROSECOND:
            return setDurationMicrosecond(data, index, value);
          case TimeUnit.NANOSECOND:
            return setDurationNanosecond(data, index, value);
        }
      };
      setFixedSizeList = (data, index, value) => {
        const { stride } = data;
        const child = data.children[0];
        const set = instance.getVisitFn(child);
        if (Array.isArray(value)) {
          for (let idx = -1, offset = index * stride; ++idx < stride; ) {
            set(child, offset + idx, value[idx]);
          }
        } else {
          for (let idx = -1, offset = index * stride; ++idx < stride; ) {
            set(child, offset + idx, value.get(idx));
          }
        }
      };
      SetVisitor.prototype.visitBool = wrapSet(setBool);
      SetVisitor.prototype.visitInt = wrapSet(setInt);
      SetVisitor.prototype.visitInt8 = wrapSet(setInt);
      SetVisitor.prototype.visitInt16 = wrapSet(setInt);
      SetVisitor.prototype.visitInt32 = wrapSet(setInt);
      SetVisitor.prototype.visitInt64 = wrapSet(setInt);
      SetVisitor.prototype.visitUint8 = wrapSet(setInt);
      SetVisitor.prototype.visitUint16 = wrapSet(setInt);
      SetVisitor.prototype.visitUint32 = wrapSet(setInt);
      SetVisitor.prototype.visitUint64 = wrapSet(setInt);
      SetVisitor.prototype.visitFloat = wrapSet(setAnyFloat);
      SetVisitor.prototype.visitFloat16 = wrapSet(setFloat16);
      SetVisitor.prototype.visitFloat32 = wrapSet(setFloat);
      SetVisitor.prototype.visitFloat64 = wrapSet(setFloat);
      SetVisitor.prototype.visitUtf8 = wrapSet(setUtf8);
      SetVisitor.prototype.visitLargeUtf8 = wrapSet(setUtf8);
      SetVisitor.prototype.visitBinary = wrapSet(setBinary);
      SetVisitor.prototype.visitLargeBinary = wrapSet(setBinary);
      SetVisitor.prototype.visitFixedSizeBinary = wrapSet(setFixedSizeBinary);
      SetVisitor.prototype.visitDate = wrapSet(setDate);
      SetVisitor.prototype.visitDateDay = wrapSet(setDateDay);
      SetVisitor.prototype.visitDateMillisecond = wrapSet(setDateMillisecond);
      SetVisitor.prototype.visitTimestamp = wrapSet(setTimestamp);
      SetVisitor.prototype.visitTimestampSecond = wrapSet(setTimestampSecond);
      SetVisitor.prototype.visitTimestampMillisecond = wrapSet(setTimestampMillisecond);
      SetVisitor.prototype.visitTimestampMicrosecond = wrapSet(setTimestampMicrosecond);
      SetVisitor.prototype.visitTimestampNanosecond = wrapSet(setTimestampNanosecond);
      SetVisitor.prototype.visitTime = wrapSet(setTime);
      SetVisitor.prototype.visitTimeSecond = wrapSet(setTimeSecond);
      SetVisitor.prototype.visitTimeMillisecond = wrapSet(setTimeMillisecond);
      SetVisitor.prototype.visitTimeMicrosecond = wrapSet(setTimeMicrosecond);
      SetVisitor.prototype.visitTimeNanosecond = wrapSet(setTimeNanosecond);
      SetVisitor.prototype.visitDecimal = wrapSet(setDecimal);
      SetVisitor.prototype.visitList = wrapSet(setList);
      SetVisitor.prototype.visitStruct = wrapSet(setStruct);
      SetVisitor.prototype.visitUnion = wrapSet(setUnion);
      SetVisitor.prototype.visitDenseUnion = wrapSet(setDenseUnion);
      SetVisitor.prototype.visitSparseUnion = wrapSet(setSparseUnion);
      SetVisitor.prototype.visitDictionary = wrapSet(setDictionary);
      SetVisitor.prototype.visitInterval = wrapSet(setIntervalValue);
      SetVisitor.prototype.visitIntervalDayTime = wrapSet(setIntervalDayTime);
      SetVisitor.prototype.visitIntervalYearMonth = wrapSet(setIntervalYearMonth);
      SetVisitor.prototype.visitDuration = wrapSet(setDuration);
      SetVisitor.prototype.visitDurationSecond = wrapSet(setDurationSecond);
      SetVisitor.prototype.visitDurationMillisecond = wrapSet(setDurationMillisecond);
      SetVisitor.prototype.visitDurationMicrosecond = wrapSet(setDurationMicrosecond);
      SetVisitor.prototype.visitDurationNanosecond = wrapSet(setDurationNanosecond);
      SetVisitor.prototype.visitFixedSizeList = wrapSet(setFixedSizeList);
      SetVisitor.prototype.visitMap = wrapSet(setMap);
      instance = new SetVisitor();
    }
  });

  // node_modules/apache-arrow/row/struct.mjs
  var kParent, kRowIndex, StructRow, StructRowIterator, StructRowProxyHandler;
  var init_struct2 = __esm({
    "node_modules/apache-arrow/row/struct.mjs"() {
      init_pretty();
      init_get();
      init_set();
      kParent = Symbol.for("parent");
      kRowIndex = Symbol.for("rowIndex");
      StructRow = class {
        constructor(parent, rowIndex) {
          this[kParent] = parent;
          this[kRowIndex] = rowIndex;
          return new Proxy(this, new StructRowProxyHandler());
        }
        toArray() {
          return Object.values(this.toJSON());
        }
        toJSON() {
          const i = this[kRowIndex];
          const parent = this[kParent];
          const keys2 = parent.type.children;
          const json = {};
          for (let j = -1, n = keys2.length; ++j < n; ) {
            json[keys2[j].name] = instance2.visit(parent.children[j], i);
          }
          return json;
        }
        toString() {
          return `{${[...this].map(([key, val]) => `${valueToString(key)}: ${valueToString(val)}`).join(", ")}}`;
        }
        [Symbol.for("nodejs.util.inspect.custom")]() {
          return this.toString();
        }
        [Symbol.iterator]() {
          return new StructRowIterator(this[kParent], this[kRowIndex]);
        }
      };
      StructRowIterator = class {
        constructor(data, rowIndex) {
          this.childIndex = 0;
          this.children = data.children;
          this.rowIndex = rowIndex;
          this.childFields = data.type.children;
          this.numChildren = this.childFields.length;
        }
        [Symbol.iterator]() {
          return this;
        }
        next() {
          const i = this.childIndex;
          if (i < this.numChildren) {
            this.childIndex = i + 1;
            return {
              done: false,
              value: [
                this.childFields[i].name,
                instance2.visit(this.children[i], this.rowIndex)
              ]
            };
          }
          return { done: true, value: null };
        }
      };
      Object.defineProperties(StructRow.prototype, {
        [Symbol.toStringTag]: { enumerable: false, configurable: false, value: "Row" },
        [kParent]: { writable: true, enumerable: false, configurable: false, value: null },
        [kRowIndex]: { writable: true, enumerable: false, configurable: false, value: -1 }
      });
      StructRowProxyHandler = class {
        isExtensible() {
          return false;
        }
        deleteProperty() {
          return false;
        }
        preventExtensions() {
          return true;
        }
        ownKeys(row) {
          return row[kParent].type.children.map((f) => f.name);
        }
        has(row, key) {
          return row[kParent].type.children.findIndex((f) => f.name === key) !== -1;
        }
        getOwnPropertyDescriptor(row, key) {
          if (row[kParent].type.children.findIndex((f) => f.name === key) !== -1) {
            return { writable: true, enumerable: true, configurable: true };
          }
          return;
        }
        get(row, key) {
          if (Reflect.has(row, key)) {
            return row[key];
          }
          const idx = row[kParent].type.children.findIndex((f) => f.name === key);
          if (idx !== -1) {
            const val = instance2.visit(row[kParent].children[idx], row[kRowIndex]);
            Reflect.set(row, key, val);
            return val;
          }
        }
        set(row, key, val) {
          const idx = row[kParent].type.children.findIndex((f) => f.name === key);
          if (idx !== -1) {
            instance.visit(row[kParent].children[idx], row[kRowIndex], val);
            return Reflect.set(row, key, val);
          } else if (Reflect.has(row, key) || typeof key === "symbol") {
            return Reflect.set(row, key, val);
          }
          return false;
        }
      };
    }
  });

  // node_modules/apache-arrow/visitor/get.mjs
  function wrapGet(fn) {
    return (data, _1) => data.getValid(_1) ? fn(data, _1) : null;
  }
  var GetVisitor, epochDaysToMs, getNull, getVariableWidthBytes, getBool, getDateDay, getDateMillisecond, getNumeric, getFloat16, getBigInts, getFixedSizeBinary, getBinary, getUtf8, getInt, getFloat, getDate, getTimestampSecond, getTimestampMillisecond, getTimestampMicrosecond, getTimestampNanosecond, getTimestamp, getTimeSecond, getTimeMillisecond, getTimeMicrosecond, getTimeNanosecond, getTime, getDecimal, getList, getMap, getStruct, getUnion, getDenseUnion, getSparseUnion, getDictionary, getInterval, getIntervalDayTime, getIntervalYearMonth, getDurationSecond, getDurationMillisecond, getDurationMicrosecond, getDurationNanosecond, getDuration, getFixedSizeList, instance2;
  var init_get = __esm({
    "node_modules/apache-arrow/visitor/get.mjs"() {
      init_bn();
      init_vector2();
      init_visitor();
      init_map2();
      init_struct2();
      init_bigint();
      init_utf8();
      init_math();
      init_enum();
      GetVisitor = class extends Visitor {
      };
      epochDaysToMs = (data, index) => 864e5 * data[index];
      getNull = (_data, _index) => null;
      getVariableWidthBytes = (values, valueOffsets, index) => {
        if (index + 1 >= valueOffsets.length) {
          return null;
        }
        const x = bigIntToNumber(valueOffsets[index]);
        const y = bigIntToNumber(valueOffsets[index + 1]);
        return values.subarray(x, y);
      };
      getBool = ({ offset, values }, index) => {
        const idx = offset + index;
        const byte = values[idx >> 3];
        return (byte & 1 << idx % 8) !== 0;
      };
      getDateDay = ({ values }, index) => epochDaysToMs(values, index);
      getDateMillisecond = ({ values }, index) => bigIntToNumber(values[index]);
      getNumeric = ({ stride, values }, index) => values[stride * index];
      getFloat16 = ({ stride, values }, index) => uint16ToFloat64(values[stride * index]);
      getBigInts = ({ values }, index) => values[index];
      getFixedSizeBinary = ({ stride, values }, index) => values.subarray(stride * index, stride * (index + 1));
      getBinary = ({ values, valueOffsets }, index) => getVariableWidthBytes(values, valueOffsets, index);
      getUtf8 = ({ values, valueOffsets }, index) => {
        const bytes = getVariableWidthBytes(values, valueOffsets, index);
        return bytes !== null ? decodeUtf8(bytes) : null;
      };
      getInt = ({ values }, index) => values[index];
      getFloat = ({ type, values }, index) => type.precision !== Precision.HALF ? values[index] : uint16ToFloat64(values[index]);
      getDate = (data, index) => data.type.unit === DateUnit.DAY ? getDateDay(data, index) : getDateMillisecond(data, index);
      getTimestampSecond = ({ values }, index) => 1e3 * bigIntToNumber(values[index]);
      getTimestampMillisecond = ({ values }, index) => bigIntToNumber(values[index]);
      getTimestampMicrosecond = ({ values }, index) => divideBigInts(values[index], BigInt(1e3));
      getTimestampNanosecond = ({ values }, index) => divideBigInts(values[index], BigInt(1e6));
      getTimestamp = (data, index) => {
        switch (data.type.unit) {
          case TimeUnit.SECOND:
            return getTimestampSecond(data, index);
          case TimeUnit.MILLISECOND:
            return getTimestampMillisecond(data, index);
          case TimeUnit.MICROSECOND:
            return getTimestampMicrosecond(data, index);
          case TimeUnit.NANOSECOND:
            return getTimestampNanosecond(data, index);
        }
      };
      getTimeSecond = ({ values }, index) => values[index];
      getTimeMillisecond = ({ values }, index) => values[index];
      getTimeMicrosecond = ({ values }, index) => values[index];
      getTimeNanosecond = ({ values }, index) => values[index];
      getTime = (data, index) => {
        switch (data.type.unit) {
          case TimeUnit.SECOND:
            return getTimeSecond(data, index);
          case TimeUnit.MILLISECOND:
            return getTimeMillisecond(data, index);
          case TimeUnit.MICROSECOND:
            return getTimeMicrosecond(data, index);
          case TimeUnit.NANOSECOND:
            return getTimeNanosecond(data, index);
        }
      };
      getDecimal = ({ values, stride }, index) => BN.decimal(values.subarray(stride * index, stride * (index + 1)));
      getList = (data, index) => {
        const { valueOffsets, stride, children } = data;
        const { [index * stride]: begin, [index * stride + 1]: end } = valueOffsets;
        const child = children[0];
        const slice = child.slice(begin, end - begin);
        return new Vector([slice]);
      };
      getMap = (data, index) => {
        const { valueOffsets, children } = data;
        const { [index]: begin, [index + 1]: end } = valueOffsets;
        const child = children[0];
        return new MapRow(child.slice(begin, end - begin));
      };
      getStruct = (data, index) => {
        return new StructRow(data, index);
      };
      getUnion = (data, index) => {
        return data.type.mode === UnionMode.Dense ? getDenseUnion(data, index) : getSparseUnion(data, index);
      };
      getDenseUnion = (data, index) => {
        const childIndex = data.type.typeIdToChildIndex[data.typeIds[index]];
        const child = data.children[childIndex];
        return instance2.visit(child, data.valueOffsets[index]);
      };
      getSparseUnion = (data, index) => {
        const childIndex = data.type.typeIdToChildIndex[data.typeIds[index]];
        const child = data.children[childIndex];
        return instance2.visit(child, index);
      };
      getDictionary = (data, index) => {
        var _a5;
        return (_a5 = data.dictionary) === null || _a5 === void 0 ? void 0 : _a5.get(data.values[index]);
      };
      getInterval = (data, index) => data.type.unit === IntervalUnit.DAY_TIME ? getIntervalDayTime(data, index) : getIntervalYearMonth(data, index);
      getIntervalDayTime = ({ values }, index) => values.subarray(2 * index, 2 * (index + 1));
      getIntervalYearMonth = ({ values }, index) => {
        const interval = values[index];
        const int32s = new Int32Array(2);
        int32s[0] = Math.trunc(interval / 12);
        int32s[1] = Math.trunc(interval % 12);
        return int32s;
      };
      getDurationSecond = ({ values }, index) => values[index];
      getDurationMillisecond = ({ values }, index) => values[index];
      getDurationMicrosecond = ({ values }, index) => values[index];
      getDurationNanosecond = ({ values }, index) => values[index];
      getDuration = (data, index) => {
        switch (data.type.unit) {
          case TimeUnit.SECOND:
            return getDurationSecond(data, index);
          case TimeUnit.MILLISECOND:
            return getDurationMillisecond(data, index);
          case TimeUnit.MICROSECOND:
            return getDurationMicrosecond(data, index);
          case TimeUnit.NANOSECOND:
            return getDurationNanosecond(data, index);
        }
      };
      getFixedSizeList = (data, index) => {
        const { stride, children } = data;
        const child = children[0];
        const slice = child.slice(index * stride, stride);
        return new Vector([slice]);
      };
      GetVisitor.prototype.visitNull = wrapGet(getNull);
      GetVisitor.prototype.visitBool = wrapGet(getBool);
      GetVisitor.prototype.visitInt = wrapGet(getInt);
      GetVisitor.prototype.visitInt8 = wrapGet(getNumeric);
      GetVisitor.prototype.visitInt16 = wrapGet(getNumeric);
      GetVisitor.prototype.visitInt32 = wrapGet(getNumeric);
      GetVisitor.prototype.visitInt64 = wrapGet(getBigInts);
      GetVisitor.prototype.visitUint8 = wrapGet(getNumeric);
      GetVisitor.prototype.visitUint16 = wrapGet(getNumeric);
      GetVisitor.prototype.visitUint32 = wrapGet(getNumeric);
      GetVisitor.prototype.visitUint64 = wrapGet(getBigInts);
      GetVisitor.prototype.visitFloat = wrapGet(getFloat);
      GetVisitor.prototype.visitFloat16 = wrapGet(getFloat16);
      GetVisitor.prototype.visitFloat32 = wrapGet(getNumeric);
      GetVisitor.prototype.visitFloat64 = wrapGet(getNumeric);
      GetVisitor.prototype.visitUtf8 = wrapGet(getUtf8);
      GetVisitor.prototype.visitLargeUtf8 = wrapGet(getUtf8);
      GetVisitor.prototype.visitBinary = wrapGet(getBinary);
      GetVisitor.prototype.visitLargeBinary = wrapGet(getBinary);
      GetVisitor.prototype.visitFixedSizeBinary = wrapGet(getFixedSizeBinary);
      GetVisitor.prototype.visitDate = wrapGet(getDate);
      GetVisitor.prototype.visitDateDay = wrapGet(getDateDay);
      GetVisitor.prototype.visitDateMillisecond = wrapGet(getDateMillisecond);
      GetVisitor.prototype.visitTimestamp = wrapGet(getTimestamp);
      GetVisitor.prototype.visitTimestampSecond = wrapGet(getTimestampSecond);
      GetVisitor.prototype.visitTimestampMillisecond = wrapGet(getTimestampMillisecond);
      GetVisitor.prototype.visitTimestampMicrosecond = wrapGet(getTimestampMicrosecond);
      GetVisitor.prototype.visitTimestampNanosecond = wrapGet(getTimestampNanosecond);
      GetVisitor.prototype.visitTime = wrapGet(getTime);
      GetVisitor.prototype.visitTimeSecond = wrapGet(getTimeSecond);
      GetVisitor.prototype.visitTimeMillisecond = wrapGet(getTimeMillisecond);
      GetVisitor.prototype.visitTimeMicrosecond = wrapGet(getTimeMicrosecond);
      GetVisitor.prototype.visitTimeNanosecond = wrapGet(getTimeNanosecond);
      GetVisitor.prototype.visitDecimal = wrapGet(getDecimal);
      GetVisitor.prototype.visitList = wrapGet(getList);
      GetVisitor.prototype.visitStruct = wrapGet(getStruct);
      GetVisitor.prototype.visitUnion = wrapGet(getUnion);
      GetVisitor.prototype.visitDenseUnion = wrapGet(getDenseUnion);
      GetVisitor.prototype.visitSparseUnion = wrapGet(getSparseUnion);
      GetVisitor.prototype.visitDictionary = wrapGet(getDictionary);
      GetVisitor.prototype.visitInterval = wrapGet(getInterval);
      GetVisitor.prototype.visitIntervalDayTime = wrapGet(getIntervalDayTime);
      GetVisitor.prototype.visitIntervalYearMonth = wrapGet(getIntervalYearMonth);
      GetVisitor.prototype.visitDuration = wrapGet(getDuration);
      GetVisitor.prototype.visitDurationSecond = wrapGet(getDurationSecond);
      GetVisitor.prototype.visitDurationMillisecond = wrapGet(getDurationMillisecond);
      GetVisitor.prototype.visitDurationMicrosecond = wrapGet(getDurationMicrosecond);
      GetVisitor.prototype.visitDurationNanosecond = wrapGet(getDurationNanosecond);
      GetVisitor.prototype.visitFixedSizeList = wrapGet(getFixedSizeList);
      GetVisitor.prototype.visitMap = wrapGet(getMap);
      instance2 = new GetVisitor();
    }
  });

  // node_modules/apache-arrow/row/map.mjs
  var kKeys, kVals, kKeysAsStrings, _kKeysAsStrings, MapRow, MapRowIterator, MapRowProxyHandler;
  var init_map2 = __esm({
    "node_modules/apache-arrow/row/map.mjs"() {
      init_vector2();
      init_pretty();
      init_get();
      init_set();
      kKeys = Symbol.for("keys");
      kVals = Symbol.for("vals");
      kKeysAsStrings = Symbol.for("kKeysAsStrings");
      _kKeysAsStrings = Symbol.for("_kKeysAsStrings");
      MapRow = class {
        constructor(slice) {
          this[kKeys] = new Vector([slice.children[0]]).memoize();
          this[kVals] = slice.children[1];
          return new Proxy(this, new MapRowProxyHandler());
        }
        /** @ignore */
        get [kKeysAsStrings]() {
          return this[_kKeysAsStrings] || (this[_kKeysAsStrings] = Array.from(this[kKeys].toArray(), String));
        }
        [Symbol.iterator]() {
          return new MapRowIterator(this[kKeys], this[kVals]);
        }
        get size() {
          return this[kKeys].length;
        }
        toArray() {
          return Object.values(this.toJSON());
        }
        toJSON() {
          const keys2 = this[kKeys];
          const vals = this[kVals];
          const json = {};
          for (let i = -1, n = keys2.length; ++i < n; ) {
            json[keys2.get(i)] = instance2.visit(vals, i);
          }
          return json;
        }
        toString() {
          return `{${[...this].map(([key, val]) => `${valueToString(key)}: ${valueToString(val)}`).join(", ")}}`;
        }
        [Symbol.for("nodejs.util.inspect.custom")]() {
          return this.toString();
        }
      };
      MapRowIterator = class {
        constructor(keys2, vals) {
          this.keys = keys2;
          this.vals = vals;
          this.keyIndex = 0;
          this.numKeys = keys2.length;
        }
        [Symbol.iterator]() {
          return this;
        }
        next() {
          const i = this.keyIndex;
          if (i === this.numKeys) {
            return { done: true, value: null };
          }
          this.keyIndex++;
          return {
            done: false,
            value: [
              this.keys.get(i),
              instance2.visit(this.vals, i)
            ]
          };
        }
      };
      MapRowProxyHandler = class {
        isExtensible() {
          return false;
        }
        deleteProperty() {
          return false;
        }
        preventExtensions() {
          return true;
        }
        ownKeys(row) {
          return row[kKeysAsStrings];
        }
        has(row, key) {
          return row[kKeysAsStrings].includes(key);
        }
        getOwnPropertyDescriptor(row, key) {
          const idx = row[kKeysAsStrings].indexOf(key);
          if (idx !== -1) {
            return { writable: true, enumerable: true, configurable: true };
          }
          return;
        }
        get(row, key) {
          if (Reflect.has(row, key)) {
            return row[key];
          }
          const idx = row[kKeysAsStrings].indexOf(key);
          if (idx !== -1) {
            const val = instance2.visit(Reflect.get(row, kVals), idx);
            Reflect.set(row, key, val);
            return val;
          }
        }
        set(row, key, val) {
          const idx = row[kKeysAsStrings].indexOf(key);
          if (idx !== -1) {
            instance.visit(Reflect.get(row, kVals), idx, val);
            return Reflect.set(row, key, val);
          } else if (Reflect.has(row, key)) {
            return Reflect.set(row, key, val);
          }
          return false;
        }
      };
      Object.defineProperties(MapRow.prototype, {
        [Symbol.toStringTag]: { enumerable: false, configurable: false, value: "Row" },
        [kKeys]: { writable: true, enumerable: false, configurable: false, value: null },
        [kVals]: { writable: true, enumerable: false, configurable: false, value: null },
        [_kKeysAsStrings]: { writable: true, enumerable: false, configurable: false, value: null }
      });
    }
  });

  // node_modules/apache-arrow/util/vector.mjs
  var vector_exports = {};
  __export(vector_exports, {
    clampRange: () => clampRange,
    createElementComparator: () => createElementComparator,
    wrapIndex: () => wrapIndex
  });
  function clampRange(source, begin, end, then) {
    const { length: len = 0 } = source;
    let lhs = typeof begin !== "number" ? 0 : begin;
    let rhs = typeof end !== "number" ? len : end;
    lhs < 0 && (lhs = (lhs % len + len) % len);
    rhs < 0 && (rhs = (rhs % len + len) % len);
    rhs < lhs && (tmp = lhs, lhs = rhs, rhs = tmp);
    rhs > len && (rhs = len);
    return then ? then(source, lhs, rhs) : [lhs, rhs];
  }
  function createElementComparator(search) {
    const typeofSearch = typeof search;
    if (typeofSearch !== "object" || search === null) {
      if (isNaNFast(search)) {
        return isNaNFast;
      }
      return (value) => value === search;
    }
    if (search instanceof Date) {
      const valueOfSearch = search.valueOf();
      return (value) => value instanceof Date ? value.valueOf() === valueOfSearch : false;
    }
    if (ArrayBuffer.isView(search)) {
      return (value) => value ? compareArrayLike(search, value) : false;
    }
    if (search instanceof Map) {
      return createMapComparator(search);
    }
    if (Array.isArray(search)) {
      return createArrayLikeComparator(search);
    }
    if (search instanceof Vector) {
      return createVectorComparator(search);
    }
    return createObjectComparator(search, true);
  }
  function createArrayLikeComparator(lhs) {
    const comparators = [];
    for (let i = -1, n = lhs.length; ++i < n; ) {
      comparators[i] = createElementComparator(lhs[i]);
    }
    return createSubElementsComparator(comparators);
  }
  function createMapComparator(lhs) {
    let i = -1;
    const comparators = [];
    for (const v of lhs.values())
      comparators[++i] = createElementComparator(v);
    return createSubElementsComparator(comparators);
  }
  function createVectorComparator(lhs) {
    const comparators = [];
    for (let i = -1, n = lhs.length; ++i < n; ) {
      comparators[i] = createElementComparator(lhs.get(i));
    }
    return createSubElementsComparator(comparators);
  }
  function createObjectComparator(lhs, allowEmpty = false) {
    const keys2 = Object.keys(lhs);
    if (!allowEmpty && keys2.length === 0) {
      return () => false;
    }
    const comparators = [];
    for (let i = -1, n = keys2.length; ++i < n; ) {
      comparators[i] = createElementComparator(lhs[keys2[i]]);
    }
    return createSubElementsComparator(comparators, keys2);
  }
  function createSubElementsComparator(comparators, keys2) {
    return (rhs) => {
      if (!rhs || typeof rhs !== "object") {
        return false;
      }
      switch (rhs.constructor) {
        case Array:
          return compareArray(comparators, rhs);
        case Map:
          return compareObject(comparators, rhs, rhs.keys());
        case MapRow:
        case StructRow:
        case Object:
        case void 0:
          return compareObject(comparators, rhs, keys2 || Object.keys(rhs));
      }
      return rhs instanceof Vector ? compareVector(comparators, rhs) : false;
    };
  }
  function compareArray(comparators, arr) {
    const n = comparators.length;
    if (arr.length !== n) {
      return false;
    }
    for (let i = -1; ++i < n; ) {
      if (!comparators[i](arr[i])) {
        return false;
      }
    }
    return true;
  }
  function compareVector(comparators, vec) {
    const n = comparators.length;
    if (vec.length !== n) {
      return false;
    }
    for (let i = -1; ++i < n; ) {
      if (!comparators[i](vec.get(i))) {
        return false;
      }
    }
    return true;
  }
  function compareObject(comparators, obj, keys2) {
    const lKeyItr = keys2[Symbol.iterator]();
    const rKeyItr = obj instanceof Map ? obj.keys() : Object.keys(obj)[Symbol.iterator]();
    const rValItr = obj instanceof Map ? obj.values() : Object.values(obj)[Symbol.iterator]();
    let i = 0;
    const n = comparators.length;
    let rVal = rValItr.next();
    let lKey = lKeyItr.next();
    let rKey = rKeyItr.next();
    for (; i < n && !lKey.done && !rKey.done && !rVal.done; ++i, lKey = lKeyItr.next(), rKey = rKeyItr.next(), rVal = rValItr.next()) {
      if (lKey.value !== rKey.value || !comparators[i](rVal.value)) {
        break;
      }
    }
    if (i === n && lKey.done && rKey.done && rVal.done) {
      return true;
    }
    lKeyItr.return && lKeyItr.return();
    rKeyItr.return && rKeyItr.return();
    rValItr.return && rValItr.return();
    return false;
  }
  var tmp, wrapIndex, isNaNFast;
  var init_vector = __esm({
    "node_modules/apache-arrow/util/vector.mjs"() {
      init_vector2();
      init_map2();
      init_struct2();
      init_buffer();
      wrapIndex = (index, len) => index < 0 ? len + index : index;
      isNaNFast = (value) => value !== value;
    }
  });

  // node_modules/apache-arrow/util/bit.mjs
  var bit_exports = {};
  __export(bit_exports, {
    BitIterator: () => BitIterator,
    getBit: () => getBit,
    getBool: () => getBool2,
    packBools: () => packBools,
    popcnt_array: () => popcnt_array,
    popcnt_bit_range: () => popcnt_bit_range,
    popcnt_uint32: () => popcnt_uint32,
    setBool: () => setBool2,
    truncateBitmap: () => truncateBitmap
  });
  function getBool2(_data, _index, byte, bit) {
    return (byte & 1 << bit) !== 0;
  }
  function getBit(_data, _index, byte, bit) {
    return (byte & 1 << bit) >> bit;
  }
  function setBool2(bytes, index, value) {
    return value ? !!(bytes[index >> 3] |= 1 << index % 8) || true : !(bytes[index >> 3] &= ~(1 << index % 8)) && false;
  }
  function truncateBitmap(offset, length, bitmap) {
    const alignedSize = bitmap.byteLength + 7 & ~7;
    if (offset > 0 || bitmap.byteLength < alignedSize) {
      const bytes = new Uint8Array(alignedSize);
      bytes.set(offset % 8 === 0 ? bitmap.subarray(offset >> 3) : (
        // Otherwise iterate each bit from the offset and return a new one
        packBools(new BitIterator(bitmap, offset, length, null, getBool2)).subarray(0, alignedSize)
      ));
      return bytes;
    }
    return bitmap;
  }
  function packBools(values) {
    const xs = [];
    let i = 0, bit = 0, byte = 0;
    for (const value of values) {
      value && (byte |= 1 << bit);
      if (++bit === 8) {
        xs[i++] = byte;
        byte = bit = 0;
      }
    }
    if (i === 0 || bit > 0) {
      xs[i++] = byte;
    }
    const b = new Uint8Array(xs.length + 7 & ~7);
    b.set(xs);
    return b;
  }
  function popcnt_bit_range(data, lhs, rhs) {
    if (rhs - lhs <= 0) {
      return 0;
    }
    if (rhs - lhs < 8) {
      let sum = 0;
      for (const bit of new BitIterator(data, lhs, rhs - lhs, data, getBit)) {
        sum += bit;
      }
      return sum;
    }
    const rhsInside = rhs >> 3 << 3;
    const lhsInside = lhs + (lhs % 8 === 0 ? 0 : 8 - lhs % 8);
    return (
      // Get the popcnt of bits between the left hand side, and the next highest multiple of 8
      popcnt_bit_range(data, lhs, lhsInside) + // Get the popcnt of bits between the right hand side, and the next lowest multiple of 8
      popcnt_bit_range(data, rhsInside, rhs) + // Get the popcnt of all bits between the left and right hand sides' multiples of 8
      popcnt_array(data, lhsInside >> 3, rhsInside - lhsInside >> 3)
    );
  }
  function popcnt_array(arr, byteOffset, byteLength) {
    let cnt = 0, pos = Math.trunc(byteOffset);
    const view = new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
    const len = byteLength === void 0 ? arr.byteLength : pos + byteLength;
    while (len - pos >= 4) {
      cnt += popcnt_uint32(view.getUint32(pos));
      pos += 4;
    }
    while (len - pos >= 2) {
      cnt += popcnt_uint32(view.getUint16(pos));
      pos += 2;
    }
    while (len - pos >= 1) {
      cnt += popcnt_uint32(view.getUint8(pos));
      pos += 1;
    }
    return cnt;
  }
  function popcnt_uint32(uint32) {
    let i = Math.trunc(uint32);
    i = i - (i >>> 1 & 1431655765);
    i = (i & 858993459) + (i >>> 2 & 858993459);
    return (i + (i >>> 4) & 252645135) * 16843009 >>> 24;
  }
  var BitIterator;
  var init_bit = __esm({
    "node_modules/apache-arrow/util/bit.mjs"() {
      BitIterator = class {
        constructor(bytes, begin, length, context, get) {
          this.bytes = bytes;
          this.length = length;
          this.context = context;
          this.get = get;
          this.bit = begin % 8;
          this.byteIndex = begin >> 3;
          this.byte = bytes[this.byteIndex++];
          this.index = 0;
        }
        next() {
          if (this.index < this.length) {
            if (this.bit === 8) {
              this.bit = 0;
              this.byte = this.bytes[this.byteIndex++];
            }
            return {
              value: this.get(this.context, this.index++, this.byte, this.bit++)
            };
          }
          return { done: true, value: null };
        }
        [Symbol.iterator]() {
          return this;
        }
      };
    }
  });

  // node_modules/apache-arrow/data.mjs
  function makeData(props) {
    return makeDataVisitor.visit(props);
  }
  var kUnknownNullCount, Data, MakeDataVisitor, makeDataVisitor;
  var init_data = __esm({
    "node_modules/apache-arrow/data.mjs"() {
      init_vector2();
      init_enum();
      init_type2();
      init_bit();
      init_visitor();
      init_buffer();
      kUnknownNullCount = -1;
      Data = class _Data {
        get typeId() {
          return this.type.typeId;
        }
        get ArrayType() {
          return this.type.ArrayType;
        }
        get buffers() {
          return [this.valueOffsets, this.values, this.nullBitmap, this.typeIds];
        }
        get nullable() {
          if (this._nullCount !== 0) {
            const { type } = this;
            if (DataType.isSparseUnion(type)) {
              return this.children.some((child) => child.nullable);
            } else if (DataType.isDenseUnion(type)) {
              return this.children.some((child) => child.nullable);
            }
            return this.nullBitmap && this.nullBitmap.byteLength > 0;
          }
          return true;
        }
        get byteLength() {
          let byteLength = 0;
          const { valueOffsets, values, nullBitmap, typeIds } = this;
          valueOffsets && (byteLength += valueOffsets.byteLength);
          values && (byteLength += values.byteLength);
          nullBitmap && (byteLength += nullBitmap.byteLength);
          typeIds && (byteLength += typeIds.byteLength);
          return this.children.reduce((byteLength2, child) => byteLength2 + child.byteLength, byteLength);
        }
        get nullCount() {
          if (DataType.isUnion(this.type)) {
            return this.children.reduce((nullCount2, child) => nullCount2 + child.nullCount, 0);
          }
          let nullCount = this._nullCount;
          let nullBitmap;
          if (nullCount <= kUnknownNullCount && (nullBitmap = this.nullBitmap)) {
            this._nullCount = nullCount = nullBitmap.length === 0 ? (
              // no null bitmap, so all values are valid
              0
            ) : this.length - popcnt_bit_range(nullBitmap, this.offset, this.offset + this.length);
          }
          return nullCount;
        }
        constructor(type, offset, length, nullCount, buffers, children = [], dictionary) {
          this.type = type;
          this.children = children;
          this.dictionary = dictionary;
          this.offset = Math.floor(Math.max(offset || 0, 0));
          this.length = Math.floor(Math.max(length || 0, 0));
          this._nullCount = Math.floor(Math.max(nullCount || 0, -1));
          let buffer;
          if (buffers instanceof _Data) {
            this.stride = buffers.stride;
            this.values = buffers.values;
            this.typeIds = buffers.typeIds;
            this.nullBitmap = buffers.nullBitmap;
            this.valueOffsets = buffers.valueOffsets;
          } else {
            this.stride = strideForType(type);
            if (buffers) {
              (buffer = buffers[0]) && (this.valueOffsets = buffer);
              (buffer = buffers[1]) && (this.values = buffer);
              (buffer = buffers[2]) && (this.nullBitmap = buffer);
              (buffer = buffers[3]) && (this.typeIds = buffer);
            }
          }
        }
        getValid(index) {
          const { type } = this;
          if (DataType.isUnion(type)) {
            const union = type;
            const child = this.children[union.typeIdToChildIndex[this.typeIds[index]]];
            const indexInChild = union.mode === UnionMode.Dense ? this.valueOffsets[index] : index;
            return child.getValid(indexInChild);
          }
          if (this.nullable && this.nullCount > 0) {
            const pos = this.offset + index;
            const val = this.nullBitmap[pos >> 3];
            return (val & 1 << pos % 8) !== 0;
          }
          return true;
        }
        setValid(index, value) {
          let prev;
          const { type } = this;
          if (DataType.isUnion(type)) {
            const union = type;
            const child = this.children[union.typeIdToChildIndex[this.typeIds[index]]];
            const indexInChild = union.mode === UnionMode.Dense ? this.valueOffsets[index] : index;
            prev = child.getValid(indexInChild);
            child.setValid(indexInChild, value);
          } else {
            let { nullBitmap } = this;
            const { offset, length } = this;
            const idx = offset + index;
            const mask = 1 << idx % 8;
            const byteOffset = idx >> 3;
            if (!nullBitmap || nullBitmap.byteLength <= byteOffset) {
              nullBitmap = new Uint8Array((offset + length + 63 & ~63) >> 3).fill(255);
              if (this.nullCount > 0) {
                nullBitmap.set(truncateBitmap(offset, length, this.nullBitmap), 0);
                Object.assign(this, { nullBitmap });
              } else {
                Object.assign(this, { nullBitmap, _nullCount: 0 });
              }
            }
            const byte = nullBitmap[byteOffset];
            prev = (byte & mask) !== 0;
            nullBitmap[byteOffset] = value ? byte | mask : byte & ~mask;
          }
          if (prev !== !!value) {
            this._nullCount = this.nullCount + (value ? -1 : 1);
          }
          return value;
        }
        clone(type = this.type, offset = this.offset, length = this.length, nullCount = this._nullCount, buffers = this, children = this.children) {
          return new _Data(type, offset, length, nullCount, buffers, children, this.dictionary);
        }
        slice(offset, length) {
          const { stride, typeId, children } = this;
          const nullCount = +(this._nullCount === 0) - 1;
          const childStride = typeId === 16 ? stride : 1;
          const buffers = this._sliceBuffers(offset, length, stride, typeId);
          return this.clone(
            this.type,
            this.offset + offset,
            length,
            nullCount,
            buffers,
            // Don't slice children if we have value offsets (the variable-width types)
            children.length === 0 || this.valueOffsets ? children : this._sliceChildren(children, childStride * offset, childStride * length)
          );
        }
        _changeLengthAndBackfillNullBitmap(newLength) {
          if (this.typeId === Type2.Null) {
            return this.clone(this.type, 0, newLength, 0);
          }
          const { length, nullCount } = this;
          const bitmap = new Uint8Array((newLength + 63 & ~63) >> 3).fill(255, 0, length >> 3);
          bitmap[length >> 3] = (1 << length - (length & ~7)) - 1;
          if (nullCount > 0) {
            bitmap.set(truncateBitmap(this.offset, length, this.nullBitmap), 0);
          }
          const buffers = this.buffers;
          buffers[BufferType.VALIDITY] = bitmap;
          return this.clone(this.type, 0, newLength, nullCount + (newLength - length), buffers);
        }
        _sliceBuffers(offset, length, stride, typeId) {
          let arr;
          const { buffers } = this;
          (arr = buffers[BufferType.TYPE]) && (buffers[BufferType.TYPE] = arr.subarray(offset, offset + length));
          (arr = buffers[BufferType.OFFSET]) && (buffers[BufferType.OFFSET] = arr.subarray(offset, offset + length + 1)) || // Otherwise if no offsets, slice the data buffer. Don't slice the data vector for Booleans, since the offset goes by bits not bytes
          (arr = buffers[BufferType.DATA]) && (buffers[BufferType.DATA] = typeId === 6 ? arr : arr.subarray(stride * offset, stride * (offset + length)));
          return buffers;
        }
        _sliceChildren(children, offset, length) {
          return children.map((child) => child.slice(offset, length));
        }
      };
      Data.prototype.children = Object.freeze([]);
      MakeDataVisitor = class _MakeDataVisitor extends Visitor {
        visit(props) {
          return this.getVisitFn(props["type"]).call(this, props);
        }
        visitNull(props) {
          const { ["type"]: type, ["offset"]: offset = 0, ["length"]: length = 0 } = props;
          return new Data(type, offset, length, length);
        }
        visitBool(props) {
          const { ["type"]: type, ["offset"]: offset = 0 } = props;
          const nullBitmap = toUint8Array(props["nullBitmap"]);
          const data = toArrayBufferView(type.ArrayType, props["data"]);
          const { ["length"]: length = data.length >> 3, ["nullCount"]: nullCount = props["nullBitmap"] ? -1 : 0 } = props;
          return new Data(type, offset, length, nullCount, [void 0, data, nullBitmap]);
        }
        visitInt(props) {
          const { ["type"]: type, ["offset"]: offset = 0 } = props;
          const nullBitmap = toUint8Array(props["nullBitmap"]);
          const data = toArrayBufferView(type.ArrayType, props["data"]);
          const { ["length"]: length = data.length, ["nullCount"]: nullCount = props["nullBitmap"] ? -1 : 0 } = props;
          return new Data(type, offset, length, nullCount, [void 0, data, nullBitmap]);
        }
        visitFloat(props) {
          const { ["type"]: type, ["offset"]: offset = 0 } = props;
          const nullBitmap = toUint8Array(props["nullBitmap"]);
          const data = toArrayBufferView(type.ArrayType, props["data"]);
          const { ["length"]: length = data.length, ["nullCount"]: nullCount = props["nullBitmap"] ? -1 : 0 } = props;
          return new Data(type, offset, length, nullCount, [void 0, data, nullBitmap]);
        }
        visitUtf8(props) {
          const { ["type"]: type, ["offset"]: offset = 0 } = props;
          const data = toUint8Array(props["data"]);
          const nullBitmap = toUint8Array(props["nullBitmap"]);
          const valueOffsets = toInt32Array(props["valueOffsets"]);
          const { ["length"]: length = valueOffsets.length - 1, ["nullCount"]: nullCount = props["nullBitmap"] ? -1 : 0 } = props;
          return new Data(type, offset, length, nullCount, [valueOffsets, data, nullBitmap]);
        }
        visitLargeUtf8(props) {
          const { ["type"]: type, ["offset"]: offset = 0 } = props;
          const data = toUint8Array(props["data"]);
          const nullBitmap = toUint8Array(props["nullBitmap"]);
          const valueOffsets = toBigInt64Array(props["valueOffsets"]);
          const { ["length"]: length = valueOffsets.length - 1, ["nullCount"]: nullCount = props["nullBitmap"] ? -1 : 0 } = props;
          return new Data(type, offset, length, nullCount, [valueOffsets, data, nullBitmap]);
        }
        visitBinary(props) {
          const { ["type"]: type, ["offset"]: offset = 0 } = props;
          const data = toUint8Array(props["data"]);
          const nullBitmap = toUint8Array(props["nullBitmap"]);
          const valueOffsets = toInt32Array(props["valueOffsets"]);
          const { ["length"]: length = valueOffsets.length - 1, ["nullCount"]: nullCount = props["nullBitmap"] ? -1 : 0 } = props;
          return new Data(type, offset, length, nullCount, [valueOffsets, data, nullBitmap]);
        }
        visitLargeBinary(props) {
          const { ["type"]: type, ["offset"]: offset = 0 } = props;
          const data = toUint8Array(props["data"]);
          const nullBitmap = toUint8Array(props["nullBitmap"]);
          const valueOffsets = toBigInt64Array(props["valueOffsets"]);
          const { ["length"]: length = valueOffsets.length - 1, ["nullCount"]: nullCount = props["nullBitmap"] ? -1 : 0 } = props;
          return new Data(type, offset, length, nullCount, [valueOffsets, data, nullBitmap]);
        }
        visitFixedSizeBinary(props) {
          const { ["type"]: type, ["offset"]: offset = 0 } = props;
          const nullBitmap = toUint8Array(props["nullBitmap"]);
          const data = toArrayBufferView(type.ArrayType, props["data"]);
          const { ["length"]: length = data.length / strideForType(type), ["nullCount"]: nullCount = props["nullBitmap"] ? -1 : 0 } = props;
          return new Data(type, offset, length, nullCount, [void 0, data, nullBitmap]);
        }
        visitDate(props) {
          const { ["type"]: type, ["offset"]: offset = 0 } = props;
          const nullBitmap = toUint8Array(props["nullBitmap"]);
          const data = toArrayBufferView(type.ArrayType, props["data"]);
          const { ["length"]: length = data.length / strideForType(type), ["nullCount"]: nullCount = props["nullBitmap"] ? -1 : 0 } = props;
          return new Data(type, offset, length, nullCount, [void 0, data, nullBitmap]);
        }
        visitTimestamp(props) {
          const { ["type"]: type, ["offset"]: offset = 0 } = props;
          const nullBitmap = toUint8Array(props["nullBitmap"]);
          const data = toArrayBufferView(type.ArrayType, props["data"]);
          const { ["length"]: length = data.length / strideForType(type), ["nullCount"]: nullCount = props["nullBitmap"] ? -1 : 0 } = props;
          return new Data(type, offset, length, nullCount, [void 0, data, nullBitmap]);
        }
        visitTime(props) {
          const { ["type"]: type, ["offset"]: offset = 0 } = props;
          const nullBitmap = toUint8Array(props["nullBitmap"]);
          const data = toArrayBufferView(type.ArrayType, props["data"]);
          const { ["length"]: length = data.length / strideForType(type), ["nullCount"]: nullCount = props["nullBitmap"] ? -1 : 0 } = props;
          return new Data(type, offset, length, nullCount, [void 0, data, nullBitmap]);
        }
        visitDecimal(props) {
          const { ["type"]: type, ["offset"]: offset = 0 } = props;
          const nullBitmap = toUint8Array(props["nullBitmap"]);
          const data = toArrayBufferView(type.ArrayType, props["data"]);
          const { ["length"]: length = data.length / strideForType(type), ["nullCount"]: nullCount = props["nullBitmap"] ? -1 : 0 } = props;
          return new Data(type, offset, length, nullCount, [void 0, data, nullBitmap]);
        }
        visitList(props) {
          const { ["type"]: type, ["offset"]: offset = 0, ["child"]: child } = props;
          const nullBitmap = toUint8Array(props["nullBitmap"]);
          const valueOffsets = toInt32Array(props["valueOffsets"]);
          const { ["length"]: length = valueOffsets.length - 1, ["nullCount"]: nullCount = props["nullBitmap"] ? -1 : 0 } = props;
          return new Data(type, offset, length, nullCount, [valueOffsets, void 0, nullBitmap], [child]);
        }
        visitStruct(props) {
          const { ["type"]: type, ["offset"]: offset = 0, ["children"]: children = [] } = props;
          const nullBitmap = toUint8Array(props["nullBitmap"]);
          const { length = children.reduce((len, { length: length2 }) => Math.max(len, length2), 0), nullCount = props["nullBitmap"] ? -1 : 0 } = props;
          return new Data(type, offset, length, nullCount, [void 0, void 0, nullBitmap], children);
        }
        visitUnion(props) {
          const { ["type"]: type, ["offset"]: offset = 0, ["children"]: children = [] } = props;
          const typeIds = toArrayBufferView(type.ArrayType, props["typeIds"]);
          const { ["length"]: length = typeIds.length, ["nullCount"]: nullCount = -1 } = props;
          if (DataType.isSparseUnion(type)) {
            return new Data(type, offset, length, nullCount, [void 0, void 0, void 0, typeIds], children);
          }
          const valueOffsets = toInt32Array(props["valueOffsets"]);
          return new Data(type, offset, length, nullCount, [valueOffsets, void 0, void 0, typeIds], children);
        }
        visitDictionary(props) {
          const { ["type"]: type, ["offset"]: offset = 0 } = props;
          const nullBitmap = toUint8Array(props["nullBitmap"]);
          const data = toArrayBufferView(type.indices.ArrayType, props["data"]);
          const { ["dictionary"]: dictionary = new Vector([new _MakeDataVisitor().visit({ type: type.dictionary })]) } = props;
          const { ["length"]: length = data.length, ["nullCount"]: nullCount = props["nullBitmap"] ? -1 : 0 } = props;
          return new Data(type, offset, length, nullCount, [void 0, data, nullBitmap], [], dictionary);
        }
        visitInterval(props) {
          const { ["type"]: type, ["offset"]: offset = 0 } = props;
          const nullBitmap = toUint8Array(props["nullBitmap"]);
          const data = toArrayBufferView(type.ArrayType, props["data"]);
          const { ["length"]: length = data.length / strideForType(type), ["nullCount"]: nullCount = props["nullBitmap"] ? -1 : 0 } = props;
          return new Data(type, offset, length, nullCount, [void 0, data, nullBitmap]);
        }
        visitDuration(props) {
          const { ["type"]: type, ["offset"]: offset = 0 } = props;
          const nullBitmap = toUint8Array(props["nullBitmap"]);
          const data = toArrayBufferView(type.ArrayType, props["data"]);
          const { ["length"]: length = data.length, ["nullCount"]: nullCount = props["nullBitmap"] ? -1 : 0 } = props;
          return new Data(type, offset, length, nullCount, [void 0, data, nullBitmap]);
        }
        visitFixedSizeList(props) {
          const { ["type"]: type, ["offset"]: offset = 0, ["child"]: child = new _MakeDataVisitor().visit({ type: type.valueType }) } = props;
          const nullBitmap = toUint8Array(props["nullBitmap"]);
          const { ["length"]: length = child.length / strideForType(type), ["nullCount"]: nullCount = props["nullBitmap"] ? -1 : 0 } = props;
          return new Data(type, offset, length, nullCount, [void 0, void 0, nullBitmap], [child]);
        }
        visitMap(props) {
          const { ["type"]: type, ["offset"]: offset = 0, ["child"]: child = new _MakeDataVisitor().visit({ type: type.childType }) } = props;
          const nullBitmap = toUint8Array(props["nullBitmap"]);
          const valueOffsets = toInt32Array(props["valueOffsets"]);
          const { ["length"]: length = valueOffsets.length - 1, ["nullCount"]: nullCount = props["nullBitmap"] ? -1 : 0 } = props;
          return new Data(type, offset, length, nullCount, [valueOffsets, void 0, nullBitmap], [child]);
        }
      };
      makeDataVisitor = new MakeDataVisitor();
    }
  });

  // node_modules/apache-arrow/util/chunk.mjs
  function computeChunkNullable(chunks) {
    return chunks.some((chunk) => chunk.nullable);
  }
  function computeChunkNullCounts(chunks) {
    return chunks.reduce((nullCount, chunk) => nullCount + chunk.nullCount, 0);
  }
  function computeChunkOffsets(chunks) {
    return chunks.reduce((offsets, chunk, index) => {
      offsets[index + 1] = offsets[index] + chunk.length;
      return offsets;
    }, new Uint32Array(chunks.length + 1));
  }
  function sliceChunks(chunks, offsets, begin, end) {
    const slices = [];
    for (let i = -1, n = chunks.length; ++i < n; ) {
      const chunk = chunks[i];
      const offset = offsets[i];
      const { length } = chunk;
      if (offset >= end) {
        break;
      }
      if (begin >= offset + length) {
        continue;
      }
      if (offset >= begin && offset + length <= end) {
        slices.push(chunk);
        continue;
      }
      const from = Math.max(0, begin - offset);
      const to = Math.min(end - offset, length);
      slices.push(chunk.slice(from, to - from));
    }
    if (slices.length === 0) {
      slices.push(chunks[0].slice(0, 0));
    }
    return slices;
  }
  function binarySearch(chunks, offsets, idx, fn) {
    let lhs = 0, mid = 0, rhs = offsets.length - 1;
    do {
      if (lhs >= rhs - 1) {
        return idx < offsets[rhs] ? fn(chunks, lhs, idx - offsets[lhs]) : null;
      }
      mid = lhs + Math.trunc((rhs - lhs) * 0.5);
      idx < offsets[mid] ? rhs = mid : lhs = mid;
    } while (lhs < rhs);
  }
  function isChunkedValid(data, index) {
    return data.getValid(index);
  }
  function wrapChunkedCall1(fn) {
    function chunkedFn(chunks, i, j) {
      return fn(chunks[i], j);
    }
    return function(index) {
      const data = this.data;
      return binarySearch(data, this._offsets, index, chunkedFn);
    };
  }
  function wrapChunkedCall2(fn) {
    let _2;
    function chunkedFn(chunks, i, j) {
      return fn(chunks[i], j, _2);
    }
    return function(index, value) {
      const data = this.data;
      _2 = value;
      const result = binarySearch(data, this._offsets, index, chunkedFn);
      _2 = void 0;
      return result;
    };
  }
  function wrapChunkedIndexOf(indexOf) {
    let _1;
    function chunkedIndexOf(data, chunkIndex, fromIndex) {
      let begin = fromIndex, index = 0, total = 0;
      for (let i = chunkIndex - 1, n = data.length; ++i < n; ) {
        const chunk = data[i];
        if (~(index = indexOf(chunk, _1, begin))) {
          return total + index;
        }
        begin = 0;
        total += chunk.length;
      }
      return -1;
    }
    return function(element, offset) {
      _1 = element;
      const data = this.data;
      const result = typeof offset !== "number" ? chunkedIndexOf(data, 0, 0) : binarySearch(data, this._offsets, offset, chunkedIndexOf);
      _1 = void 0;
      return result;
    };
  }
  var ChunkedIterator;
  var init_chunk = __esm({
    "node_modules/apache-arrow/util/chunk.mjs"() {
      ChunkedIterator = class {
        constructor(numChunks = 0, getChunkIterator) {
          this.numChunks = numChunks;
          this.getChunkIterator = getChunkIterator;
          this.chunkIndex = 0;
          this.chunkIterator = this.getChunkIterator(0);
        }
        next() {
          while (this.chunkIndex < this.numChunks) {
            const next = this.chunkIterator.next();
            if (!next.done) {
              return next;
            }
            if (++this.chunkIndex < this.numChunks) {
              this.chunkIterator = this.getChunkIterator(this.chunkIndex);
            }
          }
          return { done: true, value: null };
        }
        [Symbol.iterator]() {
          return this;
        }
      };
    }
  });

  // node_modules/apache-arrow/visitor/indexof.mjs
  function nullIndexOf(data, searchElement) {
    return searchElement === null && data.length > 0 ? 0 : -1;
  }
  function indexOfNull(data, fromIndex) {
    const { nullBitmap } = data;
    if (!nullBitmap || data.nullCount <= 0) {
      return -1;
    }
    let i = 0;
    for (const isValid of new BitIterator(nullBitmap, data.offset + (fromIndex || 0), data.length, nullBitmap, getBool2)) {
      if (!isValid) {
        return i;
      }
      ++i;
    }
    return -1;
  }
  function indexOfValue(data, searchElement, fromIndex) {
    if (searchElement === void 0) {
      return -1;
    }
    if (searchElement === null) {
      switch (data.typeId) {
        // Unions don't have a nullBitmap of its own, so compare the `searchElement` to `get()`.
        case Type2.Union:
          break;
        // Dictionaries do have a nullBitmap, but their dictionary could also have null elements.
        case Type2.Dictionary:
          break;
        // All other types can iterate the null bitmap
        default:
          return indexOfNull(data, fromIndex);
      }
    }
    const get = instance2.getVisitFn(data);
    const compare = createElementComparator(searchElement);
    for (let i = (fromIndex || 0) - 1, n = data.length; ++i < n; ) {
      if (compare(get(data, i))) {
        return i;
      }
    }
    return -1;
  }
  function indexOfUnion(data, searchElement, fromIndex) {
    const get = instance2.getVisitFn(data);
    const compare = createElementComparator(searchElement);
    for (let i = (fromIndex || 0) - 1, n = data.length; ++i < n; ) {
      if (compare(get(data, i))) {
        return i;
      }
    }
    return -1;
  }
  var IndexOfVisitor, instance3;
  var init_indexof = __esm({
    "node_modules/apache-arrow/visitor/indexof.mjs"() {
      init_enum();
      init_visitor();
      init_get();
      init_bit();
      init_vector();
      IndexOfVisitor = class extends Visitor {
      };
      IndexOfVisitor.prototype.visitNull = nullIndexOf;
      IndexOfVisitor.prototype.visitBool = indexOfValue;
      IndexOfVisitor.prototype.visitInt = indexOfValue;
      IndexOfVisitor.prototype.visitInt8 = indexOfValue;
      IndexOfVisitor.prototype.visitInt16 = indexOfValue;
      IndexOfVisitor.prototype.visitInt32 = indexOfValue;
      IndexOfVisitor.prototype.visitInt64 = indexOfValue;
      IndexOfVisitor.prototype.visitUint8 = indexOfValue;
      IndexOfVisitor.prototype.visitUint16 = indexOfValue;
      IndexOfVisitor.prototype.visitUint32 = indexOfValue;
      IndexOfVisitor.prototype.visitUint64 = indexOfValue;
      IndexOfVisitor.prototype.visitFloat = indexOfValue;
      IndexOfVisitor.prototype.visitFloat16 = indexOfValue;
      IndexOfVisitor.prototype.visitFloat32 = indexOfValue;
      IndexOfVisitor.prototype.visitFloat64 = indexOfValue;
      IndexOfVisitor.prototype.visitUtf8 = indexOfValue;
      IndexOfVisitor.prototype.visitLargeUtf8 = indexOfValue;
      IndexOfVisitor.prototype.visitBinary = indexOfValue;
      IndexOfVisitor.prototype.visitLargeBinary = indexOfValue;
      IndexOfVisitor.prototype.visitFixedSizeBinary = indexOfValue;
      IndexOfVisitor.prototype.visitDate = indexOfValue;
      IndexOfVisitor.prototype.visitDateDay = indexOfValue;
      IndexOfVisitor.prototype.visitDateMillisecond = indexOfValue;
      IndexOfVisitor.prototype.visitTimestamp = indexOfValue;
      IndexOfVisitor.prototype.visitTimestampSecond = indexOfValue;
      IndexOfVisitor.prototype.visitTimestampMillisecond = indexOfValue;
      IndexOfVisitor.prototype.visitTimestampMicrosecond = indexOfValue;
      IndexOfVisitor.prototype.visitTimestampNanosecond = indexOfValue;
      IndexOfVisitor.prototype.visitTime = indexOfValue;
      IndexOfVisitor.prototype.visitTimeSecond = indexOfValue;
      IndexOfVisitor.prototype.visitTimeMillisecond = indexOfValue;
      IndexOfVisitor.prototype.visitTimeMicrosecond = indexOfValue;
      IndexOfVisitor.prototype.visitTimeNanosecond = indexOfValue;
      IndexOfVisitor.prototype.visitDecimal = indexOfValue;
      IndexOfVisitor.prototype.visitList = indexOfValue;
      IndexOfVisitor.prototype.visitStruct = indexOfValue;
      IndexOfVisitor.prototype.visitUnion = indexOfValue;
      IndexOfVisitor.prototype.visitDenseUnion = indexOfUnion;
      IndexOfVisitor.prototype.visitSparseUnion = indexOfUnion;
      IndexOfVisitor.prototype.visitDictionary = indexOfValue;
      IndexOfVisitor.prototype.visitInterval = indexOfValue;
      IndexOfVisitor.prototype.visitIntervalDayTime = indexOfValue;
      IndexOfVisitor.prototype.visitIntervalYearMonth = indexOfValue;
      IndexOfVisitor.prototype.visitDuration = indexOfValue;
      IndexOfVisitor.prototype.visitDurationSecond = indexOfValue;
      IndexOfVisitor.prototype.visitDurationMillisecond = indexOfValue;
      IndexOfVisitor.prototype.visitDurationMicrosecond = indexOfValue;
      IndexOfVisitor.prototype.visitDurationNanosecond = indexOfValue;
      IndexOfVisitor.prototype.visitFixedSizeList = indexOfValue;
      IndexOfVisitor.prototype.visitMap = indexOfValue;
      instance3 = new IndexOfVisitor();
    }
  });

  // node_modules/apache-arrow/visitor/iterator.mjs
  function vectorIterator(vector) {
    const { type } = vector;
    if (vector.nullCount === 0 && vector.stride === 1 && // Don't defer to native iterator for timestamps since Numbers are expected
    // (DataType.isTimestamp(type)) && type.unit === TimeUnit.MILLISECOND ||
    (DataType.isInt(type) && type.bitWidth !== 64 || DataType.isTime(type) && type.bitWidth !== 64 || DataType.isFloat(type) && type.precision !== Precision.HALF)) {
      return new ChunkedIterator(vector.data.length, (chunkIndex) => {
        const data = vector.data[chunkIndex];
        return data.values.subarray(0, data.length)[Symbol.iterator]();
      });
    }
    let offset = 0;
    return new ChunkedIterator(vector.data.length, (chunkIndex) => {
      const data = vector.data[chunkIndex];
      const length = data.length;
      const inner = vector.slice(offset, offset + length);
      offset += length;
      return new VectorIterator(inner);
    });
  }
  var IteratorVisitor, VectorIterator, instance4;
  var init_iterator = __esm({
    "node_modules/apache-arrow/visitor/iterator.mjs"() {
      init_visitor();
      init_enum();
      init_type2();
      init_chunk();
      IteratorVisitor = class extends Visitor {
      };
      VectorIterator = class {
        constructor(vector) {
          this.vector = vector;
          this.index = 0;
        }
        next() {
          if (this.index < this.vector.length) {
            return {
              value: this.vector.get(this.index++)
            };
          }
          return { done: true, value: null };
        }
        [Symbol.iterator]() {
          return this;
        }
      };
      IteratorVisitor.prototype.visitNull = vectorIterator;
      IteratorVisitor.prototype.visitBool = vectorIterator;
      IteratorVisitor.prototype.visitInt = vectorIterator;
      IteratorVisitor.prototype.visitInt8 = vectorIterator;
      IteratorVisitor.prototype.visitInt16 = vectorIterator;
      IteratorVisitor.prototype.visitInt32 = vectorIterator;
      IteratorVisitor.prototype.visitInt64 = vectorIterator;
      IteratorVisitor.prototype.visitUint8 = vectorIterator;
      IteratorVisitor.prototype.visitUint16 = vectorIterator;
      IteratorVisitor.prototype.visitUint32 = vectorIterator;
      IteratorVisitor.prototype.visitUint64 = vectorIterator;
      IteratorVisitor.prototype.visitFloat = vectorIterator;
      IteratorVisitor.prototype.visitFloat16 = vectorIterator;
      IteratorVisitor.prototype.visitFloat32 = vectorIterator;
      IteratorVisitor.prototype.visitFloat64 = vectorIterator;
      IteratorVisitor.prototype.visitUtf8 = vectorIterator;
      IteratorVisitor.prototype.visitLargeUtf8 = vectorIterator;
      IteratorVisitor.prototype.visitBinary = vectorIterator;
      IteratorVisitor.prototype.visitLargeBinary = vectorIterator;
      IteratorVisitor.prototype.visitFixedSizeBinary = vectorIterator;
      IteratorVisitor.prototype.visitDate = vectorIterator;
      IteratorVisitor.prototype.visitDateDay = vectorIterator;
      IteratorVisitor.prototype.visitDateMillisecond = vectorIterator;
      IteratorVisitor.prototype.visitTimestamp = vectorIterator;
      IteratorVisitor.prototype.visitTimestampSecond = vectorIterator;
      IteratorVisitor.prototype.visitTimestampMillisecond = vectorIterator;
      IteratorVisitor.prototype.visitTimestampMicrosecond = vectorIterator;
      IteratorVisitor.prototype.visitTimestampNanosecond = vectorIterator;
      IteratorVisitor.prototype.visitTime = vectorIterator;
      IteratorVisitor.prototype.visitTimeSecond = vectorIterator;
      IteratorVisitor.prototype.visitTimeMillisecond = vectorIterator;
      IteratorVisitor.prototype.visitTimeMicrosecond = vectorIterator;
      IteratorVisitor.prototype.visitTimeNanosecond = vectorIterator;
      IteratorVisitor.prototype.visitDecimal = vectorIterator;
      IteratorVisitor.prototype.visitList = vectorIterator;
      IteratorVisitor.prototype.visitStruct = vectorIterator;
      IteratorVisitor.prototype.visitUnion = vectorIterator;
      IteratorVisitor.prototype.visitDenseUnion = vectorIterator;
      IteratorVisitor.prototype.visitSparseUnion = vectorIterator;
      IteratorVisitor.prototype.visitDictionary = vectorIterator;
      IteratorVisitor.prototype.visitInterval = vectorIterator;
      IteratorVisitor.prototype.visitIntervalDayTime = vectorIterator;
      IteratorVisitor.prototype.visitIntervalYearMonth = vectorIterator;
      IteratorVisitor.prototype.visitDuration = vectorIterator;
      IteratorVisitor.prototype.visitDurationSecond = vectorIterator;
      IteratorVisitor.prototype.visitDurationMillisecond = vectorIterator;
      IteratorVisitor.prototype.visitDurationMicrosecond = vectorIterator;
      IteratorVisitor.prototype.visitDurationNanosecond = vectorIterator;
      IteratorVisitor.prototype.visitFixedSizeList = vectorIterator;
      IteratorVisitor.prototype.visitMap = vectorIterator;
      instance4 = new IteratorVisitor();
    }
  });

  // node_modules/apache-arrow/vector.mjs
  function makeVector(init) {
    if (init) {
      if (init instanceof Data) {
        return new Vector([init]);
      }
      if (init instanceof Vector) {
        return new Vector(init.data);
      }
      if (init.type instanceof DataType) {
        return new Vector([makeData(init)]);
      }
      if (Array.isArray(init)) {
        return new Vector(init.flatMap((v) => unwrapInputs(v)));
      }
      if (ArrayBuffer.isView(init)) {
        if (init instanceof DataView) {
          init = new Uint8Array(init.buffer);
        }
        const props = { offset: 0, length: init.length, nullCount: -1, data: init };
        if (init instanceof Int8Array) {
          return new Vector([makeData(Object.assign(Object.assign({}, props), { type: new Int8() }))]);
        }
        if (init instanceof Int16Array) {
          return new Vector([makeData(Object.assign(Object.assign({}, props), { type: new Int16() }))]);
        }
        if (init instanceof Int32Array) {
          return new Vector([makeData(Object.assign(Object.assign({}, props), { type: new Int32() }))]);
        }
        if (init instanceof BigInt64Array) {
          return new Vector([makeData(Object.assign(Object.assign({}, props), { type: new Int64() }))]);
        }
        if (init instanceof Uint8Array || init instanceof Uint8ClampedArray) {
          return new Vector([makeData(Object.assign(Object.assign({}, props), { type: new Uint8() }))]);
        }
        if (init instanceof Uint16Array) {
          return new Vector([makeData(Object.assign(Object.assign({}, props), { type: new Uint16() }))]);
        }
        if (init instanceof Uint32Array) {
          return new Vector([makeData(Object.assign(Object.assign({}, props), { type: new Uint32() }))]);
        }
        if (init instanceof BigUint64Array) {
          return new Vector([makeData(Object.assign(Object.assign({}, props), { type: new Uint64() }))]);
        }
        if (init instanceof Float32Array) {
          return new Vector([makeData(Object.assign(Object.assign({}, props), { type: new Float32() }))]);
        }
        if (init instanceof Float64Array) {
          return new Vector([makeData(Object.assign(Object.assign({}, props), { type: new Float64() }))]);
        }
        throw new Error("Unrecognized input");
      }
    }
    throw new Error("Unrecognized input");
  }
  function unwrapInputs(x) {
    return x instanceof Data ? [x] : x instanceof Vector ? x.data : makeVector(x).data;
  }
  var _a2, visitorsByTypeId, vectorPrototypesByTypeId, Vector, MemoizedVector;
  var init_vector2 = __esm({
    "node_modules/apache-arrow/vector.mjs"() {
      init_enum();
      init_vector();
      init_type2();
      init_data();
      init_chunk();
      init_get();
      init_set();
      init_indexof();
      init_iterator();
      init_type2();
      visitorsByTypeId = {};
      vectorPrototypesByTypeId = {};
      Vector = class _Vector {
        constructor(input) {
          var _b2, _c2, _d2;
          const data = input[0] instanceof _Vector ? input.flatMap((x) => x.data) : input;
          if (data.length === 0 || data.some((x) => !(x instanceof Data))) {
            throw new TypeError("Vector constructor expects an Array of Data instances.");
          }
          const type = (_b2 = data[0]) === null || _b2 === void 0 ? void 0 : _b2.type;
          switch (data.length) {
            case 0:
              this._offsets = [0];
              break;
            case 1: {
              const { get, set, indexOf } = visitorsByTypeId[type.typeId];
              const unchunkedData = data[0];
              this.isValid = (index) => isChunkedValid(unchunkedData, index);
              this.get = (index) => get(unchunkedData, index);
              this.set = (index, value) => set(unchunkedData, index, value);
              this.indexOf = (index) => indexOf(unchunkedData, index);
              this._offsets = [0, unchunkedData.length];
              break;
            }
            default:
              Object.setPrototypeOf(this, vectorPrototypesByTypeId[type.typeId]);
              this._offsets = computeChunkOffsets(data);
              break;
          }
          this.data = data;
          this.type = type;
          this.stride = strideForType(type);
          this.numChildren = (_d2 = (_c2 = type.children) === null || _c2 === void 0 ? void 0 : _c2.length) !== null && _d2 !== void 0 ? _d2 : 0;
          this.length = this._offsets.at(-1);
        }
        /**
         * The aggregate size (in bytes) of this Vector's buffers and/or child Vectors.
         */
        get byteLength() {
          return this.data.reduce((byteLength, data) => byteLength + data.byteLength, 0);
        }
        /**
         * Whether this Vector's elements can contain null values.
         */
        get nullable() {
          return computeChunkNullable(this.data);
        }
        /**
         * The number of null elements in this Vector.
         */
        get nullCount() {
          return computeChunkNullCounts(this.data);
        }
        /**
         * The Array or TypedArray constructor used for the JS representation
         *  of the element's values in {@link Vector.prototype.toArray `toArray()`}.
         */
        get ArrayType() {
          return this.type.ArrayType;
        }
        /**
         * The name that should be printed when the Vector is logged in a message.
         */
        get [Symbol.toStringTag]() {
          return `${this.VectorName}<${this.type[Symbol.toStringTag]}>`;
        }
        /**
         * The name of this Vector.
         */
        get VectorName() {
          return `${Type2[this.type.typeId]}Vector`;
        }
        /**
         * Check whether an element is null.
         * @param index The index at which to read the validity bitmap.
         */
        // @ts-ignore
        isValid(index) {
          return false;
        }
        /**
         * Get an element value by position.
         * @param index The index of the element to read.
         */
        // @ts-ignore
        get(index) {
          return null;
        }
        /**
         * Get an element value by position.
         * @param index The index of the element to read. A negative index will count back from the last element.
         */
        at(index) {
          return this.get(wrapIndex(index, this.length));
        }
        /**
         * Set an element value by position.
         * @param index The index of the element to write.
         * @param value The value to set.
         */
        // @ts-ignore
        set(index, value) {
          return;
        }
        /**
         * Retrieve the index of the first occurrence of a value in an Vector.
         * @param element The value to locate in the Vector.
         * @param offset The index at which to begin the search. If offset is omitted, the search starts at index 0.
         */
        // @ts-ignore
        indexOf(element, offset) {
          return -1;
        }
        includes(element, offset) {
          return this.indexOf(element, offset) > -1;
        }
        /**
         * Iterator for the Vector's elements.
         */
        [Symbol.iterator]() {
          return instance4.visit(this);
        }
        /**
         * Combines two or more Vectors of the same type.
         * @param others Additional Vectors to add to the end of this Vector.
         */
        concat(...others) {
          return new _Vector(this.data.concat(others.flatMap((x) => x.data).flat(Number.POSITIVE_INFINITY)));
        }
        /**
         * Return a zero-copy sub-section of this Vector.
         * @param start The beginning of the specified portion of the Vector.
         * @param end The end of the specified portion of the Vector. This is exclusive of the element at the index 'end'.
         */
        slice(begin, end) {
          return new _Vector(clampRange(this, begin, end, ({ data, _offsets }, begin2, end2) => sliceChunks(data, _offsets, begin2, end2)));
        }
        toJSON() {
          return [...this];
        }
        /**
         * Return a JavaScript Array or TypedArray of the Vector's elements.
         *
         * @note If this Vector contains a single Data chunk and the Vector's type is a
         *  primitive numeric type corresponding to one of the JavaScript TypedArrays, this
         *  method returns a zero-copy slice of the underlying TypedArray values. If there's
         *  more than one chunk, the resulting TypedArray will be a copy of the data from each
         *  chunk's underlying TypedArray values.
         *
         * @returns An Array or TypedArray of the Vector's elements, based on the Vector's DataType.
         */
        toArray() {
          const { type, data, length, stride, ArrayType } = this;
          switch (type.typeId) {
            case Type2.Int:
            case Type2.Float:
            case Type2.Decimal:
            case Type2.Time:
            case Type2.Timestamp:
              switch (data.length) {
                case 0:
                  return new ArrayType();
                case 1:
                  return data[0].values.subarray(0, length * stride);
                default:
                  return data.reduce((memo, { values, length: chunk_length }) => {
                    memo.array.set(values.subarray(0, chunk_length * stride), memo.offset);
                    memo.offset += chunk_length * stride;
                    return memo;
                  }, { array: new ArrayType(length * stride), offset: 0 }).array;
              }
          }
          return [...this];
        }
        /**
         * Returns a string representation of the Vector.
         *
         * @returns A string representation of the Vector.
         */
        toString() {
          return `[${[...this].join(",")}]`;
        }
        /**
         * Returns a child Vector by name, or null if this Vector has no child with the given name.
         * @param name The name of the child to retrieve.
         */
        getChild(name) {
          var _b2;
          return this.getChildAt((_b2 = this.type.children) === null || _b2 === void 0 ? void 0 : _b2.findIndex((f) => f.name === name));
        }
        /**
         * Returns a child Vector by index, or null if this Vector has no child at the supplied index.
         * @param index The index of the child to retrieve.
         */
        getChildAt(index) {
          if (index > -1 && index < this.numChildren) {
            return new _Vector(this.data.map(({ children }) => children[index]));
          }
          return null;
        }
        get isMemoized() {
          if (DataType.isDictionary(this.type)) {
            return this.data[0].dictionary.isMemoized;
          }
          return false;
        }
        /**
         * Adds memoization to the Vector's {@link get} method. For dictionary
         * vectors, this method return a vector that memoizes only the dictionary
         * values.
         *
         * Memoization is very useful when decoding a value is expensive such as
         * Utf8. The memoization creates a cache of the size of the Vector and
         * therefore increases memory usage.
         *
         * @returns A new vector that memoizes calls to {@link get}.
         */
        memoize() {
          if (DataType.isDictionary(this.type)) {
            const dictionary = new MemoizedVector(this.data[0].dictionary);
            const newData = this.data.map((data) => {
              const cloned = data.clone();
              cloned.dictionary = dictionary;
              return cloned;
            });
            return new _Vector(newData);
          }
          return new MemoizedVector(this);
        }
        /**
         * Returns a vector without memoization of the {@link get} method. If this
         * vector is not memoized, this method returns this vector.
         *
         * @returns A new vector without memoization.
         */
        unmemoize() {
          if (DataType.isDictionary(this.type) && this.isMemoized) {
            const dictionary = this.data[0].dictionary.unmemoize();
            const newData = this.data.map((data) => {
              const newData2 = data.clone();
              newData2.dictionary = dictionary;
              return newData2;
            });
            return new _Vector(newData);
          }
          return this;
        }
      };
      _a2 = Symbol.toStringTag;
      Vector[_a2] = ((proto) => {
        proto.type = DataType.prototype;
        proto.data = [];
        proto.length = 0;
        proto.stride = 1;
        proto.numChildren = 0;
        proto._offsets = new Uint32Array([0]);
        proto[Symbol.isConcatSpreadable] = true;
        const typeIds = Object.keys(Type2).map((T) => Type2[T]).filter((T) => typeof T === "number" && T !== Type2.NONE);
        for (const typeId of typeIds) {
          const get = instance2.getVisitFnByTypeId(typeId);
          const set = instance.getVisitFnByTypeId(typeId);
          const indexOf = instance3.getVisitFnByTypeId(typeId);
          visitorsByTypeId[typeId] = { get, set, indexOf };
          vectorPrototypesByTypeId[typeId] = Object.create(proto, {
            ["isValid"]: { value: wrapChunkedCall1(isChunkedValid) },
            ["get"]: { value: wrapChunkedCall1(instance2.getVisitFnByTypeId(typeId)) },
            ["set"]: { value: wrapChunkedCall2(instance.getVisitFnByTypeId(typeId)) },
            ["indexOf"]: { value: wrapChunkedIndexOf(instance3.getVisitFnByTypeId(typeId)) }
          });
        }
        return "Vector";
      })(Vector.prototype);
      MemoizedVector = class _MemoizedVector extends Vector {
        constructor(vector) {
          super(vector.data);
          const get = this.get;
          const set = this.set;
          const slice = this.slice;
          const cache = new Array(this.length);
          Object.defineProperty(this, "get", {
            value(index) {
              const cachedValue = cache[index];
              if (cachedValue !== void 0) {
                return cachedValue;
              }
              const value = get.call(this, index);
              cache[index] = value;
              return value;
            }
          });
          Object.defineProperty(this, "set", {
            value(index, value) {
              set.call(this, index, value);
              cache[index] = value;
            }
          });
          Object.defineProperty(this, "slice", {
            value: (begin, end) => new _MemoizedVector(slice.call(this, begin, end))
          });
          Object.defineProperty(this, "isMemoized", { value: true });
          Object.defineProperty(this, "unmemoize", {
            value: () => new Vector(this.data)
          });
          Object.defineProperty(this, "memoize", {
            value: () => this
          });
        }
      };
    }
  });

  // node_modules/apache-arrow/builder/valid.mjs
  function createIsValidFunction(nullValues) {
    if (!nullValues || nullValues.length <= 0) {
      return function isValid(value) {
        return true;
      };
    }
    let fnBody = "";
    const noNaNs = nullValues.filter((x) => x === x);
    if (noNaNs.length > 0) {
      fnBody = `
    switch (x) {${noNaNs.map((x) => `
        case ${valueToCase(x)}:`).join("")}
            return false;
    }`;
    }
    if (nullValues.length !== noNaNs.length) {
      fnBody = `if (x !== x) return false;
${fnBody}`;
    }
    return new Function(`x`, `${fnBody}
return true;`);
  }
  function valueToCase(x) {
    if (typeof x !== "bigint") {
      return valueToString(x);
    }
    return `${valueToString(x)}n`;
  }
  var init_valid = __esm({
    "node_modules/apache-arrow/builder/valid.mjs"() {
      init_pretty();
    }
  });

  // node_modules/apache-arrow/builder/buffer.mjs
  function roundLengthUpToNearest64Bytes(len, BPE) {
    const bytesMinus1 = Math.ceil(len) * BPE - 1;
    return (bytesMinus1 - bytesMinus1 % 64 + 64 || 64) / BPE;
  }
  function resizeArray(arr, len = 0) {
    return arr.length >= len ? arr.subarray(0, len) : memcpy(new arr.constructor(len), arr, 0);
  }
  var BufferBuilder, DataBufferBuilder, BitmapBufferBuilder, OffsetsBufferBuilder;
  var init_buffer3 = __esm({
    "node_modules/apache-arrow/builder/buffer.mjs"() {
      init_buffer();
      BufferBuilder = class {
        constructor(bufferType, initialSize = 0, stride = 1) {
          this.length = Math.ceil(initialSize / stride);
          this.buffer = new bufferType(this.length);
          this.stride = stride;
          this.BYTES_PER_ELEMENT = bufferType.BYTES_PER_ELEMENT;
          this.ArrayType = bufferType;
        }
        get byteLength() {
          return Math.ceil(this.length * this.stride) * this.BYTES_PER_ELEMENT;
        }
        get reservedLength() {
          return this.buffer.length / this.stride;
        }
        get reservedByteLength() {
          return this.buffer.byteLength;
        }
        // @ts-ignore
        set(index, value) {
          return this;
        }
        append(value) {
          return this.set(this.length, value);
        }
        reserve(extra) {
          if (extra > 0) {
            this.length += extra;
            const stride = this.stride;
            const length = this.length * stride;
            const reserved = this.buffer.length;
            if (length >= reserved) {
              this._resize(reserved === 0 ? roundLengthUpToNearest64Bytes(length * 1, this.BYTES_PER_ELEMENT) : roundLengthUpToNearest64Bytes(length * 2, this.BYTES_PER_ELEMENT));
            }
          }
          return this;
        }
        flush(length = this.length) {
          length = roundLengthUpToNearest64Bytes(length * this.stride, this.BYTES_PER_ELEMENT);
          const array = resizeArray(this.buffer, length);
          this.clear();
          return array;
        }
        clear() {
          this.length = 0;
          this.buffer = new this.ArrayType();
          return this;
        }
        _resize(newLength) {
          return this.buffer = resizeArray(this.buffer, newLength);
        }
      };
      DataBufferBuilder = class extends BufferBuilder {
        last() {
          return this.get(this.length - 1);
        }
        get(index) {
          return this.buffer[index];
        }
        set(index, value) {
          this.reserve(index - this.length + 1);
          this.buffer[index * this.stride] = value;
          return this;
        }
      };
      BitmapBufferBuilder = class extends DataBufferBuilder {
        constructor() {
          super(Uint8Array, 0, 1 / 8);
          this.numValid = 0;
        }
        get numInvalid() {
          return this.length - this.numValid;
        }
        get(idx) {
          return this.buffer[idx >> 3] >> idx % 8 & 1;
        }
        set(idx, val) {
          const { buffer } = this.reserve(idx - this.length + 1);
          const byte = idx >> 3, bit = idx % 8, cur = buffer[byte] >> bit & 1;
          val ? cur === 0 && (buffer[byte] |= 1 << bit, ++this.numValid) : cur === 1 && (buffer[byte] &= ~(1 << bit), --this.numValid);
          return this;
        }
        clear() {
          this.numValid = 0;
          return super.clear();
        }
      };
      OffsetsBufferBuilder = class extends DataBufferBuilder {
        constructor(type) {
          super(type.OffsetArrayType, 1, 1);
        }
        append(value) {
          return this.set(this.length - 1, value);
        }
        set(index, value) {
          const offset = this.length - 1;
          const buffer = this.reserve(index - offset + 1).buffer;
          if (offset < index++ && offset >= 0) {
            buffer.fill(buffer[offset], offset, index);
          }
          buffer[index] = buffer[index - 1] + value;
          return this;
        }
        flush(length = this.length - 1) {
          if (length > this.length) {
            this.set(length - 1, this.BYTES_PER_ELEMENT > 4 ? BigInt(0) : 0);
          }
          return super.flush(length + 1);
        }
      };
    }
  });

  // node_modules/apache-arrow/builder.mjs
  var Builder2, FixedWidthBuilder, VariableWidthBuilder;
  var init_builder2 = __esm({
    "node_modules/apache-arrow/builder.mjs"() {
      init_vector2();
      init_data();
      init_map2();
      init_type2();
      init_valid();
      init_buffer3();
      Builder2 = class {
        /** @nocollapse */
        // @ts-ignore
        static throughNode(options) {
          throw new Error(`"throughNode" not available in this environment`);
        }
        /** @nocollapse */
        // @ts-ignore
        static throughDOM(options) {
          throw new Error(`"throughDOM" not available in this environment`);
        }
        /**
         * Construct a builder with the given Arrow DataType with optional null values,
         * which will be interpreted as "null" when set or appended to the `Builder`.
         * @param {{ type: T, nullValues?: any[] }} options A `BuilderOptions` object used to create this `Builder`.
         */
        constructor({ "type": type, "nullValues": nulls }) {
          this.length = 0;
          this.finished = false;
          this.type = type;
          this.children = [];
          this.nullValues = nulls;
          this.stride = strideForType(type);
          this._nulls = new BitmapBufferBuilder();
          if (nulls && nulls.length > 0) {
            this._isValid = createIsValidFunction(nulls);
          }
        }
        /**
         * Flush the `Builder` and return a `Vector<T>`.
         * @returns {Vector<T>} A `Vector<T>` of the flushed values.
         */
        toVector() {
          return new Vector([this.flush()]);
        }
        get ArrayType() {
          return this.type.ArrayType;
        }
        get nullCount() {
          return this._nulls.numInvalid;
        }
        get numChildren() {
          return this.children.length;
        }
        /**
         * @returns The aggregate length (in bytes) of the values that have been written.
         */
        get byteLength() {
          let size = 0;
          const { _offsets, _values, _nulls, _typeIds, children } = this;
          _offsets && (size += _offsets.byteLength);
          _values && (size += _values.byteLength);
          _nulls && (size += _nulls.byteLength);
          _typeIds && (size += _typeIds.byteLength);
          return children.reduce((size2, child) => size2 + child.byteLength, size);
        }
        /**
         * @returns The aggregate number of rows that have been reserved to write new values.
         */
        get reservedLength() {
          return this._nulls.reservedLength;
        }
        /**
         * @returns The aggregate length (in bytes) that has been reserved to write new values.
         */
        get reservedByteLength() {
          let size = 0;
          this._offsets && (size += this._offsets.reservedByteLength);
          this._values && (size += this._values.reservedByteLength);
          this._nulls && (size += this._nulls.reservedByteLength);
          this._typeIds && (size += this._typeIds.reservedByteLength);
          return this.children.reduce((size2, child) => size2 + child.reservedByteLength, size);
        }
        get valueOffsets() {
          return this._offsets ? this._offsets.buffer : null;
        }
        get values() {
          return this._values ? this._values.buffer : null;
        }
        get nullBitmap() {
          return this._nulls ? this._nulls.buffer : null;
        }
        get typeIds() {
          return this._typeIds ? this._typeIds.buffer : null;
        }
        /**
         * Appends a value (or null) to this `Builder`.
         * This is equivalent to `builder.set(builder.length, value)`.
         * @param {T['TValue'] | TNull } value The value to append.
         */
        append(value) {
          return this.set(this.length, value);
        }
        /**
         * Validates whether a value is valid (true), or null (false)
         * @param {T['TValue'] | TNull } value The value to compare against null the value representations
         */
        isValid(value) {
          return this._isValid(value);
        }
        /**
         * Write a value (or null-value sentinel) at the supplied index.
         * If the value matches one of the null-value representations, a 1-bit is
         * written to the null `BitmapBufferBuilder`. Otherwise, a 0 is written to
         * the null `BitmapBufferBuilder`, and the value is passed to
         * `Builder.prototype.setValue()`.
         * @param {number} index The index of the value to write.
         * @param {T['TValue'] | TNull } value The value to write at the supplied index.
         * @returns {this} The updated `Builder` instance.
         */
        set(index, value) {
          if (this.setValid(index, this.isValid(value))) {
            this.setValue(index, value);
          }
          return this;
        }
        /**
         * Write a value to the underlying buffers at the supplied index, bypassing
         * the null-value check. This is a low-level method that
         * @param {number} index
         * @param {T['TValue'] | TNull } value
         */
        setValue(index, value) {
          this._setValue(this, index, value);
        }
        setValid(index, valid) {
          this.length = this._nulls.set(index, +valid).length;
          return valid;
        }
        // @ts-ignore
        addChild(child, name = `${this.numChildren}`) {
          throw new Error(`Cannot append children to non-nested type "${this.type}"`);
        }
        /**
         * Retrieve the child `Builder` at the supplied `index`, or null if no child
         * exists at that index.
         * @param {number} index The index of the child `Builder` to retrieve.
         * @returns {Builder | null} The child Builder at the supplied index or null.
         */
        getChildAt(index) {
          return this.children[index] || null;
        }
        /**
         * Commit all the values that have been written to their underlying
         * ArrayBuffers, including any child Builders if applicable, and reset
         * the internal `Builder` state.
         * @returns A `Data<T>` of the buffers and children representing the values written.
         */
        flush() {
          let data;
          let typeIds;
          let nullBitmap;
          let valueOffsets;
          const { type, length, nullCount, _typeIds, _offsets, _values, _nulls } = this;
          if (typeIds = _typeIds === null || _typeIds === void 0 ? void 0 : _typeIds.flush(length)) {
            valueOffsets = _offsets === null || _offsets === void 0 ? void 0 : _offsets.flush(length);
          } else if (valueOffsets = _offsets === null || _offsets === void 0 ? void 0 : _offsets.flush(length)) {
            data = _values === null || _values === void 0 ? void 0 : _values.flush(_offsets.last());
          } else {
            data = _values === null || _values === void 0 ? void 0 : _values.flush(length);
          }
          if (nullCount > 0) {
            nullBitmap = _nulls === null || _nulls === void 0 ? void 0 : _nulls.flush(length);
          }
          const children = this.children.map((child) => child.flush());
          this.clear();
          return makeData({
            type,
            length,
            nullCount,
            children,
            "child": children[0],
            data,
            typeIds,
            nullBitmap,
            valueOffsets
          });
        }
        /**
         * Finalize this `Builder`, and child builders if applicable.
         * @returns {this} The finalized `Builder` instance.
         */
        finish() {
          this.finished = true;
          for (const child of this.children)
            child.finish();
          return this;
        }
        /**
         * Clear this Builder's internal state, including child Builders if applicable, and reset the length to 0.
         * @returns {this} The cleared `Builder` instance.
         */
        clear() {
          var _a5, _b2, _c2, _d2;
          this.length = 0;
          (_a5 = this._nulls) === null || _a5 === void 0 ? void 0 : _a5.clear();
          (_b2 = this._values) === null || _b2 === void 0 ? void 0 : _b2.clear();
          (_c2 = this._offsets) === null || _c2 === void 0 ? void 0 : _c2.clear();
          (_d2 = this._typeIds) === null || _d2 === void 0 ? void 0 : _d2.clear();
          for (const child of this.children)
            child.clear();
          return this;
        }
      };
      Builder2.prototype.length = 1;
      Builder2.prototype.stride = 1;
      Builder2.prototype.children = null;
      Builder2.prototype.finished = false;
      Builder2.prototype.nullValues = null;
      Builder2.prototype._isValid = () => true;
      FixedWidthBuilder = class extends Builder2 {
        constructor(opts) {
          super(opts);
          this._values = new DataBufferBuilder(this.ArrayType, 0, this.stride);
        }
        setValue(index, value) {
          const values = this._values;
          values.reserve(index - values.length + 1);
          return super.setValue(index, value);
        }
      };
      VariableWidthBuilder = class extends Builder2 {
        constructor(opts) {
          super(opts);
          this._pendingLength = 0;
          this._offsets = new OffsetsBufferBuilder(opts.type);
        }
        setValue(index, value) {
          const pending = this._pending || (this._pending = /* @__PURE__ */ new Map());
          const current = pending.get(index);
          current && (this._pendingLength -= current.length);
          this._pendingLength += value instanceof MapRow ? value[kKeys].length : value.length;
          pending.set(index, value);
        }
        setValid(index, isValid) {
          if (!super.setValid(index, isValid)) {
            (this._pending || (this._pending = /* @__PURE__ */ new Map())).set(index, void 0);
            return false;
          }
          return true;
        }
        clear() {
          this._pendingLength = 0;
          this._pending = void 0;
          return super.clear();
        }
        flush() {
          this._flush();
          return super.flush();
        }
        finish() {
          this._flush();
          return super.finish();
        }
        _flush() {
          const pending = this._pending;
          const pendingLength = this._pendingLength;
          this._pendingLength = 0;
          this._pending = void 0;
          if (pending && pending.size > 0) {
            this._flushPending(pending, pendingLength);
          }
          return this;
        }
      };
    }
  });

  // node_modules/apache-arrow/fb/block.mjs
  var Block;
  var init_block = __esm({
    "node_modules/apache-arrow/fb/block.mjs"() {
      Block = class {
        constructor() {
          this.bb = null;
          this.bb_pos = 0;
        }
        __init(i, bb) {
          this.bb_pos = i;
          this.bb = bb;
          return this;
        }
        /**
         * Index to the start of the RecordBlock (note this is past the Message header)
         */
        offset() {
          return this.bb.readInt64(this.bb_pos);
        }
        /**
         * Length of the metadata
         */
        metaDataLength() {
          return this.bb.readInt32(this.bb_pos + 8);
        }
        /**
         * Length of the data (this is aligned so there can be a gap between this and
         * the metadata).
         */
        bodyLength() {
          return this.bb.readInt64(this.bb_pos + 16);
        }
        static sizeOf() {
          return 24;
        }
        static createBlock(builder, offset, metaDataLength, bodyLength) {
          builder.prep(8, 24);
          builder.writeInt64(BigInt(bodyLength !== null && bodyLength !== void 0 ? bodyLength : 0));
          builder.pad(4);
          builder.writeInt32(metaDataLength);
          builder.writeInt64(BigInt(offset !== null && offset !== void 0 ? offset : 0));
          return builder.offset();
        }
      };
    }
  });

  // node_modules/apache-arrow/fb/footer.mjs
  var Footer;
  var init_footer = __esm({
    "node_modules/apache-arrow/fb/footer.mjs"() {
      init_flatbuffers();
      init_block();
      init_key_value();
      init_metadata_version();
      init_schema();
      Footer = class _Footer {
        constructor() {
          this.bb = null;
          this.bb_pos = 0;
        }
        __init(i, bb) {
          this.bb_pos = i;
          this.bb = bb;
          return this;
        }
        static getRootAsFooter(bb, obj) {
          return (obj || new _Footer()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static getSizePrefixedRootAsFooter(bb, obj) {
          bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
          return (obj || new _Footer()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        version() {
          const offset = this.bb.__offset(this.bb_pos, 4);
          return offset ? this.bb.readInt16(this.bb_pos + offset) : MetadataVersion.V1;
        }
        schema(obj) {
          const offset = this.bb.__offset(this.bb_pos, 6);
          return offset ? (obj || new Schema()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
        }
        dictionaries(index, obj) {
          const offset = this.bb.__offset(this.bb_pos, 8);
          return offset ? (obj || new Block()).__init(this.bb.__vector(this.bb_pos + offset) + index * 24, this.bb) : null;
        }
        dictionariesLength() {
          const offset = this.bb.__offset(this.bb_pos, 8);
          return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
        }
        recordBatches(index, obj) {
          const offset = this.bb.__offset(this.bb_pos, 10);
          return offset ? (obj || new Block()).__init(this.bb.__vector(this.bb_pos + offset) + index * 24, this.bb) : null;
        }
        recordBatchesLength() {
          const offset = this.bb.__offset(this.bb_pos, 10);
          return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
        }
        /**
         * User-defined metadata
         */
        customMetadata(index, obj) {
          const offset = this.bb.__offset(this.bb_pos, 12);
          return offset ? (obj || new KeyValue()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
        }
        customMetadataLength() {
          const offset = this.bb.__offset(this.bb_pos, 12);
          return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
        }
        static startFooter(builder) {
          builder.startObject(5);
        }
        static addVersion(builder, version2) {
          builder.addFieldInt16(0, version2, MetadataVersion.V1);
        }
        static addSchema(builder, schemaOffset) {
          builder.addFieldOffset(1, schemaOffset, 0);
        }
        static addDictionaries(builder, dictionariesOffset) {
          builder.addFieldOffset(2, dictionariesOffset, 0);
        }
        static startDictionariesVector(builder, numElems) {
          builder.startVector(24, numElems, 8);
        }
        static addRecordBatches(builder, recordBatchesOffset) {
          builder.addFieldOffset(3, recordBatchesOffset, 0);
        }
        static startRecordBatchesVector(builder, numElems) {
          builder.startVector(24, numElems, 8);
        }
        static addCustomMetadata(builder, customMetadataOffset) {
          builder.addFieldOffset(4, customMetadataOffset, 0);
        }
        static createCustomMetadataVector(builder, data) {
          builder.startVector(4, data.length, 4);
          for (let i = data.length - 1; i >= 0; i--) {
            builder.addOffset(data[i]);
          }
          return builder.endVector();
        }
        static startCustomMetadataVector(builder, numElems) {
          builder.startVector(4, numElems, 4);
        }
        static endFooter(builder) {
          const offset = builder.endObject();
          return offset;
        }
        static finishFooterBuffer(builder, offset) {
          builder.finish(offset);
        }
        static finishSizePrefixedFooterBuffer(builder, offset) {
          builder.finish(offset, void 0, true);
        }
      };
    }
  });

  // node_modules/apache-arrow/schema.mjs
  function mergeMaps(m1, m2) {
    return new Map([...m1 || /* @__PURE__ */ new Map(), ...m2 || /* @__PURE__ */ new Map()]);
  }
  function generateDictionaryMap(fields, dictionaries = /* @__PURE__ */ new Map()) {
    for (let i = -1, n = fields.length; ++i < n; ) {
      const field = fields[i];
      const type = field.type;
      if (DataType.isDictionary(type)) {
        if (!dictionaries.has(type.id)) {
          dictionaries.set(type.id, type.dictionary);
        } else if (dictionaries.get(type.id) !== type.dictionary) {
          throw new Error(`Cannot create Schema containing two different dictionaries with the same Id`);
        }
      }
      if (type.children && type.children.length > 0) {
        generateDictionaryMap(type.children, dictionaries);
      }
    }
    return dictionaries;
  }
  var Schema2, Field2;
  var init_schema2 = __esm({
    "node_modules/apache-arrow/schema.mjs"() {
      init_enum();
      init_type2();
      Schema2 = class _Schema {
        constructor(fields = [], metadata, dictionaries, metadataVersion = MetadataVersion.V5) {
          this.fields = fields || [];
          this.metadata = metadata || /* @__PURE__ */ new Map();
          if (!dictionaries) {
            dictionaries = generateDictionaryMap(this.fields);
          }
          this.dictionaries = dictionaries;
          this.metadataVersion = metadataVersion;
        }
        get [Symbol.toStringTag]() {
          return "Schema";
        }
        get names() {
          return this.fields.map((f) => f.name);
        }
        toString() {
          return `Schema<{ ${this.fields.map((f, i) => `${i}: ${f}`).join(", ")} }>`;
        }
        /**
         * Construct a new Schema containing only specified fields.
         *
         * @param fieldNames Names of fields to keep.
         * @returns A new Schema of fields matching the specified names.
         */
        select(fieldNames) {
          const names = new Set(fieldNames);
          const fields = this.fields.filter((f) => names.has(f.name));
          return new _Schema(fields, this.metadata);
        }
        /**
         * Construct a new Schema containing only fields at the specified indices.
         *
         * @param fieldIndices Indices of fields to keep.
         * @returns A new Schema of fields at the specified indices.
         */
        selectAt(fieldIndices) {
          const fields = fieldIndices.map((i) => this.fields[i]).filter(Boolean);
          return new _Schema(fields, this.metadata);
        }
        assign(...args) {
          const other = args[0] instanceof _Schema ? args[0] : Array.isArray(args[0]) ? new _Schema(args[0]) : new _Schema(args);
          const curFields = [...this.fields];
          const metadata = mergeMaps(mergeMaps(/* @__PURE__ */ new Map(), this.metadata), other.metadata);
          const newFields = other.fields.filter((f2) => {
            const i = curFields.findIndex((f) => f.name === f2.name);
            return ~i ? (curFields[i] = f2.clone({
              metadata: mergeMaps(mergeMaps(/* @__PURE__ */ new Map(), curFields[i].metadata), f2.metadata)
            })) && false : true;
          });
          const newDictionaries = generateDictionaryMap(newFields, /* @__PURE__ */ new Map());
          return new _Schema([...curFields, ...newFields], metadata, new Map([...this.dictionaries, ...newDictionaries]));
        }
      };
      Schema2.prototype.fields = null;
      Schema2.prototype.metadata = null;
      Schema2.prototype.dictionaries = null;
      Field2 = class _Field {
        /** @nocollapse */
        static new(...args) {
          let [name, type, nullable, metadata] = args;
          if (args[0] && typeof args[0] === "object") {
            ({ name } = args[0]);
            type === void 0 && (type = args[0].type);
            nullable === void 0 && (nullable = args[0].nullable);
            metadata === void 0 && (metadata = args[0].metadata);
          }
          return new _Field(`${name}`, type, nullable, metadata);
        }
        constructor(name, type, nullable = false, metadata) {
          this.name = name;
          this.type = type;
          this.nullable = nullable;
          this.metadata = metadata || /* @__PURE__ */ new Map();
        }
        get typeId() {
          return this.type.typeId;
        }
        get [Symbol.toStringTag]() {
          return "Field";
        }
        toString() {
          return `${this.name}: ${this.type}`;
        }
        clone(...args) {
          let [name, type, nullable, metadata] = args;
          !args[0] || typeof args[0] !== "object" ? [name = this.name, type = this.type, nullable = this.nullable, metadata = this.metadata] = args : { name = this.name, type = this.type, nullable = this.nullable, metadata = this.metadata } = args[0];
          return _Field.new(name, type, nullable, metadata);
        }
      };
      Field2.prototype.type = null;
      Field2.prototype.name = null;
      Field2.prototype.nullable = null;
      Field2.prototype.metadata = null;
    }
  });

  // node_modules/apache-arrow/ipc/metadata/file.mjs
  var Builder3, ByteBuffer2, Footer_, OffHeapFooter, FileBlock;
  var init_file = __esm({
    "node_modules/apache-arrow/ipc/metadata/file.mjs"() {
      init_block();
      init_footer();
      init_flatbuffers();
      init_schema2();
      init_enum();
      init_buffer();
      init_bigint();
      Builder3 = Builder;
      ByteBuffer2 = ByteBuffer;
      Footer_ = class {
        /** @nocollapse */
        static decode(buf) {
          buf = new ByteBuffer2(toUint8Array(buf));
          const footer = Footer.getRootAsFooter(buf);
          const schema = Schema2.decode(footer.schema(), /* @__PURE__ */ new Map(), footer.version());
          return new OffHeapFooter(schema, footer);
        }
        /** @nocollapse */
        static encode(footer) {
          const b = new Builder3();
          const schemaOffset = Schema2.encode(b, footer.schema);
          Footer.startRecordBatchesVector(b, footer.numRecordBatches);
          for (const rb of [...footer.recordBatches()].slice().reverse()) {
            FileBlock.encode(b, rb);
          }
          const recordBatchesOffset = b.endVector();
          Footer.startDictionariesVector(b, footer.numDictionaries);
          for (const db of [...footer.dictionaryBatches()].slice().reverse()) {
            FileBlock.encode(b, db);
          }
          const dictionaryBatchesOffset = b.endVector();
          Footer.startFooter(b);
          Footer.addSchema(b, schemaOffset);
          Footer.addVersion(b, MetadataVersion.V5);
          Footer.addRecordBatches(b, recordBatchesOffset);
          Footer.addDictionaries(b, dictionaryBatchesOffset);
          Footer.finishFooterBuffer(b, Footer.endFooter(b));
          return b.asUint8Array();
        }
        get numRecordBatches() {
          return this._recordBatches.length;
        }
        get numDictionaries() {
          return this._dictionaryBatches.length;
        }
        constructor(schema, version2 = MetadataVersion.V5, recordBatches, dictionaryBatches) {
          this.schema = schema;
          this.version = version2;
          recordBatches && (this._recordBatches = recordBatches);
          dictionaryBatches && (this._dictionaryBatches = dictionaryBatches);
        }
        *recordBatches() {
          for (let block, i = -1, n = this.numRecordBatches; ++i < n; ) {
            if (block = this.getRecordBatch(i)) {
              yield block;
            }
          }
        }
        *dictionaryBatches() {
          for (let block, i = -1, n = this.numDictionaries; ++i < n; ) {
            if (block = this.getDictionaryBatch(i)) {
              yield block;
            }
          }
        }
        getRecordBatch(index) {
          return index >= 0 && index < this.numRecordBatches && this._recordBatches[index] || null;
        }
        getDictionaryBatch(index) {
          return index >= 0 && index < this.numDictionaries && this._dictionaryBatches[index] || null;
        }
      };
      OffHeapFooter = class extends Footer_ {
        get numRecordBatches() {
          return this._footer.recordBatchesLength();
        }
        get numDictionaries() {
          return this._footer.dictionariesLength();
        }
        constructor(schema, _footer) {
          super(schema, _footer.version());
          this._footer = _footer;
        }
        getRecordBatch(index) {
          if (index >= 0 && index < this.numRecordBatches) {
            const fileBlock = this._footer.recordBatches(index);
            if (fileBlock) {
              return FileBlock.decode(fileBlock);
            }
          }
          return null;
        }
        getDictionaryBatch(index) {
          if (index >= 0 && index < this.numDictionaries) {
            const fileBlock = this._footer.dictionaries(index);
            if (fileBlock) {
              return FileBlock.decode(fileBlock);
            }
          }
          return null;
        }
      };
      FileBlock = class _FileBlock {
        /** @nocollapse */
        static decode(block) {
          return new _FileBlock(block.metaDataLength(), block.bodyLength(), block.offset());
        }
        /** @nocollapse */
        static encode(b, fileBlock) {
          const { metaDataLength } = fileBlock;
          const offset = BigInt(fileBlock.offset);
          const bodyLength = BigInt(fileBlock.bodyLength);
          return Block.createBlock(b, offset, metaDataLength, bodyLength);
        }
        constructor(metaDataLength, bodyLength, offset) {
          this.metaDataLength = metaDataLength;
          this.offset = bigIntToNumber(offset);
          this.bodyLength = bigIntToNumber(bodyLength);
        }
      };
    }
  });

  // node_modules/apache-arrow/io/interfaces.mjs
  var ITERATOR_DONE, ArrowJSON, ReadableInterop, AsyncQueue;
  var init_interfaces = __esm({
    "node_modules/apache-arrow/io/interfaces.mjs"() {
      init_tslib_es6();
      init_adapters();
      ITERATOR_DONE = Object.freeze({ done: true, value: void 0 });
      ArrowJSON = class {
        constructor(_json) {
          this._json = _json;
        }
        get schema() {
          return this._json["schema"];
        }
        get batches() {
          return this._json["batches"] || [];
        }
        get dictionaries() {
          return this._json["dictionaries"] || [];
        }
      };
      ReadableInterop = class {
        tee() {
          return this._getDOMStream().tee();
        }
        pipe(writable, options) {
          return this._getNodeStream().pipe(writable, options);
        }
        pipeTo(writable, options) {
          return this._getDOMStream().pipeTo(writable, options);
        }
        pipeThrough(duplex, options) {
          return this._getDOMStream().pipeThrough(duplex, options);
        }
        _getDOMStream() {
          return this._DOMStream || (this._DOMStream = this.toDOMStream());
        }
        _getNodeStream() {
          return this._nodeStream || (this._nodeStream = this.toNodeStream());
        }
      };
      AsyncQueue = class extends ReadableInterop {
        constructor() {
          super();
          this._values = [];
          this.resolvers = [];
          this._closedPromise = new Promise((r) => this._closedPromiseResolve = r);
        }
        get closed() {
          return this._closedPromise;
        }
        cancel(reason) {
          return __awaiter(this, void 0, void 0, function* () {
            yield this.return(reason);
          });
        }
        write(value) {
          if (this._ensureOpen()) {
            this.resolvers.length <= 0 ? this._values.push(value) : this.resolvers.shift().resolve({ done: false, value });
          }
        }
        abort(value) {
          if (this._closedPromiseResolve) {
            this.resolvers.length <= 0 ? this._error = { error: value } : this.resolvers.shift().reject({ done: true, value });
          }
        }
        close() {
          if (this._closedPromiseResolve) {
            const { resolvers } = this;
            while (resolvers.length > 0) {
              resolvers.shift().resolve(ITERATOR_DONE);
            }
            this._closedPromiseResolve();
            this._closedPromiseResolve = void 0;
          }
        }
        [Symbol.asyncIterator]() {
          return this;
        }
        toDOMStream(options) {
          return adapters_default.toDOMStream(this._closedPromiseResolve || this._error ? this : this._values, options);
        }
        toNodeStream(options) {
          return adapters_default.toNodeStream(this._closedPromiseResolve || this._error ? this : this._values, options);
        }
        throw(_) {
          return __awaiter(this, void 0, void 0, function* () {
            yield this.abort(_);
            return ITERATOR_DONE;
          });
        }
        return(_) {
          return __awaiter(this, void 0, void 0, function* () {
            yield this.close();
            return ITERATOR_DONE;
          });
        }
        read(size) {
          return __awaiter(this, void 0, void 0, function* () {
            return (yield this.next(size, "read")).value;
          });
        }
        peek(size) {
          return __awaiter(this, void 0, void 0, function* () {
            return (yield this.next(size, "peek")).value;
          });
        }
        next(..._args) {
          if (this._values.length > 0) {
            return Promise.resolve({ done: false, value: this._values.shift() });
          } else if (this._error) {
            return Promise.reject({ done: true, value: this._error.error });
          } else if (!this._closedPromiseResolve) {
            return Promise.resolve(ITERATOR_DONE);
          } else {
            return new Promise((resolve, reject) => {
              this.resolvers.push({ resolve, reject });
            });
          }
        }
        _ensureOpen() {
          if (this._closedPromiseResolve) {
            return true;
          }
          throw new Error(`AsyncQueue is closed`);
        }
      };
    }
  });

  // node_modules/apache-arrow/io/stream.mjs
  var AsyncByteQueue, ByteStream, AsyncByteStream, ByteStreamSource, AsyncByteStreamSource;
  var init_stream = __esm({
    "node_modules/apache-arrow/io/stream.mjs"() {
      init_tslib_es6();
      init_adapters();
      init_utf8();
      init_interfaces();
      init_buffer();
      init_compat();
      AsyncByteQueue = class extends AsyncQueue {
        write(value) {
          if ((value = toUint8Array(value)).byteLength > 0) {
            return super.write(value);
          }
        }
        toString(sync = false) {
          return sync ? decodeUtf8(this.toUint8Array(true)) : this.toUint8Array(false).then(decodeUtf8);
        }
        toUint8Array(sync = false) {
          return sync ? joinUint8Arrays(this._values)[0] : (() => __awaiter(this, void 0, void 0, function* () {
            var _a5, e_1, _b2, _c2;
            const buffers = [];
            let byteLength = 0;
            try {
              for (var _d2 = true, _e2 = __asyncValues(this), _f2; _f2 = yield _e2.next(), _a5 = _f2.done, !_a5; _d2 = true) {
                _c2 = _f2.value;
                _d2 = false;
                const chunk = _c2;
                buffers.push(chunk);
                byteLength += chunk.byteLength;
              }
            } catch (e_1_1) {
              e_1 = { error: e_1_1 };
            } finally {
              try {
                if (!_d2 && !_a5 && (_b2 = _e2.return)) yield _b2.call(_e2);
              } finally {
                if (e_1) throw e_1.error;
              }
            }
            return joinUint8Arrays(buffers, byteLength)[0];
          }))();
        }
      };
      ByteStream = class {
        constructor(source) {
          if (source) {
            this.source = new ByteStreamSource(adapters_default.fromIterable(source));
          }
        }
        [Symbol.iterator]() {
          return this;
        }
        next(value) {
          return this.source.next(value);
        }
        throw(value) {
          return this.source.throw(value);
        }
        return(value) {
          return this.source.return(value);
        }
        peek(size) {
          return this.source.peek(size);
        }
        read(size) {
          return this.source.read(size);
        }
      };
      AsyncByteStream = class _AsyncByteStream {
        constructor(source) {
          if (source instanceof _AsyncByteStream) {
            this.source = source.source;
          } else if (source instanceof AsyncByteQueue) {
            this.source = new AsyncByteStreamSource(adapters_default.fromAsyncIterable(source));
          } else if (isReadableNodeStream(source)) {
            this.source = new AsyncByteStreamSource(adapters_default.fromNodeStream(source));
          } else if (isReadableDOMStream(source)) {
            this.source = new AsyncByteStreamSource(adapters_default.fromDOMStream(source));
          } else if (isFetchResponse(source)) {
            this.source = new AsyncByteStreamSource(adapters_default.fromDOMStream(source.body));
          } else if (isIterable(source)) {
            this.source = new AsyncByteStreamSource(adapters_default.fromIterable(source));
          } else if (isPromise(source)) {
            this.source = new AsyncByteStreamSource(adapters_default.fromAsyncIterable(source));
          } else if (isAsyncIterable(source)) {
            this.source = new AsyncByteStreamSource(adapters_default.fromAsyncIterable(source));
          }
        }
        [Symbol.asyncIterator]() {
          return this;
        }
        next(value) {
          return this.source.next(value);
        }
        throw(value) {
          return this.source.throw(value);
        }
        return(value) {
          return this.source.return(value);
        }
        get closed() {
          return this.source.closed;
        }
        cancel(reason) {
          return this.source.cancel(reason);
        }
        peek(size) {
          return this.source.peek(size);
        }
        read(size) {
          return this.source.read(size);
        }
      };
      ByteStreamSource = class {
        constructor(source) {
          this.source = source;
        }
        cancel(reason) {
          this.return(reason);
        }
        peek(size) {
          return this.next(size, "peek").value;
        }
        read(size) {
          return this.next(size, "read").value;
        }
        next(size, cmd = "read") {
          return this.source.next({ cmd, size });
        }
        throw(value) {
          return Object.create(this.source.throw && this.source.throw(value) || ITERATOR_DONE);
        }
        return(value) {
          return Object.create(this.source.return && this.source.return(value) || ITERATOR_DONE);
        }
      };
      AsyncByteStreamSource = class {
        constructor(source) {
          this.source = source;
          this._closedPromise = new Promise((r) => this._closedPromiseResolve = r);
        }
        cancel(reason) {
          return __awaiter(this, void 0, void 0, function* () {
            yield this.return(reason);
          });
        }
        get closed() {
          return this._closedPromise;
        }
        read(size) {
          return __awaiter(this, void 0, void 0, function* () {
            return (yield this.next(size, "read")).value;
          });
        }
        peek(size) {
          return __awaiter(this, void 0, void 0, function* () {
            return (yield this.next(size, "peek")).value;
          });
        }
        next(size_1) {
          return __awaiter(this, arguments, void 0, function* (size, cmd = "read") {
            return yield this.source.next({ cmd, size });
          });
        }
        throw(value) {
          return __awaiter(this, void 0, void 0, function* () {
            const result = this.source.throw && (yield this.source.throw(value)) || ITERATOR_DONE;
            this._closedPromiseResolve && this._closedPromiseResolve();
            this._closedPromiseResolve = void 0;
            return Object.create(result);
          });
        }
        return(value) {
          return __awaiter(this, void 0, void 0, function* () {
            const result = this.source.return && (yield this.source.return(value)) || ITERATOR_DONE;
            this._closedPromiseResolve && this._closedPromiseResolve();
            this._closedPromiseResolve = void 0;
            return Object.create(result);
          });
        }
      };
    }
  });

  // node_modules/apache-arrow/io/file.mjs
  var RandomAccessFile, AsyncRandomAccessFile;
  var init_file2 = __esm({
    "node_modules/apache-arrow/io/file.mjs"() {
      init_tslib_es6();
      init_stream();
      init_buffer();
      RandomAccessFile = class extends ByteStream {
        constructor(buffer, byteLength) {
          super();
          this.position = 0;
          this.buffer = toUint8Array(buffer);
          this.size = byteLength === void 0 ? this.buffer.byteLength : byteLength;
        }
        readInt32(position) {
          const { buffer, byteOffset } = this.readAt(position, 4);
          return new DataView(buffer, byteOffset).getInt32(0, true);
        }
        seek(position) {
          this.position = Math.min(position, this.size);
          return position < this.size;
        }
        read(nBytes) {
          const { buffer, size, position } = this;
          if (buffer && position < size) {
            if (typeof nBytes !== "number") {
              nBytes = Number.POSITIVE_INFINITY;
            }
            this.position = Math.min(size, position + Math.min(size - position, nBytes));
            return buffer.subarray(position, this.position);
          }
          return null;
        }
        readAt(position, nBytes) {
          const buf = this.buffer;
          const end = Math.min(this.size, position + nBytes);
          return buf ? buf.subarray(position, end) : new Uint8Array(nBytes);
        }
        close() {
          this.buffer && (this.buffer = null);
        }
        throw(value) {
          this.close();
          return { done: true, value };
        }
        return(value) {
          this.close();
          return { done: true, value };
        }
      };
      AsyncRandomAccessFile = class extends AsyncByteStream {
        constructor(file, byteLength) {
          super();
          this.position = 0;
          this._handle = file;
          if (typeof byteLength === "number") {
            this.size = byteLength;
          } else {
            this._pending = (() => __awaiter(this, void 0, void 0, function* () {
              this.size = (yield file.stat()).size;
              delete this._pending;
            }))();
          }
        }
        readInt32(position) {
          return __awaiter(this, void 0, void 0, function* () {
            const { buffer, byteOffset } = yield this.readAt(position, 4);
            return new DataView(buffer, byteOffset).getInt32(0, true);
          });
        }
        seek(position) {
          return __awaiter(this, void 0, void 0, function* () {
            this._pending && (yield this._pending);
            this.position = Math.min(position, this.size);
            return position < this.size;
          });
        }
        read(nBytes) {
          return __awaiter(this, void 0, void 0, function* () {
            this._pending && (yield this._pending);
            const { _handle: file, size, position } = this;
            if (file && position < size) {
              if (typeof nBytes !== "number") {
                nBytes = Number.POSITIVE_INFINITY;
              }
              let pos = position, offset = 0, bytesRead = 0;
              const end = Math.min(size, pos + Math.min(size - pos, nBytes));
              const buffer = new Uint8Array(Math.max(0, (this.position = end) - pos));
              while ((pos += bytesRead) < end && (offset += bytesRead) < buffer.byteLength) {
                ({ bytesRead } = yield file.read(buffer, offset, buffer.byteLength - offset, pos));
              }
              return buffer;
            }
            return null;
          });
        }
        readAt(position, nBytes) {
          return __awaiter(this, void 0, void 0, function* () {
            this._pending && (yield this._pending);
            const { _handle: file, size } = this;
            if (file && position + nBytes < size) {
              const end = Math.min(size, position + nBytes);
              const buffer = new Uint8Array(end - position);
              return (yield file.read(buffer, 0, nBytes, position)).buffer;
            }
            return new Uint8Array(nBytes);
          });
        }
        close() {
          return __awaiter(this, void 0, void 0, function* () {
            const f = this._handle;
            this._handle = null;
            f && (yield f.close());
          });
        }
        throw(value) {
          return __awaiter(this, void 0, void 0, function* () {
            yield this.close();
            return { done: true, value };
          });
        }
        return(value) {
          return __awaiter(this, void 0, void 0, function* () {
            yield this.close();
            return { done: true, value };
          });
        }
      };
    }
  });

  // node_modules/apache-arrow/util/int.mjs
  var int_exports = {};
  __export(int_exports, {
    BaseInt64: () => BaseInt64,
    Int128: () => Int128,
    Int64: () => Int642,
    Uint64: () => Uint642
  });
  function intAsHex(value) {
    if (value < 0) {
      value = 4294967295 + value + 1;
    }
    return `0x${value.toString(16)}`;
  }
  var carryBit16, kInt32DecimalDigits, kPowersOfTen, BaseInt64, Uint642, Int642, Int128;
  var init_int2 = __esm({
    "node_modules/apache-arrow/util/int.mjs"() {
      carryBit16 = 1 << 16;
      kInt32DecimalDigits = 8;
      kPowersOfTen = [
        1,
        10,
        100,
        1e3,
        1e4,
        1e5,
        1e6,
        1e7,
        1e8
      ];
      BaseInt64 = class {
        constructor(buffer) {
          this.buffer = buffer;
        }
        high() {
          return this.buffer[1];
        }
        low() {
          return this.buffer[0];
        }
        _times(other) {
          const L = new Uint32Array([
            this.buffer[1] >>> 16,
            this.buffer[1] & 65535,
            this.buffer[0] >>> 16,
            this.buffer[0] & 65535
          ]);
          const R = new Uint32Array([
            other.buffer[1] >>> 16,
            other.buffer[1] & 65535,
            other.buffer[0] >>> 16,
            other.buffer[0] & 65535
          ]);
          let product = L[3] * R[3];
          this.buffer[0] = product & 65535;
          let sum = product >>> 16;
          product = L[2] * R[3];
          sum += product;
          product = L[3] * R[2] >>> 0;
          sum += product;
          this.buffer[0] += sum << 16;
          this.buffer[1] = sum >>> 0 < product ? carryBit16 : 0;
          this.buffer[1] += sum >>> 16;
          this.buffer[1] += L[1] * R[3] + L[2] * R[2] + L[3] * R[1];
          this.buffer[1] += L[0] * R[3] + L[1] * R[2] + L[2] * R[1] + L[3] * R[0] << 16;
          return this;
        }
        _plus(other) {
          const sum = this.buffer[0] + other.buffer[0] >>> 0;
          this.buffer[1] += other.buffer[1];
          if (sum < this.buffer[0] >>> 0) {
            ++this.buffer[1];
          }
          this.buffer[0] = sum;
        }
        lessThan(other) {
          return this.buffer[1] < other.buffer[1] || this.buffer[1] === other.buffer[1] && this.buffer[0] < other.buffer[0];
        }
        equals(other) {
          return this.buffer[1] === other.buffer[1] && this.buffer[0] == other.buffer[0];
        }
        greaterThan(other) {
          return other.lessThan(this);
        }
        hex() {
          return `${intAsHex(this.buffer[1])} ${intAsHex(this.buffer[0])}`;
        }
      };
      Uint642 = class _Uint64 extends BaseInt64 {
        times(other) {
          this._times(other);
          return this;
        }
        plus(other) {
          this._plus(other);
          return this;
        }
        /** @nocollapse */
        static from(val, out_buffer = new Uint32Array(2)) {
          return _Uint64.fromString(typeof val === "string" ? val : val.toString(), out_buffer);
        }
        /** @nocollapse */
        static fromNumber(num, out_buffer = new Uint32Array(2)) {
          return _Uint64.fromString(num.toString(), out_buffer);
        }
        /** @nocollapse */
        static fromString(str, out_buffer = new Uint32Array(2)) {
          const length = str.length;
          const out = new _Uint64(out_buffer);
          for (let posn = 0; posn < length; ) {
            const group = kInt32DecimalDigits < length - posn ? kInt32DecimalDigits : length - posn;
            const chunk = new _Uint64(new Uint32Array([Number.parseInt(str.slice(posn, posn + group), 10), 0]));
            const multiple = new _Uint64(new Uint32Array([kPowersOfTen[group], 0]));
            out.times(multiple);
            out.plus(chunk);
            posn += group;
          }
          return out;
        }
        /** @nocollapse */
        static convertArray(values) {
          const data = new Uint32Array(values.length * 2);
          for (let i = -1, n = values.length; ++i < n; ) {
            _Uint64.from(values[i], new Uint32Array(data.buffer, data.byteOffset + 2 * i * 4, 2));
          }
          return data;
        }
        /** @nocollapse */
        static multiply(left, right) {
          const rtrn = new _Uint64(new Uint32Array(left.buffer));
          return rtrn.times(right);
        }
        /** @nocollapse */
        static add(left, right) {
          const rtrn = new _Uint64(new Uint32Array(left.buffer));
          return rtrn.plus(right);
        }
      };
      Int642 = class _Int64 extends BaseInt64 {
        negate() {
          this.buffer[0] = ~this.buffer[0] + 1;
          this.buffer[1] = ~this.buffer[1];
          if (this.buffer[0] == 0) {
            ++this.buffer[1];
          }
          return this;
        }
        times(other) {
          this._times(other);
          return this;
        }
        plus(other) {
          this._plus(other);
          return this;
        }
        lessThan(other) {
          const this_high = this.buffer[1] << 0;
          const other_high = other.buffer[1] << 0;
          return this_high < other_high || this_high === other_high && this.buffer[0] < other.buffer[0];
        }
        /** @nocollapse */
        static from(val, out_buffer = new Uint32Array(2)) {
          return _Int64.fromString(typeof val === "string" ? val : val.toString(), out_buffer);
        }
        /** @nocollapse */
        static fromNumber(num, out_buffer = new Uint32Array(2)) {
          return _Int64.fromString(num.toString(), out_buffer);
        }
        /** @nocollapse */
        static fromString(str, out_buffer = new Uint32Array(2)) {
          const negate = str.startsWith("-");
          const length = str.length;
          const out = new _Int64(out_buffer);
          for (let posn = negate ? 1 : 0; posn < length; ) {
            const group = kInt32DecimalDigits < length - posn ? kInt32DecimalDigits : length - posn;
            const chunk = new _Int64(new Uint32Array([Number.parseInt(str.slice(posn, posn + group), 10), 0]));
            const multiple = new _Int64(new Uint32Array([kPowersOfTen[group], 0]));
            out.times(multiple);
            out.plus(chunk);
            posn += group;
          }
          return negate ? out.negate() : out;
        }
        /** @nocollapse */
        static convertArray(values) {
          const data = new Uint32Array(values.length * 2);
          for (let i = -1, n = values.length; ++i < n; ) {
            _Int64.from(values[i], new Uint32Array(data.buffer, data.byteOffset + 2 * i * 4, 2));
          }
          return data;
        }
        /** @nocollapse */
        static multiply(left, right) {
          const rtrn = new _Int64(new Uint32Array(left.buffer));
          return rtrn.times(right);
        }
        /** @nocollapse */
        static add(left, right) {
          const rtrn = new _Int64(new Uint32Array(left.buffer));
          return rtrn.plus(right);
        }
      };
      Int128 = class _Int128 {
        constructor(buffer) {
          this.buffer = buffer;
        }
        high() {
          return new Int642(new Uint32Array(this.buffer.buffer, this.buffer.byteOffset + 8, 2));
        }
        low() {
          return new Int642(new Uint32Array(this.buffer.buffer, this.buffer.byteOffset, 2));
        }
        negate() {
          this.buffer[0] = ~this.buffer[0] + 1;
          this.buffer[1] = ~this.buffer[1];
          this.buffer[2] = ~this.buffer[2];
          this.buffer[3] = ~this.buffer[3];
          if (this.buffer[0] == 0) {
            ++this.buffer[1];
          }
          if (this.buffer[1] == 0) {
            ++this.buffer[2];
          }
          if (this.buffer[2] == 0) {
            ++this.buffer[3];
          }
          return this;
        }
        times(other) {
          const L0 = new Uint642(new Uint32Array([this.buffer[3], 0]));
          const L1 = new Uint642(new Uint32Array([this.buffer[2], 0]));
          const L2 = new Uint642(new Uint32Array([this.buffer[1], 0]));
          const L3 = new Uint642(new Uint32Array([this.buffer[0], 0]));
          const R0 = new Uint642(new Uint32Array([other.buffer[3], 0]));
          const R1 = new Uint642(new Uint32Array([other.buffer[2], 0]));
          const R2 = new Uint642(new Uint32Array([other.buffer[1], 0]));
          const R3 = new Uint642(new Uint32Array([other.buffer[0], 0]));
          let product = Uint642.multiply(L3, R3);
          this.buffer[0] = product.low();
          const sum = new Uint642(new Uint32Array([product.high(), 0]));
          product = Uint642.multiply(L2, R3);
          sum.plus(product);
          product = Uint642.multiply(L3, R2);
          sum.plus(product);
          this.buffer[1] = sum.low();
          this.buffer[3] = sum.lessThan(product) ? 1 : 0;
          this.buffer[2] = sum.high();
          const high = new Uint642(new Uint32Array(this.buffer.buffer, this.buffer.byteOffset + 8, 2));
          high.plus(Uint642.multiply(L1, R3)).plus(Uint642.multiply(L2, R2)).plus(Uint642.multiply(L3, R1));
          this.buffer[3] += Uint642.multiply(L0, R3).plus(Uint642.multiply(L1, R2)).plus(Uint642.multiply(L2, R1)).plus(Uint642.multiply(L3, R0)).low();
          return this;
        }
        plus(other) {
          const sums = new Uint32Array(4);
          sums[3] = this.buffer[3] + other.buffer[3] >>> 0;
          sums[2] = this.buffer[2] + other.buffer[2] >>> 0;
          sums[1] = this.buffer[1] + other.buffer[1] >>> 0;
          sums[0] = this.buffer[0] + other.buffer[0] >>> 0;
          if (sums[0] < this.buffer[0] >>> 0) {
            ++sums[1];
          }
          if (sums[1] < this.buffer[1] >>> 0) {
            ++sums[2];
          }
          if (sums[2] < this.buffer[2] >>> 0) {
            ++sums[3];
          }
          this.buffer[3] = sums[3];
          this.buffer[2] = sums[2];
          this.buffer[1] = sums[1];
          this.buffer[0] = sums[0];
          return this;
        }
        hex() {
          return `${intAsHex(this.buffer[3])} ${intAsHex(this.buffer[2])} ${intAsHex(this.buffer[1])} ${intAsHex(this.buffer[0])}`;
        }
        /** @nocollapse */
        static multiply(left, right) {
          const rtrn = new _Int128(new Uint32Array(left.buffer));
          return rtrn.times(right);
        }
        /** @nocollapse */
        static add(left, right) {
          const rtrn = new _Int128(new Uint32Array(left.buffer));
          return rtrn.plus(right);
        }
        /** @nocollapse */
        static from(val, out_buffer = new Uint32Array(4)) {
          return _Int128.fromString(typeof val === "string" ? val : val.toString(), out_buffer);
        }
        /** @nocollapse */
        static fromNumber(num, out_buffer = new Uint32Array(4)) {
          return _Int128.fromString(num.toString(), out_buffer);
        }
        /** @nocollapse */
        static fromString(str, out_buffer = new Uint32Array(4)) {
          const negate = str.startsWith("-");
          const length = str.length;
          const out = new _Int128(out_buffer);
          for (let posn = negate ? 1 : 0; posn < length; ) {
            const group = kInt32DecimalDigits < length - posn ? kInt32DecimalDigits : length - posn;
            const chunk = new _Int128(new Uint32Array([Number.parseInt(str.slice(posn, posn + group), 10), 0, 0, 0]));
            const multiple = new _Int128(new Uint32Array([kPowersOfTen[group], 0, 0, 0]));
            out.times(multiple);
            out.plus(chunk);
            posn += group;
          }
          return negate ? out.negate() : out;
        }
        /** @nocollapse */
        static convertArray(values) {
          const data = new Uint32Array(values.length * 4);
          for (let i = -1, n = values.length; ++i < n; ) {
            _Int128.from(values[i], new Uint32Array(data.buffer, data.byteOffset + 4 * 4 * i, 4));
          }
          return data;
        }
      };
    }
  });

  // node_modules/apache-arrow/visitor/vectorloader.mjs
  function binaryDataFromJSON(values) {
    const joined = values.join("");
    const data = new Uint8Array(joined.length / 2);
    for (let i = 0; i < joined.length; i += 2) {
      data[i >> 1] = Number.parseInt(joined.slice(i, i + 2), 16);
    }
    return data;
  }
  var VectorLoader, JSONVectorLoader;
  var init_vectorloader = __esm({
    "node_modules/apache-arrow/visitor/vectorloader.mjs"() {
      init_data();
      init_schema2();
      init_type2();
      init_visitor();
      init_bit();
      init_utf8();
      init_int2();
      init_enum();
      init_buffer();
      VectorLoader = class extends Visitor {
        constructor(bytes, nodes, buffers, dictionaries, metadataVersion = MetadataVersion.V5) {
          super();
          this.nodesIndex = -1;
          this.buffersIndex = -1;
          this.bytes = bytes;
          this.nodes = nodes;
          this.buffers = buffers;
          this.dictionaries = dictionaries;
          this.metadataVersion = metadataVersion;
        }
        visit(node) {
          return super.visit(node instanceof Field2 ? node.type : node);
        }
        visitNull(type, { length } = this.nextFieldNode()) {
          return makeData({ type, length });
        }
        visitBool(type, { length, nullCount } = this.nextFieldNode()) {
          return makeData({ type, length, nullCount, nullBitmap: this.readNullBitmap(type, nullCount), data: this.readData(type) });
        }
        visitInt(type, { length, nullCount } = this.nextFieldNode()) {
          return makeData({ type, length, nullCount, nullBitmap: this.readNullBitmap(type, nullCount), data: this.readData(type) });
        }
        visitFloat(type, { length, nullCount } = this.nextFieldNode()) {
          return makeData({ type, length, nullCount, nullBitmap: this.readNullBitmap(type, nullCount), data: this.readData(type) });
        }
        visitUtf8(type, { length, nullCount } = this.nextFieldNode()) {
          return makeData({ type, length, nullCount, nullBitmap: this.readNullBitmap(type, nullCount), valueOffsets: this.readOffsets(type), data: this.readData(type) });
        }
        visitLargeUtf8(type, { length, nullCount } = this.nextFieldNode()) {
          return makeData({ type, length, nullCount, nullBitmap: this.readNullBitmap(type, nullCount), valueOffsets: this.readOffsets(type), data: this.readData(type) });
        }
        visitBinary(type, { length, nullCount } = this.nextFieldNode()) {
          return makeData({ type, length, nullCount, nullBitmap: this.readNullBitmap(type, nullCount), valueOffsets: this.readOffsets(type), data: this.readData(type) });
        }
        visitLargeBinary(type, { length, nullCount } = this.nextFieldNode()) {
          return makeData({ type, length, nullCount, nullBitmap: this.readNullBitmap(type, nullCount), valueOffsets: this.readOffsets(type), data: this.readData(type) });
        }
        visitFixedSizeBinary(type, { length, nullCount } = this.nextFieldNode()) {
          return makeData({ type, length, nullCount, nullBitmap: this.readNullBitmap(type, nullCount), data: this.readData(type) });
        }
        visitDate(type, { length, nullCount } = this.nextFieldNode()) {
          return makeData({ type, length, nullCount, nullBitmap: this.readNullBitmap(type, nullCount), data: this.readData(type) });
        }
        visitTimestamp(type, { length, nullCount } = this.nextFieldNode()) {
          return makeData({ type, length, nullCount, nullBitmap: this.readNullBitmap(type, nullCount), data: this.readData(type) });
        }
        visitTime(type, { length, nullCount } = this.nextFieldNode()) {
          return makeData({ type, length, nullCount, nullBitmap: this.readNullBitmap(type, nullCount), data: this.readData(type) });
        }
        visitDecimal(type, { length, nullCount } = this.nextFieldNode()) {
          return makeData({ type, length, nullCount, nullBitmap: this.readNullBitmap(type, nullCount), data: this.readData(type) });
        }
        visitList(type, { length, nullCount } = this.nextFieldNode()) {
          return makeData({ type, length, nullCount, nullBitmap: this.readNullBitmap(type, nullCount), valueOffsets: this.readOffsets(type), "child": this.visit(type.children[0]) });
        }
        visitStruct(type, { length, nullCount } = this.nextFieldNode()) {
          return makeData({ type, length, nullCount, nullBitmap: this.readNullBitmap(type, nullCount), children: this.visitMany(type.children) });
        }
        visitUnion(type, { length, nullCount } = this.nextFieldNode()) {
          if (this.metadataVersion < MetadataVersion.V5) {
            this.readNullBitmap(type, nullCount);
          }
          return type.mode === UnionMode.Sparse ? this.visitSparseUnion(type, { length, nullCount }) : this.visitDenseUnion(type, { length, nullCount });
        }
        visitDenseUnion(type, { length, nullCount } = this.nextFieldNode()) {
          return makeData({ type, length, nullCount, typeIds: this.readTypeIds(type), valueOffsets: this.readOffsets(type), children: this.visitMany(type.children) });
        }
        visitSparseUnion(type, { length, nullCount } = this.nextFieldNode()) {
          return makeData({ type, length, nullCount, typeIds: this.readTypeIds(type), children: this.visitMany(type.children) });
        }
        visitDictionary(type, { length, nullCount } = this.nextFieldNode()) {
          return makeData({ type, length, nullCount, nullBitmap: this.readNullBitmap(type, nullCount), data: this.readData(type.indices), dictionary: this.readDictionary(type) });
        }
        visitInterval(type, { length, nullCount } = this.nextFieldNode()) {
          return makeData({ type, length, nullCount, nullBitmap: this.readNullBitmap(type, nullCount), data: this.readData(type) });
        }
        visitDuration(type, { length, nullCount } = this.nextFieldNode()) {
          return makeData({ type, length, nullCount, nullBitmap: this.readNullBitmap(type, nullCount), data: this.readData(type) });
        }
        visitFixedSizeList(type, { length, nullCount } = this.nextFieldNode()) {
          return makeData({ type, length, nullCount, nullBitmap: this.readNullBitmap(type, nullCount), "child": this.visit(type.children[0]) });
        }
        visitMap(type, { length, nullCount } = this.nextFieldNode()) {
          return makeData({ type, length, nullCount, nullBitmap: this.readNullBitmap(type, nullCount), valueOffsets: this.readOffsets(type), "child": this.visit(type.children[0]) });
        }
        nextFieldNode() {
          return this.nodes[++this.nodesIndex];
        }
        nextBufferRange() {
          return this.buffers[++this.buffersIndex];
        }
        readNullBitmap(type, nullCount, buffer = this.nextBufferRange()) {
          return nullCount > 0 && this.readData(type, buffer) || new Uint8Array(0);
        }
        readOffsets(type, buffer) {
          return this.readData(type, buffer);
        }
        readTypeIds(type, buffer) {
          return this.readData(type, buffer);
        }
        readData(_type, { length, offset } = this.nextBufferRange()) {
          return this.bytes.subarray(offset, offset + length);
        }
        readDictionary(type) {
          return this.dictionaries.get(type.id);
        }
      };
      JSONVectorLoader = class extends VectorLoader {
        constructor(sources, nodes, buffers, dictionaries, metadataVersion) {
          super(new Uint8Array(0), nodes, buffers, dictionaries, metadataVersion);
          this.sources = sources;
        }
        readNullBitmap(_type, nullCount, { offset } = this.nextBufferRange()) {
          return nullCount <= 0 ? new Uint8Array(0) : packBools(this.sources[offset]);
        }
        readOffsets(_type, { offset } = this.nextBufferRange()) {
          return toArrayBufferView(Uint8Array, toArrayBufferView(_type.OffsetArrayType, this.sources[offset]));
        }
        readTypeIds(type, { offset } = this.nextBufferRange()) {
          return toArrayBufferView(Uint8Array, toArrayBufferView(type.ArrayType, this.sources[offset]));
        }
        readData(type, { offset } = this.nextBufferRange()) {
          const { sources } = this;
          if (DataType.isTimestamp(type)) {
            return toArrayBufferView(Uint8Array, Int642.convertArray(sources[offset]));
          } else if ((DataType.isInt(type) || DataType.isTime(type)) && type.bitWidth === 64 || DataType.isDuration(type)) {
            return toArrayBufferView(Uint8Array, Int642.convertArray(sources[offset]));
          } else if (DataType.isDate(type) && type.unit === DateUnit.MILLISECOND) {
            return toArrayBufferView(Uint8Array, Int642.convertArray(sources[offset]));
          } else if (DataType.isDecimal(type)) {
            return toArrayBufferView(Uint8Array, Int128.convertArray(sources[offset]));
          } else if (DataType.isBinary(type) || DataType.isLargeBinary(type) || DataType.isFixedSizeBinary(type)) {
            return binaryDataFromJSON(sources[offset]);
          } else if (DataType.isBool(type)) {
            return packBools(sources[offset]);
          } else if (DataType.isUtf8(type) || DataType.isLargeUtf8(type)) {
            return encodeUtf8(sources[offset].join(""));
          }
          return toArrayBufferView(Uint8Array, toArrayBufferView(type.ArrayType, sources[offset].map((x) => +x)));
        }
      };
    }
  });

  // node_modules/apache-arrow/builder/binary.mjs
  var BinaryBuilder;
  var init_binary2 = __esm({
    "node_modules/apache-arrow/builder/binary.mjs"() {
      init_buffer3();
      init_builder2();
      init_buffer();
      BinaryBuilder = class extends VariableWidthBuilder {
        constructor(opts) {
          super(opts);
          this._values = new BufferBuilder(Uint8Array);
        }
        get byteLength() {
          let size = this._pendingLength + this.length * 4;
          this._offsets && (size += this._offsets.byteLength);
          this._values && (size += this._values.byteLength);
          this._nulls && (size += this._nulls.byteLength);
          return size;
        }
        setValue(index, value) {
          return super.setValue(index, toUint8Array(value));
        }
        _flushPending(pending, pendingLength) {
          const offsets = this._offsets;
          const data = this._values.reserve(pendingLength).buffer;
          let offset = 0;
          for (const [index, value] of pending) {
            if (value === void 0) {
              offsets.set(index, 0);
            } else {
              const length = value.length;
              data.set(value, offset);
              offsets.set(index, length);
              offset += length;
            }
          }
        }
      };
    }
  });

  // node_modules/apache-arrow/builder/largebinary.mjs
  var LargeBinaryBuilder;
  var init_largebinary = __esm({
    "node_modules/apache-arrow/builder/largebinary.mjs"() {
      init_buffer();
      init_buffer3();
      init_builder2();
      LargeBinaryBuilder = class extends VariableWidthBuilder {
        constructor(opts) {
          super(opts);
          this._values = new BufferBuilder(Uint8Array);
        }
        get byteLength() {
          let size = this._pendingLength + this.length * 4;
          this._offsets && (size += this._offsets.byteLength);
          this._values && (size += this._values.byteLength);
          this._nulls && (size += this._nulls.byteLength);
          return size;
        }
        setValue(index, value) {
          return super.setValue(index, toUint8Array(value));
        }
        _flushPending(pending, pendingLength) {
          const offsets = this._offsets;
          const data = this._values.reserve(pendingLength).buffer;
          let offset = 0;
          for (const [index, value] of pending) {
            if (value === void 0) {
              offsets.set(index, BigInt(0));
            } else {
              const length = value.length;
              data.set(value, offset);
              offsets.set(index, BigInt(length));
              offset += length;
            }
          }
        }
      };
    }
  });

  // node_modules/apache-arrow/builder/bool.mjs
  var BoolBuilder;
  var init_bool2 = __esm({
    "node_modules/apache-arrow/builder/bool.mjs"() {
      init_buffer3();
      init_builder2();
      BoolBuilder = class extends Builder2 {
        constructor(options) {
          super(options);
          this._values = new BitmapBufferBuilder();
        }
        setValue(index, value) {
          this._values.set(index, +value);
        }
      };
    }
  });

  // node_modules/apache-arrow/builder/date.mjs
  var DateBuilder, DateDayBuilder, DateMillisecondBuilder;
  var init_date2 = __esm({
    "node_modules/apache-arrow/builder/date.mjs"() {
      init_builder2();
      init_set();
      DateBuilder = class extends FixedWidthBuilder {
      };
      DateBuilder.prototype._setValue = setDate;
      DateDayBuilder = class extends DateBuilder {
      };
      DateDayBuilder.prototype._setValue = setDateDay;
      DateMillisecondBuilder = class extends DateBuilder {
      };
      DateMillisecondBuilder.prototype._setValue = setDateMillisecond;
    }
  });

  // node_modules/apache-arrow/builder/decimal.mjs
  var DecimalBuilder;
  var init_decimal2 = __esm({
    "node_modules/apache-arrow/builder/decimal.mjs"() {
      init_builder2();
      init_set();
      DecimalBuilder = class extends FixedWidthBuilder {
      };
      DecimalBuilder.prototype._setValue = setDecimal;
    }
  });

  // node_modules/apache-arrow/builder/dictionary.mjs
  var DictionaryBuilder;
  var init_dictionary = __esm({
    "node_modules/apache-arrow/builder/dictionary.mjs"() {
      init_type2();
      init_builder2();
      init_factories();
      DictionaryBuilder = class extends Builder2 {
        constructor({ "type": type, "nullValues": nulls, "dictionaryHashFunction": hashFn }) {
          super({ type: new Dictionary(type.dictionary, type.indices, type.id, type.isOrdered) });
          this._nulls = null;
          this._dictionaryOffset = 0;
          this._keysToIndices = /* @__PURE__ */ Object.create(null);
          this.indices = makeBuilder({ "type": this.type.indices, "nullValues": nulls });
          this.dictionary = makeBuilder({ "type": this.type.dictionary, "nullValues": null });
          if (typeof hashFn === "function") {
            this.valueToKey = hashFn;
          }
        }
        get values() {
          return this.indices.values;
        }
        get nullCount() {
          return this.indices.nullCount;
        }
        get nullBitmap() {
          return this.indices.nullBitmap;
        }
        get byteLength() {
          return this.indices.byteLength + this.dictionary.byteLength;
        }
        get reservedLength() {
          return this.indices.reservedLength + this.dictionary.reservedLength;
        }
        get reservedByteLength() {
          return this.indices.reservedByteLength + this.dictionary.reservedByteLength;
        }
        isValid(value) {
          return this.indices.isValid(value);
        }
        setValid(index, valid) {
          const indices = this.indices;
          valid = indices.setValid(index, valid);
          this.length = indices.length;
          return valid;
        }
        setValue(index, value) {
          const keysToIndices = this._keysToIndices;
          const key = this.valueToKey(value);
          let idx = keysToIndices[key];
          if (idx === void 0) {
            keysToIndices[key] = idx = this._dictionaryOffset + this.dictionary.append(value).length - 1;
          }
          return this.indices.setValue(index, idx);
        }
        flush() {
          const type = this.type;
          const prev = this._dictionary;
          const curr = this.dictionary.toVector();
          const data = this.indices.flush().clone(type);
          data.dictionary = prev ? prev.concat(curr) : curr;
          this.finished || (this._dictionaryOffset += curr.length);
          this._dictionary = data.dictionary;
          this.clear();
          return data;
        }
        finish() {
          this.indices.finish();
          this.dictionary.finish();
          this._dictionaryOffset = 0;
          this._keysToIndices = /* @__PURE__ */ Object.create(null);
          return super.finish();
        }
        clear() {
          this.indices.clear();
          this.dictionary.clear();
          return super.clear();
        }
        valueToKey(val) {
          return typeof val === "string" ? val : `${val}`;
        }
      };
    }
  });

  // node_modules/apache-arrow/builder/fixedsizebinary.mjs
  var FixedSizeBinaryBuilder;
  var init_fixedsizebinary = __esm({
    "node_modules/apache-arrow/builder/fixedsizebinary.mjs"() {
      init_builder2();
      init_set();
      FixedSizeBinaryBuilder = class extends FixedWidthBuilder {
      };
      FixedSizeBinaryBuilder.prototype._setValue = setFixedSizeBinary;
    }
  });

  // node_modules/apache-arrow/builder/fixedsizelist.mjs
  var FixedSizeListBuilder;
  var init_fixedsizelist = __esm({
    "node_modules/apache-arrow/builder/fixedsizelist.mjs"() {
      init_schema2();
      init_builder2();
      init_type2();
      FixedSizeListBuilder = class extends Builder2 {
        setValue(index, value) {
          const [child] = this.children;
          const start = index * this.stride;
          for (let i = -1, n = value.length; ++i < n; ) {
            child.set(start + i, value[i]);
          }
        }
        addChild(child, name = "0") {
          if (this.numChildren > 0) {
            throw new Error("FixedSizeListBuilder can only have one child.");
          }
          const childIndex = this.children.push(child);
          this.type = new FixedSizeList2(this.type.listSize, new Field2(name, child.type, true));
          return childIndex;
        }
      };
    }
  });

  // node_modules/apache-arrow/builder/float.mjs
  var FloatBuilder, Float16Builder, Float32Builder, Float64Builder;
  var init_float = __esm({
    "node_modules/apache-arrow/builder/float.mjs"() {
      init_math();
      init_builder2();
      FloatBuilder = class extends FixedWidthBuilder {
        setValue(index, value) {
          this._values.set(index, value);
        }
      };
      Float16Builder = class extends FloatBuilder {
        setValue(index, value) {
          super.setValue(index, float64ToUint16(value));
        }
      };
      Float32Builder = class extends FloatBuilder {
      };
      Float64Builder = class extends FloatBuilder {
      };
    }
  });

  // node_modules/apache-arrow/builder/interval.mjs
  var IntervalBuilder, IntervalDayTimeBuilder, IntervalYearMonthBuilder;
  var init_interval2 = __esm({
    "node_modules/apache-arrow/builder/interval.mjs"() {
      init_builder2();
      init_set();
      IntervalBuilder = class extends FixedWidthBuilder {
      };
      IntervalBuilder.prototype._setValue = setIntervalValue;
      IntervalDayTimeBuilder = class extends IntervalBuilder {
      };
      IntervalDayTimeBuilder.prototype._setValue = setIntervalDayTime;
      IntervalYearMonthBuilder = class extends IntervalBuilder {
      };
      IntervalYearMonthBuilder.prototype._setValue = setIntervalYearMonth;
    }
  });

  // node_modules/apache-arrow/builder/duration.mjs
  var DurationBuilder, DurationSecondBuilder, DurationMillisecondBuilder, DurationMicrosecondBuilder, DurationNanosecondBuilder;
  var init_duration2 = __esm({
    "node_modules/apache-arrow/builder/duration.mjs"() {
      init_builder2();
      init_set();
      DurationBuilder = class extends FixedWidthBuilder {
      };
      DurationBuilder.prototype._setValue = setDuration;
      DurationSecondBuilder = class extends DurationBuilder {
      };
      DurationSecondBuilder.prototype._setValue = setDurationSecond;
      DurationMillisecondBuilder = class extends DurationBuilder {
      };
      DurationMillisecondBuilder.prototype._setValue = setDurationMillisecond;
      DurationMicrosecondBuilder = class extends DurationBuilder {
      };
      DurationMicrosecondBuilder.prototype._setValue = setDurationMicrosecond;
      DurationNanosecondBuilder = class extends DurationBuilder {
      };
      DurationNanosecondBuilder.prototype._setValue = setDurationNanosecond;
    }
  });

  // node_modules/apache-arrow/builder/int.mjs
  var IntBuilder, Int8Builder, Int16Builder, Int32Builder, Int64Builder, Uint8Builder, Uint16Builder, Uint32Builder, Uint64Builder;
  var init_int3 = __esm({
    "node_modules/apache-arrow/builder/int.mjs"() {
      init_builder2();
      IntBuilder = class extends FixedWidthBuilder {
        setValue(index, value) {
          this._values.set(index, value);
        }
      };
      Int8Builder = class extends IntBuilder {
      };
      Int16Builder = class extends IntBuilder {
      };
      Int32Builder = class extends IntBuilder {
      };
      Int64Builder = class extends IntBuilder {
      };
      Uint8Builder = class extends IntBuilder {
      };
      Uint16Builder = class extends IntBuilder {
      };
      Uint32Builder = class extends IntBuilder {
      };
      Uint64Builder = class extends IntBuilder {
      };
    }
  });

  // node_modules/apache-arrow/builder/list.mjs
  var ListBuilder;
  var init_list2 = __esm({
    "node_modules/apache-arrow/builder/list.mjs"() {
      init_schema2();
      init_type2();
      init_buffer3();
      init_builder2();
      ListBuilder = class extends VariableWidthBuilder {
        constructor(opts) {
          super(opts);
          this._offsets = new OffsetsBufferBuilder(opts.type);
        }
        addChild(child, name = "0") {
          if (this.numChildren > 0) {
            throw new Error("ListBuilder can only have one child.");
          }
          this.children[this.numChildren] = child;
          this.type = new List2(new Field2(name, child.type, true));
          return this.numChildren - 1;
        }
        _flushPending(pending) {
          const offsets = this._offsets;
          const [child] = this.children;
          for (const [index, value] of pending) {
            if (typeof value === "undefined") {
              offsets.set(index, 0);
            } else {
              const v = value;
              const n = v.length;
              const start = offsets.set(index, n).buffer[index];
              for (let i = -1; ++i < n; ) {
                child.set(start + i, v[i]);
              }
            }
          }
        }
      };
    }
  });

  // node_modules/apache-arrow/builder/map.mjs
  var MapBuilder;
  var init_map3 = __esm({
    "node_modules/apache-arrow/builder/map.mjs"() {
      init_schema2();
      init_type2();
      init_builder2();
      MapBuilder = class extends VariableWidthBuilder {
        set(index, value) {
          return super.set(index, value);
        }
        setValue(index, value) {
          const row = value instanceof Map ? value : new Map(Object.entries(value));
          const pending = this._pending || (this._pending = /* @__PURE__ */ new Map());
          const current = pending.get(index);
          current && (this._pendingLength -= current.size);
          this._pendingLength += row.size;
          pending.set(index, row);
        }
        addChild(child, name = `${this.numChildren}`) {
          if (this.numChildren > 0) {
            throw new Error("ListBuilder can only have one child.");
          }
          this.children[this.numChildren] = child;
          this.type = new Map_(new Field2(name, child.type, true), this.type.keysSorted);
          return this.numChildren - 1;
        }
        _flushPending(pending) {
          const offsets = this._offsets;
          const [child] = this.children;
          for (const [index, value] of pending) {
            if (value === void 0) {
              offsets.set(index, 0);
            } else {
              let { [index]: idx, [index + 1]: end } = offsets.set(index, value.size).buffer;
              for (const val of value.entries()) {
                child.set(idx, val);
                if (++idx >= end)
                  break;
              }
            }
          }
        }
      };
    }
  });

  // node_modules/apache-arrow/builder/null.mjs
  var NullBuilder;
  var init_null2 = __esm({
    "node_modules/apache-arrow/builder/null.mjs"() {
      init_builder2();
      NullBuilder = class extends Builder2 {
        // @ts-ignore
        setValue(index, value) {
        }
        setValid(index, valid) {
          this.length = Math.max(index + 1, this.length);
          return valid;
        }
      };
    }
  });

  // node_modules/apache-arrow/builder/struct.mjs
  var StructBuilder;
  var init_struct3 = __esm({
    "node_modules/apache-arrow/builder/struct.mjs"() {
      init_schema2();
      init_builder2();
      init_type2();
      StructBuilder = class extends Builder2 {
        setValue(index, value) {
          const { children, type } = this;
          switch (Array.isArray(value) || value.constructor) {
            case true:
              return type.children.forEach((_, i) => children[i].set(index, value[i]));
            case Map:
              return type.children.forEach((f, i) => children[i].set(index, value.get(f.name)));
            default:
              return type.children.forEach((f, i) => children[i].set(index, value[f.name]));
          }
        }
        /** @inheritdoc */
        setValid(index, valid) {
          if (!super.setValid(index, valid)) {
            this.children.forEach((child) => child.setValid(index, valid));
          }
          return valid;
        }
        addChild(child, name = `${this.numChildren}`) {
          const childIndex = this.children.push(child);
          this.type = new Struct([...this.type.children, new Field2(name, child.type, true)]);
          return childIndex;
        }
      };
    }
  });

  // node_modules/apache-arrow/builder/timestamp.mjs
  var TimestampBuilder, TimestampSecondBuilder, TimestampMillisecondBuilder, TimestampMicrosecondBuilder, TimestampNanosecondBuilder;
  var init_timestamp2 = __esm({
    "node_modules/apache-arrow/builder/timestamp.mjs"() {
      init_builder2();
      init_set();
      TimestampBuilder = class extends FixedWidthBuilder {
      };
      TimestampBuilder.prototype._setValue = setTimestamp;
      TimestampSecondBuilder = class extends TimestampBuilder {
      };
      TimestampSecondBuilder.prototype._setValue = setTimestampSecond;
      TimestampMillisecondBuilder = class extends TimestampBuilder {
      };
      TimestampMillisecondBuilder.prototype._setValue = setTimestampMillisecond;
      TimestampMicrosecondBuilder = class extends TimestampBuilder {
      };
      TimestampMicrosecondBuilder.prototype._setValue = setTimestampMicrosecond;
      TimestampNanosecondBuilder = class extends TimestampBuilder {
      };
      TimestampNanosecondBuilder.prototype._setValue = setTimestampNanosecond;
    }
  });

  // node_modules/apache-arrow/builder/time.mjs
  var TimeBuilder, TimeSecondBuilder, TimeMillisecondBuilder, TimeMicrosecondBuilder, TimeNanosecondBuilder;
  var init_time2 = __esm({
    "node_modules/apache-arrow/builder/time.mjs"() {
      init_builder2();
      init_set();
      TimeBuilder = class extends FixedWidthBuilder {
      };
      TimeBuilder.prototype._setValue = setTime;
      TimeSecondBuilder = class extends TimeBuilder {
      };
      TimeSecondBuilder.prototype._setValue = setTimeSecond;
      TimeMillisecondBuilder = class extends TimeBuilder {
      };
      TimeMillisecondBuilder.prototype._setValue = setTimeMillisecond;
      TimeMicrosecondBuilder = class extends TimeBuilder {
      };
      TimeMicrosecondBuilder.prototype._setValue = setTimeMicrosecond;
      TimeNanosecondBuilder = class extends TimeBuilder {
      };
      TimeNanosecondBuilder.prototype._setValue = setTimeNanosecond;
    }
  });

  // node_modules/apache-arrow/builder/union.mjs
  var UnionBuilder, SparseUnionBuilder, DenseUnionBuilder;
  var init_union2 = __esm({
    "node_modules/apache-arrow/builder/union.mjs"() {
      init_schema2();
      init_buffer3();
      init_builder2();
      init_type2();
      UnionBuilder = class extends Builder2 {
        constructor(options) {
          super(options);
          this._typeIds = new DataBufferBuilder(Int8Array, 0, 1);
          if (typeof options["valueToChildTypeId"] === "function") {
            this._valueToChildTypeId = options["valueToChildTypeId"];
          }
        }
        get typeIdToChildIndex() {
          return this.type.typeIdToChildIndex;
        }
        append(value, childTypeId) {
          return this.set(this.length, value, childTypeId);
        }
        set(index, value, childTypeId) {
          if (childTypeId === void 0) {
            childTypeId = this._valueToChildTypeId(this, value, index);
          }
          this.setValue(index, value, childTypeId);
          return this;
        }
        setValue(index, value, childTypeId) {
          this._typeIds.set(index, childTypeId);
          const childIndex = this.type.typeIdToChildIndex[childTypeId];
          const child = this.children[childIndex];
          child === null || child === void 0 ? void 0 : child.set(index, value);
        }
        addChild(child, name = `${this.children.length}`) {
          const childTypeId = this.children.push(child);
          const { type: { children, mode, typeIds } } = this;
          const fields = [...children, new Field2(name, child.type)];
          this.type = new Union_(mode, [...typeIds, childTypeId], fields);
          return childTypeId;
        }
        /** @ignore */
        // @ts-ignore
        _valueToChildTypeId(builder, value, offset) {
          throw new Error(`Cannot map UnionBuilder value to child typeId. Pass the \`childTypeId\` as the second argument to unionBuilder.append(), or supply a \`valueToChildTypeId\` function as part of the UnionBuilder constructor options.`);
        }
      };
      SparseUnionBuilder = class extends UnionBuilder {
      };
      DenseUnionBuilder = class extends UnionBuilder {
        constructor(options) {
          super(options);
          this._offsets = new DataBufferBuilder(Int32Array);
        }
        /** @ignore */
        setValue(index, value, childTypeId) {
          const id = this._typeIds.set(index, childTypeId).buffer[index];
          const child = this.getChildAt(this.type.typeIdToChildIndex[id]);
          const denseIndex = this._offsets.set(index, child.length).buffer[index];
          child === null || child === void 0 ? void 0 : child.set(denseIndex, value);
        }
      };
    }
  });

  // node_modules/apache-arrow/builder/utf8.mjs
  var Utf8Builder;
  var init_utf83 = __esm({
    "node_modules/apache-arrow/builder/utf8.mjs"() {
      init_utf8();
      init_binary2();
      init_buffer3();
      init_builder2();
      Utf8Builder = class extends VariableWidthBuilder {
        constructor(opts) {
          super(opts);
          this._values = new BufferBuilder(Uint8Array);
        }
        get byteLength() {
          let size = this._pendingLength + this.length * 4;
          this._offsets && (size += this._offsets.byteLength);
          this._values && (size += this._values.byteLength);
          this._nulls && (size += this._nulls.byteLength);
          return size;
        }
        setValue(index, value) {
          return super.setValue(index, encodeUtf8(value));
        }
        // @ts-ignore
        _flushPending(pending, pendingLength) {
        }
      };
      Utf8Builder.prototype._flushPending = BinaryBuilder.prototype._flushPending;
    }
  });

  // node_modules/apache-arrow/builder/largeutf8.mjs
  var LargeUtf8Builder;
  var init_largeutf8 = __esm({
    "node_modules/apache-arrow/builder/largeutf8.mjs"() {
      init_utf8();
      init_buffer3();
      init_builder2();
      init_largebinary();
      LargeUtf8Builder = class extends VariableWidthBuilder {
        constructor(opts) {
          super(opts);
          this._values = new BufferBuilder(Uint8Array);
        }
        get byteLength() {
          let size = this._pendingLength + this.length * 4;
          this._offsets && (size += this._offsets.byteLength);
          this._values && (size += this._values.byteLength);
          this._nulls && (size += this._nulls.byteLength);
          return size;
        }
        setValue(index, value) {
          return super.setValue(index, encodeUtf8(value));
        }
        // @ts-ignore
        _flushPending(pending, pendingLength) {
        }
      };
      LargeUtf8Builder.prototype._flushPending = LargeBinaryBuilder.prototype._flushPending;
    }
  });

  // node_modules/apache-arrow/visitor/builderctor.mjs
  var GetBuilderCtor, instance5;
  var init_builderctor = __esm({
    "node_modules/apache-arrow/visitor/builderctor.mjs"() {
      init_visitor();
      init_binary2();
      init_largebinary();
      init_bool2();
      init_date2();
      init_decimal2();
      init_dictionary();
      init_fixedsizebinary();
      init_fixedsizelist();
      init_float();
      init_interval2();
      init_duration2();
      init_int3();
      init_list2();
      init_map3();
      init_null2();
      init_struct3();
      init_timestamp2();
      init_time2();
      init_union2();
      init_utf83();
      init_largeutf8();
      GetBuilderCtor = class extends Visitor {
        visitNull() {
          return NullBuilder;
        }
        visitBool() {
          return BoolBuilder;
        }
        visitInt() {
          return IntBuilder;
        }
        visitInt8() {
          return Int8Builder;
        }
        visitInt16() {
          return Int16Builder;
        }
        visitInt32() {
          return Int32Builder;
        }
        visitInt64() {
          return Int64Builder;
        }
        visitUint8() {
          return Uint8Builder;
        }
        visitUint16() {
          return Uint16Builder;
        }
        visitUint32() {
          return Uint32Builder;
        }
        visitUint64() {
          return Uint64Builder;
        }
        visitFloat() {
          return FloatBuilder;
        }
        visitFloat16() {
          return Float16Builder;
        }
        visitFloat32() {
          return Float32Builder;
        }
        visitFloat64() {
          return Float64Builder;
        }
        visitUtf8() {
          return Utf8Builder;
        }
        visitLargeUtf8() {
          return LargeUtf8Builder;
        }
        visitBinary() {
          return BinaryBuilder;
        }
        visitLargeBinary() {
          return LargeBinaryBuilder;
        }
        visitFixedSizeBinary() {
          return FixedSizeBinaryBuilder;
        }
        visitDate() {
          return DateBuilder;
        }
        visitDateDay() {
          return DateDayBuilder;
        }
        visitDateMillisecond() {
          return DateMillisecondBuilder;
        }
        visitTimestamp() {
          return TimestampBuilder;
        }
        visitTimestampSecond() {
          return TimestampSecondBuilder;
        }
        visitTimestampMillisecond() {
          return TimestampMillisecondBuilder;
        }
        visitTimestampMicrosecond() {
          return TimestampMicrosecondBuilder;
        }
        visitTimestampNanosecond() {
          return TimestampNanosecondBuilder;
        }
        visitTime() {
          return TimeBuilder;
        }
        visitTimeSecond() {
          return TimeSecondBuilder;
        }
        visitTimeMillisecond() {
          return TimeMillisecondBuilder;
        }
        visitTimeMicrosecond() {
          return TimeMicrosecondBuilder;
        }
        visitTimeNanosecond() {
          return TimeNanosecondBuilder;
        }
        visitDecimal() {
          return DecimalBuilder;
        }
        visitList() {
          return ListBuilder;
        }
        visitStruct() {
          return StructBuilder;
        }
        visitUnion() {
          return UnionBuilder;
        }
        visitDenseUnion() {
          return DenseUnionBuilder;
        }
        visitSparseUnion() {
          return SparseUnionBuilder;
        }
        visitDictionary() {
          return DictionaryBuilder;
        }
        visitInterval() {
          return IntervalBuilder;
        }
        visitIntervalDayTime() {
          return IntervalDayTimeBuilder;
        }
        visitIntervalYearMonth() {
          return IntervalYearMonthBuilder;
        }
        visitDuration() {
          return DurationBuilder;
        }
        visitDurationSecond() {
          return DurationSecondBuilder;
        }
        visitDurationMillisecond() {
          return DurationMillisecondBuilder;
        }
        visitDurationMicrosecond() {
          return DurationMicrosecondBuilder;
        }
        visitDurationNanosecond() {
          return DurationNanosecondBuilder;
        }
        visitFixedSizeList() {
          return FixedSizeListBuilder;
        }
        visitMap() {
          return MapBuilder;
        }
      };
      instance5 = new GetBuilderCtor();
    }
  });

  // node_modules/apache-arrow/visitor/typecomparator.mjs
  function compareConstructor(type, other) {
    return other instanceof type.constructor;
  }
  function compareAny(type, other) {
    return type === other || compareConstructor(type, other);
  }
  function compareInt(type, other) {
    return type === other || compareConstructor(type, other) && type.bitWidth === other.bitWidth && type.isSigned === other.isSigned;
  }
  function compareFloat(type, other) {
    return type === other || compareConstructor(type, other) && type.precision === other.precision;
  }
  function compareFixedSizeBinary(type, other) {
    return type === other || compareConstructor(type, other) && type.byteWidth === other.byteWidth;
  }
  function compareDate(type, other) {
    return type === other || compareConstructor(type, other) && type.unit === other.unit;
  }
  function compareTimestamp(type, other) {
    return type === other || compareConstructor(type, other) && type.unit === other.unit && type.timezone === other.timezone;
  }
  function compareTime(type, other) {
    return type === other || compareConstructor(type, other) && type.unit === other.unit && type.bitWidth === other.bitWidth;
  }
  function compareList(type, other) {
    return type === other || compareConstructor(type, other) && type.children.length === other.children.length && instance6.compareManyFields(type.children, other.children);
  }
  function compareStruct(type, other) {
    return type === other || compareConstructor(type, other) && type.children.length === other.children.length && instance6.compareManyFields(type.children, other.children);
  }
  function compareUnion(type, other) {
    return type === other || compareConstructor(type, other) && type.mode === other.mode && type.typeIds.every((x, i) => x === other.typeIds[i]) && instance6.compareManyFields(type.children, other.children);
  }
  function compareDictionary(type, other) {
    return type === other || compareConstructor(type, other) && type.id === other.id && type.isOrdered === other.isOrdered && instance6.visit(type.indices, other.indices) && instance6.visit(type.dictionary, other.dictionary);
  }
  function compareInterval(type, other) {
    return type === other || compareConstructor(type, other) && type.unit === other.unit;
  }
  function compareDuration(type, other) {
    return type === other || compareConstructor(type, other) && type.unit === other.unit;
  }
  function compareFixedSizeList(type, other) {
    return type === other || compareConstructor(type, other) && type.listSize === other.listSize && type.children.length === other.children.length && instance6.compareManyFields(type.children, other.children);
  }
  function compareMap(type, other) {
    return type === other || compareConstructor(type, other) && type.keysSorted === other.keysSorted && type.children.length === other.children.length && instance6.compareManyFields(type.children, other.children);
  }
  function compareSchemas(schema, other) {
    return instance6.compareSchemas(schema, other);
  }
  function compareFields(field, other) {
    return instance6.compareFields(field, other);
  }
  function compareTypes(type, other) {
    return instance6.visit(type, other);
  }
  var TypeComparator, instance6;
  var init_typecomparator = __esm({
    "node_modules/apache-arrow/visitor/typecomparator.mjs"() {
      init_visitor();
      TypeComparator = class extends Visitor {
        compareSchemas(schema, other) {
          return schema === other || other instanceof schema.constructor && this.compareManyFields(schema.fields, other.fields);
        }
        compareManyFields(fields, others) {
          return fields === others || Array.isArray(fields) && Array.isArray(others) && fields.length === others.length && fields.every((f, i) => this.compareFields(f, others[i]));
        }
        compareFields(field, other) {
          return field === other || other instanceof field.constructor && field.name === other.name && field.nullable === other.nullable && this.visit(field.type, other.type);
        }
      };
      TypeComparator.prototype.visitNull = compareAny;
      TypeComparator.prototype.visitBool = compareAny;
      TypeComparator.prototype.visitInt = compareInt;
      TypeComparator.prototype.visitInt8 = compareInt;
      TypeComparator.prototype.visitInt16 = compareInt;
      TypeComparator.prototype.visitInt32 = compareInt;
      TypeComparator.prototype.visitInt64 = compareInt;
      TypeComparator.prototype.visitUint8 = compareInt;
      TypeComparator.prototype.visitUint16 = compareInt;
      TypeComparator.prototype.visitUint32 = compareInt;
      TypeComparator.prototype.visitUint64 = compareInt;
      TypeComparator.prototype.visitFloat = compareFloat;
      TypeComparator.prototype.visitFloat16 = compareFloat;
      TypeComparator.prototype.visitFloat32 = compareFloat;
      TypeComparator.prototype.visitFloat64 = compareFloat;
      TypeComparator.prototype.visitUtf8 = compareAny;
      TypeComparator.prototype.visitLargeUtf8 = compareAny;
      TypeComparator.prototype.visitBinary = compareAny;
      TypeComparator.prototype.visitLargeBinary = compareAny;
      TypeComparator.prototype.visitFixedSizeBinary = compareFixedSizeBinary;
      TypeComparator.prototype.visitDate = compareDate;
      TypeComparator.prototype.visitDateDay = compareDate;
      TypeComparator.prototype.visitDateMillisecond = compareDate;
      TypeComparator.prototype.visitTimestamp = compareTimestamp;
      TypeComparator.prototype.visitTimestampSecond = compareTimestamp;
      TypeComparator.prototype.visitTimestampMillisecond = compareTimestamp;
      TypeComparator.prototype.visitTimestampMicrosecond = compareTimestamp;
      TypeComparator.prototype.visitTimestampNanosecond = compareTimestamp;
      TypeComparator.prototype.visitTime = compareTime;
      TypeComparator.prototype.visitTimeSecond = compareTime;
      TypeComparator.prototype.visitTimeMillisecond = compareTime;
      TypeComparator.prototype.visitTimeMicrosecond = compareTime;
      TypeComparator.prototype.visitTimeNanosecond = compareTime;
      TypeComparator.prototype.visitDecimal = compareAny;
      TypeComparator.prototype.visitList = compareList;
      TypeComparator.prototype.visitStruct = compareStruct;
      TypeComparator.prototype.visitUnion = compareUnion;
      TypeComparator.prototype.visitDenseUnion = compareUnion;
      TypeComparator.prototype.visitSparseUnion = compareUnion;
      TypeComparator.prototype.visitDictionary = compareDictionary;
      TypeComparator.prototype.visitInterval = compareInterval;
      TypeComparator.prototype.visitIntervalDayTime = compareInterval;
      TypeComparator.prototype.visitIntervalYearMonth = compareInterval;
      TypeComparator.prototype.visitDuration = compareDuration;
      TypeComparator.prototype.visitDurationSecond = compareDuration;
      TypeComparator.prototype.visitDurationMillisecond = compareDuration;
      TypeComparator.prototype.visitDurationMicrosecond = compareDuration;
      TypeComparator.prototype.visitDurationNanosecond = compareDuration;
      TypeComparator.prototype.visitFixedSizeList = compareFixedSizeList;
      TypeComparator.prototype.visitMap = compareMap;
      instance6 = new TypeComparator();
    }
  });

  // node_modules/apache-arrow/factories.mjs
  function makeBuilder(options) {
    const type = options.type;
    const builder = new (instance5.getVisitFn(type)())(options);
    if (type.children && type.children.length > 0) {
      const children = options["children"] || [];
      const defaultOptions = { "nullValues": options["nullValues"] };
      const getChildOptions = Array.isArray(children) ? ((_, i) => children[i] || defaultOptions) : (({ name }) => children[name] || defaultOptions);
      for (const [index, field] of type.children.entries()) {
        const { type: type2 } = field;
        const opts = getChildOptions(field, index);
        builder.children.push(makeBuilder(Object.assign(Object.assign({}, opts), { type: type2 })));
      }
    }
    return builder;
  }
  function vectorFromArray(init, type) {
    if (init instanceof Data || init instanceof Vector || init.type instanceof DataType || ArrayBuffer.isView(init)) {
      return makeVector(init);
    }
    const options = { type: type !== null && type !== void 0 ? type : inferType(init), nullValues: [null] };
    const chunks = [...builderThroughIterable(options)(init)];
    const vector = chunks.length === 1 ? chunks[0] : chunks.reduce((a, b) => a.concat(b));
    if (DataType.isDictionary(vector.type)) {
      return vector.memoize();
    }
    return vector;
  }
  function tableFromJSON(array) {
    const vector = vectorFromArray(array);
    const batch = new RecordBatch2(new Schema2(vector.type.children), vector.data[0]);
    return new Table(batch);
  }
  function inferType(value) {
    if (value.length === 0) {
      return new Null2();
    }
    let nullsCount = 0;
    let arraysCount = 0;
    let objectsCount = 0;
    let numbersCount = 0;
    let stringsCount = 0;
    let bigintsCount = 0;
    let booleansCount = 0;
    let datesCount = 0;
    for (const val of value) {
      if (val == null) {
        ++nullsCount;
        continue;
      }
      switch (typeof val) {
        case "bigint":
          ++bigintsCount;
          continue;
        case "boolean":
          ++booleansCount;
          continue;
        case "number":
          ++numbersCount;
          continue;
        case "string":
          ++stringsCount;
          continue;
        case "object":
          if (Array.isArray(val)) {
            ++arraysCount;
          } else if (Object.prototype.toString.call(val) === "[object Date]") {
            ++datesCount;
          } else {
            ++objectsCount;
          }
          continue;
      }
      throw new TypeError("Unable to infer Vector type from input values, explicit type declaration expected.");
    }
    if (numbersCount + nullsCount === value.length) {
      return new Float64();
    } else if (stringsCount + nullsCount === value.length) {
      return new Dictionary(new Utf82(), new Int32());
    } else if (bigintsCount + nullsCount === value.length) {
      return new Int64();
    } else if (booleansCount + nullsCount === value.length) {
      return new Bool2();
    } else if (datesCount + nullsCount === value.length) {
      return new TimestampMillisecond();
    } else if (arraysCount + nullsCount === value.length) {
      const array = value;
      const childType = inferType(array[array.findIndex((ary) => ary != null)]);
      if (array.every((ary) => ary == null || compareTypes(childType, inferType(ary)))) {
        return new List2(new Field2("", childType, true));
      }
    } else if (objectsCount + nullsCount === value.length) {
      const fields = /* @__PURE__ */ new Map();
      for (const row of value) {
        for (const key of Object.keys(row)) {
          if (!fields.has(key) && row[key] != null) {
            fields.set(key, new Field2(key, inferType([row[key]]), true));
          }
        }
      }
      return new Struct([...fields.values()]);
    }
    throw new TypeError("Unable to infer Vector type from input values, explicit type declaration expected.");
  }
  function builderThroughIterable(options) {
    const { ["queueingStrategy"]: queueingStrategy = "count" } = options;
    const { ["highWaterMark"]: highWaterMark = queueingStrategy !== "bytes" ? Number.POSITIVE_INFINITY : Math.pow(2, 14) } = options;
    const sizeProperty = queueingStrategy !== "bytes" ? "length" : "byteLength";
    return function* (source) {
      let numChunks = 0;
      const builder = makeBuilder(options);
      for (const value of source) {
        if (builder.append(value)[sizeProperty] >= highWaterMark) {
          ++numChunks && (yield builder.toVector());
        }
      }
      if (builder.finish().length > 0 || numChunks === 0) {
        yield builder.toVector();
      }
    };
  }
  function builderThroughAsyncIterable(options) {
    const { ["queueingStrategy"]: queueingStrategy = "count" } = options;
    const { ["highWaterMark"]: highWaterMark = queueingStrategy !== "bytes" ? Number.POSITIVE_INFINITY : Math.pow(2, 14) } = options;
    const sizeProperty = queueingStrategy !== "bytes" ? "length" : "byteLength";
    return function(source) {
      return __asyncGenerator(this, arguments, function* () {
        var _a5, e_1, _b2, _c2;
        let numChunks = 0;
        const builder = makeBuilder(options);
        try {
          for (var _d2 = true, source_1 = __asyncValues(source), source_1_1; source_1_1 = yield __await(source_1.next()), _a5 = source_1_1.done, !_a5; _d2 = true) {
            _c2 = source_1_1.value;
            _d2 = false;
            const value = _c2;
            if (builder.append(value)[sizeProperty] >= highWaterMark) {
              ++numChunks && (yield yield __await(builder.toVector()));
            }
          }
        } catch (e_1_1) {
          e_1 = { error: e_1_1 };
        } finally {
          try {
            if (!_d2 && !_a5 && (_b2 = source_1.return)) yield __await(_b2.call(source_1));
          } finally {
            if (e_1) throw e_1.error;
          }
        }
        if (builder.finish().length > 0 || numChunks === 0) {
          yield yield __await(builder.toVector());
        }
      });
    };
  }
  var init_factories = __esm({
    "node_modules/apache-arrow/factories.mjs"() {
      init_tslib_es6();
      init_schema2();
      init_type2();
      init_data();
      init_vector2();
      init_builderctor();
      init_table();
      init_recordbatch2();
      init_typecomparator();
    }
  });

  // node_modules/apache-arrow/util/recordbatch.mjs
  function distributeVectorsIntoRecordBatches(schema, vecs) {
    return uniformlyDistributeChunksAcrossRecordBatches(schema, vecs.map((v) => v.data.concat()));
  }
  function uniformlyDistributeChunksAcrossRecordBatches(schema, cols) {
    const fields = [...schema.fields];
    const batches = [];
    const memo = { numBatches: cols.reduce((n, c) => Math.max(n, c.length), 0) };
    let numBatches = 0, batchLength = 0;
    let i = -1;
    const numColumns = cols.length;
    let child, children = [];
    while (memo.numBatches-- > 0) {
      for (batchLength = Number.POSITIVE_INFINITY, i = -1; ++i < numColumns; ) {
        children[i] = child = cols[i].shift();
        batchLength = Math.min(batchLength, child ? child.length : batchLength);
      }
      if (Number.isFinite(batchLength)) {
        children = distributeChildren(fields, batchLength, children, cols, memo);
        if (batchLength > 0) {
          batches[numBatches++] = makeData({
            type: new Struct(fields),
            length: batchLength,
            nullCount: 0,
            children: children.slice()
          });
        }
      }
    }
    return [
      schema = schema.assign(fields),
      batches.map((data) => new RecordBatch2(schema, data))
    ];
  }
  function distributeChildren(fields, batchLength, children, columns, memo) {
    var _a5;
    const nullBitmapSize = (batchLength + 63 & ~63) >> 3;
    for (let i = -1, n = columns.length; ++i < n; ) {
      const child = children[i];
      const length = child === null || child === void 0 ? void 0 : child.length;
      if (length >= batchLength) {
        if (length === batchLength) {
          children[i] = child;
        } else {
          children[i] = child.slice(0, batchLength);
          memo.numBatches = Math.max(memo.numBatches, columns[i].unshift(child.slice(batchLength, length - batchLength)));
        }
      } else {
        const field = fields[i];
        fields[i] = field.clone({ nullable: true });
        children[i] = (_a5 = child === null || child === void 0 ? void 0 : child._changeLengthAndBackfillNullBitmap(batchLength)) !== null && _a5 !== void 0 ? _a5 : makeData({
          type: field.type,
          length: batchLength,
          nullCount: batchLength,
          nullBitmap: new Uint8Array(nullBitmapSize)
        });
      }
    }
    return children;
  }
  var init_recordbatch = __esm({
    "node_modules/apache-arrow/util/recordbatch.mjs"() {
      init_data();
      init_type2();
      init_recordbatch2();
    }
  });

  // node_modules/apache-arrow/table.mjs
  function makeTable(input) {
    const vecs = {};
    const inputs = Object.entries(input);
    for (const [key, col] of inputs) {
      vecs[key] = makeVector(col);
    }
    return new Table(vecs);
  }
  function tableFromArrays(input) {
    const vecs = {};
    const inputs = Object.entries(input);
    for (const [key, col] of inputs) {
      vecs[key] = vectorFromArray(col);
    }
    return new Table(vecs);
  }
  var _a3, Table;
  var init_table = __esm({
    "node_modules/apache-arrow/table.mjs"() {
      init_enum();
      init_data();
      init_factories();
      init_vector2();
      init_schema2();
      init_type2();
      init_typecomparator();
      init_recordbatch();
      init_chunk();
      init_get();
      init_set();
      init_indexof();
      init_iterator();
      init_vector();
      init_recordbatch2();
      Table = class _Table {
        constructor(...args) {
          var _b2, _c2;
          if (args.length === 0) {
            this.batches = [];
            this.schema = new Schema2([]);
            this._offsets = [0];
            return this;
          }
          let schema;
          let offsets;
          if (args[0] instanceof Schema2) {
            schema = args.shift();
          }
          if (args.at(-1) instanceof Uint32Array) {
            offsets = args.pop();
          }
          const unwrap = (x) => {
            if (x) {
              if (x instanceof RecordBatch2) {
                return [x];
              } else if (x instanceof _Table) {
                return x.batches;
              } else if (x instanceof Data) {
                if (x.type instanceof Struct) {
                  return [new RecordBatch2(new Schema2(x.type.children), x)];
                }
              } else if (Array.isArray(x)) {
                return x.flatMap((v) => unwrap(v));
              } else if (typeof x[Symbol.iterator] === "function") {
                return [...x].flatMap((v) => unwrap(v));
              } else if (typeof x === "object") {
                const keys2 = Object.keys(x);
                const vecs = keys2.map((k) => new Vector([x[k]]));
                const batchSchema = schema !== null && schema !== void 0 ? schema : new Schema2(keys2.map((k, i) => new Field2(String(k), vecs[i].type, vecs[i].nullable)));
                const [, batches2] = distributeVectorsIntoRecordBatches(batchSchema, vecs);
                return batches2.length === 0 ? [new RecordBatch2(x)] : batches2;
              }
            }
            return [];
          };
          const batches = args.flatMap((v) => unwrap(v));
          schema = (_c2 = schema !== null && schema !== void 0 ? schema : (_b2 = batches[0]) === null || _b2 === void 0 ? void 0 : _b2.schema) !== null && _c2 !== void 0 ? _c2 : new Schema2([]);
          if (!(schema instanceof Schema2)) {
            throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");
          }
          for (const batch of batches) {
            if (!(batch instanceof RecordBatch2)) {
              throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");
            }
            if (!compareSchemas(schema, batch.schema)) {
              throw new TypeError("Table and inner RecordBatch schemas must be equivalent.");
            }
          }
          this.schema = schema;
          this.batches = batches;
          this._offsets = offsets !== null && offsets !== void 0 ? offsets : computeChunkOffsets(this.data);
        }
        /**
         * The contiguous {@link RecordBatch `RecordBatch`} chunks of the Table rows.
         */
        get data() {
          return this.batches.map(({ data }) => data);
        }
        /**
         * The number of columns in this Table.
         */
        get numCols() {
          return this.schema.fields.length;
        }
        /**
         * The number of rows in this Table.
         */
        get numRows() {
          return this.data.reduce((numRows, data) => numRows + data.length, 0);
        }
        /**
         * The number of null rows in this Table.
         */
        get nullCount() {
          if (this._nullCount === -1) {
            this._nullCount = computeChunkNullCounts(this.data);
          }
          return this._nullCount;
        }
        /**
         * Check whether an element is null.
         *
         * @param index The index at which to read the validity bitmap.
         */
        // @ts-ignore
        isValid(index) {
          return false;
        }
        /**
         * Get an element value by position.
         *
         * @param index The index of the element to read.
         */
        // @ts-ignore
        get(index) {
          return null;
        }
        /**
          * Get an element value by position.
          * @param index The index of the element to read. A negative index will count back from the last element.
          */
        // @ts-ignore
        at(index) {
          return this.get(wrapIndex(index, this.numRows));
        }
        /**
         * Set an element value by position.
         *
         * @param index The index of the element to write.
         * @param value The value to set.
         */
        // @ts-ignore
        set(index, value) {
          return;
        }
        /**
         * Retrieve the index of the first occurrence of a value in an Vector.
         *
         * @param element The value to locate in the Vector.
         * @param offset The index at which to begin the search. If offset is omitted, the search starts at index 0.
         */
        // @ts-ignore
        indexOf(element, offset) {
          return -1;
        }
        /**
         * Iterator for rows in this Table.
         */
        [Symbol.iterator]() {
          if (this.batches.length > 0) {
            return instance4.visit(new Vector(this.data));
          }
          return new Array(0)[Symbol.iterator]();
        }
        /**
         * Return a JavaScript Array of the Table rows.
         *
         * @returns An Array of Table rows.
         */
        toArray() {
          return [...this];
        }
        /**
         * Returns a string representation of the Table rows.
         *
         * @returns A string representation of the Table rows.
         */
        toString() {
          return `[
  ${this.toArray().join(",\n  ")}
]`;
        }
        /**
         * Combines two or more Tables of the same schema.
         *
         * @param others Additional Tables to add to the end of this Tables.
         */
        concat(...others) {
          const schema = this.schema;
          const data = this.data.concat(others.flatMap(({ data: data2 }) => data2));
          return new _Table(schema, data.map((data2) => new RecordBatch2(schema, data2)));
        }
        /**
         * Return a zero-copy sub-section of this Table.
         *
         * @param begin The beginning of the specified portion of the Table.
         * @param end The end of the specified portion of the Table. This is exclusive of the element at the index 'end'.
         */
        slice(begin, end) {
          const schema = this.schema;
          [begin, end] = clampRange({ length: this.numRows }, begin, end);
          const data = sliceChunks(this.data, this._offsets, begin, end);
          return new _Table(schema, data.map((chunk) => new RecordBatch2(schema, chunk)));
        }
        /**
         * Returns a child Vector by name, or null if this Vector has no child with the given name.
         *
         * @param name The name of the child to retrieve.
         */
        getChild(name) {
          return this.getChildAt(this.schema.fields.findIndex((f) => f.name === name));
        }
        /**
         * Returns a child Vector by index, or null if this Vector has no child at the supplied index.
         *
         * @param index The index of the child to retrieve.
         */
        getChildAt(index) {
          if (index > -1 && index < this.schema.fields.length) {
            const data = this.data.map((data2) => data2.children[index]);
            if (data.length === 0) {
              const { type } = this.schema.fields[index];
              const empty = makeData({ type, length: 0, nullCount: 0 });
              data.push(empty._changeLengthAndBackfillNullBitmap(this.numRows));
            }
            return new Vector(data);
          }
          return null;
        }
        /**
         * Sets a child Vector by name.
         *
         * @param name The name of the child to overwrite.
         * @returns A new Table with the supplied child for the specified name.
         */
        setChild(name, child) {
          var _b2;
          return this.setChildAt((_b2 = this.schema.fields) === null || _b2 === void 0 ? void 0 : _b2.findIndex((f) => f.name === name), child);
        }
        setChildAt(index, child) {
          let schema = this.schema;
          let batches = [...this.batches];
          if (index > -1 && index < this.numCols) {
            if (!child) {
              child = new Vector([makeData({ type: new Null2(), length: this.numRows })]);
            }
            const fields = schema.fields.slice();
            const field = fields[index].clone({ type: child.type });
            const children = this.schema.fields.map((_, i) => this.getChildAt(i));
            [fields[index], children[index]] = [field, child];
            [schema, batches] = distributeVectorsIntoRecordBatches(schema, children);
          }
          return new _Table(schema, batches);
        }
        /**
         * Construct a new Table containing only specified columns.
         *
         * @param columnNames Names of columns to keep.
         * @returns A new Table of columns matching the specified names.
         */
        select(columnNames) {
          const nameToIndex = this.schema.fields.reduce((m, f, i) => m.set(f.name, i), /* @__PURE__ */ new Map());
          return this.selectAt(columnNames.map((columnName) => nameToIndex.get(columnName)).filter((x) => x > -1));
        }
        /**
         * Construct a new Table containing only columns at the specified indices.
         *
         * @param columnIndices Indices of columns to keep.
         * @returns A new Table of columns at the specified indices.
         */
        selectAt(columnIndices) {
          const schema = this.schema.selectAt(columnIndices);
          const data = this.batches.map((batch) => batch.selectAt(columnIndices));
          return new _Table(schema, data);
        }
        assign(other) {
          const fields = this.schema.fields;
          const [indices, oldToNew] = other.schema.fields.reduce((memo, f2, newIdx) => {
            const [indices2, oldToNew2] = memo;
            const i = fields.findIndex((f) => f.name === f2.name);
            ~i ? oldToNew2[i] = newIdx : indices2.push(newIdx);
            return memo;
          }, [[], []]);
          const schema = this.schema.assign(other.schema);
          const columns = [
            ...fields.map((_, i) => [i, oldToNew[i]]).map(([i, j]) => j === void 0 ? this.getChildAt(i) : other.getChildAt(j)),
            ...indices.map((i) => other.getChildAt(i))
          ].filter(Boolean);
          return new _Table(...distributeVectorsIntoRecordBatches(schema, columns));
        }
      };
      _a3 = Symbol.toStringTag;
      Table[_a3] = ((proto) => {
        proto.schema = null;
        proto.batches = [];
        proto._offsets = new Uint32Array([0]);
        proto._nullCount = -1;
        proto[Symbol.isConcatSpreadable] = true;
        proto["isValid"] = wrapChunkedCall1(isChunkedValid);
        proto["get"] = wrapChunkedCall1(instance2.getVisitFn(Type2.Struct));
        proto["set"] = wrapChunkedCall2(instance.getVisitFn(Type2.Struct));
        proto["indexOf"] = wrapChunkedIndexOf(instance3.getVisitFn(Type2.Struct));
        return "Table";
      })(Table.prototype);
    }
  });

  // node_modules/apache-arrow/recordbatch.mjs
  function ensureSameLengthData(schema, chunks, maxLength = chunks.reduce((max2, col) => Math.max(max2, col.length), 0)) {
    var _b2;
    const fields = [...schema.fields];
    const children = [...chunks];
    const nullBitmapSize = (maxLength + 63 & ~63) >> 3;
    for (const [idx, field] of schema.fields.entries()) {
      const chunk = chunks[idx];
      if (!chunk || chunk.length !== maxLength) {
        fields[idx] = field.clone({ nullable: true });
        children[idx] = (_b2 = chunk === null || chunk === void 0 ? void 0 : chunk._changeLengthAndBackfillNullBitmap(maxLength)) !== null && _b2 !== void 0 ? _b2 : makeData({
          type: field.type,
          length: maxLength,
          nullCount: maxLength,
          nullBitmap: new Uint8Array(nullBitmapSize)
        });
      }
    }
    return [
      schema.assign(fields),
      makeData({ type: new Struct(fields), length: maxLength, children })
    ];
  }
  function collectDictionaries(fields, children, dictionaries = /* @__PURE__ */ new Map()) {
    var _b2, _c2;
    if (((_b2 = fields === null || fields === void 0 ? void 0 : fields.length) !== null && _b2 !== void 0 ? _b2 : 0) > 0 && (fields === null || fields === void 0 ? void 0 : fields.length) === (children === null || children === void 0 ? void 0 : children.length)) {
      for (let i = -1, n = fields.length; ++i < n; ) {
        const { type } = fields[i];
        const data = children[i];
        for (const next of [data, ...((_c2 = data === null || data === void 0 ? void 0 : data.dictionary) === null || _c2 === void 0 ? void 0 : _c2.data) || []]) {
          collectDictionaries(type.children, next === null || next === void 0 ? void 0 : next.children, dictionaries);
        }
        if (DataType.isDictionary(type)) {
          const { id } = type;
          if (!dictionaries.has(id)) {
            if (data === null || data === void 0 ? void 0 : data.dictionary) {
              dictionaries.set(id, data.dictionary);
            }
          } else if (dictionaries.get(id) !== data.dictionary) {
            throw new Error(`Cannot create Schema containing two different dictionaries with the same Id`);
          }
        }
      }
    }
    return dictionaries;
  }
  var _a4, RecordBatch2, _InternalEmptyPlaceholderRecordBatch;
  var init_recordbatch2 = __esm({
    "node_modules/apache-arrow/recordbatch.mjs"() {
      init_data();
      init_table();
      init_vector2();
      init_schema2();
      init_type2();
      init_vector();
      init_get();
      init_set();
      init_indexof();
      init_iterator();
      RecordBatch2 = class _RecordBatch {
        constructor(...args) {
          switch (args.length) {
            case 2: {
              [this.schema] = args;
              if (!(this.schema instanceof Schema2)) {
                throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");
              }
              [
                ,
                this.data = makeData({
                  nullCount: 0,
                  type: new Struct(this.schema.fields),
                  children: this.schema.fields.map((f) => makeData({ type: f.type, nullCount: 0 }))
                })
              ] = args;
              if (!(this.data instanceof Data)) {
                throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");
              }
              [this.schema, this.data] = ensureSameLengthData(this.schema, this.data.children);
              break;
            }
            case 1: {
              const [obj] = args;
              const { fields, children, length } = Object.keys(obj).reduce((memo, name, i) => {
                memo.children[i] = obj[name];
                memo.length = Math.max(memo.length, obj[name].length);
                memo.fields[i] = Field2.new({ name, type: obj[name].type, nullable: true });
                return memo;
              }, {
                length: 0,
                fields: new Array(),
                children: new Array()
              });
              const schema = new Schema2(fields);
              const data = makeData({ type: new Struct(fields), length, children, nullCount: 0 });
              [this.schema, this.data] = ensureSameLengthData(schema, data.children, length);
              break;
            }
            default:
              throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.");
          }
        }
        get dictionaries() {
          return this._dictionaries || (this._dictionaries = collectDictionaries(this.schema.fields, this.data.children));
        }
        /**
         * The number of columns in this RecordBatch.
         */
        get numCols() {
          return this.schema.fields.length;
        }
        /**
         * The number of rows in this RecordBatch.
         */
        get numRows() {
          return this.data.length;
        }
        /**
         * The number of null rows in this RecordBatch.
         */
        get nullCount() {
          return this.data.nullCount;
        }
        /**
         * Check whether an row is null.
         * @param index The index at which to read the validity bitmap.
         */
        isValid(index) {
          return this.data.getValid(index);
        }
        /**
         * Get a row by position.
         * @param index The index of the row to read.
         */
        get(index) {
          return instance2.visit(this.data, index);
        }
        /**
          * Get a row value by position.
          * @param index The index of the row to read. A negative index will count back from the last row.
          */
        at(index) {
          return this.get(wrapIndex(index, this.numRows));
        }
        /**
         * Set a row by position.
         * @param index The index of the row to write.
         * @param value The value to set.
         */
        set(index, value) {
          return instance.visit(this.data, index, value);
        }
        /**
         * Retrieve the index of the first occurrence of a row in an RecordBatch.
         * @param element The row to locate in the RecordBatch.
         * @param offset The index at which to begin the search. If offset is omitted, the search starts at index 0.
         */
        indexOf(element, offset) {
          return instance3.visit(this.data, element, offset);
        }
        /**
         * Iterator for rows in this RecordBatch.
         */
        [Symbol.iterator]() {
          return instance4.visit(new Vector([this.data]));
        }
        /**
         * Return a JavaScript Array of the RecordBatch rows.
         * @returns An Array of RecordBatch rows.
         */
        toArray() {
          return [...this];
        }
        /**
         * Combines two or more RecordBatch of the same schema.
         * @param others Additional RecordBatch to add to the end of this RecordBatch.
         */
        concat(...others) {
          return new Table(this.schema, [this, ...others]);
        }
        /**
         * Return a zero-copy sub-section of this RecordBatch.
         * @param start The beginning of the specified portion of the RecordBatch.
         * @param end The end of the specified portion of the RecordBatch. This is exclusive of the row at the index 'end'.
         */
        slice(begin, end) {
          const [slice] = new Vector([this.data]).slice(begin, end).data;
          return new _RecordBatch(this.schema, slice);
        }
        /**
         * Returns a child Vector by name, or null if this Vector has no child with the given name.
         * @param name The name of the child to retrieve.
         */
        getChild(name) {
          var _b2;
          return this.getChildAt((_b2 = this.schema.fields) === null || _b2 === void 0 ? void 0 : _b2.findIndex((f) => f.name === name));
        }
        /**
         * Returns a child Vector by index, or null if this Vector has no child at the supplied index.
         * @param index The index of the child to retrieve.
         */
        getChildAt(index) {
          if (index > -1 && index < this.schema.fields.length) {
            return new Vector([this.data.children[index]]);
          }
          return null;
        }
        /**
         * Sets a child Vector by name.
         * @param name The name of the child to overwrite.
         * @returns A new RecordBatch with the new child for the specified name.
         */
        setChild(name, child) {
          var _b2;
          return this.setChildAt((_b2 = this.schema.fields) === null || _b2 === void 0 ? void 0 : _b2.findIndex((f) => f.name === name), child);
        }
        setChildAt(index, child) {
          let schema = this.schema;
          let data = this.data;
          if (index > -1 && index < this.numCols) {
            if (!child) {
              child = new Vector([makeData({ type: new Null2(), length: this.numRows })]);
            }
            const fields = schema.fields.slice();
            const children = data.children.slice();
            const field = fields[index].clone({ type: child.type });
            [fields[index], children[index]] = [field, child.data[0]];
            schema = new Schema2(fields, new Map(this.schema.metadata));
            data = makeData({ type: new Struct(fields), children });
          }
          return new _RecordBatch(schema, data);
        }
        /**
         * Construct a new RecordBatch containing only specified columns.
         *
         * @param columnNames Names of columns to keep.
         * @returns A new RecordBatch of columns matching the specified names.
         */
        select(columnNames) {
          const schema = this.schema.select(columnNames);
          const type = new Struct(schema.fields);
          const children = [];
          for (const name of columnNames) {
            const index = this.schema.fields.findIndex((f) => f.name === name);
            if (~index) {
              children[index] = this.data.children[index];
            }
          }
          return new _RecordBatch(schema, makeData({ type, length: this.numRows, children }));
        }
        /**
         * Construct a new RecordBatch containing only columns at the specified indices.
         *
         * @param columnIndices Indices of columns to keep.
         * @returns A new RecordBatch of columns matching at the specified indices.
         */
        selectAt(columnIndices) {
          const schema = this.schema.selectAt(columnIndices);
          const children = columnIndices.map((i) => this.data.children[i]).filter(Boolean);
          const subset = makeData({ type: new Struct(schema.fields), length: this.numRows, children });
          return new _RecordBatch(schema, subset);
        }
      };
      _a4 = Symbol.toStringTag;
      RecordBatch2[_a4] = ((proto) => {
        proto._nullCount = -1;
        proto[Symbol.isConcatSpreadable] = true;
        return "RecordBatch";
      })(RecordBatch2.prototype);
      _InternalEmptyPlaceholderRecordBatch = class extends RecordBatch2 {
        constructor(schema) {
          const children = schema.fields.map((f) => makeData({ type: f.type }));
          const data = makeData({ type: new Struct(schema.fields), nullCount: 0, children });
          super(schema, data);
        }
      };
    }
  });

  // node_modules/apache-arrow/fb/message.mjs
  var Message;
  var init_message = __esm({
    "node_modules/apache-arrow/fb/message.mjs"() {
      init_flatbuffers();
      init_key_value();
      init_message_header();
      init_metadata_version();
      Message = class _Message {
        constructor() {
          this.bb = null;
          this.bb_pos = 0;
        }
        __init(i, bb) {
          this.bb_pos = i;
          this.bb = bb;
          return this;
        }
        static getRootAsMessage(bb, obj) {
          return (obj || new _Message()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        static getSizePrefixedRootAsMessage(bb, obj) {
          bb.setPosition(bb.position() + SIZE_PREFIX_LENGTH);
          return (obj || new _Message()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
        }
        version() {
          const offset = this.bb.__offset(this.bb_pos, 4);
          return offset ? this.bb.readInt16(this.bb_pos + offset) : MetadataVersion.V1;
        }
        headerType() {
          const offset = this.bb.__offset(this.bb_pos, 6);
          return offset ? this.bb.readUint8(this.bb_pos + offset) : MessageHeader.NONE;
        }
        header(obj) {
          const offset = this.bb.__offset(this.bb_pos, 8);
          return offset ? this.bb.__union(obj, this.bb_pos + offset) : null;
        }
        bodyLength() {
          const offset = this.bb.__offset(this.bb_pos, 10);
          return offset ? this.bb.readInt64(this.bb_pos + offset) : BigInt("0");
        }
        customMetadata(index, obj) {
          const offset = this.bb.__offset(this.bb_pos, 12);
          return offset ? (obj || new KeyValue()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
        }
        customMetadataLength() {
          const offset = this.bb.__offset(this.bb_pos, 12);
          return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
        }
        static startMessage(builder) {
          builder.startObject(5);
        }
        static addVersion(builder, version2) {
          builder.addFieldInt16(0, version2, MetadataVersion.V1);
        }
        static addHeaderType(builder, headerType) {
          builder.addFieldInt8(1, headerType, MessageHeader.NONE);
        }
        static addHeader(builder, headerOffset) {
          builder.addFieldOffset(2, headerOffset, 0);
        }
        static addBodyLength(builder, bodyLength) {
          builder.addFieldInt64(3, bodyLength, BigInt("0"));
        }
        static addCustomMetadata(builder, customMetadataOffset) {
          builder.addFieldOffset(4, customMetadataOffset, 0);
        }
        static createCustomMetadataVector(builder, data) {
          builder.startVector(4, data.length, 4);
          for (let i = data.length - 1; i >= 0; i--) {
            builder.addOffset(data[i]);
          }
          return builder.endVector();
        }
        static startCustomMetadataVector(builder, numElems) {
          builder.startVector(4, numElems, 4);
        }
        static endMessage(builder) {
          const offset = builder.endObject();
          return offset;
        }
        static finishMessageBuffer(builder, offset) {
          builder.finish(offset);
        }
        static finishSizePrefixedMessageBuffer(builder, offset) {
          builder.finish(offset, void 0, true);
        }
        static createMessage(builder, version2, headerType, headerOffset, bodyLength, customMetadataOffset) {
          _Message.startMessage(builder);
          _Message.addVersion(builder, version2);
          _Message.addHeaderType(builder, headerType);
          _Message.addHeader(builder, headerOffset);
          _Message.addBodyLength(builder, bodyLength);
          _Message.addCustomMetadata(builder, customMetadataOffset);
          return _Message.endMessage(builder);
        }
      };
    }
  });

  // node_modules/apache-arrow/visitor/typeassembler.mjs
  var TypeAssembler, instance7;
  var init_typeassembler = __esm({
    "node_modules/apache-arrow/visitor/typeassembler.mjs"() {
      init_visitor();
      init_null();
      init_int();
      init_floating_point();
      init_binary();
      init_large_binary();
      init_bool();
      init_utf82();
      init_large_utf8();
      init_decimal();
      init_date();
      init_time();
      init_timestamp();
      init_interval();
      init_duration();
      init_list();
      init_struct();
      init_union();
      init_dictionary_encoding();
      init_fixed_size_binary();
      init_fixed_size_list();
      init_map();
      TypeAssembler = class extends Visitor {
        visit(node, builder) {
          return node == null || builder == null ? void 0 : super.visit(node, builder);
        }
        visitNull(_node, b) {
          Null.startNull(b);
          return Null.endNull(b);
        }
        visitInt(node, b) {
          Int.startInt(b);
          Int.addBitWidth(b, node.bitWidth);
          Int.addIsSigned(b, node.isSigned);
          return Int.endInt(b);
        }
        visitFloat(node, b) {
          FloatingPoint.startFloatingPoint(b);
          FloatingPoint.addPrecision(b, node.precision);
          return FloatingPoint.endFloatingPoint(b);
        }
        visitBinary(_node, b) {
          Binary.startBinary(b);
          return Binary.endBinary(b);
        }
        visitLargeBinary(_node, b) {
          LargeBinary.startLargeBinary(b);
          return LargeBinary.endLargeBinary(b);
        }
        visitBool(_node, b) {
          Bool.startBool(b);
          return Bool.endBool(b);
        }
        visitUtf8(_node, b) {
          Utf8.startUtf8(b);
          return Utf8.endUtf8(b);
        }
        visitLargeUtf8(_node, b) {
          LargeUtf8.startLargeUtf8(b);
          return LargeUtf8.endLargeUtf8(b);
        }
        visitDecimal(node, b) {
          Decimal.startDecimal(b);
          Decimal.addScale(b, node.scale);
          Decimal.addPrecision(b, node.precision);
          Decimal.addBitWidth(b, node.bitWidth);
          return Decimal.endDecimal(b);
        }
        visitDate(node, b) {
          Date2.startDate(b);
          Date2.addUnit(b, node.unit);
          return Date2.endDate(b);
        }
        visitTime(node, b) {
          Time.startTime(b);
          Time.addUnit(b, node.unit);
          Time.addBitWidth(b, node.bitWidth);
          return Time.endTime(b);
        }
        visitTimestamp(node, b) {
          const timezone = node.timezone && b.createString(node.timezone) || void 0;
          Timestamp.startTimestamp(b);
          Timestamp.addUnit(b, node.unit);
          if (timezone !== void 0) {
            Timestamp.addTimezone(b, timezone);
          }
          return Timestamp.endTimestamp(b);
        }
        visitInterval(node, b) {
          Interval.startInterval(b);
          Interval.addUnit(b, node.unit);
          return Interval.endInterval(b);
        }
        visitDuration(node, b) {
          Duration.startDuration(b);
          Duration.addUnit(b, node.unit);
          return Duration.endDuration(b);
        }
        visitList(_node, b) {
          List.startList(b);
          return List.endList(b);
        }
        visitStruct(_node, b) {
          Struct_.startStruct_(b);
          return Struct_.endStruct_(b);
        }
        visitUnion(node, b) {
          Union.startTypeIdsVector(b, node.typeIds.length);
          const typeIds = Union.createTypeIdsVector(b, node.typeIds);
          Union.startUnion(b);
          Union.addMode(b, node.mode);
          Union.addTypeIds(b, typeIds);
          return Union.endUnion(b);
        }
        visitDictionary(node, b) {
          const indexType = this.visit(node.indices, b);
          DictionaryEncoding.startDictionaryEncoding(b);
          DictionaryEncoding.addId(b, BigInt(node.id));
          DictionaryEncoding.addIsOrdered(b, node.isOrdered);
          if (indexType !== void 0) {
            DictionaryEncoding.addIndexType(b, indexType);
          }
          return DictionaryEncoding.endDictionaryEncoding(b);
        }
        visitFixedSizeBinary(node, b) {
          FixedSizeBinary.startFixedSizeBinary(b);
          FixedSizeBinary.addByteWidth(b, node.byteWidth);
          return FixedSizeBinary.endFixedSizeBinary(b);
        }
        visitFixedSizeList(node, b) {
          FixedSizeList.startFixedSizeList(b);
          FixedSizeList.addListSize(b, node.listSize);
          return FixedSizeList.endFixedSizeList(b);
        }
        visitMap(node, b) {
          Map2.startMap(b);
          Map2.addKeysSorted(b, node.keysSorted);
          return Map2.endMap(b);
        }
      };
      instance7 = new TypeAssembler();
    }
  });

  // node_modules/apache-arrow/ipc/metadata/json.mjs
  function schemaFromJSON(_schema, dictionaries = /* @__PURE__ */ new Map()) {
    return new Schema2(schemaFieldsFromJSON(_schema, dictionaries), customMetadataFromJSON(_schema["metadata"]), dictionaries);
  }
  function recordBatchFromJSON(b) {
    return new RecordBatch3(b["count"], fieldNodesFromJSON(b["columns"]), buffersFromJSON(b["columns"]));
  }
  function dictionaryBatchFromJSON(b) {
    return new DictionaryBatch2(recordBatchFromJSON(b["data"]), b["id"], b["isDelta"]);
  }
  function schemaFieldsFromJSON(_schema, dictionaries) {
    return (_schema["fields"] || []).filter(Boolean).map((f) => Field2.fromJSON(f, dictionaries));
  }
  function fieldChildrenFromJSON(_field, dictionaries) {
    return (_field["children"] || []).filter(Boolean).map((f) => Field2.fromJSON(f, dictionaries));
  }
  function fieldNodesFromJSON(xs) {
    return (xs || []).reduce((fieldNodes, column) => [
      ...fieldNodes,
      new FieldNode2(column["count"], nullCountFromJSON(column["VALIDITY"])),
      ...fieldNodesFromJSON(column["children"])
    ], []);
  }
  function buffersFromJSON(xs, buffers = []) {
    for (let i = -1, n = (xs || []).length; ++i < n; ) {
      const column = xs[i];
      column["VALIDITY"] && buffers.push(new BufferRegion(buffers.length, column["VALIDITY"].length));
      column["TYPE_ID"] && buffers.push(new BufferRegion(buffers.length, column["TYPE_ID"].length));
      column["OFFSET"] && buffers.push(new BufferRegion(buffers.length, column["OFFSET"].length));
      column["DATA"] && buffers.push(new BufferRegion(buffers.length, column["DATA"].length));
      buffers = buffersFromJSON(column["children"], buffers);
    }
    return buffers;
  }
  function nullCountFromJSON(validity) {
    return (validity || []).reduce((sum, val) => sum + +(val === 0), 0);
  }
  function fieldFromJSON(_field, dictionaries) {
    let id;
    let keys2;
    let field;
    let dictMeta;
    let type;
    let dictType;
    if (!dictionaries || !(dictMeta = _field["dictionary"])) {
      type = typeFromJSON(_field, fieldChildrenFromJSON(_field, dictionaries));
      field = new Field2(_field["name"], type, _field["nullable"], customMetadataFromJSON(_field["metadata"]));
    } else if (!dictionaries.has(id = dictMeta["id"])) {
      keys2 = (keys2 = dictMeta["indexType"]) ? indexTypeFromJSON(keys2) : new Int32();
      dictionaries.set(id, type = typeFromJSON(_field, fieldChildrenFromJSON(_field, dictionaries)));
      dictType = new Dictionary(type, keys2, id, dictMeta["isOrdered"]);
      field = new Field2(_field["name"], dictType, _field["nullable"], customMetadataFromJSON(_field["metadata"]));
    } else {
      keys2 = (keys2 = dictMeta["indexType"]) ? indexTypeFromJSON(keys2) : new Int32();
      dictType = new Dictionary(dictionaries.get(id), keys2, id, dictMeta["isOrdered"]);
      field = new Field2(_field["name"], dictType, _field["nullable"], customMetadataFromJSON(_field["metadata"]));
    }
    return field || null;
  }
  function customMetadataFromJSON(metadata = []) {
    return new Map(metadata.map(({ key, value }) => [key, value]));
  }
  function indexTypeFromJSON(_type) {
    return new Int_(_type["isSigned"], _type["bitWidth"]);
  }
  function typeFromJSON(f, children) {
    const typeId = f["type"]["name"];
    switch (typeId) {
      case "NONE":
        return new Null2();
      case "null":
        return new Null2();
      case "binary":
        return new Binary2();
      case "largebinary":
        return new LargeBinary2();
      case "utf8":
        return new Utf82();
      case "largeutf8":
        return new LargeUtf82();
      case "bool":
        return new Bool2();
      case "list":
        return new List2((children || [])[0]);
      case "struct":
        return new Struct(children || []);
      case "struct_":
        return new Struct(children || []);
    }
    switch (typeId) {
      case "int": {
        const t = f["type"];
        return new Int_(t["isSigned"], t["bitWidth"]);
      }
      case "floatingpoint": {
        const t = f["type"];
        return new Float(Precision[t["precision"]]);
      }
      case "decimal": {
        const t = f["type"];
        return new Decimal2(t["scale"], t["precision"], t["bitWidth"]);
      }
      case "date": {
        const t = f["type"];
        return new Date_(DateUnit[t["unit"]]);
      }
      case "time": {
        const t = f["type"];
        return new Time_(TimeUnit[t["unit"]], t["bitWidth"]);
      }
      case "timestamp": {
        const t = f["type"];
        return new Timestamp_(TimeUnit[t["unit"]], t["timezone"]);
      }
      case "interval": {
        const t = f["type"];
        return new Interval_(IntervalUnit[t["unit"]]);
      }
      case "duration": {
        const t = f["type"];
        return new Duration2(TimeUnit[t["unit"]]);
      }
      case "union": {
        const t = f["type"];
        const [m, ...ms] = (t["mode"] + "").toLowerCase();
        const mode = m.toUpperCase() + ms.join("");
        return new Union_(UnionMode[mode], t["typeIds"] || [], children || []);
      }
      case "fixedsizebinary": {
        const t = f["type"];
        return new FixedSizeBinary2(t["byteWidth"]);
      }
      case "fixedsizelist": {
        const t = f["type"];
        return new FixedSizeList2(t["listSize"], (children || [])[0]);
      }
      case "map": {
        const t = f["type"];
        return new Map_((children || [])[0], t["keysSorted"]);
      }
    }
    throw new Error(`Unrecognized type: "${typeId}"`);
  }
  var init_json = __esm({
    "node_modules/apache-arrow/ipc/metadata/json.mjs"() {
      init_schema2();
      init_type2();
      init_message2();
      init_enum();
    }
  });

  // node_modules/apache-arrow/ipc/metadata/message.mjs
  function messageHeaderFromJSON(message, type) {
    return (() => {
      switch (type) {
        case MessageHeader.Schema:
          return Schema2.fromJSON(message);
        case MessageHeader.RecordBatch:
          return RecordBatch3.fromJSON(message);
        case MessageHeader.DictionaryBatch:
          return DictionaryBatch2.fromJSON(message);
      }
      throw new Error(`Unrecognized Message type: { name: ${MessageHeader[type]}, type: ${type} }`);
    });
  }
  function decodeMessageHeader(message, type) {
    return (() => {
      switch (type) {
        case MessageHeader.Schema:
          return Schema2.decode(message.header(new Schema()), /* @__PURE__ */ new Map(), message.version());
        case MessageHeader.RecordBatch:
          return RecordBatch3.decode(message.header(new RecordBatch()), message.version());
        case MessageHeader.DictionaryBatch:
          return DictionaryBatch2.decode(message.header(new DictionaryBatch()), message.version());
      }
      throw new Error(`Unrecognized Message type: { name: ${MessageHeader[type]}, type: ${type} }`);
    });
  }
  function decodeSchema(_schema, dictionaries = /* @__PURE__ */ new Map(), version2 = MetadataVersion.V5) {
    const fields = decodeSchemaFields(_schema, dictionaries);
    return new Schema2(fields, decodeCustomMetadata(_schema), dictionaries, version2);
  }
  function decodeRecordBatch(batch, version2 = MetadataVersion.V5) {
    if (batch.compression() !== null) {
      throw new Error("Record batch compression not implemented");
    }
    return new RecordBatch3(batch.length(), decodeFieldNodes(batch), decodeBuffers(batch, version2));
  }
  function decodeDictionaryBatch(batch, version2 = MetadataVersion.V5) {
    return new DictionaryBatch2(RecordBatch3.decode(batch.data(), version2), batch.id(), batch.isDelta());
  }
  function decodeBufferRegion(b) {
    return new BufferRegion(b.offset(), b.length());
  }
  function decodeFieldNode(f) {
    return new FieldNode2(f.length(), f.nullCount());
  }
  function decodeFieldNodes(batch) {
    const nodes = [];
    for (let f, i = -1, j = -1, n = batch.nodesLength(); ++i < n; ) {
      if (f = batch.nodes(i)) {
        nodes[++j] = FieldNode2.decode(f);
      }
    }
    return nodes;
  }
  function decodeBuffers(batch, version2) {
    const bufferRegions = [];
    for (let b, i = -1, j = -1, n = batch.buffersLength(); ++i < n; ) {
      if (b = batch.buffers(i)) {
        if (version2 < MetadataVersion.V4) {
          b.bb_pos += 8 * (i + 1);
        }
        bufferRegions[++j] = BufferRegion.decode(b);
      }
    }
    return bufferRegions;
  }
  function decodeSchemaFields(schema, dictionaries) {
    const fields = [];
    for (let f, i = -1, j = -1, n = schema.fieldsLength(); ++i < n; ) {
      if (f = schema.fields(i)) {
        fields[++j] = Field2.decode(f, dictionaries);
      }
    }
    return fields;
  }
  function decodeFieldChildren(field, dictionaries) {
    const children = [];
    for (let f, i = -1, j = -1, n = field.childrenLength(); ++i < n; ) {
      if (f = field.children(i)) {
        children[++j] = Field2.decode(f, dictionaries);
      }
    }
    return children;
  }
  function decodeField(f, dictionaries) {
    let id;
    let field;
    let type;
    let keys2;
    let dictType;
    let dictMeta;
    if (!dictionaries || !(dictMeta = f.dictionary())) {
      type = decodeFieldType(f, decodeFieldChildren(f, dictionaries));
      field = new Field2(f.name(), type, f.nullable(), decodeCustomMetadata(f));
    } else if (!dictionaries.has(id = bigIntToNumber(dictMeta.id()))) {
      keys2 = (keys2 = dictMeta.indexType()) ? decodeIndexType(keys2) : new Int32();
      dictionaries.set(id, type = decodeFieldType(f, decodeFieldChildren(f, dictionaries)));
      dictType = new Dictionary(type, keys2, id, dictMeta.isOrdered());
      field = new Field2(f.name(), dictType, f.nullable(), decodeCustomMetadata(f));
    } else {
      keys2 = (keys2 = dictMeta.indexType()) ? decodeIndexType(keys2) : new Int32();
      dictType = new Dictionary(dictionaries.get(id), keys2, id, dictMeta.isOrdered());
      field = new Field2(f.name(), dictType, f.nullable(), decodeCustomMetadata(f));
    }
    return field || null;
  }
  function decodeCustomMetadata(parent) {
    const data = /* @__PURE__ */ new Map();
    if (parent) {
      for (let entry, key, i = -1, n = Math.trunc(parent.customMetadataLength()); ++i < n; ) {
        if ((entry = parent.customMetadata(i)) && (key = entry.key()) != null) {
          data.set(key, entry.value());
        }
      }
    }
    return data;
  }
  function decodeIndexType(_type) {
    return new Int_(_type.isSigned(), _type.bitWidth());
  }
  function decodeFieldType(f, children) {
    const typeId = f.typeType();
    switch (typeId) {
      case Type["NONE"]:
        return new Null2();
      case Type["Null"]:
        return new Null2();
      case Type["Binary"]:
        return new Binary2();
      case Type["LargeBinary"]:
        return new LargeBinary2();
      case Type["Utf8"]:
        return new Utf82();
      case Type["LargeUtf8"]:
        return new LargeUtf82();
      case Type["Bool"]:
        return new Bool2();
      case Type["List"]:
        return new List2((children || [])[0]);
      case Type["Struct_"]:
        return new Struct(children || []);
    }
    switch (typeId) {
      case Type["Int"]: {
        const t = f.type(new Int());
        return new Int_(t.isSigned(), t.bitWidth());
      }
      case Type["FloatingPoint"]: {
        const t = f.type(new FloatingPoint());
        return new Float(t.precision());
      }
      case Type["Decimal"]: {
        const t = f.type(new Decimal());
        return new Decimal2(t.scale(), t.precision(), t.bitWidth());
      }
      case Type["Date"]: {
        const t = f.type(new Date2());
        return new Date_(t.unit());
      }
      case Type["Time"]: {
        const t = f.type(new Time());
        return new Time_(t.unit(), t.bitWidth());
      }
      case Type["Timestamp"]: {
        const t = f.type(new Timestamp());
        return new Timestamp_(t.unit(), t.timezone());
      }
      case Type["Interval"]: {
        const t = f.type(new Interval());
        return new Interval_(t.unit());
      }
      case Type["Duration"]: {
        const t = f.type(new Duration());
        return new Duration2(t.unit());
      }
      case Type["Union"]: {
        const t = f.type(new Union());
        return new Union_(t.mode(), t.typeIdsArray() || [], children || []);
      }
      case Type["FixedSizeBinary"]: {
        const t = f.type(new FixedSizeBinary());
        return new FixedSizeBinary2(t.byteWidth());
      }
      case Type["FixedSizeList"]: {
        const t = f.type(new FixedSizeList());
        return new FixedSizeList2(t.listSize(), (children || [])[0]);
      }
      case Type["Map"]: {
        const t = f.type(new Map2());
        return new Map_((children || [])[0], t.keysSorted());
      }
    }
    throw new Error(`Unrecognized type: "${Type[typeId]}" (${typeId})`);
  }
  function encodeSchema(b, schema) {
    const fieldOffsets = schema.fields.map((f) => Field2.encode(b, f));
    Schema.startFieldsVector(b, fieldOffsets.length);
    const fieldsVectorOffset = Schema.createFieldsVector(b, fieldOffsets);
    const metadataOffset = !(schema.metadata && schema.metadata.size > 0) ? -1 : Schema.createCustomMetadataVector(b, [...schema.metadata].map(([k, v]) => {
      const key = b.createString(`${k}`);
      const val = b.createString(`${v}`);
      KeyValue.startKeyValue(b);
      KeyValue.addKey(b, key);
      KeyValue.addValue(b, val);
      return KeyValue.endKeyValue(b);
    }));
    Schema.startSchema(b);
    Schema.addFields(b, fieldsVectorOffset);
    Schema.addEndianness(b, platformIsLittleEndian ? Endianness.Little : Endianness.Big);
    if (metadataOffset !== -1) {
      Schema.addCustomMetadata(b, metadataOffset);
    }
    return Schema.endSchema(b);
  }
  function encodeField(b, field) {
    let nameOffset = -1;
    let typeOffset = -1;
    let dictionaryOffset = -1;
    const type = field.type;
    let typeId = field.typeId;
    if (!DataType.isDictionary(type)) {
      typeOffset = instance7.visit(type, b);
    } else {
      typeId = type.dictionary.typeId;
      dictionaryOffset = instance7.visit(type, b);
      typeOffset = instance7.visit(type.dictionary, b);
    }
    const childOffsets = (type.children || []).map((f) => Field2.encode(b, f));
    const childrenVectorOffset = Field.createChildrenVector(b, childOffsets);
    const metadataOffset = !(field.metadata && field.metadata.size > 0) ? -1 : Field.createCustomMetadataVector(b, [...field.metadata].map(([k, v]) => {
      const key = b.createString(`${k}`);
      const val = b.createString(`${v}`);
      KeyValue.startKeyValue(b);
      KeyValue.addKey(b, key);
      KeyValue.addValue(b, val);
      return KeyValue.endKeyValue(b);
    }));
    if (field.name) {
      nameOffset = b.createString(field.name);
    }
    Field.startField(b);
    Field.addType(b, typeOffset);
    Field.addTypeType(b, typeId);
    Field.addChildren(b, childrenVectorOffset);
    Field.addNullable(b, !!field.nullable);
    if (nameOffset !== -1) {
      Field.addName(b, nameOffset);
    }
    if (dictionaryOffset !== -1) {
      Field.addDictionary(b, dictionaryOffset);
    }
    if (metadataOffset !== -1) {
      Field.addCustomMetadata(b, metadataOffset);
    }
    return Field.endField(b);
  }
  function encodeRecordBatch(b, recordBatch) {
    const nodes = recordBatch.nodes || [];
    const buffers = recordBatch.buffers || [];
    RecordBatch.startNodesVector(b, nodes.length);
    for (const n of nodes.slice().reverse())
      FieldNode2.encode(b, n);
    const nodesVectorOffset = b.endVector();
    RecordBatch.startBuffersVector(b, buffers.length);
    for (const b_ of buffers.slice().reverse())
      BufferRegion.encode(b, b_);
    const buffersVectorOffset = b.endVector();
    RecordBatch.startRecordBatch(b);
    RecordBatch.addLength(b, BigInt(recordBatch.length));
    RecordBatch.addNodes(b, nodesVectorOffset);
    RecordBatch.addBuffers(b, buffersVectorOffset);
    return RecordBatch.endRecordBatch(b);
  }
  function encodeDictionaryBatch(b, dictionaryBatch) {
    const dataOffset = RecordBatch3.encode(b, dictionaryBatch.data);
    DictionaryBatch.startDictionaryBatch(b);
    DictionaryBatch.addId(b, BigInt(dictionaryBatch.id));
    DictionaryBatch.addIsDelta(b, dictionaryBatch.isDelta);
    DictionaryBatch.addData(b, dataOffset);
    return DictionaryBatch.endDictionaryBatch(b);
  }
  function encodeFieldNode(b, node) {
    return FieldNode.createFieldNode(b, BigInt(node.length), BigInt(node.nullCount));
  }
  function encodeBufferRegion(b, node) {
    return Buffer2.createBuffer(b, BigInt(node.offset), BigInt(node.length));
  }
  var Builder4, ByteBuffer3, Message2, RecordBatch3, DictionaryBatch2, BufferRegion, FieldNode2, platformIsLittleEndian;
  var init_message2 = __esm({
    "node_modules/apache-arrow/ipc/metadata/message.mjs"() {
      init_flatbuffers();
      init_schema();
      init_int();
      init_record_batch();
      init_dictionary_batch();
      init_buffer2();
      init_field();
      init_field_node();
      init_type();
      init_key_value();
      init_endianness();
      init_floating_point();
      init_decimal();
      init_date();
      init_time();
      init_timestamp();
      init_interval();
      init_duration();
      init_union();
      init_fixed_size_binary();
      init_fixed_size_list();
      init_map();
      init_message();
      init_schema2();
      init_buffer();
      init_bigint();
      init_enum();
      init_typeassembler();
      init_json();
      init_type2();
      Builder4 = Builder;
      ByteBuffer3 = ByteBuffer;
      Message2 = class _Message {
        /** @nocollapse */
        static fromJSON(msg, headerType) {
          const message = new _Message(0, MetadataVersion.V5, headerType);
          message._createHeader = messageHeaderFromJSON(msg, headerType);
          return message;
        }
        /** @nocollapse */
        static decode(buf) {
          buf = new ByteBuffer3(toUint8Array(buf));
          const _message = Message.getRootAsMessage(buf);
          const bodyLength = _message.bodyLength();
          const version2 = _message.version();
          const headerType = _message.headerType();
          const message = new _Message(bodyLength, version2, headerType);
          message._createHeader = decodeMessageHeader(_message, headerType);
          return message;
        }
        /** @nocollapse */
        static encode(message) {
          const b = new Builder4();
          let headerOffset = -1;
          if (message.isSchema()) {
            headerOffset = Schema2.encode(b, message.header());
          } else if (message.isRecordBatch()) {
            headerOffset = RecordBatch3.encode(b, message.header());
          } else if (message.isDictionaryBatch()) {
            headerOffset = DictionaryBatch2.encode(b, message.header());
          }
          Message.startMessage(b);
          Message.addVersion(b, MetadataVersion.V5);
          Message.addHeader(b, headerOffset);
          Message.addHeaderType(b, message.headerType);
          Message.addBodyLength(b, BigInt(message.bodyLength));
          Message.finishMessageBuffer(b, Message.endMessage(b));
          return b.asUint8Array();
        }
        /** @nocollapse */
        static from(header, bodyLength = 0) {
          if (header instanceof Schema2) {
            return new _Message(0, MetadataVersion.V5, MessageHeader.Schema, header);
          }
          if (header instanceof RecordBatch3) {
            return new _Message(bodyLength, MetadataVersion.V5, MessageHeader.RecordBatch, header);
          }
          if (header instanceof DictionaryBatch2) {
            return new _Message(bodyLength, MetadataVersion.V5, MessageHeader.DictionaryBatch, header);
          }
          throw new Error(`Unrecognized Message header: ${header}`);
        }
        get type() {
          return this.headerType;
        }
        get version() {
          return this._version;
        }
        get headerType() {
          return this._headerType;
        }
        get bodyLength() {
          return this._bodyLength;
        }
        header() {
          return this._createHeader();
        }
        isSchema() {
          return this.headerType === MessageHeader.Schema;
        }
        isRecordBatch() {
          return this.headerType === MessageHeader.RecordBatch;
        }
        isDictionaryBatch() {
          return this.headerType === MessageHeader.DictionaryBatch;
        }
        constructor(bodyLength, version2, headerType, header) {
          this._version = version2;
          this._headerType = headerType;
          this.body = new Uint8Array(0);
          header && (this._createHeader = () => header);
          this._bodyLength = bigIntToNumber(bodyLength);
        }
      };
      RecordBatch3 = class {
        get nodes() {
          return this._nodes;
        }
        get length() {
          return this._length;
        }
        get buffers() {
          return this._buffers;
        }
        constructor(length, nodes, buffers) {
          this._nodes = nodes;
          this._buffers = buffers;
          this._length = bigIntToNumber(length);
        }
      };
      DictionaryBatch2 = class {
        get id() {
          return this._id;
        }
        get data() {
          return this._data;
        }
        get isDelta() {
          return this._isDelta;
        }
        get length() {
          return this.data.length;
        }
        get nodes() {
          return this.data.nodes;
        }
        get buffers() {
          return this.data.buffers;
        }
        constructor(data, id, isDelta = false) {
          this._data = data;
          this._isDelta = isDelta;
          this._id = bigIntToNumber(id);
        }
      };
      BufferRegion = class {
        constructor(offset, length) {
          this.offset = bigIntToNumber(offset);
          this.length = bigIntToNumber(length);
        }
      };
      FieldNode2 = class {
        constructor(length, nullCount) {
          this.length = bigIntToNumber(length);
          this.nullCount = bigIntToNumber(nullCount);
        }
      };
      Field2["encode"] = encodeField;
      Field2["decode"] = decodeField;
      Field2["fromJSON"] = fieldFromJSON;
      Schema2["encode"] = encodeSchema;
      Schema2["decode"] = decodeSchema;
      Schema2["fromJSON"] = schemaFromJSON;
      RecordBatch3["encode"] = encodeRecordBatch;
      RecordBatch3["decode"] = decodeRecordBatch;
      RecordBatch3["fromJSON"] = recordBatchFromJSON;
      DictionaryBatch2["encode"] = encodeDictionaryBatch;
      DictionaryBatch2["decode"] = decodeDictionaryBatch;
      DictionaryBatch2["fromJSON"] = dictionaryBatchFromJSON;
      FieldNode2["encode"] = encodeFieldNode;
      FieldNode2["decode"] = decodeFieldNode;
      BufferRegion["encode"] = encodeBufferRegion;
      BufferRegion["decode"] = decodeBufferRegion;
      platformIsLittleEndian = (() => {
        const buffer = new ArrayBuffer(2);
        new DataView(buffer).setInt16(
          0,
          256,
          true
          /* littleEndian */
        );
        return new Int16Array(buffer)[0] === 256;
      })();
    }
  });

  // node_modules/apache-arrow/ipc/message.mjs
  function checkForMagicArrowString(buffer, index = 0) {
    for (let i = -1, n = MAGIC.length; ++i < n; ) {
      if (MAGIC[i] !== buffer[index + i]) {
        return false;
      }
    }
    return true;
  }
  var invalidMessageType, nullMessage, invalidMessageMetadata, invalidMessageBodyLength, MessageReader, AsyncMessageReader, JSONMessageReader, PADDING, MAGIC_STR, MAGIC, magicLength, magicAndPadding, magicX2AndPadding;
  var init_message3 = __esm({
    "node_modules/apache-arrow/ipc/message.mjs"() {
      init_tslib_es6();
      init_enum();
      init_flatbuffers();
      init_message2();
      init_compat();
      init_file2();
      init_buffer();
      init_stream();
      init_interfaces();
      invalidMessageType = (type) => `Expected ${MessageHeader[type]} Message in stream, but was null or length 0.`;
      nullMessage = (type) => `Header pointer of flatbuffer-encoded ${MessageHeader[type]} Message is null or length 0.`;
      invalidMessageMetadata = (expected, actual) => `Expected to read ${expected} metadata bytes, but only read ${actual}.`;
      invalidMessageBodyLength = (expected, actual) => `Expected to read ${expected} bytes for message body, but only read ${actual}.`;
      MessageReader = class {
        constructor(source) {
          this.source = source instanceof ByteStream ? source : new ByteStream(source);
        }
        [Symbol.iterator]() {
          return this;
        }
        next() {
          let r;
          if ((r = this.readMetadataLength()).done) {
            return ITERATOR_DONE;
          }
          if (r.value === -1 && (r = this.readMetadataLength()).done) {
            return ITERATOR_DONE;
          }
          if ((r = this.readMetadata(r.value)).done) {
            return ITERATOR_DONE;
          }
          return r;
        }
        throw(value) {
          return this.source.throw(value);
        }
        return(value) {
          return this.source.return(value);
        }
        readMessage(type) {
          let r;
          if ((r = this.next()).done) {
            return null;
          }
          if (type != null && r.value.headerType !== type) {
            throw new Error(invalidMessageType(type));
          }
          return r.value;
        }
        readMessageBody(bodyLength) {
          if (bodyLength <= 0) {
            return new Uint8Array(0);
          }
          const buf = toUint8Array(this.source.read(bodyLength));
          if (buf.byteLength < bodyLength) {
            throw new Error(invalidMessageBodyLength(bodyLength, buf.byteLength));
          }
          return (
            /* 1. */
            buf.byteOffset % 8 === 0 && /* 2. */
            buf.byteOffset + buf.byteLength <= buf.buffer.byteLength ? buf : buf.slice()
          );
        }
        readSchema(throwIfNull = false) {
          const type = MessageHeader.Schema;
          const message = this.readMessage(type);
          const schema = message === null || message === void 0 ? void 0 : message.header();
          if (throwIfNull && !schema) {
            throw new Error(nullMessage(type));
          }
          return schema;
        }
        readMetadataLength() {
          const buf = this.source.read(PADDING);
          const bb = buf && new ByteBuffer(buf);
          const len = (bb === null || bb === void 0 ? void 0 : bb.readInt32(0)) || 0;
          return { done: len === 0, value: len };
        }
        readMetadata(metadataLength) {
          const buf = this.source.read(metadataLength);
          if (!buf) {
            return ITERATOR_DONE;
          }
          if (buf.byteLength < metadataLength) {
            throw new Error(invalidMessageMetadata(metadataLength, buf.byteLength));
          }
          return { done: false, value: Message2.decode(buf) };
        }
      };
      AsyncMessageReader = class {
        constructor(source, byteLength) {
          this.source = source instanceof AsyncByteStream ? source : isFileHandle(source) ? new AsyncRandomAccessFile(source, byteLength) : new AsyncByteStream(source);
        }
        [Symbol.asyncIterator]() {
          return this;
        }
        next() {
          return __awaiter(this, void 0, void 0, function* () {
            let r;
            if ((r = yield this.readMetadataLength()).done) {
              return ITERATOR_DONE;
            }
            if (r.value === -1 && (r = yield this.readMetadataLength()).done) {
              return ITERATOR_DONE;
            }
            if ((r = yield this.readMetadata(r.value)).done) {
              return ITERATOR_DONE;
            }
            return r;
          });
        }
        throw(value) {
          return __awaiter(this, void 0, void 0, function* () {
            return yield this.source.throw(value);
          });
        }
        return(value) {
          return __awaiter(this, void 0, void 0, function* () {
            return yield this.source.return(value);
          });
        }
        readMessage(type) {
          return __awaiter(this, void 0, void 0, function* () {
            let r;
            if ((r = yield this.next()).done) {
              return null;
            }
            if (type != null && r.value.headerType !== type) {
              throw new Error(invalidMessageType(type));
            }
            return r.value;
          });
        }
        readMessageBody(bodyLength) {
          return __awaiter(this, void 0, void 0, function* () {
            if (bodyLength <= 0) {
              return new Uint8Array(0);
            }
            const buf = toUint8Array(yield this.source.read(bodyLength));
            if (buf.byteLength < bodyLength) {
              throw new Error(invalidMessageBodyLength(bodyLength, buf.byteLength));
            }
            return (
              /* 1. */
              buf.byteOffset % 8 === 0 && /* 2. */
              buf.byteOffset + buf.byteLength <= buf.buffer.byteLength ? buf : buf.slice()
            );
          });
        }
        readSchema() {
          return __awaiter(this, arguments, void 0, function* (throwIfNull = false) {
            const type = MessageHeader.Schema;
            const message = yield this.readMessage(type);
            const schema = message === null || message === void 0 ? void 0 : message.header();
            if (throwIfNull && !schema) {
              throw new Error(nullMessage(type));
            }
            return schema;
          });
        }
        readMetadataLength() {
          return __awaiter(this, void 0, void 0, function* () {
            const buf = yield this.source.read(PADDING);
            const bb = buf && new ByteBuffer(buf);
            const len = (bb === null || bb === void 0 ? void 0 : bb.readInt32(0)) || 0;
            return { done: len === 0, value: len };
          });
        }
        readMetadata(metadataLength) {
          return __awaiter(this, void 0, void 0, function* () {
            const buf = yield this.source.read(metadataLength);
            if (!buf) {
              return ITERATOR_DONE;
            }
            if (buf.byteLength < metadataLength) {
              throw new Error(invalidMessageMetadata(metadataLength, buf.byteLength));
            }
            return { done: false, value: Message2.decode(buf) };
          });
        }
      };
      JSONMessageReader = class extends MessageReader {
        constructor(source) {
          super(new Uint8Array(0));
          this._schema = false;
          this._body = [];
          this._batchIndex = 0;
          this._dictionaryIndex = 0;
          this._json = source instanceof ArrowJSON ? source : new ArrowJSON(source);
        }
        next() {
          const { _json } = this;
          if (!this._schema) {
            this._schema = true;
            const message = Message2.fromJSON(_json.schema, MessageHeader.Schema);
            return { done: false, value: message };
          }
          if (this._dictionaryIndex < _json.dictionaries.length) {
            const batch = _json.dictionaries[this._dictionaryIndex++];
            this._body = batch["data"]["columns"];
            const message = Message2.fromJSON(batch, MessageHeader.DictionaryBatch);
            return { done: false, value: message };
          }
          if (this._batchIndex < _json.batches.length) {
            const batch = _json.batches[this._batchIndex++];
            this._body = batch["columns"];
            const message = Message2.fromJSON(batch, MessageHeader.RecordBatch);
            return { done: false, value: message };
          }
          this._body = [];
          return ITERATOR_DONE;
        }
        readMessageBody(_bodyLength) {
          return flattenDataSources(this._body);
          function flattenDataSources(xs) {
            return (xs || []).reduce((buffers, column) => [
              ...buffers,
              ...column["VALIDITY"] && [column["VALIDITY"]] || [],
              ...column["TYPE_ID"] && [column["TYPE_ID"]] || [],
              ...column["OFFSET"] && [column["OFFSET"]] || [],
              ...column["DATA"] && [column["DATA"]] || [],
              ...flattenDataSources(column["children"])
            ], []);
          }
        }
        readMessage(type) {
          let r;
          if ((r = this.next()).done) {
            return null;
          }
          if (type != null && r.value.headerType !== type) {
            throw new Error(invalidMessageType(type));
          }
          return r.value;
        }
        readSchema() {
          const type = MessageHeader.Schema;
          const message = this.readMessage(type);
          const schema = message === null || message === void 0 ? void 0 : message.header();
          if (!message || !schema) {
            throw new Error(nullMessage(type));
          }
          return schema;
        }
      };
      PADDING = 4;
      MAGIC_STR = "ARROW1";
      MAGIC = new Uint8Array(MAGIC_STR.length);
      for (let i = 0; i < MAGIC_STR.length; i += 1) {
        MAGIC[i] = MAGIC_STR.codePointAt(i);
      }
      magicLength = MAGIC.length;
      magicAndPadding = magicLength + PADDING;
      magicX2AndPadding = magicLength * 2 + PADDING;
    }
  });

  // node_modules/apache-arrow/ipc/reader.mjs
  function shouldAutoDestroy(self2, options) {
    return options && typeof options["autoDestroy"] === "boolean" ? options["autoDestroy"] : self2["autoDestroy"];
  }
  function* readAllSync(source) {
    const reader = RecordBatchReader.from(source);
    try {
      if (!reader.open({ autoDestroy: false }).closed) {
        do {
          yield reader;
        } while (!reader.reset().open().closed);
      }
    } finally {
      reader.cancel();
    }
  }
  function readAllAsync(source) {
    return __asyncGenerator(this, arguments, function* readAllAsync_1() {
      const reader = yield __await(RecordBatchReader.from(source));
      try {
        if (!(yield __await(reader.open({ autoDestroy: false }))).closed) {
          do {
            yield yield __await(reader);
          } while (!(yield __await(reader.reset().open())).closed);
        }
      } finally {
        yield __await(reader.cancel());
      }
    });
  }
  function fromArrowJSON(source) {
    return new RecordBatchStreamReader(new RecordBatchJSONReaderImpl(source));
  }
  function fromByteStream(source) {
    const bytes = source.peek(magicLength + 7 & ~7);
    return bytes && bytes.byteLength >= 4 ? !checkForMagicArrowString(bytes) ? new RecordBatchStreamReader(new RecordBatchStreamReaderImpl(source)) : new RecordBatchFileReader(new RecordBatchFileReaderImpl(source.read())) : new RecordBatchStreamReader(new RecordBatchStreamReaderImpl((function* () {
    })()));
  }
  function fromAsyncByteStream(source) {
    return __awaiter(this, void 0, void 0, function* () {
      const bytes = yield source.peek(magicLength + 7 & ~7);
      return bytes && bytes.byteLength >= 4 ? !checkForMagicArrowString(bytes) ? new AsyncRecordBatchStreamReader(new AsyncRecordBatchStreamReaderImpl(source)) : new RecordBatchFileReader(new RecordBatchFileReaderImpl(yield source.read())) : new AsyncRecordBatchStreamReader(new AsyncRecordBatchStreamReaderImpl((function() {
        return __asyncGenerator(this, arguments, function* () {
        });
      })()));
    });
  }
  function fromFileHandle(source) {
    return __awaiter(this, void 0, void 0, function* () {
      const { size } = yield source.stat();
      const file = new AsyncRandomAccessFile(source, size);
      if (size >= magicX2AndPadding && checkForMagicArrowString(yield file.readAt(0, magicLength + 7 & ~7))) {
        return new AsyncRecordBatchFileReader(new AsyncRecordBatchFileReaderImpl(file));
      }
      return new AsyncRecordBatchStreamReader(new AsyncRecordBatchStreamReaderImpl(file));
    });
  }
  var RecordBatchReader, RecordBatchStreamReader, AsyncRecordBatchStreamReader, RecordBatchFileReader, AsyncRecordBatchFileReader, RecordBatchReaderImpl, RecordBatchStreamReaderImpl, AsyncRecordBatchStreamReaderImpl, RecordBatchFileReaderImpl, AsyncRecordBatchFileReaderImpl, RecordBatchJSONReaderImpl;
  var init_reader = __esm({
    "node_modules/apache-arrow/ipc/reader.mjs"() {
      init_tslib_es6();
      init_data();
      init_vector2();
      init_type2();
      init_enum();
      init_file();
      init_adapters();
      init_stream();
      init_file2();
      init_vectorloader();
      init_recordbatch2();
      init_interfaces();
      init_message3();
      init_compat();
      RecordBatchReader = class _RecordBatchReader extends ReadableInterop {
        constructor(impl) {
          super();
          this._impl = impl;
        }
        get closed() {
          return this._impl.closed;
        }
        get schema() {
          return this._impl.schema;
        }
        get autoDestroy() {
          return this._impl.autoDestroy;
        }
        get dictionaries() {
          return this._impl.dictionaries;
        }
        get numDictionaries() {
          return this._impl.numDictionaries;
        }
        get numRecordBatches() {
          return this._impl.numRecordBatches;
        }
        get footer() {
          return this._impl.isFile() ? this._impl.footer : null;
        }
        isSync() {
          return this._impl.isSync();
        }
        isAsync() {
          return this._impl.isAsync();
        }
        isFile() {
          return this._impl.isFile();
        }
        isStream() {
          return this._impl.isStream();
        }
        next() {
          return this._impl.next();
        }
        throw(value) {
          return this._impl.throw(value);
        }
        return(value) {
          return this._impl.return(value);
        }
        cancel() {
          return this._impl.cancel();
        }
        reset(schema) {
          this._impl.reset(schema);
          this._DOMStream = void 0;
          this._nodeStream = void 0;
          return this;
        }
        open(options) {
          const opening = this._impl.open(options);
          return isPromise(opening) ? opening.then(() => this) : this;
        }
        readRecordBatch(index) {
          return this._impl.isFile() ? this._impl.readRecordBatch(index) : null;
        }
        [Symbol.iterator]() {
          return this._impl[Symbol.iterator]();
        }
        [Symbol.asyncIterator]() {
          return this._impl[Symbol.asyncIterator]();
        }
        toDOMStream() {
          return adapters_default.toDOMStream(this.isSync() ? { [Symbol.iterator]: () => this } : { [Symbol.asyncIterator]: () => this });
        }
        toNodeStream() {
          return adapters_default.toNodeStream(this.isSync() ? { [Symbol.iterator]: () => this } : { [Symbol.asyncIterator]: () => this }, { objectMode: true });
        }
        /** @nocollapse */
        // @ts-ignore
        static throughNode(options) {
          throw new Error(`"throughNode" not available in this environment`);
        }
        /** @nocollapse */
        static throughDOM(writableStrategy, readableStrategy) {
          throw new Error(`"throughDOM" not available in this environment`);
        }
        /** @nocollapse */
        static from(source) {
          if (source instanceof _RecordBatchReader) {
            return source;
          } else if (isArrowJSON(source)) {
            return fromArrowJSON(source);
          } else if (isFileHandle(source)) {
            return fromFileHandle(source);
          } else if (isPromise(source)) {
            return (() => __awaiter(this, void 0, void 0, function* () {
              return yield _RecordBatchReader.from(yield source);
            }))();
          } else if (isFetchResponse(source) || isReadableDOMStream(source) || isReadableNodeStream(source) || isAsyncIterable(source)) {
            return fromAsyncByteStream(new AsyncByteStream(source));
          }
          return fromByteStream(new ByteStream(source));
        }
        /** @nocollapse */
        static readAll(source) {
          if (source instanceof _RecordBatchReader) {
            return source.isSync() ? readAllSync(source) : readAllAsync(source);
          } else if (isArrowJSON(source) || ArrayBuffer.isView(source) || isIterable(source) || isIteratorResult(source)) {
            return readAllSync(source);
          }
          return readAllAsync(source);
        }
      };
      RecordBatchStreamReader = class extends RecordBatchReader {
        constructor(_impl) {
          super(_impl);
          this._impl = _impl;
        }
        readAll() {
          return [...this];
        }
        [Symbol.iterator]() {
          return this._impl[Symbol.iterator]();
        }
        [Symbol.asyncIterator]() {
          return __asyncGenerator(this, arguments, function* _a5() {
            yield __await(yield* __asyncDelegator(__asyncValues(this[Symbol.iterator]())));
          });
        }
      };
      AsyncRecordBatchStreamReader = class extends RecordBatchReader {
        constructor(_impl) {
          super(_impl);
          this._impl = _impl;
        }
        readAll() {
          return __awaiter(this, void 0, void 0, function* () {
            var _a5, e_1, _b2, _c2;
            const batches = new Array();
            try {
              for (var _d2 = true, _e2 = __asyncValues(this), _f2; _f2 = yield _e2.next(), _a5 = _f2.done, !_a5; _d2 = true) {
                _c2 = _f2.value;
                _d2 = false;
                const batch = _c2;
                batches.push(batch);
              }
            } catch (e_1_1) {
              e_1 = { error: e_1_1 };
            } finally {
              try {
                if (!_d2 && !_a5 && (_b2 = _e2.return)) yield _b2.call(_e2);
              } finally {
                if (e_1) throw e_1.error;
              }
            }
            return batches;
          });
        }
        [Symbol.iterator]() {
          throw new Error(`AsyncRecordBatchStreamReader is not Iterable`);
        }
        [Symbol.asyncIterator]() {
          return this._impl[Symbol.asyncIterator]();
        }
      };
      RecordBatchFileReader = class extends RecordBatchStreamReader {
        constructor(_impl) {
          super(_impl);
          this._impl = _impl;
        }
      };
      AsyncRecordBatchFileReader = class extends AsyncRecordBatchStreamReader {
        constructor(_impl) {
          super(_impl);
          this._impl = _impl;
        }
      };
      RecordBatchReaderImpl = class {
        get numDictionaries() {
          return this._dictionaryIndex;
        }
        get numRecordBatches() {
          return this._recordBatchIndex;
        }
        constructor(dictionaries = /* @__PURE__ */ new Map()) {
          this.closed = false;
          this.autoDestroy = true;
          this._dictionaryIndex = 0;
          this._recordBatchIndex = 0;
          this.dictionaries = dictionaries;
        }
        isSync() {
          return false;
        }
        isAsync() {
          return false;
        }
        isFile() {
          return false;
        }
        isStream() {
          return false;
        }
        reset(schema) {
          this._dictionaryIndex = 0;
          this._recordBatchIndex = 0;
          this.schema = schema;
          this.dictionaries = /* @__PURE__ */ new Map();
          return this;
        }
        _loadRecordBatch(header, body) {
          const children = this._loadVectors(header, body, this.schema.fields);
          const data = makeData({ type: new Struct(this.schema.fields), length: header.length, children });
          return new RecordBatch2(this.schema, data);
        }
        _loadDictionaryBatch(header, body) {
          const { id, isDelta } = header;
          const { dictionaries, schema } = this;
          const dictionary = dictionaries.get(id);
          const type = schema.dictionaries.get(id);
          const data = this._loadVectors(header.data, body, [type]);
          return (dictionary && isDelta ? dictionary.concat(new Vector(data)) : new Vector(data)).memoize();
        }
        _loadVectors(header, body, types) {
          return new VectorLoader(body, header.nodes, header.buffers, this.dictionaries, this.schema.metadataVersion).visitMany(types);
        }
      };
      RecordBatchStreamReaderImpl = class extends RecordBatchReaderImpl {
        constructor(source, dictionaries) {
          super(dictionaries);
          this._reader = !isArrowJSON(source) ? new MessageReader(this._handle = source) : new JSONMessageReader(this._handle = source);
        }
        isSync() {
          return true;
        }
        isStream() {
          return true;
        }
        [Symbol.iterator]() {
          return this;
        }
        cancel() {
          if (!this.closed && (this.closed = true)) {
            this.reset()._reader.return();
            this._reader = null;
            this.dictionaries = null;
          }
        }
        open(options) {
          if (!this.closed) {
            this.autoDestroy = shouldAutoDestroy(this, options);
            if (!(this.schema || (this.schema = this._reader.readSchema()))) {
              this.cancel();
            }
          }
          return this;
        }
        throw(value) {
          if (!this.closed && this.autoDestroy && (this.closed = true)) {
            return this.reset()._reader.throw(value);
          }
          return ITERATOR_DONE;
        }
        return(value) {
          if (!this.closed && this.autoDestroy && (this.closed = true)) {
            return this.reset()._reader.return(value);
          }
          return ITERATOR_DONE;
        }
        next() {
          if (this.closed) {
            return ITERATOR_DONE;
          }
          let message;
          const { _reader: reader } = this;
          while (message = this._readNextMessageAndValidate()) {
            if (message.isSchema()) {
              this.reset(message.header());
            } else if (message.isRecordBatch()) {
              this._recordBatchIndex++;
              const header = message.header();
              const buffer = reader.readMessageBody(message.bodyLength);
              const recordBatch = this._loadRecordBatch(header, buffer);
              return { done: false, value: recordBatch };
            } else if (message.isDictionaryBatch()) {
              this._dictionaryIndex++;
              const header = message.header();
              const buffer = reader.readMessageBody(message.bodyLength);
              const vector = this._loadDictionaryBatch(header, buffer);
              this.dictionaries.set(header.id, vector);
            }
          }
          if (this.schema && this._recordBatchIndex === 0) {
            this._recordBatchIndex++;
            return { done: false, value: new _InternalEmptyPlaceholderRecordBatch(this.schema) };
          }
          return this.return();
        }
        _readNextMessageAndValidate(type) {
          return this._reader.readMessage(type);
        }
      };
      AsyncRecordBatchStreamReaderImpl = class extends RecordBatchReaderImpl {
        constructor(source, dictionaries) {
          super(dictionaries);
          this._reader = new AsyncMessageReader(this._handle = source);
        }
        isAsync() {
          return true;
        }
        isStream() {
          return true;
        }
        [Symbol.asyncIterator]() {
          return this;
        }
        cancel() {
          return __awaiter(this, void 0, void 0, function* () {
            if (!this.closed && (this.closed = true)) {
              yield this.reset()._reader.return();
              this._reader = null;
              this.dictionaries = null;
            }
          });
        }
        open(options) {
          return __awaiter(this, void 0, void 0, function* () {
            if (!this.closed) {
              this.autoDestroy = shouldAutoDestroy(this, options);
              if (!(this.schema || (this.schema = yield this._reader.readSchema()))) {
                yield this.cancel();
              }
            }
            return this;
          });
        }
        throw(value) {
          return __awaiter(this, void 0, void 0, function* () {
            if (!this.closed && this.autoDestroy && (this.closed = true)) {
              return yield this.reset()._reader.throw(value);
            }
            return ITERATOR_DONE;
          });
        }
        return(value) {
          return __awaiter(this, void 0, void 0, function* () {
            if (!this.closed && this.autoDestroy && (this.closed = true)) {
              return yield this.reset()._reader.return(value);
            }
            return ITERATOR_DONE;
          });
        }
        next() {
          return __awaiter(this, void 0, void 0, function* () {
            if (this.closed) {
              return ITERATOR_DONE;
            }
            let message;
            const { _reader: reader } = this;
            while (message = yield this._readNextMessageAndValidate()) {
              if (message.isSchema()) {
                yield this.reset(message.header());
              } else if (message.isRecordBatch()) {
                this._recordBatchIndex++;
                const header = message.header();
                const buffer = yield reader.readMessageBody(message.bodyLength);
                const recordBatch = this._loadRecordBatch(header, buffer);
                return { done: false, value: recordBatch };
              } else if (message.isDictionaryBatch()) {
                this._dictionaryIndex++;
                const header = message.header();
                const buffer = yield reader.readMessageBody(message.bodyLength);
                const vector = this._loadDictionaryBatch(header, buffer);
                this.dictionaries.set(header.id, vector);
              }
            }
            if (this.schema && this._recordBatchIndex === 0) {
              this._recordBatchIndex++;
              return { done: false, value: new _InternalEmptyPlaceholderRecordBatch(this.schema) };
            }
            return yield this.return();
          });
        }
        _readNextMessageAndValidate(type) {
          return __awaiter(this, void 0, void 0, function* () {
            return yield this._reader.readMessage(type);
          });
        }
      };
      RecordBatchFileReaderImpl = class extends RecordBatchStreamReaderImpl {
        get footer() {
          return this._footer;
        }
        get numDictionaries() {
          return this._footer ? this._footer.numDictionaries : 0;
        }
        get numRecordBatches() {
          return this._footer ? this._footer.numRecordBatches : 0;
        }
        constructor(source, dictionaries) {
          super(source instanceof RandomAccessFile ? source : new RandomAccessFile(source), dictionaries);
        }
        isSync() {
          return true;
        }
        isFile() {
          return true;
        }
        open(options) {
          if (!this.closed && !this._footer) {
            this.schema = (this._footer = this._readFooter()).schema;
            for (const block of this._footer.dictionaryBatches()) {
              block && this._readDictionaryBatch(this._dictionaryIndex++);
            }
          }
          return super.open(options);
        }
        readRecordBatch(index) {
          var _a5;
          if (this.closed) {
            return null;
          }
          if (!this._footer) {
            this.open();
          }
          const block = (_a5 = this._footer) === null || _a5 === void 0 ? void 0 : _a5.getRecordBatch(index);
          if (block && this._handle.seek(block.offset)) {
            const message = this._reader.readMessage(MessageHeader.RecordBatch);
            if (message === null || message === void 0 ? void 0 : message.isRecordBatch()) {
              const header = message.header();
              const buffer = this._reader.readMessageBody(message.bodyLength);
              const recordBatch = this._loadRecordBatch(header, buffer);
              return recordBatch;
            }
          }
          return null;
        }
        _readDictionaryBatch(index) {
          var _a5;
          const block = (_a5 = this._footer) === null || _a5 === void 0 ? void 0 : _a5.getDictionaryBatch(index);
          if (block && this._handle.seek(block.offset)) {
            const message = this._reader.readMessage(MessageHeader.DictionaryBatch);
            if (message === null || message === void 0 ? void 0 : message.isDictionaryBatch()) {
              const header = message.header();
              const buffer = this._reader.readMessageBody(message.bodyLength);
              const vector = this._loadDictionaryBatch(header, buffer);
              this.dictionaries.set(header.id, vector);
            }
          }
        }
        _readFooter() {
          const { _handle } = this;
          const offset = _handle.size - magicAndPadding;
          const length = _handle.readInt32(offset);
          const buffer = _handle.readAt(offset - length, length);
          return Footer_.decode(buffer);
        }
        _readNextMessageAndValidate(type) {
          var _a5;
          if (!this._footer) {
            this.open();
          }
          if (this._footer && this._recordBatchIndex < this.numRecordBatches) {
            const block = (_a5 = this._footer) === null || _a5 === void 0 ? void 0 : _a5.getRecordBatch(this._recordBatchIndex);
            if (block && this._handle.seek(block.offset)) {
              return this._reader.readMessage(type);
            }
          }
          return null;
        }
      };
      AsyncRecordBatchFileReaderImpl = class extends AsyncRecordBatchStreamReaderImpl {
        get footer() {
          return this._footer;
        }
        get numDictionaries() {
          return this._footer ? this._footer.numDictionaries : 0;
        }
        get numRecordBatches() {
          return this._footer ? this._footer.numRecordBatches : 0;
        }
        constructor(source, ...rest) {
          const byteLength = typeof rest[0] !== "number" ? rest.shift() : void 0;
          const dictionaries = rest[0] instanceof Map ? rest.shift() : void 0;
          super(source instanceof AsyncRandomAccessFile ? source : new AsyncRandomAccessFile(source, byteLength), dictionaries);
        }
        isFile() {
          return true;
        }
        isAsync() {
          return true;
        }
        open(options) {
          const _super = Object.create(null, {
            open: { get: () => super.open }
          });
          return __awaiter(this, void 0, void 0, function* () {
            if (!this.closed && !this._footer) {
              this.schema = (this._footer = yield this._readFooter()).schema;
              for (const block of this._footer.dictionaryBatches()) {
                block && (yield this._readDictionaryBatch(this._dictionaryIndex++));
              }
            }
            return yield _super.open.call(this, options);
          });
        }
        readRecordBatch(index) {
          return __awaiter(this, void 0, void 0, function* () {
            var _a5;
            if (this.closed) {
              return null;
            }
            if (!this._footer) {
              yield this.open();
            }
            const block = (_a5 = this._footer) === null || _a5 === void 0 ? void 0 : _a5.getRecordBatch(index);
            if (block && (yield this._handle.seek(block.offset))) {
              const message = yield this._reader.readMessage(MessageHeader.RecordBatch);
              if (message === null || message === void 0 ? void 0 : message.isRecordBatch()) {
                const header = message.header();
                const buffer = yield this._reader.readMessageBody(message.bodyLength);
                const recordBatch = this._loadRecordBatch(header, buffer);
                return recordBatch;
              }
            }
            return null;
          });
        }
        _readDictionaryBatch(index) {
          return __awaiter(this, void 0, void 0, function* () {
            var _a5;
            const block = (_a5 = this._footer) === null || _a5 === void 0 ? void 0 : _a5.getDictionaryBatch(index);
            if (block && (yield this._handle.seek(block.offset))) {
              const message = yield this._reader.readMessage(MessageHeader.DictionaryBatch);
              if (message === null || message === void 0 ? void 0 : message.isDictionaryBatch()) {
                const header = message.header();
                const buffer = yield this._reader.readMessageBody(message.bodyLength);
                const vector = this._loadDictionaryBatch(header, buffer);
                this.dictionaries.set(header.id, vector);
              }
            }
          });
        }
        _readFooter() {
          return __awaiter(this, void 0, void 0, function* () {
            const { _handle } = this;
            _handle._pending && (yield _handle._pending);
            const offset = _handle.size - magicAndPadding;
            const length = yield _handle.readInt32(offset);
            const buffer = yield _handle.readAt(offset - length, length);
            return Footer_.decode(buffer);
          });
        }
        _readNextMessageAndValidate(type) {
          return __awaiter(this, void 0, void 0, function* () {
            if (!this._footer) {
              yield this.open();
            }
            if (this._footer && this._recordBatchIndex < this.numRecordBatches) {
              const block = this._footer.getRecordBatch(this._recordBatchIndex);
              if (block && (yield this._handle.seek(block.offset))) {
                return yield this._reader.readMessage(type);
              }
            }
            return null;
          });
        }
      };
      RecordBatchJSONReaderImpl = class extends RecordBatchStreamReaderImpl {
        constructor(source, dictionaries) {
          super(source, dictionaries);
        }
        _loadVectors(header, body, types) {
          return new JSONVectorLoader(body, header.nodes, header.buffers, this.dictionaries, this.schema.metadataVersion).visitMany(types);
        }
      };
    }
  });

  // node_modules/apache-arrow/visitor/vectorassembler.mjs
  function addBuffer(values) {
    const byteLength = values.byteLength + 7 & ~7;
    this.buffers.push(values);
    this.bufferRegions.push(new BufferRegion(this._byteLength, byteLength));
    this._byteLength += byteLength;
    return this;
  }
  function assembleUnion(data) {
    var _a5;
    const { type, length, typeIds, valueOffsets } = data;
    addBuffer.call(this, typeIds);
    if (type.mode === UnionMode.Sparse) {
      return assembleNestedVector.call(this, data);
    } else if (type.mode === UnionMode.Dense) {
      if (data.offset <= 0) {
        addBuffer.call(this, valueOffsets);
        return assembleNestedVector.call(this, data);
      } else {
        const shiftedOffsets = new Int32Array(length);
        const childOffsets = /* @__PURE__ */ Object.create(null);
        const childLengths = /* @__PURE__ */ Object.create(null);
        for (let typeId, shift, index = -1; ++index < length; ) {
          if ((typeId = typeIds[index]) === void 0) {
            continue;
          }
          if ((shift = childOffsets[typeId]) === void 0) {
            shift = childOffsets[typeId] = valueOffsets[index];
          }
          shiftedOffsets[index] = valueOffsets[index] - shift;
          childLengths[typeId] = ((_a5 = childLengths[typeId]) !== null && _a5 !== void 0 ? _a5 : 0) + 1;
        }
        addBuffer.call(this, shiftedOffsets);
        this.visitMany(data.children.map((child, childIndex) => {
          const typeId = type.typeIds[childIndex];
          const childOffset = childOffsets[typeId];
          const childLength = childLengths[typeId];
          return child.slice(childOffset, Math.min(length, childLength));
        }));
      }
    }
    return this;
  }
  function assembleBoolVector(data) {
    let values;
    if (data.nullCount >= data.length) {
      return addBuffer.call(this, new Uint8Array(0));
    } else if ((values = data.values) instanceof Uint8Array) {
      return addBuffer.call(this, truncateBitmap(data.offset, data.length, values));
    }
    return addBuffer.call(this, packBools(data.values));
  }
  function assembleFlatVector(data) {
    return addBuffer.call(this, data.values.subarray(0, data.length * data.stride));
  }
  function assembleFlatListVector(data) {
    const { length, values, valueOffsets } = data;
    const begin = bigIntToNumber(valueOffsets[0]);
    const end = bigIntToNumber(valueOffsets[length]);
    const byteLength = Math.min(end - begin, values.byteLength - begin);
    addBuffer.call(this, rebaseValueOffsets(-begin, length + 1, valueOffsets));
    addBuffer.call(this, values.subarray(begin, begin + byteLength));
    return this;
  }
  function assembleListVector(data) {
    const { length, valueOffsets } = data;
    if (valueOffsets) {
      const { [0]: begin, [length]: end } = valueOffsets;
      addBuffer.call(this, rebaseValueOffsets(-begin, length + 1, valueOffsets));
      return this.visit(data.children[0].slice(begin, end - begin));
    }
    return this.visit(data.children[0]);
  }
  function assembleNestedVector(data) {
    return this.visitMany(data.type.children.map((_, i) => data.children[i]).filter(Boolean))[0];
  }
  var VectorAssembler;
  var init_vectorassembler = __esm({
    "node_modules/apache-arrow/visitor/vectorassembler.mjs"() {
      init_vector2();
      init_visitor();
      init_enum();
      init_recordbatch2();
      init_buffer();
      init_bit();
      init_message2();
      init_type2();
      init_bigint();
      VectorAssembler = class _VectorAssembler extends Visitor {
        /** @nocollapse */
        static assemble(...args) {
          const unwrap = (nodes) => nodes.flatMap((node) => Array.isArray(node) ? unwrap(node) : node instanceof RecordBatch2 ? node.data.children : node.data);
          const assembler = new _VectorAssembler();
          assembler.visitMany(unwrap(args));
          return assembler;
        }
        constructor() {
          super();
          this._byteLength = 0;
          this._nodes = [];
          this._buffers = [];
          this._bufferRegions = [];
        }
        visit(data) {
          if (data instanceof Vector) {
            this.visitMany(data.data);
            return this;
          }
          const { type } = data;
          if (!DataType.isDictionary(type)) {
            const { length } = data;
            if (length > 2147483647) {
              throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");
            }
            if (DataType.isUnion(type)) {
              this.nodes.push(new FieldNode2(length, 0));
            } else {
              const { nullCount } = data;
              if (!DataType.isNull(type)) {
                addBuffer.call(this, nullCount <= 0 ? new Uint8Array(0) : truncateBitmap(data.offset, length, data.nullBitmap));
              }
              this.nodes.push(new FieldNode2(length, nullCount));
            }
          }
          return super.visit(data);
        }
        visitNull(_null) {
          return this;
        }
        visitDictionary(data) {
          return this.visit(data.clone(data.type.indices));
        }
        get nodes() {
          return this._nodes;
        }
        get buffers() {
          return this._buffers;
        }
        get byteLength() {
          return this._byteLength;
        }
        get bufferRegions() {
          return this._bufferRegions;
        }
      };
      VectorAssembler.prototype.visitBool = assembleBoolVector;
      VectorAssembler.prototype.visitInt = assembleFlatVector;
      VectorAssembler.prototype.visitFloat = assembleFlatVector;
      VectorAssembler.prototype.visitUtf8 = assembleFlatListVector;
      VectorAssembler.prototype.visitLargeUtf8 = assembleFlatListVector;
      VectorAssembler.prototype.visitBinary = assembleFlatListVector;
      VectorAssembler.prototype.visitLargeBinary = assembleFlatListVector;
      VectorAssembler.prototype.visitFixedSizeBinary = assembleFlatVector;
      VectorAssembler.prototype.visitDate = assembleFlatVector;
      VectorAssembler.prototype.visitTimestamp = assembleFlatVector;
      VectorAssembler.prototype.visitTime = assembleFlatVector;
      VectorAssembler.prototype.visitDecimal = assembleFlatVector;
      VectorAssembler.prototype.visitList = assembleListVector;
      VectorAssembler.prototype.visitStruct = assembleNestedVector;
      VectorAssembler.prototype.visitUnion = assembleUnion;
      VectorAssembler.prototype.visitInterval = assembleFlatVector;
      VectorAssembler.prototype.visitDuration = assembleFlatVector;
      VectorAssembler.prototype.visitFixedSizeList = assembleListVector;
      VectorAssembler.prototype.visitMap = assembleListVector;
    }
  });

  // node_modules/apache-arrow/visitor/jsontypeassembler.mjs
  var JSONTypeAssembler;
  var init_jsontypeassembler = __esm({
    "node_modules/apache-arrow/visitor/jsontypeassembler.mjs"() {
      init_visitor();
      init_type();
      init_enum();
      JSONTypeAssembler = class extends Visitor {
        visit(node) {
          return node == null ? void 0 : super.visit(node);
        }
        visitNull({ typeId }) {
          return { "name": Type[typeId].toLowerCase() };
        }
        visitInt({ typeId, bitWidth, isSigned }) {
          return { "name": Type[typeId].toLowerCase(), "bitWidth": bitWidth, "isSigned": isSigned };
        }
        visitFloat({ typeId, precision }) {
          return { "name": Type[typeId].toLowerCase(), "precision": Precision[precision] };
        }
        visitBinary({ typeId }) {
          return { "name": Type[typeId].toLowerCase() };
        }
        visitLargeBinary({ typeId }) {
          return { "name": Type[typeId].toLowerCase() };
        }
        visitBool({ typeId }) {
          return { "name": Type[typeId].toLowerCase() };
        }
        visitUtf8({ typeId }) {
          return { "name": Type[typeId].toLowerCase() };
        }
        visitLargeUtf8({ typeId }) {
          return { "name": Type[typeId].toLowerCase() };
        }
        visitDecimal({ typeId, scale, precision, bitWidth }) {
          return { "name": Type[typeId].toLowerCase(), "scale": scale, "precision": precision, "bitWidth": bitWidth };
        }
        visitDate({ typeId, unit }) {
          return { "name": Type[typeId].toLowerCase(), "unit": DateUnit[unit] };
        }
        visitTime({ typeId, unit, bitWidth }) {
          return { "name": Type[typeId].toLowerCase(), "unit": TimeUnit[unit], bitWidth };
        }
        visitTimestamp({ typeId, timezone, unit }) {
          return { "name": Type[typeId].toLowerCase(), "unit": TimeUnit[unit], timezone };
        }
        visitInterval({ typeId, unit }) {
          return { "name": Type[typeId].toLowerCase(), "unit": IntervalUnit[unit] };
        }
        visitDuration({ typeId, unit }) {
          return { "name": Type[typeId].toLocaleLowerCase(), "unit": TimeUnit[unit] };
        }
        visitList({ typeId }) {
          return { "name": Type[typeId].toLowerCase() };
        }
        visitStruct({ typeId }) {
          return { "name": Type[typeId].toLowerCase() };
        }
        visitUnion({ typeId, mode, typeIds }) {
          return {
            "name": Type[typeId].toLowerCase(),
            "mode": UnionMode[mode].toUpperCase(),
            "typeIds": [...typeIds]
          };
        }
        visitDictionary(node) {
          return this.visit(node.dictionary);
        }
        visitFixedSizeBinary({ typeId, byteWidth }) {
          return { "name": Type[typeId].toLowerCase(), "byteWidth": byteWidth };
        }
        visitFixedSizeList({ typeId, listSize }) {
          return { "name": Type[typeId].toLowerCase(), "listSize": listSize };
        }
        visitMap({ typeId, keysSorted }) {
          return { "name": Type[typeId].toLowerCase(), "keysSorted": keysSorted };
        }
      };
    }
  });

  // node_modules/apache-arrow/visitor/jsonvectorassembler.mjs
  function* binaryToString(vector) {
    for (const octets of vector) {
      yield octets.reduce((str, byte) => {
        return `${str}${("0" + (byte & 255).toString(16)).slice(-2)}`;
      }, "").toUpperCase();
    }
  }
  function* bigNumsToStrings(values, stride) {
    const u32s = new Uint32Array(values.buffer);
    for (let i = -1, n = u32s.length / stride; ++i < n; ) {
      yield `${BN.new(u32s.subarray((i + 0) * stride, (i + 1) * stride), false)}`;
    }
  }
  var JSONVectorAssembler;
  var init_jsonvectorassembler = __esm({
    "node_modules/apache-arrow/visitor/jsonvectorassembler.mjs"() {
      init_bn();
      init_vector2();
      init_visitor();
      init_enum();
      init_enum();
      init_bit();
      init_type2();
      JSONVectorAssembler = class _JSONVectorAssembler extends Visitor {
        /** @nocollapse */
        static assemble(...batches) {
          const assembler = new _JSONVectorAssembler();
          return batches.map(({ schema, data }) => {
            return assembler.visitMany(schema.fields, data.children);
          });
        }
        visit({ name }, data) {
          const { length } = data;
          const { offset, nullCount, nullBitmap } = data;
          const type = DataType.isDictionary(data.type) ? data.type.indices : data.type;
          const buffers = Object.assign([], data.buffers, { [BufferType.VALIDITY]: void 0 });
          return Object.assign({ "name": name, "count": length, "VALIDITY": DataType.isNull(type) || DataType.isUnion(type) ? void 0 : nullCount <= 0 ? Array.from({ length }, () => 1) : [...new BitIterator(nullBitmap, offset, length, null, getBit)] }, super.visit(data.clone(type, offset, length, 0, buffers)));
        }
        visitNull() {
          return {};
        }
        visitBool({ values, offset, length }) {
          return { "DATA": [...new BitIterator(values, offset, length, null, getBool2)] };
        }
        visitInt(data) {
          return {
            "DATA": data.type.bitWidth < 64 ? [...data.values] : [...bigNumsToStrings(data.values, 2)]
          };
        }
        visitFloat(data) {
          return { "DATA": [...data.values] };
        }
        visitUtf8(data) {
          return { "DATA": [...new Vector([data])], "OFFSET": [...data.valueOffsets] };
        }
        visitLargeUtf8(data) {
          return { "DATA": [...new Vector([data])], "OFFSET": [...bigNumsToStrings(data.valueOffsets, 2)] };
        }
        visitBinary(data) {
          return { "DATA": [...binaryToString(new Vector([data]))], "OFFSET": [...data.valueOffsets] };
        }
        visitLargeBinary(data) {
          return { "DATA": [...binaryToString(new Vector([data]))], "OFFSET": [...bigNumsToStrings(data.valueOffsets, 2)] };
        }
        visitFixedSizeBinary(data) {
          return { "DATA": [...binaryToString(new Vector([data]))] };
        }
        visitDate(data) {
          return {
            "DATA": data.type.unit === DateUnit.DAY ? [...data.values] : [...bigNumsToStrings(data.values, 2)]
          };
        }
        visitTimestamp(data) {
          return { "DATA": [...bigNumsToStrings(data.values, 2)] };
        }
        visitTime(data) {
          return {
            "DATA": data.type.unit < TimeUnit.MICROSECOND ? [...data.values] : [...bigNumsToStrings(data.values, 2)]
          };
        }
        visitDecimal(data) {
          return { "DATA": [...bigNumsToStrings(data.values, 4)] };
        }
        visitList(data) {
          return {
            "OFFSET": [...data.valueOffsets],
            "children": this.visitMany(data.type.children, data.children)
          };
        }
        visitStruct(data) {
          return {
            "children": this.visitMany(data.type.children, data.children)
          };
        }
        visitUnion(data) {
          return {
            "TYPE_ID": [...data.typeIds],
            "OFFSET": data.type.mode === UnionMode.Dense ? [...data.valueOffsets] : void 0,
            "children": this.visitMany(data.type.children, data.children)
          };
        }
        visitInterval(data) {
          return { "DATA": [...data.values] };
        }
        visitDuration(data) {
          return { "DATA": [...bigNumsToStrings(data.values, 2)] };
        }
        visitFixedSizeList(data) {
          return {
            "children": this.visitMany(data.type.children, data.children)
          };
        }
        visitMap(data) {
          return {
            "OFFSET": [...data.valueOffsets],
            "children": this.visitMany(data.type.children, data.children)
          };
        }
      };
    }
  });

  // node_modules/apache-arrow/ipc/writer.mjs
  function writeAll(writer, input) {
    let chunks = input;
    if (input instanceof Table) {
      chunks = input.batches;
      writer.reset(void 0, input.schema);
    }
    for (const batch of chunks) {
      writer.write(batch);
    }
    return writer.finish();
  }
  function writeAllAsync(writer, batches) {
    return __awaiter(this, void 0, void 0, function* () {
      var _a5, batches_1, batches_1_1;
      var _b2, e_1, _c2, _d2;
      try {
        for (_a5 = true, batches_1 = __asyncValues(batches); batches_1_1 = yield batches_1.next(), _b2 = batches_1_1.done, !_b2; _a5 = true) {
          _d2 = batches_1_1.value;
          _a5 = false;
          const batch = _d2;
          writer.write(batch);
        }
      } catch (e_1_1) {
        e_1 = { error: e_1_1 };
      } finally {
        try {
          if (!_a5 && !_b2 && (_c2 = batches_1.return)) yield _c2.call(batches_1);
        } finally {
          if (e_1) throw e_1.error;
        }
      }
      return writer.finish();
    });
  }
  function fieldToJSON({ name, type, nullable }) {
    const assembler = new JSONTypeAssembler();
    return {
      "name": name,
      "nullable": nullable,
      "type": assembler.visit(type),
      "children": (type.children || []).map((field) => fieldToJSON(field)),
      "dictionary": !DataType.isDictionary(type) ? void 0 : {
        "id": type.id,
        "isOrdered": type.isOrdered,
        "indexType": assembler.visit(type.indices)
      }
    };
  }
  function dictionaryBatchToJSON(dictionary, id, isDelta = false) {
    const [columns] = JSONVectorAssembler.assemble(new RecordBatch2({ [id]: dictionary }));
    return JSON.stringify({
      "id": id,
      "isDelta": isDelta,
      "data": {
        "count": dictionary.length,
        "columns": columns
      }
    }, null, 2);
  }
  function recordBatchToJSON(records) {
    const [columns] = JSONVectorAssembler.assemble(records);
    return JSON.stringify({
      "count": records.numRows,
      "columns": columns
    }, null, 2);
  }
  var RecordBatchWriter, RecordBatchStreamWriter, RecordBatchFileWriter, RecordBatchJSONWriter;
  var init_writer = __esm({
    "node_modules/apache-arrow/ipc/writer.mjs"() {
      init_tslib_es6();
      init_table();
      init_message3();
      init_vector2();
      init_type2();
      init_message2();
      init_message2();
      init_file();
      init_enum();
      init_typecomparator();
      init_stream();
      init_vectorassembler();
      init_jsontypeassembler();
      init_jsonvectorassembler();
      init_buffer();
      init_recordbatch2();
      init_interfaces();
      init_compat();
      RecordBatchWriter = class extends ReadableInterop {
        /** @nocollapse */
        // @ts-ignore
        static throughNode(options) {
          throw new Error(`"throughNode" not available in this environment`);
        }
        /** @nocollapse */
        static throughDOM(writableStrategy, readableStrategy) {
          throw new Error(`"throughDOM" not available in this environment`);
        }
        constructor(options) {
          super();
          this._position = 0;
          this._started = false;
          this._sink = new AsyncByteQueue();
          this._schema = null;
          this._dictionaryBlocks = [];
          this._recordBatchBlocks = [];
          this._seenDictionaries = /* @__PURE__ */ new Map();
          this._dictionaryDeltaOffsets = /* @__PURE__ */ new Map();
          isObject(options) || (options = { autoDestroy: true, writeLegacyIpcFormat: false });
          this._autoDestroy = typeof options.autoDestroy === "boolean" ? options.autoDestroy : true;
          this._writeLegacyIpcFormat = typeof options.writeLegacyIpcFormat === "boolean" ? options.writeLegacyIpcFormat : false;
        }
        toString(sync = false) {
          return this._sink.toString(sync);
        }
        toUint8Array(sync = false) {
          return this._sink.toUint8Array(sync);
        }
        writeAll(input) {
          if (isPromise(input)) {
            return input.then((x) => this.writeAll(x));
          } else if (isAsyncIterable(input)) {
            return writeAllAsync(this, input);
          }
          return writeAll(this, input);
        }
        get closed() {
          return this._sink.closed;
        }
        [Symbol.asyncIterator]() {
          return this._sink[Symbol.asyncIterator]();
        }
        toDOMStream(options) {
          return this._sink.toDOMStream(options);
        }
        toNodeStream(options) {
          return this._sink.toNodeStream(options);
        }
        close() {
          return this.reset()._sink.close();
        }
        abort(reason) {
          return this.reset()._sink.abort(reason);
        }
        finish() {
          this._autoDestroy ? this.close() : this.reset(this._sink, this._schema);
          return this;
        }
        reset(sink = this._sink, schema = null) {
          if (sink === this._sink || sink instanceof AsyncByteQueue) {
            this._sink = sink;
          } else {
            this._sink = new AsyncByteQueue();
            if (sink && isWritableDOMStream(sink)) {
              this.toDOMStream({ type: "bytes" }).pipeTo(sink);
            } else if (sink && isWritableNodeStream(sink)) {
              this.toNodeStream({ objectMode: false }).pipe(sink);
            }
          }
          if (this._started && this._schema) {
            this._writeFooter(this._schema);
          }
          this._started = false;
          this._dictionaryBlocks = [];
          this._recordBatchBlocks = [];
          this._seenDictionaries = /* @__PURE__ */ new Map();
          this._dictionaryDeltaOffsets = /* @__PURE__ */ new Map();
          if (!schema || !compareSchemas(schema, this._schema)) {
            if (schema == null) {
              this._position = 0;
              this._schema = null;
            } else {
              this._started = true;
              this._schema = schema;
              this._writeSchema(schema);
            }
          }
          return this;
        }
        write(payload) {
          let schema = null;
          if (!this._sink) {
            throw new Error(`RecordBatchWriter is closed`);
          } else if (payload == null) {
            return this.finish() && void 0;
          } else if (payload instanceof Table && !(schema = payload.schema)) {
            return this.finish() && void 0;
          } else if (payload instanceof RecordBatch2 && !(schema = payload.schema)) {
            return this.finish() && void 0;
          }
          if (schema && !compareSchemas(schema, this._schema)) {
            if (this._started && this._autoDestroy) {
              return this.close();
            }
            this.reset(this._sink, schema);
          }
          if (payload instanceof RecordBatch2) {
            if (!(payload instanceof _InternalEmptyPlaceholderRecordBatch)) {
              this._writeRecordBatch(payload);
            }
          } else if (payload instanceof Table) {
            this.writeAll(payload.batches);
          } else if (isIterable(payload)) {
            this.writeAll(payload);
          }
        }
        _writeMessage(message, alignment = 8) {
          const a = alignment - 1;
          const buffer = Message2.encode(message);
          const flatbufferSize = buffer.byteLength;
          const prefixSize = !this._writeLegacyIpcFormat ? 8 : 4;
          const alignedSize = flatbufferSize + prefixSize + a & ~a;
          const nPaddingBytes = alignedSize - flatbufferSize - prefixSize;
          if (message.headerType === MessageHeader.RecordBatch) {
            this._recordBatchBlocks.push(new FileBlock(alignedSize, message.bodyLength, this._position));
          } else if (message.headerType === MessageHeader.DictionaryBatch) {
            this._dictionaryBlocks.push(new FileBlock(alignedSize, message.bodyLength, this._position));
          }
          if (!this._writeLegacyIpcFormat) {
            this._write(Int32Array.of(-1));
          }
          this._write(Int32Array.of(alignedSize - prefixSize));
          if (flatbufferSize > 0) {
            this._write(buffer);
          }
          return this._writePadding(nPaddingBytes);
        }
        _write(chunk) {
          if (this._started) {
            const buffer = toUint8Array(chunk);
            if (buffer && buffer.byteLength > 0) {
              this._sink.write(buffer);
              this._position += buffer.byteLength;
            }
          }
          return this;
        }
        _writeSchema(schema) {
          return this._writeMessage(Message2.from(schema));
        }
        // @ts-ignore
        _writeFooter(schema) {
          return this._writeLegacyIpcFormat ? this._write(Int32Array.of(0)) : this._write(Int32Array.of(-1, 0));
        }
        _writeMagic() {
          return this._write(MAGIC);
        }
        _writePadding(nBytes) {
          return nBytes > 0 ? this._write(new Uint8Array(nBytes)) : this;
        }
        _writeRecordBatch(batch) {
          const { byteLength, nodes, bufferRegions, buffers } = VectorAssembler.assemble(batch);
          const recordBatch = new RecordBatch3(batch.numRows, nodes, bufferRegions);
          const message = Message2.from(recordBatch, byteLength);
          return this._writeDictionaries(batch)._writeMessage(message)._writeBodyBuffers(buffers);
        }
        _writeDictionaryBatch(dictionary, id, isDelta = false) {
          const { byteLength, nodes, bufferRegions, buffers } = VectorAssembler.assemble(new Vector([dictionary]));
          const recordBatch = new RecordBatch3(dictionary.length, nodes, bufferRegions);
          const dictionaryBatch = new DictionaryBatch2(recordBatch, id, isDelta);
          const message = Message2.from(dictionaryBatch, byteLength);
          return this._writeMessage(message)._writeBodyBuffers(buffers);
        }
        _writeBodyBuffers(buffers) {
          let buffer;
          let size, padding;
          for (let i = -1, n = buffers.length; ++i < n; ) {
            if ((buffer = buffers[i]) && (size = buffer.byteLength) > 0) {
              this._write(buffer);
              if ((padding = (size + 7 & ~7) - size) > 0) {
                this._writePadding(padding);
              }
            }
          }
          return this;
        }
        _writeDictionaries(batch) {
          var _a5, _b2;
          for (const [id, dictionary] of batch.dictionaries) {
            const chunks = (_a5 = dictionary === null || dictionary === void 0 ? void 0 : dictionary.data) !== null && _a5 !== void 0 ? _a5 : [];
            const prevDictionary = this._seenDictionaries.get(id);
            const offset = (_b2 = this._dictionaryDeltaOffsets.get(id)) !== null && _b2 !== void 0 ? _b2 : 0;
            if (!prevDictionary || prevDictionary.data[0] !== chunks[0]) {
              for (const [index, chunk] of chunks.entries())
                this._writeDictionaryBatch(chunk, id, index > 0);
            } else if (offset < chunks.length) {
              for (const chunk of chunks.slice(offset))
                this._writeDictionaryBatch(chunk, id, true);
            }
            this._seenDictionaries.set(id, dictionary);
            this._dictionaryDeltaOffsets.set(id, chunks.length);
          }
          return this;
        }
      };
      RecordBatchStreamWriter = class _RecordBatchStreamWriter extends RecordBatchWriter {
        /** @nocollapse */
        static writeAll(input, options) {
          const writer = new _RecordBatchStreamWriter(options);
          if (isPromise(input)) {
            return input.then((x) => writer.writeAll(x));
          } else if (isAsyncIterable(input)) {
            return writeAllAsync(writer, input);
          }
          return writeAll(writer, input);
        }
      };
      RecordBatchFileWriter = class _RecordBatchFileWriter extends RecordBatchWriter {
        /** @nocollapse */
        static writeAll(input) {
          const writer = new _RecordBatchFileWriter();
          if (isPromise(input)) {
            return input.then((x) => writer.writeAll(x));
          } else if (isAsyncIterable(input)) {
            return writeAllAsync(writer, input);
          }
          return writeAll(writer, input);
        }
        constructor() {
          super();
          this._autoDestroy = true;
        }
        // @ts-ignore
        _writeSchema(schema) {
          return this._writeMagic()._writePadding(2);
        }
        _writeDictionaryBatch(dictionary, id, isDelta = false) {
          if (!isDelta && this._seenDictionaries.has(id)) {
            throw new Error("The Arrow File format does not support replacement dictionaries. ");
          }
          return super._writeDictionaryBatch(dictionary, id, isDelta);
        }
        _writeFooter(schema) {
          const buffer = Footer_.encode(new Footer_(schema, MetadataVersion.V5, this._recordBatchBlocks, this._dictionaryBlocks));
          return super._writeFooter(schema)._write(buffer)._write(Int32Array.of(buffer.byteLength))._writeMagic();
        }
      };
      RecordBatchJSONWriter = class _RecordBatchJSONWriter extends RecordBatchWriter {
        /** @nocollapse */
        static writeAll(input) {
          return new _RecordBatchJSONWriter().writeAll(input);
        }
        constructor() {
          super();
          this._autoDestroy = true;
          this._recordBatches = [];
          this._recordBatchesWithDictionaries = [];
        }
        _writeMessage() {
          return this;
        }
        // @ts-ignore
        _writeFooter(schema) {
          return this;
        }
        _writeSchema(schema) {
          return this._write(`{
  "schema": ${JSON.stringify({ fields: schema.fields.map((field) => fieldToJSON(field)) }, null, 2)}`);
        }
        _writeDictionaries(batch) {
          if (batch.dictionaries.size > 0) {
            this._recordBatchesWithDictionaries.push(batch);
          }
          return this;
        }
        _writeDictionaryBatch(dictionary, id, isDelta = false) {
          this._write(this._dictionaryBlocks.length === 0 ? `    ` : `,
    `);
          this._write(dictionaryBatchToJSON(dictionary, id, isDelta));
          this._dictionaryBlocks.push(new FileBlock(0, 0, 0));
          return this;
        }
        _writeRecordBatch(batch) {
          this._writeDictionaries(batch);
          this._recordBatches.push(batch);
          return this;
        }
        close() {
          if (this._recordBatchesWithDictionaries.length > 0) {
            this._write(`,
  "dictionaries": [
`);
            for (const batch of this._recordBatchesWithDictionaries) {
              super._writeDictionaries(batch);
            }
            this._write(`
  ]`);
          }
          if (this._recordBatches.length > 0) {
            for (let i = -1, n = this._recordBatches.length; ++i < n; ) {
              this._write(i === 0 ? `,
  "batches": [
    ` : `,
    `);
              this._write(recordBatchToJSON(this._recordBatches[i]));
              this._recordBatchBlocks.push(new FileBlock(0, 0, 0));
            }
            this._write(`
  ]`);
          }
          if (this._schema) {
            this._write(`
}`);
          }
          this._recordBatchesWithDictionaries = [];
          this._recordBatches = [];
          return super.close();
        }
      };
    }
  });

  // node_modules/apache-arrow/io/whatwg/iterable.mjs
  function toDOMStream(source, options) {
    if (isAsyncIterable(source)) {
      return asyncIterableAsReadableDOMStream(source, options);
    }
    if (isIterable(source)) {
      return iterableAsReadableDOMStream(source, options);
    }
    throw new Error(`toDOMStream() must be called with an Iterable or AsyncIterable`);
  }
  function iterableAsReadableDOMStream(source, options) {
    let it = null;
    const bm = (options === null || options === void 0 ? void 0 : options.type) === "bytes" || false;
    const hwm = (options === null || options === void 0 ? void 0 : options.highWaterMark) || Math.pow(2, 24);
    return new ReadableStream(Object.assign(Object.assign({}, options), {
      start(controller) {
        next(controller, it || (it = source[Symbol.iterator]()));
      },
      pull(controller) {
        it ? next(controller, it) : controller.close();
      },
      cancel() {
        ((it === null || it === void 0 ? void 0 : it.return) && it.return() || true) && (it = null);
      }
    }), Object.assign({ highWaterMark: bm ? hwm : void 0 }, options));
    function next(controller, it2) {
      let buf;
      let r = null;
      let size = controller.desiredSize || null;
      while (!(r = it2.next(bm ? size : null)).done) {
        if (ArrayBuffer.isView(r.value) && (buf = toUint8Array(r.value))) {
          size != null && bm && (size = size - buf.byteLength + 1);
          r.value = buf;
        }
        controller.enqueue(r.value);
        if (size != null && --size <= 0) {
          return;
        }
      }
      controller.close();
    }
  }
  function asyncIterableAsReadableDOMStream(source, options) {
    let it = null;
    const bm = (options === null || options === void 0 ? void 0 : options.type) === "bytes" || false;
    const hwm = (options === null || options === void 0 ? void 0 : options.highWaterMark) || Math.pow(2, 24);
    return new ReadableStream(Object.assign(Object.assign({}, options), {
      start(controller) {
        return __awaiter(this, void 0, void 0, function* () {
          yield next(controller, it || (it = source[Symbol.asyncIterator]()));
        });
      },
      pull(controller) {
        return __awaiter(this, void 0, void 0, function* () {
          it ? yield next(controller, it) : controller.close();
        });
      },
      cancel() {
        return __awaiter(this, void 0, void 0, function* () {
          ((it === null || it === void 0 ? void 0 : it.return) && (yield it.return()) || true) && (it = null);
        });
      }
    }), Object.assign({ highWaterMark: bm ? hwm : void 0 }, options));
    function next(controller, it2) {
      return __awaiter(this, void 0, void 0, function* () {
        let buf;
        let r = null;
        let size = controller.desiredSize || null;
        while (!(r = yield it2.next(bm ? size : null)).done) {
          if (ArrayBuffer.isView(r.value) && (buf = toUint8Array(r.value))) {
            size != null && bm && (size = size - buf.byteLength + 1);
            r.value = buf;
          }
          controller.enqueue(r.value);
          if (size != null && --size <= 0) {
            return;
          }
        }
        controller.close();
      });
    }
  }
  var init_iterable = __esm({
    "node_modules/apache-arrow/io/whatwg/iterable.mjs"() {
      init_tslib_es6();
      init_buffer();
      init_compat();
    }
  });

  // node_modules/apache-arrow/io/whatwg/builder.mjs
  function builderThroughDOMStream(options) {
    return new BuilderTransform(options);
  }
  var BuilderTransform, chunkLength, chunkByteLength;
  var init_builder3 = __esm({
    "node_modules/apache-arrow/io/whatwg/builder.mjs"() {
      init_tslib_es6();
      init_factories();
      BuilderTransform = class {
        constructor(options) {
          this._numChunks = 0;
          this._finished = false;
          this._bufferedSize = 0;
          const { ["readableStrategy"]: readableStrategy, ["writableStrategy"]: writableStrategy, ["queueingStrategy"]: queueingStrategy = "count" } = options, builderOptions = __rest(options, ["readableStrategy", "writableStrategy", "queueingStrategy"]);
          this._controller = null;
          this._builder = makeBuilder(builderOptions);
          this._getSize = queueingStrategy !== "bytes" ? chunkLength : chunkByteLength;
          const { ["highWaterMark"]: readableHighWaterMark = queueingStrategy === "bytes" ? Math.pow(2, 14) : 1e3 } = Object.assign({}, readableStrategy);
          const { ["highWaterMark"]: writableHighWaterMark = queueingStrategy === "bytes" ? Math.pow(2, 14) : 1e3 } = Object.assign({}, writableStrategy);
          this["readable"] = new ReadableStream({
            ["cancel"]: () => {
              this._builder.clear();
            },
            ["pull"]: (c) => {
              this._maybeFlush(this._builder, this._controller = c);
            },
            ["start"]: (c) => {
              this._maybeFlush(this._builder, this._controller = c);
            }
          }, {
            "highWaterMark": readableHighWaterMark,
            "size": queueingStrategy !== "bytes" ? chunkLength : chunkByteLength
          });
          this["writable"] = new WritableStream({
            ["abort"]: () => {
              this._builder.clear();
            },
            ["write"]: () => {
              this._maybeFlush(this._builder, this._controller);
            },
            ["close"]: () => {
              this._maybeFlush(this._builder.finish(), this._controller);
            }
          }, {
            "highWaterMark": writableHighWaterMark,
            "size": (value) => this._writeValueAndReturnChunkSize(value)
          });
        }
        _writeValueAndReturnChunkSize(value) {
          const bufferedSize = this._bufferedSize;
          this._bufferedSize = this._getSize(this._builder.append(value));
          return this._bufferedSize - bufferedSize;
        }
        _maybeFlush(builder, controller) {
          if (controller == null) {
            return;
          }
          if (this._bufferedSize >= controller.desiredSize) {
            ++this._numChunks && this._enqueue(controller, builder.toVector());
          }
          if (builder.finished) {
            if (builder.length > 0 || this._numChunks === 0) {
              ++this._numChunks && this._enqueue(controller, builder.toVector());
            }
            if (!this._finished && (this._finished = true)) {
              this._enqueue(controller, null);
            }
          }
        }
        _enqueue(controller, chunk) {
          this._bufferedSize = 0;
          this._controller = null;
          chunk == null ? controller.close() : controller.enqueue(chunk);
        }
      };
      chunkLength = (chunk) => {
        var _a5;
        return (_a5 = chunk === null || chunk === void 0 ? void 0 : chunk.length) !== null && _a5 !== void 0 ? _a5 : 0;
      };
      chunkByteLength = (chunk) => {
        var _a5;
        return (_a5 = chunk === null || chunk === void 0 ? void 0 : chunk.byteLength) !== null && _a5 !== void 0 ? _a5 : 0;
      };
    }
  });

  // node_modules/apache-arrow/io/whatwg/reader.mjs
  function recordBatchReaderThroughDOMStream(writableStrategy, readableStrategy) {
    const queue = new AsyncByteQueue();
    let reader = null;
    const readable = new ReadableStream({
      cancel() {
        return __awaiter(this, void 0, void 0, function* () {
          yield queue.close();
        });
      },
      start(controller) {
        return __awaiter(this, void 0, void 0, function* () {
          yield next(controller, reader || (reader = yield open()));
        });
      },
      pull(controller) {
        return __awaiter(this, void 0, void 0, function* () {
          reader ? yield next(controller, reader) : controller.close();
        });
      }
    });
    return { writable: new WritableStream(queue, Object.assign({ "highWaterMark": Math.pow(2, 14) }, writableStrategy)), readable };
    function open() {
      return __awaiter(this, void 0, void 0, function* () {
        return yield (yield RecordBatchReader.from(queue)).open(readableStrategy);
      });
    }
    function next(controller, reader2) {
      return __awaiter(this, void 0, void 0, function* () {
        let size = controller.desiredSize;
        let r = null;
        while (!(r = yield reader2.next()).done) {
          controller.enqueue(r.value);
          if (size != null && --size <= 0) {
            return;
          }
        }
        controller.close();
      });
    }
  }
  var init_reader2 = __esm({
    "node_modules/apache-arrow/io/whatwg/reader.mjs"() {
      init_tslib_es6();
      init_stream();
      init_reader();
    }
  });

  // node_modules/apache-arrow/io/whatwg/writer.mjs
  function recordBatchWriterThroughDOMStream(writableStrategy, readableStrategy) {
    const writer = new this(writableStrategy);
    const reader = new AsyncByteStream(writer);
    const readable = new ReadableStream({
      // type: 'bytes',
      cancel() {
        return __awaiter(this, void 0, void 0, function* () {
          yield reader.cancel();
        });
      },
      pull(controller) {
        return __awaiter(this, void 0, void 0, function* () {
          yield next(controller);
        });
      },
      start(controller) {
        return __awaiter(this, void 0, void 0, function* () {
          yield next(controller);
        });
      }
    }, Object.assign({ "highWaterMark": Math.pow(2, 14) }, readableStrategy));
    return { writable: new WritableStream(writer, writableStrategy), readable };
    function next(controller) {
      return __awaiter(this, void 0, void 0, function* () {
        let buf = null;
        let size = controller.desiredSize;
        while (buf = yield reader.read(size || null)) {
          controller.enqueue(buf);
          if (size != null && (size -= buf.byteLength) <= 0) {
            return;
          }
        }
        controller.close();
      });
    }
  }
  var init_writer2 = __esm({
    "node_modules/apache-arrow/io/whatwg/writer.mjs"() {
      init_tslib_es6();
      init_stream();
    }
  });

  // node_modules/apache-arrow/ipc/serialization.mjs
  function tableFromIPC(input) {
    const reader = RecordBatchReader.from(input);
    if (isPromise(reader)) {
      return reader.then((reader2) => tableFromIPC(reader2));
    }
    if (reader.isAsync()) {
      return reader.readAll().then((xs) => new Table(xs));
    }
    return new Table(reader.readAll());
  }
  function tableToIPC(table, type = "stream") {
    return (type === "stream" ? RecordBatchStreamWriter : RecordBatchFileWriter).writeAll(table).toUint8Array(true);
  }
  var init_serialization = __esm({
    "node_modules/apache-arrow/ipc/serialization.mjs"() {
      init_table();
      init_compat();
      init_reader();
      init_writer();
    }
  });

  // node_modules/apache-arrow/Arrow.mjs
  var util;
  var init_Arrow = __esm({
    "node_modules/apache-arrow/Arrow.mjs"() {
      init_message_header();
      init_enum();
      init_data();
      init_type2();
      init_table();
      init_vector2();
      init_visitor();
      init_schema2();
      init_map2();
      init_struct2();
      init_builder2();
      init_factories();
      init_bool2();
      init_null2();
      init_date2();
      init_decimal2();
      init_dictionary();
      init_fixedsizebinary();
      init_float();
      init_int3();
      init_time2();
      init_timestamp2();
      init_interval2();
      init_duration2();
      init_utf83();
      init_largeutf8();
      init_binary2();
      init_largebinary();
      init_list2();
      init_fixedsizelist();
      init_map3();
      init_struct3();
      init_union2();
      init_stream();
      init_reader();
      init_writer();
      init_serialization();
      init_message3();
      init_message2();
      init_recordbatch2();
      init_bn();
      init_int2();
      init_bit();
      init_math();
      init_buffer();
      init_vector();
      init_pretty();
      init_typecomparator();
      util = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, bn_exports), int_exports), bit_exports), math_exports), buffer_exports), vector_exports), pretty_exports), {
        compareSchemas,
        compareFields,
        compareTypes
      });
    }
  });

  // node_modules/apache-arrow/Arrow.dom.mjs
  var Arrow_dom_exports = {};
  __export(Arrow_dom_exports, {
    AsyncByteQueue: () => AsyncByteQueue,
    AsyncByteStream: () => AsyncByteStream,
    AsyncMessageReader: () => AsyncMessageReader,
    AsyncRecordBatchFileReader: () => AsyncRecordBatchFileReader,
    AsyncRecordBatchStreamReader: () => AsyncRecordBatchStreamReader,
    Binary: () => Binary2,
    BinaryBuilder: () => BinaryBuilder,
    Bool: () => Bool2,
    BoolBuilder: () => BoolBuilder,
    BufferType: () => BufferType,
    Builder: () => Builder2,
    ByteStream: () => ByteStream,
    Data: () => Data,
    DataType: () => DataType,
    DateBuilder: () => DateBuilder,
    DateDay: () => DateDay,
    DateDayBuilder: () => DateDayBuilder,
    DateMillisecond: () => DateMillisecond,
    DateMillisecondBuilder: () => DateMillisecondBuilder,
    DateUnit: () => DateUnit,
    Date_: () => Date_,
    Decimal: () => Decimal2,
    DecimalBuilder: () => DecimalBuilder,
    DenseUnion: () => DenseUnion,
    DenseUnionBuilder: () => DenseUnionBuilder,
    Dictionary: () => Dictionary,
    DictionaryBuilder: () => DictionaryBuilder,
    Duration: () => Duration2,
    DurationBuilder: () => DurationBuilder,
    DurationMicrosecond: () => DurationMicrosecond,
    DurationMicrosecondBuilder: () => DurationMicrosecondBuilder,
    DurationMillisecond: () => DurationMillisecond,
    DurationMillisecondBuilder: () => DurationMillisecondBuilder,
    DurationNanosecond: () => DurationNanosecond,
    DurationNanosecondBuilder: () => DurationNanosecondBuilder,
    DurationSecond: () => DurationSecond,
    DurationSecondBuilder: () => DurationSecondBuilder,
    Field: () => Field2,
    FixedSizeBinary: () => FixedSizeBinary2,
    FixedSizeBinaryBuilder: () => FixedSizeBinaryBuilder,
    FixedSizeList: () => FixedSizeList2,
    FixedSizeListBuilder: () => FixedSizeListBuilder,
    Float: () => Float,
    Float16: () => Float16,
    Float16Builder: () => Float16Builder,
    Float32: () => Float32,
    Float32Builder: () => Float32Builder,
    Float64: () => Float64,
    Float64Builder: () => Float64Builder,
    FloatBuilder: () => FloatBuilder,
    Int: () => Int_,
    Int16: () => Int16,
    Int16Builder: () => Int16Builder,
    Int32: () => Int32,
    Int32Builder: () => Int32Builder,
    Int64: () => Int64,
    Int64Builder: () => Int64Builder,
    Int8: () => Int8,
    Int8Builder: () => Int8Builder,
    IntBuilder: () => IntBuilder,
    Interval: () => Interval_,
    IntervalBuilder: () => IntervalBuilder,
    IntervalDayTime: () => IntervalDayTime,
    IntervalDayTimeBuilder: () => IntervalDayTimeBuilder,
    IntervalUnit: () => IntervalUnit,
    IntervalYearMonth: () => IntervalYearMonth,
    IntervalYearMonthBuilder: () => IntervalYearMonthBuilder,
    JSONMessageReader: () => JSONMessageReader,
    LargeBinary: () => LargeBinary2,
    LargeBinaryBuilder: () => LargeBinaryBuilder,
    LargeUtf8: () => LargeUtf82,
    LargeUtf8Builder: () => LargeUtf8Builder,
    List: () => List2,
    ListBuilder: () => ListBuilder,
    MapBuilder: () => MapBuilder,
    MapRow: () => MapRow,
    Map_: () => Map_,
    Message: () => Message2,
    MessageHeader: () => MessageHeader,
    MessageReader: () => MessageReader,
    MetadataVersion: () => MetadataVersion,
    Null: () => Null2,
    NullBuilder: () => NullBuilder,
    Precision: () => Precision,
    RecordBatch: () => RecordBatch2,
    RecordBatchFileReader: () => RecordBatchFileReader,
    RecordBatchFileWriter: () => RecordBatchFileWriter,
    RecordBatchJSONWriter: () => RecordBatchJSONWriter,
    RecordBatchReader: () => RecordBatchReader,
    RecordBatchStreamReader: () => RecordBatchStreamReader,
    RecordBatchStreamWriter: () => RecordBatchStreamWriter,
    RecordBatchWriter: () => RecordBatchWriter,
    Schema: () => Schema2,
    SparseUnion: () => SparseUnion,
    SparseUnionBuilder: () => SparseUnionBuilder,
    Struct: () => Struct,
    StructBuilder: () => StructBuilder,
    StructRow: () => StructRow,
    Table: () => Table,
    Time: () => Time_,
    TimeBuilder: () => TimeBuilder,
    TimeMicrosecond: () => TimeMicrosecond,
    TimeMicrosecondBuilder: () => TimeMicrosecondBuilder,
    TimeMillisecond: () => TimeMillisecond,
    TimeMillisecondBuilder: () => TimeMillisecondBuilder,
    TimeNanosecond: () => TimeNanosecond,
    TimeNanosecondBuilder: () => TimeNanosecondBuilder,
    TimeSecond: () => TimeSecond,
    TimeSecondBuilder: () => TimeSecondBuilder,
    TimeUnit: () => TimeUnit,
    Timestamp: () => Timestamp_,
    TimestampBuilder: () => TimestampBuilder,
    TimestampMicrosecond: () => TimestampMicrosecond,
    TimestampMicrosecondBuilder: () => TimestampMicrosecondBuilder,
    TimestampMillisecond: () => TimestampMillisecond,
    TimestampMillisecondBuilder: () => TimestampMillisecondBuilder,
    TimestampNanosecond: () => TimestampNanosecond,
    TimestampNanosecondBuilder: () => TimestampNanosecondBuilder,
    TimestampSecond: () => TimestampSecond,
    TimestampSecondBuilder: () => TimestampSecondBuilder,
    Type: () => Type2,
    Uint16: () => Uint16,
    Uint16Builder: () => Uint16Builder,
    Uint32: () => Uint32,
    Uint32Builder: () => Uint32Builder,
    Uint64: () => Uint64,
    Uint64Builder: () => Uint64Builder,
    Uint8: () => Uint8,
    Uint8Builder: () => Uint8Builder,
    Union: () => Union_,
    UnionBuilder: () => UnionBuilder,
    UnionMode: () => UnionMode,
    Utf8: () => Utf82,
    Utf8Builder: () => Utf8Builder,
    Vector: () => Vector,
    Visitor: () => Visitor,
    builderThroughAsyncIterable: () => builderThroughAsyncIterable,
    builderThroughIterable: () => builderThroughIterable,
    makeBuilder: () => makeBuilder,
    makeData: () => makeData,
    makeTable: () => makeTable,
    makeVector: () => makeVector,
    tableFromArrays: () => tableFromArrays,
    tableFromIPC: () => tableFromIPC,
    tableFromJSON: () => tableFromJSON,
    tableToIPC: () => tableToIPC,
    util: () => util,
    vectorFromArray: () => vectorFromArray
  });
  var init_Arrow_dom = __esm({
    "node_modules/apache-arrow/Arrow.dom.mjs"() {
      init_adapters();
      init_builder2();
      init_reader();
      init_writer();
      init_iterable();
      init_builder3();
      init_reader2();
      init_writer2();
      init_Arrow();
      init_Arrow();
      adapters_default.toDOMStream = toDOMStream;
      Builder2["throughDOM"] = builderThroughDOMStream;
      RecordBatchReader["throughDOM"] = recordBatchReaderThroughDOMStream;
      RecordBatchFileReader["throughDOM"] = recordBatchReaderThroughDOMStream;
      RecordBatchStreamReader["throughDOM"] = recordBatchReaderThroughDOMStream;
      RecordBatchWriter["throughDOM"] = recordBatchWriterThroughDOMStream;
      RecordBatchFileWriter["throughDOM"] = recordBatchWriterThroughDOMStream;
      RecordBatchStreamWriter["throughDOM"] = recordBatchWriterThroughDOMStream;
    }
  });

  // node_modules/alasql/dist/alasql.min.js
  var require_alasql_min = __commonJS({
    "node_modules/alasql/dist/alasql.min.js"(exports, module) {
      "use strict";
      (function(c, R2) {
        typeof define == "function" && define.amd ? define([], R2) : typeof exports == "object" ? module.exports = R2() : c.alasql = R2();
      })(exports, function() {
        let c = function(e, r, t, n) {
          if (r = r || [], typeof importScripts != "function" && c.webworker) {
            var i = c.lastid++;
            c.buffer[i] = t, c.webworker.postMessage({ id: i, sql: e, params: r });
            return;
          }
          return arguments.length === 0 ? new S.Select({ columns: [new S.Column({ columnid: "*" })], from: [new S.ParamValue({ param: 0 })] }) : arguments.length === 1 && e.constructor === Array ? c.promise(e) : (typeof r == "function" && (n = t, t = r, r = []), typeof r != "object" && (r = [r]), typeof e == "string" && e[0] === "#" && typeof document == "object" ? e = document.querySelector(e).textContent : typeof e == "object" && e instanceof HTMLElement ? e = e.textContent : typeof e == "function" && (e = e.toString(), e = (/\/\*([\S\s]+)\*\//m.exec(e) || ["", "Function given as SQL. Plese Provide SQL string or have a /* ... */ syle comment with SQL in the function."])[1]), c.exec(e, r, t, n));
        };
        c.version = "4.17.1", c.build = "develop-a8ee499a", c.debug = void 0;
        var R2 = function() {
          return null;
        }, Os = "", rt = (function() {
          var e = function(V2, ve, ke, Te) {
            for (ke = ke || {}, Te = V2.length; Te--; ke[V2[Te]] = ve) ;
            return ke;
          }, r = [2, 17], t = [1, 112], n = [1, 106], i = [1, 107], s = [1, 108], o = [1, 109], a = [1, 110], f = [1, 111], m = [1, 6], E = [1, 43], p = [1, 81], h = [1, 77], g = [1, 78], O = [1, 98], T = [1, 97], v = [1, 70], N = [1, 105], b = [1, 87], L = [1, 65], C = [1, 72], a1 = [1, 86], r1 = [1, 67], H = [1, 71], C1 = [1, 69], k1 = [1, 62], V1 = [1, 75], J1 = [1, 63], R = [1, 68], U1 = [1, 85], ee = [1, 79], _1 = [1, 88], K1 = [1, 89], Se = [1, 100], Ie = [1, 83], Xe = [1, 84], Ve = [1, 82], we = [1, 90], Ge = [1, 91], Me = [1, 92], Ze = [1, 93], Re = [1, 94], Oe = [1, 95], Pe = [1, 96], He = [1, 102], l2 = [1, 66], v2 = [1, 80], k2 = [1, 73], I2 = [1, 101], w2 = [1, 64], _2 = [1, 74], A4 = [1, 116], N4 = [1, 115], U2 = [14, 339, 639, 798], B = [14, 339, 343, 639, 798], vt = [2, 251], it = [1, 121], st = [1, 123], at = [1, 122], M = [1, 128], $e = [1, 130], j = [1, 129], U = [1, 131], F = [1, 132], P = [1, 133], G = [1, 134], O4 = [139, 388, 447], C4 = [1, 142], R4 = [1, 141], k4 = [1, 149], R1 = [1, 179], V = [1, 194], J = [1, 197], o1 = [1, 190], w = [1, 200], i1 = [1, 204], l1 = [1, 175], _ = [1, 201], u1 = [1, 186], f1 = [1, 188], c1 = [1, 193], x = [1, 202], h1 = [1, 191], Y = [1, 219], W = [1, 220], d1 = [1, 192], p1 = [1, 181], b1 = [1, 182], g1 = [1, 212], E1 = [1, 207], m1 = [1, 208], v1 = [1, 184], X = [1, 213], K = [1, 214], q = [1, 215], Q = [1, 216], z = [1, 217], Z = [1, 218], $ = [1, 221], e1 = [1, 222], t1 = [1, 195], n1 = [1, 196], y = [1, 198], s1 = [1, 199], S1 = [1, 205], T1 = [1, 211], D = [1, 203], A1 = [1, 206], N1 = [1, 189], O1 = [1, 187], I3 = [1, 210], k = [1, 223], St = [2, 4, 5, 6, 7, 8, 9, 152, 161, 190, 335], Zt = [2, 502], $t = [1, 227], kn = [1, 232], z2 = [1, 241], Z2 = [1, 239], en = [14, 77, 84, 103, 108, 127, 137, 171, 177, 178, 192, 207, 252, 271, 273, 339, 343, 503, 639, 798], I4 = [1, 246], w4 = [2, 4, 5, 6, 7, 8, 9, 14, 77, 82, 83, 84, 121, 124, 125, 127, 131, 132, 133, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 192, 194, 196, 207, 266, 267, 304, 313, 314, 315, 316, 317, 318, 319, 320, 339, 343, 457, 461, 503, 639, 798], he = [2, 4, 5, 6, 7, 8, 9, 14, 58, 77, 79, 82, 83, 84, 96, 103, 105, 108, 109, 116, 121, 124, 125, 127, 131, 132, 133, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 188, 189, 190, 192, 194, 196, 198, 207, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 252, 259, 266, 267, 268, 269, 271, 273, 294, 295, 304, 313, 314, 315, 316, 317, 318, 319, 320, 322, 329, 333, 339, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 363, 364, 365, 366, 368, 372, 373, 433, 437, 438, 441, 443, 445, 446, 454, 455, 457, 461, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 503, 509, 545, 546, 555, 639, 798], Ye = [1, 275], hr = [1, 282], dr = [1, 283], F2 = [1, 288], _4 = [1, 293], P2 = [1, 298], G2 = [1, 297], tn = [2, 4, 5, 6, 7, 8, 9, 14, 77, 83, 84, 103, 108, 116, 127, 137, 140, 141, 146, 152, 154, 158, 161, 163, 165, 171, 177, 178, 188, 189, 190, 192, 207, 229, 252, 266, 267, 271, 273, 281, 292, 293, 294, 298, 299, 301, 304, 313, 314, 315, 316, 317, 318, 319, 320, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 335, 336, 339, 343, 345, 350, 457, 461, 503, 639, 798], In = [2, 175], wn = [1, 309], x4 = [14, 79, 84, 339, 343, 466, 639, 798], A = [2, 4, 5, 6, 7, 8, 9, 14, 58, 77, 79, 82, 83, 84, 96, 103, 105, 108, 109, 116, 121, 124, 125, 127, 131, 132, 133, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 188, 189, 190, 192, 194, 196, 198, 202, 207, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 259, 266, 267, 268, 269, 271, 273, 294, 295, 304, 313, 314, 315, 316, 317, 318, 319, 320, 322, 329, 330, 333, 335, 339, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 363, 364, 365, 366, 368, 372, 373, 378, 379, 391, 403, 404, 407, 408, 423, 426, 433, 437, 438, 439, 440, 441, 442, 443, 445, 446, 454, 455, 457, 461, 463, 466, 471, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 503, 509, 545, 546, 552, 553, 554, 555, 639, 798], D4 = [2, 4, 5, 6, 7, 8, 9, 14, 58, 77, 83, 96, 133, 155, 165, 198, 294, 295, 322, 339, 368, 372, 373, 433, 437, 438, 441, 443, 445, 446, 454, 455, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 545, 546, 555, 639, 798], _n = [14, 77, 84, 271, 273, 339, 343, 503, 639, 798], pr = [2, 263], br = [1, 595], $2 = [83, 198], ot = [1, 607], L4 = [1, 609], gr = [1, 610], x2 = [2, 4, 5, 6, 7, 8, 9], xn = [2, 534], Dn = [1, 616], lt = [1, 627], y2 = [1, 630], D2 = [1, 631], V4 = [14, 83, 84, 96, 141, 146, 155, 198, 329, 339, 343, 509, 639, 798], u2 = [14, 79, 339, 343, 639, 798], Ln = [2, 605], Vn = [1, 649], Mn = [2, 4, 5, 6, 7, 8, 9, 165], le = [1, 687], Z1 = [1, 659], I1 = [1, 693], w1 = [1, 694], M1 = [1, 667], M4 = [1, 678], F1 = [1, 665], D1 = [1, 673], P1 = [1, 666], ue = [1, 674], fe = [1, 676], H1 = [1, 668], Y1 = [1, 669], ce = [1, 688], Ee = [1, 685], me = [1, 686], y1 = [1, 662], G1 = [1, 664], q1 = [1, 656], L1 = [1, 657], Q1 = [1, 658], z1 = [1, 660], x1 = [1, 661], B1 = [1, 663], W1 = [1, 670], X1 = [1, 671], te = [1, 675], ne = [1, 677], re = [1, 679], ie = [1, 680], se = [1, 681], ae = [1, 682], oe = [1, 683], de = [1, 689], pe = [1, 690], $1 = [1, 691], ge = [1, 692], U4 = [1, 702], F4 = [1, 699], Un = [2, 4, 5, 6, 7, 8, 9, 14, 58, 77, 79, 82, 84, 96, 103, 105, 108, 109, 116, 121, 124, 125, 127, 131, 132, 133, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 188, 189, 190, 192, 194, 196, 198, 207, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 252, 259, 266, 267, 268, 269, 271, 273, 294, 295, 304, 313, 314, 315, 316, 317, 318, 319, 320, 322, 329, 333, 339, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 363, 364, 365, 366, 368, 372, 373, 433, 437, 438, 441, 443, 445, 446, 454, 455, 457, 461, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 503, 509, 545, 546, 555, 639, 798], Er = [2, 301], P4 = [2, 4, 5, 6, 7, 8, 9, 14, 58, 77, 79, 82, 83, 84, 96, 103, 105, 108, 109, 116, 121, 124, 127, 131, 132, 133, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 188, 189, 190, 192, 194, 196, 198, 207, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 252, 259, 266, 267, 268, 269, 271, 273, 294, 295, 304, 313, 314, 315, 316, 317, 318, 319, 320, 322, 329, 333, 339, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 363, 364, 365, 366, 368, 372, 373, 433, 437, 438, 441, 443, 445, 446, 454, 455, 457, 461, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 503, 509, 545, 546, 555, 639, 798], G4 = [2, 299], y4 = [2, 300], t3 = [2, 4, 5, 6, 7, 8, 9, 14, 58, 77, 79, 82, 83, 84, 96, 103, 105, 108, 109, 116, 121, 124, 125, 127, 131, 132, 133, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 188, 189, 190, 192, 194, 196, 198, 207, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 259, 266, 267, 268, 269, 271, 273, 294, 295, 304, 313, 314, 315, 316, 317, 318, 319, 320, 322, 329, 330, 333, 339, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 363, 364, 365, 366, 368, 372, 373, 378, 391, 403, 404, 407, 408, 433, 437, 438, 441, 443, 445, 446, 454, 455, 457, 461, 463, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 503, 509, 545, 546, 555, 639, 798], B4 = [2, 383], Tt = [2, 4, 5, 6, 7, 8, 9, 14, 58, 77, 79, 82, 83, 84, 96, 103, 105, 108, 109, 116, 121, 124, 125, 127, 131, 132, 133, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 188, 189, 190, 192, 194, 196, 198, 207, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 259, 266, 267, 268, 269, 271, 273, 294, 295, 304, 313, 314, 315, 316, 317, 318, 319, 320, 322, 329, 330, 333, 335, 339, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 363, 364, 365, 366, 368, 372, 373, 378, 379, 391, 403, 404, 407, 408, 433, 437, 438, 441, 443, 445, 446, 454, 455, 457, 461, 463, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 503, 509, 545, 546, 555, 639, 798], mr = [1, 718], Fn = [1, 728], f2 = [2, 4, 5, 6, 7, 8, 9, 14, 58, 77, 79, 82, 83, 84, 96, 103, 105, 108, 109, 116, 121, 124, 125, 127, 131, 132, 133, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 188, 189, 190, 192, 194, 196, 198, 207, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 259, 266, 267, 268, 269, 271, 273, 294, 295, 304, 313, 314, 315, 316, 317, 318, 319, 320, 322, 329, 333, 339, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 363, 364, 365, 366, 368, 372, 373, 433, 437, 438, 441, 443, 445, 446, 454, 455, 457, 461, 463, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 503, 509, 545, 546, 555, 639, 798], nn = [1, 745], Qe = [1, 747], ze = [1, 748], rn = [1, 738], J4 = [1, 756], j4 = [1, 755], Pn = [2, 4, 5, 6, 7, 8, 9, 14, 77, 79, 84, 103, 108, 127, 137, 171, 177, 178, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 271, 273, 339, 343, 503, 639, 798], xe = [14, 77, 79, 84, 103, 108, 127, 137, 171, 177, 178, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 271, 273, 339, 343, 503, 639, 798], S2 = [1, 772], H4 = [2, 206], Y4 = [1, 781], ut = [14, 77, 84, 103, 108, 127, 137, 171, 177, 178, 192, 252, 271, 273, 339, 343, 503, 639, 798], vr = [2, 176], Sr = [1, 784], W4 = [2, 4, 5, 6, 7, 8, 9, 121, 229, 281], B2 = [14, 77, 84, 127, 271, 273, 339, 343, 503, 639, 798], f3 = [1, 798], c3 = [1, 817], h3 = [1, 797], d32 = [1, 796], p3 = [1, 791], b3 = [1, 792], g3 = [1, 794], E3 = [1, 795], m3 = [1, 799], v3 = [1, 800], S3 = [1, 801], T3 = [1, 802], A3 = [1, 803], N3 = [1, 804], O3 = [1, 805], C3 = [1, 806], R3 = [1, 807], k3 = [1, 808], I32 = [1, 809], w3 = [1, 810], _3 = [1, 811], x3 = [1, 812], D3 = [1, 813], L3 = [1, 814], V3 = [1, 816], M3 = [1, 818], U3 = [1, 819], F3 = [1, 820], P3 = [1, 821], G3 = [1, 822], y3 = [1, 823], B3 = [1, 824], J3 = [1, 827], j3 = [1, 828], H3 = [1, 829], Y3 = [1, 830], W3 = [1, 831], X3 = [1, 832], K3 = [1, 833], q3 = [1, 834], Q3 = [1, 835], z3 = [1, 836], Z3 = [1, 838], $3 = [1, 839], e2 = [1, 837], At = [79, 83, 96, 198], X4 = [14, 83, 96, 137, 152, 154, 155, 158, 161, 190, 198, 335, 339, 343, 378, 379, 457, 461, 503, 639, 798], De = [14, 79, 84, 163, 196, 250, 330, 339, 343, 378, 391, 403, 404, 407, 408, 639, 798], t2 = [1, 858], K4 = [14, 79, 84, 333, 339, 343, 639, 798], be = [1, 859], q4 = [1, 866], Q4 = [1, 867], Tr = [1, 871], ye = [14, 79, 84, 339, 343, 639, 798], ft = [2, 4, 5, 6, 7, 8, 9, 83, 140, 141, 146, 152, 154, 158, 161, 163, 165, 188, 189, 190, 229, 266, 267, 281, 292, 293, 294, 298, 299, 301, 304, 313, 314, 315, 316, 317, 318, 319, 320, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 335, 336, 345, 350, 457, 461], Nt = [14, 77, 84, 103, 108, 116, 127, 137, 171, 177, 178, 192, 207, 252, 271, 273, 339, 343, 503, 639, 798], ct = [2, 4, 5, 6, 7, 8, 9, 14, 77, 83, 84, 103, 108, 116, 127, 137, 140, 141, 146, 152, 154, 158, 161, 163, 165, 171, 173, 177, 178, 188, 189, 190, 192, 194, 196, 204, 207, 229, 252, 266, 267, 271, 273, 281, 292, 293, 294, 298, 299, 301, 304, 313, 314, 315, 316, 317, 318, 319, 320, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 335, 336, 339, 343, 345, 350, 457, 461, 503, 639, 798], s3 = [14, 77, 84, 339, 343, 503, 639, 798], Ar = [2, 274], Nr = [1, 884], Or = [1, 885], Gn = [2, 4, 5, 6, 7, 8, 9, 141, 329], z4 = [1, 915], Z4 = [14, 79, 82, 84, 339, 343, 639, 798], Cr = [2, 783], yn = [14, 79, 82, 84, 141, 148, 150, 154, 161, 339, 343, 457, 461, 639, 798], $4 = [2, 1238], Bn = [14, 79, 82, 84, 148, 150, 154, 161, 339, 343, 457, 461, 639, 798], O2 = [14, 79, 82, 84, 148, 150, 154, 339, 343, 457, 461, 639, 798], ei = [14, 79, 84, 148, 150, 339, 343, 639, 798], Rr = [14, 83, 84, 96, 141, 155, 198, 329, 339, 343, 509, 639, 798], Ot = [368, 372, 373], ti = [2, 809], ni = [1, 940], ri = [1, 941], ii = [1, 942], si = [1, 943], Ct = [1, 952], Rt = [1, 951], Ke = [2, 762], qe = [1, 955], ht = [173, 175, 367], ai = [2, 468], oi = [1, 1009], li = [2, 4, 5, 6, 7, 8, 9, 83, 140, 165, 293, 322, 323, 324, 325, 326], ui = [1, 1027], fi = [1, 1026], Jn = [2, 4, 5, 6, 7, 8, 9, 14, 58, 77, 79, 82, 83, 84, 96, 103, 105, 108, 109, 116, 121, 127, 131, 133, 137, 138, 139, 140, 141, 143, 144, 146, 148, 149, 150, 151, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 188, 190, 192, 194, 196, 198, 207, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 252, 259, 266, 267, 268, 269, 271, 273, 294, 295, 304, 313, 314, 315, 316, 317, 318, 319, 320, 322, 329, 333, 339, 341, 342, 343, 344, 346, 347, 348, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 363, 364, 365, 366, 368, 372, 373, 433, 437, 438, 441, 443, 445, 446, 454, 455, 457, 461, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 503, 509, 545, 546, 555, 639, 798], kr = [2, 4, 5, 6, 7, 8, 9, 14, 58, 77, 79, 82, 83, 84, 96, 103, 105, 108, 109, 116, 121, 124, 125, 127, 131, 132, 133, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 188, 189, 190, 192, 194, 196, 198, 207, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 252, 259, 266, 267, 268, 269, 271, 273, 294, 295, 304, 313, 314, 315, 316, 317, 318, 319, 320, 322, 329, 333, 339, 341, 342, 343, 344, 345, 346, 347, 348, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 363, 364, 365, 366, 368, 372, 373, 433, 437, 438, 441, 443, 445, 446, 454, 455, 457, 461, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 503, 509, 545, 546, 555, 639, 798], ci = [2, 399], hi = [1, 1038], Ir = [339, 341, 343], di = [79, 333], C2 = [79, 333, 463], pi = [1, 1046], bi = [2, 4, 5, 6, 7, 8, 9, 14, 58, 77, 79, 82, 83, 84, 96, 103, 105, 108, 109, 116, 121, 124, 127, 131, 132, 133, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 188, 189, 190, 192, 194, 196, 198, 207, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 252, 259, 266, 267, 268, 269, 271, 273, 294, 295, 304, 313, 314, 315, 316, 317, 318, 319, 320, 322, 329, 333, 339, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 363, 364, 365, 366, 368, 372, 373, 433, 437, 438, 441, 443, 445, 446, 454, 455, 457, 461, 463, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 503, 509, 545, 546, 555, 639, 798], et = [79, 463], dt = [1, 1065], pt = [1, 1064], J2 = [1, 1072], kt = [14, 77, 84, 103, 108, 127, 137, 171, 177, 178, 252, 271, 273, 339, 343, 503, 639, 798], gi = [2, 186], Ei = [1, 1085], mi = [1, 1095], It = [2, 84], n2 = [1, 1102], r2 = [1, 1103], i2 = [1, 1104], Ae = [2, 4, 5, 6, 7, 8, 9, 14, 77, 79, 82, 83, 84, 121, 124, 125, 127, 131, 132, 133, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 188, 189, 190, 192, 194, 196, 207, 266, 267, 304, 313, 314, 315, 316, 317, 318, 319, 320, 339, 343, 457, 461, 503, 639, 798], wt = [1, 1157], _t2 = [1, 1156], vi = [1, 1171], Si = [1, 1170], xt = [1, 1178], j2 = [14, 77, 79, 84, 103, 108, 116, 127, 137, 171, 177, 178, 192, 207, 252, 271, 273, 339, 343, 503, 639, 798], sn = [2, 348], an = [1, 1203], wr = [1, 1219], Ti = [14, 83, 84, 96, 155, 198, 339, 343, 509, 639, 798], Ai = [1, 1239], Ni = [1, 1238], Oi = [1, 1237], Dt = [2, 4, 5, 6, 7, 8, 9, 14, 58, 77, 79, 82, 83, 84, 96, 103, 105, 108, 109, 116, 121, 124, 125, 127, 131, 132, 133, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 188, 189, 190, 192, 194, 196, 198, 207, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 250, 252, 259, 266, 267, 268, 269, 271, 273, 294, 295, 304, 313, 314, 315, 316, 317, 318, 319, 320, 322, 329, 330, 333, 339, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 363, 364, 365, 366, 368, 372, 373, 378, 391, 403, 404, 407, 408, 433, 437, 438, 441, 443, 445, 446, 454, 455, 457, 461, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 503, 509, 545, 546, 555, 639, 798], Ci = [1, 1254], jn = [2, 4, 5, 6, 7, 8, 9, 14, 58, 77, 79, 82, 83, 84, 96, 103, 105, 108, 109, 116, 121, 127, 131, 133, 137, 138, 139, 140, 141, 143, 144, 146, 148, 149, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 190, 192, 194, 196, 198, 207, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 252, 259, 266, 267, 268, 269, 271, 273, 294, 295, 304, 313, 314, 315, 316, 317, 318, 319, 320, 322, 329, 333, 339, 341, 342, 343, 344, 346, 347, 348, 353, 354, 355, 356, 357, 358, 359, 363, 364, 365, 366, 368, 372, 373, 433, 437, 438, 441, 443, 445, 446, 454, 455, 457, 461, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 503, 509, 545, 546, 555, 639, 798], Ri = [2, 4, 5, 6, 7, 8, 9, 14, 58, 77, 79, 82, 83, 84, 96, 103, 105, 108, 109, 116, 121, 127, 131, 133, 137, 138, 139, 140, 141, 143, 144, 146, 148, 149, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 190, 192, 194, 196, 198, 207, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 252, 259, 266, 267, 268, 269, 271, 273, 294, 295, 304, 313, 314, 315, 316, 317, 318, 319, 320, 322, 329, 333, 339, 341, 342, 343, 344, 346, 348, 353, 354, 355, 356, 357, 358, 359, 363, 364, 365, 366, 368, 372, 373, 433, 437, 438, 441, 443, 445, 446, 454, 455, 457, 461, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 503, 509, 545, 546, 555, 639, 798], _r2 = [2, 4, 5, 6, 7, 8, 9, 14, 58, 77, 79, 82, 83, 84, 96, 103, 105, 108, 109, 116, 121, 127, 131, 133, 137, 138, 139, 140, 141, 142, 143, 144, 146, 147, 148, 149, 150, 151, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 188, 189, 190, 192, 194, 196, 198, 207, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 252, 259, 266, 267, 268, 269, 271, 273, 294, 295, 304, 313, 314, 315, 316, 317, 318, 319, 320, 322, 329, 333, 339, 341, 342, 343, 344, 346, 347, 348, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 363, 364, 365, 366, 368, 372, 373, 433, 437, 438, 441, 443, 445, 446, 454, 455, 457, 461, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 503, 509, 545, 546, 555, 639, 798], Hn = [2, 4, 5, 6, 7, 8, 9, 14, 58, 77, 79, 82, 83, 84, 96, 103, 105, 108, 109, 116, 121, 127, 131, 133, 137, 138, 139, 140, 141, 143, 144, 146, 148, 149, 150, 151, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 190, 192, 194, 196, 198, 207, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 252, 259, 266, 267, 268, 269, 271, 273, 294, 295, 304, 313, 314, 315, 316, 317, 318, 319, 320, 322, 329, 333, 339, 341, 342, 343, 344, 346, 347, 348, 351, 352, 353, 354, 355, 356, 357, 358, 359, 363, 364, 365, 366, 368, 372, 373, 433, 437, 438, 441, 443, 445, 446, 454, 455, 457, 461, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 503, 509, 545, 546, 555, 639, 798], L2 = [2, 4, 5, 6, 7, 8, 9, 14, 58, 77, 79, 82, 83, 84, 96, 103, 105, 108, 109, 116, 127, 131, 133, 137, 138, 139, 140, 141, 143, 144, 146, 148, 149, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 190, 192, 194, 196, 198, 207, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 252, 259, 266, 267, 268, 269, 271, 273, 294, 295, 304, 313, 314, 315, 316, 317, 318, 319, 320, 322, 329, 333, 339, 341, 342, 343, 347, 353, 354, 355, 356, 357, 358, 359, 363, 364, 366, 368, 372, 373, 433, 437, 438, 441, 443, 445, 446, 454, 455, 457, 461, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 503, 509, 545, 546, 555, 639, 798], ki = [2, 430], xr = [2, 4, 5, 6, 7, 8, 9, 14, 58, 77, 79, 82, 83, 84, 96, 103, 105, 108, 116, 127, 131, 137, 138, 139, 140, 141, 143, 144, 146, 152, 154, 155, 157, 158, 159, 161, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 190, 192, 194, 196, 198, 207, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 252, 259, 266, 267, 268, 269, 271, 273, 294, 295, 304, 313, 314, 315, 316, 317, 318, 319, 320, 322, 329, 333, 339, 341, 342, 343, 347, 363, 364, 366, 368, 372, 373, 433, 437, 438, 441, 443, 445, 446, 454, 455, 457, 461, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 503, 509, 545, 546, 555, 639, 798], Ii = [2, 320], Dr = [9, 84], wi = [2, 352], _i = [1, 1272], xi = [2, 296], Lt = [2, 4, 5, 6, 7, 8, 9, 14, 58, 77, 79, 82, 83, 84, 96, 103, 105, 108, 109, 116, 121, 124, 125, 127, 131, 132, 133, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 188, 189, 190, 192, 194, 196, 198, 207, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 252, 259, 266, 267, 268, 269, 271, 273, 294, 295, 304, 313, 314, 315, 316, 317, 318, 319, 320, 322, 329, 333, 339, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 363, 364, 365, 366, 368, 372, 373, 433, 437, 438, 441, 443, 445, 446, 454, 455, 457, 461, 463, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 503, 509, 545, 546, 555, 639, 798], Ce = [14, 84, 339, 343, 639, 798], c2 = [1, 1298], Di = [14, 83, 84, 152, 154, 161, 190, 335, 339, 343, 457, 461, 503, 639, 798], Vt = [14, 79, 84, 339, 341, 343, 503, 639, 798], Li = [1, 1316], Vi = [1, 1319], Mi = [2, 1146], T2 = [14, 77, 84, 127, 137, 171, 177, 178, 252, 271, 273, 339, 343, 503, 639, 798], Ui = [1, 1325], Fi = [1, 1326], Yn = [14, 77, 79, 84, 103, 108, 127, 137, 171, 177, 178, 192, 207, 252, 271, 273, 339, 343, 503, 639, 798], a3 = [2, 4, 5, 6, 7, 8, 9, 77, 82, 83, 84, 121, 124, 125, 127, 131, 132, 133, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 194, 196, 266, 267, 304, 313, 314, 315, 316, 317, 318, 319, 320, 457, 461], H2 = [2, 4, 5, 6, 7, 8, 9, 77, 79, 82, 83, 84, 121, 124, 125, 127, 131, 132, 133, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 194, 196, 266, 267, 304, 313, 314, 315, 316, 317, 318, 319, 320, 457, 461], Mt = [2, 1140], Pi = [2, 4, 5, 6, 7, 8, 9, 77, 79, 82, 83, 121, 124, 125, 127, 131, 132, 133, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 194, 196, 266, 267, 304, 313, 314, 315, 316, 317, 318, 319, 320, 457, 461], Y2 = [1, 1372], o3 = [14, 77, 79, 84, 103, 108, 127, 137, 171, 177, 178, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 252, 271, 273, 339, 343, 503, 639, 798], Gi = [2, 518], on = [1, 1375], Wn = [14, 79, 84, 137, 339, 341, 343, 503, 639, 798], ln = [124, 125, 133], bt = [1, 1392], W2 = [9, 14, 77, 79, 84, 271, 273, 339, 343, 503, 639, 798], Lr = [2, 622], Vr = [1, 1413], yi = [82, 148], Bi = [2, 769], Ji = [1, 1430], ji = [1, 1431], Mr = [2, 4, 5, 6, 7, 8, 9, 14, 58, 77, 82, 83, 96, 133, 155, 165, 198, 250, 294, 295, 322, 339, 343, 368, 372, 373, 433, 437, 438, 441, 443, 445, 446, 454, 455, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 545, 546, 555, 639, 798], Hi = [1, 1460], Yi = [2, 354], Ur = [1, 1477], n3 = [79, 84], Fr = [1, 1486], r3 = [14, 339, 341, 343, 503, 639, 798], Pr = [14, 77, 84, 127, 171, 177, 178, 252, 271, 273, 339, 343, 503, 639, 798], Wi = [2, 237], Xi = [1, 1496], Gr = [1, 1500], Xn = [1, 1504], Kn = [1, 1505], qn = [1, 1507], un = [1, 1508], fn = [1, 1509], cn = [1, 1510], hn = [1, 1511], dn = [1, 1512], pn = [1, 1513], bn = [1, 1514], Ut = [1, 1538], yr = [84, 127], tt = [14, 77, 84, 127, 171, 177, 178, 271, 273, 339, 343, 503, 639, 798], Ki = [2, 239], qi = [1, 1642], Qi = [1, 1658], zi = [1, 1660], p2 = [2, 4, 5, 6, 7, 8, 9, 83, 152, 154, 161, 165, 190, 293, 322, 323, 324, 325, 326, 335, 457, 461], Zi = [1, 1697], $i = [1, 1699], es = [1, 1700], ts = [1, 1696], ns = [1, 1695], rs = [1, 1694], Br = [1, 1701], is = [1, 1691], ss = [1, 1692], as = [1, 1693], os = [1, 1723], Jr = [2, 4, 5, 6, 7, 8, 9, 14, 58, 77, 83, 96, 133, 155, 165, 198, 294, 295, 322, 339, 343, 368, 372, 373, 433, 437, 438, 441, 443, 445, 446, 454, 455, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 545, 546, 555, 639, 798], jr = [1, 1746], Hr = [1, 1745], Ft = [1, 1797], Pt = [1, 1798], Gt = [1, 1796], ls = [1, 1812], us = [1, 1814], fs = [1, 1811], cs = [1, 1813], Qn = [196, 202, 403, 404, 407], Yr = [2, 546], Wr = [1, 1819], gn = [1, 1836], hs = [14, 77, 84, 339, 343, 452, 503, 639, 798], ds = [1, 1859], En = [1, 1866], yt = [14, 77, 79, 84, 127, 171, 177, 178, 259, 271, 273, 339, 343, 503, 639, 798], Bt = [4, 14, 269, 339, 343, 378, 391, 639, 798], Xr = [2, 249], Kr = [1, 1903], zn = [14, 79, 84, 163, 196, 330, 339, 343, 378, 391, 403, 404, 407, 408, 639, 798], qr = [2, 552], Qr = [1, 1918], ps = [1, 1966], bs = [1, 1965], gs = [1, 1987], Es = [1, 1998], ms = [1, 1997], vs = [1, 1999], Ss = [1, 2e3], Zn = [1, 2007], $n = [1, 2024], zr = [14, 79, 84, 250, 339, 343, 639, 798], er = { trace: function() {
          }, yy: {}, symbols_: { error: 2, Literal: 3, LITERAL: 4, BRALITERAL: 5, KEY: 6, OPEN: 7, CLOSE: 8, SEPARATOR: 9, NonReserved: 10, LiteralWithSpaces: 11, main: 12, Statements: 13, EOF: 14, Statements_group0: 15, AStatement: 16, ExplainStatement: 17, EXPLAIN: 18, QUERY: 19, PLAN: 20, Statement: 21, AlterTable: 22, AttachDatabase: 23, Call: 24, CreateDatabase: 25, CreateIndex: 26, CreateGraph: 27, CreateTable: 28, CreateView: 29, CreateEdge: 30, CreateVertex: 31, Declare: 32, Delete: 33, DetachDatabase: 34, DropDatabase: 35, DropIndex: 36, DropTable: 37, DropView: 38, If: 39, Insert: 40, Merge: 41, Reindex: 42, RenameTable: 43, Select: 44, ParenthesizedSelect: 45, ShowCreateTable: 46, ShowColumns: 47, ShowDatabases: 48, ShowIndex: 49, ShowTables: 50, TruncateTable: 51, WithSelect: 52, CreateTrigger: 53, DropTrigger: 54, BeginTransaction: 55, CommitTransaction: 56, RollbackTransaction: 57, EndTransaction: 58, UseDatabase: 59, Update: 60, JavaScript: 61, Source: 62, Assert: 63, While: 64, Continue: 65, Break: 66, BeginEnd: 67, Print: 68, Require: 69, SetVariable: 70, ExpressionStatement: 71, AddRule: 72, Query: 73, Echo: 74, CreateFunction: 75, CreateAggregate: 76, WITH: 77, WithTablesList: 78, COMMA: 79, WithTable: 80, RECURSIVE: 81, AS: 82, LPAR: 83, RPAR: 84, ColumnsList: 85, SelectClause: 86, Select_option0: 87, IntoClause: 88, FromClause: 89, Select_option1: 90, WhereClause: 91, GroupClause: 92, UnionClause: 93, OrderClause: 94, LimitClause: 95, SEARCH: 96, Select_repetition0: 97, Select_option2: 98, SelectWithoutOrderOrLimit: 99, SelectWithoutOrderOrLimit_option0: 100, SelectWithoutOrderOrLimit_option1: 101, PivotClause: 102, PIVOT: 103, Expression: 104, FOR: 105, PivotClause_option0: 106, PivotClause_option1: 107, UNPIVOT: 108, IN: 109, PivotClause_option2: 110, PivotClause2: 111, AsList: 112, AsLiteral: 113, AsPart: 114, RemoveClause: 115, REMOVE: 116, RemoveClause_option0: 117, RemoveColumnsList: 118, RemoveColumn: 119, Column: 120, LIKE: 121, StringValue: 122, ArrowDot: 123, ARROW: 124, DOT: 125, SearchSelector: 126, ORDER: 127, BY: 128, OrderExpressionsList: 129, SearchSelector_option0: 130, DOTDOT: 131, CARET: 132, EQ: 133, SearchSelector_repetition_plus0: 134, SearchSelector_repetition_plus1: 135, SearchSelector_option1: 136, WHERE: 137, OF: 138, CLASS: 139, NUMBER: 140, STRING: 141, SLASH: 142, VERTEX: 143, EDGE: 144, EXCLAMATION: 145, SHARP: 146, MODULO: 147, GT: 148, LT: 149, GTGT: 150, LTLT: 151, DOLLAR: 152, Json: 153, AT: 154, SET: 155, SetColumnsList: 156, TO: 157, VALUE: 158, ROW: 159, ExprList: 160, COLON: 161, PlusStar: 162, NOT: 163, SearchSelector_repetition2: 164, IF: 165, SearchSelector_repetition3: 166, Aggregator: 167, SearchSelector_repetition4: 168, SearchSelector_group0: 169, SearchSelector_repetition5: 170, UNION: 171, SearchSelectorList: 172, ALL: 173, SearchSelector_repetition6: 174, ANY: 175, SearchSelector_repetition7: 176, INTERSECT: 177, EXCEPT: 178, AND: 179, OR: 180, PATH: 181, RETURN: 182, ResultColumns: 183, REPEAT: 184, SearchSelector_repetition8: 185, SearchSelectorList_repetition0: 186, SearchSelectorList_repetition1: 187, PLUS: 188, STAR: 189, QUESTION: 190, SearchFrom: 191, FROM: 192, SelectModifier: 193, DISTINCT: 194, TopClause: 195, UNIQUE: 196, SelectClause_option0: 197, SELECT: 198, COLUMN: 199, MATRIX: 200, TEXTSTRING: 201, INDEX: 202, RECORDSET: 203, TOP: 204, NumValue: 205, TopClause_option0: 206, INTO: 207, Table: 208, FuncValue: 209, ParamValue: 210, VarValue: 211, FromTablesList: 212, JoinTablesList: 213, ApplyClause: 214, CROSS: 215, APPLY: 216, OUTER: 217, FromTable: 218, FromTable_option0: 219, FromTable_option1: 220, FromTable_option2: 221, FromTable_option3: 222, INDEXED: 223, FromTable_option4: 224, FromTable_option5: 225, FromTable_option6: 226, FromString: 227, FromTable_option7: 228, INSERTED: 229, FromTableAlias: 230, TargetTable: 231, JoinTable: 232, JoinMode: 233, JoinTableAs: 234, OnClause: 235, JoinTableAs_option0: 236, JoinTableAs_option1: 237, JoinTableAs_option2: 238, JoinTableAs_option3: 239, JoinTableAs_option4: 240, JoinModeMode: 241, NATURAL: 242, JOIN: 243, INNER: 244, LEFT: 245, RIGHT: 246, FULL: 247, SEMI: 248, ANTI: 249, ON: 250, USING: 251, GROUP: 252, GroupExpressionsList: 253, HavingClause: 254, ROLLUP: 255, CUBE: 256, GroupExpression: 257, GROUPING: 258, HAVING: 259, UnionOp: 260, UnionableSelect: 261, CORRESPONDING: 262, OrderExpression: 263, NullsOrder: 264, NULLS: 265, FIRST: 266, LAST: 267, DIRECTION: 268, COLLATE: 269, NOCASE: 270, LIMIT: 271, OffsetClause: 272, OFFSET: 273, LimitClause_option0: 274, FETCH: 275, LimitClause_option1: 276, LimitClause_option2: 277, LimitClause_option3: 278, ResultColumn: 279, Star: 280, DELETED: 281, AggrValue: 282, Op: 283, LogicValue: 284, NullValue: 285, ExistsValue: 286, CaseValue: 287, CastClause: 288, ArrayValue: 289, NewClause: 290, Expression_group0: 291, CURRENT_TIMESTAMP: 292, CURRENT_DATE: 293, JAVASCRIPT: 294, CREATE: 295, FUNCTION: 296, AGGREGATE: 297, NEW: 298, CAST: 299, ColumnType: 300, CONVERT: 301, PrimitiveValue: 302, OverClause: 303, GROUP_CONCAT: 304, GroupConcatOrderClause: 305, GroupConcatSeparatorClause: 306, OVER: 307, OverClause_option0: 308, OverClause_option1: 309, OverPartitionClause: 310, PARTITION: 311, OverOrderByClause: 312, SUM: 313, TOTAL: 314, COUNT: 315, MIN: 316, MAX: 317, AVG: 318, AGGR: 319, ARRAY: 320, FuncValue_option0: 321, REPLACE: 322, DATEADD: 323, DATEDIFF: 324, TIMESTAMPDIFF: 325, INTERVAL: 326, TRUE: 327, FALSE: 328, NSTRING: 329, NULL: 330, EXISTS: 331, ARRAYLBRA: 332, RBRA: 333, ParamValue_group0: 334, BRAQUESTION: 335, CASE: 336, WhensList: 337, ElseClause: 338, END: 339, When: 340, WHEN: 341, THEN: 342, ELSE: 343, REGEXP: 344, TILDA: 345, GLOB: 346, ESCAPE: 347, NOT_LIKE: 348, BARBAR: 349, MINUS: 350, AMPERSAND: 351, BAR: 352, GE: 353, LE: 354, EQEQ: 355, EQEQEQ: 356, NE: 357, NEEQEQ: 358, NEEQEQEQ: 359, CondOp: 360, AllSome: 361, ColFunc: 362, BETWEEN: 363, NOT_BETWEEN: 364, IS: 365, DOUBLECOLON: 366, SOME: 367, UPDATE: 368, OutputClause: 369, SetColumn: 370, SetColumn_group0: 371, DELETE: 372, INSERT: 373, Into: 374, Values: 375, ValuesListsList: 376, IGNORE: 377, DEFAULT: 378, VALUES: 379, ValuesList: 380, Value: 381, DateValue: 382, TemporaryClause: 383, TableClass: 384, IfNotExists: 385, CreateTableDefClause: 386, CreateTableOptionsClause: 387, TABLE: 388, CreateTableOptions: 389, CreateTableOption: 390, IDENTITY: 391, TEMP: 392, ColumnDefsList: 393, ConstraintsList: 394, Constraint: 395, ConstraintName: 396, PrimaryKey: 397, ForeignKey: 398, UniqueKey: 399, IndexKey: 400, Check: 401, CONSTRAINT: 402, CHECK: 403, PRIMARY: 404, PrimaryKey_option0: 405, ColsList: 406, FOREIGN: 407, REFERENCES: 408, ForeignKey_option0: 409, OnReferentialActions: 410, ParColsList: 411, OnDeleteClause: 412, OnUpdateClause: 413, ReferentialAction: 414, CASCADE: 415, RESTRICT: 416, NO: 417, ACTION: 418, UniqueKey_option0: 419, UniqueKey_option1: 420, ColumnDef: 421, ColumnConstraintsClause: 422, ColumnConstraints: 423, SingularColumnType: 424, NumberMax: 425, ENUM: 426, MAXNUM: 427, ColumnConstraintsList: 428, ColumnConstraint: 429, ParLiteral: 430, ColumnConstraint_option0: 431, ColumnConstraint_option1: 432, DROP: 433, DropTable_group0: 434, IfExists: 435, TablesList: 436, ALTER: 437, RENAME: 438, ADD: 439, MODIFY: 440, ATTACH: 441, DATABASE: 442, DETACH: 443, AsClause: 444, USE: 445, SHOW: 446, VIEW: 447, CreateView_option0: 448, CreateView_option1: 449, SubqueryRestriction: 450, READ: 451, ONLY: 452, OPTION: 453, SOURCE: 454, ASSERT: 455, JsonObject: 456, ATLBRA: 457, JsonArray: 458, JsonValue: 459, JsonPrimitiveValue: 460, LCUR: 461, JsonPropertiesList: 462, RCUR: 463, JsonElementsList: 464, JsonProperty: 465, COLONDASH: 466, OnOff: 467, SetPropsList: 468, AtDollar: 469, SetProp: 470, OFF: 471, COMMIT: 472, TRANSACTION: 473, ROLLBACK: 474, BEGIN: 475, ElseStatement: 476, WHILE: 477, CONTINUE: 478, ITERATE: 479, BREAK: 480, LEAVE: 481, PRINT: 482, REQUIRE: 483, StringValuesList: 484, PluginsList: 485, Plugin: 486, ECHO: 487, DECLARE: 488, DeclaresList: 489, DeclareItem: 490, TRUNCATE: 491, MERGE: 492, MergeInto: 493, MergeUsing: 494, MergeOn: 495, MergeMatchedList: 496, MergeMatched: 497, MergeNotMatched: 498, MATCHED: 499, MergeMatchedAction: 500, MergeNotMatchedAction: 501, TARGET: 502, OUTPUT: 503, CreateVertex_option0: 504, CreateVertex_option1: 505, CreateVertex_option2: 506, CreateVertexSet: 507, SharpValue: 508, CONTENT: 509, CreateEdge_option0: 510, GRAPH: 511, GraphList: 512, GraphVertexEdge: 513, GraphElement: 514, GraphVertexEdge_option0: 515, GraphVertexEdge_option1: 516, GraphElementVar: 517, GraphVertexEdge_option2: 518, GraphVertexEdge_option3: 519, GraphVertexEdge_option4: 520, GraphVar: 521, GraphAsClause: 522, GraphAtClause: 523, GraphElement2: 524, GraphElement2_option0: 525, GraphElement2_option1: 526, GraphElement2_option2: 527, GraphElement2_option3: 528, GraphElement_option0: 529, GraphElement_option1: 530, GraphElement_option2: 531, SharpLiteral: 532, GraphElement_option3: 533, GraphElement_option4: 534, GraphElement_option5: 535, ColonLiteral: 536, DeleteVertex: 537, DeleteVertex_option0: 538, DeleteEdge: 539, DeleteEdge_option0: 540, DeleteEdge_option1: 541, DeleteEdge_option2: 542, Term: 543, TermsList: 544, QUESTIONDASH: 545, CALL: 546, TRIGGER: 547, BeforeAfter: 548, InsertDeleteUpdate: 549, CreateTrigger_option0: 550, CreateTrigger_option1: 551, BEFORE: 552, AFTER: 553, INSTEAD: 554, REINDEX: 555, A: 556, ABSENT: 557, ABSOLUTE: 558, ACCORDING: 559, ADA: 560, ADMIN: 561, ALWAYS: 562, ASC: 563, ASSERTION: 564, ASSIGNMENT: 565, ATTRIBUTE: 566, ATTRIBUTES: 567, BASE64: 568, BERNOULLI: 569, BLOCKED: 570, BOM: 571, BREADTH: 572, C: 573, CATALOG: 574, CATALOG_NAME: 575, CHAIN: 576, CHARACTERISTICS: 577, CHARACTERS: 578, CHARACTER_SET_CATALOG: 579, CHARACTER_SET_NAME: 580, CHARACTER_SET_SCHEMA: 581, CLASS_ORIGIN: 582, COBOL: 583, COLLATION: 584, COLLATION_CATALOG: 585, COLLATION_NAME: 586, COLLATION_SCHEMA: 587, COLUMNS: 588, COLUMN_NAME: 589, COMMAND_FUNCTION: 590, COMMAND_FUNCTION_CODE: 591, COMMITTED: 592, CONDITION_NUMBER: 593, CONNECTION: 594, CONNECTION_NAME: 595, CONSTRAINTS: 596, CONSTRAINT_CATALOG: 597, CONSTRAINT_NAME: 598, CONSTRAINT_SCHEMA: 599, CONSTRUCTOR: 600, CONTROL: 601, CURSOR_NAME: 602, DATA: 603, DATETIME_INTERVAL_CODE: 604, DATETIME_INTERVAL_PRECISION: 605, DB: 606, DEFAULTS: 607, DEFERRABLE: 608, DEFERRED: 609, DEFINED: 610, DEFINER: 611, DEGREE: 612, DEPTH: 613, DERIVED: 614, DESC: 615, DESCRIPTOR: 616, DIAGNOSTICS: 617, DISPATCH: 618, DOCUMENT: 619, DOMAIN: 620, DYNAMIC_FUNCTION: 621, DYNAMIC_FUNCTION_CODE: 622, EMPTY: 623, ENCODING: 624, ENFORCED: 625, EXCLUDE: 626, EXCLUDING: 627, EXPRESSION: 628, FILE: 629, FINAL: 630, FLAG: 631, FOLLOWING: 632, FORTRAN: 633, FOUND: 634, FS: 635, G: 636, GENERAL: 637, GENERATED: 638, GO: 639, GOTO: 640, GRANTED: 641, HEX: 642, HIERARCHY: 643, ID: 644, IMMEDIATE: 645, IMMEDIATELY: 646, IMPLEMENTATION: 647, INCLUDING: 648, INCREMENT: 649, INDENT: 650, INITIALLY: 651, INPUT: 652, INSTANCE: 653, INSTANTIABLE: 654, INTEGRITY: 655, INVOKER: 656, ISOLATION: 657, K: 658, KEY_MEMBER: 659, KEY_TYPE: 660, LENGTH: 661, LEVEL: 662, LIBRARY: 663, LINK: 664, LOCATION: 665, LOCATOR: 666, M: 667, MAP: 668, MAPPING: 669, MAXVALUE: 670, MESSAGE_LENGTH: 671, MESSAGE_OCTET_LENGTH: 672, MESSAGE_TEXT: 673, MINVALUE: 674, MORE: 675, MUMPS: 676, NAME: 677, NAMES: 678, NAMESPACE: 679, NESTING: 680, NEXT: 681, NFC: 682, NFD: 683, NFKC: 684, NFKD: 685, NIL: 686, NORMALIZED: 687, NULLABLE: 688, OBJECT: 689, OCTETS: 690, OPTIONS: 691, ORDERING: 692, ORDINALITY: 693, OTHERS: 694, OVERRIDING: 695, P: 696, PAD: 697, PARAMETER_MODE: 698, PARAMETER_NAME: 699, PARAMETER_ORDINAL_POSITION: 700, PARAMETER_SPECIFIC_CATALOG: 701, PARAMETER_SPECIFIC_NAME: 702, PARAMETER_SPECIFIC_SCHEMA: 703, PARTIAL: 704, PASCAL: 705, PASSING: 706, PASSTHROUGH: 707, PERMISSION: 708, PLACING: 709, PLI: 710, PRECEDING: 711, PRESERVE: 712, PRIOR: 713, PRIVILEGES: 714, PUBLIC: 715, RECOVERY: 716, RELATIVE: 717, REPEATABLE: 718, REQUIRING: 719, RESPECT: 720, RESTART: 721, RESTORE: 722, RETURNED_CARDINALITY: 723, RETURNED_LENGTH: 724, RETURNED_OCTET_LENGTH: 725, RETURNED_SQLSTATE: 726, RETURNING: 727, ROLE: 728, ROUTINE: 729, ROUTINE_CATALOG: 730, ROUTINE_NAME: 731, ROUTINE_SCHEMA: 732, ROW_COUNT: 733, SCALE: 734, SCHEMA: 735, SCHEMA_NAME: 736, SCOPE_CATALOG: 737, SCOPE_NAME: 738, SCOPE_SCHEMA: 739, SECTION: 740, SECURITY: 741, SELECTIVE: 742, SELF: 743, SEQUENCE: 744, SERIALIZABLE: 745, SERVER: 746, SERVER_NAME: 747, SESSION: 748, SETS: 749, SIMPLE: 750, SIZE: 751, SPACE: 752, SPECIFIC_NAME: 753, STANDALONE: 754, STATE: 755, STATEMENT: 756, STRIP: 757, STRUCTURE: 758, STYLE: 759, SUBCLASS_ORIGIN: 760, T: 761, TABLE_NAME: 762, TEMPORARY: 763, TIES: 764, TOKEN: 765, TOP_LEVEL_COUNT: 766, TRANSACTIONS_COMMITTED: 767, TRANSACTIONS_ROLLED_BACK: 768, TRANSACTION_ACTIVE: 769, TRANSFORM: 770, TRANSFORMS: 771, TRIGGER_CATALOG: 772, TRIGGER_NAME: 773, TRIGGER_SCHEMA: 774, TYPE: 775, UNBOUNDED: 776, UNCOMMITTED: 777, UNDER: 778, UNLINK: 779, UNNAMED: 780, UNTYPED: 781, URI: 782, USAGE: 783, USER_DEFINED_TYPE_CATALOG: 784, USER_DEFINED_TYPE_CODE: 785, USER_DEFINED_TYPE_NAME: 786, USER_DEFINED_TYPE_SCHEMA: 787, VALID: 788, VERSION: 789, WHITESPACE: 790, WORK: 791, WRAPPER: 792, WRITE: 793, XMLDECLARATION: 794, XMLSCHEMA: 795, YES: 796, ZONE: 797, SEMICOLON: 798, PERCENT: 799, ROWS: 800, FuncValue_option0_group0: 801, $accept: 0, $end: 1 }, terminals_: { 2: "error", 4: "LITERAL", 5: "BRALITERAL", 6: "KEY", 7: "OPEN", 8: "CLOSE", 9: "SEPARATOR", 14: "EOF", 18: "EXPLAIN", 19: "QUERY", 20: "PLAN", 58: "EndTransaction", 77: "WITH", 79: "COMMA", 81: "RECURSIVE", 82: "AS", 83: "LPAR", 84: "RPAR", 96: "SEARCH", 103: "PIVOT", 105: "FOR", 108: "UNPIVOT", 109: "IN", 116: "REMOVE", 121: "LIKE", 124: "ARROW", 125: "DOT", 127: "ORDER", 128: "BY", 131: "DOTDOT", 132: "CARET", 133: "EQ", 137: "WHERE", 138: "OF", 139: "CLASS", 140: "NUMBER", 141: "STRING", 142: "SLASH", 143: "VERTEX", 144: "EDGE", 145: "EXCLAMATION", 146: "SHARP", 147: "MODULO", 148: "GT", 149: "LT", 150: "GTGT", 151: "LTLT", 152: "DOLLAR", 154: "AT", 155: "SET", 157: "TO", 158: "VALUE", 159: "ROW", 161: "COLON", 163: "NOT", 165: "IF", 171: "UNION", 173: "ALL", 175: "ANY", 177: "INTERSECT", 178: "EXCEPT", 179: "AND", 180: "OR", 181: "PATH", 182: "RETURN", 184: "REPEAT", 188: "PLUS", 189: "STAR", 190: "QUESTION", 192: "FROM", 194: "DISTINCT", 196: "UNIQUE", 198: "SELECT", 199: "COLUMN", 200: "MATRIX", 201: "TEXTSTRING", 202: "INDEX", 203: "RECORDSET", 204: "TOP", 207: "INTO", 215: "CROSS", 216: "APPLY", 217: "OUTER", 223: "INDEXED", 229: "INSERTED", 242: "NATURAL", 243: "JOIN", 244: "INNER", 245: "LEFT", 246: "RIGHT", 247: "FULL", 248: "SEMI", 249: "ANTI", 250: "ON", 251: "USING", 252: "GROUP", 255: "ROLLUP", 256: "CUBE", 258: "GROUPING", 259: "HAVING", 262: "CORRESPONDING", 265: "NULLS", 266: "FIRST", 267: "LAST", 268: "DIRECTION", 269: "COLLATE", 270: "NOCASE", 271: "LIMIT", 273: "OFFSET", 275: "FETCH", 281: "DELETED", 292: "CURRENT_TIMESTAMP", 293: "CURRENT_DATE", 294: "JAVASCRIPT", 295: "CREATE", 296: "FUNCTION", 297: "AGGREGATE", 298: "NEW", 299: "CAST", 301: "CONVERT", 304: "GROUP_CONCAT", 307: "OVER", 311: "PARTITION", 313: "SUM", 314: "TOTAL", 315: "COUNT", 316: "MIN", 317: "MAX", 318: "AVG", 319: "AGGR", 320: "ARRAY", 322: "REPLACE", 323: "DATEADD", 324: "DATEDIFF", 325: "TIMESTAMPDIFF", 326: "INTERVAL", 327: "TRUE", 328: "FALSE", 329: "NSTRING", 330: "NULL", 331: "EXISTS", 332: "ARRAYLBRA", 333: "RBRA", 335: "BRAQUESTION", 336: "CASE", 339: "END", 341: "WHEN", 342: "THEN", 343: "ELSE", 344: "REGEXP", 345: "TILDA", 346: "GLOB", 347: "ESCAPE", 348: "NOT_LIKE", 349: "BARBAR", 350: "MINUS", 351: "AMPERSAND", 352: "BAR", 353: "GE", 354: "LE", 355: "EQEQ", 356: "EQEQEQ", 357: "NE", 358: "NEEQEQ", 359: "NEEQEQEQ", 363: "BETWEEN", 364: "NOT_BETWEEN", 365: "IS", 366: "DOUBLECOLON", 367: "SOME", 368: "UPDATE", 372: "DELETE", 373: "INSERT", 377: "IGNORE", 378: "DEFAULT", 379: "VALUES", 382: "DateValue", 388: "TABLE", 391: "IDENTITY", 392: "TEMP", 402: "CONSTRAINT", 403: "CHECK", 404: "PRIMARY", 407: "FOREIGN", 408: "REFERENCES", 415: "CASCADE", 416: "RESTRICT", 417: "NO", 418: "ACTION", 423: "ColumnConstraints", 426: "ENUM", 427: "MAXNUM", 433: "DROP", 437: "ALTER", 438: "RENAME", 439: "ADD", 440: "MODIFY", 441: "ATTACH", 442: "DATABASE", 443: "DETACH", 445: "USE", 446: "SHOW", 447: "VIEW", 451: "READ", 452: "ONLY", 453: "OPTION", 454: "SOURCE", 455: "ASSERT", 457: "ATLBRA", 461: "LCUR", 463: "RCUR", 466: "COLONDASH", 471: "OFF", 472: "COMMIT", 473: "TRANSACTION", 474: "ROLLBACK", 475: "BEGIN", 477: "WHILE", 478: "CONTINUE", 479: "ITERATE", 480: "BREAK", 481: "LEAVE", 482: "PRINT", 483: "REQUIRE", 487: "ECHO", 488: "DECLARE", 491: "TRUNCATE", 492: "MERGE", 499: "MATCHED", 502: "TARGET", 503: "OUTPUT", 509: "CONTENT", 511: "GRAPH", 545: "QUESTIONDASH", 546: "CALL", 547: "TRIGGER", 552: "BEFORE", 553: "AFTER", 554: "INSTEAD", 555: "REINDEX", 556: "A", 557: "ABSENT", 558: "ABSOLUTE", 559: "ACCORDING", 560: "ADA", 561: "ADMIN", 562: "ALWAYS", 563: "ASC", 564: "ASSERTION", 565: "ASSIGNMENT", 566: "ATTRIBUTE", 567: "ATTRIBUTES", 568: "BASE64", 569: "BERNOULLI", 570: "BLOCKED", 571: "BOM", 572: "BREADTH", 573: "C", 574: "CATALOG", 575: "CATALOG_NAME", 576: "CHAIN", 577: "CHARACTERISTICS", 578: "CHARACTERS", 579: "CHARACTER_SET_CATALOG", 580: "CHARACTER_SET_NAME", 581: "CHARACTER_SET_SCHEMA", 582: "CLASS_ORIGIN", 583: "COBOL", 584: "COLLATION", 585: "COLLATION_CATALOG", 586: "COLLATION_NAME", 587: "COLLATION_SCHEMA", 588: "COLUMNS", 589: "COLUMN_NAME", 590: "COMMAND_FUNCTION", 591: "COMMAND_FUNCTION_CODE", 592: "COMMITTED", 593: "CONDITION_NUMBER", 594: "CONNECTION", 595: "CONNECTION_NAME", 596: "CONSTRAINTS", 597: "CONSTRAINT_CATALOG", 598: "CONSTRAINT_NAME", 599: "CONSTRAINT_SCHEMA", 600: "CONSTRUCTOR", 601: "CONTROL", 602: "CURSOR_NAME", 603: "DATA", 604: "DATETIME_INTERVAL_CODE", 605: "DATETIME_INTERVAL_PRECISION", 606: "DB", 607: "DEFAULTS", 608: "DEFERRABLE", 609: "DEFERRED", 610: "DEFINED", 611: "DEFINER", 612: "DEGREE", 613: "DEPTH", 614: "DERIVED", 615: "DESC", 616: "DESCRIPTOR", 617: "DIAGNOSTICS", 618: "DISPATCH", 619: "DOCUMENT", 620: "DOMAIN", 621: "DYNAMIC_FUNCTION", 622: "DYNAMIC_FUNCTION_CODE", 623: "EMPTY", 624: "ENCODING", 625: "ENFORCED", 626: "EXCLUDE", 627: "EXCLUDING", 628: "EXPRESSION", 629: "FILE", 630: "FINAL", 631: "FLAG", 632: "FOLLOWING", 633: "FORTRAN", 634: "FOUND", 635: "FS", 636: "G", 637: "GENERAL", 638: "GENERATED", 639: "GO", 640: "GOTO", 641: "GRANTED", 642: "HEX", 643: "HIERARCHY", 644: "ID", 645: "IMMEDIATE", 646: "IMMEDIATELY", 647: "IMPLEMENTATION", 648: "INCLUDING", 649: "INCREMENT", 650: "INDENT", 651: "INITIALLY", 652: "INPUT", 653: "INSTANCE", 654: "INSTANTIABLE", 655: "INTEGRITY", 656: "INVOKER", 657: "ISOLATION", 658: "K", 659: "KEY_MEMBER", 660: "KEY_TYPE", 661: "LENGTH", 662: "LEVEL", 663: "LIBRARY", 664: "LINK", 665: "LOCATION", 666: "LOCATOR", 667: "M", 668: "MAP", 669: "MAPPING", 670: "MAXVALUE", 671: "MESSAGE_LENGTH", 672: "MESSAGE_OCTET_LENGTH", 673: "MESSAGE_TEXT", 674: "MINVALUE", 675: "MORE", 676: "MUMPS", 677: "NAME", 678: "NAMES", 679: "NAMESPACE", 680: "NESTING", 681: "NEXT", 682: "NFC", 683: "NFD", 684: "NFKC", 685: "NFKD", 686: "NIL", 687: "NORMALIZED", 688: "NULLABLE", 689: "OBJECT", 690: "OCTETS", 691: "OPTIONS", 692: "ORDERING", 693: "ORDINALITY", 694: "OTHERS", 695: "OVERRIDING", 696: "P", 697: "PAD", 698: "PARAMETER_MODE", 699: "PARAMETER_NAME", 700: "PARAMETER_ORDINAL_POSITION", 701: "PARAMETER_SPECIFIC_CATALOG", 702: "PARAMETER_SPECIFIC_NAME", 703: "PARAMETER_SPECIFIC_SCHEMA", 704: "PARTIAL", 705: "PASCAL", 706: "PASSING", 707: "PASSTHROUGH", 708: "PERMISSION", 709: "PLACING", 710: "PLI", 711: "PRECEDING", 712: "PRESERVE", 713: "PRIOR", 714: "PRIVILEGES", 715: "PUBLIC", 716: "RECOVERY", 717: "RELATIVE", 718: "REPEATABLE", 719: "REQUIRING", 720: "RESPECT", 721: "RESTART", 722: "RESTORE", 723: "RETURNED_CARDINALITY", 724: "RETURNED_LENGTH", 725: "RETURNED_OCTET_LENGTH", 726: "RETURNED_SQLSTATE", 727: "RETURNING", 728: "ROLE", 729: "ROUTINE", 730: "ROUTINE_CATALOG", 731: "ROUTINE_NAME", 732: "ROUTINE_SCHEMA", 733: "ROW_COUNT", 734: "SCALE", 735: "SCHEMA", 736: "SCHEMA_NAME", 737: "SCOPE_CATALOG", 738: "SCOPE_NAME", 739: "SCOPE_SCHEMA", 740: "SECTION", 741: "SECURITY", 742: "SELECTIVE", 743: "SELF", 744: "SEQUENCE", 745: "SERIALIZABLE", 746: "SERVER", 747: "SERVER_NAME", 748: "SESSION", 749: "SETS", 750: "SIMPLE", 751: "SIZE", 752: "SPACE", 753: "SPECIFIC_NAME", 754: "STANDALONE", 755: "STATE", 756: "STATEMENT", 757: "STRIP", 758: "STRUCTURE", 759: "STYLE", 760: "SUBCLASS_ORIGIN", 761: "T", 762: "TABLE_NAME", 763: "TEMPORARY", 764: "TIES", 765: "TOKEN", 766: "TOP_LEVEL_COUNT", 767: "TRANSACTIONS_COMMITTED", 768: "TRANSACTIONS_ROLLED_BACK", 769: "TRANSACTION_ACTIVE", 770: "TRANSFORM", 771: "TRANSFORMS", 772: "TRIGGER_CATALOG", 773: "TRIGGER_NAME", 774: "TRIGGER_SCHEMA", 775: "TYPE", 776: "UNBOUNDED", 777: "UNCOMMITTED", 778: "UNDER", 779: "UNLINK", 780: "UNNAMED", 781: "UNTYPED", 782: "URI", 783: "USAGE", 784: "USER_DEFINED_TYPE_CATALOG", 785: "USER_DEFINED_TYPE_CODE", 786: "USER_DEFINED_TYPE_NAME", 787: "USER_DEFINED_TYPE_SCHEMA", 788: "VALID", 789: "VERSION", 790: "WHITESPACE", 791: "WORK", 792: "WRAPPER", 793: "WRITE", 794: "XMLDECLARATION", 795: "XMLSCHEMA", 796: "YES", 797: "ZONE", 798: "SEMICOLON", 799: "PERCENT", 800: "ROWS" }, productions_: [0, [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 2], [11, 1], [11, 2], [12, 2], [13, 3], [13, 1], [13, 1], [17, 2], [17, 4], [16, 1], [21, 0], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 1], [52, 3], [78, 3], [78, 4], [78, 1], [78, 2], [80, 5], [80, 8], [44, 10], [44, 6], [44, 4], [44, 4], [45, 3], [45, 3], [99, 8], [102, 8], [102, 11], [111, 4], [113, 2], [113, 1], [112, 3], [112, 1], [114, 1], [114, 3], [115, 3], [118, 3], [118, 1], [119, 1], [119, 2], [123, 1], [123, 1], [126, 1], [126, 5], [126, 5], [126, 1], [126, 2], [126, 1], [126, 2], [126, 2], [126, 3], [126, 4], [126, 4], [126, 4], [126, 4], [126, 4], [126, 1], [126, 1], [126, 1], [126, 1], [126, 1], [126, 1], [126, 2], [126, 2], [126, 2], [126, 1], [126, 1], [126, 1], [126, 1], [126, 1], [126, 1], [126, 2], [126, 3], [126, 4], [126, 3], [126, 1], [126, 4], [126, 2], [126, 2], [126, 4], [126, 4], [126, 4], [126, 4], [126, 4], [126, 5], [126, 4], [126, 4], [126, 4], [126, 4], [126, 4], [126, 4], [126, 4], [126, 4], [126, 6], [172, 3], [172, 1], [162, 1], [162, 1], [162, 1], [191, 2], [86, 4], [86, 4], [86, 4], [86, 3], [193, 1], [193, 2], [193, 2], [193, 2], [193, 2], [193, 2], [193, 2], [193, 2], [195, 3], [195, 4], [195, 0], [88, 0], [88, 2], [88, 2], [88, 2], [88, 2], [88, 2], [89, 2], [89, 3], [89, 5], [89, 5], [89, 0], [214, 6], [214, 7], [214, 6], [214, 7], [212, 1], [212, 3], [218, 4], [218, 3], [218, 2], [218, 3], [218, 2], [218, 2], [218, 2], [218, 2], [218, 1], [230, 1], [230, 2], [227, 1], [208, 3], [208, 1], [231, 1], [231, 1], [213, 2], [213, 2], [213, 1], [213, 1], [232, 3], [234, 2], [234, 3], [234, 2], [234, 4], [234, 2], [234, 2], [233, 1], [233, 2], [241, 1], [241, 2], [241, 2], [241, 3], [241, 2], [241, 3], [241, 2], [241, 3], [241, 2], [241, 2], [241, 2], [235, 2], [235, 2], [235, 4], [235, 0], [91, 0], [91, 2], [92, 0], [92, 4], [92, 6], [92, 6], [253, 1], [253, 3], [257, 5], [257, 4], [257, 4], [257, 1], [254, 0], [254, 2], [93, 0], [93, 2], [260, 1], [260, 2], [260, 1], [260, 1], [260, 2], [260, 3], [260, 2], [260, 2], [261, 1], [261, 1], [94, 0], [94, 3], [129, 1], [129, 3], [264, 2], [264, 2], [263, 1], [263, 2], [263, 3], [263, 3], [263, 4], [95, 0], [95, 3], [95, 8], [272, 0], [272, 2], [183, 3], [183, 1], [279, 3], [279, 2], [279, 3], [279, 2], [279, 3], [279, 2], [279, 1], [280, 5], [280, 3], [280, 3], [280, 3], [280, 1], [120, 5], [120, 3], [120, 3], [120, 3], [120, 3], [120, 4], [120, 1], [120, 1], [120, 1], [104, 1], [104, 1], [104, 1], [104, 1], [104, 1], [104, 1], [104, 1], [104, 1], [104, 1], [104, 1], [104, 1], [104, 1], [104, 1], [104, 1], [104, 1], [104, 1], [104, 1], [104, 1], [104, 3], [104, 3], [104, 3], [104, 1], [104, 1], [104, 1], [61, 1], [75, 5], [76, 5], [290, 2], [290, 2], [288, 6], [288, 8], [288, 6], [288, 8], [302, 1], [302, 1], [302, 1], [302, 1], [302, 1], [302, 1], [302, 1], [302, 1], [282, 5], [282, 6], [282, 6], [282, 6], [282, 7], [303, 0], [303, 5], [310, 3], [312, 3], [305, 0], [305, 3], [306, 0], [306, 2], [167, 1], [167, 1], [167, 1], [167, 1], [167, 1], [167, 1], [167, 1], [167, 1], [167, 1], [167, 1], [167, 1], [209, 6], [209, 4], [209, 4], [209, 4], [209, 3], [209, 8], [209, 8], [209, 8], [209, 8], [209, 8], [209, 3], [160, 1], [160, 3], [205, 1], [284, 1], [284, 1], [122, 1], [122, 1], [285, 1], [211, 2], [286, 4], [289, 3], [210, 2], [210, 2], [210, 1], [210, 1], [287, 5], [287, 4], [337, 2], [337, 1], [340, 4], [338, 2], [338, 0], [283, 3], [283, 3], [283, 3], [283, 3], [283, 5], [283, 3], [283, 5], [283, 3], [283, 3], [283, 3], [283, 3], [283, 3], [283, 3], [283, 3], [283, 3], [283, 3], [283, 3], [283, 3], [283, 3], [283, 3], [283, 5], [283, 3], [283, 3], [283, 3], [283, 5], [283, 3], [283, 3], [283, 3], [283, 3], [283, 3], [283, 3], [283, 3], [283, 3], [283, 3], [283, 3], [283, 3], [283, 6], [283, 6], [283, 3], [283, 3], [283, 2], [283, 2], [283, 2], [283, 2], [283, 2], [283, 3], [283, 5], [283, 6], [283, 5], [283, 6], [283, 4], [283, 5], [283, 3], [283, 4], [283, 3], [283, 4], [283, 3], [283, 3], [283, 3], [283, 3], [283, 3], [362, 1], [362, 1], [362, 4], [360, 1], [360, 1], [360, 1], [360, 1], [360, 1], [360, 1], [361, 1], [361, 1], [361, 1], [60, 7], [60, 5], [156, 1], [156, 3], [370, 3], [370, 4], [33, 6], [33, 4], [40, 6], [40, 5], [40, 7], [40, 6], [40, 10], [40, 9], [40, 6], [40, 9], [40, 8], [40, 7], [40, 6], [40, 5], [40, 6], [40, 9], [40, 8], [40, 5], [40, 7], [40, 8], [40, 6], [375, 1], [375, 1], [374, 0], [374, 1], [376, 3], [376, 1], [376, 1], [376, 5], [376, 3], [376, 3], [380, 1], [380, 3], [381, 1], [381, 1], [381, 1], [381, 1], [381, 1], [381, 1], [85, 1], [85, 3], [28, 9], [28, 5], [384, 1], [384, 1], [387, 0], [387, 1], [389, 2], [389, 1], [390, 1], [390, 3], [390, 3], [390, 3], [383, 0], [383, 1], [385, 0], [385, 3], [386, 3], [386, 1], [386, 2], [394, 1], [394, 3], [395, 2], [395, 2], [395, 2], [395, 2], [395, 2], [396, 0], [396, 2], [401, 4], [397, 6], [398, 9], [411, 3], [410, 0], [410, 1], [410, 1], [410, 2], [410, 2], [412, 3], [413, 3], [414, 1], [414, 2], [414, 2], [414, 1], [414, 2], [399, 6], [400, 5], [406, 1], [406, 1], [406, 3], [406, 3], [393, 1], [393, 3], [421, 3], [421, 2], [421, 1], [424, 6], [424, 4], [424, 1], [424, 4], [300, 2], [300, 1], [425, 1], [425, 1], [422, 0], [422, 1], [428, 2], [428, 1], [430, 3], [429, 2], [429, 6], [429, 4], [429, 6], [429, 1], [429, 2], [429, 4], [429, 2], [429, 1], [429, 2], [429, 1], [429, 1], [429, 3], [429, 5], [37, 4], [436, 3], [436, 1], [435, 0], [435, 2], [22, 6], [22, 6], [22, 6], [22, 8], [22, 6], [43, 5], [23, 4], [23, 7], [23, 6], [23, 9], [34, 3], [25, 4], [25, 6], [25, 9], [25, 6], [444, 0], [444, 2], [59, 3], [59, 2], [35, 4], [35, 5], [35, 5], [26, 8], [26, 9], [36, 3], [48, 2], [48, 4], [48, 3], [48, 5], [50, 2], [50, 4], [50, 4], [50, 6], [47, 4], [47, 6], [49, 4], [49, 6], [46, 4], [46, 6], [29, 11], [29, 8], [450, 3], [450, 3], [450, 5], [38, 4], [71, 2], [62, 2], [63, 2], [63, 2], [63, 4], [153, 4], [153, 2], [153, 2], [153, 2], [153, 2], [153, 1], [153, 2], [153, 2], [459, 1], [459, 1], [460, 1], [460, 2], [460, 1], [460, 1], [460, 1], [460, 1], [460, 1], [460, 1], [460, 3], [456, 3], [456, 4], [456, 2], [458, 2], [458, 3], [458, 1], [462, 3], [462, 1], [465, 3], [465, 3], [465, 3], [465, 3], [465, 3], [465, 3], [464, 3], [464, 1], [70, 4], [70, 3], [70, 4], [70, 5], [70, 5], [70, 6], [469, 1], [469, 1], [468, 3], [468, 2], [470, 1], [470, 1], [470, 3], [467, 1], [467, 1], [56, 2], [57, 2], [55, 2], [39, 4], [39, 3], [476, 2], [64, 3], [65, 1], [65, 1], [66, 1], [66, 1], [67, 3], [68, 2], [68, 2], [69, 2], [69, 2], [486, 1], [486, 1], [74, 2], [484, 3], [484, 1], [485, 3], [485, 1], [32, 2], [489, 1], [489, 3], [490, 3], [490, 4], [490, 5], [490, 6], [51, 3], [41, 6], [493, 1], [493, 2], [494, 2], [494, 4], [495, 2], [496, 2], [496, 2], [496, 1], [496, 1], [497, 4], [497, 6], [500, 1], [500, 3], [498, 5], [498, 7], [498, 7], [498, 9], [498, 7], [498, 9], [501, 3], [501, 6], [501, 3], [501, 6], [369, 0], [369, 2], [369, 5], [369, 4], [369, 7], [31, 6], [508, 2], [507, 0], [507, 2], [507, 2], [507, 1], [30, 8], [27, 3], [27, 4], [512, 3], [512, 1], [513, 3], [513, 7], [513, 6], [513, 3], [513, 4], [517, 1], [517, 1], [521, 2], [522, 3], [523, 2], [524, 4], [514, 4], [514, 3], [514, 2], [514, 1], [536, 2], [532, 2], [532, 2], [537, 4], [539, 6], [72, 3], [72, 2], [544, 3], [544, 1], [543, 1], [543, 4], [73, 2], [24, 2], [53, 9], [53, 8], [53, 9], [548, 0], [548, 1], [548, 1], [548, 1], [548, 2], [549, 1], [549, 1], [549, 1], [54, 3], [42, 2], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [15, 1], [15, 1], [87, 0], [87, 1], [90, 0], [90, 1], [97, 0], [97, 2], [98, 0], [98, 1], [100, 0], [100, 1], [101, 0], [101, 1], [106, 0], [106, 1], [107, 0], [107, 1], [110, 0], [110, 1], [117, 0], [117, 1], [130, 0], [130, 1], [134, 1], [134, 2], [135, 1], [135, 2], [136, 0], [136, 1], [164, 0], [164, 2], [166, 0], [166, 2], [168, 0], [168, 2], [169, 1], [169, 1], [170, 0], [170, 2], [174, 0], [174, 2], [176, 0], [176, 2], [185, 0], [185, 2], [186, 0], [186, 2], [187, 0], [187, 2], [197, 0], [197, 1], [206, 0], [206, 1], [219, 0], [219, 1], [220, 0], [220, 1], [221, 0], [221, 1], [222, 0], [222, 1], [224, 0], [224, 1], [225, 0], [225, 1], [226, 0], [226, 1], [228, 0], [228, 1], [236, 0], [236, 1], [237, 0], [237, 1], [238, 0], [238, 1], [239, 0], [239, 1], [240, 0], [240, 1], [274, 0], [274, 1], [276, 0], [276, 1], [277, 0], [277, 1], [278, 0], [278, 1], [291, 1], [291, 1], [308, 0], [308, 1], [309, 0], [309, 1], [801, 1], [801, 1], [321, 0], [321, 1], [334, 1], [334, 1], [371, 1], [371, 1], [405, 0], [405, 1], [409, 0], [409, 1], [419, 0], [419, 1], [420, 0], [420, 1], [431, 0], [431, 1], [432, 0], [432, 1], [434, 1], [434, 1], [448, 0], [448, 1], [449, 0], [449, 1], [504, 0], [504, 1], [505, 0], [505, 1], [506, 0], [506, 1], [510, 0], [510, 1], [515, 0], [515, 1], [516, 0], [516, 1], [518, 0], [518, 1], [519, 0], [519, 1], [520, 0], [520, 1], [525, 0], [525, 1], [526, 0], [526, 1], [527, 0], [527, 1], [528, 0], [528, 1], [529, 0], [529, 1], [530, 0], [530, 1], [531, 0], [531, 1], [533, 0], [533, 1], [534, 0], [534, 1], [535, 0], [535, 1], [538, 0], [538, 2], [540, 0], [540, 2], [541, 0], [541, 2], [542, 0], [542, 2], [550, 0], [550, 1], [551, 0], [551, 1]], performAction: function(ve, ke, Te, d, Je, l, nt) {
            var u = l.length - 1;
            switch (Je) {
              case 1:
                c.options.casesensitive ? this.$ = l[u] : this.$ = l[u].toLowerCase();
                break;
              case 2:
                this.$ = Is(l[u].substr(1, l[u].length - 2));
                break;
              case 3:
              case 4:
              case 5:
              case 6:
                this.$ = l[u].toLowerCase();
                break;
              case 7:
                this.$ = l[u].toLowerCase();
                break;
              case 8:
                this.$ = l[u];
                break;
              case 9:
                this.$ = l[u] ? l[u - 1] + " " + l[u] : l[u - 1];
                break;
              case 10:
                return new d.Statements({ statements: l[u - 1] });
              case 11:
                this.$ = l[u - 2], l[u] && l[u - 2].push(l[u]);
                break;
              case 12:
              case 13:
              case 76:
              case 93:
              case 98:
              case 156:
              case 191:
              case 211:
              case 212:
              case 243:
              case 265:
              case 280:
              case 378:
              case 396:
              case 475:
              case 505:
              case 506:
              case 510:
              case 518:
              case 566:
              case 567:
              case 604:
              case 691:
              case 701:
              case 727:
              case 729:
              case 731:
              case 746:
              case 747:
              case 777:
              case 801:
                this.$ = [l[u]];
                break;
              case 14:
                this.$ = l[u], l[u].explain = true;
                break;
              case 15:
                this.$ = l[u], l[u].explain = true;
                break;
              case 16:
                this.$ = l[u], d.exists && (this.$.exists = d.exists), delete d.exists, d.queries && (this.$.queries = d.queries), delete d.queries;
                break;
              case 17:
              case 175:
              case 186:
              case 236:
              case 237:
              case 239:
              case 249:
              case 251:
              case 263:
              case 274:
              case 277:
              case 348:
              case 352:
              case 354:
              case 399:
              case 522:
              case 532:
              case 534:
              case 546:
              case 605:
                this.$ = void 0;
                break;
              case 73:
                this.$ = new d.WithSelect({ withs: l[u - 1], select: l[u] });
                break;
              case 74:
              case 603:
                l[u - 2].push(l[u]), this.$ = l[u - 2];
                break;
              case 75:
                l[u].recursive = true, l[u - 3].push(l[u]), this.$ = l[u - 3];
                break;
              case 77:
                l[u].recursive = true, this.$ = [l[u]];
                break;
              case 78:
                this.$ = { name: l[u - 4], select: l[u - 1] };
                break;
              case 79:
                this.$ = { name: l[u - 7], columns: l[u - 5], select: l[u - 1] };
                break;
              case 80:
                d.extend(this.$, l[u - 9]), d.extend(this.$, l[u - 8]), d.extend(this.$, l[u - 7]), d.extend(this.$, l[u - 6]), d.extend(this.$, l[u - 5]), d.extend(this.$, l[u - 4]), d.extend(this.$, l[u - 3]), d.extend(this.$, l[u - 2]), d.extend(this.$, l[u - 1]), d.extend(this.$, l[u]), this.$ = l[u - 9], d.exists && (this.$.exists = d.exists.slice());
                break;
              case 81:
                this.$ = l[u - 4], d.extend(this.$, l[u - 2]), d.extend(this.$, l[u - 1]), d.extend(this.$, l[u]), d.exists && (this.$.exists = d.exists.slice());
                break;
              case 82:
                d.extend(this.$, l[u - 3]), d.extend(this.$, l[u - 2]), d.extend(this.$, l[u - 1]), d.extend(this.$, l[u]), this.$ = l[u - 3], d.exists && (this.$.exists = d.exists.slice());
                break;
              case 83:
                this.$ = new d.Search({ selectors: l[u - 2], from: l[u] }), d.extend(this.$, l[u - 1]);
                break;
              case 84:
              case 85:
              case 89:
              case 551:
              case 587:
              case 623:
              case 657:
              case 675:
              case 676:
              case 679:
              case 704:
                this.$ = l[u - 1];
                break;
              case 86:
                d.extend(this.$, l[u - 7]), d.extend(this.$, l[u - 6]), d.extend(this.$, l[u - 5]), d.extend(this.$, l[u - 4]), d.extend(this.$, l[u - 3]), d.extend(this.$, l[u - 2]), d.extend(this.$, l[u - 1]), d.extend(this.$, l[u]), this.$ = l[u - 7], d.exists && (this.$.exists = d.exists.slice());
                break;
              case 87:
                this.$ = { pivot: { expr: l[u - 5], columnid: l[u - 3], inlist: l[u - 2], as: l[u] } };
                break;
              case 88:
                this.$ = { unpivot: { tocolumnid: l[u - 8], forcolumnid: l[u - 6], inlist: l[u - 3], as: l[u] } };
                break;
              case 90:
              case 91:
              case 99:
              case 160:
              case 202:
              case 203:
              case 207:
              case 208:
              case 248:
              case 287:
              case 302:
              case 303:
              case 304:
              case 305:
              case 306:
              case 307:
              case 308:
              case 309:
              case 310:
              case 311:
              case 312:
              case 313:
              case 314:
              case 315:
              case 318:
              case 319:
              case 335:
              case 336:
              case 337:
              case 338:
              case 339:
              case 340:
              case 353:
              case 398:
              case 464:
              case 465:
              case 466:
              case 467:
              case 468:
              case 469:
              case 547:
              case 580:
              case 584:
              case 586:
              case 661:
              case 662:
              case 663:
              case 664:
              case 665:
              case 666:
              case 671:
              case 673:
              case 674:
              case 683:
              case 702:
              case 703:
              case 768:
              case 783:
              case 784:
              case 786:
              case 787:
              case 793:
              case 794:
                this.$ = l[u];
                break;
              case 92:
              case 97:
              case 776:
              case 800:
                this.$ = l[u - 2], this.$.push(l[u]);
                break;
              case 94:
                this.$ = { expr: l[u] };
                break;
              case 95:
                this.$ = { expr: l[u - 2], as: l[u] };
                break;
              case 96:
                this.$ = { removecolumns: l[u] };
                break;
              case 100:
                this.$ = { like: l[u] };
                break;
              case 103:
              case 117:
                this.$ = { srchid: "PROP", args: [l[u]] };
                break;
              case 104:
                this.$ = { srchid: "ORDERBY", args: l[u - 1] };
                break;
              case 105:
                var X2 = l[u - 1];
                X2 || (X2 = "ASC"), this.$ = { srchid: "ORDERBY", args: [{ expression: new d.Column({ columnid: "_" }), direction: X2 }] };
                break;
              case 106:
                this.$ = { srchid: "PARENT" };
                break;
              case 107:
                this.$ = { srchid: "APROP", args: [l[u]] };
                break;
              case 108:
                this.$ = { selid: "ROOT" };
                break;
              case 109:
                this.$ = { srchid: "EQ", args: [l[u]] };
                break;
              case 110:
                this.$ = { srchid: "LIKE", args: [l[u]] };
                break;
              case 111:
              case 112:
                this.$ = { selid: "WITH", args: l[u - 1] };
                break;
              case 113:
                this.$ = { srchid: l[u - 3].toUpperCase(), args: l[u - 1] };
                break;
              case 114:
                this.$ = { srchid: "WHERE", args: [l[u - 1]] };
                break;
              case 115:
                this.$ = { selid: "OF", args: [l[u - 1]] };
                break;
              case 116:
                this.$ = { srchid: "CLASS", args: [l[u - 1]] };
                break;
              case 118:
                this.$ = { srchid: "NAME", args: [l[u].substr(1, l[u].length - 2)] };
                break;
              case 119:
                this.$ = { srchid: "CHILD" };
                break;
              case 120:
                this.$ = { srchid: "VERTEX" };
                break;
              case 121:
                this.$ = { srchid: "EDGE" };
                break;
              case 122:
                this.$ = { srchid: "REF" };
                break;
              case 123:
                this.$ = { srchid: "SHARP", args: [l[u]] };
                break;
              case 124:
                this.$ = { srchid: "ATTR", args: typeof l[u] > "u" ? void 0 : [l[u]] };
                break;
              case 125:
                this.$ = { srchid: "ATTR" };
                break;
              case 126:
                this.$ = { srchid: "OUT" };
                break;
              case 127:
                this.$ = { srchid: "IN" };
                break;
              case 128:
                this.$ = { srchid: "OUTOUT" };
                break;
              case 129:
                this.$ = { srchid: "ININ" };
                break;
              case 130:
                this.$ = { srchid: "CONTENT" };
                break;
              case 131:
                this.$ = { srchid: "EX", args: [new d.Json({ value: l[u] })] };
                break;
              case 132:
                this.$ = { srchid: "AT", args: [l[u]] };
                break;
              case 133:
                this.$ = { srchid: "AS", args: [l[u]] };
                break;
              case 134:
                this.$ = { srchid: "SET", args: l[u - 1] };
                break;
              case 135:
                this.$ = { selid: "TO", args: [l[u]] };
                break;
              case 136:
                this.$ = { srchid: "VALUE" };
                break;
              case 137:
                this.$ = { srchid: "ROW", args: l[u - 1] };
                break;
              case 138:
                this.$ = { srchid: "CLASS", args: [l[u]] };
                break;
              case 139:
                this.$ = { selid: l[u], args: [l[u - 1]] };
                break;
              case 140:
                this.$ = { selid: "NOT", args: l[u - 1] };
                break;
              case 141:
                this.$ = { selid: "IF", args: l[u - 1] };
                break;
              case 142:
                this.$ = { selid: l[u - 3], args: l[u - 1] };
                break;
              case 143:
                this.$ = { selid: "DISTINCT", args: l[u - 1] };
                break;
              case 144:
                this.$ = { selid: "UNION", args: l[u - 1] };
                break;
              case 145:
                this.$ = { selid: "UNIONALL", args: l[u - 1] };
                break;
              case 146:
                this.$ = { selid: "ALL", args: [l[u - 1]] };
                break;
              case 147:
                this.$ = { selid: "ANY", args: [l[u - 1]] };
                break;
              case 148:
                this.$ = { selid: "INTERSECT", args: l[u - 1] };
                break;
              case 149:
                this.$ = { selid: "EXCEPT", args: l[u - 1] };
                break;
              case 150:
                this.$ = { selid: "AND", args: l[u - 1] };
                break;
              case 151:
                this.$ = { selid: "OR", args: l[u - 1] };
                break;
              case 152:
                this.$ = { selid: "PATH", args: [l[u - 1]] };
                break;
              case 153:
                this.$ = { srchid: "RETURN", args: l[u - 1] };
                break;
              case 154:
                this.$ = { selid: "REPEAT", sels: l[u - 3], args: l[u - 1] };
                break;
              case 155:
                this.$ = l[u - 2], this.$.push(l[u]);
                break;
              case 157:
                this.$ = "PLUS";
                break;
              case 158:
                this.$ = "STAR";
                break;
              case 159:
                this.$ = "QUESTION";
                break;
              case 161:
                this.$ = new d.Select({ columns: l[u], distinct: true }), d.extend(this.$, l[u - 3]), d.extend(this.$, l[u - 1]);
                break;
              case 162:
                this.$ = new d.Select({ columns: l[u], distinct: true }), d.extend(this.$, l[u - 3]), d.extend(this.$, l[u - 1]);
                break;
              case 163:
                this.$ = new d.Select({ columns: l[u], all: true }), d.extend(this.$, l[u - 3]), d.extend(this.$, l[u - 1]);
                break;
              case 164:
                l[u] ? (this.$ = new d.Select({ columns: l[u] }), d.extend(this.$, l[u - 2]), d.extend(this.$, l[u - 1])) : this.$ = new d.Select({ columns: [new d.Column({ columnid: "_" })], modifier: "COLUMN" });
                break;
              case 165:
                l[u] == "SELECT" ? this.$ = void 0 : this.$ = { modifier: l[u] };
                break;
              case 166:
                this.$ = { modifier: "VALUE" };
                break;
              case 167:
                this.$ = { modifier: "ROW" };
                break;
              case 168:
                this.$ = { modifier: "COLUMN" };
                break;
              case 169:
                this.$ = { modifier: "MATRIX" };
                break;
              case 170:
                this.$ = { modifier: "TEXTSTRING" };
                break;
              case 171:
                this.$ = { modifier: "INDEX" };
                break;
              case 172:
                this.$ = { modifier: "RECORDSET" };
                break;
              case 173:
                this.$ = { top: l[u - 1], percent: typeof l[u] < "u" ? true : void 0 };
                break;
              case 174:
                this.$ = { top: l[u - 1] };
                break;
              case 176:
              case 769:
                this.$ = void 0;
                break;
              case 177:
              case 178:
              case 179:
              case 180:
                this.$ = { into: l[u] };
                break;
              case 181:
                var We = l[u];
                We = We.substr(1, We.length - 2);
                var s2 = We.substr(-3).toUpperCase(), b2 = We.substr(-4).toUpperCase();
                We[0] == "#" ? this.$ = { into: new d.FuncValue({ funcid: "HTML", args: [new d.StringValue({ value: We }), new d.Json({ value: { headers: true } })] }) } : s2 == "XLS" || s2 == "CSV" || s2 == "TAB" ? this.$ = { into: new d.FuncValue({ funcid: s2, args: [new d.StringValue({ value: We }), new d.Json({ value: { headers: true } })] }) } : (b2 == "XLSX" || b2 == "JSON") && (this.$ = { into: new d.FuncValue({ funcid: b2, args: [new d.StringValue({ value: We }), new d.Json({ value: { headers: true } })] }) });
                break;
              case 182:
                this.$ = { from: l[u] };
                break;
              case 183:
                this.$ = { from: l[u - 1], joins: l[u] };
                break;
              case 184:
                var Jt = l[u - 2];
                l[u].forEach((Le) => {
                  var l3 = new d.Join({ joinmode: "CROSS" });
                  Le.tableid ? l3.table = new d.Table({ databaseid: Le.databaseid, tableid: Le.tableid }) : Le instanceof d.Select ? l3.select = Le : Le instanceof d.Search ? l3.search = Le : Le instanceof d.ParamValue ? l3.param = Le : Le instanceof d.VarValue ? l3.variable = Le.variable : Le instanceof d.FuncValue ? l3.func = Le : Le instanceof d.Json && (l3.json = Le), Le.as && (l3.as = Le.as), Jt.push(l3);
                }), this.$ = { from: l[u - 3], joins: Jt };
                break;
              case 185:
                this.$ = { from: l[u - 2], joins: l[u - 1] };
                break;
              case 187:
                this.$ = new d.Apply({ select: l[u - 2], applymode: "CROSS", as: l[u] });
                break;
              case 188:
                this.$ = new d.Apply({ select: l[u - 3], applymode: "CROSS", as: l[u] });
                break;
              case 189:
                this.$ = new d.Apply({ select: l[u - 2], applymode: "OUTER", as: l[u] });
                break;
              case 190:
                this.$ = new d.Apply({ select: l[u - 3], applymode: "OUTER", as: l[u] });
                break;
              case 192:
              case 244:
              case 476:
              case 568:
              case 569:
                this.$ = l[u - 2], l[u - 2].push(l[u]);
                break;
              case 193:
                this.$ = l[u - 2], this.$.as = l[u] || "default";
                break;
              case 194:
                this.$ = new d.Json({ value: l[u - 2] }), l[u - 2].as = l[u];
                break;
              case 195:
                this.$ = l[u - 1], l[u] && (l[u - 1].as = l[u]);
                break;
              case 196:
              case 677:
              case 680:
                this.$ = l[u - 2];
                break;
              case 197:
              case 198:
              case 199:
              case 200:
                this.$ = l[u - 1], l[u - 1].as = l[u] || "default";
                break;
              case 201:
                this.$ = { inserted: true };
                break;
              case 204:
                var We = l[u];
                We = We.substr(1, We.length - 2);
                var s2 = We.substr(-3).toUpperCase(), b2 = We.substr(-4).toUpperCase(), jt;
                if (We[0] == "#") jt = new d.FuncValue({ funcid: "HTML", args: [new d.StringValue({ value: We }), new d.Json({ value: { headers: true } })] });
                else if (s2 == "XLS" || s2 == "CSV" || s2 == "TAB") jt = new d.FuncValue({ funcid: s2, args: [new d.StringValue({ value: We }), new d.Json({ value: { headers: true } })] });
                else if (b2 == "XLSX" || b2 == "JSON") jt = new d.FuncValue({ funcid: b2, args: [new d.StringValue({ value: We }), new d.Json({ value: { headers: true } })] });
                else throw new Error("Unknown string in FROM clause");
                this.$ = jt;
                break;
              case 205:
                l[u - 2] == "INFORMATION_SCHEMA" ? this.$ = new d.FuncValue({ funcid: l[u - 2], args: [new d.StringValue({ value: l[u] })] }) : this.$ = new d.Table({ databaseid: l[u - 2], tableid: l[u] });
                break;
              case 206:
                this.$ = new d.Table({ tableid: l[u] });
                break;
              case 209:
              case 210:
                this.$ = l[u - 1], l[u - 1].push(l[u]);
                break;
              case 213:
                this.$ = new d.Join(l[u - 2]), d.extend(this.$, l[u - 1]), d.extend(this.$, l[u]);
                break;
              case 214:
                this.$ = { table: l[u - 1] }, l[u] && (this.$.as = l[u]);
                break;
              case 215:
                this.$ = { json: new d.Json({ value: l[u - 2], as: l[u] }) };
                break;
              case 216:
                this.$ = { param: l[u - 1], as: l[u] };
                break;
              case 217:
                this.$ = { select: l[u - 2], as: l[u] };
                break;
              case 218:
                this.$ = { func: l[u - 1], as: l[u] || "default" };
                break;
              case 219:
                this.$ = { variable: l[u - 1], as: l[u] || "default" };
                break;
              case 220:
                this.$ = { joinmode: l[u] };
                break;
              case 221:
                this.$ = { joinmode: l[u - 1], natural: true };
                break;
              case 222:
              case 223:
                this.$ = "INNER";
                break;
              case 224:
              case 225:
                this.$ = "LEFT";
                break;
              case 226:
              case 227:
                this.$ = "RIGHT";
                break;
              case 228:
              case 229:
                this.$ = "OUTER";
                break;
              case 230:
                this.$ = "SEMI";
                break;
              case 231:
                this.$ = "ANTI";
                break;
              case 232:
                this.$ = "CROSS";
                break;
              case 233:
                this.$ = { on: l[u] };
                break;
              case 234:
              case 741:
                this.$ = { using: l[u] };
                break;
              case 235:
              case 742:
                this.$ = { using: l[u - 1] };
                break;
              case 238:
                this.$ = { where: new d.Expression({ expression: l[u] }) };
                break;
              case 240:
                this.$ = { group: l[u - 1] }, d.extend(this.$, l[u]);
                break;
              case 241:
                this.$ = { group: [new d.GroupExpression({ type: "ROLLUP", group: l[u - 3] })] }, d.extend(this.$, l[u]);
                break;
              case 242:
                this.$ = { group: [new d.GroupExpression({ type: "CUBE", group: l[u - 3] })] }, d.extend(this.$, l[u]);
                break;
              case 245:
                this.$ = new d.GroupExpression({ type: "GROUPING SETS", group: l[u - 1] });
                break;
              case 246:
                this.$ = new d.GroupExpression({ type: "ROLLUP", group: l[u - 1] });
                break;
              case 247:
                this.$ = new d.GroupExpression({ type: "CUBE", group: l[u - 1] });
                break;
              case 250:
                this.$ = { having: l[u] };
                break;
              case 252:
                this.$ = {}, this.$[l[u - 1].op] = l[u], l[u - 1].corresponding && (this.$.corresponding = true);
                break;
              case 253:
                d.queriesStack || (d.queriesStack = []), d.queriesStack.push(d.queries || []), d.queries = [], this.$ = { op: "union" };
                break;
              case 254:
                d.queriesStack || (d.queriesStack = []), d.queriesStack.push(d.queries || []), d.queries = [], this.$ = { op: "unionall" };
                break;
              case 255:
                d.queriesStack || (d.queriesStack = []), d.queriesStack.push(d.queries || []), d.queries = [], this.$ = { op: "except" };
                break;
              case 256:
                d.queriesStack || (d.queriesStack = []), d.queriesStack.push(d.queries || []), d.queries = [], this.$ = { op: "intersect" };
                break;
              case 257:
                d.queriesStack || (d.queriesStack = []), d.queriesStack.push(d.queries || []), d.queries = [], this.$ = { op: "union", corresponding: true };
                break;
              case 258:
                d.queriesStack || (d.queriesStack = []), d.queriesStack.push(d.queries || []), d.queries = [], this.$ = { op: "unionall", corresponding: true };
                break;
              case 259:
                d.queriesStack || (d.queriesStack = []), d.queriesStack.push(d.queries || []), d.queries = [], this.$ = { op: "except", corresponding: true };
                break;
              case 260:
                d.queriesStack || (d.queriesStack = []), d.queriesStack.push(d.queries || []), d.queries = [], this.$ = { op: "intersect", corresponding: true };
                break;
              case 261:
              case 262:
                d.queriesStack && d.queriesStack.length > 0 && (d.queries && d.queries.length > 0 && (l[u].queries = d.queries), d.queries = d.queriesStack.pop()), this.$ = l[u];
                break;
              case 264:
                this.$ = { order: l[u] };
                break;
              case 266:
                this.$ = l[u - 2], l[u - 2].push(l[u]);
                break;
              case 267:
                this.$ = { nullsOrder: "FIRST" };
                break;
              case 268:
                this.$ = { nullsOrder: "LAST" };
                break;
              case 269:
                this.$ = new d.Expression({ expression: l[u], direction: "ASC" });
                break;
              case 270:
                this.$ = new d.Expression({ expression: l[u - 1], direction: l[u].toUpperCase() });
                break;
              case 271:
                this.$ = new d.Expression({ expression: l[u - 2], direction: l[u - 1].toUpperCase() }), d.extend(this.$, l[u]);
                break;
              case 272:
                this.$ = new d.Expression({ expression: l[u - 2], direction: "ASC", nocase: true });
                break;
              case 273:
                this.$ = new d.Expression({ expression: l[u - 3], direction: l[u].toUpperCase(), nocase: true });
                break;
              case 275:
                this.$ = { limit: l[u - 1] }, d.extend(this.$, l[u]);
                break;
              case 276:
                this.$ = { limit: l[u - 2], offset: l[u - 6] };
                break;
              case 278:
                this.$ = { offset: l[u] };
                break;
              case 279:
              case 540:
              case 571:
              case 690:
              case 700:
              case 726:
              case 728:
              case 732:
                l[u - 2].push(l[u]), this.$ = l[u - 2];
                break;
              case 281:
              case 283:
                l[u - 2].as = l[u], this.$ = l[u - 2];
                break;
              case 282:
              case 284:
                l[u - 1].as = l[u], this.$ = l[u - 1];
                break;
              case 285:
                l[u - 2].as = l[u].value, this.$ = l[u - 2];
                break;
              case 286:
                l[u - 1].as = l[u].value, this.$ = l[u - 1];
                break;
              case 288:
                this.$ = new d.Column({ columid: l[u], tableid: l[u - 2], databaseid: l[u - 4] });
                break;
              case 289:
                this.$ = new d.Column({ columnid: l[u], tableid: l[u - 2] });
                break;
              case 290:
                this.$ = new d.Column({ columnid: l[u], tableid: "INSERTED" });
                break;
              case 291:
                this.$ = new d.Column({ columnid: l[u], tableid: "DELETED" });
                break;
              case 292:
                this.$ = new d.Column({ columnid: l[u] });
                break;
              case 293:
                this.$ = new d.Column({ columnid: l[u], tableid: l[u - 2], databaseid: l[u - 4] });
                break;
              case 294:
                this.$ = new d.Column({ columnid: l[u], tableid: "INSERTED" });
                break;
              case 295:
                this.$ = new d.Column({ columnid: l[u], tableid: "DELETED" });
                break;
              case 296:
              case 297:
                this.$ = new d.Column({ columnid: l[u], tableid: l[u - 2] });
                break;
              case 298:
                this.$ = new d.Column({ columnid: "@" + l[u], tableid: l[u - 3] });
                break;
              case 299:
                this.$ = new d.Column({ columnid: "inserted" });
                break;
              case 300:
                this.$ = new d.Column({ columnid: "deleted" });
                break;
              case 301:
                this.$ = new d.Column({ columnid: l[u] });
                break;
              case 316:
                this.$ = new d.DomainValueValue();
                break;
              case 317:
                this.$ = new d.Json({ value: l[u] });
                break;
              case 320:
              case 321:
              case 322:
                d.queries || (d.queries = []), d.queries.push(l[u - 1]), l[u - 1].queriesidx = d.queries.length, this.$ = l[u - 1];
                break;
              case 323:
                this.$ = l[u];
                break;
              case 324:
                this.$ = new d.FuncValue({ funcid: "CURRENT_TIMESTAMP" });
                break;
              case 325:
                this.$ = new d.FuncValue({ funcid: "CURRENT_DATE" });
                break;
              case 326:
                this.$ = new d.JavaScript({ value: l[u].substr(2, l[u].length - 4) });
                break;
              case 327:
                this.$ = new d.JavaScript({ value: 'alasql.fn["' + l[u - 2] + '"] = ' + l[u].substr(2, l[u].length - 4) });
                break;
              case 328:
                this.$ = new d.JavaScript({ value: 'alasql.aggr["' + l[u - 2] + '"] = ' + l[u].substr(2, l[u].length - 4) });
                break;
              case 329:
                this.$ = new d.FuncValue({ funcid: l[u], newid: true });
                break;
              case 330:
                this.$ = l[u], d.extend(this.$, { newid: true });
                break;
              case 331:
                this.$ = new d.Convert({ expression: l[u - 3] }), d.extend(this.$, l[u - 1]);
                break;
              case 332:
                this.$ = new d.Convert({ expression: l[u - 5], style: l[u - 1] }), d.extend(this.$, l[u - 3]);
                break;
              case 333:
                this.$ = new d.Convert({ expression: l[u - 1] }), d.extend(this.$, l[u - 3]);
                break;
              case 334:
                this.$ = new d.Convert({ expression: l[u - 3], style: l[u - 1] }), d.extend(this.$, l[u - 5]);
                break;
              case 341:
                this.$ = new d.FuncValue({ funcid: "CURRENT_TIMESTAMP" });
                break;
              case 342:
                this.$ = new d.FuncValue({ funcid: "CURRENT_DATE" });
                break;
              case 343:
                l[u - 2].length > 1 && (l[u - 4].toUpperCase() == "MAX" || l[u - 4].toUpperCase() == "MIN") ? this.$ = new d.FuncValue({ funcid: l[u - 4], args: l[u - 2] }) : this.$ = new d.AggrValue({ aggregatorid: l[u - 4].toUpperCase(), expression: l[u - 2].pop(), over: l[u] });
                break;
              case 344:
                this.$ = new d.AggrValue({ aggregatorid: l[u - 5].toUpperCase(), expression: l[u - 2], distinct: true, over: l[u] });
                break;
              case 345:
                this.$ = new d.AggrValue({ aggregatorid: l[u - 5].toUpperCase(), expression: l[u - 2], over: l[u] });
                break;
              case 346:
                this.$ = new d.AggrValue({ aggregatorid: "REDUCE", funcid: "GROUP_CONCAT", expression: l[u - 3], order: l[u - 2], separator: l[u - 1] });
                break;
              case 347:
                this.$ = new d.AggrValue({ aggregatorid: "REDUCE", funcid: "GROUP_CONCAT", expression: l[u - 3], distinct: true, order: l[u - 2], separator: l[u - 1] });
                break;
              case 349:
                this.$ = new d.Over(), d.extend(this.$, l[u - 2]), d.extend(this.$, l[u - 1]);
                break;
              case 350:
                this.$ = { partition: l[u] };
                break;
              case 351:
                this.$ = { order: l[u] };
                break;
              case 355:
                var je = l[u].substring(1, l[u].length - 1);
                je = je.replace(/\\n/g, `
`).replace(/\\t/g, "	").replace(/\\r/g, "\r").replace(/\\\\/g, "\\"), this.$ = je;
                break;
              case 356:
                this.$ = "SUM";
                break;
              case 357:
                this.$ = "TOTAL";
                break;
              case 358:
                this.$ = "COUNT";
                break;
              case 359:
                this.$ = "MIN";
                break;
              case 360:
              case 582:
                this.$ = "MAX";
                break;
              case 361:
                this.$ = "AVG";
                break;
              case 362:
                this.$ = "FIRST";
                break;
              case 363:
                this.$ = "LAST";
                break;
              case 364:
                this.$ = "AGGR";
                break;
              case 365:
                this.$ = "ARRAY";
                break;
              case 366:
                this.$ = "GROUP_CONCAT";
                break;
              case 367:
                var g2 = l[u - 5], K2 = l[u - 2];
                K2.length > 1 && (g2.toUpperCase() == "MIN" || g2.toUpperCase() == "MAX") ? this.$ = new d.FuncValue({ funcid: g2, args: K2, over: l[u] }) : c.aggr[l[u - 5]] ? this.$ = new d.AggrValue({ aggregatorid: "REDUCE", funcid: g2, expression: K2[0], args: K2, distinct: l[u - 3] == "DISTINCT", over: l[u] }) : this.$ = new d.FuncValue({ funcid: g2, args: K2, over: l[u] });
                break;
              case 368:
                this.$ = new d.FuncValue({ funcid: l[u - 3], over: l[u] });
                break;
              case 369:
                this.$ = new d.FuncValue({ funcid: "IIF", args: l[u - 1] });
                break;
              case 370:
                this.$ = new d.FuncValue({ funcid: "REPLACE", args: l[u - 1] });
                break;
              case 371:
                this.$ = new d.FuncValue({ funcid: l[u - 2] });
                break;
              case 372:
                this.$ = new d.FuncValue({ funcid: "DATEADD", args: [new d.StringValue({ value: l[u - 5] }), l[u - 3], l[u - 1]] });
                break;
              case 373:
                this.$ = new d.FuncValue({ funcid: "DATEADD", args: [l[u - 5], l[u - 3], l[u - 1]] });
                break;
              case 374:
                this.$ = new d.FuncValue({ funcid: "DATEDIFF", args: [new d.StringValue({ value: l[u - 5] }), l[u - 3], l[u - 1]] });
                break;
              case 375:
                this.$ = new d.FuncValue({ funcid: "DATEDIFF", args: [l[u - 5], l[u - 3], l[u - 1]] });
                break;
              case 376:
                this.$ = new d.FuncValue({ funcid: "TIMESTAMPDIFF", args: [new d.StringValue({ value: l[u - 5] }), l[u - 3], l[u - 1]] });
                break;
              case 377:
                this.$ = new d.FuncValue({ funcid: "INTERVAL", args: [l[u - 1], new d.StringValue({ value: l[u].toLowerCase() })] });
                break;
              case 379:
                l[u - 2].push(l[u]), this.$ = l[u - 2];
                break;
              case 380:
                this.$ = new d.NumValue({ value: +l[u] });
                break;
              case 381:
                this.$ = new d.LogicValue({ value: true });
                break;
              case 382:
                this.$ = new d.LogicValue({ value: false });
                break;
              case 383:
                this.$ = new d.StringValue({ value: l[u].substr(1, l[u].length - 2).replace(/(\\\')/g, "'").replace(/(\'\')/g, "'") });
                break;
              case 384:
                this.$ = new d.StringValue({ value: l[u].substr(2, l[u].length - 3).replace(/(\\\')/g, "'").replace(/(\'\')/g, "'") });
                break;
              case 385:
                this.$ = new d.NullValue({ value: void 0 });
                break;
              case 386:
                this.$ = new d.VarValue({ variable: l[u] });
                break;
              case 387:
                d.exists || (d.exists = []), this.$ = new d.ExistsValue({ value: l[u - 1], existsidx: d.exists.length }), d.exists.push(l[u - 1]);
                break;
              case 388:
                this.$ = new d.ArrayValue({ value: l[u - 1] });
                break;
              case 389:
              case 390:
                this.$ = new d.ParamValue({ param: l[u] });
                break;
              case 391:
                typeof d.question > "u" && (d.question = 0), this.$ = new d.ParamValue({ param: d.question++ });
                break;
              case 392:
                typeof d.question > "u" && (d.question = 0), this.$ = new d.ParamValue({ param: d.question++, array: true });
                break;
              case 393:
                this.$ = new d.CaseValue({ expression: l[u - 3], whens: l[u - 2], elses: l[u - 1] });
                break;
              case 394:
                this.$ = new d.CaseValue({ whens: l[u - 2], elses: l[u - 1] });
                break;
              case 395:
              case 744:
              case 745:
                this.$ = l[u - 1], this.$.push(l[u]);
                break;
              case 397:
                this.$ = { when: l[u - 2], then: l[u] };
                break;
              case 400:
              case 401:
                this.$ = new d.Op({ left: l[u - 2], op: "REGEXP", right: l[u] });
                break;
              case 402:
                this.$ = new d.Op({ left: l[u - 2], op: "GLOB", right: l[u] });
                break;
              case 403:
                this.$ = new d.Op({ left: l[u - 2], op: "LIKE", right: l[u] });
                break;
              case 404:
                this.$ = new d.Op({ left: l[u - 4], op: "LIKE", right: l[u - 2], escape: l[u] });
                break;
              case 405:
                this.$ = new d.Op({ left: l[u - 2], op: "NOT LIKE", right: l[u] });
                break;
              case 406:
                this.$ = new d.Op({ left: l[u - 4], op: "NOT LIKE", right: l[u - 2], escape: l[u] });
                break;
              case 407:
                this.$ = new d.Op({ left: l[u - 2], op: "||", right: l[u] });
                break;
              case 408:
                this.$ = new d.Op({ left: l[u - 2], op: "+", right: l[u] });
                break;
              case 409:
                this.$ = new d.Op({ left: l[u - 2], op: "-", right: l[u] });
                break;
              case 410:
                this.$ = new d.Op({ left: l[u - 2], op: "*", right: l[u] });
                break;
              case 411:
                this.$ = new d.Op({ left: l[u - 2], op: "/", right: l[u] });
                break;
              case 412:
                this.$ = new d.Op({ left: l[u - 2], op: "%", right: l[u] });
                break;
              case 413:
                this.$ = new d.Op({ left: l[u - 2], op: "^", right: l[u] });
                break;
              case 414:
                this.$ = new d.Op({ left: l[u - 2], op: ">>", right: l[u] });
                break;
              case 415:
                this.$ = new d.Op({ left: l[u - 2], op: "<<", right: l[u] });
                break;
              case 416:
                this.$ = new d.Op({ left: l[u - 2], op: "&", right: l[u] });
                break;
              case 417:
                this.$ = new d.Op({ left: l[u - 2], op: "|", right: l[u] });
                break;
              case 418:
              case 419:
              case 421:
                this.$ = new d.Op({ left: l[u - 2], op: "->", right: l[u] });
                break;
              case 420:
                this.$ = new d.Op({ left: l[u - 4], op: "->", right: l[u - 1] });
                break;
              case 422:
              case 423:
              case 425:
                this.$ = new d.Op({ left: l[u - 2], op: "!", right: l[u] });
                break;
              case 424:
                this.$ = new d.Op({ left: l[u - 4], op: "!", right: l[u - 1] });
                break;
              case 426:
                this.$ = new d.Op({ left: l[u - 2], op: ">", right: l[u] });
                break;
              case 427:
                this.$ = new d.Op({ left: l[u - 2], op: ">=", right: l[u] });
                break;
              case 428:
                this.$ = new d.Op({ left: l[u - 2], op: "<", right: l[u] });
                break;
              case 429:
                this.$ = new d.Op({ left: l[u - 2], op: "<=", right: l[u] });
                break;
              case 430:
                this.$ = new d.Op({ left: l[u - 2], op: "=", right: l[u] });
                break;
              case 431:
                this.$ = new d.Op({ left: l[u - 2], op: "==", right: l[u] });
                break;
              case 432:
                this.$ = new d.Op({ left: l[u - 2], op: "===", right: l[u] });
                break;
              case 433:
                this.$ = new d.Op({ left: l[u - 2], op: "!=", right: l[u] });
                break;
              case 434:
                this.$ = new d.Op({ left: l[u - 2], op: "!==", right: l[u] });
                break;
              case 435:
                this.$ = new d.Op({ left: l[u - 2], op: "!===", right: l[u] });
                break;
              case 436:
                d.queries || (d.queries = []);
                var E2 = d.queries.slice();
                d.queries = [], E2.length > 0 && (l[u - 1].queries = E2), d.queries.push(l[u - 1]), this.$ = new d.Op({ left: l[u - 5], op: l[u - 4], allsome: l[u - 3], right: l[u - 1], queriesidx: d.queries.length - 1 });
                break;
              case 437:
                this.$ = new d.Op({ left: l[u - 5], op: l[u - 4], allsome: l[u - 3], right: l[u - 1] });
                break;
              case 438:
                l[u - 2].op == "BETWEEN1" ? l[u - 2].left.op == "AND" ? this.$ = new d.Op({ left: l[u - 2].left.left, op: "AND", right: new d.Op({ left: l[u - 2].left.right, op: "BETWEEN", right1: l[u - 2].right, right2: l[u] }) }) : this.$ = new d.Op({ left: l[u - 2].left, op: "BETWEEN", right1: l[u - 2].right, right2: l[u] }) : l[u - 2].op == "NOT BETWEEN1" ? l[u - 2].left.op == "AND" ? this.$ = new d.Op({ left: l[u - 2].left.left, op: "AND", right: new d.Op({ left: l[u - 2].left.right, op: "NOT BETWEEN", right1: l[u - 2].right, right2: l[u] }) }) : this.$ = new d.Op({ left: l[u - 2].left, op: "NOT BETWEEN", right1: l[u - 2].right, right2: l[u] }) : this.$ = new d.Op({ left: l[u - 2], op: "AND", right: l[u] });
                break;
              case 439:
                this.$ = new d.Op({ left: l[u - 2], op: "OR", right: l[u] });
                break;
              case 440:
                this.$ = new d.UniOp({ op: "NOT", right: l[u] });
                break;
              case 441:
                this.$ = new d.UniOp({ op: "-", right: l[u] });
                break;
              case 442:
                this.$ = new d.UniOp({ op: "+", right: l[u] });
                break;
              case 443:
                this.$ = new d.UniOp({ op: "~", right: l[u] });
                break;
              case 444:
                this.$ = new d.UniOp({ op: "#", right: l[u] });
                break;
              case 445:
                this.$ = new d.UniOp({ right: l[u - 1] });
                break;
              case 446:
                d.queries || (d.queries = []);
                var E2 = d.queries.slice();
                d.queries = [], E2.length > 0 && (l[u - 1].queries = E2), d.queries.push(l[u - 1]), this.$ = new d.Op({ left: l[u - 4], op: "IN", right: l[u - 1], queriesidx: d.queries.length - 1 });
                break;
              case 447:
                d.queries || (d.queries = []);
                var E2 = d.queries.slice();
                d.queries = [], E2.length > 0 && (l[u - 1].queries = E2), d.queries.push(l[u - 1]), this.$ = new d.Op({ left: l[u - 5], op: "NOT IN", right: l[u - 1], queriesidx: d.queries.length - 1 });
                break;
              case 448:
                this.$ = new d.Op({ left: l[u - 4], op: "IN", right: l[u - 1] });
                break;
              case 449:
                this.$ = new d.Op({ left: l[u - 5], op: "NOT IN", right: l[u - 1] });
                break;
              case 450:
                this.$ = new d.Op({ left: l[u - 3], op: "IN", right: [] });
                break;
              case 451:
                this.$ = new d.Op({ left: l[u - 4], op: "NOT IN", right: [] });
                break;
              case 452:
              case 454:
                this.$ = new d.Op({ left: l[u - 2], op: "IN", right: l[u] });
                break;
              case 453:
              case 455:
                this.$ = new d.Op({ left: l[u - 3], op: "NOT IN", right: l[u] });
                break;
              case 456:
                this.$ = new d.Op({ left: l[u - 2], op: "BETWEEN1", right: l[u] });
                break;
              case 457:
                this.$ = new d.Op({ left: l[u - 2], op: "NOT BETWEEN1", right: l[u] });
                break;
              case 458:
                this.$ = new d.Op({ op: "IS", left: l[u - 2], right: l[u] });
                break;
              case 459:
                this.$ = new d.Op({ op: "IS", left: l[u - 2], right: new d.UniOp({ op: "NOT", right: new d.NullValue({ value: void 0 }) }) });
                break;
              case 460:
                this.$ = new d.Convert({ expression: l[u - 2] }), d.extend(this.$, l[u]);
                break;
              case 461:
              case 462:
                this.$ = l[u];
                break;
              case 463:
                this.$ = l[u - 1];
                break;
              case 470:
                this.$ = "ALL";
                break;
              case 471:
                this.$ = "SOME";
                break;
              case 472:
                this.$ = "ANY";
                break;
              case 473:
                this.$ = new d.Update({ table: l[u - 5], columns: l[u - 3], where: l[u - 1] }), d.extend(this.$, l[u]);
                break;
              case 474:
                this.$ = new d.Update({ table: l[u - 3], columns: l[u - 1] }), d.extend(this.$, l[u]);
                break;
              case 477:
                this.$ = new d.SetColumn({ column: l[u - 2], expression: l[u] });
                break;
              case 478:
                this.$ = new d.SetColumn({ variable: l[u - 2], expression: l[u], method: l[u - 3] });
                break;
              case 479:
                this.$ = new d.Delete({ table: l[u - 3], where: l[u - 1] }), d.extend(this.$, l[u]);
                break;
              case 480:
                this.$ = new d.Delete({ table: l[u - 1] }), d.extend(this.$, l[u]);
                break;
              case 481:
                this.$ = new d.Insert({ into: l[u - 3], values: l[u - 1] }), d.extend(this.$, l[u]);
                break;
              case 482:
                this.$ = new d.Insert({ into: l[u - 2], values: l[u - 1] }), d.extend(this.$, l[u]);
                break;
              case 483:
                this.$ = new d.Insert({ into: l[u - 3], values: l[u - 1], ignore: true }), d.extend(this.$, l[u]);
                break;
              case 484:
                this.$ = new d.Insert({ into: l[u - 2], values: l[u - 1], ignore: true }), d.extend(this.$, l[u]);
                break;
              case 485:
                this.$ = new d.Insert({ into: l[u - 6], columns: l[u - 4], values: l[u - 1], ignore: true }), d.extend(this.$, l[u]);
                break;
              case 486:
                this.$ = new d.Insert({ into: l[u - 5], columns: l[u - 3], values: l[u - 1], ignore: true }), d.extend(this.$, l[u]);
                break;
              case 487:
                this.$ = new d.Insert({ into: l[u - 2], select: l[u - 1], ignore: true }), d.extend(this.$, l[u]);
                break;
              case 488:
                this.$ = new d.Insert({ into: l[u - 5], columns: l[u - 3], select: l[u - 1], ignore: true }), d.extend(this.$, l[u]);
                break;
              case 489:
              case 491:
                this.$ = new d.Insert({ into: l[u - 3], values: l[u - 1], orreplace: true }), d.extend(this.$, l[u]);
                break;
              case 490:
              case 492:
                this.$ = new d.Insert({ into: l[u - 2], values: l[u - 1], orreplace: true }), d.extend(this.$, l[u]);
                break;
              case 493:
                this.$ = new d.Insert({ into: l[u - 3], default: true }), d.extend(this.$, l[u]);
                break;
              case 494:
                this.$ = new d.Insert({ into: l[u - 6], columns: l[u - 4], values: l[u - 1] }), d.extend(this.$, l[u]);
                break;
              case 495:
                this.$ = new d.Insert({ into: l[u - 5], columns: l[u - 3], values: l[u - 1] }), d.extend(this.$, l[u]);
                break;
              case 496:
                this.$ = new d.Insert({ into: l[u - 2], select: l[u - 1] }), d.extend(this.$, l[u]);
                break;
              case 497:
                this.$ = new d.Insert({ into: l[u - 2], select: l[u - 1], orreplace: true }), d.extend(this.$, l[u]);
                break;
              case 498:
                this.$ = new d.Insert({ into: l[u - 5], columns: l[u - 3], select: l[u - 1] }), d.extend(this.$, l[u]);
                break;
              case 499:
                this.$ = new d.Insert({ into: l[u - 3], setcolumns: l[u - 1] }), d.extend(this.$, l[u]);
                break;
              case 504:
                this.$ = [l[u - 1]];
                break;
              case 507:
                this.$ = l[u - 4], l[u - 4].push(l[u - 1]);
                break;
              case 508:
              case 509:
              case 511:
              case 519:
                this.$ = l[u - 2], l[u - 2].push(l[u]);
                break;
              case 520:
                this.$ = new d.CreateTable({ table: l[u - 4] }), d.extend(this.$, l[u - 7]), d.extend(this.$, l[u - 6]), d.extend(this.$, l[u - 5]), d.extend(this.$, l[u - 2]), d.extend(this.$, l[u]);
                break;
              case 521:
                this.$ = new d.CreateTable({ table: l[u] }), d.extend(this.$, l[u - 3]), d.extend(this.$, l[u - 2]), d.extend(this.$, l[u - 1]);
                break;
              case 523:
                this.$ = { class: true };
                break;
              case 533:
                this.$ = { temporary: true };
                break;
              case 535:
                this.$ = { ifnotexists: true };
                break;
              case 536:
                this.$ = { columns: l[u - 2], constraints: l[u] };
                break;
              case 537:
                this.$ = { columns: l[u] };
                break;
              case 538:
                this.$ = { as: l[u] };
                break;
              case 539:
              case 570:
                this.$ = [l[u]];
                break;
              case 541:
              case 542:
              case 543:
              case 544:
              case 545:
                l[u].constraintid = l[u - 1], this.$ = l[u];
                break;
              case 548:
                this.$ = { type: "CHECK", expression: l[u - 1] };
                break;
              case 549:
                this.$ = { type: "PRIMARY KEY", columns: l[u - 1], clustered: (l[u - 3] + "").toUpperCase() };
                break;
              case 550:
                this.$ = { type: "FOREIGN KEY", columns: l[u - 5], fktable: l[u - 2], fkcolumns: l[u - 1] }, d.extend(this.$, l[u]);
                break;
              case 552:
                this.$ = {};
                break;
              case 553:
                this.$ = { ondelete: l[u] };
                break;
              case 554:
                this.$ = { onupdate: l[u] };
                break;
              case 555:
                this.$ = { ondelete: l[u - 1], onupdate: l[u] };
                break;
              case 556:
                this.$ = { ondelete: l[u], onupdate: l[u - 1] };
                break;
              case 557:
              case 558:
                this.$ = l[u];
                break;
              case 559:
                this.$ = "CASCADE";
                break;
              case 560:
                this.$ = "SET NULL";
                break;
              case 561:
                this.$ = "SET DEFAULT";
                break;
              case 562:
                this.$ = "RESTRICT";
                break;
              case 563:
                this.$ = "NO ACTION";
                break;
              case 564:
                this.$ = { type: "UNIQUE", columns: l[u - 1], clustered: (l[u - 3] + "").toUpperCase() };
                break;
              case 565:
                this.$ = { type: "INDEX", indexid: l[u - 3], columns: l[u - 1] };
                break;
              case 572:
                this.$ = new d.ColumnDef({ columnid: l[u - 2] }), d.extend(this.$, l[u - 1]), d.extend(this.$, l[u]);
                break;
              case 573:
                this.$ = new d.ColumnDef({ columnid: l[u - 1] }), d.extend(this.$, l[u]);
                break;
              case 574:
                this.$ = new d.ColumnDef({ columnid: l[u], dbtypeid: "" });
                break;
              case 575:
                this.$ = { dbtypeid: l[u - 5], dbsize: l[u - 3], dbprecision: +l[u - 1] };
                break;
              case 576:
                this.$ = { dbtypeid: l[u - 3], dbsize: l[u - 1] };
                break;
              case 577:
                this.$ = { dbtypeid: l[u] };
                break;
              case 578:
                this.$ = { dbtypeid: "ENUM", enumvalues: l[u - 1] };
                break;
              case 579:
                this.$ = l[u - 1], l[u - 1].dbtypeid += "[" + l[u] + "]";
                break;
              case 581:
              case 795:
                this.$ = +l[u];
                break;
              case 583:
                this.$ = void 0;
                break;
              case 585:
                d.extend(l[u - 1], l[u]), this.$ = l[u - 1];
                break;
              case 588:
                this.$ = { primarykey: true };
                break;
              case 589:
              case 590:
                this.$ = { foreignkey: { table: l[u - 2], columnid: l[u - 1] } }, d.extend(this.$.foreignkey, l[u]);
                break;
              case 591:
                this.$ = { identity: { value: l[u - 3], step: l[u - 1] } };
                break;
              case 592:
                this.$ = { identity: { value: 1, step: 1 } };
                break;
              case 593:
              case 595:
                this.$ = { default: l[u] };
                break;
              case 594:
                this.$ = { default: l[u - 1] };
                break;
              case 596:
                this.$ = { null: true };
                break;
              case 597:
                this.$ = { notnull: true };
                break;
              case 598:
                this.$ = { check: l[u] };
                break;
              case 599:
                this.$ = { unique: true };
                break;
              case 600:
                this.$ = { onupdate: l[u] };
                break;
              case 601:
                this.$ = { onupdate: l[u - 1] };
                break;
              case 602:
                this.$ = new d.DropTable({ tables: l[u], type: l[u - 2] }), d.extend(this.$, l[u - 1]);
                break;
              case 606:
                this.$ = { ifexists: true };
                break;
              case 607:
                this.$ = new d.AlterTable({ table: l[u - 3], renameto: l[u] });
                break;
              case 608:
                this.$ = new d.AlterTable({ table: l[u - 3], addcolumn: l[u] });
                break;
              case 609:
                this.$ = new d.AlterTable({ table: l[u - 3], modifycolumn: l[u] });
                break;
              case 610:
                this.$ = new d.AlterTable({ table: l[u - 5], renamecolumn: l[u - 2], to: l[u] });
                break;
              case 611:
                this.$ = new d.AlterTable({ table: l[u - 3], dropcolumn: l[u] });
                break;
              case 612:
                this.$ = new d.AlterTable({ table: l[u - 2], renameto: l[u] });
                break;
              case 613:
                this.$ = new d.AttachDatabase({ databaseid: l[u], engineid: l[u - 2].toUpperCase() });
                break;
              case 614:
                this.$ = new d.AttachDatabase({ databaseid: l[u - 3], engineid: l[u - 5].toUpperCase(), args: l[u - 1] });
                break;
              case 615:
                this.$ = new d.AttachDatabase({ databaseid: l[u - 2], engineid: l[u - 4].toUpperCase(), as: l[u] });
                break;
              case 616:
                this.$ = new d.AttachDatabase({ databaseid: l[u - 5], engineid: l[u - 7].toUpperCase(), as: l[u], args: l[u - 3] });
                break;
              case 617:
                this.$ = new d.DetachDatabase({ databaseid: l[u] });
                break;
              case 618:
                this.$ = new d.CreateDatabase({ databaseid: l[u] }), d.extend(this.$, l[u]);
                break;
              case 619:
                this.$ = new d.CreateDatabase({ engineid: l[u - 4].toUpperCase(), databaseid: l[u - 1], as: l[u] }), d.extend(this.$, l[u - 2]);
                break;
              case 620:
                this.$ = new d.CreateDatabase({ engineid: l[u - 7].toUpperCase(), databaseid: l[u - 4], args: l[u - 2], as: l[u] }), d.extend(this.$, l[u - 5]);
                break;
              case 621:
                this.$ = new d.CreateDatabase({ engineid: l[u - 4].toUpperCase(), as: l[u], args: [l[u - 1]] }), d.extend(this.$, l[u - 2]);
                break;
              case 622:
                this.$ = void 0;
                break;
              case 624:
              case 625:
                this.$ = new d.UseDatabase({ databaseid: l[u] });
                break;
              case 626:
                this.$ = new d.DropDatabase({ databaseid: l[u] }), d.extend(this.$, l[u - 1]);
                break;
              case 627:
              case 628:
                this.$ = new d.DropDatabase({ databaseid: l[u], engineid: l[u - 3].toUpperCase() }), d.extend(this.$, l[u - 1]);
                break;
              case 629:
                this.$ = new d.CreateIndex({ indexid: l[u - 5], table: l[u - 3], columns: l[u - 1] });
                break;
              case 630:
                this.$ = new d.CreateIndex({ indexid: l[u - 5], table: l[u - 3], columns: l[u - 1], unique: true });
                break;
              case 631:
                this.$ = new d.DropIndex({ indexid: l[u] });
                break;
              case 632:
                this.$ = new d.ShowDatabases();
                break;
              case 633:
                this.$ = new d.ShowDatabases({ like: l[u] });
                break;
              case 634:
                this.$ = new d.ShowDatabases({ engineid: l[u - 1].toUpperCase() });
                break;
              case 635:
                this.$ = new d.ShowDatabases({ engineid: l[u - 3].toUpperCase(), like: l[u] });
                break;
              case 636:
                this.$ = new d.ShowTables();
                break;
              case 637:
                this.$ = new d.ShowTables({ like: l[u] });
                break;
              case 638:
                this.$ = new d.ShowTables({ databaseid: l[u] });
                break;
              case 639:
                this.$ = new d.ShowTables({ like: l[u], databaseid: l[u - 2] });
                break;
              case 640:
                this.$ = new d.ShowColumns({ table: l[u] });
                break;
              case 641:
                this.$ = new d.ShowColumns({ table: l[u - 2], databaseid: l[u] });
                break;
              case 642:
                this.$ = new d.ShowIndex({ table: l[u] });
                break;
              case 643:
                this.$ = new d.ShowIndex({ table: l[u - 2], databaseid: l[u] });
                break;
              case 644:
                this.$ = new d.ShowCreateTable({ table: l[u] });
                break;
              case 645:
                this.$ = new d.ShowCreateTable({ table: l[u - 2], databaseid: l[u] });
                break;
              case 646:
                this.$ = new d.CreateTable({ table: l[u - 6], view: true, select: l[u - 1], viewcolumns: l[u - 4] }), d.extend(this.$, l[u - 9]), d.extend(this.$, l[u - 7]);
                break;
              case 647:
                this.$ = new d.CreateTable({ table: l[u - 3], view: true, select: l[u - 1] }), d.extend(this.$, l[u - 6]), d.extend(this.$, l[u - 4]);
                break;
              case 651:
                this.$ = new d.DropTable({ tables: l[u], view: true }), d.extend(this.$, l[u - 1]);
                break;
              case 652:
              case 805:
                this.$ = new d.ExpressionStatement({ expression: l[u] });
                break;
              case 653:
                this.$ = new d.Source({ url: l[u].value });
                break;
              case 654:
                this.$ = new d.Assert({ value: l[u] });
                break;
              case 655:
                this.$ = new d.Assert({ value: l[u].value });
                break;
              case 656:
                this.$ = new d.Assert({ value: l[u], message: l[u - 2] });
                break;
              case 658:
              case 670:
              case 672:
                this.$ = l[u].value;
                break;
              case 659:
              case 667:
                this.$ = +l[u].value;
                break;
              case 660:
                this.$ = !!l[u].value;
                break;
              case 668:
                this.$ = -l[u].value;
                break;
              case 669:
                this.$ = "" + l[u].value;
                break;
              case 678:
                this.$ = {};
                break;
              case 681:
                this.$ = [];
                break;
              case 682:
                d.extend(l[u - 2], l[u]), this.$ = l[u - 2];
                break;
              case 684:
                this.$ = {}, this.$[l[u - 2].substr(1, l[u - 2].length - 2)] = l[u];
                break;
              case 685:
              case 686:
                this.$ = {}, this.$[l[u - 2]] = l[u];
                break;
              case 687:
                this.$ = {}, this.$[l[u - 2].substr(1, l[u - 2].length - 2)] = -l[u].value;
                break;
              case 688:
              case 689:
                this.$ = {}, this.$[l[u - 2]] = -l[u].value;
                break;
              case 692:
                this.$ = new d.SetVariable({ variable: l[u - 2].toLowerCase(), value: l[u] });
                break;
              case 693:
                this.$ = new d.SetVariable({ variable: l[u - 1].toLowerCase(), value: l[u] });
                break;
              case 694:
                this.$ = new d.SetVariable({ variable: l[u - 2], expression: l[u] });
                break;
              case 695:
                this.$ = new d.SetVariable({ variable: l[u - 3], props: l[u - 2], expression: l[u] });
                break;
              case 696:
                this.$ = new d.SetVariable({ variable: l[u - 2], expression: l[u], method: l[u - 3] });
                break;
              case 697:
                this.$ = new d.SetVariable({ variable: l[u - 3], props: l[u - 2], expression: l[u], method: l[u - 4] });
                break;
              case 698:
                this.$ = "@";
                break;
              case 699:
                this.$ = "$";
                break;
              case 705:
                this.$ = true;
                break;
              case 706:
                this.$ = false;
                break;
              case 707:
                this.$ = new d.CommitTransaction();
                break;
              case 708:
                this.$ = new d.RollbackTransaction();
                break;
              case 709:
                this.$ = new d.BeginTransaction();
                break;
              case 710:
                this.$ = new d.If({ expression: l[u - 2], thenstat: l[u - 1], elsestat: l[u] }), l[u - 1].exists && (this.$.exists = l[u - 1].exists), l[u - 1].queries && (this.$.queries = l[u - 1].queries);
                break;
              case 711:
                this.$ = new d.If({ expression: l[u - 1], thenstat: l[u] }), l[u].exists && (this.$.exists = l[u].exists), l[u].queries && (this.$.queries = l[u].queries);
                break;
              case 712:
                this.$ = l[u];
                break;
              case 713:
                this.$ = new d.While({ expression: l[u - 1], loopstat: l[u] }), l[u].exists && (this.$.exists = l[u].exists), l[u].queries && (this.$.queries = l[u].queries);
                break;
              case 714:
              case 715:
                this.$ = new d.Continue();
                break;
              case 716:
              case 717:
                this.$ = new d.Break();
                break;
              case 718:
                this.$ = new d.BeginEnd({ statements: l[u - 1] });
                break;
              case 719:
                this.$ = new d.Print({ exprs: l[u] });
                break;
              case 720:
                this.$ = new d.Print({ select: l[u] });
                break;
              case 721:
                this.$ = new d.Require({ paths: l[u] });
                break;
              case 722:
                this.$ = new d.Require({ plugins: l[u] });
                break;
              case 723:
              case 724:
                this.$ = l[u].toUpperCase();
                break;
              case 725:
                this.$ = new d.Echo({ expr: l[u] });
                break;
              case 730:
                this.$ = new d.Declare({ declares: l[u] });
                break;
              case 733:
                this.$ = { variable: l[u - 1] }, d.extend(this.$, l[u]);
                break;
              case 734:
                this.$ = { variable: l[u - 2] }, d.extend(this.$, l[u]);
                break;
              case 735:
                this.$ = { variable: l[u - 3], expression: l[u] }, d.extend(this.$, l[u - 2]);
                break;
              case 736:
                this.$ = { variable: l[u - 4], expression: l[u] }, d.extend(this.$, l[u - 2]);
                break;
              case 737:
                this.$ = new d.TruncateTable({ table: l[u] });
                break;
              case 738:
                this.$ = new d.Merge(), d.extend(this.$, l[u - 4]), d.extend(this.$, l[u - 3]), d.extend(this.$, l[u - 2]), d.extend(this.$, { matches: l[u - 1] }), d.extend(this.$, l[u]);
                break;
              case 739:
              case 740:
                this.$ = { into: l[u] };
                break;
              case 743:
                this.$ = { on: l[u] };
                break;
              case 748:
                this.$ = { matched: true, action: l[u] };
                break;
              case 749:
                this.$ = { matched: true, expr: l[u - 2], action: l[u] };
                break;
              case 750:
                this.$ = { delete: true };
                break;
              case 751:
                this.$ = { update: l[u] };
                break;
              case 752:
              case 753:
                this.$ = { matched: false, bytarget: true, action: l[u] };
                break;
              case 754:
              case 755:
                this.$ = { matched: false, bytarget: true, expr: l[u - 2], action: l[u] };
                break;
              case 756:
                this.$ = { matched: false, bysource: true, action: l[u] };
                break;
              case 757:
                this.$ = { matched: false, bysource: true, expr: l[u - 2], action: l[u] };
                break;
              case 758:
                this.$ = { insert: true, values: l[u] };
                break;
              case 759:
                this.$ = { insert: true, values: l[u], columns: l[u - 3] };
                break;
              case 760:
                this.$ = { insert: true, defaultvalues: true };
                break;
              case 761:
                this.$ = { insert: true, defaultvalues: true, columns: l[u - 3] };
                break;
              case 763:
                this.$ = { output: { columns: l[u] } };
                break;
              case 764:
                this.$ = { output: { columns: l[u - 3], intovar: l[u], method: l[u - 1] } };
                break;
              case 765:
                this.$ = { output: { columns: l[u - 2], intotable: l[u] } };
                break;
              case 766:
                this.$ = { output: { columns: l[u - 5], intotable: l[u - 3], intocolumns: l[u - 1] } };
                break;
              case 767:
                this.$ = new d.CreateVertex({ class: l[u - 3], sharp: l[u - 2], name: l[u - 1] }), d.extend(this.$, l[u]);
                break;
              case 770:
                this.$ = { sets: l[u] };
                break;
              case 771:
                this.$ = { content: l[u] };
                break;
              case 772:
                this.$ = { select: l[u] };
                break;
              case 773:
                this.$ = new d.CreateEdge({ from: l[u - 3], to: l[u - 1], name: l[u - 5] }), d.extend(this.$, l[u]);
                break;
              case 774:
                this.$ = new d.CreateGraph({ graph: l[u] });
                break;
              case 775:
                this.$ = new d.CreateGraph({ from: l[u] });
                break;
              case 778:
                this.$ = l[u - 2], l[u - 1] && (this.$.json = new d.Json({ value: l[u - 1] })), l[u] && (this.$.as = l[u]);
                break;
              case 779:
                this.$ = { source: l[u - 6], target: l[u] }, l[u - 3] && (this.$.json = new d.Json({ value: l[u - 3] })), l[u - 2] && (this.$.as = l[u - 2]), d.extend(this.$, l[u - 4]);
                break;
              case 780:
                this.$ = { source: l[u - 5], target: l[u] }, l[u - 2] && (this.$.json = new d.Json({ value: l[u - 3] })), l[u - 1] && (this.$.as = l[u - 2]);
                break;
              case 781:
                this.$ = { source: l[u - 2], target: l[u] };
                break;
              case 785:
                this.$ = { vars: l[u], method: l[u - 1] };
                break;
              case 788:
              case 789:
                var mn = l[u - 1];
                this.$ = { prop: l[u - 3], sharp: l[u - 2], name: typeof mn > "u" ? void 0 : mn.substr(1, mn.length - 2), class: l[u] };
                break;
              case 790:
                var vn = l[u - 1];
                this.$ = { sharp: l[u - 2], name: typeof vn > "u" ? void 0 : vn.substr(1, vn.length - 2), class: l[u] };
                break;
              case 791:
                var Ht = l[u - 1];
                this.$ = { name: typeof Ht > "u" ? void 0 : Ht.substr(1, Ht.length - 2), class: l[u] };
                break;
              case 792:
                this.$ = { class: l[u] };
                break;
              case 798:
                this.$ = new d.AddRule({ left: l[u - 2], right: l[u] });
                break;
              case 799:
                this.$ = new d.AddRule({ right: l[u] });
                break;
              case 802:
                this.$ = { termid: l[u] };
                break;
              case 803:
                this.$ = { termid: l[u - 3], args: l[u - 1] };
                break;
              case 806:
                this.$ = new d.CreateTrigger({ trigger: l[u - 6], when: l[u - 5], action: l[u - 4], table: l[u - 2], statement: l[u] }), l[u].exists && (this.$.exists = l[u].exists), l[u].queries && (this.$.queries = l[u].queries);
                break;
              case 807:
                this.$ = new d.CreateTrigger({ trigger: l[u - 5], when: l[u - 4], action: l[u - 3], table: l[u - 1], funcid: l[u] });
                break;
              case 808:
                this.$ = new d.CreateTrigger({ trigger: l[u - 6], when: l[u - 4], action: l[u - 3], table: l[u - 5], statement: l[u] }), l[u].exists && (this.$.exists = l[u].exists), l[u].queries && (this.$.queries = l[u].queries);
                break;
              case 809:
              case 810:
              case 812:
                this.$ = "AFTER";
                break;
              case 811:
                this.$ = "BEFORE";
                break;
              case 813:
                this.$ = "INSTEADOF";
                break;
              case 814:
                this.$ = "INSERT";
                break;
              case 815:
                this.$ = "DELETE";
                break;
              case 816:
                this.$ = "UPDATE";
                break;
              case 817:
                this.$ = new d.DropTrigger({ trigger: l[u] });
                break;
              case 818:
                this.$ = new d.Reindex({ indexid: l[u] });
                break;
              case 1098:
              case 1122:
              case 1124:
              case 1126:
              case 1130:
              case 1132:
              case 1134:
              case 1136:
              case 1138:
              case 1140:
                this.$ = [];
                break;
              case 1099:
              case 1117:
              case 1119:
              case 1123:
              case 1125:
              case 1127:
              case 1131:
              case 1133:
              case 1135:
              case 1137:
              case 1139:
              case 1141:
                l[u - 1].push(l[u]);
                break;
              case 1116:
              case 1118:
                this.$ = [l[u]];
                break;
            }
          }, table: [e([14, 639, 798], r, { 12: 1, 13: 2, 16: 3, 17: 4, 21: 5, 22: 7, 23: 8, 24: 9, 25: 10, 26: 11, 27: 12, 28: 13, 29: 14, 30: 15, 31: 16, 32: 17, 33: 18, 34: 19, 35: 20, 36: 21, 37: 22, 38: 23, 39: 24, 40: 25, 41: 26, 42: 27, 43: 28, 44: 29, 45: 30, 46: 31, 47: 32, 48: 33, 49: 34, 50: 35, 51: 36, 52: 37, 53: 38, 54: 39, 55: 40, 56: 41, 57: 42, 59: 44, 60: 45, 61: 46, 62: 47, 63: 48, 64: 49, 65: 50, 66: 51, 67: 52, 68: 53, 69: 54, 70: 55, 71: 56, 72: 57, 73: 58, 74: 59, 75: 60, 76: 61, 86: 76, 543: 99, 193: 103, 3: 104, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 18: m, 58: E, 77: p, 83: h, 96: g, 133: O, 155: T, 165: v, 198: N, 294: b, 295: L, 322: C, 368: a1, 372: r1, 373: H, 433: C1, 437: k1, 438: V1, 441: J1, 443: R, 445: U1, 446: ee, 454: _1, 455: K1, 466: Se, 472: Ie, 474: Xe, 475: Ve, 477: we, 478: Ge, 479: Me, 480: Ze, 481: Re, 482: Oe, 483: Pe, 487: He, 488: l2, 491: v2, 492: k2, 545: I2, 546: w2, 555: _2 }), { 1: [3] }, { 14: [1, 113], 15: 114, 639: A4, 798: N4 }, e(U2, [2, 12]), e(U2, [2, 13]), e(B, [2, 16]), e(U2, r, { 21: 5, 22: 7, 23: 8, 24: 9, 25: 10, 26: 11, 27: 12, 28: 13, 29: 14, 30: 15, 31: 16, 32: 17, 33: 18, 34: 19, 35: 20, 36: 21, 37: 22, 38: 23, 39: 24, 40: 25, 41: 26, 42: 27, 43: 28, 44: 29, 45: 30, 46: 31, 47: 32, 48: 33, 49: 34, 50: 35, 51: 36, 52: 37, 53: 38, 54: 39, 55: 40, 56: 41, 57: 42, 59: 44, 60: 45, 61: 46, 62: 47, 63: 48, 64: 49, 65: 50, 66: 51, 67: 52, 68: 53, 69: 54, 70: 55, 71: 56, 72: 57, 73: 58, 74: 59, 75: 60, 76: 61, 86: 76, 543: 99, 193: 103, 3: 104, 16: 117, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 19: [1, 118], 58: E, 77: p, 83: h, 96: g, 133: O, 155: T, 165: v, 198: N, 294: b, 295: L, 322: C, 368: a1, 372: r1, 373: H, 433: C1, 437: k1, 438: V1, 441: J1, 443: R, 445: U1, 446: ee, 454: _1, 455: K1, 466: Se, 472: Ie, 474: Xe, 475: Ve, 477: we, 478: Ge, 479: Me, 480: Ze, 481: Re, 482: Oe, 483: Pe, 487: He, 488: l2, 491: v2, 492: k2, 545: I2, 546: w2, 555: _2 }), e(B, [2, 18]), e(B, [2, 19]), e(B, [2, 20]), e(B, [2, 21]), e(B, [2, 22]), e(B, [2, 23]), e(B, [2, 24]), e(B, [2, 25]), e(B, [2, 26]), e(B, [2, 27]), e(B, [2, 28]), e(B, [2, 29]), e(B, [2, 30]), e(B, [2, 31]), e(B, [2, 32]), e(B, [2, 33]), e(B, [2, 34]), e(B, [2, 35]), e(B, [2, 36]), e(B, [2, 37]), e(B, [2, 38]), e(B, [2, 39]), e(B, [2, 40]), e(B, [2, 41], { 93: 119, 260: 120, 127: vt, 271: vt, 273: vt, 171: it, 177: st, 178: at }), e(B, [2, 42]), e(B, [2, 43]), e(B, [2, 44]), e(B, [2, 45]), e(B, [2, 46]), e(B, [2, 47]), e(B, [2, 48]), e(B, [2, 49]), e(B, [2, 50]), e(B, [2, 51]), e(B, [2, 52]), e(B, [2, 53]), e(B, [2, 54]), e(B, [2, 55]), e(B, [2, 56]), e(B, [2, 57]), e(B, [2, 58]), e(B, [2, 59]), e(B, [2, 60]), e(B, [2, 61]), e(B, [2, 62]), e(B, [2, 63]), e(B, [2, 64]), e(B, [2, 65]), e(B, [2, 66]), e(B, [2, 67]), e(B, [2, 68]), e(B, [2, 69]), e(B, [2, 70]), e(B, [2, 71]), e(B, [2, 72]), { 388: [1, 124] }, { 2: t, 3: 125, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, { 2: t, 3: 127, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 165: M, 209: 126, 293: $e, 322: j, 323: U, 324: F, 325: P, 326: G }, e(O4, [2, 532], { 3: 136, 383: 140, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 143: C4, 144: R4, 196: [1, 138], 202: [1, 137], 296: [1, 144], 297: [1, 145], 392: [1, 146], 442: [1, 135], 511: [1, 139], 547: [1, 143] }), { 154: k4, 489: 147, 490: 148 }, { 192: [1, 150] }, { 442: [1, 151] }, { 2: t, 3: 153, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 139: [1, 159], 202: [1, 154], 388: [1, 158], 434: 155, 442: [1, 152], 447: [1, 156], 547: [1, 157] }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 160, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(St, Zt, { 374: 224, 180: [1, 226], 207: $t, 377: [1, 225] }), e(St, Zt, { 374: 228, 207: $t }), { 2: t, 3: 240, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: kn, 141: z2, 152: w, 153: 233, 154: i1, 161: _, 165: M, 190: x, 207: [1, 231], 208: 234, 209: 236, 210: 235, 211: 237, 218: 230, 227: 238, 229: Z2, 293: $e, 322: j, 323: U, 324: F, 325: P, 326: G, 335: D, 456: 209, 457: I3, 461: k, 493: 229 }, { 2: t, 3: 242, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, { 388: [1, 243] }, e(en, [2, 1094], { 87: 244, 115: 245, 116: I4 }), { 44: 247, 45: 248, 83: h, 86: 76, 96: g, 193: 103, 198: N }, e(w4, [2, 1098], { 97: 249 }), { 2: t, 3: 253, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 199: [1, 251], 202: [1, 254], 295: [1, 250], 388: [1, 255], 442: [1, 252] }, { 388: [1, 256] }, { 2: t, 3: 260, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 78: 257, 80: 258, 81: [1, 259] }, e([339, 639, 798], r, { 16: 3, 17: 4, 21: 5, 22: 7, 23: 8, 24: 9, 25: 10, 26: 11, 27: 12, 28: 13, 29: 14, 30: 15, 31: 16, 32: 17, 33: 18, 34: 19, 35: 20, 36: 21, 37: 22, 38: 23, 39: 24, 40: 25, 41: 26, 42: 27, 43: 28, 44: 29, 45: 30, 46: 31, 47: 32, 48: 33, 49: 34, 50: 35, 51: 36, 52: 37, 53: 38, 54: 39, 55: 40, 56: 41, 57: 42, 59: 44, 60: 45, 61: 46, 62: 47, 63: 48, 64: 49, 65: 50, 66: 51, 67: 52, 68: 53, 69: 54, 70: 55, 71: 56, 72: 57, 73: 58, 74: 59, 75: 60, 76: 61, 86: 76, 543: 99, 193: 103, 3: 104, 13: 262, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 18: m, 58: E, 77: p, 83: h, 96: g, 133: O, 155: T, 165: v, 198: N, 294: b, 295: L, 322: C, 368: a1, 372: r1, 373: H, 433: C1, 437: k1, 438: V1, 441: J1, 443: R, 445: U1, 446: ee, 454: _1, 455: K1, 466: Se, 472: Ie, 473: [1, 261], 474: Xe, 475: Ve, 477: we, 478: Ge, 479: Me, 480: Ze, 481: Re, 482: Oe, 483: Pe, 487: He, 488: l2, 491: v2, 492: k2, 545: I2, 546: w2, 555: _2 }), { 473: [1, 263] }, { 473: [1, 264] }, { 2: t, 3: 266, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 442: [1, 265] }, { 2: t, 3: 270, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 152: w, 161: _, 190: x, 208: 268, 210: 269, 231: 267, 335: D }, e(he, [2, 326]), { 122: 271, 141: J, 329: y }, { 2: t, 3: 127, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 122: 277, 140: V, 141: [1, 274], 152: w, 153: 272, 154: Ye, 161: _, 165: M, 190: x, 205: 276, 209: 281, 210: 280, 284: 278, 285: 279, 292: hr, 293: dr, 302: 273, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 335: D, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 284, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(B, [2, 714]), e(B, [2, 715]), e(B, [2, 716]), e(B, [2, 717]), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 44: 286, 45: 248, 61: 180, 83: F2, 86: 76, 96: g, 104: 287, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 160: 285, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 193: 103, 198: N, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 294, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 122: 291, 141: J, 329: y, 484: 289, 485: 290, 486: 292, 487: _4 }, { 2: t, 3: 295, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 152: P2, 154: G2, 469: 296 }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 299, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 466: [1, 300] }, { 2: t, 3: 104, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 543: 302, 544: 301 }, { 2: t, 3: 127, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 165: M, 209: 303, 293: $e, 322: j, 323: U, 324: F, 325: P, 326: G }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 304, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(tn, In, { 195: 308, 173: [1, 307], 194: [1, 305], 196: [1, 306], 204: wn }), e(x4, [2, 802], { 83: [1, 310] }), e([2, 4, 5, 6, 7, 8, 9, 14, 77, 83, 84, 103, 108, 116, 127, 137, 140, 141, 146, 152, 154, 161, 163, 165, 171, 173, 177, 178, 188, 189, 190, 192, 194, 196, 204, 207, 229, 252, 266, 267, 271, 273, 281, 292, 293, 294, 298, 299, 301, 304, 313, 314, 315, 316, 317, 318, 319, 320, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 335, 336, 339, 343, 345, 350, 457, 461, 503, 639, 798], [2, 165], { 158: [1, 311], 159: [1, 312], 199: [1, 313], 200: [1, 314], 201: [1, 315], 202: [1, 316], 203: [1, 317] }), e(A, [2, 1]), e(A, [2, 2]), e(A, [2, 3]), e(A, [2, 4]), e(A, [2, 5]), e(A, [2, 6]), { 6: [1, 435], 7: [1, 474], 8: [1, 351], 9: [1, 534], 10: 318, 127: [1, 477], 140: [1, 470], 181: [1, 495], 229: [1, 427], 265: [1, 469], 266: [1, 403], 267: [1, 438], 271: [1, 442], 281: [1, 384], 377: [1, 418], 415: [1, 341], 416: [1, 512], 418: [1, 323], 439: [1, 325], 447: [1, 583], 451: [1, 504], 453: [1, 475], 454: [1, 543], 471: [1, 473], 473: [1, 559], 478: [1, 371], 499: [1, 449], 503: [1, 481], 509: [1, 370], 552: [1, 335], 553: [1, 327], 554: [1, 430], 556: [1, 319], 557: [1, 320], 558: [1, 321], 559: [1, 322], 560: [1, 324], 561: [1, 326], 562: [1, 328], 563: [1, 329], 564: [1, 330], 565: [1, 331], 566: [1, 332], 567: [1, 333], 568: [1, 334], 569: [1, 336], 570: [1, 337], 571: [1, 338], 572: [1, 339], 573: [1, 340], 574: [1, 342], 575: [1, 343], 576: [1, 344], 577: [1, 345], 578: [1, 346], 579: [1, 347], 580: [1, 348], 581: [1, 349], 582: [1, 350], 583: [1, 352], 584: [1, 353], 585: [1, 354], 586: [1, 355], 587: [1, 356], 588: [1, 357], 589: [1, 358], 590: [1, 359], 591: [1, 360], 592: [1, 361], 593: [1, 362], 594: [1, 363], 595: [1, 364], 596: [1, 365], 597: [1, 366], 598: [1, 367], 599: [1, 368], 600: [1, 369], 601: [1, 372], 602: [1, 373], 603: [1, 374], 604: [1, 375], 605: [1, 376], 606: [1, 377], 607: [1, 378], 608: [1, 379], 609: [1, 380], 610: [1, 381], 611: [1, 382], 612: [1, 383], 613: [1, 385], 614: [1, 386], 615: [1, 387], 616: [1, 388], 617: [1, 389], 618: [1, 390], 619: [1, 391], 620: [1, 392], 621: [1, 393], 622: [1, 394], 623: [1, 395], 624: [1, 396], 625: [1, 397], 626: [1, 398], 627: [1, 399], 628: [1, 400], 629: [1, 401], 630: [1, 402], 631: [1, 404], 632: [1, 405], 633: [1, 406], 634: [1, 407], 635: [1, 408], 636: [1, 409], 637: [1, 410], 638: [1, 411], 639: [1, 412], 640: [1, 413], 641: [1, 414], 642: [1, 415], 643: [1, 416], 644: [1, 417], 645: [1, 419], 646: [1, 420], 647: [1, 421], 648: [1, 422], 649: [1, 423], 650: [1, 424], 651: [1, 425], 652: [1, 426], 653: [1, 428], 654: [1, 429], 655: [1, 431], 656: [1, 432], 657: [1, 433], 658: [1, 434], 659: [1, 436], 660: [1, 437], 661: [1, 439], 662: [1, 440], 663: [1, 441], 664: [1, 443], 665: [1, 444], 666: [1, 445], 667: [1, 446], 668: [1, 447], 669: [1, 448], 670: [1, 450], 671: [1, 451], 672: [1, 452], 673: [1, 453], 674: [1, 454], 675: [1, 455], 676: [1, 456], 677: [1, 457], 678: [1, 458], 679: [1, 459], 680: [1, 460], 681: [1, 461], 682: [1, 462], 683: [1, 463], 684: [1, 464], 685: [1, 465], 686: [1, 466], 687: [1, 467], 688: [1, 468], 689: [1, 471], 690: [1, 472], 691: [1, 476], 692: [1, 478], 693: [1, 479], 694: [1, 480], 695: [1, 482], 696: [1, 483], 697: [1, 484], 698: [1, 485], 699: [1, 486], 700: [1, 487], 701: [1, 488], 702: [1, 489], 703: [1, 490], 704: [1, 491], 705: [1, 492], 706: [1, 493], 707: [1, 494], 708: [1, 496], 709: [1, 497], 710: [1, 498], 711: [1, 499], 712: [1, 500], 713: [1, 501], 714: [1, 502], 715: [1, 503], 716: [1, 505], 717: [1, 506], 718: [1, 507], 719: [1, 508], 720: [1, 509], 721: [1, 510], 722: [1, 511], 723: [1, 513], 724: [1, 514], 725: [1, 515], 726: [1, 516], 727: [1, 517], 728: [1, 518], 729: [1, 519], 730: [1, 520], 731: [1, 521], 732: [1, 522], 733: [1, 523], 734: [1, 524], 735: [1, 525], 736: [1, 526], 737: [1, 527], 738: [1, 528], 739: [1, 529], 740: [1, 530], 741: [1, 531], 742: [1, 532], 743: [1, 533], 744: [1, 535], 745: [1, 536], 746: [1, 537], 747: [1, 538], 748: [1, 539], 749: [1, 540], 750: [1, 541], 751: [1, 542], 752: [1, 544], 753: [1, 545], 754: [1, 546], 755: [1, 547], 756: [1, 548], 757: [1, 549], 758: [1, 550], 759: [1, 551], 760: [1, 552], 761: [1, 553], 762: [1, 554], 763: [1, 555], 764: [1, 556], 765: [1, 557], 766: [1, 558], 767: [1, 560], 768: [1, 561], 769: [1, 562], 770: [1, 563], 771: [1, 564], 772: [1, 565], 773: [1, 566], 774: [1, 567], 775: [1, 568], 776: [1, 569], 777: [1, 570], 778: [1, 571], 779: [1, 572], 780: [1, 573], 781: [1, 574], 782: [1, 575], 783: [1, 576], 784: [1, 577], 785: [1, 578], 786: [1, 579], 787: [1, 580], 788: [1, 581], 789: [1, 582], 790: [1, 584], 791: [1, 585], 792: [1, 586], 793: [1, 587], 794: [1, 588], 795: [1, 589], 796: [1, 590], 797: [1, 591] }, { 1: [2, 10] }, e(U2, r, { 21: 5, 22: 7, 23: 8, 24: 9, 25: 10, 26: 11, 27: 12, 28: 13, 29: 14, 30: 15, 31: 16, 32: 17, 33: 18, 34: 19, 35: 20, 36: 21, 37: 22, 38: 23, 39: 24, 40: 25, 41: 26, 42: 27, 43: 28, 44: 29, 45: 30, 46: 31, 47: 32, 48: 33, 49: 34, 50: 35, 51: 36, 52: 37, 53: 38, 54: 39, 55: 40, 56: 41, 57: 42, 59: 44, 60: 45, 61: 46, 62: 47, 63: 48, 64: 49, 65: 50, 66: 51, 67: 52, 68: 53, 69: 54, 70: 55, 71: 56, 72: 57, 73: 58, 74: 59, 75: 60, 76: 61, 86: 76, 543: 99, 193: 103, 3: 104, 16: 592, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 58: E, 77: p, 83: h, 96: g, 133: O, 155: T, 165: v, 198: N, 294: b, 295: L, 322: C, 368: a1, 372: r1, 373: H, 433: C1, 437: k1, 438: V1, 441: J1, 443: R, 445: U1, 446: ee, 454: _1, 455: K1, 466: Se, 472: Ie, 474: Xe, 475: Ve, 477: we, 478: Ge, 479: Me, 480: Ze, 481: Re, 482: Oe, 483: Pe, 487: He, 488: l2, 491: v2, 492: k2, 545: I2, 546: w2, 555: _2 }), e(D4, [2, 1092]), e(D4, [2, 1093]), e(U2, [2, 14]), { 20: [1, 593] }, e(_n, pr, { 94: 594, 127: br }), { 45: 598, 83: [1, 600], 86: 599, 99: 597, 193: 103, 198: N, 261: 596 }, e($2, [2, 253], { 173: [1, 601], 262: [1, 602] }), e($2, [2, 255], { 262: [1, 603] }), e($2, [2, 256], { 262: [1, 604] }), { 2: t, 3: 270, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 208: 605 }, { 442: [1, 606] }, e(B, [2, 805]), { 83: ot }, { 83: [1, 608] }, { 83: L4 }, { 83: gr }, { 83: [1, 611] }, { 83: [1, 612] }, { 83: [1, 613] }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 614, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(x2, xn, { 385: 615, 165: Dn }), { 442: [1, 617] }, { 2: t, 3: 618, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, { 202: [1, 619] }, { 2: t, 3: 625, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 141: lt, 146: y2, 152: P2, 154: G2, 161: D2, 192: [1, 621], 469: 632, 512: 620, 513: 622, 514: 623, 517: 624, 521: 629, 532: 626, 536: 628 }, { 139: [1, 636], 384: 633, 388: [1, 635], 447: [1, 634] }, { 122: 638, 141: J, 192: [2, 1218], 329: y, 510: 637 }, e(V4, [2, 1212], { 504: 639, 3: 640, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }), { 2: t, 3: 641, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, { 4: [1, 642] }, { 4: [1, 643] }, e(O4, [2, 533]), e(B, [2, 730], { 79: [1, 644] }), e(u2, [2, 731]), { 2: t, 3: 645, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, { 2: t, 3: 270, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 152: w, 161: _, 190: x, 208: 268, 210: 269, 231: 646, 335: D }, { 2: t, 3: 647, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, e(x2, Ln, { 435: 648, 165: Vn }), { 442: [1, 650] }, { 2: t, 3: 651, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, e(x2, Ln, { 435: 652, 165: Vn }), e(x2, Ln, { 435: 653, 165: Vn }), { 2: t, 3: 654, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, e(Mn, [2, 1206]), e(Mn, [2, 1207]), e(B, r, { 21: 5, 22: 7, 23: 8, 24: 9, 25: 10, 26: 11, 27: 12, 28: 13, 29: 14, 30: 15, 31: 16, 32: 17, 33: 18, 34: 19, 35: 20, 36: 21, 37: 22, 38: 23, 39: 24, 40: 25, 41: 26, 42: 27, 43: 28, 44: 29, 45: 30, 46: 31, 47: 32, 48: 33, 49: 34, 50: 35, 51: 36, 52: 37, 53: 38, 54: 39, 55: 40, 56: 41, 57: 42, 59: 44, 60: 45, 61: 46, 62: 47, 63: 48, 64: 49, 65: 50, 66: 51, 67: 52, 68: 53, 69: 54, 70: 55, 71: 56, 72: 57, 73: 58, 74: 59, 75: 60, 76: 61, 86: 76, 543: 99, 193: 103, 3: 104, 16: 655, 123: 672, 360: 684, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 58: E, 77: p, 83: h, 96: g, 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 133: M4, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 155: T, 163: ce, 165: v, 179: Ee, 180: me, 188: y1, 189: G1, 198: N, 294: b, 295: L, 322: C, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1, 366: ge, 368: a1, 372: r1, 373: H, 433: C1, 437: k1, 438: V1, 441: J1, 443: R, 445: U1, 446: ee, 454: _1, 455: K1, 466: Se, 472: Ie, 474: Xe, 475: Ve, 477: we, 478: Ge, 479: Me, 480: Ze, 481: Re, 482: Oe, 483: Pe, 487: He, 488: l2, 491: v2, 492: k2, 545: I2, 546: w2, 555: _2 }), e(he, [2, 302]), e(he, [2, 303]), e(he, [2, 304]), e(he, [2, 305]), e(he, [2, 306]), e(he, [2, 307]), e(he, [2, 308]), e(he, [2, 309]), e(he, [2, 310]), e(he, [2, 311]), e(he, [2, 312]), e(he, [2, 313]), e(he, [2, 314]), e(he, [2, 315]), e(he, [2, 316]), e(he, [2, 317]), e(he, [2, 318]), e(he, [2, 319]), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 30: 701, 31: 700, 40: 696, 44: 695, 45: 248, 61: 180, 83: F2, 86: 76, 96: g, 104: 698, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 193: 103, 198: N, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 291: 697, 292: p1, 293: b1, 294: b, 295: U4, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: F4, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 373: H, 456: 209, 457: I3, 461: k }, e(he, [2, 323]), e(he, [2, 324]), e(Un, [2, 325], { 83: gr }), { 83: [1, 703] }, { 83: [1, 704] }, e([2, 4, 5, 6, 7, 8, 9, 14, 58, 77, 79, 82, 84, 96, 103, 105, 108, 109, 116, 121, 124, 127, 131, 132, 133, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 188, 189, 190, 192, 194, 196, 198, 207, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 252, 259, 266, 267, 268, 269, 271, 273, 294, 295, 304, 313, 314, 315, 316, 317, 318, 319, 320, 322, 329, 333, 339, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 363, 364, 365, 366, 368, 372, 373, 433, 437, 438, 441, 443, 445, 446, 454, 455, 457, 461, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 503, 509, 545, 546, 555, 639, 798], Er, { 83: ot, 125: [1, 705] }), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 706, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 707, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 708, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 709, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 710, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(P4, G4, { 125: [1, 711] }), e(P4, y4, { 125: [1, 712] }), e(he, [2, 292]), e([2, 4, 5, 6, 7, 8, 9, 14, 58, 77, 79, 82, 83, 84, 96, 103, 105, 108, 109, 116, 121, 124, 125, 127, 131, 132, 133, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 188, 189, 190, 192, 194, 196, 198, 207, 215, 217, 229, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 259, 266, 267, 268, 269, 271, 273, 275, 281, 292, 293, 294, 295, 298, 299, 301, 304, 313, 314, 315, 316, 317, 318, 319, 320, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 335, 336, 339, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 363, 364, 365, 366, 368, 372, 373, 378, 391, 403, 404, 407, 408, 433, 437, 438, 441, 443, 445, 446, 452, 454, 455, 457, 461, 463, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 503, 509, 545, 546, 555, 639, 798, 799, 800], [2, 380]), e(t3, [2, 381]), e(t3, [2, 382]), e(t3, B4), e(t3, [2, 384]), e([2, 4, 5, 6, 7, 8, 9, 14, 58, 77, 79, 82, 83, 84, 96, 103, 105, 108, 109, 116, 121, 124, 125, 127, 131, 132, 133, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 188, 189, 190, 192, 194, 196, 198, 207, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 250, 252, 259, 266, 267, 268, 269, 271, 273, 294, 295, 304, 313, 314, 315, 316, 317, 318, 319, 320, 322, 329, 330, 333, 339, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 363, 364, 365, 366, 368, 372, 373, 378, 391, 403, 404, 407, 408, 433, 437, 438, 441, 443, 445, 446, 454, 455, 457, 461, 463, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 503, 509, 545, 546, 555, 639, 798], [2, 385]), { 2: t, 3: 714, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 140: [1, 715], 334: 713 }, { 2: t, 3: 716, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, e(Tt, [2, 391]), e(Tt, [2, 392]), { 2: t, 3: 717, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: mr, 122: 719, 140: V, 141: J, 152: w, 161: _, 190: x, 205: 720, 210: 722, 284: 721, 327: t1, 328: n1, 329: y, 335: D, 456: 723, 461: k }, { 83: [1, 724] }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 725, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 337: 726, 340: 727, 341: Fn, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 83: [1, 729] }, { 83: [1, 730] }, e(f2, [2, 662]), { 2: t, 3: 746, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: nn, 120: 741, 122: 739, 140: V, 141: J, 152: w, 153: 735, 154: Ye, 161: _, 165: M, 190: x, 205: 737, 209: 744, 210: 743, 229: Qe, 281: ze, 284: 740, 285: 742, 293: $e, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 333: [1, 733], 335: D, 350: rn, 456: 209, 457: I3, 458: 731, 459: 734, 460: 736, 461: k, 464: 732 }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 287, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 160: 749, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 750, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 165: M, 209: 751, 293: $e, 322: j, 323: U, 324: F, 325: P, 326: G }, { 83: [2, 356] }, { 83: [2, 357] }, { 83: [2, 358] }, { 83: [2, 359] }, { 83: [2, 360] }, { 83: [2, 361] }, { 83: [2, 362] }, { 83: [2, 363] }, { 83: [2, 364] }, { 83: [2, 365] }, { 2: t, 3: 757, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 140: J4, 141: j4, 462: 752, 463: [1, 753], 465: 754 }, { 2: t, 3: 270, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 152: w, 161: _, 190: x, 208: 268, 210: 269, 231: 758, 335: D }, e(St, Zt, { 374: 759, 207: $t }), { 322: [1, 760] }, e(St, [2, 503]), { 2: t, 3: 270, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 152: w, 161: _, 190: x, 208: 268, 210: 269, 231: 761, 335: D }, { 251: [1, 763], 494: 762 }, { 251: [2, 739] }, { 2: t, 3: 240, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: kn, 141: z2, 152: w, 153: 233, 154: i1, 161: _, 165: M, 190: x, 208: 234, 209: 236, 210: 235, 211: 237, 218: 764, 227: 238, 229: Z2, 293: $e, 322: j, 323: U, 324: F, 325: P, 326: G, 335: D, 456: 209, 457: I3, 461: k }, { 44: 765, 45: 248, 83: h, 86: 76, 96: g, 193: 103, 198: N }, e(Pn, [2, 1148], { 220: 766, 82: [1, 767] }), e(xe, [2, 1152], { 222: 768, 230: 770, 3: 771, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 82: S2, 163: [1, 769] }), e(xe, [2, 1154], { 3: 771, 224: 773, 230: 774, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 82: S2 }), e(xe, [2, 1156], { 3: 771, 225: 775, 230: 776, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 82: S2 }), e(xe, [2, 1158], { 3: 771, 226: 777, 230: 778, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 82: S2 }), e(xe, [2, 1160], { 3: 771, 228: 779, 230: 780, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 82: S2 }), e(xe, [2, 201]), e([2, 4, 5, 6, 7, 8, 9, 14, 77, 79, 82, 84, 103, 108, 127, 137, 163, 171, 177, 178, 192, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 271, 273, 339, 343, 503, 639, 798], H4, { 83: ot, 125: Y4 }), e([2, 4, 5, 6, 7, 8, 9, 14, 77, 79, 82, 84, 103, 108, 127, 137, 171, 177, 178, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 271, 273, 339, 343, 503, 639, 798], [2, 204]), e(B, [2, 818]), { 2: t, 3: 270, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 208: 782 }, e(ut, vr, { 88: 783, 207: Sr }), e(en, [2, 1095]), e(W4, [2, 1112], { 117: 785, 199: [1, 786] }), { 84: [1, 787] }, e(B2, vt, { 93: 119, 260: 120, 171: it, 177: st, 178: at }), e([14, 84, 192, 339, 343, 503, 639, 798], vr, { 456: 209, 88: 788, 126: 789, 3: 790, 123: 793, 153: 815, 167: 825, 169: 826, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 77: f3, 82: c3, 83: h3, 121: d32, 124: I1, 125: w1, 127: p3, 131: b3, 132: g3, 133: E3, 137: m3, 138: v3, 139: S3, 140: T3, 141: A3, 142: N3, 143: O3, 144: C3, 145: R3, 146: k3, 147: I32, 148: w3, 149: _3, 150: x3, 151: D3, 152: L3, 154: V3, 155: M3, 157: U3, 158: F3, 159: P3, 161: G3, 163: y3, 165: B3, 171: J3, 173: j3, 175: H3, 177: Y3, 178: W3, 179: X3, 180: K3, 181: q3, 182: Q3, 184: z3, 194: Z3, 196: $3, 207: Sr, 266: Y, 267: W, 304: e2, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 457: I3, 461: k }), { 388: [1, 840] }, { 192: [1, 841] }, e(B, [2, 632], { 121: [1, 842] }), { 442: [1, 843] }, { 192: [1, 844] }, e(B, [2, 636], { 121: [1, 845], 192: [1, 846] }), { 2: t, 3: 270, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 208: 847 }, { 44: 848, 45: 248, 79: [1, 849], 83: h, 86: 76, 96: g, 193: 103, 198: N }, e(At, [2, 76]), { 2: t, 3: 260, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 80: 850 }, { 82: [1, 851], 83: [1, 852] }, e(B, [2, 709]), { 15: 114, 339: [1, 853], 639: A4, 798: N4 }, e(B, [2, 707]), e(B, [2, 708]), { 2: t, 3: 854, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, e(B, [2, 625]), { 155: [1, 855] }, e(X4, [2, 207]), e(X4, [2, 208]), e([2, 4, 5, 6, 7, 8, 9, 14, 58, 77, 79, 82, 83, 84, 96, 105, 133, 137, 152, 154, 155, 157, 158, 161, 163, 165, 190, 192, 196, 198, 250, 294, 295, 322, 330, 335, 339, 343, 368, 372, 373, 378, 379, 391, 403, 404, 407, 408, 433, 437, 438, 439, 440, 441, 443, 445, 446, 454, 455, 457, 461, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 503, 545, 546, 552, 553, 554, 555, 639, 798], H4, { 125: Y4 }), e(B, [2, 653]), e(B, [2, 654]), e(B, [2, 655]), e(B, B4, { 79: [1, 856] }), { 83: mr, 122: 719, 140: V, 141: J, 152: w, 161: _, 190: x, 205: 720, 210: 722, 284: 721, 327: t1, 328: n1, 329: y, 335: D, 456: 723, 461: k }, e(De, [2, 335]), e(De, [2, 336]), e(De, [2, 337]), e(De, [2, 338]), e(De, [2, 339]), e(De, [2, 340]), e(De, [2, 341]), e(De, [2, 342], { 83: gr }), e(B, r, { 21: 5, 22: 7, 23: 8, 24: 9, 25: 10, 26: 11, 27: 12, 28: 13, 29: 14, 30: 15, 31: 16, 32: 17, 33: 18, 34: 19, 35: 20, 36: 21, 37: 22, 38: 23, 39: 24, 40: 25, 41: 26, 42: 27, 43: 28, 44: 29, 45: 30, 46: 31, 47: 32, 48: 33, 49: 34, 50: 35, 51: 36, 52: 37, 53: 38, 54: 39, 55: 40, 56: 41, 57: 42, 59: 44, 60: 45, 61: 46, 62: 47, 63: 48, 64: 49, 65: 50, 66: 51, 67: 52, 68: 53, 69: 54, 70: 55, 71: 56, 72: 57, 73: 58, 74: 59, 75: 60, 76: 61, 86: 76, 543: 99, 193: 103, 3: 104, 123: 672, 360: 684, 16: 857, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 58: E, 77: p, 83: h, 96: g, 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 133: M4, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 155: T, 163: ce, 165: v, 179: Ee, 180: me, 188: y1, 189: G1, 198: N, 294: b, 295: L, 322: C, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1, 366: ge, 368: a1, 372: r1, 373: H, 433: C1, 437: k1, 438: V1, 441: J1, 443: R, 445: U1, 446: ee, 454: _1, 455: K1, 466: Se, 472: Ie, 474: Xe, 475: Ve, 477: we, 478: Ge, 479: Me, 480: Ze, 481: Re, 482: Oe, 483: Pe, 487: He, 488: l2, 491: v2, 492: k2, 545: I2, 546: w2, 555: _2 }), e(B, [2, 719], { 79: t2 }), e(B, [2, 720]), e(K4, [2, 378], { 123: 672, 360: 684, 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1, 366: ge }), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 30: 701, 31: 700, 40: 696, 44: 860, 45: 248, 61: 180, 83: F2, 86: 76, 96: g, 104: 698, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 193: 103, 198: N, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 291: 697, 292: p1, 293: b1, 294: b, 295: U4, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: F4, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 373: H, 456: 209, 457: I3, 461: k }, e(B, [2, 721], { 79: [1, 861] }), e(B, [2, 722], { 79: [1, 862] }), e(u2, [2, 727]), e(u2, [2, 729]), e(u2, [2, 723]), e(u2, [2, 724]), { 123: 868, 124: I1, 125: w1, 133: [1, 863], 250: q4, 467: 864, 468: 865, 471: Q4 }, { 2: t, 3: 869, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, e(x2, [2, 698]), e(x2, [2, 699]), e(B, [2, 652], { 123: 672, 360: 684, 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1, 366: ge }), { 2: t, 3: 104, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 543: 302, 544: 870 }, e(B, [2, 799], { 79: Tr }), e(ye, [2, 801]), e(B, [2, 804]), e(B, [2, 725], { 123: 672, 360: 684, 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1, 366: ge }), e(ft, In, { 195: 872, 204: wn }), e(ft, In, { 195: 873, 204: wn }), e(ft, In, { 195: 874, 204: wn }), e(Nt, [2, 1142], { 282: 161, 209: 162, 283: 163, 120: 164, 280: 165, 205: 166, 284: 167, 122: 168, 285: 169, 210: 170, 211: 171, 286: 172, 287: 173, 288: 174, 153: 176, 289: 177, 290: 178, 61: 180, 167: 183, 3: 185, 456: 209, 197: 875, 183: 876, 279: 877, 104: 878, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: R1, 140: V, 141: J, 146: o1, 152: w, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 188: f1, 189: c1, 190: x, 229: h1, 266: Y, 267: W, 281: d1, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 457: I3, 461: k }), { 83: [1, 880], 140: V, 205: 879 }, { 2: t, 3: 104, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 543: 302, 544: 881 }, e(ct, [2, 166]), e(ct, [2, 167]), e(ct, [2, 168]), e(ct, [2, 169]), e(ct, [2, 170]), e(ct, [2, 171]), e(ct, [2, 172]), e(A, [2, 7]), e(A, [2, 819]), e(A, [2, 820]), e(A, [2, 821]), e(A, [2, 822]), e(A, [2, 823]), e(A, [2, 824]), e(A, [2, 825]), e(A, [2, 826]), e(A, [2, 827]), e(A, [2, 828]), e(A, [2, 829]), e(A, [2, 830]), e(A, [2, 831]), e(A, [2, 832]), e(A, [2, 833]), e(A, [2, 834]), e(A, [2, 835]), e(A, [2, 836]), e(A, [2, 837]), e(A, [2, 838]), e(A, [2, 839]), e(A, [2, 840]), e(A, [2, 841]), e(A, [2, 842]), e(A, [2, 843]), e(A, [2, 844]), e(A, [2, 845]), e(A, [2, 846]), e(A, [2, 847]), e(A, [2, 848]), e(A, [2, 849]), e(A, [2, 850]), e(A, [2, 851]), e(A, [2, 852]), e(A, [2, 853]), e(A, [2, 854]), e(A, [2, 855]), e(A, [2, 856]), e(A, [2, 857]), e(A, [2, 858]), e(A, [2, 859]), e(A, [2, 860]), e(A, [2, 861]), e(A, [2, 862]), e(A, [2, 863]), e(A, [2, 864]), e(A, [2, 865]), e(A, [2, 866]), e(A, [2, 867]), e(A, [2, 868]), e(A, [2, 869]), e(A, [2, 870]), e(A, [2, 871]), e(A, [2, 872]), e(A, [2, 873]), e(A, [2, 874]), e(A, [2, 875]), e(A, [2, 876]), e(A, [2, 877]), e(A, [2, 878]), e(A, [2, 879]), e(A, [2, 880]), e(A, [2, 881]), e(A, [2, 882]), e(A, [2, 883]), e(A, [2, 884]), e(A, [2, 885]), e(A, [2, 886]), e(A, [2, 887]), e(A, [2, 888]), e(A, [2, 889]), e(A, [2, 890]), e(A, [2, 891]), e(A, [2, 892]), e(A, [2, 893]), e(A, [2, 894]), e(A, [2, 895]), e(A, [2, 896]), e(A, [2, 897]), e(A, [2, 898]), e(A, [2, 899]), e(A, [2, 900]), e(A, [2, 901]), e(A, [2, 902]), e(A, [2, 903]), e(A, [2, 904]), e(A, [2, 905]), e(A, [2, 906]), e(A, [2, 907]), e(A, [2, 908]), e(A, [2, 909]), e(A, [2, 910]), e(A, [2, 911]), e(A, [2, 912]), e(A, [2, 913]), e(A, [2, 914]), e(A, [2, 915]), e(A, [2, 916]), e(A, [2, 917]), e(A, [2, 918]), e(A, [2, 919]), e(A, [2, 920]), e(A, [2, 921]), e(A, [2, 922]), e(A, [2, 923]), e(A, [2, 924]), e(A, [2, 925]), e(A, [2, 926]), e(A, [2, 927]), e(A, [2, 928]), e(A, [2, 929]), e(A, [2, 930]), e(A, [2, 931]), e(A, [2, 932]), e(A, [2, 933]), e(A, [2, 934]), e(A, [2, 935]), e(A, [2, 936]), e(A, [2, 937]), e(A, [2, 938]), e(A, [2, 939]), e(A, [2, 940]), e(A, [2, 941]), e(A, [2, 942]), e(A, [2, 943]), e(A, [2, 944]), e(A, [2, 945]), e(A, [2, 946]), e(A, [2, 947]), e(A, [2, 948]), e(A, [2, 949]), e(A, [2, 950]), e(A, [2, 951]), e(A, [2, 952]), e(A, [2, 953]), e(A, [2, 954]), e(A, [2, 955]), e(A, [2, 956]), e(A, [2, 957]), e(A, [2, 958]), e(A, [2, 959]), e(A, [2, 960]), e(A, [2, 961]), e(A, [2, 962]), e(A, [2, 963]), e(A, [2, 964]), e(A, [2, 965]), e(A, [2, 966]), e(A, [2, 967]), e(A, [2, 968]), e(A, [2, 969]), e(A, [2, 970]), e(A, [2, 971]), e(A, [2, 972]), e(A, [2, 973]), e(A, [2, 974]), e(A, [2, 975]), e(A, [2, 976]), e(A, [2, 977]), e(A, [2, 978]), e(A, [2, 979]), e(A, [2, 980]), e(A, [2, 981]), e(A, [2, 982]), e(A, [2, 983]), e(A, [2, 984]), e(A, [2, 985]), e(A, [2, 986]), e(A, [2, 987]), e(A, [2, 988]), e(A, [2, 989]), e(A, [2, 990]), e(A, [2, 991]), e(A, [2, 992]), e(A, [2, 993]), e(A, [2, 994]), e(A, [2, 995]), e(A, [2, 996]), e(A, [2, 997]), e(A, [2, 998]), e(A, [2, 999]), e(A, [2, 1e3]), e(A, [2, 1001]), e(A, [2, 1002]), e(A, [2, 1003]), e(A, [2, 1004]), e(A, [2, 1005]), e(A, [2, 1006]), e(A, [2, 1007]), e(A, [2, 1008]), e(A, [2, 1009]), e(A, [2, 1010]), e(A, [2, 1011]), e(A, [2, 1012]), e(A, [2, 1013]), e(A, [2, 1014]), e(A, [2, 1015]), e(A, [2, 1016]), e(A, [2, 1017]), e(A, [2, 1018]), e(A, [2, 1019]), e(A, [2, 1020]), e(A, [2, 1021]), e(A, [2, 1022]), e(A, [2, 1023]), e(A, [2, 1024]), e(A, [2, 1025]), e(A, [2, 1026]), e(A, [2, 1027]), e(A, [2, 1028]), e(A, [2, 1029]), e(A, [2, 1030]), e(A, [2, 1031]), e(A, [2, 1032]), e(A, [2, 1033]), e(A, [2, 1034]), e(A, [2, 1035]), e(A, [2, 1036]), e(A, [2, 1037]), e(A, [2, 1038]), e(A, [2, 1039]), e(A, [2, 1040]), e(A, [2, 1041]), e(A, [2, 1042]), e(A, [2, 1043]), e(A, [2, 1044]), e(A, [2, 1045]), e(A, [2, 1046]), e(A, [2, 1047]), e(A, [2, 1048]), e(A, [2, 1049]), e(A, [2, 1050]), e(A, [2, 1051]), e(A, [2, 1052]), e(A, [2, 1053]), e(A, [2, 1054]), e(A, [2, 1055]), e(A, [2, 1056]), e(A, [2, 1057]), e(A, [2, 1058]), e(A, [2, 1059]), e(A, [2, 1060]), e(A, [2, 1061]), e(A, [2, 1062]), e(A, [2, 1063]), e(A, [2, 1064]), e(A, [2, 1065]), e(A, [2, 1066]), e(A, [2, 1067]), e(A, [2, 1068]), e(A, [2, 1069]), e(A, [2, 1070]), e(A, [2, 1071]), e(A, [2, 1072]), e(A, [2, 1073]), e(A, [2, 1074]), e(A, [2, 1075]), e(A, [2, 1076]), e(A, [2, 1077]), e(A, [2, 1078]), e(A, [2, 1079]), e(A, [2, 1080]), e(A, [2, 1081]), e(A, [2, 1082]), e(A, [2, 1083]), e(A, [2, 1084]), e(A, [2, 1085]), e(A, [2, 1086]), e(A, [2, 1087]), e(A, [2, 1088]), e(A, [2, 1089]), e(A, [2, 1090]), e(A, [2, 1091]), e(U2, [2, 11]), e(U2, r, { 21: 5, 22: 7, 23: 8, 24: 9, 25: 10, 26: 11, 27: 12, 28: 13, 29: 14, 30: 15, 31: 16, 32: 17, 33: 18, 34: 19, 35: 20, 36: 21, 37: 22, 38: 23, 39: 24, 40: 25, 41: 26, 42: 27, 43: 28, 44: 29, 45: 30, 46: 31, 47: 32, 48: 33, 49: 34, 50: 35, 51: 36, 52: 37, 53: 38, 54: 39, 55: 40, 56: 41, 57: 42, 59: 44, 60: 45, 61: 46, 62: 47, 63: 48, 64: 49, 65: 50, 66: 51, 67: 52, 68: 53, 69: 54, 70: 55, 71: 56, 72: 57, 73: 58, 74: 59, 75: 60, 76: 61, 86: 76, 543: 99, 193: 103, 3: 104, 16: 882, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 58: E, 77: p, 83: h, 96: g, 133: O, 155: T, 165: v, 198: N, 294: b, 295: L, 322: C, 368: a1, 372: r1, 373: H, 433: C1, 437: k1, 438: V1, 441: J1, 443: R, 445: U1, 446: ee, 454: _1, 455: K1, 466: Se, 472: Ie, 474: Xe, 475: Ve, 477: we, 478: Ge, 479: Me, 480: Ze, 481: Re, 482: Oe, 483: Pe, 487: He, 488: l2, 491: v2, 492: k2, 545: I2, 546: w2, 555: _2 }), e(s3, Ar, { 95: 883, 271: Nr, 273: Or }), { 128: [1, 886] }, e(B2, [2, 252]), e(B2, [2, 261]), e(B2, [2, 262]), e(en, [2, 1102], { 100: 887, 115: 888, 116: I4 }), { 44: 889, 45: 248, 83: h, 86: 76, 96: g, 193: 103, 198: N }, e($2, [2, 254], { 262: [1, 890] }), e($2, [2, 257]), e($2, [2, 259]), e($2, [2, 260]), { 433: [1, 894], 438: [1, 891], 439: [1, 892], 440: [1, 893] }, { 2: t, 3: 895, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, e(ft, [2, 1188], { 321: 896, 801: 898, 84: [1, 897], 173: [1, 900], 194: [1, 899] }), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 287, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 160: 901, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 287, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 160: 902, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 84: [1, 903] }, { 2: t, 3: 904, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 141: [1, 905] }, { 2: t, 3: 906, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 141: [1, 907] }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 908, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 909, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, { 2: t, 3: 910, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, { 163: [1, 911] }, e(Gn, xn, { 385: 912, 165: Dn }), { 250: [1, 913] }, { 2: t, 3: 914, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, e(B, [2, 774], { 79: z4 }), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 916, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(ye, [2, 777]), e(Z4, [2, 1220], { 456: 209, 515: 917, 153: 918, 148: Cr, 150: Cr, 154: Ye, 457: I3, 461: k }), { 148: [1, 919], 150: [1, 920] }, e(yn, $4, { 529: 922, 532: 923, 83: [1, 921], 146: y2 }), e(Bn, [2, 1244], { 533: 924, 141: [1, 925] }), e(O2, [2, 1248], { 535: 926, 536: 927, 161: D2 }), e(O2, [2, 792]), e(ei, [2, 784]), { 2: t, 3: 928, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 140: [1, 929] }, { 2: t, 3: 930, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, { 2: t, 3: 931, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, e(x2, xn, { 385: 932, 165: Dn }), e(x2, xn, { 385: 933, 165: Dn }), e(Mn, [2, 522]), e(Mn, [2, 523]), { 192: [1, 934] }, { 192: [2, 1219] }, e(Rr, [2, 1214], { 505: 935, 508: 936, 146: [1, 937] }), e(V4, [2, 1213]), e(Ot, ti, { 548: 938, 105: ni, 250: [1, 939], 552: ri, 553: ii, 554: si }), { 82: [1, 944] }, { 82: [1, 945] }, { 154: k4, 490: 946 }, { 4: Ct, 11: 950, 82: [1, 948], 300: 947, 424: 949, 426: Rt }, e(B, Ke, { 369: 954, 137: [1, 953], 503: qe }), e(B, [2, 617]), { 2: t, 3: 956, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, { 331: [1, 957] }, e(Gn, Ln, { 435: 958, 165: Vn }), e(B, [2, 631]), { 2: t, 3: 270, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 208: 960, 436: 959 }, { 2: t, 3: 270, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 208: 960, 436: 961 }, e(B, [2, 817]), e(U2, [2, 711], { 476: 962, 343: [1, 963] }), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 964, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 965, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 966, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 967, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 968, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 969, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 970, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 971, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 972, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 973, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 974, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 975, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 976, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 977, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 978, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 979, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 980, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: [1, 982], 140: V, 165: M, 205: 981, 209: 983, 293: $e, 322: j, 323: U, 324: F, 325: P, 326: G }, { 2: t, 3: 984, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: [1, 986], 140: V, 165: M, 205: 985, 209: 987, 293: $e, 322: j, 323: U, 324: F, 325: P, 326: G }, e(ht, [2, 464], { 282: 161, 209: 162, 283: 163, 120: 164, 280: 165, 205: 166, 284: 167, 122: 168, 285: 169, 210: 170, 211: 171, 286: 172, 287: 173, 288: 174, 153: 176, 289: 177, 290: 178, 61: 180, 167: 183, 3: 185, 456: 209, 104: 988, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: R1, 140: V, 141: J, 146: o1, 152: w, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 188: f1, 189: c1, 190: x, 229: h1, 266: Y, 267: W, 281: d1, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 457: I3, 461: k }), e(ht, [2, 465], { 282: 161, 209: 162, 283: 163, 120: 164, 280: 165, 205: 166, 284: 167, 122: 168, 285: 169, 210: 170, 211: 171, 286: 172, 287: 173, 288: 174, 153: 176, 289: 177, 290: 178, 61: 180, 167: 183, 3: 185, 456: 209, 104: 989, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: R1, 140: V, 141: J, 146: o1, 152: w, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 188: f1, 189: c1, 190: x, 229: h1, 266: Y, 267: W, 281: d1, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 457: I3, 461: k }), e(ht, [2, 466], { 282: 161, 209: 162, 283: 163, 120: 164, 280: 165, 205: 166, 284: 167, 122: 168, 285: 169, 210: 170, 211: 171, 286: 172, 287: 173, 288: 174, 153: 176, 289: 177, 290: 178, 61: 180, 167: 183, 3: 185, 456: 209, 104: 990, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: R1, 140: V, 141: J, 146: o1, 152: w, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 188: f1, 189: c1, 190: x, 229: h1, 266: Y, 267: W, 281: d1, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 457: I3, 461: k }), e(ht, [2, 467], { 282: 161, 209: 162, 283: 163, 120: 164, 280: 165, 205: 166, 284: 167, 122: 168, 285: 169, 210: 170, 211: 171, 286: 172, 287: 173, 288: 174, 153: 176, 289: 177, 290: 178, 61: 180, 167: 183, 3: 185, 456: 209, 104: 991, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: R1, 140: V, 141: J, 146: o1, 152: w, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 188: f1, 189: c1, 190: x, 229: h1, 266: Y, 267: W, 281: d1, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 457: I3, 461: k }), e(ht, ai, { 282: 161, 209: 162, 283: 163, 120: 164, 280: 165, 205: 166, 284: 167, 122: 168, 285: 169, 210: 170, 211: 171, 286: 172, 287: 173, 288: 174, 153: 176, 289: 177, 290: 178, 61: 180, 167: 183, 3: 185, 456: 209, 104: 992, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: R1, 140: V, 141: J, 146: o1, 152: w, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 188: f1, 189: c1, 190: x, 229: h1, 266: Y, 267: W, 281: d1, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 457: I3, 461: k }), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 993, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 994, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(ht, [2, 469], { 282: 161, 209: 162, 283: 163, 120: 164, 280: 165, 205: 166, 284: 167, 122: 168, 285: 169, 210: 170, 211: 171, 286: 172, 287: 173, 288: 174, 153: 176, 289: 177, 290: 178, 61: 180, 167: 183, 3: 185, 456: 209, 104: 995, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: R1, 140: V, 141: J, 146: o1, 152: w, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 188: f1, 189: c1, 190: x, 229: h1, 266: Y, 267: W, 281: d1, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 457: I3, 461: k }), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 996, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 997, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 173: [1, 999], 175: [1, 1001], 361: 998, 367: [1, 1e3] }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1002, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1003, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 746, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: [1, 1004], 120: 1007, 154: oi, 165: M, 209: 1008, 211: 1006, 229: Qe, 281: ze, 293: $e, 322: j, 323: U, 324: F, 325: P, 326: G, 362: 1005 }, { 109: [1, 1010], 330: [1, 1011] }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1012, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1013, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1014, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 4: Ct, 11: 950, 300: 1015, 424: 949, 426: Rt }, e(li, [2, 101]), e(li, [2, 102]), { 84: [1, 1016] }, { 84: [1, 1017] }, { 84: [1, 1018] }, { 84: [1, 1019], 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, e(St, Zt, { 374: 228, 83: L4, 207: $t }), { 84: [2, 1180] }, { 84: [2, 1181] }, { 143: C4, 144: R4 }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 287, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 160: 1020, 161: _, 163: u1, 165: M, 167: 183, 173: [1, 1022], 188: f1, 189: c1, 190: x, 194: [1, 1021], 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1023, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 194: [1, 1024], 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 1025, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 154: ui, 158: fi, 189: [1, 1028] }, e([2, 4, 5, 6, 7, 8, 9, 14, 58, 77, 79, 82, 83, 84, 96, 103, 105, 108, 109, 116, 127, 131, 137, 138, 139, 140, 141, 143, 144, 146, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 190, 192, 194, 196, 198, 207, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 252, 259, 266, 267, 268, 269, 271, 273, 294, 295, 304, 313, 314, 315, 316, 317, 318, 319, 320, 322, 329, 333, 339, 341, 342, 343, 347, 363, 364, 366, 368, 372, 373, 433, 437, 438, 441, 443, 445, 446, 454, 455, 457, 461, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 503, 509, 545, 546, 555, 639, 798], [2, 440], { 123: 672, 360: 684, 121: Z1, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 365: $1 }), e(Jn, [2, 441], { 123: 672, 360: 684, 124: I1, 125: w1, 132: M1, 142: F1, 145: D1, 147: P1, 189: G1, 345: L1, 349: x1 }), e(Jn, [2, 442], { 123: 672, 360: 684, 124: I1, 125: w1, 132: M1, 142: F1, 145: D1, 147: P1, 189: G1, 345: L1, 349: x1 }), e(kr, [2, 443], { 123: 672, 360: 684, 349: x1 }), e(kr, [2, 444], { 123: 672, 360: 684, 349: x1 }), { 2: t, 3: 1029, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 189: [1, 1030] }, { 2: t, 3: 1031, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 189: [1, 1032] }, e(Tt, [2, 389]), e(Tt, [2, 1190]), e(Tt, [2, 1191]), e(Tt, [2, 390]), e([2, 4, 5, 6, 7, 8, 9, 14, 58, 77, 79, 82, 83, 84, 96, 103, 105, 108, 109, 116, 121, 124, 125, 127, 131, 132, 133, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 188, 189, 190, 192, 194, 196, 198, 207, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 259, 266, 267, 268, 269, 271, 273, 294, 295, 304, 313, 314, 315, 316, 317, 318, 319, 320, 322, 329, 333, 339, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 363, 364, 365, 366, 368, 372, 373, 433, 437, 438, 441, 443, 445, 446, 454, 455, 457, 461, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 503, 509, 545, 546, 555, 639, 798], [2, 386]), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1033, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(f2, [2, 658]), e(f2, [2, 659]), e(f2, [2, 660]), e(f2, [2, 661]), e(f2, [2, 663]), { 44: 1034, 45: 248, 83: h, 86: 76, 96: g, 193: 103, 198: N }, { 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 337: 1035, 340: 727, 341: Fn, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, { 338: 1036, 339: ci, 340: 1037, 341: Fn, 343: hi }, e(Ir, [2, 396]), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1039, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1040, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 4: Ct, 11: 950, 300: 1041, 424: 949, 426: Rt }, e(f2, [2, 664]), { 79: [1, 1043], 333: [1, 1042] }, e(f2, [2, 681]), e(di, [2, 691]), e(C2, [2, 665]), e(C2, [2, 666]), e(C2, [2, 667]), { 140: V, 205: 1044 }, e(C2, [2, 669]), e(C2, [2, 670]), e(C2, [2, 671]), e(C2, [2, 672]), e(C2, [2, 673]), e(C2, [2, 674]), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1045, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e([2, 4, 5, 6, 7, 8, 9, 14, 58, 77, 79, 82, 84, 96, 103, 105, 108, 109, 116, 121, 124, 127, 131, 132, 133, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 188, 189, 190, 192, 194, 196, 198, 207, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 252, 259, 266, 267, 268, 269, 271, 273, 294, 295, 304, 313, 314, 315, 316, 317, 318, 319, 320, 322, 329, 333, 339, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 363, 364, 365, 366, 368, 372, 373, 433, 437, 438, 441, 443, 445, 446, 454, 455, 457, 461, 463, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 503, 509, 545, 546, 555, 639, 798], Er, { 83: ot, 125: pi }), e(bi, G4, { 125: [1, 1047] }), e(bi, y4, { 125: [1, 1048] }), { 79: t2, 333: [1, 1049] }, e(Un, [2, 329], { 83: ot }), e(he, [2, 330]), { 79: [1, 1051], 463: [1, 1050] }, e(f2, [2, 678]), e(et, [2, 683]), { 161: [1, 1052], 466: [1, 1053] }, { 161: [1, 1054], 466: [1, 1055] }, { 161: [1, 1056], 466: [1, 1057] }, { 44: 1062, 45: 248, 83: [1, 1061], 86: 76, 96: g, 152: w, 153: 1066, 154: Ye, 155: [1, 1063], 158: dt, 161: _, 190: x, 193: 103, 198: N, 210: 1067, 335: D, 375: 1058, 376: 1059, 378: [1, 1060], 379: pt, 456: 209, 457: I3, 461: k }, { 2: t, 3: 270, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 152: w, 161: _, 190: x, 208: 268, 210: 269, 231: 1068, 335: D }, e(St, Zt, { 374: 1069, 207: $t }), { 83: J2, 152: w, 153: 1066, 154: Ye, 158: dt, 161: _, 190: x, 210: 1067, 335: D, 375: 1070, 376: 1071, 379: pt, 456: 209, 457: I3, 461: k }, { 250: [1, 1074], 495: 1073 }, { 2: t, 3: 240, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: [1, 1076], 141: z2, 152: w, 153: 233, 154: i1, 161: _, 165: M, 190: x, 208: 234, 209: 236, 210: 235, 211: 237, 218: 1075, 227: 238, 229: Z2, 293: $e, 322: j, 323: U, 324: F, 325: P, 326: G, 335: D, 456: 209, 457: I3, 461: k }, { 251: [2, 740] }, { 84: [1, 1077] }, e(xe, [2, 1150], { 221: 1078, 3: 1079, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }), e(Pn, [2, 1149]), e(xe, [2, 195]), { 223: [1, 1080] }, e(xe, [2, 1153]), e(xe, [2, 202]), { 2: t, 3: 1081, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, e(xe, [2, 197]), e(xe, [2, 1155]), e(xe, [2, 198]), e(xe, [2, 1157]), e(xe, [2, 199]), e(xe, [2, 1159]), e(xe, [2, 200]), e(xe, [2, 1161]), { 2: t, 3: 1082, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, { 157: [1, 1083] }, e(kt, gi, { 89: 1084, 192: Ei }), { 2: t, 3: 240, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 141: [1, 1090], 152: w, 154: [1, 1091], 161: _, 165: M, 190: x, 208: 1086, 209: 1087, 210: 1088, 211: 1089, 293: $e, 322: j, 323: U, 324: F, 325: P, 326: G, 335: D }, { 2: t, 3: 1096, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 118: 1092, 119: 1093, 120: 1094, 121: mi, 229: Qe, 281: ze }, e(W4, [2, 1113]), e(B2, It, { 260: 120, 93: 1097, 171: it, 177: st, 178: at }), e(s3, [2, 1100], { 98: 1098, 191: 1099, 192: [1, 1100] }), e(w4, [2, 1099], { 162: 1101, 188: n2, 189: r2, 190: i2 }), e([2, 4, 5, 6, 7, 8, 9, 14, 77, 79, 82, 84, 121, 124, 125, 127, 131, 132, 133, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 188, 189, 190, 192, 194, 196, 207, 266, 267, 304, 313, 314, 315, 316, 317, 318, 319, 320, 339, 343, 457, 461, 503, 639, 798], [2, 103], { 83: [1, 1105] }), { 128: [1, 1106] }, e(Ae, [2, 106]), { 2: t, 3: 1107, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, e(Ae, [2, 108]), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1108, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1109, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 790, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 77: f3, 82: c3, 83: h3, 121: d32, 123: 793, 124: I1, 125: w1, 126: 1111, 127: p3, 131: b3, 132: g3, 133: E3, 134: 1110, 137: m3, 138: v3, 139: S3, 140: T3, 141: A3, 142: N3, 143: O3, 144: C3, 145: R3, 146: k3, 147: I32, 148: w3, 149: _3, 150: x3, 151: D3, 152: L3, 153: 815, 154: V3, 155: M3, 157: U3, 158: F3, 159: P3, 161: G3, 163: y3, 165: B3, 167: 825, 169: 826, 171: J3, 173: j3, 175: H3, 177: Y3, 178: W3, 179: X3, 180: K3, 181: q3, 182: Q3, 184: z3, 194: Z3, 196: $3, 266: Y, 267: W, 304: e2, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 456: 209, 457: I3, 461: k }, { 83: [1, 1112] }, { 83: [1, 1113] }, { 83: [1, 1114] }, { 83: [1, 1115] }, e(Ae, [2, 117]), e(Ae, [2, 118]), e(Ae, [2, 119]), e(Ae, [2, 120]), e(Ae, [2, 121]), e(Ae, [2, 122]), { 2: t, 3: 1116, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, { 2: t, 3: 1117, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 142: [1, 1118] }, e(Ae, [2, 126]), e(Ae, [2, 127]), e(Ae, [2, 128]), e(Ae, [2, 129]), e(Ae, [2, 130]), e(Ae, [2, 131]), { 2: t, 3: 1119, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: mr, 122: 719, 140: V, 141: J, 152: w, 161: _, 190: x, 205: 720, 210: 722, 284: 721, 327: t1, 328: n1, 329: y, 335: D, 456: 723, 461: k }, { 154: [1, 1120] }, { 83: [1, 1121] }, { 154: [1, 1122] }, e(Ae, [2, 136]), { 83: [1, 1123] }, { 2: t, 3: 1124, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, { 83: [1, 1125] }, { 83: [1, 1126] }, { 83: [1, 1127] }, { 83: [1, 1128] }, { 83: [1, 1129], 173: [1, 1130] }, { 83: [1, 1131] }, { 83: [1, 1132] }, { 83: [1, 1133] }, { 83: [1, 1134] }, { 83: [1, 1135] }, { 83: [1, 1136] }, { 83: [1, 1137] }, { 83: [1, 1138] }, { 83: [1, 1139] }, { 83: [2, 366] }, { 83: [2, 1128] }, { 83: [2, 1129] }, { 2: t, 3: 270, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 208: 1140 }, { 2: t, 3: 270, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 208: 1141 }, { 122: 1142, 141: J, 329: y }, e(B, [2, 634], { 121: [1, 1143] }), { 2: t, 3: 270, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 208: 1144 }, { 122: 1145, 141: J, 329: y }, { 2: t, 3: 1146, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, e(B, [2, 737]), e(B, [2, 73]), { 2: t, 3: 260, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 80: 1147, 81: [1, 1148] }, e(At, [2, 77]), { 83: [1, 1149] }, { 2: t, 3: 1096, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 85: 1150, 120: 1151, 229: Qe, 281: ze }, e(B, [2, 718]), e(B, [2, 624]), { 2: t, 3: 1096, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 120: 1154, 152: wt, 154: _t2, 156: 1152, 229: Qe, 281: ze, 370: 1153, 371: 1155 }, { 153: 1158, 154: Ye, 456: 209, 457: I3, 461: k }, e(B, [2, 713]), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1159, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(ht, ai, { 282: 161, 209: 162, 283: 163, 120: 164, 280: 165, 205: 166, 284: 167, 122: 168, 285: 169, 210: 170, 211: 171, 286: 172, 287: 173, 288: 174, 153: 176, 289: 177, 290: 178, 61: 180, 167: 183, 3: 185, 456: 209, 104: 1160, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: R1, 140: V, 141: J, 146: o1, 152: w, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 188: f1, 189: c1, 190: x, 229: h1, 266: Y, 267: W, 281: d1, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 457: I3, 461: k }), { 84: [1, 1161] }, { 122: 1162, 141: J, 329: y }, { 2: t, 3: 294, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 486: 1163, 487: _4 }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1165, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 250: q4, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k, 467: 1164, 471: Q4 }, e(B, [2, 693]), { 123: 1167, 124: I1, 125: w1, 133: [1, 1166] }, e(B, [2, 705]), e(B, [2, 706]), { 2: t, 3: 1169, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: vi, 140: Si, 470: 1168 }, { 123: 868, 124: I1, 125: w1, 133: [1, 1172], 468: 1173 }, e(B, [2, 798], { 79: Tr }), { 2: t, 3: 104, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 543: 1174 }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 878, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 183: 1175, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 279: 877, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 878, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 183: 1176, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 279: 877, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 878, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 183: 1177, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 279: 877, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(Nt, [2, 164]), e(Nt, [2, 1143], { 79: xt }), e(j2, [2, 280]), e(j2, [2, 287], { 123: 672, 360: 684, 3: 1180, 122: 1182, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 82: [1, 1179], 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 133: be, 140: [1, 1181], 141: J, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 329: y, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1, 366: ge }), e(tn, [2, 1144], { 206: 1183, 799: [1, 1184] }), { 140: V, 205: 1185 }, { 79: Tr, 84: [1, 1186] }, e(U2, [2, 15]), e(s3, [2, 82]), { 140: V, 205: 1187 }, { 140: V, 205: 1188 }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1191, 120: 164, 122: 168, 129: 1189, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 263: 1190, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(ut, vr, { 88: 1192, 207: Sr }), e(en, [2, 1103]), { 84: [1, 1193] }, e($2, [2, 258]), { 157: [1, 1194], 199: [1, 1195] }, { 199: [1, 1196] }, { 199: [1, 1197] }, { 199: [1, 1198] }, e(B, [2, 613], { 82: [1, 1200], 83: [1, 1199] }), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 287, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 160: 1201, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(t3, sn, { 303: 1202, 307: an }), e(ft, [2, 1189]), e(ft, [2, 1186]), e(ft, [2, 1187]), { 79: t2, 84: [1, 1204] }, { 79: t2, 84: [1, 1205] }, e(t3, [2, 371]), { 79: [1, 1206] }, { 79: [1, 1207] }, { 79: [1, 1208] }, { 79: [1, 1209] }, { 79: [1, 1210], 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, e(t3, [2, 377]), e(B, [2, 618]), { 331: [1, 1211] }, { 2: t, 3: 1212, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 122: 1213, 141: J, 329: y }, { 2: t, 3: 270, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 208: 1214 }, { 250: [1, 1215] }, { 2: t, 3: 625, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 141: lt, 146: y2, 152: P2, 154: G2, 161: D2, 469: 632, 513: 1216, 514: 623, 517: 624, 521: 629, 532: 626, 536: 628 }, e(B, [2, 775], { 123: 672, 360: 684, 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1, 366: ge }), e(ye, [2, 1222], { 516: 1217, 522: 1218, 82: wr }), e(Z4, [2, 1221]), { 2: t, 3: 1222, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 141: lt, 146: y2, 153: 1221, 154: Ye, 161: D2, 456: 209, 457: I3, 461: k, 514: 1220, 532: 626, 536: 628 }, { 2: t, 3: 1222, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 141: lt, 146: y2, 152: P2, 154: G2, 161: D2, 469: 632, 514: 1224, 517: 1223, 521: 629, 532: 626, 536: 628 }, { 2: t, 3: 625, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 141: lt, 146: y2, 152: P2, 154: G2, 161: D2, 469: 632, 512: 1225, 513: 622, 514: 623, 517: 624, 521: 629, 532: 626, 536: 628 }, e(Bn, [2, 1240], { 530: 1226, 141: [1, 1227] }), e(yn, [2, 1239]), e(O2, [2, 1246], { 534: 1228, 536: 1229, 161: D2 }), e(Bn, [2, 1245]), e(O2, [2, 791]), e(O2, [2, 1249]), e(yn, [2, 794]), e(yn, [2, 795]), e(O2, [2, 793]), e(ei, [2, 785]), { 2: t, 3: 270, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 208: 1230 }, { 2: t, 3: 270, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 208: 1231 }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1232, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(Ti, [2, 1216], { 506: 1233, 122: 1234, 141: J, 329: y }), e(Rr, [2, 1215]), { 2: t, 3: 1235, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, { 368: Ai, 372: Ni, 373: Oi, 549: 1236 }, { 2: t, 3: 270, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 208: 1240 }, e(Ot, [2, 810]), e(Ot, [2, 811]), e(Ot, [2, 812]), { 138: [1, 1241] }, { 294: [1, 1242] }, { 294: [1, 1243] }, e(u2, [2, 732]), e(u2, [2, 733], { 133: [1, 1244] }), { 4: Ct, 11: 950, 300: 1245, 424: 949, 426: Rt }, e([2, 4, 6, 7, 8, 9, 14, 58, 77, 79, 82, 83, 84, 96, 103, 105, 108, 109, 116, 121, 124, 125, 127, 131, 132, 133, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 188, 189, 190, 192, 194, 196, 198, 207, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 250, 252, 259, 266, 267, 268, 269, 271, 273, 294, 295, 304, 313, 314, 315, 316, 317, 318, 319, 320, 322, 329, 330, 333, 339, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 363, 364, 365, 366, 368, 372, 373, 378, 391, 403, 404, 407, 408, 433, 437, 438, 441, 443, 445, 446, 454, 455, 457, 461, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 503, 509, 545, 546, 555, 639, 798], [2, 580], { 5: [1, 1246] }), e([2, 5, 6, 7, 8, 9, 14, 58, 77, 79, 82, 84, 96, 103, 105, 108, 109, 116, 121, 124, 125, 127, 131, 132, 133, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 188, 189, 190, 192, 194, 196, 198, 207, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 250, 252, 259, 266, 267, 268, 269, 271, 273, 294, 295, 304, 313, 314, 315, 316, 317, 318, 319, 320, 322, 329, 330, 333, 339, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 363, 364, 365, 366, 368, 372, 373, 378, 391, 403, 404, 407, 408, 433, 437, 438, 441, 443, 445, 446, 454, 455, 457, 461, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 503, 509, 545, 546, 555, 639, 798], [2, 577], { 4: [1, 1248], 83: [1, 1247] }), { 83: [1, 1249] }, e(Dt, [2, 8]), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1250, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(B, [2, 480]), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 878, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 183: 1251, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 279: 877, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(B, [2, 626]), e(Gn, [2, 606]), { 2: t, 3: 1252, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 122: 1253, 141: J, 329: y }, e(B, [2, 602], { 79: Ci }), e(u2, [2, 604]), e(B, [2, 651], { 79: Ci }), e(B, [2, 710]), e(B, r, { 21: 5, 22: 7, 23: 8, 24: 9, 25: 10, 26: 11, 27: 12, 28: 13, 29: 14, 30: 15, 31: 16, 32: 17, 33: 18, 34: 19, 35: 20, 36: 21, 37: 22, 38: 23, 39: 24, 40: 25, 41: 26, 42: 27, 43: 28, 44: 29, 45: 30, 46: 31, 47: 32, 48: 33, 49: 34, 50: 35, 51: 36, 52: 37, 53: 38, 54: 39, 55: 40, 56: 41, 57: 42, 59: 44, 60: 45, 61: 46, 62: 47, 63: 48, 64: 49, 65: 50, 66: 51, 67: 52, 68: 53, 69: 54, 70: 55, 71: 56, 72: 57, 73: 58, 74: 59, 75: 60, 76: 61, 86: 76, 543: 99, 193: 103, 3: 104, 16: 1255, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 58: E, 77: p, 83: h, 96: g, 133: O, 155: T, 165: v, 198: N, 294: b, 295: L, 322: C, 368: a1, 372: r1, 373: H, 433: C1, 437: k1, 438: V1, 441: J1, 443: R, 445: U1, 446: ee, 454: _1, 455: K1, 466: Se, 472: Ie, 474: Xe, 475: Ve, 477: we, 478: Ge, 479: Me, 480: Ze, 481: Re, 482: Oe, 483: Pe, 487: He, 488: l2, 491: v2, 492: k2, 545: I2, 546: w2, 555: _2 }), e(jn, [2, 400], { 123: 672, 360: 684, 124: I1, 125: w1, 132: M1, 142: F1, 145: D1, 147: P1, 150: H1, 151: Y1, 188: y1, 189: G1, 345: L1, 349: x1, 350: B1, 351: W1, 352: X1 }), e(kr, [2, 401], { 123: 672, 360: 684, 349: x1 }), e(jn, [2, 402], { 123: 672, 360: 684, 124: I1, 125: w1, 132: M1, 142: F1, 145: D1, 147: P1, 150: H1, 151: Y1, 188: y1, 189: G1, 345: L1, 349: x1, 350: B1, 351: W1, 352: X1 }), e(Ri, [2, 403], { 123: 672, 360: 684, 124: I1, 125: w1, 132: M1, 142: F1, 145: D1, 147: P1, 150: H1, 151: Y1, 188: y1, 189: G1, 345: L1, 347: [1, 1256], 349: x1, 350: B1, 351: W1, 352: X1 }), e(Ri, [2, 405], { 123: 672, 360: 684, 124: I1, 125: w1, 132: M1, 142: F1, 145: D1, 147: P1, 150: H1, 151: Y1, 188: y1, 189: G1, 345: L1, 347: [1, 1257], 349: x1, 350: B1, 351: W1, 352: X1 }), e(he, [2, 407], { 123: 672, 360: 684 }), e(Jn, [2, 408], { 123: 672, 360: 684, 124: I1, 125: w1, 132: M1, 142: F1, 145: D1, 147: P1, 189: G1, 345: L1, 349: x1 }), e(Jn, [2, 409], { 123: 672, 360: 684, 124: I1, 125: w1, 132: M1, 142: F1, 145: D1, 147: P1, 189: G1, 345: L1, 349: x1 }), e(_r2, [2, 410], { 123: 672, 360: 684, 124: I1, 125: w1, 132: M1, 145: D1, 345: L1, 349: x1 }), e(_r2, [2, 411], { 123: 672, 360: 684, 124: I1, 125: w1, 132: M1, 145: D1, 345: L1, 349: x1 }), e(_r2, [2, 412], { 123: 672, 360: 684, 124: I1, 125: w1, 132: M1, 145: D1, 345: L1, 349: x1 }), e([2, 4, 5, 6, 7, 8, 9, 14, 58, 77, 79, 82, 83, 84, 96, 103, 105, 108, 109, 116, 121, 127, 131, 132, 133, 137, 138, 139, 140, 141, 142, 143, 144, 146, 147, 148, 149, 150, 151, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 188, 189, 190, 192, 194, 196, 198, 207, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 252, 259, 266, 267, 268, 269, 271, 273, 294, 295, 304, 313, 314, 315, 316, 317, 318, 319, 320, 322, 329, 333, 339, 341, 342, 343, 344, 346, 347, 348, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 363, 364, 365, 366, 368, 372, 373, 433, 437, 438, 441, 443, 445, 446, 454, 455, 457, 461, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 503, 509, 545, 546, 555, 639, 798], [2, 413], { 123: 672, 360: 684, 124: I1, 125: w1, 145: D1, 345: L1, 349: x1 }), e(Hn, [2, 414], { 123: 672, 360: 684, 124: I1, 125: w1, 132: M1, 142: F1, 145: D1, 147: P1, 188: y1, 189: G1, 345: L1, 349: x1, 350: B1 }), e(Hn, [2, 415], { 123: 672, 360: 684, 124: I1, 125: w1, 132: M1, 142: F1, 145: D1, 147: P1, 188: y1, 189: G1, 345: L1, 349: x1, 350: B1 }), e(Hn, [2, 416], { 123: 672, 360: 684, 124: I1, 125: w1, 132: M1, 142: F1, 145: D1, 147: P1, 188: y1, 189: G1, 345: L1, 349: x1, 350: B1 }), e(Hn, [2, 417], { 123: 672, 360: 684, 124: I1, 125: w1, 132: M1, 142: F1, 145: D1, 147: P1, 188: y1, 189: G1, 345: L1, 349: x1, 350: B1 }), e(Un, [2, 418], { 83: ot }), e(he, [2, 419]), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1258, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(he, [2, 421]), e(Un, [2, 422], { 83: ot }), e(he, [2, 423]), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1259, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(he, [2, 425]), e(L2, [2, 426], { 123: 672, 360: 684, 121: Z1, 124: I1, 125: w1, 132: M1, 142: F1, 145: D1, 147: P1, 150: H1, 151: Y1, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 365: $1 }), e(L2, [2, 427], { 123: 672, 360: 684, 121: Z1, 124: I1, 125: w1, 132: M1, 142: F1, 145: D1, 147: P1, 150: H1, 151: Y1, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 365: $1 }), e(L2, [2, 428], { 123: 672, 360: 684, 121: Z1, 124: I1, 125: w1, 132: M1, 142: F1, 145: D1, 147: P1, 150: H1, 151: Y1, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 365: $1 }), e(L2, [2, 429], { 123: 672, 360: 684, 121: Z1, 124: I1, 125: w1, 132: M1, 142: F1, 145: D1, 147: P1, 150: H1, 151: Y1, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 365: $1 }), e([2, 4, 5, 6, 7, 8, 9, 14, 58, 77, 83, 96, 109, 133, 148, 149, 155, 163, 165, 179, 180, 198, 294, 295, 322, 339, 343, 353, 354, 355, 356, 357, 358, 359, 363, 364, 366, 368, 372, 373, 433, 437, 438, 441, 443, 445, 446, 454, 455, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 545, 546, 555, 639, 798], ki, { 123: 672, 360: 684, 121: Z1, 124: I1, 125: w1, 132: M1, 142: F1, 145: D1, 147: P1, 150: H1, 151: Y1, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 365: $1 }), e(L2, [2, 431], { 123: 672, 360: 684, 121: Z1, 124: I1, 125: w1, 132: M1, 142: F1, 145: D1, 147: P1, 150: H1, 151: Y1, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 365: $1 }), e(L2, [2, 432], { 123: 672, 360: 684, 121: Z1, 124: I1, 125: w1, 132: M1, 142: F1, 145: D1, 147: P1, 150: H1, 151: Y1, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 365: $1 }), e(L2, [2, 433], { 123: 672, 360: 684, 121: Z1, 124: I1, 125: w1, 132: M1, 142: F1, 145: D1, 147: P1, 150: H1, 151: Y1, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 365: $1 }), e(L2, [2, 434], { 123: 672, 360: 684, 121: Z1, 124: I1, 125: w1, 132: M1, 142: F1, 145: D1, 147: P1, 150: H1, 151: Y1, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 365: $1 }), e(L2, [2, 435], { 123: 672, 360: 684, 121: Z1, 124: I1, 125: w1, 132: M1, 142: F1, 145: D1, 147: P1, 150: H1, 151: Y1, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 365: $1 }), { 83: [1, 1260] }, { 83: [2, 470] }, { 83: [2, 471] }, { 83: [2, 472] }, e(xr, [2, 438], { 123: 672, 360: 684, 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 365: $1 }), e([2, 4, 5, 6, 7, 8, 9, 14, 58, 77, 79, 82, 83, 84, 96, 103, 105, 108, 116, 127, 131, 137, 138, 139, 140, 141, 143, 144, 146, 152, 154, 155, 157, 158, 159, 161, 165, 171, 173, 175, 177, 178, 180, 181, 182, 184, 190, 192, 194, 196, 198, 207, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 252, 259, 266, 267, 268, 269, 271, 273, 294, 295, 304, 313, 314, 315, 316, 317, 318, 319, 320, 322, 329, 333, 339, 341, 342, 343, 347, 366, 368, 372, 373, 433, 437, 438, 441, 443, 445, 446, 454, 455, 457, 461, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 503, 509, 545, 546, 555, 639, 798], [2, 439], { 123: 672, 360: 684, 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1 }), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 44: 1261, 45: 248, 61: 180, 83: F2, 84: [1, 1263], 86: 76, 96: g, 104: 287, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 160: 1262, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 193: 103, 198: N, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(he, [2, 452]), e(he, [2, 454]), e(he, [2, 461]), e(he, [2, 462]), { 2: t, 3: 717, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: [1, 1264] }, { 2: t, 3: 746, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: [1, 1265], 120: 1007, 154: oi, 165: M, 209: 1008, 211: 1267, 229: Qe, 281: ze, 293: $e, 322: j, 323: U, 324: F, 325: P, 326: G, 362: 1266 }, e(he, [2, 459]), e(xr, [2, 456], { 123: 672, 360: 684, 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 365: $1 }), e(xr, [2, 457], { 123: 672, 360: 684, 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 365: $1 }), e([2, 4, 5, 6, 7, 8, 9, 14, 58, 77, 79, 82, 83, 84, 96, 103, 105, 108, 109, 116, 127, 131, 133, 137, 138, 139, 140, 141, 143, 144, 146, 148, 149, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 190, 192, 194, 196, 198, 207, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 252, 259, 266, 267, 268, 269, 271, 273, 294, 295, 304, 313, 314, 315, 316, 317, 318, 319, 320, 322, 329, 333, 339, 341, 342, 343, 347, 353, 354, 355, 356, 357, 358, 359, 363, 364, 365, 366, 368, 372, 373, 433, 437, 438, 441, 443, 445, 446, 454, 455, 457, 461, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 503, 509, 545, 546, 555, 639, 798], [2, 458], { 123: 672, 360: 684, 121: Z1, 124: I1, 125: w1, 132: M1, 142: F1, 145: D1, 147: P1, 150: H1, 151: Y1, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1 }), e(he, [2, 460]), e(he, Ii), e(he, [2, 321]), e(he, [2, 322]), e(he, [2, 445]), { 79: t2, 84: [1, 1268] }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1269, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1270, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(Dr, wi, { 123: 672, 360: 684, 305: 1271, 109: le, 121: Z1, 124: I1, 125: w1, 127: _i, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1, 366: ge }), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1273, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(he, xi), e(Lt, [2, 297]), { 2: t, 3: 1275, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, e(he, [2, 289]), e(Lt, [2, 294]), e(he, [2, 290]), e(Lt, [2, 295]), e(he, [2, 291]), { 84: [1, 1276], 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, { 84: [1, 1277] }, { 338: 1278, 339: ci, 340: 1037, 341: Fn, 343: hi }, { 339: [1, 1279] }, e(Ir, [2, 395]), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1280, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 342: [1, 1281], 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, { 82: [1, 1282], 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, { 79: [1, 1283] }, e(f2, [2, 679]), { 2: t, 3: 746, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: nn, 120: 741, 122: 739, 140: V, 141: J, 152: w, 153: 735, 154: Ye, 161: _, 165: M, 190: x, 205: 737, 209: 744, 210: 743, 229: Qe, 281: ze, 284: 740, 285: 742, 293: $e, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 333: [1, 1284], 335: D, 350: rn, 456: 209, 457: I3, 459: 1285, 460: 736, 461: k }, e(C2, [2, 668]), { 84: [1, 1286], 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, { 2: t, 3: 1287, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 154: ui, 158: fi }, { 2: t, 3: 1029, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, { 2: t, 3: 1031, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, e(he, [2, 388]), e(f2, [2, 676]), { 2: t, 3: 757, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 140: J4, 141: j4, 463: [1, 1288], 465: 1289 }, { 2: t, 3: 746, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: nn, 120: 741, 122: 739, 140: V, 141: J, 152: w, 153: 735, 154: Ye, 161: _, 165: M, 190: x, 205: 737, 209: 744, 210: 743, 229: Qe, 281: ze, 284: 740, 285: 742, 293: $e, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 335: D, 350: rn, 456: 209, 457: I3, 459: 1290, 460: 736, 461: k }, { 140: V, 205: 1291 }, { 2: t, 3: 746, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: nn, 120: 741, 122: 739, 140: V, 141: J, 152: w, 153: 735, 154: Ye, 161: _, 165: M, 190: x, 205: 737, 209: 744, 210: 743, 229: Qe, 281: ze, 284: 740, 285: 742, 293: $e, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 335: D, 350: rn, 456: 209, 457: I3, 459: 1292, 460: 736, 461: k }, { 140: V, 205: 1293 }, { 2: t, 3: 746, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: nn, 120: 741, 122: 739, 140: V, 141: J, 152: w, 153: 735, 154: Ye, 161: _, 165: M, 190: x, 205: 737, 209: 744, 210: 743, 229: Qe, 281: ze, 284: 740, 285: 742, 293: $e, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 335: D, 350: rn, 456: 209, 457: I3, 459: 1294, 460: 736, 461: k }, { 140: V, 205: 1295 }, { 83: J2, 152: w, 153: 1066, 154: Ye, 161: _, 190: x, 210: 1067, 335: D, 376: 1296, 456: 209, 457: I3, 461: k }, e(Ce, Ke, { 369: 1297, 79: c2, 503: qe }), { 158: dt, 375: 1299, 379: pt }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 44: 247, 45: 248, 61: 180, 83: F2, 85: 1300, 86: 76, 96: g, 104: 1303, 120: 1302, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 193: 103, 198: N, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 380: 1301, 456: 209, 457: I3, 461: k }, e(Ce, Ke, { 369: 1304, 503: qe }), { 2: t, 3: 1096, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 120: 1154, 152: wt, 154: _t2, 156: 1305, 229: Qe, 281: ze, 370: 1153, 371: 1155 }, e(Di, [2, 500]), e(Di, [2, 501]), e(Vt, [2, 505]), e(Vt, [2, 506]), { 44: 1309, 45: 248, 83: [1, 1308], 86: 76, 96: g, 152: w, 153: 1066, 154: Ye, 158: dt, 161: _, 190: x, 193: 103, 198: N, 210: 1067, 335: D, 375: 1306, 376: 1307, 379: pt, 456: 209, 457: I3, 461: k }, { 2: t, 3: 270, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 152: w, 161: _, 190: x, 208: 268, 210: 269, 231: 1310, 335: D }, { 83: J2, 152: w, 153: 1066, 154: Ye, 161: _, 190: x, 210: 1067, 335: D, 376: 1311, 456: 209, 457: I3, 461: k }, e(Ce, Ke, { 369: 1312, 79: c2, 503: qe }), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1303, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 380: 1301, 456: 209, 457: I3, 461: k }, { 341: Li, 496: 1313, 497: 1314, 498: 1315 }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1317, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 250: [2, 741] }, { 2: t, 3: 240, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 44: 765, 45: 248, 83: Vi, 86: 76, 96: g, 141: z2, 152: w, 153: 233, 154: i1, 161: _, 165: M, 190: x, 193: 103, 198: N, 208: 234, 209: 236, 210: 235, 211: 237, 218: 1318, 227: 238, 229: Z2, 293: $e, 322: j, 323: U, 324: F, 325: P, 326: G, 335: D, 456: 209, 457: I3, 461: k }, e(xe, Mi, { 3: 771, 219: 1320, 230: 1321, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 82: S2 }), e(xe, [2, 194]), e(xe, [2, 1151]), e(xe, [2, 196]), e(xe, [2, 203]), e([2, 4, 5, 6, 7, 8, 9, 14, 58, 77, 79, 82, 83, 84, 96, 103, 105, 108, 127, 133, 137, 152, 154, 155, 157, 158, 161, 163, 165, 171, 177, 178, 190, 192, 196, 198, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 271, 273, 294, 295, 322, 330, 335, 339, 343, 368, 372, 373, 378, 379, 391, 403, 404, 407, 408, 433, 437, 438, 439, 440, 441, 443, 445, 446, 454, 455, 457, 461, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 503, 545, 546, 552, 553, 554, 555, 639, 798], [2, 205]), { 2: t, 3: 1322, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, e(T2, [2, 1096], { 90: 1323, 102: 1324, 103: Ui, 108: Fi }), { 2: t, 3: 240, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: [1, 1328], 141: z2, 152: w, 153: 233, 154: i1, 161: _, 165: M, 190: x, 208: 234, 209: 236, 210: 235, 211: 237, 212: 1327, 218: 1329, 227: 238, 229: Z2, 293: $e, 322: j, 323: U, 324: F, 325: P, 326: G, 335: D, 456: 209, 457: I3, 461: k }, e(ut, [2, 177]), e(ut, [2, 178]), e(ut, [2, 179]), e(ut, [2, 180]), e(ut, [2, 181]), { 2: t, 3: 717, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, e(en, [2, 96], { 79: [1, 1330] }), e(Yn, [2, 98]), e(Yn, [2, 99]), { 122: 1331, 141: J, 329: y }, e([14, 77, 79, 84, 103, 108, 127, 133, 137, 171, 177, 178, 192, 207, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 252, 271, 273, 339, 343, 503, 639, 798], Er, { 125: pi }), e(_n, pr, { 94: 1332, 127: br }), e(s3, [2, 83]), e(s3, [2, 1101]), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1333, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(Ae, [2, 139]), e(Ae, [2, 157]), e(Ae, [2, 158]), e(Ae, [2, 159]), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 84: [2, 1120], 104: 287, 120: 164, 122: 168, 136: 1334, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 160: 1335, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 83: [1, 1336] }, e(Ae, [2, 107]), e([2, 4, 5, 6, 7, 8, 9, 14, 77, 79, 82, 83, 84, 127, 131, 133, 137, 138, 139, 140, 141, 143, 144, 146, 148, 149, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 190, 192, 194, 196, 207, 266, 267, 304, 313, 314, 315, 316, 317, 318, 319, 320, 339, 343, 457, 461, 503, 639, 798], [2, 109], { 123: 672, 360: 684, 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 142: F1, 145: D1, 147: P1, 150: H1, 151: Y1, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1, 366: ge }), e([2, 4, 5, 6, 7, 8, 9, 14, 77, 79, 82, 83, 84, 121, 127, 131, 133, 137, 138, 139, 140, 141, 143, 144, 146, 148, 149, 152, 154, 155, 157, 158, 159, 161, 163, 165, 171, 173, 175, 177, 178, 179, 180, 181, 182, 184, 190, 192, 194, 196, 207, 266, 267, 304, 313, 314, 315, 316, 317, 318, 319, 320, 339, 343, 457, 461, 503, 639, 798], [2, 110], { 123: 672, 360: 684, 109: le, 124: I1, 125: w1, 132: M1, 142: F1, 145: D1, 147: P1, 150: H1, 151: Y1, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1, 366: ge }), { 2: t, 3: 790, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 77: f3, 82: c3, 83: h3, 84: [1, 1337], 121: d32, 123: 793, 124: I1, 125: w1, 126: 1338, 127: p3, 131: b3, 132: g3, 133: E3, 137: m3, 138: v3, 139: S3, 140: T3, 141: A3, 142: N3, 143: O3, 144: C3, 145: R3, 146: k3, 147: I32, 148: w3, 149: _3, 150: x3, 151: D3, 152: L3, 153: 815, 154: V3, 155: M3, 157: U3, 158: F3, 159: P3, 161: G3, 163: y3, 165: B3, 167: 825, 169: 826, 171: J3, 173: j3, 175: H3, 177: Y3, 178: W3, 179: X3, 180: K3, 181: q3, 182: Q3, 184: z3, 194: Z3, 196: $3, 266: Y, 267: W, 304: e2, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 456: 209, 457: I3, 461: k }, e(a3, [2, 1116], { 162: 1101, 188: n2, 189: r2, 190: i2 }), { 2: t, 3: 790, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 77: f3, 82: c3, 83: h3, 121: d32, 123: 793, 124: I1, 125: w1, 126: 1340, 127: p3, 131: b3, 132: g3, 133: E3, 135: 1339, 137: m3, 138: v3, 139: S3, 140: T3, 141: A3, 142: N3, 143: O3, 144: C3, 145: R3, 146: k3, 147: I32, 148: w3, 149: _3, 150: x3, 151: D3, 152: L3, 153: 815, 154: V3, 155: M3, 157: U3, 158: F3, 159: P3, 161: G3, 163: y3, 165: B3, 167: 825, 169: 826, 171: J3, 173: j3, 175: H3, 177: Y3, 178: W3, 179: X3, 180: K3, 181: q3, 182: Q3, 184: z3, 194: Z3, 196: $3, 266: Y, 267: W, 304: e2, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1341, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1342, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 1343, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, e(Ae, [2, 123]), e(Ae, [2, 124]), e(Ae, [2, 125]), e(Ae, [2, 132]), { 2: t, 3: 1344, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, { 2: t, 3: 1096, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 120: 1154, 152: wt, 154: _t2, 156: 1345, 229: Qe, 281: ze, 370: 1153, 371: 1155 }, { 2: t, 3: 1346, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 287, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 160: 1347, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(Ae, [2, 138]), e(a3, [2, 1122], { 164: 1348 }), e(a3, [2, 1124], { 166: 1349 }), e(a3, [2, 1126], { 168: 1350 }), e(a3, [2, 1130], { 170: 1351 }), e(H2, Mt, { 172: 1352, 187: 1353 }), { 83: [1, 1354] }, e(a3, [2, 1132], { 174: 1355 }), e(a3, [2, 1134], { 176: 1356 }), e(H2, Mt, { 187: 1353, 172: 1357 }), e(H2, Mt, { 187: 1353, 172: 1358 }), e(H2, Mt, { 187: 1353, 172: 1359 }), e(H2, Mt, { 187: 1353, 172: 1360 }), { 2: t, 3: 790, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 77: f3, 82: c3, 83: h3, 121: d32, 123: 793, 124: I1, 125: w1, 126: 1361, 127: p3, 131: b3, 132: g3, 133: E3, 137: m3, 138: v3, 139: S3, 140: T3, 141: A3, 142: N3, 143: O3, 144: C3, 145: R3, 146: k3, 147: I32, 148: w3, 149: _3, 150: x3, 151: D3, 152: L3, 153: 815, 154: V3, 155: M3, 157: U3, 158: F3, 159: P3, 161: G3, 163: y3, 165: B3, 167: 825, 169: 826, 171: J3, 173: j3, 175: H3, 177: Y3, 178: W3, 179: X3, 180: K3, 181: q3, 182: Q3, 184: z3, 194: Z3, 196: $3, 266: Y, 267: W, 304: e2, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 878, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 183: 1362, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 279: 877, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(Pi, [2, 1136], { 185: 1363 }), e(B, [2, 644], { 192: [1, 1364] }), e(B, [2, 640], { 192: [1, 1365] }), e(B, [2, 633]), { 122: 1366, 141: J, 329: y }, e(B, [2, 642], { 192: [1, 1367] }), e(B, [2, 637]), e(B, [2, 638], { 121: [1, 1368] }), e(At, [2, 74]), { 2: t, 3: 260, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 80: 1369 }, { 44: 1370, 45: 248, 83: h, 86: 76, 96: g, 193: 103, 198: N }, { 79: Y2, 84: [1, 1371] }, e(o3, Gi), e(B, Ke, { 369: 1374, 79: on, 137: [1, 1373], 503: qe }), e(Wn, [2, 475]), { 133: [1, 1376] }, { 2: t, 3: 1377, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, e(x2, [2, 1192]), e(x2, [2, 1193]), e(B, [2, 656]), e(K4, [2, 379], { 123: 672, 360: 684, 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1, 366: ge }), e(L2, ki, { 123: 672, 360: 684, 121: Z1, 124: I1, 125: w1, 132: M1, 142: F1, 145: D1, 147: P1, 150: H1, 151: Y1, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 365: $1 }), e([14, 79, 84, 109, 121, 124, 125, 127, 132, 133, 142, 145, 147, 148, 149, 150, 151, 163, 179, 180, 188, 189, 271, 273, 339, 343, 344, 345, 346, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 363, 364, 365, 366, 639, 798], Ii, { 260: 120, 93: 1097, 171: it, 177: st, 178: at }), e(u2, [2, 726]), e(u2, [2, 728]), e(B, [2, 692]), e(B, [2, 694], { 123: 672, 360: 684, 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1, 366: ge }), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1378, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 1169, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: vi, 140: Si, 470: 1379 }, e(ln, [2, 701]), e(ln, [2, 702]), e(ln, [2, 703]), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1380, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1381, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 123: 1167, 124: I1, 125: w1, 133: [1, 1382] }, e(ye, [2, 800]), e(Nt, [2, 161], { 79: xt }), e(Nt, [2, 162], { 79: xt }), e(Nt, [2, 163], { 79: xt }), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 878, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 279: 1383, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 1384, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 122: 1386, 140: [1, 1385], 141: J, 329: y }, e(j2, [2, 282]), e(j2, [2, 284]), e(j2, [2, 286]), e(tn, [2, 173]), e(tn, [2, 1145]), { 84: [1, 1387] }, e(x4, [2, 803]), e(s3, [2, 277], { 272: 1388, 273: [1, 1389] }), { 274: 1390, 275: [2, 1172], 800: [1, 1391] }, e(_n, [2, 264], { 79: bt }), e(W2, [2, 265]), e(W2, [2, 269], { 123: 672, 360: 684, 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 268: [1, 1393], 269: [1, 1394], 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1, 366: ge }), e(kt, gi, { 89: 1395, 192: Ei }), e(B2, It), { 2: t, 3: 1396, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, { 2: t, 3: 1397, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, { 2: t, 3: 1399, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 421: 1398 }, { 2: t, 3: 1399, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 421: 1400 }, { 2: t, 3: 1401, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 287, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 160: 1402, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 1403, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, { 79: t2, 84: [1, 1404] }, e(t3, [2, 368]), { 83: [1, 1405] }, e(t3, [2, 369]), e(t3, [2, 370]), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1406, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1407, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1408, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1409, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1410, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(Gn, [2, 535]), e(B, Lr, { 444: 1411, 82: Vr, 83: [1, 1412] }), e(B, Lr, { 444: 1414, 82: Vr }), { 83: [1, 1415] }, { 2: t, 3: 270, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 208: 1416 }, e(ye, [2, 776]), e(ye, [2, 778]), e(ye, [2, 1223]), { 152: P2, 154: G2, 469: 1417 }, e(yi, [2, 1224], { 456: 209, 518: 1418, 153: 1419, 154: Ye, 457: I3, 461: k }), { 82: wr, 148: [2, 1228], 520: 1420, 522: 1421 }, e([14, 79, 82, 84, 141, 148, 154, 161, 339, 343, 457, 461, 639, 798], $4, { 529: 922, 532: 923, 146: y2 }), e(ye, [2, 781]), e(ye, Cr), { 79: z4, 84: [1, 1422] }, e(O2, [2, 1242], { 531: 1423, 536: 1424, 161: D2 }), e(Bn, [2, 1241]), e(O2, [2, 790]), e(O2, [2, 1247]), e(B, [2, 521], { 83: [1, 1425] }), { 82: [1, 1427], 83: [1, 1426] }, { 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 157: [1, 1428], 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, e(Ce, Bi, { 86: 76, 193: 103, 45: 248, 507: 1429, 44: 1432, 83: h, 96: g, 155: Ji, 198: N, 509: ji }), e(Ti, [2, 1217]), e(Rr, [2, 768]), { 250: [1, 1433] }, e(Mr, [2, 814]), e(Mr, [2, 815]), e(Mr, [2, 816]), e(Ot, ti, { 548: 1434, 105: ni, 552: ri, 553: ii, 554: si }), e(Ot, [2, 813]), e(B, [2, 327]), e(B, [2, 328]), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1435, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(u2, [2, 734], { 133: [1, 1436] }), e(Dt, [2, 579]), { 140: [1, 1438], 425: 1437, 427: [1, 1439] }, e(Dt, [2, 9]), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1303, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 380: 1440, 456: 209, 457: I3, 461: k }, e(B, Ke, { 123: 672, 360: 684, 369: 1441, 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1, 366: ge, 503: qe }), e(Ce, [2, 763], { 79: xt, 207: [1, 1442] }), e(B, [2, 627]), e(B, [2, 628]), { 2: t, 3: 270, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 208: 1443 }, e(B, [2, 712]), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1444, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1445, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 84: [1, 1446], 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, { 84: [1, 1447], 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 44: 1448, 45: 248, 61: 180, 83: F2, 86: 76, 96: g, 104: 287, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 160: 1449, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 193: 103, 198: N, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 84: [1, 1450] }, { 79: t2, 84: [1, 1451] }, e(he, [2, 450]), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1452, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 44: 1453, 45: 248, 61: 180, 83: F2, 84: [1, 1455], 86: 76, 96: g, 104: 287, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 160: 1454, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 193: 103, 198: N, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(he, [2, 453]), e(he, [2, 455]), e(he, sn, { 303: 1456, 307: an }), { 84: [1, 1457], 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, { 84: [1, 1458], 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, { 9: Hi, 84: Yi, 306: 1459 }, { 128: [1, 1461] }, e(Dr, wi, { 123: 672, 360: 684, 305: 1462, 109: le, 121: Z1, 124: I1, 125: w1, 127: _i, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1, 366: ge }), { 2: t, 3: 1463, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 189: [1, 1464] }, e(Lt, [2, 298]), e(f2, [2, 657]), e(he, [2, 387]), { 339: [1, 1465] }, e(he, [2, 394]), { 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 339: [2, 398], 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1466, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 4: Ct, 11: 950, 300: 1467, 424: 949, 426: Rt }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1468, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(f2, [2, 680]), e(di, [2, 690]), e(C2, [2, 675]), e(Lt, xi), e(f2, [2, 677]), e(et, [2, 682]), e(et, [2, 684]), e(et, [2, 687]), e(et, [2, 685]), e(et, [2, 688]), e(et, [2, 686]), e(et, [2, 689]), e(Ce, Ke, { 369: 1470, 79: c2, 503: qe }), e(Ce, [2, 482]), { 83: [1, 1471], 152: w, 153: 1472, 154: Ye, 161: _, 190: x, 210: 1473, 335: D, 456: 209, 457: I3, 461: k }, e(Ce, Ke, { 369: 1474, 503: qe }), { 79: Y2, 84: [1, 1475] }, { 79: Ur, 84: [1, 1476] }, e([79, 84, 109, 121, 124, 125, 132, 133, 142, 145, 147, 148, 149, 150, 151, 163, 179, 180, 188, 189, 344, 345, 346, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 363, 364, 365, 366], Gi), e(n3, [2, 510], { 123: 672, 360: 684, 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1, 366: ge }), e(Ce, [2, 496]), e(Ce, Ke, { 369: 1478, 79: on, 503: qe }), { 83: J2, 152: w, 153: 1066, 154: Ye, 161: _, 190: x, 210: 1067, 335: D, 376: 1479, 456: 209, 457: I3, 461: k }, e(Ce, Ke, { 369: 1480, 79: c2, 503: qe }), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 44: 247, 45: 248, 61: 180, 83: F2, 85: 1481, 86: 76, 96: g, 104: 1303, 120: 1302, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 193: 103, 198: N, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 380: 1301, 456: 209, 457: I3, 461: k }, e(Ce, Ke, { 369: 1482, 503: qe }), { 44: 1485, 45: 248, 83: Fr, 86: 76, 96: g, 152: w, 153: 1066, 154: Ye, 158: dt, 161: _, 190: x, 193: 103, 198: N, 210: 1067, 335: D, 375: 1483, 376: 1484, 379: pt, 456: 209, 457: I3, 461: k }, e(Ce, Ke, { 369: 1487, 79: c2, 503: qe }), e(Ce, [2, 492]), e(B, Ke, { 369: 1488, 497: 1489, 498: 1490, 341: Li, 503: qe }), e(r3, [2, 746]), e(r3, [2, 747]), { 163: [1, 1492], 499: [1, 1491] }, { 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 341: [2, 743], 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, { 84: [1, 1493] }, { 44: 1494, 45: 248, 83: h, 86: 76, 96: g, 193: 103, 198: N }, e(xe, [2, 193]), e(xe, [2, 1147]), e(B, [2, 612]), e(Pr, Wi, { 91: 1495, 137: Xi }), e(T2, [2, 1097]), { 83: [1, 1497] }, { 83: [1, 1498] }, e(kt, [2, 182], { 213: 1499, 232: 1501, 214: 1502, 233: 1503, 241: 1506, 79: Gr, 215: Xn, 217: Kn, 242: qn, 243: un, 244: fn, 245: cn, 246: hn, 247: dn, 248: pn, 249: bn }), { 2: t, 3: 240, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 44: 765, 45: 248, 83: Vi, 86: 76, 96: g, 141: z2, 152: w, 153: 233, 154: i1, 161: _, 165: M, 190: x, 193: 103, 198: N, 208: 234, 209: 236, 210: 235, 211: 237, 212: 1515, 218: 1329, 227: 238, 229: Z2, 293: $e, 322: j, 323: U, 324: F, 325: P, 326: G, 335: D, 456: 209, 457: I3, 461: k }, e(o3, [2, 191]), { 2: t, 3: 1096, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 119: 1516, 120: 1094, 121: mi, 229: Qe, 281: ze }, e(Yn, [2, 100]), e(s3, Ar, { 95: 1517, 271: Nr, 273: Or }), e(s3, [2, 160], { 123: 672, 360: 684, 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1, 366: ge }), { 84: [1, 1518] }, { 79: t2, 84: [2, 1121] }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 84: [2, 1114], 104: 1191, 120: 164, 122: 168, 129: 1519, 130: 1520, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 263: 1190, 266: Y, 267: W, 268: [1, 1521], 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(Ae, [2, 111]), e(a3, [2, 1117], { 162: 1101, 188: n2, 189: r2, 190: i2 }), { 2: t, 3: 790, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 77: f3, 82: c3, 83: h3, 84: [1, 1522], 121: d32, 123: 793, 124: I1, 125: w1, 126: 1523, 127: p3, 131: b3, 132: g3, 133: E3, 137: m3, 138: v3, 139: S3, 140: T3, 141: A3, 142: N3, 143: O3, 144: C3, 145: R3, 146: k3, 147: I32, 148: w3, 149: _3, 150: x3, 151: D3, 152: L3, 153: 815, 154: V3, 155: M3, 157: U3, 158: F3, 159: P3, 161: G3, 163: y3, 165: B3, 167: 825, 169: 826, 171: J3, 173: j3, 175: H3, 177: Y3, 178: W3, 179: X3, 180: K3, 181: q3, 182: Q3, 184: z3, 194: Z3, 196: $3, 266: Y, 267: W, 304: e2, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 456: 209, 457: I3, 461: k }, e(a3, [2, 1118], { 162: 1101, 188: n2, 189: r2, 190: i2 }), { 84: [1, 1524], 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, { 84: [1, 1525], 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, { 84: [1, 1526] }, e(Ae, [2, 133]), { 79: on, 84: [1, 1527] }, e(Ae, [2, 135]), { 79: t2, 84: [1, 1528] }, { 2: t, 3: 790, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 77: f3, 82: c3, 83: h3, 84: [1, 1529], 121: d32, 123: 793, 124: I1, 125: w1, 126: 1530, 127: p3, 131: b3, 132: g3, 133: E3, 137: m3, 138: v3, 139: S3, 140: T3, 141: A3, 142: N3, 143: O3, 144: C3, 145: R3, 146: k3, 147: I32, 148: w3, 149: _3, 150: x3, 151: D3, 152: L3, 153: 815, 154: V3, 155: M3, 157: U3, 158: F3, 159: P3, 161: G3, 163: y3, 165: B3, 167: 825, 169: 826, 171: J3, 173: j3, 175: H3, 177: Y3, 178: W3, 179: X3, 180: K3, 181: q3, 182: Q3, 184: z3, 194: Z3, 196: $3, 266: Y, 267: W, 304: e2, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 790, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 77: f3, 82: c3, 83: h3, 84: [1, 1531], 121: d32, 123: 793, 124: I1, 125: w1, 126: 1532, 127: p3, 131: b3, 132: g3, 133: E3, 137: m3, 138: v3, 139: S3, 140: T3, 141: A3, 142: N3, 143: O3, 144: C3, 145: R3, 146: k3, 147: I32, 148: w3, 149: _3, 150: x3, 151: D3, 152: L3, 153: 815, 154: V3, 155: M3, 157: U3, 158: F3, 159: P3, 161: G3, 163: y3, 165: B3, 167: 825, 169: 826, 171: J3, 173: j3, 175: H3, 177: Y3, 178: W3, 179: X3, 180: K3, 181: q3, 182: Q3, 184: z3, 194: Z3, 196: $3, 266: Y, 267: W, 304: e2, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 790, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 77: f3, 82: c3, 83: h3, 84: [1, 1533], 121: d32, 123: 793, 124: I1, 125: w1, 126: 1534, 127: p3, 131: b3, 132: g3, 133: E3, 137: m3, 138: v3, 139: S3, 140: T3, 141: A3, 142: N3, 143: O3, 144: C3, 145: R3, 146: k3, 147: I32, 148: w3, 149: _3, 150: x3, 151: D3, 152: L3, 153: 815, 154: V3, 155: M3, 157: U3, 158: F3, 159: P3, 161: G3, 163: y3, 165: B3, 167: 825, 169: 826, 171: J3, 173: j3, 175: H3, 177: Y3, 178: W3, 179: X3, 180: K3, 181: q3, 182: Q3, 184: z3, 194: Z3, 196: $3, 266: Y, 267: W, 304: e2, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 790, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 77: f3, 82: c3, 83: h3, 84: [1, 1535], 121: d32, 123: 793, 124: I1, 125: w1, 126: 1536, 127: p3, 131: b3, 132: g3, 133: E3, 137: m3, 138: v3, 139: S3, 140: T3, 141: A3, 142: N3, 143: O3, 144: C3, 145: R3, 146: k3, 147: I32, 148: w3, 149: _3, 150: x3, 151: D3, 152: L3, 153: 815, 154: V3, 155: M3, 157: U3, 158: F3, 159: P3, 161: G3, 163: y3, 165: B3, 167: 825, 169: 826, 171: J3, 173: j3, 175: H3, 177: Y3, 178: W3, 179: X3, 180: K3, 181: q3, 182: Q3, 184: z3, 194: Z3, 196: $3, 266: Y, 267: W, 304: e2, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 456: 209, 457: I3, 461: k }, { 79: Ut, 84: [1, 1537] }, e(n3, [2, 156], { 456: 209, 3: 790, 123: 793, 153: 815, 167: 825, 169: 826, 126: 1539, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 77: f3, 82: c3, 83: h3, 121: d32, 124: I1, 125: w1, 127: p3, 131: b3, 132: g3, 133: E3, 137: m3, 138: v3, 139: S3, 140: T3, 141: A3, 142: N3, 143: O3, 144: C3, 145: R3, 146: k3, 147: I32, 148: w3, 149: _3, 150: x3, 151: D3, 152: L3, 154: V3, 155: M3, 157: U3, 158: F3, 159: P3, 161: G3, 163: y3, 165: B3, 171: J3, 173: j3, 175: H3, 177: Y3, 178: W3, 179: X3, 180: K3, 181: q3, 182: Q3, 184: z3, 194: Z3, 196: $3, 266: Y, 267: W, 304: e2, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 457: I3, 461: k }), e(H2, Mt, { 187: 1353, 172: 1540 }), { 2: t, 3: 790, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 77: f3, 82: c3, 83: h3, 84: [1, 1541], 121: d32, 123: 793, 124: I1, 125: w1, 126: 1542, 127: p3, 131: b3, 132: g3, 133: E3, 137: m3, 138: v3, 139: S3, 140: T3, 141: A3, 142: N3, 143: O3, 144: C3, 145: R3, 146: k3, 147: I32, 148: w3, 149: _3, 150: x3, 151: D3, 152: L3, 153: 815, 154: V3, 155: M3, 157: U3, 158: F3, 159: P3, 161: G3, 163: y3, 165: B3, 167: 825, 169: 826, 171: J3, 173: j3, 175: H3, 177: Y3, 178: W3, 179: X3, 180: K3, 181: q3, 182: Q3, 184: z3, 194: Z3, 196: $3, 266: Y, 267: W, 304: e2, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 790, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 77: f3, 82: c3, 83: h3, 84: [1, 1543], 121: d32, 123: 793, 124: I1, 125: w1, 126: 1544, 127: p3, 131: b3, 132: g3, 133: E3, 137: m3, 138: v3, 139: S3, 140: T3, 141: A3, 142: N3, 143: O3, 144: C3, 145: R3, 146: k3, 147: I32, 148: w3, 149: _3, 150: x3, 151: D3, 152: L3, 153: 815, 154: V3, 155: M3, 157: U3, 158: F3, 159: P3, 161: G3, 163: y3, 165: B3, 167: 825, 169: 826, 171: J3, 173: j3, 175: H3, 177: Y3, 178: W3, 179: X3, 180: K3, 181: q3, 182: Q3, 184: z3, 194: Z3, 196: $3, 266: Y, 267: W, 304: e2, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 456: 209, 457: I3, 461: k }, { 79: Ut, 84: [1, 1545] }, { 79: Ut, 84: [1, 1546] }, { 79: Ut, 84: [1, 1547] }, { 79: Ut, 84: [1, 1548] }, { 84: [1, 1549], 162: 1101, 188: n2, 189: r2, 190: i2 }, { 79: xt, 84: [1, 1550] }, { 2: t, 3: 790, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 77: f3, 79: [1, 1551], 82: c3, 83: h3, 121: d32, 123: 793, 124: I1, 125: w1, 126: 1552, 127: p3, 131: b3, 132: g3, 133: E3, 137: m3, 138: v3, 139: S3, 140: T3, 141: A3, 142: N3, 143: O3, 144: C3, 145: R3, 146: k3, 147: I32, 148: w3, 149: _3, 150: x3, 151: D3, 152: L3, 153: 815, 154: V3, 155: M3, 157: U3, 158: F3, 159: P3, 161: G3, 163: y3, 165: B3, 167: 825, 169: 826, 171: J3, 173: j3, 175: H3, 177: Y3, 178: W3, 179: X3, 180: K3, 181: q3, 182: Q3, 184: z3, 194: Z3, 196: $3, 266: Y, 267: W, 304: e2, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 1553, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, { 2: t, 3: 1554, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, e(B, [2, 635]), { 2: t, 3: 1555, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, { 122: 1556, 141: J, 329: y }, e(At, [2, 75]), { 84: [1, 1557] }, { 82: [1, 1558] }, { 2: t, 3: 1096, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 120: 1559, 229: Qe, 281: ze }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1560, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(B, [2, 474]), { 2: t, 3: 1096, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 120: 1154, 152: wt, 154: _t2, 229: Qe, 281: ze, 370: 1561, 371: 1155 }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1562, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 133: [1, 1563] }, e(B, [2, 695], { 123: 672, 360: 684, 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1, 366: ge }), e(ln, [2, 700]), { 84: [1, 1564], 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, e(B, [2, 696], { 123: 672, 360: 684, 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1, 366: ge }), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1565, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(j2, [2, 279]), e(j2, [2, 281]), e(j2, [2, 283]), e(j2, [2, 285]), e(tn, [2, 174]), e(s3, [2, 275]), { 140: V, 205: 1566 }, { 275: [1, 1567] }, { 275: [2, 1173] }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1191, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 263: 1568, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(W2, [2, 270], { 264: 1569, 265: [1, 1570] }), { 270: [1, 1571] }, e(T2, [2, 1104], { 101: 1572, 102: 1573, 103: Ui, 108: Fi }), e(B, [2, 607]), { 157: [1, 1574] }, e(B, [2, 608]), e(ye, [2, 574], { 424: 949, 11: 950, 300: 1575, 4: Ct, 423: [1, 1576], 426: Rt }), e(B, [2, 609]), e(B, [2, 611]), { 79: t2, 84: [1, 1577] }, e(B, [2, 615]), e(t3, sn, { 303: 1578, 307: an }), e(yr, [2, 1182], { 308: 1579, 310: 1580, 311: [1, 1581] }), { 79: [1, 1582], 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, { 79: [1, 1583], 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, { 79: [1, 1584], 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, { 79: [1, 1585], 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, { 79: [1, 1586], 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, e(B, [2, 619]), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 287, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 160: 1587, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 1588, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, e(B, [2, 621]), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1191, 120: 164, 122: 168, 129: 1589, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 263: 1190, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 83: [1, 1590] }, { 2: t, 3: 1591, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, { 82: wr, 148: [2, 1226], 519: 1592, 522: 1593 }, e(yi, [2, 1225]), { 148: [1, 1594] }, { 148: [2, 1229] }, e(ye, [2, 782]), e(O2, [2, 789]), e(O2, [2, 1243]), { 2: t, 3: 1399, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 82: [1, 1597], 386: 1595, 393: 1596, 421: 1598 }, { 2: t, 3: 1096, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 85: 1599, 120: 1151, 229: Qe, 281: ze }, { 44: 1600, 45: 248, 83: h, 86: 76, 96: g, 193: 103, 198: N }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1601, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(Ce, [2, 767]), { 2: t, 3: 1096, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 120: 1154, 152: wt, 154: _t2, 156: 1602, 229: Qe, 281: ze, 370: 1153, 371: 1155 }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 287, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 160: 1603, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(Ce, [2, 772]), { 2: t, 3: 270, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 208: 1604 }, { 368: Ai, 372: Ni, 373: Oi, 549: 1605 }, e(u2, [2, 735], { 123: 672, 360: 684, 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1, 366: ge }), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1606, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 79: [1, 1607], 84: [1, 1608] }, e(n3, [2, 581]), e(n3, [2, 582]), { 79: Ur, 84: [1, 1609] }, e(B, [2, 479]), { 2: t, 3: 270, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 152: P2, 154: G2, 208: 1611, 469: 1610 }, e(u2, [2, 603]), e(jn, [2, 404], { 123: 672, 360: 684, 124: I1, 125: w1, 132: M1, 142: F1, 145: D1, 147: P1, 150: H1, 151: Y1, 188: y1, 189: G1, 345: L1, 349: x1, 350: B1, 351: W1, 352: X1 }), e(jn, [2, 406], { 123: 672, 360: 684, 124: I1, 125: w1, 132: M1, 142: F1, 145: D1, 147: P1, 150: H1, 151: Y1, 188: y1, 189: G1, 345: L1, 349: x1, 350: B1, 351: W1, 352: X1 }), e(he, [2, 420]), e(he, [2, 424]), { 84: [1, 1612] }, { 79: t2, 84: [1, 1613] }, e(he, [2, 446]), e(he, [2, 448]), { 84: [1, 1614], 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, { 84: [1, 1615] }, { 79: t2, 84: [1, 1616] }, e(he, [2, 451]), e(he, [2, 343]), e(he, sn, { 303: 1617, 307: an }), e(he, sn, { 303: 1618, 307: an }), { 84: [1, 1619] }, { 141: [1, 1620] }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1191, 120: 164, 122: 168, 129: 1621, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 263: 1190, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 9: Hi, 84: Yi, 306: 1622 }, e(Lt, [2, 293]), e(he, [2, 288]), e(he, [2, 393]), e(Ir, [2, 397], { 123: 672, 360: 684, 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1, 366: ge }), { 79: [1, 1624], 84: [1, 1623] }, { 79: [1, 1626], 84: [1, 1625], 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, { 2: t, 3: 1463, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, e(Ce, [2, 481]), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1303, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 380: 1627, 456: 209, 457: I3, 461: k }, e(Vt, [2, 508]), e(Vt, [2, 509]), e(Ce, [2, 493]), { 44: 1630, 45: 248, 83: Fr, 86: 76, 96: g, 152: w, 153: 1066, 154: Ye, 158: dt, 161: _, 190: x, 193: 103, 198: N, 210: 1067, 335: D, 375: 1628, 376: 1629, 379: pt, 456: 209, 457: I3, 461: k }, e(Vt, [2, 504]), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1631, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(Ce, [2, 499]), e(Ce, Ke, { 369: 1632, 79: c2, 503: qe }), e(Ce, [2, 484]), { 79: Y2, 84: [1, 1633] }, e(Ce, [2, 487]), { 83: J2, 152: w, 153: 1066, 154: Ye, 161: _, 190: x, 210: 1067, 335: D, 376: 1634, 456: 209, 457: I3, 461: k }, e(Ce, Ke, { 369: 1635, 79: c2, 503: qe }), e(Ce, Ke, { 369: 1636, 503: qe }), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 44: 247, 45: 248, 61: 180, 83: F2, 86: 76, 96: g, 104: 1303, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 193: 103, 198: N, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 380: 1301, 456: 209, 457: I3, 461: k }, e(Ce, [2, 491]), e(B, [2, 738]), e(r3, [2, 744]), e(r3, [2, 745]), { 179: [1, 1638], 342: [1, 1637] }, { 499: [1, 1639] }, { 250: [2, 742] }, { 84: [1, 1640] }, e(tt, Ki, { 92: 1641, 252: qi }), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1643, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1644, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 1645, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, e(kt, [2, 183], { 233: 1503, 241: 1506, 232: 1647, 214: 1648, 79: [1, 1646], 215: Xn, 217: Kn, 242: qn, 243: un, 244: fn, 245: cn, 246: hn, 247: dn, 248: pn, 249: bn }), { 2: t, 3: 240, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: kn, 141: z2, 152: w, 153: 233, 154: i1, 161: _, 165: M, 190: x, 208: 234, 209: 236, 210: 235, 211: 237, 218: 1649, 227: 238, 229: Z2, 293: $e, 322: j, 323: U, 324: F, 325: P, 326: G, 335: D, 456: 209, 457: I3, 461: k }, e(o3, [2, 211]), e(o3, [2, 212]), { 2: t, 3: 240, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: [1, 1654], 152: w, 153: 1652, 154: i1, 161: _, 165: M, 190: x, 208: 1651, 209: 1655, 210: 1653, 211: 1656, 234: 1650, 293: $e, 322: j, 323: U, 324: F, 325: P, 326: G, 335: D, 456: 209, 457: I3, 461: k }, { 216: [1, 1657], 243: Qi }, { 216: [1, 1659], 243: zi }, e(p2, [2, 220]), { 215: [1, 1663], 217: [1, 1662], 241: 1661, 243: un, 244: fn, 245: cn, 246: hn, 247: dn, 248: pn, 249: bn }, e(p2, [2, 222]), { 243: [1, 1664] }, { 217: [1, 1666], 243: [1, 1665] }, { 217: [1, 1668], 243: [1, 1667] }, { 217: [1, 1669] }, { 243: [1, 1670] }, { 243: [1, 1671] }, { 79: Gr, 213: 1672, 214: 1502, 215: Xn, 217: Kn, 232: 1501, 233: 1503, 241: 1506, 242: qn, 243: un, 244: fn, 245: cn, 246: hn, 247: dn, 248: pn, 249: bn }, e(Yn, [2, 97]), e(s3, [2, 81]), e(Ae, [2, 113]), { 79: bt, 84: [1, 1673] }, { 84: [1, 1674] }, { 84: [2, 1115] }, e(Ae, [2, 112]), e(a3, [2, 1119], { 162: 1101, 188: n2, 189: r2, 190: i2 }), e(Ae, [2, 114]), e(Ae, [2, 115]), e(Ae, [2, 116]), e(Ae, [2, 134]), e(Ae, [2, 137]), e(Ae, [2, 140]), e(a3, [2, 1123], { 162: 1101, 188: n2, 189: r2, 190: i2 }), e(Ae, [2, 141]), e(a3, [2, 1125], { 162: 1101, 188: n2, 189: r2, 190: i2 }), e(Ae, [2, 142]), e(a3, [2, 1127], { 162: 1101, 188: n2, 189: r2, 190: i2 }), e(Ae, [2, 143]), e(a3, [2, 1131], { 162: 1101, 188: n2, 189: r2, 190: i2 }), e(Ae, [2, 144]), e(H2, [2, 1138], { 186: 1675 }), e(H2, [2, 1141], { 162: 1101, 188: n2, 189: r2, 190: i2 }), { 79: Ut, 84: [1, 1676] }, e(Ae, [2, 146]), e(a3, [2, 1133], { 162: 1101, 188: n2, 189: r2, 190: i2 }), e(Ae, [2, 147]), e(a3, [2, 1135], { 162: 1101, 188: n2, 189: r2, 190: i2 }), e(Ae, [2, 148]), e(Ae, [2, 149]), e(Ae, [2, 150]), e(Ae, [2, 151]), e(Ae, [2, 152]), e(Ae, [2, 153]), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 287, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 160: 1677, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(Pi, [2, 1137], { 162: 1101, 188: n2, 189: r2, 190: i2 }), e(B, [2, 645]), e(B, [2, 641]), e(B, [2, 643]), e(B, [2, 639]), e(At, [2, 78]), { 83: [1, 1678] }, e(o3, [2, 519]), e(B, Ke, { 123: 672, 360: 684, 369: 1679, 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1, 366: ge, 503: qe }), e(Wn, [2, 476]), e(Wn, [2, 477], { 123: 672, 360: 684, 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1, 366: ge }), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1680, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(ln, [2, 704]), e(B, [2, 697], { 123: 672, 360: 684, 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1, 366: ge }), e(s3, [2, 278]), { 140: [2, 1174], 276: 1681, 681: [1, 1682] }, e(W2, [2, 266]), e(W2, [2, 271]), { 266: [1, 1683], 267: [1, 1684] }, e(W2, [2, 272], { 268: [1, 1685] }), e(Pr, Wi, { 91: 1686, 137: Xi }), e(T2, [2, 1105]), { 2: t, 3: 1687, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, e(ye, [2, 583], { 422: 1688, 428: 1689, 429: 1690, 401: 1698, 163: Zi, 196: $i, 250: es, 330: ts, 378: ns, 391: rs, 403: Br, 404: is, 407: ss, 408: as }), e(ye, [2, 573]), e(B, [2, 614], { 82: [1, 1702] }), e(t3, [2, 367]), { 84: [2, 1184], 127: [1, 1705], 309: 1703, 312: 1704 }, e(yr, [2, 1183]), { 128: [1, 1706] }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1707, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1708, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1709, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1710, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1711, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 79: t2, 84: [1, 1712] }, e(B, [2, 623]), { 79: bt, 84: [1, 1713] }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1191, 120: 164, 122: 168, 129: 1714, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 263: 1190, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e([14, 79, 84, 148, 339, 343, 639, 798], [2, 786]), { 148: [1, 1715] }, { 148: [2, 1227] }, { 2: t, 3: 1222, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 141: lt, 146: y2, 152: P2, 154: G2, 161: D2, 469: 632, 514: 1224, 517: 1716, 521: 629, 532: 626, 536: 628 }, { 84: [1, 1717] }, { 79: [1, 1718], 84: [2, 537] }, { 44: 1719, 45: 248, 83: h, 86: 76, 96: g, 193: 103, 198: N }, e(n3, [2, 570]), { 79: Y2, 84: [1, 1720] }, e(B, [2, 1210], { 449: 1721, 450: 1722, 77: os }), e(Ce, Bi, { 86: 76, 193: 103, 45: 248, 123: 672, 360: 684, 44: 1432, 507: 1724, 83: h, 96: g, 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 155: Ji, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 198: N, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1, 366: ge, 509: ji }), e(Ce, [2, 770], { 79: on }), e(Ce, [2, 771], { 79: t2 }), e([14, 58, 77, 83, 96, 133, 155, 165, 198, 294, 295, 322, 339, 343, 368, 372, 373, 433, 437, 438, 441, 443, 445, 446, 454, 455, 466, 472, 474, 475, 477, 478, 479, 480, 481, 482, 483, 487, 488, 491, 492, 545, 546, 555, 639, 798], [2, 1258], { 550: 1725, 3: 1726, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 82: [1, 1727] }), e(Jr, [2, 1260], { 551: 1728, 82: [1, 1729] }), e(u2, [2, 736], { 123: 672, 360: 684, 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1, 366: ge }), { 140: [1, 1730] }, e(Dt, [2, 576]), e(Dt, [2, 578]), { 2: t, 3: 1731, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, e(Ce, [2, 765], { 83: [1, 1732] }), e(he, [2, 436]), e(he, [2, 437]), e(he, [2, 463]), e(he, [2, 447]), e(he, [2, 449]), e(he, [2, 344]), e(he, [2, 345]), e(he, [2, 346]), { 84: [2, 355] }, e(Dr, [2, 353], { 79: bt }), { 84: [1, 1733] }, e(he, [2, 331]), { 140: [1, 1734] }, e(he, [2, 333]), { 140: [1, 1735] }, { 79: Ur, 84: [1, 1736] }, { 83: J2, 152: w, 153: 1066, 154: Ye, 161: _, 190: x, 210: 1067, 335: D, 376: 1737, 456: 209, 457: I3, 461: k }, e(Ce, Ke, { 369: 1738, 79: c2, 503: qe }), e(Ce, Ke, { 369: 1739, 503: qe }), e(n3, [2, 511], { 123: 672, 360: 684, 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1, 366: ge }), e(Ce, [2, 483]), { 44: 1742, 45: 248, 83: Fr, 86: 76, 96: g, 152: w, 153: 1066, 154: Ye, 158: dt, 161: _, 190: x, 193: 103, 198: N, 210: 1067, 335: D, 375: 1740, 376: 1741, 379: pt, 456: 209, 457: I3, 461: k }, e(Ce, Ke, { 369: 1743, 79: c2, 503: qe }), e(Ce, [2, 490]), e(Ce, [2, 497]), { 368: jr, 372: Hr, 500: 1744 }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1747, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 128: [1, 1749], 179: [1, 1750], 342: [1, 1748] }, e([79, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249], Mi, { 260: 120, 3: 771, 93: 1097, 219: 1320, 230: 1321, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 82: S2, 84: It, 127: It, 271: It, 273: It, 171: it, 177: st, 178: at }), e(B2, vt, { 260: 120, 93: 1751, 171: it, 177: st, 178: at }), { 128: [1, 1752] }, e(Pr, [2, 238], { 123: 672, 360: 684, 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1, 366: ge }), { 105: [1, 1753], 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, { 105: [1, 1754] }, { 2: t, 3: 240, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: kn, 141: z2, 152: w, 153: 233, 154: i1, 161: _, 165: M, 190: x, 208: 234, 209: 236, 210: 235, 211: 237, 212: 1755, 218: 1329, 227: 238, 229: Z2, 293: $e, 322: j, 323: U, 324: F, 325: P, 326: G, 335: D, 456: 209, 457: I3, 461: k }, e(o3, [2, 209]), e(o3, [2, 210]), e(o3, [2, 192]), e(o3, [2, 236], { 235: 1756, 250: [1, 1757], 251: [1, 1758] }), e(xe, [2, 1162], { 3: 771, 236: 1759, 230: 1760, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 82: S2 }), e(Pn, [2, 1164], { 237: 1761, 82: [1, 1762] }), { 2: t, 3: 771, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 82: S2, 230: 1763 }, { 44: 1764, 45: 248, 83: h, 86: 76, 96: g, 193: 103, 198: N }, e(xe, [2, 1168], { 3: 771, 239: 1765, 230: 1766, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 82: S2 }), e(xe, [2, 1170], { 3: 771, 240: 1767, 230: 1768, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 82: S2 }), { 83: [1, 1769] }, e(p2, [2, 232]), { 83: [1, 1770] }, e(p2, [2, 228]), e(p2, [2, 221]), { 243: zi }, { 243: Qi }, e(p2, [2, 223]), e(p2, [2, 224]), { 243: [1, 1771] }, e(p2, [2, 226]), { 243: [1, 1772] }, { 243: [1, 1773] }, e(p2, [2, 230]), e(p2, [2, 231]), { 84: [1, 1774], 214: 1648, 215: Xn, 217: Kn, 232: 1647, 233: 1503, 241: 1506, 242: qn, 243: un, 244: fn, 245: cn, 246: hn, 247: dn, 248: pn, 249: bn }, e(Ae, [2, 104]), e(Ae, [2, 105]), e(n3, [2, 155], { 456: 209, 3: 790, 123: 793, 153: 815, 167: 825, 169: 826, 126: 1775, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 77: f3, 82: c3, 83: h3, 121: d32, 124: I1, 125: w1, 127: p3, 131: b3, 132: g3, 133: E3, 137: m3, 138: v3, 139: S3, 140: T3, 141: A3, 142: N3, 143: O3, 144: C3, 145: R3, 146: k3, 147: I32, 148: w3, 149: _3, 150: x3, 151: D3, 152: L3, 154: V3, 155: M3, 157: U3, 158: F3, 159: P3, 161: G3, 163: y3, 165: B3, 171: J3, 173: j3, 175: H3, 177: Y3, 178: W3, 179: X3, 180: K3, 181: q3, 182: Q3, 184: z3, 194: Z3, 196: $3, 266: Y, 267: W, 304: e2, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 457: I3, 461: k }), e(Ae, [2, 145]), { 79: t2, 84: [1, 1776] }, { 44: 1777, 45: 248, 83: h, 86: 76, 96: g, 193: 103, 198: N }, e(B, [2, 473]), e(Wn, [2, 478], { 123: 672, 360: 684, 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1, 366: ge }), { 140: V, 205: 1778 }, { 140: [2, 1175] }, e(W2, [2, 267]), e(W2, [2, 268]), e(W2, [2, 273]), e(tt, Ki, { 92: 1779, 252: qi }), e(B, [2, 610]), e(ye, [2, 572]), e(ye, [2, 584], { 401: 1698, 429: 1780, 163: Zi, 196: $i, 250: es, 330: ts, 378: ns, 391: rs, 403: Br, 404: is, 407: ss, 408: as }), e(De, [2, 586]), { 6: [1, 1781] }, { 6: [1, 1782] }, { 2: t, 3: 270, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 208: 1783 }, e(De, [2, 592], { 83: [1, 1784] }), { 2: t, 3: 127, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: [1, 1786], 122: 277, 140: V, 141: J, 152: w, 161: _, 165: M, 190: x, 205: 276, 209: 1787, 210: 280, 284: 278, 285: 279, 292: hr, 293: dr, 302: 1785, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 335: D }, e(De, [2, 596]), { 330: [1, 1788] }, e(De, [2, 598]), e(De, [2, 599]), { 368: [1, 1789] }, { 83: [1, 1790] }, { 2: t, 3: 1791, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, { 84: [1, 1792] }, { 84: [2, 1185] }, { 128: [1, 1793] }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1799, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 253: 1794, 255: Ft, 256: Pt, 257: 1795, 258: Gt, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 84: [1, 1800], 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, { 84: [1, 1801], 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, { 84: [1, 1802], 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, { 84: [1, 1803], 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, { 84: [1, 1804], 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, e(B, Lr, { 444: 1805, 82: Vr }), e(B, [2, 629]), { 79: bt, 84: [1, 1806] }, { 2: t, 3: 1222, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 141: lt, 146: y2, 152: P2, 154: G2, 161: D2, 469: 632, 514: 1224, 517: 1807, 521: 629, 532: 626, 536: 628 }, e(ye, [2, 780]), e(B, [2, 524], { 387: 1808, 389: 1809, 390: 1810, 4: ls, 269: us, 378: fs, 391: cs }), e(Qn, Yr, { 3: 1399, 394: 1815, 421: 1816, 395: 1817, 396: 1818, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 402: Wr }), { 84: [2, 538] }, { 82: [1, 1820] }, e(B, [2, 647]), e(B, [2, 1211]), { 403: [1, 1822], 451: [1, 1821] }, e(Ce, [2, 773]), e(B, r, { 21: 5, 22: 7, 23: 8, 24: 9, 25: 10, 26: 11, 27: 12, 28: 13, 29: 14, 30: 15, 31: 16, 32: 17, 33: 18, 34: 19, 35: 20, 36: 21, 37: 22, 38: 23, 39: 24, 40: 25, 41: 26, 42: 27, 43: 28, 44: 29, 45: 30, 46: 31, 47: 32, 48: 33, 49: 34, 50: 35, 51: 36, 52: 37, 53: 38, 54: 39, 55: 40, 56: 41, 57: 42, 59: 44, 60: 45, 61: 46, 62: 47, 63: 48, 64: 49, 65: 50, 66: 51, 67: 52, 68: 53, 69: 54, 70: 55, 71: 56, 72: 57, 73: 58, 74: 59, 75: 60, 76: 61, 86: 76, 543: 99, 193: 103, 3: 104, 16: 1823, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 58: E, 77: p, 83: h, 96: g, 133: O, 155: T, 165: v, 198: N, 294: b, 295: L, 322: C, 368: a1, 372: r1, 373: H, 433: C1, 437: k1, 438: V1, 441: J1, 443: R, 445: U1, 446: ee, 454: _1, 455: K1, 466: Se, 472: Ie, 474: Xe, 475: Ve, 477: we, 478: Ge, 479: Me, 480: Ze, 481: Re, 482: Oe, 483: Pe, 487: He, 488: l2, 491: v2, 492: k2, 545: I2, 546: w2, 555: _2 }), e(B, [2, 807]), e(Jr, [2, 1259]), e(B, r, { 21: 5, 22: 7, 23: 8, 24: 9, 25: 10, 26: 11, 27: 12, 28: 13, 29: 14, 30: 15, 31: 16, 32: 17, 33: 18, 34: 19, 35: 20, 36: 21, 37: 22, 38: 23, 39: 24, 40: 25, 41: 26, 42: 27, 43: 28, 44: 29, 45: 30, 46: 31, 47: 32, 48: 33, 49: 34, 50: 35, 51: 36, 52: 37, 53: 38, 54: 39, 55: 40, 56: 41, 57: 42, 59: 44, 60: 45, 61: 46, 62: 47, 63: 48, 64: 49, 65: 50, 66: 51, 67: 52, 68: 53, 69: 54, 70: 55, 71: 56, 72: 57, 73: 58, 74: 59, 75: 60, 76: 61, 86: 76, 543: 99, 193: 103, 3: 104, 16: 1824, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 58: E, 77: p, 83: h, 96: g, 133: O, 155: T, 165: v, 198: N, 294: b, 295: L, 322: C, 368: a1, 372: r1, 373: H, 433: C1, 437: k1, 438: V1, 441: J1, 443: R, 445: U1, 446: ee, 454: _1, 455: K1, 466: Se, 472: Ie, 474: Xe, 475: Ve, 477: we, 478: Ge, 479: Me, 480: Ze, 481: Re, 482: Oe, 483: Pe, 487: He, 488: l2, 491: v2, 492: k2, 545: I2, 546: w2, 555: _2 }), e(Jr, [2, 1261]), { 84: [1, 1825] }, e(Ce, [2, 764]), { 2: t, 3: 1096, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 85: 1826, 120: 1151, 229: Qe, 281: ze }, e(he, [2, 347]), { 84: [1, 1827] }, { 84: [1, 1828] }, e(Vt, [2, 507]), e(Ce, Ke, { 369: 1829, 79: c2, 503: qe }), e(Ce, [2, 495]), e(Ce, [2, 498]), { 83: J2, 152: w, 153: 1066, 154: Ye, 161: _, 190: x, 210: 1067, 335: D, 376: 1830, 456: 209, 457: I3, 461: k }, e(Ce, Ke, { 369: 1831, 79: c2, 503: qe }), e(Ce, Ke, { 369: 1832, 503: qe }), e(Ce, [2, 489]), e(r3, [2, 748]), e(r3, [2, 750]), { 155: [1, 1833] }, { 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 342: [1, 1834], 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, { 373: gn, 501: 1835 }, { 454: [1, 1838], 502: [1, 1837] }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1839, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(_n, pr, { 94: 1840, 127: br }), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1799, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 253: 1841, 255: Ft, 256: Pt, 257: 1795, 258: Gt, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 1842, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, { 2: t, 3: 1843, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, e(kt, [2, 184], { 79: Gr }), e(o3, [2, 213]), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1844, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 1096, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: [1, 1846], 85: 1845, 120: 1151, 229: Qe, 281: ze }, e(xe, [2, 214]), e(xe, [2, 1163]), e(xe, [2, 1166], { 238: 1847, 3: 1848, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }), e(Pn, [2, 1165]), e(xe, [2, 216]), { 84: [1, 1849] }, e(xe, [2, 218]), e(xe, [2, 1169]), e(xe, [2, 219]), e(xe, [2, 1171]), { 44: 1850, 45: 248, 83: h, 86: 76, 96: g, 193: 103, 198: N }, { 44: 1851, 45: 248, 83: h, 86: 76, 96: g, 193: 103, 198: N }, e(p2, [2, 225]), e(p2, [2, 227]), e(p2, [2, 229]), e(kt, [2, 185]), e(H2, [2, 1139], { 162: 1101, 188: n2, 189: r2, 190: i2 }), e(Ae, [2, 154]), { 84: [1, 1852] }, e(hs, [2, 1176], { 277: 1853, 800: [1, 1854] }), e(B2, vt, { 260: 120, 93: 1855, 171: it, 177: st, 178: at }), e(De, [2, 585]), e(De, [2, 588]), { 408: [1, 1856] }, e(De, [2, 1204], { 432: 1857, 430: 1858, 83: ds }), { 140: V, 205: 1860 }, e(De, [2, 593]), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1861, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(De, [2, 595]), e(De, [2, 597]), { 2: t, 3: 127, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: [1, 1863], 122: 277, 140: V, 141: J, 152: w, 161: _, 165: M, 190: x, 205: 276, 209: 281, 210: 280, 284: 278, 285: 279, 292: hr, 293: dr, 302: 1862, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 335: D }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1864, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(B, [2, 616]), e(t3, [2, 349]), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1191, 120: 164, 122: 168, 129: 1865, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 263: 1190, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(yr, [2, 350], { 79: En }), e(yt, [2, 243]), { 155: [1, 1867] }, { 83: [1, 1868] }, { 83: [1, 1869] }, e(yt, [2, 248], { 123: 672, 360: 684, 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1, 366: ge }), e(t3, [2, 372]), e(t3, [2, 373]), e(t3, [2, 374]), e(t3, [2, 375]), e(t3, [2, 376]), e(B, [2, 620]), e(B, [2, 630]), e(ye, [2, 779]), e(B, [2, 520]), e(B, [2, 525], { 390: 1870, 4: ls, 269: us, 378: fs, 391: cs }), e(Bt, [2, 527]), e(Bt, [2, 528]), { 133: [1, 1871] }, { 133: [1, 1872] }, { 133: [1, 1873] }, { 79: [1, 1874], 84: [2, 536] }, e(n3, [2, 571]), e(n3, [2, 539]), { 196: [1, 1882], 202: [1, 1883], 397: 1875, 398: 1876, 399: 1877, 400: 1878, 401: 1879, 403: Br, 404: [1, 1880], 407: [1, 1881] }, { 2: t, 3: 1884, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, { 44: 1885, 45: 248, 83: h, 86: 76, 96: g, 193: 103, 198: N }, { 452: [1, 1886] }, { 453: [1, 1887] }, e(B, [2, 806]), e(B, [2, 808]), e(Dt, [2, 575]), { 79: Y2, 84: [1, 1888] }, e(he, [2, 332]), e(he, [2, 334]), e(Ce, [2, 494]), e(Ce, Ke, { 369: 1889, 79: c2, 503: qe }), e(Ce, [2, 486]), e(Ce, [2, 488]), { 2: t, 3: 1096, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 120: 1154, 152: wt, 154: _t2, 156: 1890, 229: Qe, 281: ze, 370: 1153, 371: 1155 }, { 368: jr, 372: Hr, 500: 1891 }, e(r3, [2, 752]), { 83: [1, 1893], 378: [1, 1894], 379: [1, 1892] }, { 179: [1, 1896], 342: [1, 1895] }, { 179: [1, 1898], 342: [1, 1897] }, { 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 342: [1, 1899], 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, e(s3, Ar, { 95: 1900, 271: Nr, 273: Or }), e([14, 84, 127, 171, 177, 178, 271, 273, 339, 343, 503, 639, 798], Xr, { 254: 1901, 77: [1, 1902], 79: En, 259: Kr }), { 84: [2, 1106], 106: 1904, 109: [1, 1906], 111: 1905 }, { 109: [1, 1907] }, e(o3, [2, 233], { 123: 672, 360: 684, 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1, 366: ge }), e([14, 77, 84, 103, 108, 127, 137, 171, 177, 178, 215, 217, 242, 243, 244, 245, 246, 247, 248, 249, 252, 271, 273, 339, 343, 503, 639, 798], [2, 234], { 79: Y2 }), { 2: t, 3: 1096, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 85: 1908, 120: 1151, 229: Qe, 281: ze }, e(xe, [2, 215]), e(xe, [2, 1167]), { 2: t, 3: 771, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 82: S2, 230: 1909 }, { 84: [1, 1910] }, { 84: [1, 1911] }, e(At, [2, 79]), e(s3, [2, 1178], { 278: 1912, 452: [1, 1913] }), e(hs, [2, 1177]), e(B2, [2, 86]), { 2: t, 3: 270, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 208: 1914 }, e(zn, qr, { 410: 1915, 412: 1916, 413: 1917, 250: Qr }), e(De, [2, 1205]), { 2: t, 3: 1919, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, { 79: [1, 1920] }, { 84: [1, 1921], 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, e(De, [2, 600]), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1922, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 84: [1, 1923], 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, { 79: bt, 84: [2, 351] }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1799, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 255: Ft, 256: Pt, 257: 1924, 258: Gt, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 83: [1, 1925] }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1799, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 253: 1926, 255: Ft, 256: Pt, 257: 1795, 258: Gt, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1799, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 253: 1927, 255: Ft, 256: Pt, 257: 1795, 258: Gt, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, e(Bt, [2, 526]), { 2: t, 3: 1928, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, { 140: V, 205: 1929 }, { 2: t, 3: 1930, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, e(Qn, Yr, { 396: 1818, 395: 1931, 402: Wr }), e(ye, [2, 541]), e(ye, [2, 542]), e(ye, [2, 543]), e(ye, [2, 544]), e(ye, [2, 545]), { 6: [1, 1932] }, { 6: [1, 1933] }, e([2, 4, 5, 7, 8, 9, 83], [2, 1198], { 419: 1934, 6: [1, 1935] }), { 2: t, 3: 1936, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, e(Qn, [2, 547]), e(B, [2, 1208], { 448: 1937, 450: 1938, 77: os }), e(B, [2, 648]), e(B, [2, 649], { 402: [1, 1939] }), e(Ce, [2, 766]), e(Ce, [2, 485]), e(r3, [2, 751], { 79: on }), e(r3, [2, 749]), { 83: J2, 152: w, 153: 1066, 154: Ye, 161: _, 190: x, 210: 1067, 335: D, 376: 1940, 456: 209, 457: I3, 461: k }, { 2: t, 3: 1096, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 85: 1941, 120: 1151, 229: Qe, 281: ze }, { 379: [1, 1942] }, { 373: gn, 501: 1943 }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1944, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 373: gn, 501: 1945 }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1946, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 373: gn, 501: 1947 }, e(s3, [2, 80]), e(tt, [2, 240]), { 255: [1, 1948], 256: [1, 1949] }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1950, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 84: [1, 1951] }, { 84: [2, 1107] }, { 83: [1, 1952] }, { 83: [1, 1953] }, { 79: Y2, 84: [1, 1954] }, e(xe, [2, 217]), { 2: t, 3: 1955, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 82: [1, 1956] }, { 2: t, 3: 1957, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 82: [1, 1958] }, e(s3, [2, 276]), e(s3, [2, 1179]), e(De, [2, 1202], { 431: 1959, 430: 1960, 83: ds }), e(De, [2, 590]), e(zn, [2, 553], { 413: 1961, 250: [1, 1962] }), e(zn, [2, 554], { 412: 1963, 250: [1, 1964] }), { 368: ps, 372: bs }, { 84: [1, 1967] }, { 140: V, 205: 1968 }, e(De, [2, 594]), { 84: [1, 1969], 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, e(De, [2, 548]), e(yt, [2, 244]), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1799, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 253: 1970, 255: Ft, 256: Pt, 257: 1795, 258: Gt, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 79: En, 84: [1, 1971] }, { 79: En, 84: [1, 1972] }, e(Bt, [2, 529]), e(Bt, [2, 530]), e(Bt, [2, 531]), e(n3, [2, 540]), { 2: t, 3: 1974, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: [2, 1194], 405: 1973 }, { 83: [1, 1975] }, { 2: t, 3: 1977, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 83: [2, 1200], 420: 1976 }, e([2, 4, 5, 6, 7, 8, 9, 83], [2, 1199]), { 83: [1, 1978] }, e(B, [2, 646]), e(B, [2, 1209]), e(Qn, Yr, { 396: 1818, 395: 1979, 402: Wr }), e(r3, [2, 758], { 79: c2 }), { 79: Y2, 84: [1, 1980] }, e(r3, [2, 760]), e(r3, [2, 753]), { 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 342: [1, 1981], 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, e(r3, [2, 756]), { 109: le, 121: Z1, 123: 672, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 342: [1, 1982], 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 360: 684, 363: de, 364: pe, 365: $1, 366: ge }, e(r3, [2, 754]), e(tt, Xr, { 254: 1983, 259: Kr }), e(tt, Xr, { 254: 1984, 259: Kr }), e(tt, [2, 250], { 123: 672, 360: 684, 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1, 366: ge }), e(T2, [2, 1108], { 107: 1985, 113: 1986, 3: 1988, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 82: gs }), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1991, 112: 1989, 114: 1990, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 1096, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 85: 1992, 120: 1151, 229: Qe, 281: ze }, e(o3, [2, 235]), e(o3, [2, 187]), { 2: t, 3: 1993, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, e(o3, [2, 189]), { 2: t, 3: 1994, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, e(zn, qr, { 412: 1916, 413: 1917, 410: 1995, 250: Qr }), e(De, [2, 1203]), e(De, [2, 555]), { 368: ps }, e(De, [2, 556]), { 372: bs }, { 155: Es, 414: 1996, 415: ms, 416: vs, 417: Ss }, { 155: Es, 414: 2001, 415: ms, 416: vs, 417: Ss }, e(De, [2, 587]), { 84: [1, 2002] }, e(De, [2, 601]), { 79: En, 84: [1, 2003] }, e(yt, [2, 246]), e(yt, [2, 247]), { 83: [1, 2004] }, { 83: [2, 1195] }, { 2: t, 3: 2006, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 141: Zn, 406: 2005 }, { 83: [1, 2008] }, { 83: [2, 1201] }, { 2: t, 3: 2006, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 141: Zn, 406: 2009 }, e(B, [2, 650]), { 378: [1, 2011], 379: [1, 2010] }, { 373: gn, 501: 2012 }, { 368: jr, 372: Hr, 500: 2013 }, e(tt, [2, 241]), e(tt, [2, 242]), e(T2, [2, 87]), e(T2, [2, 1109]), { 2: t, 3: 2014, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, e(T2, [2, 91]), { 79: [1, 2016], 84: [1, 2015] }, e(n3, [2, 93]), e(n3, [2, 94], { 123: 672, 360: 684, 82: [1, 2017], 109: le, 121: Z1, 124: I1, 125: w1, 132: M1, 133: be, 142: F1, 145: D1, 147: P1, 148: ue, 149: fe, 150: H1, 151: Y1, 163: ce, 179: Ee, 180: me, 188: y1, 189: G1, 344: q1, 345: L1, 346: Q1, 348: z1, 349: x1, 350: B1, 351: W1, 352: X1, 353: te, 354: ne, 355: re, 356: ie, 357: se, 358: ae, 359: oe, 363: de, 364: pe, 365: $1, 366: ge }), { 79: Y2, 84: [1, 2018] }, e(o3, [2, 188]), e(o3, [2, 190]), e(De, [2, 589]), e(De, [2, 557]), e(De, [2, 559]), { 330: [1, 2019], 378: [1, 2020] }, e(De, [2, 562]), { 418: [1, 2021] }, e(De, [2, 558]), e(De, [2, 591]), e(yt, [2, 245]), { 2: t, 3: 2006, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 141: Zn, 406: 2022 }, { 79: $n, 84: [1, 2023] }, e(n3, [2, 566]), e(n3, [2, 567]), { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1191, 120: 164, 122: 168, 129: 2025, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 263: 1190, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 79: $n, 84: [1, 2026] }, { 83: J2, 152: w, 153: 1066, 154: Ye, 161: _, 190: x, 210: 1067, 335: D, 376: 2027, 456: 209, 457: I3, 461: k }, { 379: [1, 2028] }, e(r3, [2, 755]), e(r3, [2, 757]), e(T2, [2, 90]), { 84: [2, 89] }, { 2: t, 3: 185, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 61: 180, 83: R1, 104: 1991, 114: 2029, 120: 164, 122: 168, 140: V, 141: J, 146: o1, 152: w, 153: 176, 154: i1, 158: l1, 161: _, 163: u1, 165: M, 167: 183, 188: f1, 189: c1, 190: x, 205: 166, 209: 162, 210: 170, 211: 171, 229: h1, 266: Y, 267: W, 280: 165, 281: d1, 282: 161, 283: 163, 284: 167, 285: 169, 286: 172, 287: 173, 288: 174, 289: 177, 290: 178, 292: p1, 293: b1, 294: b, 298: g1, 299: E1, 301: m1, 304: v1, 313: X, 314: K, 315: q, 316: Q, 317: z, 318: Z, 319: $, 320: e1, 322: j, 323: U, 324: F, 325: P, 326: G, 327: t1, 328: n1, 329: y, 330: s1, 331: S1, 332: T1, 335: D, 336: A1, 345: N1, 350: O1, 456: 209, 457: I3, 461: k }, { 2: t, 3: 2030, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f }, { 84: [1, 2031] }, e(De, [2, 560]), e(De, [2, 561]), e(De, [2, 563]), { 79: $n, 84: [1, 2032] }, { 408: [1, 2033] }, { 2: t, 3: 2034, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 141: [1, 2035] }, { 79: bt, 84: [1, 2036] }, e(ye, [2, 565]), e(r3, [2, 759], { 79: c2 }), e(r3, [2, 761]), e(n3, [2, 92]), e(n3, [2, 95]), e(T2, [2, 1110], { 3: 1988, 110: 2037, 113: 2038, 2: t, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 82: gs }), e(ye, [2, 549]), { 2: t, 3: 270, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 208: 2039 }, e(n3, [2, 568]), e(n3, [2, 569]), e(ye, [2, 564]), e(T2, [2, 88]), e(T2, [2, 1111]), e(zr, [2, 1196], { 409: 2040, 411: 2041, 83: [1, 2042] }), e(ye, qr, { 412: 1916, 413: 1917, 410: 2043, 250: Qr }), e(zr, [2, 1197]), { 2: t, 3: 2006, 4: n, 5: i, 6: s, 7: o, 8: a, 9: f, 141: Zn, 406: 2044 }, e(ye, [2, 550]), { 79: $n, 84: [1, 2045] }, e(zr, [2, 551])], defaultActions: { 113: [2, 10], 213: [2, 356], 214: [2, 357], 215: [2, 358], 216: [2, 359], 217: [2, 360], 218: [2, 361], 219: [2, 362], 220: [2, 363], 221: [2, 364], 222: [2, 365], 230: [2, 739], 638: [2, 1219], 700: [2, 1180], 701: [2, 1181], 764: [2, 740], 837: [2, 366], 838: [2, 1128], 839: [2, 1129], 999: [2, 470], 1e3: [2, 471], 1001: [2, 472], 1075: [2, 741], 1391: [2, 1173], 1421: [2, 1229], 1493: [2, 742], 1521: [2, 1115], 1593: [2, 1227], 1620: [2, 355], 1682: [2, 1175], 1704: [2, 1185], 1719: [2, 538], 1905: [2, 1107], 1974: [2, 1195], 1977: [2, 1201], 2015: [2, 89] }, parseError: function(ve, ke) {
            if (ke.recoverable) this.trace(ve);
            else {
              var Te = new Error(ve);
              throw Te.hash = ke, Te;
            }
          }, parse: function(ve) {
            var ke = this, Te = [0], d = [], Je = [null], l = [], nt = this.table, u = "", X2 = 0, Jt = 0, We = 0, s2 = 2, b2 = 1, jt = l.slice.call(arguments, 1), je = Object.create(this.lexer), g2 = { yy: {} };
            for (var K2 in this.yy) Object.prototype.hasOwnProperty.call(this.yy, K2) && (g2.yy[K2] = this.yy[K2]);
            je.setInput(ve, g2.yy), g2.yy.lexer = je, g2.yy.parser = this, typeof je.yylloc > "u" && (je.yylloc = {});
            var E2 = je.yylloc;
            l.push(E2);
            var mn = je.options && je.options.ranges;
            typeof g2.yy.parseError == "function" ? this.parseError = g2.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
            function vn(h2) {
              Te.length = Te.length - 2 * h2, Je.length = Je.length - h2, l.length = l.length - h2;
            }
            for (var Ht = function() {
              var h2;
              return h2 = je.lex() || b2, typeof h2 != "number" && (h2 = ke.symbols_[h2] || h2), h2;
            }, Le, l3, A2, m2, Sa, $r, Yt = {}, tr, q2, Ts, nr; ; ) {
              if (A2 = Te[Te.length - 1], this.defaultActions[A2] ? m2 = this.defaultActions[A2] : ((Le === null || typeof Le > "u") && (Le = Ht()), m2 = nt[A2] && nt[A2][Le]), typeof m2 > "u" || !m2.length || !m2[0]) {
                var Sn, Tn = "", As = function(h2) {
                  for (var e4 = Te.length - 1, Ns = 0; ; ) {
                    if (s2.toString() in nt[h2]) return Ns;
                    if (h2 === 0 || e4 < 2) return false;
                    e4 -= 2, h2 = Te[e4], ++Ns;
                  }
                };
                if (We) l3 !== b2 && (Sn = As(A2));
                else {
                  Sn = As(A2), nr = [];
                  for (tr in nt[A2]) this.terminals_[tr] && tr > s2 && nr.push("'" + this.terminals_[tr] + "'");
                  je.showPosition ? Tn = "Parse error on line " + (X2 + 1) + `:
` + je.showPosition() + `
Expecting ` + nr.join(", ") + ", got '" + (this.terminals_[Le] || Le) + "'" : Tn = "Parse error on line " + (X2 + 1) + ": Unexpected " + (Le == b2 ? "end of input" : "'" + (this.terminals_[Le] || Le) + "'"), this.parseError(Tn, { text: je.match, token: this.terminals_[Le] || Le, line: je.yylineno, loc: E2, expected: nr, recoverable: Sn !== false });
                }
                if (We == 3) {
                  if (Le === b2 || l3 === b2) throw new Error(Tn || "Parsing halted while starting to recover from another error.");
                  Jt = je.yyleng, u = je.yytext, X2 = je.yylineno, E2 = je.yylloc, Le = Ht();
                }
                if (Sn === false) throw new Error(Tn || "Parsing halted. No suitable error recovery rule available.");
                vn(Sn), l3 = Le == s2 ? null : Le, Le = s2, A2 = Te[Te.length - 1], m2 = nt[A2] && nt[A2][s2], We = 3;
              }
              if (m2[0] instanceof Array && m2.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + A2 + ", token: " + Le);
              switch (m2[0]) {
                case 1:
                  Te.push(Le), Je.push(je.yytext), l.push(je.yylloc), Te.push(m2[1]), Le = null, l3 ? (Le = l3, l3 = null) : (Jt = je.yyleng, u = je.yytext, X2 = je.yylineno, E2 = je.yylloc, We > 0 && We--);
                  break;
                case 2:
                  if (q2 = this.productions_[m2[1]][1], Yt.$ = Je[Je.length - q2], Yt._$ = { first_line: l[l.length - (q2 || 1)].first_line, last_line: l[l.length - 1].last_line, first_column: l[l.length - (q2 || 1)].first_column, last_column: l[l.length - 1].last_column }, mn && (Yt._$.range = [l[l.length - (q2 || 1)].range[0], l[l.length - 1].range[1]]), $r = this.performAction.apply(Yt, [u, Jt, X2, g2.yy, m2[1], Je, l].concat(jt)), typeof $r < "u") return $r;
                  q2 && (Te = Te.slice(0, -1 * q2 * 2), Je = Je.slice(0, -1 * q2), l = l.slice(0, -1 * q2)), Te.push(this.productions_[m2[1]][0]), Je.push(Yt.$), l.push(Yt._$), Ts = nt[Te[Te.length - 2]][Te[Te.length - 1]], Te.push(Ts);
                  break;
                case 3:
                  return true;
              }
            }
            return true;
          } }, na = ["A", "ABSENT", "ABSOLUTE", "ACCORDING", "ACTION", "ADA", "ADD", "ADMIN", "AFTER", "ALWAYS", "ASC", "ASSERTION", "ASSIGNMENT", "ATTRIBUTE", "ATTRIBUTES", "BASE64", "BEFORE", "BERNOULLI", "BLOCKED", "BOM", "BREADTH", "C", "CASCADE", "CATALOG", "CATALOG_NAME", "CHAIN", "CHARACTERISTICS", "CHARACTERS", "CHARACTER_SET_CATALOG", "CHARACTER_SET_NAME", "CHARACTER_SET_SCHEMA", "CLASS_ORIGIN", "CLOSE", "COBOL", "COLLATION", "COLLATION_CATALOG", "COLLATION_NAME", "COLLATION_SCHEMA", "COLUMNS", "COLUMN_NAME", "COMMAND_FUNCTION", "COMMAND_FUNCTION_CODE", "COMMITTED", "CONDITION_NUMBER", "CONNECTION", "CONNECTION_NAME", "CONSTRAINTS", "CONSTRAINT_CATALOG", "CONSTRAINT_NAME", "CONSTRAINT_SCHEMA", "CONSTRUCTOR", "CONTENT", "CONTINUE", "CONTROL", "CURSOR_NAME", "DATA", "DATETIME_INTERVAL_CODE", "DATETIME_INTERVAL_PRECISION", "DB", "DEFAULTS", "DEFERRABLE", "DEFERRED", "DEFINED", "DEFINER", "DEGREE", "DELETED", "DEPTH", "DERIVED", "DESC", "DESCRIPTOR", "DIAGNOSTICS", "DISPATCH", "DOCUMENT", "DOMAIN", "DYNAMIC_FUNCTION", "DYNAMIC_FUNCTION_CODE", "EMPTY", "ENCODING", "ENFORCED", "EXCLUDE", "EXCLUDING", "EXPRESSION", "FILE", "FINAL", "FIRST", "FLAG", "FOLLOWING", "FORTRAN", "FOUND", "FS", "G", "GENERAL", "GENERATED", "GO", "GOTO", "GRANTED", "HEX", "HIERARCHY", "ID", "IGNORE", "IMMEDIATE", "IMMEDIATELY", "IMPLEMENTATION", "INCLUDING", "INCREMENT", "INDENT", "INITIALLY", "INPUT", "INSERTED", "INSTANCE", "INSTANTIABLE", "INSTEAD", "INTEGRITY", "INVOKER", "ISOLATION", "K", "KEY", "KEY_MEMBER", "KEY_TYPE", "LAST", "LENGTH", "LEVEL", "LIBRARY", "LIMIT", "LINK", "LOCATION", "LOCATOR", "M", "MAP", "MAPPING", "MATCHED", "MAXVALUE", "MESSAGE_LENGTH", "MESSAGE_OCTET_LENGTH", "MESSAGE_TEXT", "MINVALUE", "MORE", "MUMPS", "NAME", "NAMES", "NAMESPACE", "NESTING", "NEXT", "NFC", "NFD", "NFKC", "NFKD", "NIL", "NORMALIZED", "NULLABLE", "NULLS", "NUMBER", "OBJECT", "OCTETS", "OFF", "OPEN", "OPTION", "OPTIONS", "ORDER", "ORDERING", "ORDINALITY", "OTHERS", "OUTPUT", "OVERRIDING", "P", "PAD", "PARAMETER_MODE", "PARAMETER_NAME", "PARAMETER_ORDINAL_POSITION", "PARAMETER_SPECIFIC_CATALOG", "PARAMETER_SPECIFIC_NAME", "PARAMETER_SPECIFIC_SCHEMA", "PARTIAL", "PASCAL", "PASSING", "PASSTHROUGH", "PATH", "PERMISSION", "PLACING", "PLI", "PRECEDING", "PRESERVE", "PRIOR", "PRIVILEGES", "PUBLIC", "READ", "RECOVERY", "RELATIVE", "REPEATABLE", "REQUIRING", "RESPECT", "RESTART", "RESTORE", "RESTRICT", "RETURNED_CARDINALITY", "RETURNED_LENGTH", "RETURNED_OCTET_LENGTH", "RETURNED_SQLSTATE", "RETURNING", "ROLE", "ROUTINE", "ROUTINE_CATALOG", "ROUTINE_NAME", "ROUTINE_SCHEMA", "ROW_COUNT", "SCALE", "SCHEMA", "SCHEMA_NAME", "SCOPE_CATALOG", "SCOPE_NAME", "SCOPE_SCHEMA", "SECTION", "SECURITY", "SELECTIVE", "SELF", "SEPARATOR", "SEQUENCE", "SERIALIZABLE", "SERVER", "SERVER_NAME", "SESSION", "SETS", "SIMPLE", "SIZE", "SOURCE", "SPACE", "SPECIFIC_NAME", "STANDALONE", "STATE", "STATEMENT", "STRIP", "STRUCTURE", "STYLE", "SUBCLASS_ORIGIN", "T", "TABLE_NAME", "TEMPORARY", "TIES", "TOKEN", "TOP_LEVEL_COUNT", "TRANSACTION", "TRANSACTIONS_COMMITTED", "TRANSACTIONS_ROLLED_BACK", "TRANSACTION_ACTIVE", "TRANSFORM", "TRANSFORMS", "TRIGGER_CATALOG", "TRIGGER_NAME", "TRIGGER_SCHEMA", "TYPE", "UNBOUNDED", "UNCOMMITTED", "UNDER", "UNLINK", "UNNAMED", "UNTYPED", "URI", "USAGE", "USER_DEFINED_TYPE_CATALOG", "USER_DEFINED_TYPE_CODE", "USER_DEFINED_TYPE_NAME", "USER_DEFINED_TYPE_SCHEMA", "VALID", "VERSION", "VIEW", "WHITESPACE", "WORK", "WRAPPER", "WRITE", "XMLDECLARATION", "XMLSCHEMA", "YES", "ZONE"];
          er.parseError = function(V2, ve) {
            if (!(ve.expected && ve.expected.indexOf("'LITERAL'") > -1 && /[a-zA-Z_][a-zA-Z_0-9]*/.test(ve.token) && na.indexOf(ve.token) > -1)) throw new SyntaxError(V2);
          };
          var ra = /* @__PURE__ */ (function() {
            var V2 = { EOF: 1, parseError: function(ke, Te) {
              if (this.yy.parser) this.yy.parser.parseError(ke, Te);
              else throw new Error(ke);
            }, setInput: function(ve, ke) {
              return this.yy = ke || this.yy || {}, this._input = ve, this._more = this._backtrack = this.done = false, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
            }, input: function() {
              var ve = this._input[0];
              this.yytext += ve, this.yyleng++, this.offset++, this.match += ve, this.matched += ve;
              var ke = ve.match(/(?:\r\n?|\n).*/g);
              return ke ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), ve;
            }, unput: function(ve) {
              var ke = ve.length, Te = ve.split(/(?:\r\n?|\n)/g);
              this._input = ve + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - ke), this.offset -= ke;
              var d = this.match.split(/(?:\r\n?|\n)/g);
              this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), Te.length - 1 && (this.yylineno -= Te.length - 1);
              var Je = this.yylloc.range;
              return this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: Te ? (Te.length === d.length ? this.yylloc.first_column : 0) + d[d.length - Te.length].length - Te[0].length : this.yylloc.first_column - ke }, this.options.ranges && (this.yylloc.range = [Je[0], Je[0] + this.yyleng - ke]), this.yyleng = this.yytext.length, this;
            }, more: function() {
              return this._more = true, this;
            }, reject: function() {
              if (this.options.backtrack_lexer) this._backtrack = true;
              else return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
` + this.showPosition(), { text: "", token: null, line: this.yylineno });
              return this;
            }, less: function(ve) {
              this.unput(this.match.slice(ve));
            }, pastInput: function() {
              var ve = this.matched.substr(0, this.matched.length - this.match.length);
              return (ve.length > 20 ? "..." : "") + ve.substr(-20).replace(/\n/g, "");
            }, upcomingInput: function() {
              var ve = this.match;
              return ve.length < 20 && (ve += this._input.substr(0, 20 - ve.length)), (ve.substr(0, 20) + (ve.length > 20 ? "..." : "")).replace(/\n/g, "");
            }, showPosition: function() {
              var ve = this.pastInput(), ke = new Array(ve.length + 1).join("-");
              return ve + this.upcomingInput() + `
` + ke + "^";
            }, test_match: function(ve, ke) {
              var Te, d, Je;
              if (this.options.backtrack_lexer && (Je = { yylineno: this.yylineno, yylloc: { first_line: this.yylloc.first_line, last_line: this.last_line, first_column: this.yylloc.first_column, last_column: this.yylloc.last_column }, yytext: this.yytext, match: this.match, matches: this.matches, matched: this.matched, yyleng: this.yyleng, offset: this.offset, _more: this._more, _input: this._input, yy: this.yy, conditionStack: this.conditionStack.slice(0), done: this.done }, this.options.ranges && (Je.yylloc.range = this.yylloc.range.slice(0))), d = ve[0].match(/(?:\r\n?|\n).*/g), d && (this.yylineno += d.length), this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: d ? d[d.length - 1].length - d[d.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + ve[0].length }, this.yytext += ve[0], this.match += ve[0], this.matches = ve, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = false, this._backtrack = false, this._input = this._input.slice(ve[0].length), this.matched += ve[0], Te = this.performAction.call(this, this.yy, this, ke, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = false), Te) return Te;
              if (this._backtrack) {
                for (var l in Je) this[l] = Je[l];
                return false;
              }
              return false;
            }, next: function() {
              if (this.done) return this.EOF;
              this._input || (this.done = true);
              var ve, ke, Te, d;
              this._more || (this.yytext = "", this.match = "");
              for (var Je = this._currentRules(), l = 0; l < Je.length; l++) if (Te = this._input.match(this.rules[Je[l]]), Te && (!ke || Te[0].length > ke[0].length)) {
                if (ke = Te, d = l, this.options.backtrack_lexer) {
                  if (ve = this.test_match(Te, Je[l]), ve !== false) return ve;
                  if (this._backtrack) {
                    ke = false;
                    continue;
                  } else return false;
                } else if (!this.options.flex) break;
              }
              return ke ? (ve = this.test_match(ke, Je[d]), ve !== false ? ve : false) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
` + this.showPosition(), { text: "", token: null, line: this.yylineno });
            }, lex: function() {
              var ke = this.next();
              return ke || this.lex();
            }, begin: function(ke) {
              this.conditionStack.push(ke);
            }, popState: function() {
              var ke = this.conditionStack.length - 1;
              return ke > 0 ? this.conditionStack.pop() : this.conditionStack[0];
            }, _currentRules: function() {
              return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
            }, topState: function(ke) {
              return ke = this.conditionStack.length - 1 - Math.abs(ke || 0), ke >= 0 ? this.conditionStack[ke] : "INITIAL";
            }, pushState: function(ke) {
              this.begin(ke);
            }, stateStackSize: function() {
              return this.conditionStack.length;
            }, options: { "case-insensitive": true }, performAction: function(ke, Te, d, Je) {
              var l = Je;
              switch (d) {
                case 0:
                  return 294;
                case 1:
                  return 335;
                case 2:
                  return 457;
                case 3:
                  return 332;
                case 4:
                  return 5;
                case 5:
                  return 5;
                case 6:
                  return 329;
                case 7:
                  return 329;
                case 8:
                  return 141;
                case 9:
                  return 141;
                case 10:
                  return;
                case 11:
                  break;
                case 12:
                  return 349;
                case 13:
                  return 352;
                case 14:
                  return Te.yytext = "VALUE", 96;
                  break;
                case 15:
                  return Te.yytext = "VALUE", 198;
                  break;
                case 16:
                  return Te.yytext = "ROW", 198;
                  break;
                case 17:
                  return Te.yytext = "COLUMN", 198;
                  break;
                case 18:
                  return Te.yytext = "MATRIX", 198;
                  break;
                case 19:
                  return Te.yytext = "INDEX", 198;
                  break;
                case 20:
                  return Te.yytext = "RECORDSET", 198;
                  break;
                case 21:
                  return Te.yytext = "TEXT", 198;
                  break;
                case 22:
                  return Te.yytext = "SELECT", 198;
                  break;
                case 23:
                  return 558;
                case 24:
                  return 418;
                case 25:
                  return 439;
                case 26:
                  return 553;
                case 27:
                  return 319;
                case 28:
                  return 297;
                case 29:
                  return 297;
                case 30:
                  return 173;
                case 31:
                  return 437;
                case 32:
                  return 179;
                case 33:
                  return 249;
                case 34:
                  return 175;
                case 35:
                  return 216;
                case 36:
                  return 320;
                case 37:
                  return 82;
                case 38:
                  return 455;
                case 39:
                  return 268;
                case 40:
                  return 441;
                case 41:
                  return 391;
                case 42:
                  return 318;
                case 43:
                  return 552;
                case 44:
                  return 475;
                case 45:
                  return 363;
                case 46:
                  return 480;
                case 47:
                  return 364;
                case 48:
                  return 348;
                case 49:
                  return 128;
                case 50:
                  return 121;
                case 51:
                  return 348;
                case 52:
                  return 121;
                case 53:
                  return 348;
                case 54:
                  return 121;
                case 55:
                  return 348;
                case 56:
                  return 546;
                case 57:
                  return 336;
                case 58:
                  return 415;
                case 59:
                  return 299;
                case 60:
                  return 403;
                case 61:
                  return 139;
                case 62:
                  return 8;
                case 63:
                  return 269;
                case 64:
                  return 199;
                case 65:
                  return 199;
                case 66:
                  return 472;
                case 67:
                  return 402;
                case 68:
                  return 509;
                case 69:
                  return 478;
                case 70:
                  return 301;
                case 71:
                  return 262;
                case 72:
                  return 315;
                case 73:
                  return 295;
                case 74:
                  return 215;
                case 75:
                  return 256;
                case 76:
                  return 292;
                case 77:
                  return 293;
                case 78:
                  return 293;
                case 79:
                  return "CURSOR";
                case 80:
                  return 442;
                case 81:
                  return 323;
                case 82:
                  return 324;
                case 83:
                  return 325;
                case 84:
                  return 488;
                case 85:
                  return 378;
                case 86:
                  return 372;
                case 87:
                  return 281;
                case 88:
                  return 268;
                case 89:
                  return 443;
                case 90:
                  return 194;
                case 91:
                  return 433;
                case 92:
                  return 487;
                case 93:
                  return 144;
                case 94:
                  return 339;
                case 95:
                  return 426;
                case 96:
                  return 343;
                case 97:
                  return 347;
                case 98:
                  return 178;
                case 99:
                  return 546;
                case 100:
                  return 546;
                case 101:
                  return 331;
                case 102:
                  return 18;
                case 103:
                  return 328;
                case 104:
                  return 275;
                case 105:
                  return 266;
                case 106:
                  return 105;
                case 107:
                  return 407;
                case 108:
                  return 192;
                case 109:
                  return 247;
                case 110:
                  return 296;
                case 111:
                  return 346;
                case 112:
                  return 639;
                case 113:
                  return 511;
                case 114:
                  return 252;
                case 115:
                  return 304;
                case 116:
                  return 258;
                case 117:
                  return 259;
                case 118:
                  return 165;
                case 119:
                  return 391;
                case 120:
                  return 377;
                case 121:
                  return 365;
                case 122:
                  return 109;
                case 123:
                  return 202;
                case 124:
                  return 223;
                case 125:
                  return 244;
                case 126:
                  return 554;
                case 127:
                  return 373;
                case 128:
                  return 229;
                case 129:
                  return 177;
                case 130:
                  return 326;
                case 131:
                  return 207;
                case 132:
                  return 479;
                case 133:
                  return 243;
                case 134:
                  return 6;
                case 135:
                  return 267;
                case 136:
                  return "LET";
                case 137:
                  return 481;
                case 138:
                  return 245;
                case 139:
                  return 121;
                case 140:
                  return 271;
                case 141:
                  return 499;
                case 142:
                  return 200;
                case 143:
                  return 317;
                case 144:
                  return 427;
                case 145:
                  return 316;
                case 146:
                  return 492;
                case 147:
                  return 178;
                case 148:
                  return 440;
                case 149:
                  return 242;
                case 150:
                  return 681;
                case 151:
                  return 298;
                case 152:
                  return 270;
                case 153:
                  return 417;
                case 154:
                  return 163;
                case 155:
                  return 330;
                case 156:
                  return 265;
                case 157:
                  return 471;
                case 158:
                  return 250;
                case 159:
                  return 452;
                case 160:
                  return 138;
                case 161:
                  return 273;
                case 162:
                  return 7;
                case 163:
                  return 453;
                case 164:
                  return 180;
                case 165:
                  return 127;
                case 166:
                  return 217;
                case 167:
                  return 503;
                case 168:
                  return 307;
                case 169:
                  return 181;
                case 170:
                  return 311;
                case 171:
                  return 799;
                case 172:
                  return 103;
                case 173:
                  return 20;
                case 174:
                  return 404;
                case 175:
                  return 482;
                case 176:
                  return 713;
                case 177:
                  return 19;
                case 178:
                  return 451;
                case 179:
                  return 203;
                case 180:
                  return "REDUCE";
                case 181:
                  return 81;
                case 182:
                  return 408;
                case 183:
                  return 344;
                case 184:
                  return 555;
                case 185:
                  return 717;
                case 186:
                  return 116;
                case 187:
                  return 438;
                case 188:
                  return 184;
                case 189:
                  return 322;
                case 190:
                  return 416;
                case 191:
                  return 483;
                case 192:
                  return 722;
                case 193:
                  return 182;
                case 194:
                  return 182;
                case 195:
                  return 246;
                case 196:
                  return 474;
                case 197:
                  return 255;
                case 198:
                  return 159;
                case 199:
                  return 800;
                case 200:
                  return 442;
                case 201:
                  return 96;
                case 202:
                  return 248;
                case 203:
                  return 9;
                case 204:
                  return 155;
                case 205:
                  return 155;
                case 206:
                  return 446;
                case 207:
                  return 367;
                case 208:
                  return 454;
                case 209:
                  return "STRATEGY";
                case 210:
                  return "STORE";
                case 211:
                  return 313;
                case 212:
                  return 314;
                case 213:
                  return 388;
                case 214:
                  return 388;
                case 215:
                  return 502;
                case 216:
                  return 392;
                case 217:
                  return 392;
                case 218:
                  return 201;
                case 219:
                  return 342;
                case 220:
                  return "TIMEOUT";
                case 221:
                  return 157;
                case 222:
                  return 204;
                case 223:
                  return 473;
                case 224:
                  return 473;
                case 225:
                  return 547;
                case 226:
                  return 327;
                case 227:
                  return 491;
                case 228:
                  return 171;
                case 229:
                  return 196;
                case 230:
                  return 108;
                case 231:
                  return 368;
                case 232:
                  return 445;
                case 233:
                  return 251;
                case 234:
                  return 158;
                case 235:
                  return 379;
                case 236:
                  return 143;
                case 237:
                  return 447;
                case 238:
                  return 341;
                case 239:
                  return 137;
                case 240:
                  return 477;
                case 241:
                  return 77;
                case 242:
                  return 473;
                case 243:
                  return 4;
                case 244:
                  return 140;
                case 245:
                  return 124;
                case 246:
                  return 146;
                case 247:
                  return 188;
                case 248:
                  return 350;
                case 249:
                  return 189;
                case 250:
                  return 142;
                case 251:
                  return 147;
                case 252:
                  return 359;
                case 253:
                  return 356;
                case 254:
                  return 358;
                case 255:
                  return 355;
                case 256:
                  return 353;
                case 257:
                  return 351;
                case 258:
                  return 352;
                case 259:
                  return 151;
                case 260:
                  return 150;
                case 261:
                  return 148;
                case 262:
                  return 354;
                case 263:
                  return 357;
                case 264:
                  return 149;
                case 265:
                  return 133;
                case 266:
                  return 357;
                case 267:
                  return 83;
                case 268:
                  return 84;
                case 269:
                  return 461;
                case 270:
                  return 463;
                case 271:
                  return 333;
                case 272:
                  return 466;
                case 273:
                  return 545;
                case 274:
                  return 131;
                case 275:
                  return 125;
                case 276:
                  return 79;
                case 277:
                  return 366;
                case 278:
                  return 161;
                case 279:
                  return 798;
                case 280:
                  return 152;
                case 281:
                  return 190;
                case 282:
                  return 145;
                case 283:
                  return 132;
                case 284:
                  return 345;
                case 285:
                  return 154;
                case 286:
                  return 14;
                case 287:
                  return "INVALID";
              }
            }, rules: [/^(?:``([^\`])+``)/i, /^(?:\[\?\])/i, /^(?:@\[)/i, /^(?:ARRAY\[)/i, /^(?:\[([^\]'])*?\])/i, /^(?:`([^\`'])*?`)/i, /^(?:N(['](\\.|[^']|\\')*?['])+)/i, /^(?:X(['](\\.|[^']|\\')*?['])+)/i, /^(?:(['](\\.|[^']|\\')*?['])+)/i, /^(?:(["](\\.|[^"]|\\")*?["])+)/i, /^(?:--(.*?)($|\r\n|\r|\n))/i, /^(?:\s+)/i, /^(?:\|\|)/i, /^(?:\|)/i, /^(?:VALUE\s+OF\s+SEARCH\b)/i, /^(?:VALUE\s+OF\s+SELECT\b)/i, /^(?:ROW\s+OF\s+SELECT\b)/i, /^(?:COLUMN\s+OF\s+SELECT\b)/i, /^(?:MATRIX\s+OF\s+SELECT\b)/i, /^(?:INDEX\s+OF\s+SELECT\b)/i, /^(?:RECORDSET\s+OF\s+SELECT\b)/i, /^(?:TEXT\s+OF\s+SELECT\b)/i, /^(?:SELECT\b)/i, /^(?:ABSOLUTE\b)/i, /^(?:ACTION\b)/i, /^(?:ADD\b)/i, /^(?:AFTER\b)/i, /^(?:AGGR\b)/i, /^(?:AGGREGATE\b)/i, /^(?:AGGREGATOR\b)/i, /^(?:ALL\b)/i, /^(?:ALTER\b)/i, /^(?:AND\b)/i, /^(?:ANTI\b)/i, /^(?:ANY\b)/i, /^(?:APPLY\b)/i, /^(?:ARRAY\b)/i, /^(?:AS\b)/i, /^(?:ASSERT\b)/i, /^(?:ASC\b)/i, /^(?:ATTACH\b)/i, /^(?:AUTO(_)?INCREMENT\b)/i, /^(?:AVG\b)/i, /^(?:BEFORE\b)/i, /^(?:BEGIN\b)/i, /^(?:BETWEEN\b)/i, /^(?:BREAK\b)/i, /^(?:NOT\s+BETWEEN\b)/i, /^(?:NOT\s+LIKE\b)/i, /^(?:BY\b)/i, /^(?:~~\*)/i, /^(?:!~~\*)/i, /^(?:~~)/i, /^(?:!~~)/i, /^(?:ILIKE\b)/i, /^(?:NOT\s+ILIKE\b)/i, /^(?:CALL\b)/i, /^(?:CASE\b)/i, /^(?:CASCADE\b)/i, /^(?:CAST\b)/i, /^(?:CHECK\b)/i, /^(?:CLASS\b)/i, /^(?:CLOSE\b)/i, /^(?:COLLATE\b)/i, /^(?:COLUMN\b)/i, /^(?:COLUMNS\b)/i, /^(?:COMMIT\b)/i, /^(?:CONSTRAINT\b)/i, /^(?:CONTENT\b)/i, /^(?:CONTINUE\b)/i, /^(?:CONVERT\b)/i, /^(?:CORRESPONDING\b)/i, /^(?:COUNT\b)/i, /^(?:CREATE\b)/i, /^(?:CROSS\b)/i, /^(?:CUBE\b)/i, /^(?:CURRENT_TIMESTAMP\b)/i, /^(?:CURRENT_DATE\b)/i, /^(?:CURDATE\b)/i, /^(?:CURSOR\b)/i, /^(?:DATABASE(S)?)/i, /^(?:DATEADD\b)/i, /^(?:DATEDIFF\b)/i, /^(?:TIMESTAMPDIFF\b)/i, /^(?:DECLARE\b)/i, /^(?:DEFAULT\b)/i, /^(?:DELETE\b)/i, /^(?:DELETED\b)/i, /^(?:DESC\b)/i, /^(?:DETACH\b)/i, /^(?:DISTINCT\b)/i, /^(?:DROP\b)/i, /^(?:ECHO\b)/i, /^(?:EDGE\b)/i, /^(?:END\b)/i, /^(?:ENUM\b)/i, /^(?:ELSE\b)/i, /^(?:ESCAPE\b)/i, /^(?:EXCEPT\b)/i, /^(?:EXEC\b)/i, /^(?:EXECUTE\b)/i, /^(?:EXISTS\b)/i, /^(?:EXPLAIN\b)/i, /^(?:FALSE\b)/i, /^(?:FETCH\b)/i, /^(?:FIRST\b)/i, /^(?:FOR\b)/i, /^(?:FOREIGN\b)/i, /^(?:FROM\b)/i, /^(?:FULL\b)/i, /^(?:FUNCTION\b)/i, /^(?:GLOB\b)/i, /^(?:GO\b)/i, /^(?:GRAPH\b)/i, /^(?:GROUP\b)/i, /^(?:GROUP_CONCAT\b)/i, /^(?:GROUPING\b)/i, /^(?:HAVING\b)/i, /^(?:IF\b)/i, /^(?:IDENTITY\b)/i, /^(?:IGNORE\b)/i, /^(?:IS\b)/i, /^(?:IN\b)/i, /^(?:INDEX\b)/i, /^(?:INDEXED\b)/i, /^(?:INNER\b)/i, /^(?:INSTEAD\b)/i, /^(?:INSERT\b)/i, /^(?:INSERTED\b)/i, /^(?:INTERSECT\b)/i, /^(?:INTERVAL\b)/i, /^(?:INTO\b)/i, /^(?:ITERATE\b)/i, /^(?:JOIN\b)/i, /^(?:KEY\b)/i, /^(?:LAST\b)/i, /^(?:LET\b)/i, /^(?:LEAVE\b)/i, /^(?:LEFT\b)/i, /^(?:LIKE\b)/i, /^(?:LIMIT\b)/i, /^(?:MATCHED\b)/i, /^(?:MATRIX\b)/i, /^(?:MAX\s*(?=\())/i, /^(?:MAX\s*(?=(,|\))))/i, /^(?:MIN\s*(?=\())/i, /^(?:MERGE\b)/i, /^(?:MINUS\b)/i, /^(?:MODIFY\b)/i, /^(?:NATURAL\b)/i, /^(?:NEXT\b)/i, /^(?:NEW\b)/i, /^(?:NOCASE\b)/i, /^(?:NO\b)/i, /^(?:NOT\b)/i, /^(?:NULL\b)/i, /^(?:NULLS\b)/i, /^(?:OFF\b)/i, /^(?:ON\b)/i, /^(?:ONLY\b)/i, /^(?:OF\b)/i, /^(?:OFFSET\b)/i, /^(?:OPEN\b)/i, /^(?:OPTION\b)/i, /^(?:OR\b)/i, /^(?:ORDER\b)/i, /^(?:OUTER\b)/i, /^(?:OUTPUT\b)/i, /^(?:OVER\b)/i, /^(?:PATH\b)/i, /^(?:PARTITION\b)/i, /^(?:PERCENT\b)/i, /^(?:PIVOT\b)/i, /^(?:PLAN\b)/i, /^(?:PRIMARY\b)/i, /^(?:PRINT\b)/i, /^(?:PRIOR\b)/i, /^(?:QUERY\b)/i, /^(?:READ\b)/i, /^(?:RECORDSET\b)/i, /^(?:REDUCE\b)/i, /^(?:RECURSIVE\b)/i, /^(?:REFERENCES\b)/i, /^(?:REGEXP\b)/i, /^(?:REINDEX\b)/i, /^(?:RELATIVE\b)/i, /^(?:REMOVE\b)/i, /^(?:RENAME\b)/i, /^(?:REPEAT\b)/i, /^(?:REPLACE\b)/i, /^(?:RESTRICT\b)/i, /^(?:REQUIRE\b)/i, /^(?:RESTORE\b)/i, /^(?:RETURN\b)/i, /^(?:RETURNS\b)/i, /^(?:RIGHT\b)/i, /^(?:ROLLBACK\b)/i, /^(?:ROLLUP\b)/i, /^(?:ROW\b)/i, /^(?:ROWS\b)/i, /^(?:SCHEMA(S)?)/i, /^(?:SEARCH\b)/i, /^(?:SEMI\b)/i, /^(?:SEPARATOR\b)/i, /^(?:SET\b)/i, /^(?:SETS\b)/i, /^(?:SHOW\b)/i, /^(?:SOME\b)/i, /^(?:SOURCE\b)/i, /^(?:STRATEGY\b)/i, /^(?:STORE\b)/i, /^(?:SUM\b)/i, /^(?:TOTAL\b)/i, /^(?:TABLE\b)/i, /^(?:TABLES\b)/i, /^(?:TARGET\b)/i, /^(?:TEMP\b)/i, /^(?:TEMPORARY\b)/i, /^(?:TEXTSTRING\b)/i, /^(?:THEN\b)/i, /^(?:TIMEOUT\b)/i, /^(?:TO\b)/i, /^(?:TOP\b)/i, /^(?:TRAN\b)/i, /^(?:TRANSACTION\b)/i, /^(?:TRIGGER\b)/i, /^(?:TRUE\b)/i, /^(?:TRUNCATE\b)/i, /^(?:UNION\b)/i, /^(?:UNIQUE\b)/i, /^(?:UNPIVOT\b)/i, /^(?:UPDATE\b)/i, /^(?:USE\b)/i, /^(?:USING\b)/i, /^(?:VALUE\b)/i, /^(?:VALUES\b)/i, /^(?:VERTEX\b)/i, /^(?:VIEW\b)/i, /^(?:WHEN\b)/i, /^(?:WHERE\b)/i, /^(?:WHILE\b)/i, /^(?:WITH\b)/i, /^(?:WORK\b)/i, /^(?:[0-9]*[a-zA-Z_]+[a-zA-Z_0-9]*)/i, /^(?:(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?(?![a-zA-Z_0-9]))/i, /^(?:->)/i, /^(?:#)/i, /^(?:\+)/i, /^(?:-)/i, /^(?:\*)/i, /^(?:\/)/i, /^(?:%)/i, /^(?:!===)/i, /^(?:===)/i, /^(?:!==)/i, /^(?:==)/i, /^(?:>=)/i, /^(?:&)/i, /^(?:\|)/i, /^(?:<<)/i, /^(?:>>)/i, /^(?:>)/i, /^(?:<=)/i, /^(?:<>)/i, /^(?:<)/i, /^(?:=)/i, /^(?:!=)/i, /^(?:\()/i, /^(?:\))/i, /^(?:\{)/i, /^(?:\})/i, /^(?:\])/i, /^(?::-)/i, /^(?:\?-)/i, /^(?:\.\.)/i, /^(?:\.)/i, /^(?:,)/i, /^(?:::)/i, /^(?::)/i, /^(?:;)/i, /^(?:\$)/i, /^(?:\?)/i, /^(?:!)/i, /^(?:\^)/i, /^(?:~)/i, /^(?:@)/i, /^(?:$)/i, /^(?:.)/i], conditions: { INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287], inclusive: true } } };
            return V2;
          })();
          er.lexer = ra;
          function Zr() {
            this.yy = {};
          }
          return Zr.prototype = er, er.Parser = Zr, new Zr();
        })();
        typeof R2 < "u" && typeof exports < "u" && (exports.parser = rt, exports.Parser = rt.Parser, exports.parse = function() {
          return rt.parse.apply(rt, arguments);
        }, exports.main = function(r) {
          r[1] || (console.log("Usage: " + r[0] + " FILE"), process.exit(1));
          var t = R2("fs").readFileSync(R2("path").normalize(r[1]), "utf8");
          return exports.parser.parse(t);
        }, typeof module < "u" && R2.main === module && exports.main(process.argv.slice(1))), c.prettyflag = false, c.pretty = function(e, r) {
          var t = c.prettyflag;
          c.prettyflag = !r;
          var n = c.parse(e).toString();
          return c.prettyflag = t, n;
        };
        var j1 = c.utils = {};
        function Cs(e) {
          return "(y=" + e + ",y===y?y:undefined)";
        }
        var An = Cs;
        function Rs(e, r) {
          return "(y=" + e + ',typeof y=="undefined"?undefined:' + r + ")";
        }
        var Q2 = Rs;
        function u3() {
          return true;
        }
        function ia() {
        }
        var _e2 = j1.escapeq = function(e) {
          return ("" + e).replace(/["'\\\n\r\u2028\u2029]/g, function(r) {
            switch (r) {
              case '"':
              case "'":
              case "\\":
                return "\\" + r;
              case `
`:
                return "\\n";
              case "\r":
                return "\\r";
              case "\u2028":
                return "\\u2028";
              case "\u2029":
                return "\\u2029";
            }
          });
        }, ks = j1.undoubleq = function(e) {
          return e.replace(/(\')/g, "''");
        }, Is = j1.doubleq = function(e) {
          return e.replace(/(\'\')/g, "\\'");
        }, sa = j1.doubleqq = function(e) {
          return e.replace(/'/g, "\\'");
        }, Nn = function(e) {
          return e[0] === "\uFEFF" && (e = e.substr(1)), e;
        };
        j1.global = (function() {
          return typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : Function("return this")();
        })();
        var aa = j1.isNativeFunction = function(e) {
          return typeof e == "function" && !!~e.toString().indexOf("[native code]");
        };
        j1.isWebWorker = (function() {
          try {
            var e = j1.global.importScripts;
            return j1.isNativeFunction(e);
          } catch {
            return false;
          }
        })(), j1.isNode = (function() {
          try {
            return !(typeof process > "u" || !process.versions || !process.versions.node);
          } catch {
            return false;
          }
        })(), j1.isBrowser = (function() {
          try {
            return j1.isNativeFunction(j1.global.location.reload);
          } catch {
            return false;
          }
        })(), j1.isBrowserify = (function() {
          return j1.isBrowser && typeof process < "u" && process.browser;
        })(), j1.isRequireJS = (function() {
          return j1.isBrowser && typeof R2 == "function" && typeof R2.specified == "function";
        })(), j1.isMeteor = (function() {
          return typeof Meteor < "u" && Meteor.release;
        })(), j1.isMeteorClient = j1.isMeteorClient = (function() {
          return j1.isMeteor && Meteor.isClient;
        })(), j1.isMeteorServer = (function() {
          return j1.isMeteor && Meteor.isServer;
        })(), j1.isCordova = /* @__PURE__ */ (function() {
          return typeof cordova == "object";
        })(), j1.isReactNative = /* @__PURE__ */ (function() {
          var e = false;
          return e;
        })(), j1.hasIndexedDB = (function() {
          return !!j1.global.indexedDB;
        })(), j1.isArray = function(e) {
          return Object.prototype.toString.call(e) === "[object Array]";
        };
        const oa = /^[a-z]+:\/\//i;
        let On = j1.loadFile = function(e, r, t, n) {
          var i, s;
          if (!(j1.isNode || j1.isMeteorServer)) {
            if (j1.isCordova) {
              j1.global.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(m) {
                m.root.getFile(e, { create: false }, function(E) {
                  E.file(function(p) {
                    var h = new FileReader();
                    h.onloadend = function(g) {
                      t(Nn(this.result));
                    }, h.readAsText(p);
                  });
                });
              });
              return;
            }
            if (typeof e == "string") {
              if (e.substr(0, 1) === "#" && typeof document < "u") {
                i = document.querySelector(e).textContent, t(i);
                return;
              }
              n4(e, (m) => t(Nn(m)), n, r);
              return;
            }
            if (e instanceof Event) {
              var o = e.target.files, a = new FileReader(), f = o[0].name;
              a.onload = function(m) {
                var E = m.target.result;
                t(Nn(E));
              }, a.readAsText(o[0]);
            }
            n4(e, (m) => t(Nn(m)), n, r);
          }
        }, t4 = typeof fetch < "u" ? fetch : null;
        async function n4(e, r, t, n) {
          return n ? r4(e, r, t) : await r4(e, r, t);
        }
        function r4(e, r, t) {
          return t4(e).then((n) => n.text()).then((n) => {
            r(n);
          }).catch((n) => {
            if (t) return t(n);
            throw console.error(n), n;
          });
        }
        function la(e, r, t) {
          return t4(e).then((n) => n.arrayBuffer()).then((n) => {
            var i = new Uint8Array(n), s = [...i].map((o) => String.fromCharCode(o)).join("");
            r(s);
          }).catch((n) => {
            if (t) return t(n);
            throw console.error(n), n;
          });
        }
        var ua = j1.loadBinaryFile = function(e, r, t, n = (i) => {
          throw i;
        }) {
          var i;
          if (!(j1.isNode || j1.isMeteorServer)) if (typeof e == "string") {
            var s = new XMLHttpRequest();
            s.open("GET", e, r), s.responseType = "arraybuffer", s.onload = function() {
              for (var m = new Uint8Array(s.response), E = [], p = 0; p < m.length; ++p) E[p] = String.fromCharCode(m[p]);
              t(E.join(""));
            }, s.onerror = n, s.send();
          } else if (e instanceof Event) {
            var o = e.target.files, a = new FileReader(), f = o[0].name;
            a.onload = function(m) {
              var E = m.target.result;
              t(E);
            }, a.onerror = n, a.readAsArrayBuffer(o[0]);
          } else e instanceof Blob && t(e);
        }, fa = j1.removeFile = function(e, r) {
          if (!j1.isNode) throw new Error("You can remove files only in Node.js and Apache Cordova");
        }, ca = j1.deleteFile = function(e, r) {
        };
        j1.autoExtFilename = function(e, r, t) {
          return t = t || {}, typeof e != "string" || e.match(/^[A-Z]+:\/\/|\n|\..{2,6}$/i) || t.autoExt === 0 || t.autoExt === false ? e : e + "." + r;
        };
        var ha = j1.fileExists = function(e, r) {
          if (!j1.isNode) throw new Error("You can use exists() only in Node.js or Apach Cordova");
        }, da = j1.saveFile = function(e, r, t, n) {
          var i = 1;
          if (e === void 0) i = r, t && (i = t(i));
          else if (!j1.isNode) {
            var s = { disableAutoBom: false };
            c.utils.extend(s, n);
            var o = new Blob([r], { type: "text/plain;charset=utf-8" });
            mt(o, e, s.disableAutoBom), t && (i = t(i));
          }
          return i;
        }, d2 = j1.hash = function(e) {
          for (var r = 2166136261, t = e.length; t; ) r ^= e.charCodeAt(--t), r += (r << 1) + (r << 4) + (r << 7) + (r << 8) + (r << 24);
          return r;
        }, ws = j1.arrayUnion = function(e, r) {
          var t = r.slice(0);
          return e.forEach(function(n) {
            t.indexOf(n) < 0 && t.push(n);
          }), t;
        }, _s2 = j1.arrayDiff = function(e, r) {
          return e.filter(function(t) {
            return r.indexOf(t) < 0;
          });
        }, xs = j1.arrayIntersect = function(e, r) {
          var t = [];
          return e.forEach(function(n) {
            var i = false;
            r.forEach(function(s) {
              i = i || n === s;
            }), i && t.push(n);
          }), t;
        }, Ds = j1.arrayUnionDeep = function(e, r) {
          var t = r.slice(0);
          return e.forEach(function(n) {
            var i = false;
            t.forEach(function(s) {
              i = i || gt(n, s);
            }), i || t.push(n);
          }), t;
        }, Ls = j1.arrayExceptDeep = function(e, r) {
          var t = [];
          return e.forEach(function(n) {
            var i = false;
            r.forEach(function(s) {
              i = i || gt(n, s);
            }), i || t.push(n);
          }), t;
        }, Vs = j1.arrayIntersectDeep = function(e, r) {
          var t = [];
          return e.forEach(function(n) {
            var i = false;
            r.forEach(function(s) {
              i = i || gt(n, s, true);
            }), i && t.push(n);
          }), t;
        }, N2 = j1.cloneDeep = function e(r) {
          if (r === null || typeof r != "object") return r;
          if (r instanceof Date) return new Date(r);
          if (r instanceof String) return r.toString();
          if (r instanceof Number) return +r;
          var t = new r.constructor();
          for (var n in r) r.hasOwnProperty(n) && (t[n] = e(r[n]));
          return t;
        }, gt = j1.deepEqual = function(e, r) {
          if (e === r) return true;
          if (typeof e == "object" && e !== null && typeof r == "object" && r !== null) {
            if (Object.keys(e).length !== Object.keys(r).length) return false;
            for (var t in e) if (!gt(e[t], r[t])) return false;
            return true;
          }
          return false;
        }, rr = j1.distinctArray = function(e) {
          for (var r = {}, t = 0, n = e.length; t < n; t++) {
            var i;
            typeof e[t] == "object" ? i = Object.keys(e[t]).sort().map(function(a) {
              return a + "`" + e[t][a];
            }).join("`") : i = e[t], r[i] = e[t];
          }
          var s = [];
          for (var o in r) s.push(r[o]);
          return s;
        }, Be = j1.extend = function(r, t) {
          r = r || {};
          for (var n in t) t.hasOwnProperty(n) && (r[n] = t[n]);
          return r;
        }, Ms = j1.getValueOf = function(e) {
          return typeof e == "object" && (e instanceof String || e instanceof Number) ? e.valueOf() : e;
        }, Us = j1.flatArray = function(e) {
          if (!e || e.length === 0) return [];
          if (typeof e == "object" && e instanceof c.Recordset) return e.data.map(function(t) {
            return Ms(t[e.columns[0].columnid]);
          });
          var r = Object.keys(e[0])[0];
          return r === void 0 ? [] : e.map(function(t) {
            return t[r];
          });
        }, pa = j1.arrayOfArrays = function(e) {
          return e.map(function(r) {
            var t = [];
            for (var n in r) t.push(r[n]);
            return t;
          });
        };
        Array.isArray || (Array.isArray = function(e) {
          return Object.prototype.toString.call(e) === "[object Array]";
        });
        var ba = j1.xlsnc = function(e) {
          var r = "";
          if (e > 701) {
            let n = ((e - 26) / 676 | 0) - 1;
            r = String.fromCharCode(65 + n % 26), e = e % 676;
          }
          var t = String.fromCharCode(65 + e % 26);
          return e >= 26 && (e = (e / 26 | 0) - 1, t = String.fromCharCode(65 + e % 26) + t, e > 26 && (e = (e / 26 | 0) - 1, t = String.fromCharCode(65 + e % 26) + t)), r + t;
        }, ga = j1.xlscn = function(e) {
          var r = e.charCodeAt(0) - 65;
          return e.length > 1 && (r = (r + 1) * 26 + e.charCodeAt(1) - 65, e.length > 2 && (r = (r + 1) * 26 + e.charCodeAt(2) - 65)), r;
        }, Ea = j1.domEmptyChildren = function(e) {
          for (var r = e.childNodes.length; r--; ) e.removeChild(e.lastChild);
        }, ir = {}, ma = j1.like = function(e, r, t = "") {
          if (!ir[e]) {
            for (var n = "^", i = 0; i < e.length; ) {
              var s = e[i], o = i < e.length - 1 ? e[i + 1] : "";
              s === t ? (n += "\\" + o, i++) : s === "[" && o === "^" ? (n += "[^", i++) : s === "[" || s === "]" ? n += s : s === "%" ? n += "[\\s\\S]*" : s === "_" ? n += "." : "/.*+?|(){}".indexOf(s) > -1 ? n += "\\" + s : n += s, i++;
            }
            n += "$", ir[e] = RegExp(n, "i");
          }
          return ("" + (r ?? "")).search(ir[e]) > -1;
        };
        j1.glob = function(e, r) {
          for (var t = 0, n = "^"; t < r.length; ) {
            var i = r[t], s = t < r.length - 1 ? r[t + 1] : "";
            i === "[" && s === "^" ? (n += "[^", t++) : i === "[" || i === "]" ? n += i : i === "*" ? n += ".*" : i === "?" ? n += "." : "/.*+?|(){}".indexOf(i) > -1 ? n += "\\" + i : n += i, t++;
          }
          return n += "$", ("" + (e || "")).toUpperCase().search(RegExp(n.toUpperCase())) > -1;
        }, j1.findAlaSQLPath = function() {
          if (j1.isWebWorker) return "";
          if (j1.isMeteorClient) return "/packages/dist/";
          if (j1.isMeteorServer) return "assets/packages/dist/";
          if (j1.isNode) return Os;
          if (j1.isBrowser) for (var e = document.getElementsByTagName("script"), r = 0; r < e.length; r++) {
            if (e[r].src.substr(-16).toLowerCase() === "alasql-worker.js") return e[r].src.substr(0, e[r].src.length - 16);
            if (e[r].src.substr(-20).toLowerCase() === "alasql-worker.min.js") return e[r].src.substr(0, e[r].src.length - 20);
            if (e[r].src.substr(-9).toLowerCase() === "alasql.js") return e[r].src.substr(0, e[r].src.length - 9);
            if (e[r].src.substr(-13).toLowerCase() === "alasql.min.js") return e[r].src.substr(0, e[r].src.length - 13);
          }
          return "";
        };
        var Wt = function() {
          var e = c.private.externalXlsxLib || j1.global.XLSX || null;
          if (e) return e;
          if (j1.isNode || j1.isBrowserify || j1.isMeteorServer, !e) throw new Error("Please include the xlsx.js library");
          return e;
        }, Xt = { str: /string|char$|text/i, int: /^int|int$/i, num: /float|double|real|^num|decimal|money/i, bool: /^bool/i, date: /^date|^time/i };
        j1.typeConverter = function(e, r) {
          if (e == null) return e;
          if (!r) return c.options.csvStringToNumber && typeof e == "string" && e.length > 0 && e == +e ? +e : e;
          if (Xt.str.test(r)) return String(e);
          if (Xt.int.test(r)) {
            var t = parseInt(e, 10);
            return isNaN(t) ? e : t;
          }
          if (Xt.num.test(r)) {
            var n = parseFloat(e);
            return isNaN(n) ? e : n;
          }
          return Xt.bool.test(r) ? typeof e == "string" ? /^(true|1|yes)$/i.test(e) : !!e : Xt.date.test(r) ? e instanceof Date ? e : new Date(e) : e;
        }, c.path = c.utils.findAlaSQLPath(), c.utils.uncomment = function(e) {
          e = ("__" + e + "__").split("");
          for (var r = false, t, n = false, i = false, s = 0, o = e.length; s < o; s++) {
            var a = e[s - 1] !== "\\" || e[s - 2] === "\\";
            r ? e[s] === t && a && (r = false) : n ? e[s] === "*" && e[s + 1] === "/" ? (e[s] = e[s + 1] = "", n = false, s++) : e[s] = "" : i ? ((e[s + 1] === `
` || e[s + 1] === "\r" || e.length - 2 === s) && (i = false), e[s] = "") : e[s] === '"' || e[s] === "'" ? (r = true, t = e[s]) : e[s] === "[" && e[s - 1] !== "@" ? (r = true, t = "]") : e[s] === "-" && e[s + 1] === "-" ? (e[s] = "", i = true) : e[s] === "/" && e[s + 1] === "*" && (e[s] = "", n = true);
          }
          return e = e.join("").slice(2, -2), e;
        }, c.parser = rt, c.parser.parseError = function(e, r) {
          throw new Error("Have you used a reserved keyword without `escaping` it?\n" + e);
        }, c.parse = function(e) {
          return rt.parse(c.utils.uncomment(e));
        }, c.engines = {}, c.databases = {}, c.databasenum = 0, c.options = { errorlog: false, valueof: true, dropifnotexists: false, datetimeformat: "sql", casesensitive: true, logtarget: "output", logprompt: true, progress: false, modifier: void 0, columnlookup: 10, autovertex: true, usedbo: true, autocommit: true, cache: true, tsql: true, mysql: true, postgres: true, oracle: true, sqlite: true, orientdb: true, nocount: false, nan: false, excel: { cellDates: true }, joinstar: "overwrite", loopbreak: 1e5, maxCteIterations: 1e3, dateAsString: true, csvStringToNumber: true }, c.vars = {}, c.declares = {}, c.prompthistory = [], c.plugins = {}, c.from = {}, c.into = {}, c.fn = {}, c.aggr = {}, c.busy = 0, c.MAXSQLCACHESIZE = 1e4, c.DEFAULTDATABASEID = "alasql", c.lastid = 0, c.buffer = {}, c.private = { externalXlsxLib: null }, c.setXLSX = function(e) {
          c.private.externalXlsxLib = e;
        }, c.use = function(e) {
          if (e || (e = c.DEFAULTDATABASEID), c.useid !== e) if (c.databases[e] !== void 0) {
            c.useid = e;
            let r = c.databases[c.useid];
            c.tables = r.tables, r.resetSqlCache(), c.options.usedbo && (c.databases.dbo = r);
          } else throw Error("Database does not exist: " + e);
        }, c.autoval = function(e, r, t, n) {
          var i = n ? c.databases[n] : c.databases[c.useid];
          if (!i.tables[e]) throw new Error("Tablename not found: " + e);
          if (!i.tables[e].identities[r]) throw new Error("Colname not found: " + r);
          return t ? i.tables[e].identities[r].value || null : i.tables[e].identities[r].value - i.tables[e].identities[r].step || null;
        }, c.exec = function(e, r, t, n) {
          if (typeof r == "function" && (n = t, t = r, r = {}), delete c.error, r = r || {}, c.options.errorlog) try {
            return c.dexec(c.useid, e, r, t, n);
          } catch (i) {
            c.error = i, t && t(null, c.error);
          }
          else return c.dexec(c.useid, e, r, t, n);
        };
        function i4(e) {
          e && c.options.cache && e && e.query && e.query.data && (e.query.data = []);
        }
        c.dexec = function(e, r, t, n, i) {
          var s = c.databases[e], o = d2(r + "|joinstar:" + c.options.joinstar);
          if (c.options.cache) {
            let E = s.sqlCache[o];
            if (E && s.dbversion === E.dbversion) {
              var a = E(t, n);
              return i4(E), a;
            }
          }
          let f = s.astCache[o];
          if (c.options.cache && !f ? (f = c.parse(r), f && (s.astCache[o] = f)) : f = c.parse(r), !!f.statements) {
            if (f.statements.length === 0) return 0;
            if (f.statements.length === 1) {
              if (f.statements[0].compile) {
                var m = f.statements[0].compile(e, t);
                if (!m) return;
                m.sql = r, m.dbversion = s.dbversion, c.options.cache && (s.sqlCacheSize > c.MAXSQLCACHESIZE && s.resetSqlCache(), s.sqlCacheSize++, s.sqlCache[o] = m);
                var a = c.res = m(t, n, i);
                return i4(m), a;
              }
              c.precompile(f.statements[0], c.useid, t);
              var a = c.res = f.statements[0].execute(e, t, n, i);
              return a;
            }
            if (n) {
              c.adrun(e, f, t, n, i);
              return;
            }
            return c.drun(e, f, t, n, i);
          }
        }, c.drun = function(e, r, t, n, i) {
          var s = c.useid;
          s !== e && c.use(e);
          for (var o = [], a = 0, f = r.statements.length; a < f; a++) if (r.statements[a]) if (r.statements[a].compile) {
            var m = r.statements[a].compile(c.useid);
            o.push(c.res = m(t, null, i));
          } else c.precompile(r.statements[a], c.useid, t), o.push(c.res = r.statements[a].execute(c.useid, t));
          return s !== e && c.use(s), n && n(o), c.res = o, o;
        }, c.adrun = function(e, r, t, n, i) {
          var s = 0, o = r.statements.length;
          c.options.progress !== false && c.options.progress(o, s++);
          var a = c.useid;
          a !== e && c.use(e);
          var f = [];
          function m(E) {
            E !== void 0 && f.push(E);
            var p = r.statements.shift();
            if (!p) {
              a !== e && c.use(a), n(f);
              return;
            }
            if (p.compile) {
              var h = p.compile(c.useid);
              h(t, m, i), c.options.progress !== false && c.options.progress(o, s++);
              return;
            }
            c.precompile(r.statements[0], c.useid, t), p.execute(c.useid, t, m), c.options.progress !== false && c.options.progress(o, s++);
          }
          m();
        }, c.compile = function(e, r) {
          r = r || c.useid;
          let t = c.parse(e);
          if (t.statements.length !== 1) throw new Error("Cannot compile, because number of statements in SQL is not equal to 1");
          var n = t.statements[0].compile(r);
          return n.promise = function(i) {
            return new Promise(function(s, o) {
              n(i, function(a, f) {
                f ? o(f) : s(a);
              });
            });
          }, n;
        }, j1.global.Promise || (j1.global.Promise = Promise);
        var s4 = function(e, r, t, n) {
          return new j1.global.Promise(function(i, s) {
            c(e, r, function(o, a) {
              a ? s(a) : (t && n && c.options.progress !== false && c.options.progress(t, n), i(o));
            });
          });
        };
        const Fs = (e, r) => {
          var t = r.resolve([]);
          return e.forEach((n) => {
            t = t.then((i) => s4(n.sql, n.params, n.i, n.length).then((s) => [...i, s]));
          }), t;
        };
        var Ps = function(e) {
          if (!(e.length < 1)) {
            for (var r, t, n, i = [], s = 0; s < e.length; s++) {
              if (r = e[s], typeof r == "string" && (r = [r]), !j1.isArray(r) || r.length < 1 || 2 < r.length) throw new Error("Error in .promise parameter");
              t = r[0], n = r[1] || void 0, i.push({ sql: t, params: n, i: s, length: e.length });
            }
            return Fs(i, j1.global.Promise);
          }
        };
        c.promise = function(e, r) {
          if (typeof Promise > "u") throw new Error("Please include a Promise/A+ library");
          if (typeof e == "string") return s4(e, r);
          if (!j1.isArray(e) || e.length < 1 || typeof r < "u") throw new Error("Error in .promise parameters");
          return Ps(e);
        };
        var Kt = c.Database = function(e) {
          var r = this;
          if (r === c) if (e) {
            if (r = c.databases[e], c.databases[e] = r, !r) throw new Error(`Database ${e} not found`);
          } else r = c.databases.alasql, c.options.tsql && (c.databases.tempdb = c.databases.alasql);
          return e || (e = "db" + c.databasenum++), r.databaseid = e, c.databases[e] = r, r.dbversion = 0, r.tables = {}, r.views = {}, r.triggers = {}, r.indices = {}, r.objects = {}, r.counter = 0, r.resetSqlCache(), r;
        };
        Kt.prototype.resetSqlCache = function() {
          this.sqlCache = {}, this.sqlCacheSize = 0, this.astCache = {};
        }, Kt.prototype.exec = function(e, r, t) {
          return c.dexec(this.databaseid, e, r, t);
        }, Kt.prototype.autoval = function(e, r, t) {
          return c.autoval(e, r, t, this.databaseid);
        }, Kt.prototype.transaction = function(e) {
          var r = new c.Transaction(this.databaseid), t = e(r);
          return t;
        };
        class sr {
          transactionid = Date.now();
          committed = false;
          bank;
          constructor(r) {
            this.databaseid = r, this.dbversion = c.databases[r].dbversion, this.bank = JSON.stringify(c.databases[r]);
          }
          commit() {
            this.committed = true, c.databases[this.databaseid].dbversion = Date.now(), delete this.bank;
          }
          rollback() {
            if (!this.committed) c.databases[this.databaseid] = JSON.parse(this.bank), delete this.bank;
            else throw new Error("Transaction already commited");
          }
          exec(r, t, n) {
            return c.dexec(this.databaseid, r, t, n);
          }
        }
        sr.prototype.executeSQL = sr.prototype.exec, c.Transaction = sr;
        var Cn = c.Table = function(e) {
          this.data = [], this.columns = [], this.xcolumns = {}, this.inddefs = {}, this.indices = {}, this.uniqs = {}, this.uniqdefs = {}, this.identities = {}, this.checks = [], this.checkfns = [], this.beforeinsert = {}, this.afterinsert = {}, this.insteadofinsert = {}, this.beforedelete = {}, this.afterdelete = {}, this.insteadofdelete = {}, this.beforeupdate = {}, this.afterupdate = {}, this.insteadofupdate = {}, Object.assign(this, e);
        };
        Cn.prototype.indexColumns = function() {
          var e = this;
          e.xcolumns = {}, e.columns.forEach(function(r) {
            e.xcolumns[r.columnid] = r;
          });
        };
        class Gs {
          constructor(r) {
            this.columns = [], this.xcolumns = {}, this.query = [], Object.assign(this, r);
          }
        }
        c.View = Gs;
        class a4 {
          constructor(r) {
            this.alasql = c, this.columns = [], this.xcolumns = {}, this.selectGroup = [], this.groupColumns = {}, Object.assign(this, r);
          }
        }
        class ys {
          constructor(r) {
            Object.assign(this, r);
          }
        }
        c.Recordset = ys, c.Query = a4;
        class Bs {
          constructor(r) {
            Object.assign(this, r);
          }
          toString() {
          }
          toType() {
          }
          toJS() {
          }
          exec() {
          }
          compile() {
          }
        }
        var S = { extend: Object.assign, casesensitive: c.options.casesensitive, Base: Bs, compileParamValue: function(e, r, t, n, i, s) {
          return function(o, a) {
            var f = o[e];
            if (!Array.isArray(f)) {
              var m = new Error(r + " requires an array for parameter " + e);
              if (a) return a(null, m);
              throw m;
            }
            var E = "__p" + e + "_" + Date.now(), p = c.databases[n || "alasql"];
            p.tables[E] = new c.Table({ tableid: E }), p.tables[E].data = f;
            try {
              var h = i[s];
              i[s] = new S.Table({ tableid: E, databaseid: p.databaseid });
              var g = i.compile(n);
              i[s] = h;
              var O = g(o, a);
              if (t) {
                var T = p.tables[E].data;
                f.length = 0, Array.prototype.push.apply(f, T);
              }
              return O;
            } catch (v) {
              if (a) return a(null, v);
              throw v;
            } finally {
              delete p.tables[E];
            }
          };
        } };
        rt.yy = c.yy = S, S.Statements = class {
          constructor(r) {
            Object.assign(this, r);
          }
          toString() {
            return this.statements.map((r) => r.toString()).join("; ");
          }
          compile(r) {
            const t = this.statements.map((n) => n.compile(r));
            return t.length === 1 ? t[0] : (n, i) => {
              const s = t.map((o) => o(n));
              return i && i(s), s;
            };
          }
        }, S.Search = class {
          constructor(r) {
            Object.assign(this, r);
          }
          toString() {
            let r = "SEARCH ";
            return this.selectors && (r += this.selectors.toString()), this.from && (r += "FROM " + this.from.toString()), r;
          }
          toJS(r) {
            return `this.queriesfn[${this.queriesidx - 1}](this.params,null,${r})`;
          }
          compile(r) {
            var t = r, n = (i, s) => {
              var o;
              return this.#e(t, i, function(a) {
                o = f4(n.query, a), s && (o = s(o));
              }), o;
            };
            return n.query = {}, n;
          }
          #e(r, t, n) {
            var i, s = {}, o, a = N2(this.selectors);
            function f(O, T, v) {
              var N, b, L, C = O[T], a1 = c.options.loopbreak || 1e5;
              if (C.selid) {
                if (C.selid === "PATH") {
                  for (var r1 = [{ node: v, stack: [] }], H = {}, C1 = c.databases[c.useid].objects; r1.length > 0; ) {
                    var k1 = r1.shift(), V1 = k1.node, J1 = k1.stack, L = f(C.args, 0, V1);
                    if (L.length > 0) {
                      if (T + 1 + 1 > O.length) return J1;
                      var R = [];
                      return J1 && J1.length > 0 && J1.forEach(function(Oe) {
                        R = R.concat(f(O, T + 1, Oe));
                      }), R;
                    } else {
                      if (typeof H[V1.$id] < "u") continue;
                      H[V1.$id] = true, V1.$out && V1.$out.length > 0 && V1.$out.forEach(function(Oe) {
                        var Pe = C1[Oe], He = J1.concat(Pe);
                        He.push(C1[Pe.$out[0]]), r1.push({ node: C1[Pe.$out[0]], stack: He });
                      });
                    }
                  }
                  return [];
                }
                if (C.selid === "NOT") {
                  var b = f(C.args, 0, v);
                  return b.length > 0 ? [] : T + 1 + 1 > O.length ? [v] : f(O, T + 1, v);
                } else if (C.selid === "DISTINCT") {
                  var b;
                  if (typeof C.args > "u" || C.args.length === 0 ? b = rr(v) : b = f(C.args, 0, v), b.length === 0) return [];
                  var Me = rr(b);
                  return T + 1 + 1 > O.length ? Me : f(O, T + 1, Me);
                } else if (C.selid === "AND") {
                  var Me = true;
                  return C.args.forEach(function(Oe) {
                    Me = Me && f(Oe, 0, v).length > 0;
                  }), Me ? T + 1 + 1 > O.length ? [v] : f(O, T + 1, v) : [];
                } else if (C.selid === "OR") {
                  var Me = false;
                  return C.args.forEach(function(Oe) {
                    Me = Me || f(Oe, 0, v).length > 0;
                  }), Me ? T + 1 + 1 > O.length ? [v] : f(O, T + 1, v) : [];
                } else if (C.selid === "ALL") {
                  var b = f(C.args[0], 0, v);
                  return b.length === 0 ? [] : T + 1 + 1 > O.length ? b : f(O, T + 1, b);
                } else if (C.selid === "ANY") {
                  var b = f(C.args[0], 0, v);
                  return b.length === 0 ? [] : T + 1 + 1 > O.length ? [b[0]] : f(O, T + 1, [b[0]]);
                } else if (C.selid === "UNIONALL") {
                  var b = [];
                  return C.args.forEach(function(Oe) {
                    b = b.concat(f(Oe, 0, v));
                  }), b.length === 0 ? [] : T + 1 + 1 > O.length ? b : f(O, T + 1, b);
                } else if (C.selid === "UNION") {
                  var b = [];
                  C.args.forEach(function(Oe) {
                    b = b.concat(f(Oe, 0, v));
                  });
                  var b = rr(b);
                  return b.length === 0 ? [] : T + 1 + 1 > O.length ? b : f(O, T + 1, b);
                } else if (C.selid === "IF") {
                  var b = f(C.args, 0, v);
                  return b.length === 0 ? [] : T + 1 + 1 > O.length ? [v] : f(O, T + 1, v);
                } else if (C.selid === "REPEAT") {
                  var U1, ee, _1 = C.args[0].value;
                  C.args[1] ? ee = C.args[1].value : ee = _1, C.args[2] && (U1 = C.args[2].variable);
                  var K1 = [];
                  if (_1 === 0 && (T + 1 + 1 > O.length ? K1 = [v] : (U1 && (c.vars[U1] = 0), K1 = K1.concat(f(O, T + 1, v)))), ee > 0) for (var Se = [{ value: v, lvl: 1 }], Ie = 0; Se.length > 0; ) {
                    var b = Se[0];
                    if (Se.shift(), b.lvl <= ee) {
                      U1 && (c.vars[U1] = b.lvl);
                      var Xe = f(C.sels, 0, b.value);
                      Xe.forEach(function(Oe) {
                        Se.push({ value: Oe, lvl: b.lvl + 1 });
                      }), b.lvl >= _1 && (T + 1 + 1 > O.length ? K1 = K1.concat(Xe) : Xe.forEach(function(Oe) {
                        K1 = K1.concat(f(O, T + 1, Oe));
                      }));
                    }
                    if (Ie++, Ie > a1) throw new Error("Infinite loop brake. Number of iterations = " + Ie);
                  }
                  return K1;
                } else if (C.selid === "OF") {
                  if (T + 1 + 1 > O.length) return [v];
                  var Ve = [];
                  return Object.keys(v).forEach(function(Re) {
                    c.vars[C.args[0].variable] = Re, Ve = Ve.concat(f(O, T + 1, v[Re]));
                  }), Ve;
                } else if (C.selid === "TO") {
                  var we = c.vars[C.args[0]], Ge = [];
                  if (we !== void 0 ? Ge = we.slice(0) : Ge = [], Ge.push(v), T + 1 + 1 > O.length) return [v];
                  c.vars[C.args[0]] = Ge;
                  var Ve = f(O, T + 1, v);
                  return c.vars[C.args[0]] = we, Ve;
                } else if (C.selid === "ARRAY") {
                  var b = f(C.args, 0, v);
                  if (b.length > 0) N = b;
                  else return [];
                  return T + 1 + 1 > O.length ? [N] : f(O, T + 1, N);
                } else if (C.selid === "SUM") {
                  var b = f(C.args, 0, v);
                  if (b.length > 0) var N = b.reduce(function(Pe, He) {
                    return Pe + He;
                  }, 0);
                  else return [];
                  return T + 1 + 1 > O.length ? [N] : f(O, T + 1, N);
                } else if (C.selid === "AVG") {
                  if (b = f(C.args, 0, v), b.length > 0) N = b.reduce(function(Re, Oe) {
                    return Re + Oe;
                  }, 0) / b.length;
                  else return [];
                  return T + 1 + 1 > O.length ? [N] : f(O, T + 1, N);
                } else if (C.selid === "COUNT") {
                  if (b = f(C.args, 0, v), b.length > 0) N = b.length;
                  else return [];
                  return T + 1 + 1 > O.length ? [N] : f(O, T + 1, N);
                } else if (C.selid === "FIRST") {
                  if (b = f(C.args, 0, v), b.length > 0) N = b[0];
                  else return [];
                  return T + 1 + 1 > O.length ? [N] : f(O, T + 1, N);
                } else if (C.selid === "LAST") {
                  if (b = f(C.args, 0, v), b.length > 0) N = b[b.length - 1];
                  else return [];
                  return T + 1 + 1 > O.length ? [N] : f(O, T + 1, N);
                } else if (C.selid === "MIN") {
                  if (b = f(C.args, 0, v), b.length === 0) return [];
                  var N = b.reduce(function(Oe, Pe) {
                    return Math.min(Oe, Pe);
                  }, 1 / 0);
                  return T + 1 + 1 > O.length ? [N] : f(O, T + 1, N);
                } else if (C.selid === "MAX") {
                  var b = f(C.args, 0, v);
                  if (b.length === 0) return [];
                  var N = b.reduce(function(Pe, He) {
                    return Math.max(Pe, He);
                  }, -1 / 0);
                  return T + 1 + 1 > O.length ? [N] : f(O, T + 1, N);
                } else if (C.selid === "PLUS") {
                  var K1 = [], Se = f(C.args, 0, v).slice();
                  T + 1 + 1 > O.length ? K1 = K1.concat(Se) : Se.forEach(function(He) {
                    K1 = K1.concat(f(O, T + 1, He));
                  });
                  for (var Ie = 0; Se.length > 0; ) {
                    var b = Se.shift();
                    if (b = f(C.args, 0, b), Se = Se.concat(b), T + 1 + 1 > O.length ? K1 = K1.concat(b) : b.forEach(function(l2) {
                      var v2 = f(O, T + 1, l2);
                      K1 = K1.concat(v2);
                    }), Ie++, Ie > a1) throw new Error("Infinite loop brake. Number of iterations = " + Ie);
                  }
                  return K1;
                } else if (C.selid === "STAR") {
                  var K1 = [];
                  K1 = f(O, T + 1, v);
                  var Se = f(C.args, 0, v).slice();
                  T + 1 + 1 > O.length ? K1 = K1.concat(Se) : Se.forEach(function(He) {
                    K1 = K1.concat(f(O, T + 1, He));
                  });
                  for (var Ie = 0; Se.length > 0; ) {
                    var b = Se[0];
                    if (Se.shift(), b = f(C.args, 0, b), Se = Se.concat(b), T + 1 + 1 <= O.length && b.forEach(function(l2) {
                      K1 = K1.concat(f(O, T + 1, l2));
                    }), Ie++, Ie > a1) throw new Error("Infinite loop brake. Number of iterations = " + Ie);
                  }
                  return K1;
                } else if (C.selid === "QUESTION") {
                  var K1 = [];
                  K1 = K1.concat(f(O, T + 1, v));
                  var b = f(C.args, 0, v);
                  return T + 1 + 1 <= O.length && b.forEach(function(Pe) {
                    K1 = K1.concat(f(O, T + 1, Pe));
                  }), K1;
                } else if (C.selid === "WITH") {
                  var b = f(C.args, 0, v);
                  if (b.length === 0) return [];
                  var L = { status: 1, values: b };
                } else {
                  if (C.selid === "ROOT") return T + 1 + 1 > O.length ? [v] : f(O, T + 1, o);
                  throw new Error("Wrong selector " + C.selid);
                }
              } else if (C.srchid) var L = c.srch[C.srchid.toUpperCase()](v, C.args, s, t);
              else throw new Error("Selector not found");
              typeof L > "u" && (L = { status: 1, values: [v] });
              var Me = [];
              if (L.status === 1) {
                var Ze = L.values;
                if (T + 1 + 1 > O.length) Me = Ze;
                else for (var Ie = 0; Ie < L.values.length; Ie++) Me = Me.concat(f(O, T + 1, Ze[Ie]));
              }
              return Me;
            }
            if (a !== void 0 && a.length > 0 && (a && a[0] && a[0].srchid === "PROP" && a[0].args && a[0].args[0] && (a[0].args[0].toUpperCase() === "XML" ? (s.mode = "XML", a.shift()) : a[0].args[0].toUpperCase() === "HTML" ? (s.mode = "HTML", a.shift()) : a[0].args[0].toUpperCase() === "JSON" && (s.mode = "JSON", a.shift())), a.length > 0 && a[0].srchid === "VALUE" && (s.value = true, a.shift())), this.from instanceof S.Column) {
              var m = this.from.databaseid || r;
              o = c.databases[m].tables[this.from.columnid].data;
            } else if (this.from instanceof S.FuncValue && c.from[this.from.funcid.toUpperCase()]) {
              var E = this.from.args.map(function(O) {
                var T = O.toJS(), v = new Function("params,alasql", "var y;return " + T).bind(this);
                return v(t, c);
              });
              o = c.from[this.from.funcid.toUpperCase()].apply(this, E);
            } else if (typeof this.from > "u") o = c.databases[r].objects;
            else {
              var p = new Function("params,alasql", "var y;return " + this.from.toJS());
              o = p(t, c), typeof Mongo == "object" && typeof Mongo.Collection != "object" && o instanceof Mongo.Collection && (o = o.find().fetch());
            }
            if (a !== void 0 && a.length > 0 ? i = f(a, 0, o) : i = o, this.into) if (this.into instanceof S.ParamValue) typeof this.into.param == "string" ? t[this.into.param] = i : t[this.into.param] = i, n && (i = n(i));
            else if (this.into instanceof S.VarValue) c.vars[this.into.variable] = i, n && (i = n(i));
            else {
              var h, g;
              typeof this.into.args[0] < "u" && (h = new Function("params,alasql", "var y;return " + this.into.args[0].toJS())(t, c)), typeof this.into.args[1] < "u" && (g = new Function("params,alasql", "var y;return " + this.into.args[1].toJS())(t, c)), i = c.into[this.into.funcid.toUpperCase()](h, g, i, [], n);
            }
            else s.value && i.length > 0 && (i = i[0]), n && (i = n(i));
            return i;
          }
        }, c.srch = { PROP(e, r, t) {
          if (t.mode === "XML") {
            const n = e.children.filter((i) => i.name.toUpperCase() === r[0].toUpperCase());
            return { status: n.length ? 1 : -1, values: n };
          } else return typeof e != "object" || e === null || typeof r != "object" || typeof e[r[0]] > "u" ? { status: -1, values: [] } : { status: 1, values: [e[r[0]]] };
        }, APROP(e, r) {
          return typeof e != "object" || e === null || typeof r != "object" || typeof e[r[0]] > "u" ? { status: 1, values: [void 0] } : { status: 1, values: [e[r[0]]] };
        }, EQ(e, r, t, n) {
          var i = r[0].toJS("x", ""), s = new Function("x,alasql,params", "return " + i);
          return e === s(e, c, n) ? { status: 1, values: [e] } : { status: -1, values: [] };
        }, LIKE(e, r, t, n) {
          var i = r[0].toJS("x", ""), s = new Function("x,alasql,params", "return " + i);
          return e.toUpperCase().match(new RegExp("^" + s(e, c, n).toUpperCase().replace(/%/g, ".*").replace(/\?|_/g, ".") + "$"), "g") ? { status: 1, values: [e] } : { status: -1, values: [] };
        }, ATTR(e, r, t) {
          if (t.mode === "XML") return typeof r > "u" ? { status: 1, values: [e.attributes] } : typeof e == "object" && typeof e.attributes == "object" && typeof e.attributes[r[0]] < "u" ? { status: 1, values: [e.attributes[r[0]]] } : { status: -1, values: [] };
          throw new Error("ATTR is not using in usual mode");
        }, CONTENT(e, r, t) {
          if (t.mode !== "XML") throw new Error("ATTR is not using in usual mode");
          return { status: 1, values: [e.content] };
        }, SHARP(e, r) {
          const t = c.databases[c.useid].objects[r[0]];
          return e !== void 0 && e === t ? { status: 1, values: [e] } : { status: -1, values: [] };
        }, PARENT() {
          return console.error("PARENT not implemented", arguments), { status: -1, values: [] };
        }, CHILD(e, r, t) {
          return typeof e == "object" ? Array.isArray(e) ? { status: 1, values: e } : t.mode === "XML" ? { status: 1, values: Object.keys(e.children).map(function(n) {
            return e.children[n];
          }) } : { status: 1, values: Object.keys(e).map(function(n) {
            return e[n];
          }) } : { status: 1, values: [] };
        }, KEYS(e) {
          return typeof e == "object" && e !== null ? { status: 1, values: Object.keys(e) } : { status: 1, values: [] };
        }, WHERE(e, r, t, n) {
          var i = r[0].toJS("x", ""), s = new Function("x,alasql,params", "return " + i);
          return s(e, c, n) ? { status: 1, values: [e] } : { status: -1, values: [] };
        }, NAME(e, r) {
          return e.name === r[0] ? { status: 1, values: [e] } : { status: -1, values: [] };
        }, CLASS(e, r) {
          return e.$class == r ? { status: 1, values: [e] } : { status: -1, values: [] };
        }, VERTEX(e) {
          return e.$node === "VERTEX" ? { status: 1, values: [e] } : { status: -1, values: [] };
        }, INSTANCEOF(e, r) {
          return e instanceof c.fn[r[0]] ? { status: 1, values: [e] } : { status: -1, values: [] };
        }, EDGE(e) {
          return e.$node === "EDGE" ? { status: 1, values: [e] } : { status: -1, values: [] };
        }, EX(e, r, t, n) {
          var i = r[0].toJS("x", ""), s = new Function("x,alasql,params", "return " + i);
          return { status: 1, values: [s(e, c, n)] };
        }, RETURN(e, r, t, n) {
          var i = {};
          return r && r.length > 0 && r.forEach(function(s) {
            var o = s.toJS("x", ""), a = new Function("x,alasql,params", "return " + o);
            typeof s.as > "u" && (s.as = s.toString()), i[s.as] = a(e, c, n);
          }), { status: 1, values: [i] };
        }, REF(e) {
          return { status: 1, values: [c.databases[c.useid].objects[e]] };
        }, OUT(e) {
          if (e.$out && e.$out.length > 0) {
            var r = e.$out.map(function(t) {
              return c.databases[c.useid].objects[t];
            });
            return { status: 1, values: r };
          } else return { status: -1, values: [] };
        }, OUTOUT(e) {
          if (e.$out && e.$out.length > 0) {
            var r = [];
            return e.$out.forEach(function(t) {
              var n = c.databases[c.useid].objects[t];
              n && n.$out && n.$out.length > 0 && n.$out.forEach(function(i) {
                r = r.concat(c.databases[c.useid].objects[i]);
              });
            }), { status: 1, values: r };
          } else return { status: -1, values: [] };
        }, IN(e) {
          if (e.$in && e.$in.length > 0) {
            var r = e.$in.map(function(t) {
              return c.databases[c.useid].objects[t];
            });
            return { status: 1, values: r };
          } else return { status: -1, values: [] };
        }, ININ(e) {
          if (e.$in && e.$in.length > 0) {
            var r = [];
            return e.$in.forEach(function(t) {
              var n = c.databases[c.useid].objects[t];
              n && n.$in && n.$in.length > 0 && n.$in.forEach(function(i) {
                r = r.concat(c.databases[c.useid].objects[i]);
              });
            }), { status: 1, values: r };
          } else return { status: -1, values: [] };
        }, AS(e, r) {
          return c.vars[r[0]] = e, { status: 1, values: [e] };
        }, AT(e, r) {
          var t = c.vars[r[0]];
          return { status: 1, values: [t] };
        }, CLONEDEEP(e) {
          var r = N2(e);
          return { status: 1, values: [r] };
        }, SET(e, r, t, n) {
          var i = r.map(function(o) {
            return o.method === "@" ? `alasql.vars[${JSON.stringify(o.variable)}]=` + o.expression.toJS("x", "") : o.method === "$" ? `params[${JSON.stringify(o.variable)}]=` + o.expression.toJS("x", "") : `x[${JSON.stringify(o.column.columnid)}]=` + o.expression.toJS("x", "");
          }).join(";"), s = new Function("x,params,alasql", i);
          return s(e, n, c), { status: 1, values: [e] };
        }, ROW(e, r, t, n) {
          var i = "var y;return [";
          i += r.map((a) => a.toJS("x", "")).join(","), i += "]";
          var s = new Function("x,params,alasql", i), o = s(e, n, c);
          return { status: 1, values: [o] };
        }, D3(e) {
          return e.$node !== "VERTEX" && e.$node === "EDGE" && (e.source = e.$in[0], e.target = e.$out[0]), { status: 1, values: [e] };
        }, ORDERBY(e, r) {
          var t = e.sort(Js(r));
          return { status: 1, values: t };
        } };
        var Js = function(e) {
          if (e) {
            if (typeof e?.[0]?.expression == "function") {
              var r = e[0].expression;
              return function(i, s) {
                var o = r(i), a = r(s);
                return o > a ? 1 : o === a ? 0 : -1;
              };
            }
            var t = "", n = "";
            return e.forEach(function(i) {
              var s = "";
              if (i.expression instanceof S.NumValue && (i.expression = self.columns[i.expression.value - 1]), i.expression instanceof S.Column) {
                var o = i.expression.columnid;
                c.options.valueof && (s = ".valueOf()"), i.nocase && (s += ".toUpperCase()"), o === "_" ? (t += "if(a" + s + (i.direction === "ASC" ? ">" : "<") + "b" + s + ")return 1;", t += "if(a" + s + "==b" + s + "){") : t += `if (
							(a[${JSON.stringify(o)}]||'')${s}
							${i.direction === "ASC" ? ">" : "<"}
							(b[${JSON.stringify(o)}]||'')${s}
						) return 1;

						if(
							(a[${JSON.stringify(o)}]||'')${s}
							==
							(b[${JSON.stringify(o)}]||'')${s}
						){
						`;
              } else s = ".valueOf()", i.nocase && (s += ".toUpperCase()"), t += `
					if (
						(${i.toJS("a", "")} || '')${s}
						${i.direction === "ASC" ? ">" : "<"}
						(${i.toJS("b", "")} || '')${s}
					) return 1;

					if (
						(${i.toJS("a", "")} || '')${s} ==
						(${i.toJS("b", "")} || '')${s}
					) {`;
              n += "}";
            }), t += "return 0;", t += n + "return -1", new Function("a,b", t);
          }
        };
        function js(e, r, t, n, i) {
          e.sourceslen = e.sources.length;
          let s = e.sourceslen;
          e.query = e, e.A = n, e.B = i, e.cb = t, e.oldscope = r, e.subqueryCache = {}, e.queriesfn && (e.sourceslen += e.queriesfn.length, s += e.queriesfn.length, e.queriesdata = [], e.queriesfn.forEach(function(a, f) {
            a.query.params = e.params, o4([], -f - 1, e);
          })), e.scope = r ? N2(r) : {};
          let o;
          if (e.sources.forEach(function(a, f) {
            a.query = e;
            var m = a.datafn(e, e.params, o4, f, c);
            typeof m < "u" && ((e.intofn || e.intoallfn) && Array.isArray(m) && !e.preserveArrayResult && (m = m.length), o = m), a.queriesdata = e.queriesdata;
          }), e.sources.length == 0 || s === 0) try {
            o = l4(e);
          } catch (a) {
            if (t) return t(null, a);
            throw a;
          }
          return o;
        }
        function o4(e, r, t) {
          if (r >= 0) {
            let n = t.sources[r];
            n.data = e, typeof n.data == "function" && (n.getfn = n.data, n.dontcache = n.getfn.dontcache, ["OUTER", "RIGHT", "ANTI"].includes(n.joinmode) && (n.dontcache = false), n.data = {});
          } else t.queriesdata[-r - 1] = Us(e);
          if (t.sourceslen--, !(t.sourceslen > 0)) return l4(t);
        }
        function l4(e) {
          var r = e.scope, t;
          Ys(e), e.data = [], e.xgroups = {}, e.groups = [];
          var n = 0;
          if (Et(e, r, n), e.groupfn) {
            if (e.data = [], e.groups.length === 0 && e.allgroups.length === 0) {
              var i = {};
              e.selectGroup.length > 0 && e.selectGroup.forEach(function(k1) {
                k1.aggregatorid == "COUNT" || k1.aggregatorid == "SUM" || k1.aggregatorid == "TOTAL" ? i[k1.nick] = 0 : i[k1.nick] = void 0;
              }), e.groups = [i];
            }
            if (e.aggrKeys.length > 0) {
              var s = "";
              e.aggrKeys.forEach(function(k1) {
                var V1 = "";
                k1.args && k1.args.length > 1 ? V1 = Array(k1.args.length).fill("undefined").join(",") + "," : V1 = "undefined,", s += `
				g[${JSON.stringify(k1.nick)}] = alasql.aggr[${JSON.stringify(k1.funcid)}](${V1}g[${JSON.stringify(k1.nick)}],3); `;
              });
              var o = new Function("g,params,alasql", "var y;" + s);
            }
            for (var a = 0, f = e.groups.length; a < f; a++) {
              var i = e.groups[a];
              if (o && o(i, e.params, c), !e.havingfn || e.havingfn(i, e.params, c)) {
                var m = e.selectgfn(i, e.params, c);
                for (const V1 in e.groupColumns) if (e.groupColumns[V1] !== V1 && m[e.groupColumns[V1]] && !e.groupColumns[e.groupColumns[V1]]) {
                  var E = e.groupColumns[V1], p = false;
                  for (const J1 in e.groupColumns) if (J1 !== V1 && e.groupColumns[J1] === E && m[J1]) {
                    p = true;
                    break;
                  }
                  p || delete m[e.groupColumns[V1]];
                }
                e.data.push(m);
              }
            }
          }
          Hs(e);
          var h = ["unionallfn", "unionfn", "exceptfn", "intersectfn"].some(function(k1) {
            var V1 = e[k1];
            return V1 && V1.query && (V1.query.orderfn || V1.query.limit);
          });
          if (h && (e.orderfn || e.limit)) {
            if (e.orderfn) {
              if (e.orderColumns) for (var a = 0, f = e.data.length; a < f; a++) for (var g = 0; g < e.orderColumns.length; g++) {
                var O = e.orderColumns[g], T = "$$$" + g, v = e.data[a];
                O instanceof S.Column && v[O.columnid] !== void 0 ? v[T] = v[O.columnid] : (O instanceof S.Column, v[T] = void 0), a === 0 && e.removeKeys.indexOf(T) === -1 && e.removeKeys.push(T);
              }
              e.data = e.data.sort(e.orderfn), e.orderfn = null;
            }
            e.limit && (u4(e), e.limit = null, e.offset = null);
          }
          if (e.unionallfn) {
            var N, b;
            if (e.corresponding) e.unionallfn.query && !e.unionallfn.query.modifier && (e.unionallfn.query.modifier = void 0), N = e.unionallfn(e.params);
            else {
              e.unionallfn.query && !e.unionallfn.query.modifier && (e.unionallfn.query.modifier = "RECORDSET"), b = e.unionallfn(e.params), N = [], f = b.data.length;
              for (var a = 0; a < f; a++) {
                var v = {};
                if (e.columns.length) {
                  t = Math.min(e.columns.length, b.columns.length);
                  for (var L = 0; L < t; L++) v[e.columns[L].columnid] = b.data[a][b.columns[L].columnid];
                } else {
                  t = b.columns.length;
                  for (var L = 0; L < t; L++) v[b.columns[L].columnid] = b.data[a][b.columns[L].columnid];
                }
                N.push(v);
              }
            }
            e.data = e.data.concat(N);
          } else if (e.unionfn) {
            if (e.corresponding) e.unionfn.query && !e.unionfn.query.modifier && (e.unionfn.query.modifier = "ARRAY"), N = e.unionfn(e.params);
            else {
              e.unionfn.query && !e.unionfn.query.modifier && (e.unionfn.query.modifier = "RECORDSET"), b = e.unionfn(e.params), N = [], f = b.data.length;
              for (var a = 0; a < f; a++) {
                if (v = {}, e.columns.length) {
                  t = Math.min(e.columns.length, b.columns.length);
                  for (var L = 0; L < t; L++) v[e.columns[L].columnid] = b.data[a][b.columns[L].columnid];
                } else {
                  t = b.columns.length;
                  for (var L = 0; L < t; L++) v[b.columns[L].columnid] = b.data[a][b.columns[L].columnid];
                }
                N.push(v);
              }
            }
            e.data = Ds(e.data, N);
          } else if (e.exceptfn) {
            if (e.corresponding) {
              e.exceptfn.query && !e.exceptfn.query.modifier && (e.exceptfn.query.modifier = "ARRAY");
              var N = e.exceptfn(e.params);
            } else {
              e.exceptfn.query && !e.exceptfn.query.modifier && (e.exceptfn.query.modifier = "RECORDSET");
              for (var b = e.exceptfn(e.params), N = [], a = 0, f = b.data.length; a < f; a++) {
                for (var v = {}, L = Math.min(e.columns.length, b.columns.length) - 1; 0 <= L; L--) v[e.columns[L].columnid] = b.data[a][b.columns[L].columnid];
                N.push(v);
              }
            }
            e.data = Ls(e.data, N);
          } else if (e.intersectfn) {
            if (e.corresponding) e.intersectfn.query && !e.intersectfn.query.modifier && (e.intersectfn.query.modifier = void 0), N = e.intersectfn(e.params);
            else for (e.intersectfn.query && !e.intersectfn.query.modifier && (e.intersectfn.query.modifier = "RECORDSET"), b = e.intersectfn(e.params), N = [], f = b.data.length, a = 0; a < f; a++) {
              for (v = {}, t = Math.min(e.columns.length, b.columns.length), L = 0; L < t; L++) v[e.columns[L].columnid] = b.data[a][b.columns[L].columnid];
              N.push(v);
            }
            e.data = Vs(e.data, N);
          }
          if (e.orderfn && e.orderColumns && (e.unionallfn || e.unionfn || e.exceptfn || e.intersectfn)) for (a = 0, f = e.data.length; a < f; a++) for (var g = 0; g < e.orderColumns.length; g++) {
            var O = e.orderColumns[g], T = "$$$" + g, v = e.data[a];
            O instanceof S.Column && v[O.columnid] !== void 0 ? v[T] = v[O.columnid] : (O instanceof S.Column, v[T] = void 0), a === 0 && e.removeKeys.indexOf(T) === -1 && e.removeKeys.push(T);
          }
          if (e.orderfn) {
            if (e.explain) var C = Date.now();
            e.data = e.data.sort(e.orderfn), e.explain && e.explaination.push({ explid: e.explid++, description: "QUERY BY", ms: Date.now() - C });
          }
          if (u4(e), typeof angular < "u" && e.removeKeys.push("$$hashKey"), e.removeKeys.length > 0) {
            var a1 = e.removeKeys;
            if (t = a1.length, t > 0) for (f = e.data.length, a = 0; a < f; a++) for (L = 0; L < t; L++) delete e.data[a][a1[L]];
            e.columns.length > 0 && (e.columns = e.columns.filter(function(k1) {
              var V1 = false;
              return a1.forEach(function(J1) {
                k1.columnid == J1 && (V1 = true);
              }), !V1;
            }));
          }
          if (typeof e.removeLikeKeys < "u" && e.removeLikeKeys.length > 0) {
            for (var r1 = e.removeLikeKeys, a = 0, f = e.data.length; a < f; a++) {
              v = e.data[a];
              for (var H in v) for (L = 0; L < e.removeLikeKeys.length; L++) c.utils.like(e.removeLikeKeys[L], H) && delete v[H];
            }
            e.columns.length > 0 && (e.columns = e.columns.filter(function(k1) {
              var V1 = false;
              return r1.forEach(function(J1) {
                c.utils.like(J1, k1.columnid) && (V1 = true);
              }), !V1;
            }));
          }
          if (e.pivotfn && e.pivotfn(), e.unpivotfn && e.unpivotfn(), e.intoallfn) {
            var C1 = e.intoallfn(e.columns, e.cb, e.params, e.alasql);
            return C1;
          }
          if (e.intofn) {
            for (f = e.data.length, a = 0; a < f; a++) e.intofn(e.data[a], a, e.params, e.alasql);
            return e.cb && e.cb(e.data.length, e.A, e.B), e.data.length;
          }
          return C1 = e.data, e.cb && (C1 = e.cb(e.data, e.A, e.B)), C1;
        }
        function u4(e) {
          if (e.limit) {
            var r = 0;
            e.offset && (r = e.offset | 0 || 0, r = r < 0 ? 0 : r);
            var t;
            e.percent ? t = (e.data.length * e.limit / 100 | 0) + r : t = (e.limit | 0) + r, e.data = e.data.slice(r, t);
          }
        }
        function Hs(e) {
          if (e.distinct) {
            for (var r = {}, t = Object.keys(e.data[0] || []), n = 0, i = e.data.length; n < i; n++) {
              var s = t.map(function(a) {
                var f = e.data[n][a];
                return typeof f == "object" ? JSON.stringify(f) : f;
              }).join("`");
              r[s] = e.data[n];
            }
            e.data = [];
            for (var o in r) e.data.push(r[o]);
          }
        }
        var Ys = function(e) {
          for (var r = 0, t = e.sources.length; r < t; r++) {
            var n = e.sources[r];
            delete n.ix;
            var i, s, o, a, f, m, E, p;
            if (r > 0 && n.optimization == "ix" && n.onleftfn && n.onrightfn) {
              if (n.databaseid && c.databases[n.databaseid].tables[n.tableid] && (c.databases[n.databaseid].tables[n.tableid].indices || (e.database.tables[n.tableid].indices = {}), f = c.databases[n.databaseid].tables[n.tableid].indices[d2(n.onrightfns + "`" + n.srcwherefns)], !c.databases[n.databaseid].tables[n.tableid].dirty && f && (n.ix = f)), !n.ix) {
                for (n.ix = {}, i = {}, s = 0, o = n.data.length; (a = n.data[s]) || n.getfn && (a = n.getfn(s)) || s < o; ) {
                  if (n.getfn && !n.dontcache && (n.data[s] = a), i[n.alias || n.tableid] = a, n.srcwherefn(i, e.params, c)) {
                    var m = n.onrightfn(i, e.params, c), E = n.ix[m];
                    E || (E = n.ix[m] = []), E.push(a);
                  }
                  s++;
                }
                n.databaseid && c.databases[n.databaseid].tables[n.tableid] && (c.databases[n.databaseid].tables[n.tableid].indices[d2(n.onrightfns + "`" + n.srcwherefns)] = n.ix);
              }
            } else if (n.wxleftfn) {
              if (c.databases[n.databaseid].engineid || (f = c.databases[n.databaseid].tables[n.tableid].indices[d2(n.wxleftfns + "`")]), !c.databases[n.databaseid].tables[n.tableid].dirty && f) n.ix = f, n.data = n.ix[n.wxrightfn(null, e.params, c)];
              else {
                for (n.ix = {}, i = {}, s = 0, o = n.data.length; (a = n.data[s]) || n.getfn && (a = n.getfn(s)) || s < o; ) n.getfn && !n.dontcache && (n.data[s] = a), i[n.alias || n.tableid] = n.data[s], m = n.wxleftfn(i, e.params, c), E = n.ix[m], E || (E = n.ix[m] = []), E.push(n.data[s]), s++;
                c.databases[n.databaseid].engineid || (c.databases[n.databaseid].tables[n.tableid].indices[d2(n.wxleftfns + "`")] = n.ix);
              }
              n.srcwherefns && (n.data ? (i = {}, n.data = n.data.filter(function(h) {
                return i[n.alias] = h, n.srcwherefn(i, e.params, c);
              })) : n.data = []);
            } else if (n.srcwherefns && !n.dontcache) if (n.data) {
              for (i = {}, n.data = n.data.filter(function(h) {
                return i[n.alias] = h, n.srcwherefn(i, e.params, c);
              }), i = {}, s = 0, o = n.data.length, p = []; (a = n.data[s]) || n.getfn && (a = n.getfn(s)) || s < o; ) n.getfn && !n.dontcache && (n.data[s] = a), i[n.alias] = a, n.srcwherefn(i, e.params, c) && p.push(a), s++;
              n.data = p;
            } else n.data = [];
            n.databaseid && c.databases[n.databaseid].tables[n.tableid];
          }
        };
        function Et(e, r, t) {
          if (t >= e.sources.length) e.wherefn(r, e.params, c) && (e.groupfn ? e.groupfn(r, e.params, c) : e.data.push(e.selectfn(r, e.params, c)));
          else if (e.sources[t].applyselect) {
            var n = e.sources[t];
            n.applyselect(e.params, function(f) {
              if (f.length > 0) for (var m = 0; m < f.length; m++) r[n.alias] = f[m], Et(e, r, t + 1);
              else n.applymode == "OUTER" && (r[n.alias] = {}, Et(e, r, t + 1));
            }, r);
          } else {
            let f = e.sources[t], m = e.sources[t + 1], E = f.alias || f.tableid, p = false, h = f.data, g = false;
            (!f.getfn || f.getfn && !f.dontcache) && f.joinmode != "RIGHT" && f.joinmode != "OUTER" && f.joinmode != "ANTI" && f.optimization == "ix" && (h = f.ix[f.onleftfn(r, e.params, c)] || [], g = true);
            let O = 0;
            if (typeof h > "u") throw new Error("Data source number " + t + " in undefined");
            let T = h.length, v;
            for (; (v = h[O]) || !g && f.getfn && (v = f.getfn(O)) || O < T; ) {
              !g && f.getfn && !f.dontcache && (h[O] = v), r[E] = v;
              var i = !f.onleftfn;
              if (!i) {
                var s = f.onleftfn(r, e.params, c), o = f.onrightfn(r, e.params, c);
                (s instanceof String || s instanceof Number) && (s = s.valueOf()), (o instanceof String || o instanceof Number) && (o = s.valueOf()), i = s == o;
              }
              i && f.onmiddlefn(r, e.params, c) && (f.joinmode != "SEMI" && f.joinmode != "ANTI" && Et(e, r, t + 1), f.joinmode != "LEFT" && f.joinmode != "INNER" && (v._rightjoin = true), p = true), O++;
            }
            if ((f.joinmode == "LEFT" || f.joinmode == "OUTER" || f.joinmode == "SEMI") && !p && (r[E] = {}, Et(e, r, t + 1)), t == 0) for (var a = t + 1; a < e.sources.length; a++) {
              if (m.joinmode == "OUTER" || m.joinmode == "RIGHT" || m.joinmode == "ANTI") {
                r[f.alias] = {};
                let N = 0, b = m.data.length, L;
                for (; (L = m.data[N]) || m.getfn && (L = m.getfn(N)) || N < b; ) m.getfn && !m.dontcache && (m.data[N] = L), L._rightjoin ? delete L._rightjoin : (r[m.alias] = L, Et(e, r, a + 1)), N++;
              }
              f = e.sources[a], m = e.sources[a + 1];
            }
            r[E] = void 0;
          }
        }
        function va(e, r) {
          var t = e.sources[r], n = e.sources[r + 1];
          let i = t.onleftfn, s = t.onleftfns, o = t.onrightfn, a = t.onrightfns, f = t.optimization;
          t.onleftfn = n.onrightfn, t.onleftfns = n.onrightfns, t.onrightfn = n.onleftfn, t.onrightfns = n.onleftfns, t.optimization = n.optimization, n.onleftfn = i, n.onleftfns = s, n.onrightfn = o, n.onrightfns = a, n.optimization = f, e.sources[r] = n, e.sources[r + 1] = t;
        }
        S.Select = class {
          constructor(r) {
            Object.assign(this, r);
          }
          toString() {
            var r;
            return r = "", this.explain && (r += "EXPLAIN "), r += "SELECT ", this.modifier && (r += this.modifier + " "), this.distinct && (r += "DISTINCT "), this.top && (r += "TOP " + this.top.value + " ", this.percent && (r += "PERCENT ")), r += this.columns.map(function(t) {
              var n;
              return n = t.toString(), typeof t.as < "u" && (n += " AS " + t.as), n;
            }).join(", "), this.from && (r += " FROM " + this.from.map(function(t) {
              var n;
              return n = t.toString(), t.as && (n += " AS " + t.as), n;
            }).join(",")), this.joins && (r += this.joins.map(function(t) {
              var n;
              if (n = " ", t.joinmode && (n += t.joinmode + " "), t.table) n += "JOIN " + t.table.toString();
              else if (t.select) n += "JOIN (" + t.select.toString() + ")";
              else if (t instanceof c.yy.Apply) n += t.toString();
              else throw new Error("Wrong type in JOIN mode");
              return t.as && (n += " AS " + t.as), t.using && (n += " USING " + t.using.toString()), t.on && (n += " ON " + t.on.toString()), n;
            }).join("")), this.where && (r += " WHERE " + this.where.toString()), this.group && this.group.length > 0 && (r += " GROUP BY " + this.group.map(function(t) {
              return t.toString();
            }).join(", ")), this.having && (r += " HAVING " + this.having.toString()), this.order && this.order.length > 0 && (r += " ORDER BY " + this.order.map(function(t) {
              return t.toString();
            }).join(", ")), this.limit && (r += " LIMIT " + this.limit.value), this.offset && (r += " OFFSET " + this.offset.value), this.union && (r += " UNION " + (this.corresponding ? "CORRESPONDING " : "") + this.union.toString()), this.unionall && (r += " UNION ALL " + (this.corresponding ? "CORRESPONDING " : "") + this.unionall.toString()), this.except && (r += " EXCEPT " + (this.corresponding ? "CORRESPONDING " : "") + this.except.toString()), this.intersect && (r += " INTERSECT " + (this.corresponding ? "CORRESPONDING " : "") + this.intersect.toString()), r;
          }
          toJS(r) {
            var t = "alasql.utils.flatArray(this.queriesfn[" + (this.queriesidx - 1) + "](this.params,null," + r + "))[0]";
            return t;
          }
          compile(r, t) {
            var n = c.databases[r], i = new a4();
            if (i.removeKeys = [], i.aggrKeys = [], i.explain = this.explain, i.explaination = [], i.explid = 1, i.modifier = this.modifier, i.database = n, this.compileWhereExists(i), this.compileQueries(i), i.defcols = this.compileDefCols(i, r), i.fromfn = this.compileFrom(i), this.joins && this.compileJoins(i), i.rownums = [], i.grouprownums = [], i.windowaggrs = [], this.into instanceof S.FuncValue && this.into.funcid.toUpperCase() === "OBJECT" && (i.intoObject = true), this.compileSelectGroup0(i), this.group || i.selectGroup.length > 0 ? i.selectgfns = this.compileSelectGroup1(i) : i.selectfns = this.compileSelect1(i, t), this.compileRemoveColumns(i), this.where && this.compileWhereJoins(i), i.wherefn = this.compileWhere(i), (this.group || i.selectGroup.length > 0) && (i.groupfn = this.compileGroup(i)), this.having && (i.havingfn = this.compileHaving(i)), this.order && (i.orderfn = this.compileOrder(i, t), i.orderColumns = this.orderColumns), this.group || i.selectGroup.length > 0 ? i.selectgfn = this.compileSelectGroup2(i) : i.selectfn = this.compileSelect2(i, t), i.distinct = this.distinct, this.pivot && (i.pivotfn = this.compilePivot(i)), this.unpivot && (i.pivotfn = this.compileUnpivot(i)), this.top ? i.limit = this.top.value : this.limit && (i.limit = this.limit.value, this.offset && (i.offset = this.offset.value)), i.percent = this.percent, i.corresponding = this.corresponding, this.union ? (i.unionfn = this.union.compile(r), !i.orderfn && this.union.order && (i.orderfn = this.union.compileOrder(i, t))) : this.unionall ? (i.unionallfn = this.unionall.compile(r), !i.orderfn && this.unionall.order && (i.orderfn = this.unionall.compileOrder(i, t))) : this.except ? (i.exceptfn = this.except.compile(r), !i.orderfn && this.except.order && (i.orderfn = this.except.compileOrder(i, t))) : this.intersect && (i.intersectfn = this.intersect.compile(r), !i.orderfn && this.intersect.order && (i.orderfn = this.intersect.compileOrder(i, t))), this.into) {
              if (this.into instanceof S.Table) if (c.options.autocommit && c.databases[this.into.databaseid || r].engineid) i.intoallfns = `return alasql
								.engines[${JSON.stringify(c.databases[this.into.databaseid || r].engineid)}]
								.intoTable(
									${JSON.stringify(this.into.databaseid || r)},
									${JSON.stringify(this.into.tableid)},
									this.data,
									columns,
									cb
								);`;
              else {
                var s = this.into.databaseid || r, o = this.into.tableid;
                i.intofns = `
						var db = alasql.databases[${JSON.stringify(s)}];
						var table = db.tables[${JSON.stringify(o)}];
						var converted = {};
						for (var key in r) {
							var colDef = table.xcolumns && table.xcolumns[key];
							converted[key] = alasql.utils.typeConverter(r[key], colDef ? colDef.dbtypeid : null);
						}
						table.data.push(converted);
					`;
              }
              else if (this.into instanceof S.VarValue) i.intoallfns = `
					alasql.vars[${JSON.stringify(this.into.variable)}]=this.data;
					res=this.data.length;
					if(cb) res = cb(res);
					return res;
				`;
              else if (this.into instanceof S.FuncValue) {
                var a = this.into.funcid.toUpperCase(), f = "return alasql.into[" + JSON.stringify(a) + "](";
                this.into.args && this.into.args.length > 0 ? (f += this.into.args[0].toJS() + ",", this.into.args.length > 1 ? f += this.into.args[1].toJS() + "," : f += "undefined,") : f += "undefined, undefined,", i.intoallfns = f + "this.data,columns,cb)", a === "OBJECT" && (i.preserveArrayResult = true);
              } else this.into instanceof S.ParamValue && (typeof this.into.param == "string" ? i.intoallfns = `
						if(!params[${JSON.stringify(this.into.param)}]) params[${JSON.stringify(this.into.param)}]=[];
						params[${JSON.stringify(this.into.param)}]=this.data;
						res=this.data.length;
						if(cb) res = cb(res);
						return res;
					` : i.intofns = `params[${JSON.stringify(this.into.param)}].push(r)`);
              i.intofns ? i.intofn = new Function("r,i,params,alasql", "var y;" + i.intofns) : i.intoallfns && (i.intoallfn = new Function("columns,cb,params,alasql", "var y;" + i.intoallfns));
            }
            var m = function(E, p, h) {
              i.params = E;
              var g = js(i, h, function(O, T) {
                if (T) {
                  if (p) return p(null, T);
                  throw T;
                }
                if (i.rownums.length > 0) for (var v = 0, N = O.length; v < N; v++) for (var b = 0, L = i.rownums.length; b < L; b++) O[v][i.rownums[b]] = v + 1;
                if (i.grouprownums && i.grouprownums.length > 0) for (var b = 0, L = i.grouprownums.length; b < L; b++) {
                  var C = i.grouprownums[b], a1;
                  if (C.partitionColumns && C.partitionColumns.length > 0) a1 = C.partitionColumns;
                  else {
                    var r1 = Object.keys(O[0] || {});
                    a1 = [r1[0]];
                  }
                  for (var H = null, C1 = 0, v = 0, N = O.length; v < N; v++) {
                    var k1 = a1.map(function(Me) {
                      return O[v][Me];
                    }).join("|");
                    v === 0 || k1 !== H ? C1 = 1 : C1++, O[v][C.as] = C1, H = k1;
                  }
                }
                if (i.windowaggrs && i.windowaggrs.length > 0) for (var b = 0, L = i.windowaggrs.length; b < L; b++) {
                  for (var C = i.windowaggrs[b], V1 = {}, v = 0, N = O.length; v < N; v++) {
                    var J1 = C.partitionColumns && C.partitionColumns.length > 0 ? C.partitionColumns.map(function(Ze) {
                      return O[v][Ze];
                    }).join("|") : "__all__";
                    V1[J1] || (V1[J1] = []), V1[J1].push(v);
                  }
                  for (var J1 in V1) {
                    var R = V1[J1], U1 = [], ee = C.expression && C.expression.columnid;
                    if (C.aggregatorid !== "COUNT" || ee && ee !== "*") for (var _1 = 0; _1 < R.length; _1++) {
                      var K1 = O[R[_1]][ee];
                      K1 != null && U1.push(K1);
                    }
                    var Se;
                    switch (C.aggregatorid) {
                      case "COUNT":
                        Se = ee && ee !== "*" ? U1.length : R.length;
                        break;
                      case "SUM":
                        Se = U1.reduce(function(Me, Ze) {
                          return Me + Ze;
                        }, 0);
                        break;
                      case "AVG":
                        Se = U1.length > 0 ? U1.reduce(function(Me, Ze) {
                          return Me + Ze;
                        }, 0) / U1.length : null;
                        break;
                      case "MAX":
                        Se = U1.length > 0 ? Math.max.apply(null, U1) : null;
                        break;
                      case "MIN":
                        Se = U1.length > 0 ? Math.min.apply(null, U1) : null;
                        break;
                    }
                    for (var _1 = 0; _1 < R.length; _1++) O[R[_1]][C.as] = Se;
                  }
                }
                var Ie = f4(i, O);
                return p && p(Ie), Ie;
              });
              return g;
            };
            return m.query = i, m;
          }
          execute(r, t, n) {
            return this.compile(r)(t, n);
          }
          compileWhereExists(r) {
            this.exists && (r.existsfn = this.exists.map(function(t) {
              var n = t.compile(r.database.databaseid);
              return n.query.modifier = "RECORDSET", n;
            }));
          }
          compileQueries(r) {
            if (!this.queries) return;
            const t = (n, i) => {
              if (!n.from) return false;
              const s = /* @__PURE__ */ new Set();
              n.from.forEach((a) => {
                a.tableid && s.add(a.tableid), a.as && s.add(a.as);
              });
              const o = (a) => {
                if (!a) return false;
                if (a instanceof S.Column && a.tableid && !s.has(a.tableid)) return true;
                for (let f of Object.keys(a)) if (a[f] && typeof a[f] == "object" && o(a[f])) return true;
                return false;
              };
              return o(n.where) || o(n.columns);
            };
            r.queriesfn = this.queries.map(function(n, i) {
              var s = n.compile(r.database.databaseid);
              return s.query.modifier = "RECORDSET", s.query.isCorrelated = t(n, r), n.queries && n.queries.length > 0 && (s.query.queriesfn = n.queries.map(function(o) {
                var a = o.compile(r.database.databaseid);
                return a.query.modifier = "RECORDSET", a;
              })), s;
            });
          }
        };
        function f4(e, r) {
          if (typeof r > "u" || typeof r == "number" || typeof r == "string" || typeof r == "boolean") return r;
          var t = e.modifier || c.options.modifier, n = e.columns;
          if (e.dirtyColumns && r.length > 0) {
            for (var i = {}, s = Math.min(r.length, c.options.columnlookup || 10) - 1; 0 <= s; s--) for (var o in r[s]) i[o] = true;
            var a = Object.keys(i).map(function(E) {
              return { columnid: E };
            });
            if (!n || n.length === 0) n = a;
            else {
              var f = {};
              n.forEach(function(E) {
                f[E.columnid] = true;
              }), a.forEach(function(E) {
                f[E.columnid] || n.push(E);
              });
            }
          } else if (typeof n > "u" || n.length === 0) if (r.length > 0) {
            for (var i = {}, s = Math.min(r.length, c.options.columnlookup || 10) - 1; 0 <= s; s--) for (var o in r[s]) i[o] = true;
            n = Object.keys(i).map(function(p) {
              return { columnid: p };
            });
          } else n = [], e && e.sources && e.sources.forEach((E) => {
            E && E.columns && Array.isArray(E.columns) && (n = n.concat(E.columns));
          });
          switch (t) {
            case "VALUE":
              if (r.length === 0) return;
              const E = n && n.length > 0 ? n[0].columnid : Object.keys(r[0])[0];
              return r[0][E];
            case "ROW":
              return r.length === 0 ? void 0 : Object.values(r[0]);
            case "COLUMN":
              if (r.length === 0) return [];
              let p;
              n && n.length > 0 ? p = n[0].columnid : p = Object.keys(r[0])[0];
              let h = [];
              for (var s = 0, m = r.length; s < m; s++) h.push(r[s][p]);
              return e.distinct && (h = c.utils.distinctArray(h)), h;
            case "MATRIX":
              return r.length === 0 ? void 0 : r.map((v) => n.map((N) => v[N.columnid]));
            case "INDEX":
              if (r.length === 0) return;
              const g = n && n.length > 0 ? n[0].columnid : Object.keys(r[0])[0], O = n && n.length > 1 ? n[1].columnid : Object.keys(r[0])[1];
              return r.reduce((v, N) => ({ ...v, [N[g]]: N[O] }), {});
            case "RECORDSET":
              return new c.Recordset({ columns: n, data: r });
            case "TEXTSTRING":
              if (r.length === 0) return;
              const T = n && n.length > 0 ? n[0].columnid : Object.keys(r[0])[0];
              return r.map((v) => v[T]).join(`
`);
            case "ALASQL_DETAILS":
              return { data: r, columns: n, length: r.length };
          }
          return r;
        }
        S.ExistsValue = class {
          constructor(r) {
            Object.assign(this, r);
          }
          toString() {
            return "EXISTS(" + this.value.toString() + ")";
          }
          toType() {
            return "boolean";
          }
          toJS(r, t, n) {
            return `!!this.existsfn[${this.existsidx}](params, null, ${r}).data.length`;
          }
        }, c.precompile = function(e, r, t) {
          if (e) {
            if (e.params = t, e.view && e.select && e.queries) {
              e.select.queries = e.queries;
              return;
            }
            e.queries && (e.queriesfn = e.queries.map(function(n) {
              var i = n.compile(r || e.database.databaseid);
              return i.query.modifier = "RECORDSET", i;
            })), e.exists && (e.existsfn = e.exists.map(function(n) {
              var i = n.compile(r || e.database.databaseid);
              return i.query.modifier = "RECORDSET", i;
            }));
          }
        }, S.Select.prototype.compileFrom = function(e) {
          const r = this;
          e.sources = [], e.aliases = {}, r.from && (r.from.forEach((t) => {
            const n = t.as || t.tableid;
            if (t instanceof S.Table) e.aliases[n] = { tableid: t.tableid, databaseid: t.databaseid || e.database.databaseid, type: "table" };
            else if (t instanceof S.Select) e.aliases[n] = { type: "subquery" };
            else if (t instanceof S.Search) e.aliases[n] = { type: "subsearch" };
            else if (t instanceof S.ParamValue) e.aliases[n] = { type: "paramvalue" };
            else if (t instanceof S.FuncValue) e.aliases[n] = { type: "funcvalue" };
            else if (t instanceof S.VarValue) e.aliases[n] = { type: "varvalue" };
            else if (t instanceof S.FromData) e.aliases[n] = { type: "fromdata" };
            else if (t instanceof S.Json) e.aliases[n] = { type: "json" };
            else if (t.inserted) e.aliases[n] = { type: "inserted" };
            else throw new Error("Wrong table at FROM");
            const i = { alias: n, databaseid: t.databaseid || e.database.databaseid, tableid: t.tableid, joinmode: "INNER", onmiddlefn: u3, srcwherefns: "", srcwherefn: u3 };
            if (t instanceof S.Table) i.columns = c.databases[i.databaseid].tables[i.tableid].columns, c.options.autocommit && c.databases[i.databaseid].engineid && !c.databases[i.databaseid].tables[i.tableid].view ? i.datafn = (s, o, a, f, m) => m.engines[m.databases[i.databaseid].engineid].fromTable(i.databaseid, i.tableid, a, f, s) : c.databases[i.databaseid].tables[i.tableid].view ? i.datafn = (s, o, a, f, m) => {
              let E = m.databases[i.databaseid].tables[i.tableid];
              !E.select && E.viewSelect && (E.select = E.viewSelect.compile(E.viewDatabaseid));
              let p = E.select(o);
              return a && (p = a(p, f, s)), p;
            } : i.datafn = (s, o, a, f, m) => {
              let E = m.databases[i.databaseid].tables[i.tableid].data;
              return a && (E = a(E, f, s)), E;
            };
            else if (t instanceof S.Select) i.subquery = t.compile(e.database.databaseid), typeof i.subquery.query.modifier > "u" && (i.subquery.query.modifier = "RECORDSET"), i.columns = i.subquery.query.columns, i.datafn = (s, o, a, f, m) => {
              let E;
              return i.subquery(s.params, (p) => {
                E = p.data, a && (E = a(E, f, s));
              }), E;
            };
            else if (t instanceof S.Search) i.subsearch = t, i.columns = [], i.datafn = (s, o, a, f, m) => {
              let E;
              return i.subsearch.execute(s.database.databaseid, s.params, (p) => {
                E = p, a && (E = a(E, f, s));
              }), E;
            };
            else if (t instanceof S.ParamValue) {
              let s = `var res = alasql.prepareFromData(params['${t.param}']`;
              t.array && (s += ",true"), s += ");if(cb)res=cb(res,idx,query);return res", i.datafn = new Function("query,params,cb,idx,alasql", s);
            } else if (t.inserted) {
              let s = "var res = alasql.prepareFromData(alasql.inserted";
              t.array && (s += ",true"), s += ");if(cb)res=cb(res,idx,query);return res", i.datafn = new Function("query,params,cb,idx,alasql", s);
            } else if (t instanceof S.Json) {
              let s = "var res = alasql.prepareFromData(" + t.toJS();
              t.array && (s += ",true"), s += ");if(cb)res=cb(res,idx,query);return res", i.datafn = new Function("query,params,cb,idx,alasql", s);
            } else if (t instanceof S.VarValue) {
              let s = `var res = alasql.prepareFromData(alasql.vars['${t.variable}']`;
              t.array && (s += ",true"), s += ");if(cb)res=cb(res,idx,query);return res", i.datafn = new Function("query,params,cb,idx,alasql", s);
            } else if (t instanceof S.FuncValue) {
              let s = "var res=alasql.from[" + JSON.stringify(t.funcid.toUpperCase()) + "](";
              t.args && t.args.length > 0 ? (t.args[0] ? s += t.args[0].toJS("query.oldscope") + "," : s += "null,", t.args[1] ? s += t.args[1].toJS("query.oldscope") + "," : s += "null,") : s += "null,null,", s += "cb,idx,query); return res", i.datafn = new Function("query,params,cb,idx,alasql", s);
            } else if (t instanceof S.FromData) i.datafn = (s, o, a, f, m) => {
              let E = t.data;
              return a && (E = a(E, f, s)), E;
            };
            else throw new Error("Wrong table at FROM");
            e.sources.push(i);
          }), e.defaultTableid = e.sources[0].alias);
        }, c.prepareFromData = function(e, r) {
          let t = e;
          if (typeof e == "string") t = e.split(/\r?\n/), r && (t = t.map((n) => [n]));
          else if (r) t = e.map((n) => [n]);
          else if (typeof e == "object" && !Array.isArray(e)) if (typeof Mongo < "u" && typeof Mongo.Collection < "u" && e instanceof Mongo.Collection) t = e.find().fetch();
          else {
            t = [];
            for (const n in e) e.hasOwnProperty(n) && t.push([n, e[n]]);
          }
          return t;
        }, S.Select.prototype.compileJoins = function(e) {
          const r = this;
          this.joins.forEach((t) => {
            let n, i, s;
            if (t.joinmode === "CROSS" && (t.joinmode = "INNER"), t instanceof S.Apply) {
              s = { alias: t.as, applymode: t.applymode, onmiddlefn: u3, srcwherefns: "", srcwherefn: u3, columns: [] }, s.applyselect = t.select.compile(e.database.databaseid), s.columns = s.applyselect.query.columns, s.datafn = function(a, f, m, E, p) {
                let h;
                return m && (h = m(h, E, a)), h;
              }, e.sources.push(s);
              return;
            }
            if (t.table) {
              if (n = t.table, s = { alias: t.as || n.tableid, databaseid: n.databaseid || e.database.databaseid, tableid: n.tableid, joinmode: t.joinmode, onmiddlefn: u3, srcwherefns: "", srcwherefn: u3, columns: [] }, !c.databases[s.databaseid].tables[s.tableid]) throw new Error("Table '" + s.tableid + "' is not exists in database '" + s.databaseid + "'");
              s.columns = c.databases[s.databaseid].tables[s.tableid].columns, c.options.autocommit && c.databases[s.databaseid].engineid ? s.datafn = function(a, f, m, E, p) {
                return p.engines[p.databases[s.databaseid].engineid].fromTable(s.databaseid, s.tableid, m, E, a);
              } : c.databases[s.databaseid].tables[s.tableid].view ? s.datafn = function(a, f, m, E, p) {
                let h = p.databases[s.databaseid].tables[s.tableid].select(f);
                return m && (h = m(h, E, a)), h;
              } : s.datafn = function(a, f, m, E, p) {
                let h = p.databases[s.databaseid].tables[s.tableid].data;
                return m && (h = m(h, E, a)), h;
              }, e.aliases[s.alias] = { tableid: n.tableid, databaseid: n.databaseid || e.database.databaseid };
            } else if (t.select) n = t.select, s = { alias: t.as, joinmode: t.joinmode, onmiddlefn: u3, srcwherefns: "", srcwherefn: u3, columns: [] }, s.subquery = n.compile(e.database.databaseid), typeof s.subquery.query.modifier > "u" && (s.subquery.query.modifier = "RECORDSET"), s.columns = s.subquery.query.columns, s.datafn = function(a, f, m, E, p) {
              s.data = s.subquery(a.params, null, m, E).data;
              let h = s.data;
              return m && (h = m(h, E, a)), h;
            }, e.aliases[s.alias] = { type: "subquery" };
            else if (t.param) s = { alias: t.as, joinmode: t.joinmode, onmiddlefn: u3, srcwherefns: "", srcwherefn: u3 }, i = "let res=alasql.prepareFromData(params['" + t.param.param + "']", t.array && (i += ",true"), i += "); if(cb) res=cb(res, idx, query); return res", s.datafn = new Function("query,params,cb,idx, alasql", i), e.aliases[s.alias] = { type: "paramvalue" };
            else if (t.variable) s = { alias: t.as, joinmode: t.joinmode, onmiddlefn: u3, srcwherefns: "", srcwherefn: u3 }, i = "let res=alasql.prepareFromData(alasql.vars['" + t.variable + "']", t.array && (i += ", true"), i += "); if(cb)res=cb(res, idx, query);return res", s.datafn = new Function("query,params,cb,idx, alasql", i), e.aliases[s.alias] = { type: "varvalue" };
            else if (t.func) {
              s = { alias: t.as, joinmode: t.joinmode, onmiddlefn: u3, srcwherefns: "", srcwherefn: u3 };
              let a = "let res=alasql.from[" + JSON.stringify(t.func.funcid.toUpperCase()) + "](";
              const f = t.func.args;
              f && f.length > 0 ? (f[0] ? a += f[0].toJS("query.oldscope") + ", " : a += "null, ", f[1] ? a += f[1].toJS("query.oldscope") + ", " : a += "null, ") : a += "null, null, ", a += "cb, idx, query); return res", s.datafn = new Function("query, params, cb, idx, alasql", a), e.aliases[s.alias] = { type: "funcvalue" };
            }
            const o = s.alias;
            if (t.natural) {
              if (t.using || t.on) throw new Error("NATURAL JOIN cannot have USING or ON clauses");
              if (e.sources.length > 0) {
                const a = e.sources[e.sources.length - 1], f = c.databases[a.databaseid].tables[a.tableid], m = c.databases[s.databaseid].tables[s.tableid];
                if (f && m) {
                  const E = f.columns.map((h) => h.columnid), p = m.columns.map((h) => h.columnid);
                  t.using = xs(E, p).map((h) => ({ columnid: h }));
                } else throw new Error("In this version of Alasql NATURAL JOIN works for tables with predefined columns only");
              }
            }
            if (t.using) {
              const a = e.sources[e.sources.length - 1];
              s.onleftfns = t.using.map((f) => "p['" + (a.alias || a.tableid) + "']['" + f.columnid + "']").join('+"`"+'), s.onleftfn = new Function("p,params,alasql", "let y;return " + s.onleftfns), s.onrightfns = t.using.map((f) => "p['" + (s.alias || s.tableid) + "']['" + f.columnid + "']").join('+"`"+'), s.onrightfn = new Function("p,params,alasql", "let y;return " + s.onrightfns), s.optimization = "ix";
            } else if (t.on) if (t.on instanceof S.Op && t.on.op === "=" && !t.on.allsome) {
              s.optimization = "ix";
              let a = "", f = "", m = "", E = false;
              const p = t.on.left.toJS("p", e.defaultTableid, e.defcols), h = t.on.right.toJS("p", e.defaultTableid, e.defcols);
              p.indexOf("p['" + o + "']") > -1 && !(h.indexOf("p['" + o + "']") > -1) ? (p.match(/p\['.*?'\]/g) || []).every((g) => g === "p['" + o + "']") ? f = p : E = true : !(p.indexOf("p['" + o + "']") > -1) && h.indexOf("p['" + o + "']") > -1 && (h.match(/p\['.*?'\]/g) || []).every((g) => g === "p['" + o + "']") ? a = p : E = true, h.indexOf("p['" + o + "']") > -1 && !(p.indexOf("p['" + o + "']") > -1) ? (h.match(/p\['.*?'\]/g) || []).every((g) => g === "p['" + o + "']") ? f = h : E = true : !(h.indexOf("p['" + o + "']") > -1) && p.indexOf("p['" + o + "']") > -1 && (p.match(/p\['.*?'\]/g) || []).every((g) => g === "p['" + o + "']") ? a = h : E = true, E && (f = "", a = "", m = t.on.toJS("p", e.defaultTableid, e.defcols), s.optimization = "no"), s.onleftfns = a, s.onrightfns = f, s.onmiddlefns = m || "true", s.onleftfn = new Function("p,params,alasql", "let y;return " + s.onleftfns), s.onrightfn = new Function("p,params,alasql", "let y;return " + s.onrightfns), s.onmiddlefn = new Function("p,params,alasql", "let y;return " + s.onmiddlefns);
            } else s.optimization = "no", s.onmiddlefns = t.on.toJS("p", e.defaultTableid, e.defcols), s.onmiddlefn = new Function("p,params,alasql", "let y;return " + t.on.toJS("p", e.defaultTableid, e.defcols));
            e.sources.push(s);
          });
        }, S.Select.prototype.compileWhere = function(e) {
          if (this.where) {
            if (typeof this.where == "function") return this.where;
            var r = this.where.toJS("p", e.defaultTableid, e.defcols);
            return e.wherefns = r, new Function("p,params,alasql", "var y;return " + r);
          } else return function() {
            return true;
          };
        };
        function c4(e, r, t) {
          e.onleftfn || (e.onleftfns = r, e.onrightfns = t, e.onleftfn = new Function("p,params,alasql", "var y;return " + r), e.onrightfn = new Function("p,params,alasql", "var y;return " + t), e.optimization = "ix");
        }
        function h4(e, r, t) {
          var n = "(" + r + "==" + t + ")";
          e.srcwherefns = e.srcwherefns ? e.srcwherefns + "&&" + n : n;
        }
        S.Select.prototype.compileWhereJoins = function(e) {
          if (this.where && !(e.sources.length <= 1)) {
            var r = e.sources.some(function(i, s) {
              return s > 0 && i.onleftfn;
            });
            if (!r) {
              var t = Ws(this.where), n = {};
              e.sources.forEach(function(i, s) {
                n[i.alias] = s;
              }), t.forEach(function(i) {
                if (i.op === "=" && !i.allsome) {
                  var s = d4(i.left), o = d4(i.right), a = i.left.toJS("p", e.defaultTableid, e.defcols), f = i.right.toJS("p", e.defaultTableid, e.defcols);
                  if (s.length === 1 && o.length === 1) {
                    var m = s[0], E = o[0];
                    if (n[m] === void 0 || n[E] === void 0) return;
                    var p = n[m], h = n[E];
                    h > p ? c4(e.sources[h], a, f) : p > h && c4(e.sources[p], f, a);
                  } else s.length === 1 && o.length === 0 ? n[s[0]] !== void 0 && h4(e.sources[n[s[0]]], a, f) : s.length === 0 && o.length === 1 && n[o[0]] !== void 0 && h4(e.sources[n[o[0]]], a, f);
                }
              }), e.sources.forEach(function(i) {
                i.srcwherefns && (i.srcwherefn = new Function("p,params,alasql", "var y;return " + i.srcwherefns));
              });
            }
          }
        };
        function Ws(e) {
          var r = [];
          function t(n) {
            if (n) {
              if (n.expression) {
                t(n.expression);
                return;
              }
              n instanceof S.Op && (n.op === "AND" ? (t(n.left), t(n.right)) : n.op === "=" && r.push(n));
            }
          }
          return t(e), r;
        }
        function d4(e) {
          var r = [];
          function t(n) {
            if (n) {
              if (n instanceof S.Column) {
                n.tableid && r.indexOf(n.tableid) === -1 && r.push(n.tableid);
                return;
              }
              n instanceof S.Op && (t(n.left), t(n.right));
            }
          }
          return t(e), r;
        }
        function p4(e, r) {
          if (!r) return false;
          if (r instanceof S.Op && !(r.op != "=" && r.op != "AND") && !r.allsome) {
            var t = r.toJS("p", e.defaultTableid, e.defcols), n = [];
            if (e.sources.forEach(function(a, f) {
              a.tableid && t.indexOf("p['" + a.alias + "']") > -1 && n.push(a);
            }), n.length != 0) if (n.length == 1) {
              if (!(t.match(/p\[\'.*?\'\]/g) || []).every(function(a) {
                return a == "p['" + n[0].alias + "']";
              })) return;
              var i = n[0];
              if (i.srcwherefns = i.srcwherefns ? i.srcwherefns + "&&" + t : t, r instanceof S.Op && r.op == "=" && !r.allsome) {
                if (r.left instanceof S.Column) {
                  var s = r.left.toJS("p", e.defaultTableid, e.defcols), o = r.right.toJS("p", e.defaultTableid, e.defcols);
                  o.indexOf("p['" + n[0].alias + "']") == -1 && (n[0].wxleftfns = s, n[0].wxrightfns = o);
                }
                if (r.right instanceof S.Column) {
                  var s = r.left.toJS("p", e.defaultTableid, e.defcols), o = r.right.toJS("p", e.defaultTableid, e.defcols);
                  s.indexOf("p['" + n[0].alias + "']") == -1 && (n[0].wxleftfns = o, n[0].wxrightfns = s);
                }
              }
              r.reduced = true;
              return;
            } else r.op == "AND" && (p4(e, r.left), p4(e, r.right));
          }
        }
        function b4(e) {
          if (!e.funcid || e.funcid.toUpperCase() !== "GROUP_CONCAT") return "";
          const r = e.separator !== void 0 ? JSON.stringify(e.separator) : "undefined", t = e.order && e.order.length > 0 && e.order[0].direction ? JSON.stringify(e.order[0].direction) : "undefined";
          return `,${r},${t}`;
        }
        S.Select.prototype.compileGroup = function(e) {
          if (e.sources.length > 0) var r = e.sources[0].alias;
          else var r = "";
          var t = e.defcols, n = [[]];
          this.group && (n = or(this.group, e));
          var i = [];
          n.forEach(function(o) {
            i = ws(i, o);
          }), e.allgroups = i, e.ingroup = [];
          var s = "";
          return n.forEach(function(o) {
            s += "var g=this.xgroups[";
            var a = o.map(function(p) {
              var h = p.split("	")[0], g = p.split("	")[1];
              return h === "" ? "1" : (e.ingroup.push(h), g);
            });
            a.length === 0 && (a = ["''"]), s += a.join('+"`"+'), s += "];if(!g) {this.groups.push((g=this.xgroups[", s += a.join('+"`"+'), s += "] = {", s += o.map(function(p) {
              var h = p.split("	")[0], g = p.split("	")[1];
              return h === "" ? "" : "'" + h + "':" + g + ",";
            }).join("");
            var f = _s2(i, o);
            s += f.map(function(p) {
              var h = p.split("	")[0];
              return "'" + h + "':null,";
            }).join("");
            var m = "", E = "";
            typeof e.groupStar < "u" && (E += "for(var f in p['" + e.groupStar + "']) {g[f]=p['" + e.groupStar + "'][f];};"), s += e.selectGroup.map(function(p) {
              var h = p.expression.toJS("p", r, t), g = p.nick;
              let O = (T) => T.args[0].toJS("p", r, t);
              if (p instanceof S.AggrValue) {
                if (p.distinct && (m += ",g['$$_VALUES_" + g + "']={},g['$$_VALUES_" + g + "'][" + h + "]=true"), p.aggregatorid === "SUM") {
                  if ("funcid" in p.expression) {
                    let T = O(p.expression);
                    return `'${g}':(__alasql_tmp = ${h}, (__alasql_tmp instanceof Date) ? undefined : ((__alasql_tmp || typeof __alasql_tmp == 'number') ? __alasql_tmp : undefined)),`;
                  }
                  return `'${g}':(__alasql_tmp = ${h}, (__alasql_tmp instanceof Date) ? undefined : ((__alasql_tmp || typeof __alasql_tmp == 'number') ? __alasql_tmp : undefined)),`;
                } else if (p.aggregatorid === "TOTAL") {
                  if ("funcid" in p.expression) {
                    let T = O(p.expression);
                    return `'${g}':(${T}) || typeof ${T} == 'number' ?
							${T} : ${T} == 'string' && typeof Number(${T}) == 'number' ? Number(${T}) :
							typeof ${T} == 'boolean' ?  Number(${T}) : 0,`;
                  }
                  return `'${g}':(${h})|| typeof ${h} == 'number' ?
							${h} : ${h} == 'string' && typeof Number(${h}) == 'number' ? Number(${h}) :
							typeof ${h} === 'boolean' ?  Number(${h}) : 0,`;
                } else {
                  if (p.aggregatorid === "FIRST" || p.aggregatorid === "LAST") return "'" + g + "':" + h + ",";
                  if (p.aggregatorid === "MIN") {
                    if ("funcid" in p.expression) {
                      let T = O(p.expression);
                      return `'${g}': (__alasql_tmp = ${h}, __alasql_tmp !== null && (typeof __alasql_tmp == 'number' || typeof __alasql_tmp == 'bigint' || (typeof __alasql_tmp == 'object' && (typeof Number(__alasql_tmp) == 'number' || __alasql_tmp instanceof Date))) ? __alasql_tmp : undefined),`;
                    }
                    return `'${g}': (__alasql_tmp = ${h}, __alasql_tmp !== null && (typeof __alasql_tmp == 'number' || typeof __alasql_tmp == 'bigint' || (typeof __alasql_tmp == 'object' && (typeof Number(__alasql_tmp) == 'number' || __alasql_tmp instanceof Date))) ? __alasql_tmp : undefined),`;
                  } else if (p.aggregatorid === "MAX") {
                    if ("funcid" in p.expression) {
                      let T = O(p.expression);
                      return `'${g}': (__alasql_tmp = ${h}, __alasql_tmp !== null && (typeof __alasql_tmp == 'number' || typeof __alasql_tmp == 'bigint' || (typeof __alasql_tmp == 'object' && (typeof Number(__alasql_tmp) == 'number' || __alasql_tmp instanceof Date))) ? __alasql_tmp : undefined),`;
                    }
                    return `'${g}' : (${h} !== null && (typeof ${h} == 'number' || typeof ${h} == 'bigint') ? ${h} : ${h} !== null && typeof ${h} == 'object' ?
							typeof Number(${h}) == 'number' ? ${h} : undefined : undefined),`;
                  } else {
                    if (p.aggregatorid === "ARRAY") return `'${g}':[${h}],`;
                    if (p.aggregatorid === "COUNT") return p.expression.columnid === "*" ? `'${g}':1,` : `'${g}':(typeof ${h} == "undefined" || ${h} === null) ? 0 : 1,`;
                    if (p.aggregatorid === "AVG") return e.removeKeys.push(`_SUM_${g}`), e.removeKeys.push(`_COUNT_${g}`), `'${g}':(function() { var t = ${h}; return (t instanceof Date) ? undefined : t; })(),'_SUM_${g}':(function() { var t = ${h}; return (t instanceof Date) ? undefined : (t || 0); })(),'_COUNT_${g}':(typeof ${h} == "undefined" || ${h} === null) ? 0 : 1,`;
                    if (p.aggregatorid === "AGGR") return m += `,g['${g}']=${p.expression.toJS("g", -1)}`, "";
                    if (p.aggregatorid === "REDUCE") {
                      e.aggrKeys.push(p);
                      const T = b4(p);
                      if (p.args && p.args.length > 1) {
                        let v = p.args.map((N) => N.toJS("p", r, t)).join(",");
                        return `'${g}':alasql.aggr['${p.funcid}'](${v},undefined,1${T}),`;
                      } else return `'${g}':alasql.aggr['${p.funcid}'](${h},undefined,1${T}),`;
                    }
                  }
                }
                return "";
              }
              return "";
            }).join(""), s += "}" + m + ",g));" + E + "} else {", s += e.selectGroup.map(function(p) {
              var h = p.nick, g = p.expression.toJS("p", r, t);
              let O = (N) => N.args[0].toJS("p", r, t);
              if (p instanceof S.AggrValue) {
                var T = "", v = "";
                if (p.distinct && (T = `if(typeof ${g}!="undefined" && (!g['$$_VALUES_${h}'][${g}])) {`, v = `g['$$_VALUES_${h}'][${g}]=true;}`), p.aggregatorid === "SUM") {
                  if ("funcid" in p.expression) {
                    let N = O(p.expression);
                    return T + `
								{
									const __g_colas = g['${h}'];
									const __typeof_colexp1 = typeof ${N};
									const __colexp1 = ${N};

									if (__g_colas == null && ${N} == null) {
										g['${h}'] = undefined;
									} else if (typeof __g_colas === 'bigint' || typeof __colexp1 === 'bigint') {
            					    	g['${h}'] = BigInt(__g_colas) + BigInt(__colexp);
            						} else if ((typeof __g_colas !== 'object' && typeof __g_colas !== 'number' && __typeof_colexp1 !== 'object' && __typeof_colexp1 !== 'number') ||
										   (__g_colas == null || (typeof __g_colas !== 'number' && typeof __g_colas !== 'object')) && (${N} == null || (__typeof_colexp1 !== 'number' && __typeof_colexp1 !== 'object'))) {
										g['${h}'] = undefined;
									} else if ((typeof __g_colas !== 'object' && typeof __g_colas !== 'number' && __typeof_colexp1 == 'number') ||
											   (__g_colas == null && __typeof_colexp1 == 'number')) {
										g['${h}'] = ${g};
									} else if (typeof __g_colas == 'number' && ${N} == null) {
										g['${h}'] = __g_colas;
									} else if (__g_colas instanceof Date || __colexp1 instanceof Date) {
										// Date objects cause string concatenation with +=, return undefined instead
										g['${h}'] = undefined;
									} else {
										g['${h}'] += ${g} || 0;
									}
								}
								` + v;
                  }
                  return T + `
							{
								const __g_colas = g['${h}'];
								const __typeof_colexp = typeof ${g};
								const __colexp = ${g};

								if (__g_colas == null && ${g} == null) {
									g['${h}'] = undefined;
								} else if (typeof __g_colas === 'bigint' || typeof __colexp === 'bigint') {
            					    g['${h}'] = BigInt(__g_colas) + BigInt(__colexp);
            					} else if ((typeof __g_colas !== 'object' && typeof __g_colas !== 'number' && __typeof_colexp !== 'object' && __typeof_colexp !== 'number') ||
										   (__g_colas == null || (typeof __g_colas !== 'number' && typeof __g_colas !== 'object')) && (${g} == null || (__typeof_colexp !== 'number' && __typeof_colexp !== 'object'))) {
								g['${h}'] = undefined;
							} else if (typeof __g_colas !== 'object' && typeof __g_colas !== 'number' && __typeof_colexp == 'number') {
								g['${h}'] = ${g};
							} else if (typeof __g_colas == 'number' && ${g} == null) {
								g['${h}'] = __g_colas;
							} else if (__g_colas == null && __typeof_colexp == 'number') {
								g['${h}'] = ${g};
							} else if (__g_colas instanceof Date || __colexp instanceof Date) {
								// Date objects cause string concatenation with +=, return undefined instead
								g['${h}'] = undefined;
							} else {
								g['${h}'] += ${g} || 0;
							}
						}
						` + v;
                } else if (p.aggregatorid === "TOTAL") {
                  if ("funcid" in p.expression) {
                    let N = O(p.expression);
                    return T + `{
									const __g_colas = g['${h}'];
									const __colexp1 = ${N};
									const __typeof_g_colas = typeof __g_colas;
									const __typeof_colexp1 = typeof __colexp1;

									if (__typeof_g_colas == 'string' && !isNaN(__g_colas) && typeof Number(__g_colas) == 'number' &&
										__typeof_colexp1 == 'string' && !isNaN(__colexp1) && typeof Number(__colexp1) == 'number') {
										g['${h}'] = Number(__g_colas) + Number(__colexp1);
									} else if (__typeof_g_colas === 'bigint' || __typeof_colexp1 === 'bigint') {
       							    	g['${h}'] = BigInt(__g_colas || 0) + BigInt(__colexp1 || 0);
       								} else if (__typeof_g_colas == 'string' && __typeof_colexp1 == 'string') {
										g['${h}'] = 0;
									} else if (__typeof_g_colas == 'string' && __typeof_colexp1 == 'number') {
										g['${h}'] = __colexp1;
									} else if (__typeof_colexp1 == 'string' && __typeof_g_colas == 'number') {
										g['${h}'] = __g_colas;
									} else {
										g['${h}'] += __colexp1 || 0;
									}
								}` + v;
                  }
                  return T + `{
								const __g_colas = g['${h}'];
								const __colexp = ${g};
								const __typeof_g_colas = typeof __g_colas;
								const __typeof_colexp = typeof __colexp;

								if (__typeof_g_colas === 'string' && !isNaN(__g_colas) && typeof Number(__g_colas) === 'number' &&
									__typeof_colexp === 'string' && !isNaN(__colexp) && typeof Number(__colexp) === 'number') {
									g['${h}'] = Number(__g_colas) + Number(__colexp);
								} else if (__typeof_g_colas === 'bigint' || __typeof_colexp === 'bigint') {
       							    g['${h}'] = BigInt(__g_colas || 0) + BigInt(__colexp || 0);
       							} else if (__typeof_g_colas === 'string' && __typeof_colexp === 'string') {
									g['${h}'] = 0;
								} else if (__typeof_g_colas === 'string' && __typeof_colexp === 'number') {
									g['${h}'] = __colexp;
								} else if (__typeof_colexp === 'string' && __typeof_g_colas === 'number') {
									g['${h}'] = __g_colas;
								} else {
									g['${h}'] += __colexp || 0;
								}
							}

							` + v;
                } else {
                  if (p.aggregatorid === "COUNT") return p.expression.columnid === "*" ? `${T}
								g['${h}']++;
								${v}` : `${T}
							if(typeof ${g}!="undefined" && ${g} !== null) g['${h}']++;
							${v}`;
                  if (p.aggregatorid === "ARRAY") return T + "g['" + h + "'].push(" + g + ");" + v;
                  if (p.aggregatorid === "MIN") {
                    if ("funcid" in p.expression) {
                      let N = O(p.expression);
                      return T + `if ((g['${h}'] == null && ${N} !== null) ? y = ${g} : 
									(g['${h}'] !== null && ${N} == null) ? y = g['${h}'] : 
									((y = ${g}) < g['${h}'])) {
									if (typeof y == 'number' || typeof y == 'bigint') {
									  g['${h}'] = y;
									} else if (typeof y == 'object' && y instanceof Date) {
									  g['${h}'] = y;
									} else if (typeof y == 'object' && typeof Number(y) == 'number') {
									  g['${h}'] = Number(y);
									}
								} else if (g['${h}'] !== null && typeof g['${h}'] == 'object' && y instanceof Date) {
									g['${h}'] = g['${h}'];
								} else if (g['${h}'] !== null && typeof g['${h}'] == 'object') {
									g['${h}'] = Number(g['${h}']);
								}` + v;
                    }
                    return T + `if((g['${h}'] == null && ${g}!== null) ? y = ${g} : 
								(g['${h}']!== null && ${g} == null) ? y = g['${h}'] : 
								((y=${g}) < g['${h}'])) { 
								if(typeof y == 'number' || typeof y == 'bigint') {
									g['${h}'] = y;
								} else if(typeof y == 'object' && y instanceof Date) {
									g['${h}'] = y;
								} else if(typeof y == 'object' && typeof Number(y) == 'number') {
									g['${h}'] = Number(y);
								}
							} else if(g['${h}']!== null && typeof g['${h}'] == 'object' && y instanceof Date) {
								g['${h}'] = g['${h}'];
							} else if(g['${h}']!== null && typeof g['${h}'] == 'object') {
								g['${h}'] = Number(g['${h}']);
							}` + v;
                  } else if (p.aggregatorid === "MAX") {
                    if ("funcid" in p.expression) {
                      let N = O(p.expression);
                      return T + `if ((g['${h}'] == null && ${N} !== null) ? y = ${g} : 
									(g['${h}'] !== null && ${N} == null) ? y = g['${h}'] : 
									((y = ${g}) > g['${h}'])) {
									if (typeof y == 'number' || typeof y == 'bigint') {
									  g['${h}'] = y;
									} else if (typeof y == 'object' && y instanceof Date) {
									  g['${h}'] = y;
									} else if (typeof y == 'object' && typeof Number(y) == 'number') {
									  g['${h}'] = Number(y);
									}
								} else if (g['${h}'] !== null && typeof g['${h}'] == 'object' && y instanceof Date) {
									g['${h}'] = g['${h}'];
								} else if (g['${h}'] !== null && typeof g['${h}'] == 'object') {
									g['${h}'] = Number(g['${h}']);
								}` + v;
                    }
                    return T + `if ((g['${h}'] == null && ${g} !== null) ? y = ${g} : 
								(g['${h}'] !== null && ${g} == null) ? y = g['${h}'] : 
								((y = ${g}) > g['${h}'])) {
								if (typeof y == 'number' || typeof y == 'bigint') {
								  g['${h}'] = y;
								} else if (typeof y == 'object' && y instanceof Date) {
								  g['${h}'] = y;
								} else if (typeof y == 'object' && typeof Number(y) == 'number') {
								  g['${h}'] = Number(y);
								}
							} else if (g['${h}'] !== null && typeof g['${h}'] == 'object' && y instanceof Date) {
								g['${h}'] = g['${h}'];
							} else if (g['${h}'] !== null && typeof g['${h}'] == 'object') {
								g['${h}'] = Number(g['${h}']);
							}` + v;
                  } else {
                    if (p.aggregatorid === "FIRST") return "";
                    if (p.aggregatorid === "LAST") return `${T}g['${h}']=${g};${v}`;
                    if (p.aggregatorid === "AVG") return `${T}
							y= (${g});
							g['_COUNT_${h}'] += (typeof y == "undefined" || y === null) ? 0 : 1;
							if (y instanceof Date || (g['_SUM_${h}'] && g['_SUM_${h}'] instanceof Date)) {
							// AVG on Date objects doesn't make semantic sense - return undefined
							g['_SUM_${h}'] = undefined;
							g['${h}'] = undefined;
							} else if (typeof g['_SUM_${h}'] === 'bigint' || typeof y === 'bigint') {
								g['_SUM_${h}'] = BigInt(g['_SUM_${h}']);
								g['_SUM_${h}'] += BigInt(y || 0);
    							g['${h}'] = BigInt(g['_SUM_${h}']) / BigInt(g['_COUNT_${h}']); 
    						} else {
								g['_SUM_${h}'] += (y || 0);
    							g['${h}'] = g['_SUM_${h}'] / g['_COUNT_${h}']; 
    						}
							${v}`;
                    if (p.aggregatorid === "AGGR") return `${T}
							g['${h}']=${p.expression.toJS("g", -1)};
							${v}`;
                    if (p.aggregatorid === "REDUCE") {
                      const N = b4(p);
                      if (p.args && p.args.length > 1) {
                        let b = p.args.map((L) => L.toJS("p", r, t)).join(",");
                        return `${T}
								g['${h}'] = alasql.aggr.${p.funcid}(${b},g['${h}'],2${N});
								${v}`;
                      } else return `${T}
								g['${h}'] = alasql.aggr.${p.funcid}(${g},g['${h}'],2${N});
								${v}`;
                    }
                  }
                }
                return "";
              }
              return "";
            }).join(""), s += "}";
          }), new Function("p,params,alasql", "var y;" + s);
        };
        var Xs = /^(SUM|MAX|MIN|FIRST|LAST|AVG|ARRAY|REDUCE|TOTAL)$/;
        function g4(e, r, t) {
          var n = "", i = [], s = {};
          return r.forEach(function(o) {
            e.ixsources = {}, e.sources.forEach(function(f) {
              e.ixsources[f.alias] = f;
            });
            var a;
            if (e.ixsources[o]) var a = e.ixsources[o].columns;
            t && c.options.joinstar == "json" && (n += "r['" + o + "']={};"), a && a.length > 0 ? a.forEach(function(f) {
              const m = _e2(f.columnid);
              if (t && c.options.joinstar == "underscore") i.push("'" + o + "_" + m + "':p['" + o + "']['" + m + "']");
              else if (t && c.options.joinstar == "json") n += "r['" + o + "']['" + m + "']=p['" + o + "']['" + m + "'];";
              else {
                var E = "p['" + o + "']['" + m + "']";
                if (s[f.columnid]) {
                  var h = E + " !== undefined ? " + E + " : " + s[f.columnid].value;
                  i[s[f.columnid].id] = s[f.columnid].key + h, s[f.columnid].value = h;
                } else {
                  var p = "'" + m + "':";
                  i.push(p + E), s[f.columnid] = { id: i.length - 1, value: E, key: p };
                }
              }
              e.selectColumns[m] = true;
              var g = { columnid: f.columnid, dbtypeid: f.dbtypeid, dbsize: f.dbsize, dbprecision: f.dbprecision, dbenum: f.dbenum };
              e.columns.push(g), e.xcolumns[g.columnid] = g;
            }) : (t && c.options.joinstar == "json" ? n += "r['" + _e2(o) + "']=p['" + _e2(o) + "'];" : t && c.options.joinstar == "underscore" ? n += 'var w=p["' + _e2(o) + '"];for(var k in w){r["' + _e2(o) + '_"+k]=w[k]};' : n += 'var w=p["' + _e2(o) + '"];for(var k in w){r[k]=w[k]};', e.dirtyColumns = true);
          }), { s: i.join(","), sp: n };
        }
        function Ks(e) {
          if (!e || e.op !== "->") return null;
          for (var r = [], t = e; t && t.op === "->"; ) {
            if (typeof t.right == "string") r.unshift(t.right);
            else if (typeof t.right == "number") r.unshift(t.right);
            else return null;
            t = t.left;
          }
          return t && t.columnid ? (r.unshift(t.columnid), r) : null;
        }
        S.Select.prototype.compileSelect1 = function(e, r) {
          var t = this;
          e.columns = [], e.xcolumns = {}, e.selectColumns = {}, e.dirtyColumns = false;
          var n = "var r={", i = "", s = [];
          return this.columns.forEach(function(o) {
            if (o instanceof S.Column) if (o.columnid === "*") if (o.func) i += "r=params['" + o.param + "'](p['" + e.sources[0].alias + "'],p,params,alasql);";
            else if (o.tableid) {
              var a = g4(e, [o.tableid], false);
              a.s && (s = s.concat(a.s)), i += a.sp;
            } else {
              var a = g4(e, Object.keys(e.aliases), true);
              a.s && (s = s.concat(a.s)), i += a.sp;
            }
            else {
              var f = o.tableid, m = o.databaseid || e.sources[0].databaseid || e.database.databaseid;
              if (f || (f = e.defcols[o.columnid]), f || (f = e.defaultTableid), o.columnid !== "_") {
                var E = r && r.length > 1 && Array.isArray(r[0]) && r[0].length >= 1 && r[0][0].hasOwnProperty("sheetid");
                if (E) i = 'var r={};var w=p["' + f + '"];var cols=[' + t.columns.map(function(k1) {
                  return "'" + k1.columnid + "'";
                }).join(",") + "];var colas=[" + t.columns.map(function(k1) {
                  return "'" + (k1.as || k1.columnid) + "'";
                }).join(",") + "];for (var i=0;i<Object.keys(p['" + f + "']).length;i++) for(var k=0;k<cols.length;k++){if (!r.hasOwnProperty(i)) r[i]={}; r[i][colas[k]]=w[i][cols[k]];}";
                else {
                  var p = !o.tableid && e.sources.length > 1 && (!e.defcols[o.columnid] || e.defcols[o.columnid] === "-");
                  if (p) {
                    var h = Object.keys(e.aliases), g = h.map(function(k1) {
                      return "p['" + k1 + "']['" + o.columnid + "']";
                    }).join(" ?? ");
                    s.push("'" + _e2(o.as || o.columnid) + "':(" + g + ")");
                  } else s.push("'" + _e2(o.as || o.columnid) + "':p['" + f + "']['" + o.columnid + "']");
                }
              } else s.push("'" + _e2(o.as || o.columnid) + "':p['" + f + "']");
              if (e.selectColumns[_e2(o.as || o.columnid)] = true, e.aliases[f] && e.aliases[f].type === "table") {
                if (!c.databases[m].tables[e.aliases[f].tableid]) throw new Error("Table '" + f + "' does not exist in database");
                var O = c.databases[m].tables[e.aliases[f].tableid].columns, T = c.databases[m].tables[e.aliases[f].tableid].xcolumns;
                if (T && O.length > 0) {
                  var v = T[o.columnid];
                  if (v === void 0) throw new Error("Column does not exist: " + o.columnid);
                  var N = { columnid: o.as || o.columnid, dbtypeid: v.dbtypeid, dbsize: v.dbsize, dbpecision: v.dbprecision, dbenum: v.dbenum };
                  e.columns.push(N), e.xcolumns[N.columnid] = N;
                } else {
                  var N = { columnid: o.as || o.columnid };
                  e.columns.push(N), e.xcolumns[N.columnid] = N, e.dirtyColumns = true;
                }
              } else {
                var N = { columnid: o.as || o.columnid };
                e.columns.push(N), e.xcolumns[N.columnid] = N;
              }
            }
            else if (o instanceof S.AggrValue) {
              o.as || (o.as = _e2(o.toString())), o.over ? e.windowaggrs.push({ as: o.as, aggregatorid: o.aggregatorid, expression: o.expression, partitionColumns: o.over.partition ? o.over.partition.map(function(V1) {
                return V1.columnid || V1.toString();
              }) : [] }) : (t.group || (t.group = [""]), Xs.test(o.aggregatorid) ? s.push("'" + _e2(o.as) + "':" + An(o.expression.toJS("p", e.defaultTableid, e.defcols))) : o.aggregatorid === "COUNT" && s.push("'" + _e2(o.as) + "':1"));
              var N = { columnid: o.as || o.columnid || o.toString() };
              e.columns.push(N), e.xcolumns[N.columnid] = N;
            } else {
              var b = e.intoObject && !o.as ? Ks(o) : null;
              if (b && b.length > 1) {
                for (var L = An(o.toJS("p", e.defaultTableid, e.defcols)), C = 0; C < b.length - 1; C++) {
                  var a1 = b.slice(0, C + 1), r1 = a1.map(function(V1) {
                    return "['" + _e2(V1) + "']";
                  }).join("");
                  i += "r" + r1 + " = r" + r1 + " || {};";
                }
                var H = b.map(function(V1) {
                  return "['" + _e2(V1) + "']";
                }).join("");
                i += "r" + H + " = " + L + ";";
                var C1 = b[0];
                e.selectColumns[_e2(C1)] = true;
                var N = { columnid: C1 };
                e.xcolumns[N.columnid] || (e.columns.push(N), e.xcolumns[N.columnid] = N);
              } else {
                s.push("'" + _e2(o.as || o.columnid || o.toString()) + "':" + An(o.toJS("p", e.defaultTableid, e.defcols))), e.selectColumns[_e2(o.as || o.columnid || o.toString())] = true;
                var N = { columnid: o.as || o.columnid || o.toString() };
                e.columns.push(N), e.xcolumns[N.columnid] = N;
              }
            }
          }), n += s.join(",") + "};" + i, n;
        }, S.Select.prototype.compileSelect2 = function(e, r) {
          var t = e.selectfns;
          return this.orderColumns && this.orderColumns.length > 0 && !this.union && !this.unionall && !this.except && !this.intersect && this.orderColumns.forEach(function(n, i) {
            var s = "$$$" + i;
            n._useColumnIndex !== void 0 ? t += "var keys=Object.keys(r);r['" + s + "']=r[keys[" + n.columnIndex + "]];" : n instanceof S.Column && e.xcolumns[n.columnid] ? t += "r['" + s + "']=r['" + n.columnid + "'];" : n instanceof S.ParamValue && e.xcolumns[r[n.param]] ? t += "r['" + s + "']=r['" + r[n.param] + "'];" : t += "r['" + s + "']=" + n.toJS("p", e.defaultTableid, e.defcols) + ";", e.removeKeys.push(s);
          }), new Function("p,params,alasql", "var y;" + t + "return r");
        }, S.Select.prototype.compileSelectGroup0 = function(e) {
          var r = this, t = null, n = null;
          r.group && (t = {}, r.group.forEach(function(i, s) {
            i instanceof S.Column && i.columnid && !i.tableid && (t[i.columnid] = s);
          }), n = {}, r.columns.forEach(function(i) {
            i instanceof S.Column && i.columnid && (n[i.columnid] = true);
          })), r.columns.forEach(function(i, s) {
            if (i instanceof S.Column && i.columnid === "*") e.groupStar = i.tableid || "default";
            else {
              var o;
              i instanceof S.Column ? o = _e2(i.columnid) : o = _e2(i.toString(true));
              for (var a = 0; a < s; a++) if (o === r.columns[a].nick) {
                o = r.columns[a].nick + ":" + s;
                break;
              }
              if (i.nick = o, r.group) {
                var f = r.group.findIndex(function(p) {
                  return p.columnid === i.columnid && p.tableid === i.tableid;
                });
                if (f > -1 && (r.group[f].nick = o), i.as && t && t.hasOwnProperty(i.as) && !n[i.as]) {
                  var m = t[i.as], E = N2(i);
                  delete E.as, E.nick = o, r.group[m] = E;
                }
              }
              i.funcid && (i.funcid.toUpperCase() === "ROWNUM" || i.funcid.toUpperCase() === "ROW_NUMBER") && (i.over && i.over.partition ? e.grouprownums.push({ as: i.as, partitionColumns: i.over.partition.map(function(p) {
                return p.columnid || p.toString();
              }) }) : e.rownums.push(i.as)), i.funcid && i.funcid.toUpperCase() === "GROUP_ROW_NUMBER" && e.grouprownums.push({ as: i.as, columnIndex: 0 });
            }
          }), this.columns.forEach(function(i) {
            i.findAggregator && i.findAggregator(e);
          }), this.having && this.having.findAggregator && this.having.findAggregator(e);
        }, S.Select.prototype.compileSelectGroup1 = function(e) {
          var r = this, t = "var r = {};";
          return r.columns.forEach(function(n) {
            if (n instanceof S.Column && n.columnid === "*") return t += "for(var k in g) {r[k]=g[k]};", "";
            var i = n.as;
            i === void 0 && (n instanceof S.Column ? i = _e2(n.columnid) : i = n.nick), e.groupColumns[i] = n.nick, t += "r['" + i + "']=", t += An(n.toJS("g", "")) + ";";
            for (var s = 0; s < e.removeKeys.length; s++) if (e.removeKeys[s] === i) {
              e.removeKeys.splice(s, 1);
              break;
            }
          }), t;
        }, S.Select.prototype.compileSelectGroup2 = function(e) {
          var r = this, t = e.selectgfns, n = {};
          return r.group && r.group.forEach(function(i) {
            var s = (i.tableid || "") + "	" + i.columnid;
            n[s] = i;
          }), r.columns.forEach(function(i) {
            if (!(i instanceof S.Column && i.columnid === "*")) {
              var s = null;
              if (i instanceof S.Column && r.group) {
                var o = (i.tableid || "") + "	" + i.columnid;
                s = n[o];
              }
              var a = s !== null || e.ingroup.indexOf(i.nick) > -1;
              if (a) {
                var f = s && s.nick || i.nick;
                t += "r['" + (i.as || i.nick) + "']=g['" + f + "'];";
              }
            }
          }), this.orderColumns && this.orderColumns.length > 0 && !this.union && !this.unionall && !this.except && !this.intersect && this.orderColumns.forEach(function(i, s) {
            var o = "$$$" + s;
            i._useColumnIndex !== void 0 ? t += "var keys=Object.keys(r);r['" + o + "']=r[keys[" + i.columnIndex + "]];" : i instanceof S.Column && e.groupColumns[i.columnid] ? t += "r['" + o + "']=r['" + i.columnid + "'];" : t += "r['" + o + "']=" + i.toJS("g", "") + ";", e.removeKeys.push(o);
          }), new Function("g,params,alasql", "var y;" + t + "return r");
        }, S.Select.prototype.compileRemoveColumns = function(e) {
          var r = this;
          typeof this.removecolumns < "u" && (e.removeKeys = e.removeKeys.concat(this.removecolumns.filter(function(t) {
            return typeof t.like > "u";
          }).map(function(t) {
            return t.columnid;
          })), e.removeLikeKeys = this.removecolumns.filter(function(t) {
            return typeof t.like < "u";
          }).map(function(t) {
            return t.like.value;
          }));
        }, S.Select.prototype.compileHaving = function(e) {
          if (this.having) {
            var r = this.having.toJS("g", -1);
            return e.havingfns = r, new Function("g,params,alasql", "var y;return " + r);
          }
          return function() {
            return true;
          };
        }, S.Select.prototype.compileOrder = function(e, r) {
          var t = this;
          if (t.orderColumns = [], this.order) {
            if (this.order && this.order.length == 1 && this.order[0].expression && typeof this.order[0].expression == "function") {
              var n = this.order[0].expression, i = this.order[0].nullsOrder == "FIRST" ? -1 : this.order[0].nullsOrder == "LAST" ? 1 : 0;
              return function(a, f) {
                var m = n(a), E = n(f);
                if (i) {
                  if (m == null) return E == null ? 0 : i;
                  if (E == null) return -i;
                }
                return m > E ? 1 : m == E ? 0 : -1;
              };
            }
            var s = "", o = "";
            return this.order.forEach(function(a, f) {
              if (a.expression instanceof S.NumValue) {
                if (a.expression.value < 1) throw new Error(`Invalid column number ${a.expression.value}. Column numbers must be at least 1.`);
                var m = t.columns[a.expression.value - 1], E = t.columns.length === 1 && t.columns[0] instanceof S.Column && t.columns[0].columnid === "*";
                if (E) m = { _useColumnIndex: true, columnIndex: a.expression.value - 1 };
                else {
                  if (a.expression.value > t.columns.length) throw new Error(`You are trying to order by column number ${a.expression.value} but you have only selected ${t.columns.length} columns.`);
                  m instanceof S.Column && m.columnid === "*" && (m = { _useColumnIndex: true, columnIndex: a.expression.value - 1 });
                }
              } else if (a.expression instanceof S.StringValue) var m = new S.Column({ columnid: a.expression.value });
              else var m = a.expression;
              t.orderColumns.push(m);
              var p = "$$$" + f, h = "", g;
              if (a.expression instanceof S.Column ? g = a.expression.columnid : a.expression instanceof S.ParamValue ? g = r[a.expression.param] : a.expression instanceof S.StringValue && (g = a.expression.value), g) {
                if (c.options.valueof) h = ".valueOf()";
                else if (e.xcolumns[g]) {
                  var O = e.xcolumns[g].dbtypeid;
                  (O == "DATE" || O == "DATETIME" || O == "DATETIME2" || O == "STRING" || O == "NUMBER") && (h = ".valueOf()");
                }
              }
              a.nocase && (h += ".toUpperCase()"), a.nullsOrder && (a.nullsOrder == "FIRST" ? s += "if((a['" + p + "'] != null) && (b['" + p + "'] == null)) return 1;" : a.nullsOrder == "LAST" && (s += "if((a['" + p + "'] == null) && (b['" + p + "'] != null)) return 1;"), s += "if((a['" + p + "'] == null) == (b['" + p + "'] == null)) {", o += "}"), s += "if((a['" + p + "']||'')" + h + (a.direction == "ASC" ? ">" : "<") + "(b['" + p + "']||'')" + h + ")return 1;", s += "if((a['" + p + "']||'')" + h + "==(b['" + p + "']||'')" + h + "){", o += "}";
            }), s += "return 0;", s += o + "return -1", e.orderfns = s, new Function("a,b", "var y;" + s);
          }
        }, S.Select.prototype.compilePivot = function(e) {
          var r = this, t = r.pivot.columnid, n = r.pivot.expr.aggregatorid, i = r.pivot.inlist, s = null;
          if (r.pivot.expr.expression.hasOwnProperty("columnid") ? s = r.pivot.expr.expression.columnid : s = r.pivot.expr.expression.expression.columnid, s == null) throw "columnid not found";
          return i && (i = i.map(function(o) {
            return o.expr.columnid;
          })), function() {
            var o = this;
            if (!o.data || o.data.length === 0) {
              o.columns = [];
              return;
            }
            var a = Object.keys(o.data[0]), f = a.filter(function(L) {
              return L !== t && L !== s;
            }), m = [], E = {}, p = {}, h = {}, g = [];
            if (o.data.forEach(function(L) {
              if (!(i && i.indexOf(L[t]) === -1)) {
                var C = f.map(function(C1) {
                  return L[C1] === void 0 || L[C1] === null ? "" : L[C1];
                }).join("`"), a1 = p[C];
                a1 || (a1 = {}, p[C] = a1, g.push(a1), f.forEach(function(C1) {
                  a1[C1] = L[C1];
                })), h[C] || (h[C] = {});
                var r1 = L[t], H = L[s];
                if (h[C][r1] ? H !== null && typeof H < "u" && h[C][r1]++ : h[C][r1] = H !== null && typeof H < "u" ? 1 : 0, E[r1] || (E[r1] = true, m.push(r1)), n == "SUM" || n == "AVG" || n == "TOTAL") H !== null && typeof H < "u" ? a1[r1] = typeof a1[r1] > "u" || a1[r1] === null ? Number(H) : a1[r1] + Number(H) : typeof a1[r1] > "u" && (a1[r1] = null);
                else if (n == "COUNT") s === "*" || H !== null && typeof H < "u" ? a1[r1] = (a1[r1] || 0) + 1 : typeof a1[r1] > "u" && (a1[r1] = 0);
                else if (n == "MIN") H !== null && typeof H < "u" ? (typeof a1[r1] > "u" || a1[r1] === null || H < a1[r1]) && (a1[r1] = H) : typeof a1[r1] > "u" && (a1[r1] = null);
                else if (n == "MAX") H !== null && typeof H < "u" ? (typeof a1[r1] > "u" || a1[r1] === null || H > a1[r1]) && (a1[r1] = H) : typeof a1[r1] > "u" && (a1[r1] = null);
                else if (n == "FIRST") typeof a1[r1] > "u" && (a1[r1] = H);
                else if (n == "LAST") a1[r1] = H;
                else if (c.aggr[n]) typeof a1[r1] > "u" ? a1[r1] = c.aggr[n](H, void 0, 1) : a1[r1] = c.aggr[n](H, a1[r1], 2);
                else throw new Error("Unknown aggregator in PIVOT clause: " + n);
              }
            }), n == "AVG") for (var O in p) {
              var T = p[O];
              for (var v in h[O]) if (T.hasOwnProperty(v) && T[v] !== null) {
                var N = h[O][v];
                N > 0 ? T[v] = T[v] / N : T[v] = null;
              }
            }
            o.data = g, i ? m = i : m.sort();
            let b = o.columns.find((L) => L.columnid === s);
            if (!b && o.sources && o.sources.length > 0) {
              let L = o.sources[0].tableid, C = o.sources[0].databaseid;
              L && C && c.databases[C]?.tables?.[L]?.xcolumns && (b = c.databases[C].tables[L].xcolumns[s]);
            }
            b = b || { columnid: s, dbtypeid: "OBJECT" }, o.columns = o.columns.filter(function(L) {
              return f.includes(L.columnid);
            }), m.forEach(function(L) {
              var C = N2(b);
              C.columnid = L;
              const a1 = (b.dbtypeid || "OBJECT").toUpperCase(), r1 = ["INT", "INTEGER", "SMALLINT", "BIGINT", "SERIAL", "SMALLSERIAL", "BIGSERIAL"], H = [...r1, "NUMBER", "FLOAT", "DECIMAL", "NUMERIC", "MONEY"];
              n === "COUNT" ? C.dbtypeid = "INT" : n === "AVG" ? r1.includes(a1) ? C.dbtypeid = b.dbtypeid : C.dbtypeid = "FLOAT" : n === "SUM" || n === "TOTAL" ? H.includes(a1) ? C.dbtypeid = b.dbtypeid : C.dbtypeid = "FLOAT" : n === "MIN" || n === "MAX" || n === "FIRST" || n === "LAST" ? C.dbtypeid = b.dbtypeid : C.dbtypeid || (C.dbtypeid = "OBJECT"), o.columns.push(C);
            });
          };
        }, S.Select.prototype.compileUnpivot = function(e) {
          var r = this, t = r.unpivot.tocolumnid, n = r.unpivot.forcolumnid, i = r.unpivot.inlist.map(function(s) {
            return s.columnid;
          });
          return function() {
            var s = [], o = e.columns.map(function(a) {
              return a.columnid;
            }).filter(function(a) {
              return i.indexOf(a) == -1 && a != n && a != t;
            });
            e.data.forEach(function(a) {
              i.forEach(function(f) {
                var m = {};
                o.forEach(function(E) {
                  m[E] = a[E];
                }), m[n] = f, m[t] = a[f], s.push(m);
              });
            }), e.data = s;
          };
        };
        const qs = (e, r) => {
          const t = [];
          let n = 0;
          const i = e.length;
          for (let s = 0; s < i + 1; s++) {
            const o = [];
            for (let a = 0; a < i; a++) {
              let f;
              e[a] instanceof S.Column ? (e[a].nick = _e2(e[a].columnid), r.groupColumns[_e2(e[a].columnid)] = e[a].nick, f = `${e[a].nick}	${e[a].toJS("p", r.sources[0].alias, r.defcols)}`) : (r.groupColumns[_e2(e[a].toString())] = _e2(e[a].toString()), f = `${_e2(e[a].toString())}	${e[a].toJS("p", r.sources[0].alias, r.defcols)}`), n & 1 << a && o.push(f);
            }
            t.push(o), n = (n << 1) + 1;
          }
          return t;
        }, Qs = (e, r) => {
          const t = [], n = e.length, i = 1 << n;
          for (let s = 0; s < i; s++) {
            let o = [];
            for (let a = 0; a < n; a++) s & 1 << a && (o = o.concat(or(e[a], r)));
            t.push(o);
          }
          return t;
        }, zs = (e, r) => e.reduce((t, n) => (t = t.concat(or(n, r)), t), []), ar = (e, r) => {
          const t = [];
          for (let n = 0; n < e.length; n++) for (let i = 0; i < r.length; i++) t.push(e[n].concat(r[i]));
          return t;
        };
        function or(e, r) {
          if (Array.isArray(e)) {
            let t = [[]];
            for (let n = 0; n < e.length; n++) if (e[n] instanceof S.Column) e[n].nick = e[n].nick ? _e2(e[n].nick) : _e2(e[n].columnid), r.groupColumns[e[n].nick] = e[n].nick, t = t.map((i) => i.concat(`${e[n].nick}	${e[n].toJS("p", r.sources[0].alias, r.defcols)}`));
            else if (e[n] instanceof S.FuncValue) r.groupColumns[_e2(e[n].toString())] = _e2(e[n].toString()), t = t.map((i) => i.concat(`${_e2(e[n].toString())}	${e[n].toJS("p", r.sources[0].alias, r.defcols)}`));
            else if (e[n] instanceof S.GroupExpression) if (e[n].type == "ROLLUP") t = ar(t, qs(e[n].group, r));
            else if (e[n].type == "CUBE") t = ar(t, Qs(e[n].group, r));
            else if (e[n].type == "GROUPING SETS") t = ar(t, zs(e[n].group, r));
            else throw new Error("Unknown grouping function");
            else e[n] === "" ? t = [["1	1"]] : t = t.map((i) => i.concat(`${_e2(e[n].toString())}	${e[n].toJS("p", r.sources[0].alias, r.defcols)}`));
            return t;
          }
          return e instanceof S.FuncValue ? (r.groupColumns[_e2(e.toString())] = _e2(e.toString()), [`${e.toString()}	${e.toJS("p", r.sources[0].alias, r.defcols)}`]) : e instanceof S.Column ? (e.nick = _e2(e.columnid), r.groupColumns[e.nick] = e.nick, [`${e.nick}	${e.toJS("p", r.sources[0].alias, r.defcols)}`]) : (r.groupColumns[_e2(e.toString())] = _e2(e.toString()), [`${_e2(e.toString())}	${e.toJS("p", r.sources[0].alias, r.defcols)}`]);
        }
        S.Select.prototype.compileDefCols = function(e, r) {
          var t = { ".": {} };
          return this.from && this.from.forEach(function(n) {
            if (t["."][n.as || n.tableid] = true, n instanceof S.Table) {
              var i = n.as || n.tableid, s = c.databases[n.databaseid || r].tables[n.tableid];
              if (s === void 0) throw new Error("Table does not exist: " + n.tableid);
              s.columns && s.columns.forEach(function(o) {
                t[o.columnid] ? t[o.columnid] = "-" : t[o.columnid] = i;
              });
            } else if (!(n instanceof S.Select)) {
              if (!(n instanceof S.Search)) {
                if (!(n instanceof S.ParamValue)) {
                  if (!(n instanceof S.VarValue)) {
                    if (!(n instanceof S.FuncValue)) {
                      if (!(n instanceof S.FromData)) {
                        if (!(n instanceof S.Json)) {
                          if (!n.inserted) throw new Error("Unknown type of FROM clause");
                        }
                      }
                    }
                  }
                }
              }
            }
          }), this.joins && this.joins.forEach(function(n) {
            if (t["."][n.as || n.table.tableid] = true, n.table) {
              var i = n.as || n.table.tableid, s = n.table.databaseid || r, o = c.databases[s];
              if (o === void 0) throw new Error("Database does not exist: " + s);
              var a = o.tables[n.table.tableid];
              if (a === void 0) throw new Error("Table does not exist: " + n.table.tableid);
              a.columns && a.columns.forEach(function(f) {
                t[f.columnid] ? t[f.columnid] = "-" : t[f.columnid] = i;
              });
            } else if (!n.select) {
              if (!n.param) {
                if (!n.func) throw new Error("Unknown type of FROM clause");
              }
            }
          }), t;
        }, S.Union = class {
          constructor(r) {
            Object.assign(this, r);
          }
          toString() {
            return "UNION";
          }
          compile(r) {
            return null;
          }
        }, S.Apply = class {
          constructor(r) {
            Object.assign(this, r);
          }
          toString() {
            let r = `${this.applymode} APPLY (${this.select.toString()})`;
            return this.as && (r += ` AS ${this.as}`), r;
          }
        }, S.Over = class {
          constructor(r) {
            Object.assign(this, r);
          }
          toString() {
            let r = "OVER (";
            return this.partition && (r += `PARTITION BY ${this.partition.toString()}`, this.order && (r += " ")), this.order && (r += `ORDER BY ${this.order.toString()}`), r += ")", r;
          }
        };
        {
          const e = Object.assign;
          class r {
            constructor(R) {
              e(this, R);
            }
            toString() {
              return this.expression.toString();
            }
            execute(R, U1, ee) {
              if (this.expression) {
                c.precompile(this, R, U1);
                var _1 = new Function("params,alasql,p", "var y;return " + this.expression.toJS("({})", "", null)).bind(this), K1 = _1(U1, c);
                return ee && (K1 = ee(K1)), K1;
              }
            }
          }
          class t {
            constructor(R) {
              e(this, R);
            }
            toString() {
              var R = this.expression.toString();
              return this.order && (R += " " + this.order.toString()), this.nocase && (R += " COLLATE NOCASE"), this.direction && (R += " " + this.direction), R;
            }
            findAggregator(R) {
              this.expression.findAggregator && this.expression.findAggregator(R);
            }
            toJS(R, U1, ee) {
              return this.expression.reduced ? "true" : this.expression.toJS(R, U1, ee);
            }
            compile(R, U1, ee) {
              return this.reduced ? u3() : new Function("p", "var y;return " + this.toJS(R, U1, ee));
            }
          }
          class n {
            constructor(R) {
              e(this, R);
            }
            toString() {
              var R = "``" + this.value + "``";
              return R;
            }
            toJS() {
              return "(" + this.value + ")";
            }
            execute(R, U1, ee) {
              var _1 = 1, K1 = new Function("params,alasql,p", this.value);
              return K1(U1, c), ee && (_1 = ee(_1)), _1;
            }
          }
          class i {
            constructor(R) {
              e(this, R);
            }
            toString() {
              var R = this.value;
              return this.value1 && (R = this.value1 + "." + R), R;
            }
          }
          class s {
            constructor(R) {
              e(this, R);
            }
            toString() {
              var R = " ";
              return this.joinmode && (R += this.joinmode + " "), R += "JOIN " + this.table.toString(), R;
            }
          }
          class o {
            constructor(R) {
              e(this, R);
            }
            toString() {
              var R = this.tableid;
              return this.databaseid && (R = this.databaseid + "." + R), R;
            }
          }
          class a {
            constructor(R) {
              e(this, R);
            }
            toString() {
              var R = this.viewid;
              return this.databaseid && (R = this.databaseid + "." + R), R;
            }
          }
          const f = /* @__PURE__ */ new Set(["-", "*", "/", "%", "^", "<<", ">>", "&", "|"]), m = /* @__PURE__ */ new Set(["||"]), E = /[\s.\-\[\]]/, p = /* @__PURE__ */ new Set(["AND", "OR", "NOT", "=", "==", "===", "!=", "!==", "!===", ">", ">=", "<", "<=", "IN", "NOT IN", "LIKE", "NOT LIKE", "REGEXP", "GLOB", "BETWEEN", "NOT BETWEEN", "IS NULL", "IS NOT NULL"]);
          class h {
            constructor(R) {
              e(this, R);
            }
            toString() {
              const R = this.left.toString();
              let U1;
              return this.op === "IN" || this.op === "NOT IN" ? `${R} ${this.op} (${this.right.toString()})` : this.allsome ? `${R} ${this.op} ${this.allsome} (${this.right.toString()})` : this.op === "->" || this.op === "!" ? (U1 = `${R}${this.op}`, typeof this.right != "string" && typeof this.right != "number" ? U1 + `(${this.right.toString()})` : U1 + this.right.toString()) : this.op === "BETWEEN" || this.op === "NOT BETWEEN" ? `${R} ${this.op} ${this.right1.toString()} AND ${this.right2.toString()}` : `${R} ${this.op} ${this.allsome ? this.allsome + " " : ""}${this.right.toString()}`;
            }
            findAggregator(R) {
              this.left && this.left.findAggregator && this.left.findAggregator(R), (this.op === "BETWEEN" || this.op === "NOT BETWEEN") && (this.right1 && this.right1.findAggregator && this.right1.findAggregator(R), this.right2 && this.right2.findAggregator && this.right2.findAggregator(R)), this.right && this.right.findAggregator && !this.allsome && this.right.findAggregator(R);
            }
            toType(R) {
              if (f.has(this.op)) return "number";
              if (m.has(this.op)) return "string";
              if (this.op === "+") {
                const U1 = this.left.toType(R), ee = this.right.toType(R);
                if (U1 === "string" || ee === "string") return "string";
                if (U1 === "number" || ee === "number") return "number";
              }
              return p.has(this.op) || this.allsome ? "boolean" : this.op ? "unknown" : this.left.toType(R);
            }
            toJS(R, U1, ee) {
              var _1;
              let K1 = [], Se = this.op, Ie = false, Xe = this, Ve = function(Re) {
                return Re.toJS && (Re = Re.toJS(R, U1, ee)), "y[" + (K1.push(Re) - 1) + "]";
              };
              var we = function() {
                return Ve(Xe.left);
              }, Ge = function() {
                return Ve(Xe.right);
              };
              if (this.op === "=") Se = "===";
              else if (this.op === "<>") Se = "!=";
              else if (this.op === "OR") Se = "||";
              else if (this.op === "->") {
                const Re = `(${we()} || {})`;
                if (typeof this.right == "string") _1 = `${Re}["${_e2(this.right)}"]`;
                else if (typeof this.right == "number") _1 = `${Re}[${this.right}]`;
                else if (this.right instanceof S.FuncValue) {
                  let Oe = [];
                  this.right.args && this.right.args.length > 0 && (Oe = this.right.args.map(Ve)), _1 = `${Re}[${JSON.stringify(this.right.funcid)}](${Oe.join(",")})`;
                } else _1 = `${Re}[${Ge()}]`;
              } else if (this.op === "!") typeof this.right == "string" && (_1 = `alasql.databases[alasql.useid].objects[${we()}]["${this.right}"]`);
              else if (this.op === "IS") {
                const Re = we(), Oe = Ge();
                this.right instanceof S.NullValue || this.right.op === "NOT" && this.right.right instanceof S.NullValue ? _1 = `((${Re} == null) === (${Oe} == null))` : _1 = `((${Re} == ${Oe}) || (${Re} < 0 && true == ${Oe}))`;
              } else if (this.op === "==") _1 = `alasql.utils.deepEqual(${we()}, ${Ge()})`;
              else if (this.op === "===" || this.op === "!===") _1 = `(${this.op === "!===" ? "!" : ""}((${we()}).valueOf() === (${Ge()}).valueOf()))`;
              else if (this.op === "!==") _1 = `(!alasql.utils.deepEqual(${we()}, ${Ge()}))`;
              else if (this.op === "||") _1 = `(''+(${we()} || '') + (${Ge()} || ''))`;
              else if (this.op === "LIKE" || this.op === "NOT LIKE") _1 = `(${this.op === "NOT LIKE" ? "!" : ""}alasql.utils.like(${Ge()}, ${we()}${this.escape ? `, ${Ve(this.escape)}` : ""}))`;
              else if (this.op === "REGEXP") _1 = `alasql.stdfn.REGEXP_LIKE(${we()}, ${Ge()})`;
              else if (this.op === "GLOB") _1 = `alasql.utils.glob(${we()}, ${Ge()})`;
              else if (this.op === "BETWEEN" || this.op === "NOT BETWEEN") {
                const Re = we();
                _1 = `(${this.op === "NOT BETWEEN" ? "!" : ""}((${Ve(this.right1)} <= ${Re}) && (${Re} <= ${Ve(this.right2)})))`;
              } else if (this.op === "IN") if (this.right instanceof S.Select) {
                const Re = `in${this.queriesidx}`, Oe = `(this.queriesfn[${this.queriesidx}].query && this.queriesfn[${this.queriesidx}].query.isCorrelated)`, Pe = `((this.subqueryCache = this.subqueryCache || {}, this.subqueryCache.${Re} || (this.subqueryCache.${Re} = new Set(alasql.utils.flatArray(this.queriesfn[${this.queriesidx}](params, null, ${R})).map(alasql.utils.getValueOf)))).has(alasql.utils.getValueOf(${we()})))`, He = `(alasql.utils.flatArray(this.queriesfn[${this.queriesidx}](params, null, ${R})).indexOf(alasql.utils.getValueOf(${we()})) > -1)`;
                _1 = `(${Oe} ? ${He} : ${Pe})`;
              } else if (Array.isArray(this.right)) if (this.right.length === 0) we(), _1 = "false", Ie = true;
              else if (!c.options.cache || this.right.some((Re) => Re instanceof S.ParamValue)) _1 = `(new Set([${this.right.map(Ve).join(",")}]).has(alasql.utils.getValueOf(${we()})))`;
              else {
                c.sets = c.sets || {};
                const Re = this.right.map((Pe) => Pe.value), Oe = Re.join(",");
                c.sets[Oe] = c.sets[Oe] || new Set(Re), _1 = `alasql.sets["${Oe}"].has(alasql.utils.getValueOf(${we()}))`;
              }
              else _1 = `(${Ge()}.indexOf(${we()}) > -1)`;
              else if (this.op === "NOT IN") if (this.right instanceof S.Select) {
                const Re = `notIn${this.queriesidx}`, Oe = `(this.queriesfn[${this.queriesidx}].query && this.queriesfn[${this.queriesidx}].query.isCorrelated)`, Pe = `(!(this.subqueryCache = this.subqueryCache || {}, this.subqueryCache.${Re} || (this.subqueryCache.${Re} = new Set(alasql.utils.flatArray(this.queriesfn[${this.queriesidx}](params, null, ${R})).map(alasql.utils.getValueOf)))).has(alasql.utils.getValueOf(${we()})))`, He = `(alasql.utils.flatArray(this.queriesfn[${this.queriesidx}](params, null, ${R})).indexOf(alasql.utils.getValueOf(${we()})) < 0)`;
                _1 = `(${Oe} ? ${He} : ${Pe})`;
              } else if (Array.isArray(this.right)) if (this.right.length === 0) we(), _1 = "true", Ie = true;
              else if (!c.options.cache || this.right.some((Re) => Re instanceof S.ParamValue)) _1 = `(!(new Set([${this.right.map(Ve).join(",")}]).has(alasql.utils.getValueOf(${we()}))))`;
              else {
                c.sets = c.sets || {};
                const Re = this.right.map((Pe) => Pe.value), Oe = Re.join(",");
                c.sets[Oe] = c.sets[Oe] || new Set(Re), _1 = `!alasql.sets["${Oe}"].has(alasql.utils.getValueOf(${we()}))`;
              }
              else _1 = `(${Ge()}.indexOf(${we()}) === -1)`;
              if (this.allsome === "ALL") {
                var _1;
                if (this.right instanceof S.Select) _1 = "alasql.utils.flatArray(this.query.queriesfn[" + this.queriesidx + "](params,null,p))", _1 += ".every(function(b){return (", _1 += we() + ")" + Se + "b})";
                else if (Array.isArray(this.right)) _1 = "" + (this.right.length == 1 ? Ve(this.right[0]) : "[" + this.right.map(Ve).join(",") + "]"), _1 += ".every(function(b){return (", _1 += we() + ")" + Se + "b})";
                else throw new Error("NOT IN operator without SELECT");
              }
              if (this.allsome === "SOME" || this.allsome === "ANY") {
                var _1;
                if (this.right instanceof S.Select) _1 = "alasql.utils.flatArray(this.query.queriesfn[" + this.queriesidx + "](params,null,p))", _1 += ".some(function(b){return (", _1 += we() + ")" + Se + "b})";
                else if (Array.isArray(this.right)) _1 = "" + (this.right.length == 1 ? Ve(this.right[0]) : "[" + this.right.map(Ve).join(",") + "]"), _1 += ".some(function(b){return (", _1 += we() + ")" + Se + "b})";
                else throw new Error("SOME/ANY operator without SELECT");
              }
              if (this.op === "AND") {
                if (this.left.reduced) {
                  if (this.right.reduced) return "true";
                  _1 = Ge();
                } else this.right.reduced && (_1 = we());
                Se = "&&";
              }
              var Me = _1 || "(" + we() + Se + Ge() + ")", Ze = "y=[(" + K1.join("), (") + ")]";
              return Ie || Se === "&&" || Se === "||" || Se === "IS" || Se === "IS NULL" || Se === "IS NOT NULL" ? "(" + Ze + ", " + Me + ")" : `(${Ze}, y.some(e => e == null || (typeof e === 'number' && isNaN(e))) ? void 0 : ${Me})`;
            }
          }
          class g {
            constructor(R) {
              e(this, R);
            }
            toString() {
              return "@" + this.variable;
            }
            toType() {
              return "unknown";
            }
            toJS() {
              return "alasql.vars['" + _e2(this.variable) + "']";
            }
          }
          class O {
            constructor(R) {
              e(this, R);
            }
            toString() {
              return this.value.toString();
            }
            toType() {
              return "number";
            }
            toJS() {
              return "" + this.value;
            }
          }
          class T {
            constructor(R) {
              e(this, R);
            }
            toString() {
              return "'" + this.value.toString() + "'";
            }
            toType() {
              return "string";
            }
            toJS() {
              return "'" + _e2(this.value) + "'";
            }
          }
          class v {
            constructor(R) {
              e(this, R);
            }
            toString() {
              return "VALUE";
            }
            toType() {
              return "object";
            }
            toJS(R, U1, ee) {
              return R;
            }
          }
          class N {
            constructor(R) {
              e(this, R);
            }
            toString() {
              return "ARRAY[]";
            }
            toType() {
              return "object";
            }
            toJS(R, U1, ee) {
              return "[(" + this.value.map(function(_1) {
                return _1.toJS(R, U1, ee);
              }).join("), (") + ")]";
            }
          }
          class b {
            constructor(R) {
              e(this, R);
            }
            toString() {
              return this.value ? "TRUE" : "FALSE";
            }
            toType() {
              return "boolean";
            }
            toJS() {
              return this.value ? "true" : "false";
            }
          }
          class L {
            constructor(R) {
              e(this, R);
            }
            toString() {
              return "NULL";
            }
            toJS() {
              return "undefined";
            }
          }
          class C {
            constructor(R) {
              e(this, R);
            }
            toString() {
              return "$" + this.param;
            }
            toJS() {
              return typeof this.param == "string" ? "params['" + this.param + "']" : "params[" + this.param + "]";
            }
          }
          const a1 = { "~": "~", "-": "-", "+": "+", NOT: "!" };
          class r1 {
            constructor(R) {
              e(this, R);
            }
            toString() {
              const { op: R, right: U1 } = this, ee = U1.toString();
              switch (R) {
                case "~":
                case "-":
                case "+":
                case "#":
                  return R + ee;
                case "NOT":
                  return R + "(" + ee + ")";
                default:
                  return "(" + ee + ")";
              }
            }
            findAggregator(R) {
              this.right.findAggregator && this.right.findAggregator(R);
            }
            toType() {
              switch (this.op) {
                case "-":
                case "+":
                  return "number";
                case "NOT":
                  return "boolean";
                default:
                  return "string";
              }
            }
            toJS(R, U1, ee) {
              if (this.right instanceof H && this.op === "#") return `(alasql.databases[alasql.useid].objects['${this.right.columnid}'])`;
              const _1 = this.right.toJS(R, U1, ee);
              if (a1.hasOwnProperty(this.op)) return `(${a1[this.op]}(${_1}))`;
              if (this.op == null) return `(${_1})`;
              throw new Error(`Unsupported operator: ${this.op}`);
            }
          }
          class H {
            constructor(R) {
              e(this, R);
            }
            static needsBrackets(R) {
              return R == null ? false : R == +R ? true : E.test(R);
            }
            static wrapId(R) {
              return H.needsBrackets(R) ? "[" + R + "]" : R;
            }
            toString() {
              const R = H.needsBrackets(this.columnid);
              let U1 = R ? "[" + this.columnid + "]" : this.columnid;
              if (this.tableid) {
                const ee = R ? "" : ".";
                U1 = H.wrapId(this.tableid) + ee + U1, this.databaseid && (U1 = H.wrapId(this.databaseid) + "." + U1);
              }
              return U1;
            }
            toJS(R, U1, ee) {
              if (!this.tableid && U1 === "" && !ee) return this.columnid !== "_" ? `${R}['${this.columnid}']` : R === "g" ? "g['_']" : R;
              if (R === "g") return `g['${this.nick || this.columnid}']`;
              if (this.tableid) return this.columnid !== "_" ? `${R}['${this.tableid}']['${this.columnid}']` : R === "g" ? "g['_']" : `${R}['${this.tableid}']`;
              if (ee) {
                const _1 = ee[this.columnid];
                if (_1 === "-") throw new Error(`Cannot resolve column "${this.columnid}" because it exists in two source tables`);
                return _1 ? this.columnid !== "_" ? `${R}['${_1}']['${this.columnid}']` : `${R}['${_1}']` : this.columnid !== "_" ? `${R}['${this.tableid || U1}']['${this.columnid}']` : `${R}['${this.tableid || U1}']`;
              }
              return U1 === -1 ? `${R}['${this.columnid}']` : this.columnid !== "_" ? `${R}['${this.tableid || U1}']['${this.columnid}']` : `${R}['${this.tableid || U1}']`;
            }
          }
          class C1 {
            constructor(R) {
              e(this, R);
            }
            toString() {
              const R = this.aggregatorid === "REDUCE" ? this.funcid.replace(E4, "") : this.aggregatorid, U1 = this.distinct ? "DISTINCT " : "", ee = this.expression ? this.expression.toString() : "", _1 = this.over ? ` ${this.over.toString()}` : "";
              return `${R}(${U1}${ee})${_1}`;
            }
            findAggregator(R) {
              if (this.over) return;
              let U1 = R.selectGroup.find((ee) => ee.toString() === this.toString());
              U1 ? this.aggrNick = U1.nick : (this.nick || (this.nick = _e2(this.toString()) + ":" + R.selectGroup.length, R.removeKeys.includes(this.nick) || R.removeKeys.push(this.nick)), this.aggrNick = this.nick, R.selectGroup.push(this));
            }
            toType() {
              return ["SUM", "COUNT", "AVG", "MIN", "MAX", "AGGR", "VAR", "STDDEV", "TOTAL"].includes(this.aggregatorid) ? "number" : this.aggregatorid === "ARRAY" ? "array" : this.expression.toType();
            }
            toJS() {
              var R = this.aggrNick || this.nick;
              return R === void 0 && (R = _e2(this.toString())), "g['" + R + "']";
            }
          }
          class k1 {
            constructor(R) {
              e(this, R);
            }
          }
          k1.prototype.toString = t.prototype.toString;
          class V1 {
            constructor(R) {
              e(this, R);
            }
            toString() {
              return this.type + "(" + this.group.toString() + ")";
            }
          }
          e(S, { AggrValue: C1, ArrayValue: N, Column: H, DomainValueValue: v, Expression: t, ExpressionStatement: r, GroupExpression: V1, JavaScript: n, Join: s, Literal: i, LogicValue: b, NullValue: L, NumValue: O, Op: h, OrderExpression: k1, ParamValue: C, StringValue: T, Table: o, UniOp: r1, VarValue: g, View: a });
        }
        S.FromData = function(e) {
          return S.extend(this, e);
        }, S.FromData.prototype.toString = function() {
          return this.data ? "DATA(" + (Math.random() * 1e16 | 0) + ")" : "?";
        }, S.FromData.prototype.toJS = function() {
        }, S.Select.prototype.exec = function(e, r) {
          this.preparams && (e = this.preparams.concat(e));
          var t = c.useid, n = c.databases[t], i = this.toString(), s = d2(i), o = this.compile(t);
          if (o) {
            o.sql = i, o.dbversion = n.dbversion, n.sqlCacheSize > c.MAXSQLCACHESIZE && n.resetSqlCache(), n.sqlCacheSize++, n.sqlCache[s] = o;
            var a = c.res = o(e, r);
            return a;
          }
        }, S.Select.prototype.Select = function() {
          var e = this, r = [];
          if (arguments.length > 1) r = Array.prototype.slice.call(arguments);
          else if (arguments.length == 1) Array.isArray(arguments[0]) ? r = arguments[0] : r = [arguments[0]];
          else throw new Error("Wrong number of arguments of Select() function");
          return e.columns = [], r.forEach(function(t) {
            if (typeof t == "string") e.columns.push(new S.Column({ columnid: t }));
            else if (typeof t == "function") {
              var n = 0;
              e.preparams ? n = e.preparams.length : e.preparams = [], e.preparams.push(t), e.columns.push(new S.Column({ columnid: "*", func: t, param: n }));
            }
          }), e;
        }, S.Select.prototype.From = function(e) {
          var r = this;
          if (r.from || (r.from = []), Array.isArray(e)) {
            var t = 0;
            r.preparams ? t = r.preparams.length : r.preparams = [], r.preparams.push(e), r.from.push(new S.ParamValue({ param: t }));
          } else if (typeof e == "string") r.from.push(new S.Table({ tableid: e }));
          else throw new Error("Unknown arguments in From() function");
          return r;
        }, S.Select.prototype.OrderBy = function() {
          var e = this, r = [];
          if (e.order = [], arguments.length == 0) r = ["_"];
          else if (arguments.length > 1) r = Array.prototype.slice.call(arguments);
          else if (arguments.length == 1) Array.isArray(arguments[0]) ? r = arguments[0] : r = [arguments[0]];
          else throw new Error("Wrong number of arguments of Select() function");
          return r.length > 0 && r.forEach(function(t) {
            var n = new S.Column({ columnid: t });
            typeof t == "function" && (n = t), e.order.push(new S.OrderExpression({ expression: n, direction: "ASC" }));
          }), e;
        }, S.Select.prototype.Top = function(e) {
          var r = this;
          return r.top = new S.NumValue({ value: e }), r;
        }, S.Select.prototype.GroupBy = function() {
          var e = this, r = [];
          if (arguments.length > 1) r = Array.prototype.slice.call(arguments);
          else if (arguments.length == 1) Array.isArray(arguments[0]) ? r = arguments[0] : r = [arguments[0]];
          else throw new Error("Wrong number of arguments of Select() function");
          return e.group = [], r.forEach(function(t) {
            var n = new S.Column({ columnid: t });
            e.group.push(n);
          }), e;
        }, S.Select.prototype.Where = function(e) {
          var r = this;
          return typeof e == "function" && (r.where = e), r;
        }, S.FuncValue = function(e) {
          return Object.assign(this, e);
        };
        let E4 = /[^0-9A-Z_$]+/i;
        S.FuncValue.prototype.toString = function() {
          let e = "";
          return c.fn[this.funcid] ? e += this.funcid : c.aggr[this.funcid] ? e += this.funcid : (c.stdlib[this.funcid.toUpperCase()] || c.stdfn[this.funcid.toUpperCase()]) && (e += this.funcid.toUpperCase().replace(E4, "")), this.funcid !== "CURRENT_TIMESTAMP" && (e += "(", this.args && this.args.length > 0 && (e += this.args.map(function(r) {
            return r.toString();
          }).join(",")), e += ")"), this.over && (e += " " + this.over.toString()), e;
        }, S.FuncValue.prototype.execute = function(e, r, t) {
          let n = 1;
          return c.precompile(this, e, r), new Function("params,alasql", "var y;return " + this.toJS("", "", null))(r, c), t && (n = t(n)), n;
        }, S.FuncValue.prototype.findAggregator = function(e) {
          this.args && this.args.length > 0 && this.args.forEach(function(r) {
            r.findAggregator && r.findAggregator(e);
          });
        }, S.FuncValue.prototype.toJS = function(e, r, t) {
          var n = "", i = this.funcid;
          return !c.fn[i] && c.stdlib[i.toUpperCase()] ? this.args && this.args.length > 0 ? n += c.stdlib[i.toUpperCase()].apply(this, this.args.map(function(s) {
            return s.toJS(e, r);
          })) : n += c.stdlib[i.toUpperCase()]() : !c.fn[i] && c.stdfn[i.toUpperCase()] ? (this.newid && (n += "new "), n += "alasql.stdfn[" + JSON.stringify(this.funcid.toUpperCase()) + "](", this.args && this.args.length > 0 && (n += this.args.map(function(s) {
            return s.toJS(e, r, t);
          }).join(",")), n += ")") : (this.newid && (n += "new "), n += "alasql.fn[" + JSON.stringify(this.funcid) + "](", this.args && this.args.length > 0 && (n += this.args.map(function(s) {
            return s.toJS(e, r, t);
          }).join(",")), n += ")"), n;
        };
        var Ue = c.stdlib = {}, Fe = c.stdfn = {};
        Ue.ABS = function(e) {
          return "Math.abs(" + e + ")";
        }, Ue.CLONEDEEP = function(e) {
          return "alasql.utils.cloneDeep(" + e + ")";
        }, Fe.CONCAT = function() {
          return Array.prototype.slice.call(arguments).join("");
        }, Ue.EXP = function(e) {
          return "Math.pow(Math.E," + e + ")";
        }, Ue.IIF = function(e, r, t) {
          if (arguments.length === 3) return `((${e}) ? (${r}) : (${t}))`;
          throw new Error("Number of arguments of IFF is not equals to 3");
        }, Ue.IFNULL = function(e, r) {
          return `((typeof ${e} === "undefined" || ${e} === null) ? ${r} : ${e})`;
        }, Ue.INSTR = function(e, r) {
          return `((${e}).indexOf(${r}) + 1)`;
        }, Ue.LEN = Ue.LENGTH = function(e) {
          return Q2(e, "y.length");
        }, Ue.LOWER = Ue.LCASE = function(e) {
          return Q2(e, "String(y).toLowerCase()");
        }, Ue.LTRIM = function(e) {
          return Q2(e, 'y.replace(/^[ ]+/,"")');
        }, Ue.RTRIM = function(e) {
          return Q2(e, 'y.replace(/[ ]+$/,"")');
        }, Ue.MAX = Ue.GREATEST = function() {
          return "[" + Array.prototype.join.call(arguments, ",") + "].reduce(function (a, b) { return a > b ? a : b; })";
        }, Ue.MIN = Ue.LEAST = function() {
          return "[" + Array.prototype.join.call(arguments, ",") + "].reduce(function (a, b) { return a < b ? a : b; })";
        }, Ue.SUBSTRING = Ue.SUBSTR = Ue.MID = function(e, r, t) {
          if (arguments.length == 2) return Q2(e, "y.substr(" + r + "-1)");
          if (arguments.length == 3) return Q2(e, "y.substr(" + r + "-1," + t + ")");
        }, Fe.REGEXP_LIKE = function(e, r, t) {
          var n = r.replace(/\[\[:<:\]\]/g, "\\b").replace(/\[\[:>:\]\]/g, "\\b");
          return (e || "").search(RegExp(n, t)) > -1;
        }, Ue.ISNULL = Ue.NULLIF = function(e, r) {
          return "(" + e + "==" + r + "?undefined:" + e + ")";
        }, Ue.POWER = function(e, r) {
          return "Math.pow(" + e + "," + r + ")";
        }, Ue.RANDOM = function(e) {
          return arguments.length == 0 ? "Math.random()" : "(Math.random()*(" + e + ")|0)";
        }, Ue.ROUND = function(e, r) {
          return arguments.length == 2 ? "(__alasql_tmp = (" + e + '), (__alasql_tmp == null || (typeof __alasql_tmp === "string" && __alasql_tmp.trim() === "")) ? undefined : ((__alasql_tmp = Number(__alasql_tmp)), isNaN(__alasql_tmp) ? undefined : Math.round(__alasql_tmp*Math.pow(10,(' + r + ")))/Math.pow(10,(" + r + "))))" : "(__alasql_tmp = (" + e + '), (__alasql_tmp == null || (typeof __alasql_tmp === "string" && __alasql_tmp.trim() === "")) ? undefined : ((__alasql_tmp = Number(__alasql_tmp)), isNaN(__alasql_tmp) ? undefined : Math.round(__alasql_tmp)))';
        }, Ue.CEIL = Ue.CEILING = function(e) {
          return "Math.ceil(" + e + ")";
        }, Ue.FLOOR = function(e) {
          return "Math.floor(" + e + ")";
        }, Ue.ROWNUM = function() {
          return "1";
        }, Ue.ROW_NUMBER = function() {
          return "1";
        }, Ue.GROUP_ROW_NUMBER = function() {
          return "1";
        }, Ue.SQRT = function(e) {
          return "Math.sqrt(" + e + ")";
        }, Ue.TRIM = function(e) {
          return Q2(e, "y.trim()");
        }, Ue.UPPER = Ue.UCASE = function(e) {
          return Q2(e, "String(y).toUpperCase()");
        }, Fe.CONCAT_WS = function() {
          var e = Array.prototype.slice.call(arguments);
          return e = e.filter((r) => !(r === null || typeof r > "u")), e.slice(1, e.length).join(e[0] || "");
        }, c.aggr.group_concat = c.aggr.GROUP_CONCAT = function(e, r, t, n, i) {
          if (n === void 0 && (n = ","), t === 1) return e == null ? { values: [], separator: n, orderDirection: i } : { values: [e], separator: n, orderDirection: i };
          if (t === 2) return e == null ? r : r == null ? { values: [e], separator: n, orderDirection: i } : (typeof r == "string" && (r = { values: r.split(","), separator: ",", orderDirection: void 0 }), r.values.push(e), r);
          {
            if (r == null) return;
            if (typeof r == "string") return r;
            let s = r.values;
            if (s.length === 0) return;
            if (r.orderDirection && r.orderDirection !== void 0) {
              let o = r.orderDirection === "ASC";
              s = s.slice().sort((a, f) => a === f ? 0 : a == null ? 1 : f == null ? -1 : typeof a == "string" && typeof f == "string" ? o ? a.localeCompare(f) : f.localeCompare(a) : o ? a < f ? -1 : 1 : f < a ? -1 : 1);
            }
            return s.join(r.separator);
          }
        }, c.aggr.median = c.aggr.MEDIAN = function(e, r, t) {
          if (t === 2) return e !== null && r.push(e), r;
          if (t === 1) return e === null ? [] : [e];
          if (!r.length) return;
          let n = r.sort((a, f) => a > f ? 1 : a < f ? -1 : 0), i = (n.length + 1) / 2, s = i | 0, o = n[s - 1];
          return i === s || typeof o != "number" && !(o instanceof Number) ? o : (o + n[s]) / 2;
        }, c.aggr.QUART = function(e, r, t, n) {
          if (t === 2) return e !== null && r.push(e), r;
          if (t === 1) return e === null ? [] : [e];
          if (!r.length) return r;
          n = n || 1;
          var i = r.sort(function(o, a) {
            return o === a ? 0 : o > a ? 1 : -1;
          });
          let s = n * (i.length + 1) / 4;
          return Number.isInteger(s) ? i[s - 1] : i[Math.floor(s)];
        }, c.aggr.QUART2 = function(e, r, t) {
          return c.aggr.QUART(e, r, t, 2);
        }, c.aggr.QUART3 = function(e, r, t) {
          return c.aggr.QUART(e, r, t, 3);
        }, c.aggr.VAR = function(e, r, t) {
          return t === 1 ? e === null ? { sum: 0, sumSq: 0, count: 0 } : { sum: e, sumSq: e * e, count: 1 } : t === 2 ? (e !== null && (r.sum += e, r.sumSq += e * e, r.count++), r) : r.count > 1 ? (r.sumSq - r.sum * r.sum / r.count) / (r.count - 1) : 0;
        }, c.aggr.STDEV = function(e, r, t) {
          return t === 1 || t === 2 ? c.aggr.VAR(e, r, t) : Math.sqrt(c.aggr.VAR(e, r, t));
        }, c.aggr.STDEV = function(e, r, t) {
          return t === 1 || t === 2 ? c.aggr.VAR(e, r, t) : Math.sqrt(c.aggr.VAR(e, r, t));
        }, c.aggr.VARP = function(e, r, t) {
          if (t === 1) return { count: 1, sum: e, sumSq: e * e };
          if (t === 2) return r.count++, r.sum += e, r.sumSq += e * e, r;
          if (r.count > 0) {
            const n = r.sum / r.count;
            return r.sumSq / r.count - n * n;
          } else return 0;
        }, c.aggr.STD = c.aggr.STDDEV = c.aggr.STDEVP = function(e, r, t) {
          return t == 1 || t == 2 ? c.aggr.VARP(e, r, t) : Math.sqrt(c.aggr.VARP(e, r, t));
        }, c._aggrOriginal = c.aggr, c.aggr = {}, Object.keys(c._aggrOriginal).forEach(function(e) {
          c.aggr[e] = function(r, t, n) {
            if (!(n === 3 && typeof t > "u")) return c._aggrOriginal[e].apply(null, arguments);
          };
        }), Fe.REPLACE = function(e, r, t) {
          return String(e ?? "").split(String(r ?? "")).join(String(t ?? ""));
        };
        for (var i3 = [], qt = 0; qt < 256; qt++) i3[qt] = (qt < 16 ? "0" : "") + qt.toString(16);
        Fe.NEWID = Fe.UUID = Fe.GEN_RANDOM_UUID = function() {
          var e = Math.random() * 4294967295 | 0, r = Math.random() * 4294967295 | 0, t = Math.random() * 4294967295 | 0, n = Math.random() * 4294967295 | 0;
          return i3[e & 255] + i3[e >> 8 & 255] + i3[e >> 16 & 255] + i3[e >> 24 & 255] + "-" + i3[r & 255] + i3[r >> 8 & 255] + "-" + i3[r >> 16 & 15 | 64] + i3[r >> 24 & 255] + "-" + i3[t & 63 | 128] + i3[t >> 8 & 255] + "-" + i3[t >> 16 & 255] + i3[t >> 24 & 255] + i3[n & 255] + i3[n >> 8 & 255] + i3[n >> 16 & 255] + i3[n >> 24 & 255];
        }, S.CaseValue = function(e) {
          return Object.assign(this, e);
        }, S.CaseValue.prototype.toString = function() {
          var e = "CASE ";
          return this.expression && (e += this.expression.toString()), this.whens && (e += this.whens.map(function(r) {
            return " WHEN " + r.when.toString() + " THEN " + r.then.toString();
          }).join()), e += " END", e;
        }, S.CaseValue.prototype.findAggregator = function(e) {
          this.expression && this.expression.findAggregator && this.expression.findAggregator(e), this.whens && this.whens.length > 0 && this.whens.forEach(function(r) {
            r.when.findAggregator && r.when.findAggregator(e), r.then.findAggregator && r.then.findAggregator(e);
          }), this.elses && this.elses.findAggregator && this.elses.findAggregator(e);
        }, S.CaseValue.prototype.toJS = function(e, r, t) {
          let n = `(((${e}, params, alasql) => {
        let y, r;`;
          return this.expression ? (n += `let v = ${this.expression.toJS(e, r, t)};`, this.whens.forEach((i, s) => {
            const o = `v === ${i.when.toJS(e, r, t)}`, a = `r = ${i.then.toJS(e, r, t)}`;
            n += `${s === 0 ? "if" : " else if"} (${o}) { ${a}; }`;
          })) : this.whens.forEach((i, s) => {
            const o = i.when.toJS(e, r, t), a = `r = ${i.then.toJS(e, r, t)}`;
            n += `${s === 0 ? "if" : " else if"} (${o}) { ${a}; }`;
          }), this.elses && (n += ` else { r = ${this.elses.toJS(e, r, t)}; }`), n += "; return r; }))(" + e + ", params, alasql)", n;
        }, S.Json = function(e) {
          return Object.assign(this, e);
        }, S.Json.prototype.toString = function() {
          var e = "";
          return e += M2(this.value), e += "", e;
        };
        const M2 = c.utils.JSONtoString = function(e) {
          if (typeof e == "string") return `"${e}"`;
          if (typeof e == "number" || typeof e == "boolean") return String(e);
          if (typeof e == "bigint") return `${e.toString()}n`;
          if (Array.isArray(e)) return `[${e.map((r) => M2(r)).join(",")}]`;
          if (typeof e == "object") if (!e.toJS || e instanceof S.Json) {
            const r = [];
            for (const t in e) {
              const n = typeof t == "string" ? `"${t}"` : String(t), i = M2(e[t]);
              r.push(`${n}:${i}`);
            }
            return `{${r.join(",")}}`;
          } else {
            if (e.toString) return e.toString();
            throw new Error(`1: Cannot show JSON object ${JSON.stringify(e)}`);
          }
          else throw new Error(`2: Cannot show JSON object ${JSON.stringify(e)}`);
        };
        function Rn(e, r, t, n) {
          var i = "";
          if (typeof e == "string") i = '"' + e + '"';
          else if (typeof e == "number") i = "(" + e + ")";
          else if (typeof e == "boolean") i = e;
          else if (typeof e == "bigint") i = e.toString() + "n";
          else if (typeof e == "object") if (Array.isArray(e)) i += `[${e.map((s) => Rn(s, r, t, n)).join(",")}]`;
          else if (!e.toJS || e instanceof S.Json) {
            let s = [];
            for (const o in e) {
              let a = typeof o == "string" ? `"${o}"` : o.toString(), f = Rn(e[o], r, t, n);
              s.push(`${a}:${f}`);
            }
            i = `{${s.join(",")}}`;
          } else if (e.toJS) i = e.toJS(r, t, n);
          else throw new Error(`Cannot parse JSON object ${JSON.stringify(e)}`);
          else throw new Error("2Can not parse JSON object " + JSON.stringify(e));
          return i;
        }
        S.Json.prototype.toJS = function(e, r, t) {
          return Rn(this.value, e, r, t);
        }, S.Convert = function(e) {
          return Object.assign(this, e);
        }, S.Convert.prototype.toString = function() {
          var e = "CONVERT(";
          return e += this.dbtypeid, typeof this.dbsize < "u" && (e += "(" + this.dbsize, this.dbprecision && (e += "," + this.dbprecision), e += ")"), e += "," + this.expression.toString(), this.style && (e += "," + this.style), e += ")", e;
        }, S.Convert.prototype.toJS = function(e, r, t) {
          return `alasql.stdfn.CONVERT(${this.expression.toJS(e, r, t)}, {
        dbtypeid: "${this.dbtypeid}",
        dbsize: ${this.dbsize},
        dbprecision: ${this.dbprecision},
        style: ${this.style}
    })`;
        };
        function Zs(e) {
          var r = e.getMonth() + 1, t = e.getYear(), n = e.getFullYear(), i = e.getDate(), s = e.toString().substr(4, 3), o = ("0" + i).substr(-2), a = ("0" + r).substr(-2), f = ("0" + t).substr(-2), m = ("0" + e.getHours()).substr(-2), E = ("0" + e.getMinutes()).substr(-2), p = ("0" + e.getSeconds()).substr(-2), h = ("00" + e.getMilliseconds()).substr(-3);
          return { month: r, year: t, fullYear: n, date: i, day: s, formattedDate: o, formattedMonth: a, formattedYear: f, formattedHour: m, formattedMinutes: E, formattedSeconds: p, formattedMilliseconds: h };
        }
        c.stdfn.CONVERT = function(e, r) {
          var t = e, n = r.dbtypeid?.toUpperCase(), i, s;
          if ((r.style || r.dbtypeid == "Date" || ["DATE", "DATETIME", "DATETIME2"].indexOf(n) > -1) && (/\d{8}/.test(t) ? i = new Date(+t.substr(0, 4), +t.substr(4, 2) - 1, +t.substr(6, 2)) : i = a2(t), s = Zs(i)), r.style) switch (r.style) {
            case 1:
              t = s.formattedMonth + "/" + s.formattedDate + "/" + s.formattedYear;
              break;
            case 2:
              t = s.formattedYear + "." + s.formattedMonth + "." + s.formattedDate;
              break;
            case 3:
              t = s.formattedDate + "/" + s.formattedMonth + "/" + s.formattedYear;
              break;
            case 4:
              t = s.formattedDate + "." + s.formattedMonth + "." + s.formattedYear;
              break;
            case 5:
              t = s.formattedDate + "-" + s.formattedMonth + "-" + s.formattedYear;
              break;
            case 6:
              t = s.formattedDate + " " + s.day.toLowerCase() + " " + s.formattedYear;
              break;
            case 7:
              t = s.day + " " + s.formattedDate + "," + s.formattedYear;
              break;
            case 8:
            case 108:
              t = s.formattedHour + ":" + s.formattedMinutes + ":" + s.formattedSeconds;
              break;
            case 10:
              t = s.formattedMonth + "-" + s.formattedDate + "-" + s.formattedYear;
              break;
            case 11:
              t = s.formattedYear + "/" + s.formattedMonth + "/" + s.formattedDate;
              break;
            case 12:
              t = s.formattedYear + s.formattedMonth + s.formattedDate;
              break;
            case 101:
              t = s.formattedMonth + "/" + s.formattedDate + "/" + s.fullYear;
              break;
            case 102:
              t = s.fullYear + "." + s.formattedMonth + "." + s.formattedDate;
              break;
            case 103:
              t = s.formattedDate + "/" + s.formattedMonth + "/" + s.fullYear;
              break;
            case 104:
              t = s.formattedDate + "." + s.formattedMonth + "." + s.fullYear;
              break;
            case 105:
              t = s.formattedDate + "-" + s.formattedMonth + "-" + s.fullYear;
              break;
            case 106:
              t = s.formattedDate + " " + s.day.toLowerCase() + " " + s.fullYear;
              break;
            case 107:
              t = s.day + " " + s.formattedDate + "," + s.fullYear;
              break;
            case 110:
              t = s.formattedMonth + "-" + s.formattedDate + "-" + s.fullYear;
              break;
            case 111:
              t = s.fullYear + "/" + s.formattedMonth + "/" + s.formattedDate;
              break;
            case 112:
              t = s.fullYear + s.formattedMonth + s.formattedDate;
              break;
            default:
              throw new Error("The CONVERT style " + r.style + " is not realized yet.");
          }
          switch (n) {
            case "DATE":
              return `${s.formattedYear}.${s.formattedMonth}.${s.formattedDate}`;
            case "DATETIME":
            case "DATETIME2":
              return `${s.fullYear}.${s.formattedMonth}.${s.formattedDate} ${s.formattedHour}:${s.formattedMinutes}:${s.formattedSeconds}.${s.formattedMilliseconds}`;
            case "MONEY":
              var o = +t;
              return (o | 0) + o * 100 % 100 / 100;
            case "BOOLEAN":
              return !!t;
            case "INT":
            case "INTEGER":
            case "SMALLINT":
            case "BIGINT":
            case "SERIAL":
            case "SMALLSERIAL":
            case "BIGSERIAL":
              return t | 0;
            case "STRING":
            case "VARCHAR":
            case "NVARCHAR":
            case "CHARACTER VARIABLE":
              return r.dbsize ? String(t).substr(0, r.dbsize) : String(t);
            case "CHAR":
            case "CHARACTER":
            case "NCHAR":
              return (t + " ".repeat(r.dbsize)).substr(0, r.dbsize);
            case "NUMBER":
            case "FLOAT":
            case "DECIMAL":
            case "NUMERIC":
              var o = +t;
              return r.dbsize !== void 0 && (o = parseFloat(o.toPrecision(r.dbsize))), r.dbprecision !== void 0 && (o = parseFloat(o.toFixed(r.dbprecision))), o;
            case "JSON":
              if (typeof t == "object") return t;
              try {
                return JSON.parse(t);
              } catch {
                throw new Error("Cannot convert string to JSON");
              }
            case "Date":
              return t;
            default:
              return t;
          }
        }, S.ColumnDef = function(e) {
          return Object.assign(this, e);
        }, S.ColumnDef.prototype.toString = function() {
          let e = this.columnid;
          return this.dbtypeid && (e += " " + this.dbtypeid), this.dbsize && (e += "(" + this.dbsize, this.dbprecision && (e += "," + this.dbprecision), e += ")"), this.primarykey && (e += " PRIMARY KEY"), this.notnull && (e += " NOT NULL"), e;
        }, S.CreateTable = function(e) {
          return Object.assign(this, e);
        }, S.CreateTable.prototype.toString = function() {
          let e = `CREATE${this.temporary ? " TEMPORARY" : ""}${this.view ? " VIEW" : ` ${this.class ? "CLASS" : "TABLE"}`}${this.ifnotexists ? " IF NOT EXISTS" : ""} ${this.table.toString()}`;
          return this.viewcolumns && (e += `(${this.viewcolumns.map((r) => r.toString()).join(",")})`), this.as ? e += ` AS ${this.as}` : e += ` (${this.columns.map((r) => r.toString()).join(",")})`, this.view && this.select && (e += ` AS ${this.select.toString()}`), e;
        }, S.CreateTable.prototype.execute = function(e, r, t) {
          var n = c.databases[this.table.databaseid || e], i = this.table.tableid;
          if (!i) throw new Error("Table name is not defined");
          var s = this.columns, o = this.constraints || [];
          if (this.ifnotexists && n.tables[i]) return t ? t(0) : 0;
          if (n.tables[i]) throw new Error("Can not create table '" + i + "', because it already exists in the database '" + n.databaseid + "'");
          var a = n.tables[i] = new c.Table();
          this.class && (a.isclass = true);
          var f = [], m = [];
          if (s && s.forEach(function(h) {
            var g = h.dbtypeid;
            c.fn[g] || (g = g.toUpperCase()), ["SERIAL", "SMALLSERIAL", "BIGSERIAL"].indexOf(g) > -1 && (h.identity = { value: 1, step: 1 });
            var O = { columnid: h.columnid, dbtypeid: g, dbsize: h.dbsize, dbprecision: h.dbprecision, notnull: h.notnull, identity: h.identity };
            if (h.identity && (a.identities[h.columnid] = { value: +h.identity.value, step: +h.identity.step }), h.check && a.checks.push({ id: h.check.constrantid, fn: new Function("r,params,alasql", "var y;return " + h.check.expression.toJS("r", "")) }), h.default && f.push(JSON.stringify("" + h.columnid) + ":" + h.default.toJS("r", "")), h.primarykey) {
              var T = a.pk = {};
              T.columns = [h.columnid], T.onrightfns = `r[${JSON.stringify(h.columnid)}]`, T.onrightfn = new Function("r", "var y;return " + T.onrightfns), T.hh = d2(T.onrightfns), a.uniqs[T.hh] = {};
            }
            if (h.unique) {
              var v = {};
              a.uk = a.uk || [], a.uk.push(v), v.columns = [h.columnid], v.onrightfns = `r[${JSON.stringify(h.columnid)}]`, v.onrightfn = new Function("r", "var y;return " + v.onrightfns), v.hh = d2(v.onrightfns), a.uniqs[v.hh] = {};
            }
            if (h.foreignkey) {
              var N = h.foreignkey.table, b = c.databases[N.databaseid || e].tables[N.tableid];
              if (typeof N.columnid > "u") if (b.pk.columns && b.pk.columns.length > 0) N.columnid = b.pk.columns[0];
              else throw new Error("FOREIGN KEY allowed only to tables with PRIMARY KEYs");
              O.foreignkey = { tableid: N.tableid, columnid: N.columnid };
              var L = function(C) {
                var a1 = {}, r1 = C[h.columnid];
                if (r1 != null && !(typeof r1 == "number" && isNaN(r1))) {
                  a1[N.columnid] = r1;
                  var H = b.pk.onrightfn(a1);
                  if (!b.uniqs[b.pk.hh][H]) throw new Error('Foreign key "' + r1 + '" not found in table "' + N.tableid + '"');
                }
                return true;
              };
              a.checks.push({ fn: L, fk: true });
            }
            h.onupdate && m.push(`r[${JSON.stringify(h.columnid)}]=` + h.onupdate.toJS("r", "")), a.columns.push(O), a.xcolumns[O.columnid] = O;
          }), a.defaultfns = f.join(","), a.onupdatefns = m.join(";"), o.forEach(function(h) {
            var g;
            if (h.type === "PRIMARY KEY") {
              if (a.pk) throw new Error("Primary key already exists");
              var O = a.pk = {};
              O.columns = h.columns, O.onrightfns = O.columns.map(function(b) {
                return `r[${JSON.stringify(b)}]`;
              }).join("+'`'+"), O.onrightfn = new Function("r", "var y;return " + O.onrightfns), O.hh = d2(O.onrightfns), a.uniqs[O.hh] = {}, O.columns.forEach(function(b) {
                a.xcolumns[b] && (a.xcolumns[b].primarykey = true);
              });
            } else if (h.type === "CHECK") g = new Function("r,params,alasql", "var y;return " + h.expression.toJS("r", ""));
            else if (h.type === "UNIQUE") {
              var T = {};
              a.uk = a.uk || [], a.uk.push(T), T.columns = h.columns, T.onrightfns = T.columns.map(function(b) {
                return b.expression.toJS("r", "");
              }).join("+'`'+"), T.onrightfn = new Function("r", "var y;return " + T.onrightfns), T.hh = d2(T.onrightfns), a.uniqs[T.hh] = {};
            } else if (h.type === "FOREIGN KEY") {
              var v = h.fktable;
              h.fkcolumns && h.fkcolumns.length > 0 && (v.fkcolumns = h.fkcolumns);
              var N = c.databases[v.databaseid || e].tables[v.tableid];
              if (typeof v.fkcolumns > "u" && (v.fkcolumns = N.pk.columns), v.columns = h.columns, v.fkcolumns.length > v.columns.length) throw new Error("Invalid foreign key on table " + a.tableid);
              v.columns.forEach(function(b, L) {
                a.xcolumns[b] && (a.xcolumns[b].foreignkey = { tableid: v.tableid, columnid: v.fkcolumns[L], constraintid: h.constraintid });
              }), g = function(b) {
                var L = {};
                if (v.fkcolumns.forEach(function(H, C1) {
                  var k1 = b[v.columns[C1]];
                  k1 != null && !(typeof k1 == "number" && isNaN(k1)) && (L[H] = k1);
                }), Object.keys(L).length === 0) return true;
                if (Object.keys(L).length !== v.columns.length) throw new Error("Invalid foreign key on table " + a.tableid);
                var C = c.databases[v.databaseid || e].tables[v.tableid], a1 = C.pk.onrightfn(L);
                if (!C.uniqs[C.pk.hh][a1]) {
                  var r1 = v.columns.map(function(H) {
                    return b[H];
                  });
                  throw new Error('Foreign key "' + r1.join(", ") + '" not found in table "' + v.tableid + '"');
                }
                return true;
              };
            }
            g && a.checks.push({ fn: g, id: h.constraintid, fk: h.type === "FOREIGN KEY" });
          }), this.view && this.viewcolumns) {
            var E = this;
            this.viewcolumns.forEach(function(h, g) {
              E.select.columns[g].as = h.columnid;
            });
          }
          if (this.view && this.select && (a.view = true, a.viewSelect = this.select, a.viewDatabaseid = this.table.databaseid || e), n.engineid) return c.engines[n.engineid].createTable(this.table.databaseid || e, i, this.ifnotexists, t);
          a.insert = function(h, g, O) {
            var T = c.inserted;
            c.inserted = [h];
            var v = this;
            g && O && (O = false);
            var N = false, b = false;
            for (var L in v.beforeinsert) {
              var C = v.beforeinsert[L];
              C && c.executeTrigger(C, e, h) === false && (b = b || true);
            }
            if (!b) {
              var a1 = false;
              for (L in v.insteadofinsert) a1 = true, C = v.insteadofinsert[L], C && c.executeTrigger(C, e, h);
              if (!a1) {
                for (var r1 in v.identities) {
                  var H = v.identities[r1];
                  (typeof h[r1] > "u" || h[r1] === null) && (h[r1] = H.value);
                }
                if (v.checks && v.checks.length > 0 && v.checks.forEach(function(K1) {
                  if (K1.fn(h, {}, c) === false) throw new Error("Violation of CHECK constraint " + (K1.id || ""));
                }), v.columns.forEach(function(K1) {
                  if (K1.notnull && typeof h[K1.columnid] > "u") throw new Error("Wrong NULL value in NOT NULL column " + K1.columnid);
                }), v.pk) {
                  var C1 = v.pk, k1 = C1.onrightfn(h);
                  if (typeof v.uniqs[C1.hh][k1] < "u") if (g) N = v.uniqs[C1.hh][k1];
                  else {
                    if (O) return c.inserted = T, false;
                    throw new Error("Cannot insert record, because it already exists in primary key index");
                  }
                }
                if (v.uk && v.uk.length) for (var V1 = 0; V1 < v.uk.length; V1++) {
                  var J1 = v.uk[V1], R = J1.onrightfn(h);
                  if (typeof v.uniqs[J1.hh][R] < "u") if (g) N = v.uniqs[J1.hh][R];
                  else {
                    if (O) return c.inserted = T, false;
                    throw new Error("Cannot insert record, because it already exists in unique index");
                  }
                }
                if (N) v.update(function(K1) {
                  for (var Se in h) K1[Se] = h[Se];
                }, v.data.indexOf(N), r);
                else {
                  v.data.push(h);
                  for (var r1 in v.identities) {
                    var H = v.identities[r1];
                    typeof h[r1] < "u" && h[r1] !== null && +h[r1] >= H.value ? H.value = +h[r1] + H.step : H.value += H.step;
                  }
                  if (v.pk) {
                    var C1 = v.pk, k1 = C1.onrightfn(h);
                    v.uniqs[C1.hh][k1] = h;
                  }
                  if (v.uk && v.uk.length && v.uk.forEach(function(K1) {
                    var Se = K1.onrightfn(h);
                    v.uniqs[K1.hh][Se] = h;
                  }), v.inddefs) for (var U1 in v.inddefs) {
                    var ee = v.inddefs[U1], _1 = ee.hh;
                    if (v.indices[_1]) {
                      var k1 = new Function("r,params,alasql", "return " + ee.rightfns)(h, r, c);
                      v.indices[_1][k1] || (v.indices[_1][k1] = []), v.indices[_1][k1].push(h);
                    }
                  }
                }
                for (var L in v.afterinsert) {
                  var C = v.afterinsert[L];
                  C && c.executeTrigger(C, e, h);
                }
                c.inserted = T;
              }
            }
          }, a.delete = function(h) {
            var g = this, O = g.data[h], T = false;
            for (var v in g.beforedelete) {
              var N = g.beforedelete[v];
              N && c.executeTrigger(N, e, O) === false && (T = T || true);
            }
            if (T) return false;
            var b = false;
            for (var v in g.insteadofdelete) {
              b = true;
              var N = g.insteadofdelete[v];
              N && c.executeTrigger(N, e, O);
            }
            if (!b) {
              if (this.pk) {
                var L = this.pk, C = L.onrightfn(O);
                if (typeof this.uniqs[L.hh][C] > "u") throw new Error("Something wrong with primary key index on table");
                this.uniqs[L.hh][C] = void 0;
              }
              g.uk && g.uk.length && g.uk.forEach(function(a1) {
                var r1 = a1.onrightfn(O);
                if (typeof g.uniqs[a1.hh][r1] > "u") throw new Error("Something wrong with unique index on table");
                g.uniqs[a1.hh][r1] = void 0;
              });
            }
          }, a.deleteall = function() {
            this.data.length = 0, this.pk && (this.uniqs[this.pk.hh] = {}), a.uk && a.uk.length && a.uk.forEach(function(h) {
              a.uniqs[h.hh] = {};
            });
          }, a.update = function(h, g, O) {
            var T = N2(this.data[g]), v;
            if (this.pk && (v = this.pk, v.pkaddr = v.onrightfn(T, O), typeof this.uniqs[v.hh][v.pkaddr] > "u")) {
              this.uniqs[v.hh] = {};
              for (var N = 0; N < this.data.length; N++) {
                var b = v.onrightfn(this.data[N]);
                this.uniqs[v.hh][b] = this.data[N];
              }
              v.pkaddr = v.onrightfn(T, O);
            }
            a.uk && a.uk.length && a.uk.forEach(function(H) {
              if (H.ukaddr = H.onrightfn(T), typeof a.uniqs[H.hh][H.ukaddr] > "u") {
                a.uniqs[H.hh] = {};
                for (var C1 = 0; C1 < a.data.length; C1++) {
                  var k1 = H.onrightfn(a.data[C1]);
                  a.uniqs[H.hh][k1] = a.data[C1];
                }
                H.ukaddr = H.onrightfn(T);
              }
            }), h(T, O, c);
            var L = false;
            for (var C in a.beforeupdate) {
              var a1 = a.beforeupdate[C];
              a1 && c.executeTrigger(a1, e, this.data[g], T) === false && (L = L || true);
            }
            if (L) return false;
            var r1 = false;
            for (var C in a.insteadofupdate) {
              r1 = true;
              var a1 = a.insteadofupdate[C];
              a1 && c.executeTrigger(a1, e, this.data[g], T);
            }
            if (!r1) {
              if (a.checks && a.checks.length > 0 && a.checks.forEach(function(H) {
                if (H.fn(T, O, c) === false) throw new Error("Violation of CHECK constraint " + (H.id || ""));
              }), a.columns.forEach(function(H) {
                if (H.notnull && typeof T[H.columnid] > "u") throw new Error("Wrong NULL value in NOT NULL column " + H.columnid);
              }), this.pk && (v.newpkaddr = v.onrightfn(T), typeof this.uniqs[v.hh][v.newpkaddr] < "u" && v.newpkaddr !== v.pkaddr)) throw new Error("Record already exists");
              a.uk && a.uk.length && a.uk.forEach(function(H) {
                if (H.newukaddr = H.onrightfn(T), typeof a.uniqs[H.hh][H.newukaddr] < "u" && H.newukaddr !== H.ukaddr) throw new Error("Record already exists");
              }), this.pk && (this.uniqs[v.hh][v.pkaddr] = void 0, this.uniqs[v.hh][v.newpkaddr] = T), a.uk && a.uk.length && a.uk.forEach(function(H) {
                a.uniqs[H.hh][H.ukaddr] = void 0, a.uniqs[H.hh][H.newukaddr] = T;
              }), this.data[g] = T;
              for (var C in a.afterupdate) {
                var a1 = a.afterupdate[C];
                a1 && c.executeTrigger(a1, e, this.data[g], T);
              }
            }
          };
          var p;
          return c.options.nocount || (p = 1), t && (p = t(p)), p;
        }, c.fn.Date = Object, c.fn.Date = Date, c.fn.Number = Number, c.fn.String = String, c.fn.Boolean = Boolean, Fe.EXTEND = c.utils.extend, Fe.CHAR = String.fromCharCode.bind(String), Fe.ASCII = function(e) {
          return e.charCodeAt(0);
        }, Fe.COALESCE = function() {
          for (var e = 0; e < arguments.length; e++) if (arguments[e] !== null && !(typeof arguments[e] > "u") && !(typeof arguments[e] == "number" && isNaN(arguments[e]))) return arguments[e];
        }, Fe.USER = function() {
          return "alasql";
        }, Fe.OBJECT_ID = function(e) {
          return !!c.tables[e];
        }, Fe.DATE = function(e) {
          return !isNaN(e) && e.length === 8 ? new Date(+e.substr(0, 4), +e.substr(4, 2) - 1, +e.substr(6, 2)) : a2(e);
        }, Fe.NOW = function() {
          if (c.options.dateAsString) {
            var e = /* @__PURE__ */ new Date(), r = e.getFullYear() + "-" + ("0" + (e.getMonth() + 1)).substr(-2) + "-" + ("0" + e.getDate()).substr(-2);
            return r += " " + ("0" + e.getHours()).substr(-2) + ":" + ("0" + e.getMinutes()).substr(-2) + ":" + ("0" + e.getSeconds()).substr(-2), r += "." + ("00" + e.getMilliseconds()).substr(-3), r;
          }
          return /* @__PURE__ */ new Date();
        }, Fe.GETDATE = Fe.NOW, Fe.CURRENT_TIMESTAMP = Fe.NOW, Fe.CURDATE = Fe.CURRENT_DATE = function() {
          var e = /* @__PURE__ */ new Date();
          if (e.setHours(0, 0, 0, 0), c.options.dateAsString) {
            var r = e.getFullYear() + "-" + ("0" + (e.getMonth() + 1)).substr(-2) + "-" + ("0" + e.getDate()).substr(-2);
            return r;
          }
          return e;
        }, Fe.SECOND = function(r) {
          var r = a2(r);
          return r.getSeconds();
        }, Fe.MINUTE = function(r) {
          var r = a2(r);
          return r.getMinutes();
        }, Fe.HOUR = function(r) {
          var r = a2(r);
          return r.getHours();
        }, Fe.DAYOFWEEK = Fe.WEEKDAY = function(r) {
          var r = a2(r);
          return r.getDay();
        }, Fe.DAY = Fe.DAYOFMONTH = function(r) {
          var r = a2(r);
          return r.getDate();
        }, Fe.MONTH = function(r) {
          var r = a2(r);
          return r.getMonth() + 1;
        }, Fe.YEAR = function(r) {
          var r = a2(r);
          return r.getFullYear();
        };
        var lr = { year: 1e3 * 3600 * 24 * 365, quarter: 1e3 * 3600 * 24 * 365 / 4, month: 1e3 * 3600 * 24 * 30, week: 1e3 * 3600 * 24 * 7, day: 1e3 * 3600 * 24, dayofyear: 1e3 * 3600 * 24, weekday: 1e3 * 3600 * 24, hour: 1e3 * 3600, minute: 1e3 * 60, second: 1e3, millisecond: 1, microsecond: 1e-3 };
        c.stdfn.DATEDIFF = function(e, r, t) {
          var n = a2(t).getTime() - a2(r).getTime();
          return n / lr[e.toLowerCase()] | 0;
        }, c.stdfn.DATEADD = function(i, r, t) {
          var n = a2(t), i = i.toLowerCase();
          switch (i) {
            case "year":
              n.setFullYear(n.getFullYear() + r);
              break;
            case "quarter":
              n.setMonth(n.getMonth() + r * 3);
              break;
            case "month":
              n.setMonth(n.getMonth() + r);
              break;
            default:
              n = new Date(n.getTime() + r * lr[i]);
              break;
          }
          return n;
        }, c.stdfn.INTERVAL = function(e, r) {
          return e * lr[r.toLowerCase()];
        }, c.stdfn.DATE_ADD = c.stdfn.ADDDATE = function(e, r) {
          var t = a2(e).getTime() + r;
          return new Date(t);
        }, c.stdfn.DATE_SUB = c.stdfn.SUBDATE = function(e, r) {
          var t = a2(e).getTime() - r;
          return new Date(t);
        };
        var $s = /^\d{4}\.\d{2}\.\d{2} \d{2}:\d{2}:\d{2}/;
        function a2(e) {
          return typeof e == "string" && $s.test(e) && (e = e.replace(".", "-").replace(".", "-")), new Date(e);
        }
        S.DropTable = function(e) {
          return Object.assign(this, e);
        }, S.DropTable.prototype.toString = function() {
          var e = "DROP ";
          return this.view ? e += "VIEW" : e += "TABLE", this.ifexists && (e += " IF EXISTS"), e += " " + this.tables.toString(), e;
        }, S.DropTable.prototype.execute = function(e, r, t) {
          var n = this.ifexists, i = 0, s = 0, o = this.tables.length;
          return this.tables.forEach(function(a) {
            var f = c.databases[a.databaseid || e], m = a.tableid;
            if (!n || n && f.tables[m]) {
              if (f.tables[m]) f.engineid ? c.engines[f.engineid].dropTable(a.databaseid || e, m, n, function(E) {
                delete f.tables[m], i += E, s++, s == o && t && t(i);
              }) : (delete f.tables[m], i++, s++, s == o && t && t(i));
              else if (!c.options.dropifnotexists) throw new Error(`Can not drop table ${JSON.stringify(a.tableid)} because it does not exist in the database.`);
            } else s++, s == o && t && t(i);
          }), i;
        }, S.TruncateTable = function(e) {
          return Object.assign(this, e);
        }, S.TruncateTable.prototype.toString = function() {
          var e = "TRUNCATE TABLE";
          return e += " " + this.table.toString(), e;
        }, S.TruncateTable.prototype.execute = function(e, r, t) {
          var n = c.databases[this.table.databaseid || e], i = this.table.tableid;
          if (n.engineid) return c.engines[n.engineid].truncateTable(this.table.databaseid || e, i, this.ifexists, t);
          if (n.tables[i]) n.tables[i].data = [];
          else throw new Error("Cannot truncate table becaues it does not exist");
          return t ? t(0) : 0;
        }, S.CreateVertex = function(e) {
          return Object.assign(this, e);
        }, S.CreateVertex.prototype.toString = function() {
          var e = "CREATE VERTEX ";
          return this.class && (e += this.class + " "), this.sharp && (e += "#" + this.sharp + " "), this.sets ? e += this.sets.toString() : this.content ? e += this.content.toString() : this.select && (e += this.select.toString()), e;
        }, S.CreateVertex.prototype.toJS = function(e) {
          var r = "this.queriesfn[" + (this.queriesidx - 1) + "](this.params,null," + e + ")";
          return r;
        }, S.CreateVertex.prototype.compile = function(e) {
          var r = e, t = this.sharp;
          if (typeof this.name < "u") var n = "x.name=" + this.name.toJS(), i = new Function("x", n);
          if (this.sets && this.sets.length > 0) var n = this.sets.map(function(f) {
            return `x[${JSON.stringify(f.column.columnid)}]=` + f.expression.toJS("x", "");
          }).join(";"), s = new Function("x,params,alasql", n);
          var o = function(a, f) {
            var m, E = c.databases[r], p;
            typeof t < "u" ? p = t : p = E.counter++;
            var h = { $id: p, $node: "VERTEX" };
            return E.objects[h.$id] = h, m = h, i && i(h), s && s(h, a, c), f && (m = f(m)), m;
          };
          return o;
        }, S.CreateEdge = function(e) {
          return Object.assign(this, e);
        }, S.CreateEdge.prototype.toString = function() {
          var e = "CREATE EDGE ";
          return this.class && (e += this.class + " "), e;
        }, S.CreateEdge.prototype.toJS = function(e) {
          var r = "this.queriesfn[" + (this.queriesidx - 1) + "](this.params,null," + e + ")";
          return r;
        }, S.CreateEdge.prototype.compile = function(e) {
          var r = e, t = new Function("params,alasql", "var y;return " + this.from.toJS()), n = new Function("params,alasql", "var y;return " + this.to.toJS());
          if (typeof this.name < "u") var i = "x.name=" + this.name.toJS(), s = new Function("x", i);
          if (this.sets && this.sets.length > 0) var i = this.sets.map(function(m) {
            return `x[${JSON.stringify(m.column.columnid)}]=` + m.expression.toJS("x", "");
          }).join(";"), o = new Function("x,params,alasql", "var y;" + i);
          return (f, m) => {
            let E = 0, p = c.databases[r], h = { $id: p.counter++, $node: "EDGE" }, g = t(f, c), O = n(f, c);
            return h.$in = [g.$id], h.$out = [O.$id], g.$out = g.$out || [], g.$out.push(h.$id), O.$in = O.$in || [], O.$in.push(h.$id), p.objects[h.$id] = h, E = h, s?.(h), o?.(h, f, c), m ? m(E) : E;
          };
        }, S.CreateGraph = function(e) {
          return Object.assign(this, e);
        }, S.CreateGraph.prototype.toString = function() {
          var e = "CREATE GRAPH ";
          return this.class && (e += this.class + " "), e;
        }, S.CreateGraph.prototype.execute = function(e, r, t) {
          var n = [];
          return this.from && c.from[this.from.funcid] && (this.graph = c.from[this.from.funcid.toUpperCase()]), this.graph.forEach((o) => {
            if (!o.source) s(o);
            else {
              let a = {};
              o.as !== void 0 && (c.vars[o.as] = a), o.prop !== void 0 && (a.name = o.prop), o.sharp !== void 0 && (a.$id = o.sharp), o.name !== void 0 && (a.name = o.name), o.class !== void 0 && (a.$class = o.class);
              let f = c.databases[e];
              a.$id = a.$id !== void 0 ? a.$id : f.counter++, a.$node = "EDGE", o.json !== void 0 && Object.assign(a, new Function("params, alasql", `return ${o.json.toJS()}`)(r, c));
              const m = (h, g) => {
                let O, T;
                if (h.vars) T = c.vars[h.vars], O = typeof T == "object" ? T : f.objects[T];
                else {
                  let v = h.sharp || h.prop;
                  O = f.objects[v], O === void 0 && c.options.autovertex && (h.prop || h.name) && (O = i(h.prop || h.name) || s(h));
                }
                return g && O && typeof O.$out > "u" && (O.$out = []), !g && O && typeof O.$in > "u" && (O.$in = []), O;
              };
              let E = m(o.source, true), p = m(o.target, false);
              if (a.$in = [E.$id], a.$out = [p.$id], E.$out.push(a.$id), p.$in.push(a.$id), f.objects[a.$id] = a, a.$class !== void 0) {
                let h = c.databases[e].tables[a.$class];
                if (h === void 0) throw new Error("No such class. Please use CREATE CLASS");
                h.data.push(a);
              }
              n.push(a.$id);
            }
          }), t && (n = t(n)), n;
          function i(o) {
            var a = c.databases[c.useid].objects;
            for (var f in a) if (a[f].name === o) return a[f];
          }
          function s(o) {
            var a = {};
            typeof o.as < "u" && (c.vars[o.as] = a), typeof o.prop < "u" && (a.$id = o.prop, a.name = o.prop), typeof o.sharp < "u" && (a.$id = o.sharp), typeof o.name < "u" && (a.name = o.name), typeof o.class < "u" && (a.$class = o.class);
            var f = c.databases[e];
            if (typeof a.$id > "u" && (a.$id = f.counter++), a.$node = "VERTEX", typeof o.json < "u" && Be(a, new Function("params,alasql", "var y;return " + o.json.toJS())(r, c)), f.objects[a.$id] = a, typeof a.$class < "u") {
              if (typeof c.databases[e].tables[a.$class] > "u") throw new Error("No such class. Pleace use CREATE CLASS");
              c.databases[e].tables[a.$class].data.push(a);
            }
            return n.push(a.$id), a;
          }
        }, S.CreateGraph.prototype.compile1 = function(e) {
          const r = e, t = new Function("params, alasql", `return ${this.from.toJS()}`), n = new Function("params, alasql", `return ${this.to.toJS()}`);
          let i, s;
          if (this.name !== void 0) {
            const a = `x.name = ${this.name.toJS()}`;
            i = new Function("x", a);
          }
          if (this.sets && this.sets.length > 0) {
            const a = this.sets.map((f) => `x[${JSON.stringify(f.column.columnid)}] = ${f.expression.toJS("x", "")}`).join(";");
            s = new Function("x, params, alasql", `var y; ${a}`);
          }
          return (a, f) => {
            let m = 0;
            const E = c.databases[r], p = { $id: E.counter++, $node: "EDGE" }, h = t(a, c), g = n(a, c);
            return p.$in = [h.$id], p.$out = [g.$id], h.$out = h.$out || [], h.$out.push(p.$id), g.$in = g.$in || [], g.$in.push(p.$id), E.objects[p.$id] = p, m = p, i && i(p), s && s(p, a, c), f && (m = f(m)), m;
          };
        }, S.AlterTable = function(e) {
          return Object.assign(this, e);
        }, S.AlterTable.prototype.toString = function() {
          let e = "ALTER TABLE " + this.table.toString();
          return this.renameto && (e += " RENAME TO " + this.renameto), e;
        }, S.AlterTable.prototype.execute = function(e, r, t) {
          let n = c.databases[e];
          if (n.dbversion = Date.now(), this.renameto) {
            var i = this.table.tableid, s = this.renameto, o = 1;
            if (n.tables[s]) throw new Error(`Can not rename a table "${i}" to "${s}" because the table with this name already exists`);
            if (s === i) throw new Error(`Can not rename a table "${i}" to itself`);
            return n.tables[s] = n.tables[i], delete n.tables[i], o = 1, t && t(o), o;
          }
          if (this.addcolumn) {
            n = c.databases[this.table.databaseid || e], n.dbversion++;
            var a = this.table.tableid, f = n.tables[a], m = this.addcolumn.columnid;
            if (f.xcolumns[m]) throw new Error(`Cannot add column "${m}" because it already exists in table "${a}"`);
            var E = { columnid: m, dbtypeid: this.addcolumn.dbtypeid, dbsize: this.dbsize, dbprecision: this.dbprecision, dbenum: this.dbenum, defaultfns: null }, p = function() {
            };
            f.columns.push(E), f.xcolumns[m] = E;
            for (let N = 0, b = f.data.length; N < b; N++) f.data[N][m] = p();
            return t ? t(1) : 1;
          }
          if (this.modifycolumn) {
            let N = c.databases[this.table.databaseid || e];
            N.dbversion++;
            var a = this.table.tableid, f = N.tables[a], m = this.modifycolumn.columnid;
            if (!f.xcolumns[m]) throw new Error(`Cannot modify column "${m}" because it was not found in table "${a}"`);
            return E = f.xcolumns[m], E.dbtypeid = this.dbtypeid, E.dbsize = this.dbsize, E.dbprecision = this.dbprecision, E.dbenum = this.dbenum, t ? t(1) : 1;
          }
          if (this.renamecolumn) {
            let N = c.databases[this.table.databaseid || e];
            N.dbversion++;
            var a = this.table.tableid, f = N.tables[a], m = this.renamecolumn, h = this.to, E;
            if (!f.xcolumns[m]) throw new Error('Column "' + m + '" is not found in the table "' + a + '"');
            if (f.xcolumns[h]) throw new Error('Column "' + h + '" already exists in the table "' + a + '"');
            if (m != h) {
              for (var g = 0; g < f.columns.length; g++) f.columns[g].columnid == m && (f.columns[g].columnid = h);
              f.xcolumns[h] = f.xcolumns[m], delete f.xcolumns[m];
              for (var O = 0, T = f.data.length; O < T; O++) f.data[O][h] = f.data[O][m], delete f.data[O][m];
              return f.data.length;
            }
            return t ? t(0) : 0;
          }
          if (this.dropcolumn) {
            let N = c.databases[this.table.databaseid || e];
            N.dbversion++;
            for (var a = this.table.tableid, f = N.tables[a], m = this.dropcolumn, v = false, g = 0; g < f.columns.length; g++) if (f.columns[g].columnid == m) {
              v = true, f.columns.splice(g, 1);
              break;
            }
            if (!v) throw new Error(`Cannot drop column "${m}" because it was not found in the table ${a}"`);
            for (delete f.xcolumns[m], O = 0, T = f.data.length; O < T; O++) delete f.data[O][m];
            return t ? t(f.data.length) : f.data.length;
          }
          throw Error("Unknown ALTER TABLE method");
        }, S.CreateIndex = function(e) {
          return Object.assign(this, e);
        }, S.CreateIndex.prototype.toString = function() {
          var e = "CREATE";
          return this.unique && (e += " UNIQUE"), e += " INDEX " + this.indexid + " ON " + this.table.toString(), e += "(" + this.columns.toString() + ")", e;
        }, S.CreateIndex.prototype.execute = function(e, r, t) {
          var n = c.databases[this.table.databaseid || e], i = this.table.tableid, s = n.tables[i], o = this.indexid;
          n.indices[o] = i;
          var a = this.columns.map(function(v) {
            return v.expression.toJS("r", "");
          }).join("+'`'+"), f = new Function("r,params,alasql", "return " + a);
          if (this.unique) {
            var m = {};
            if (s.uk = s.uk || [], s.uk.push(m), m.columns = this.columns, m.onrightfns = a, m.onrightfn = f, m.hh = d2(a), s.uniqdefs[o] = { rightfns: a, hh: m.hh }, s.uniqs[m.hh] = {}, s.data.length > 0) for (var E = 0, p = s.data.length; E < p; E++) {
              var h = f(s.data[E], r, c);
              if (typeof s.uniqs[m.hh][h] < "u") throw new Error("Cannot create unique index with duplicate values");
              s.uniqs[m.hh][h] = s.data[E];
            }
          } else {
            var g = d2(a);
            s.inddefs[o] = { rightfns: a, hh: g }, s.indices[g] = {};
            var O = s.indices[g] = {};
            if (s.data.length > 0) for (var E = 0, p = s.data.length; E < p; E++) {
              var h = f(s.data[E], r, c);
              O[h] || (O[h] = []), O[h].push(s.data[E]);
            }
          }
          var T = 1;
          return t && (T = t(T)), T;
        }, S.Reindex = function(e) {
          return Object.assign(this, e);
        }, S.Reindex.prototype.toString = function() {
          var e = "REINDEX " + this.indexid;
          return e;
        }, S.Reindex.prototype.execute = function(e, r, t) {
          var n = c.databases[e], i = this.indexid, s = n.indices[i], o = n.tables[s];
          o.indexColumns();
          var a = 1;
          return t && (a = t(a)), a;
        }, S.DropIndex = function(e) {
          return Object.assign(this, e);
        }, S.DropIndex.prototype.toString = function() {
          return "DROP INDEX" + this.indexid;
        }, S.DropIndex.prototype.compile = function(e) {
          var r = this.indexid;
          return function() {
            return 1;
          };
        }, S.WithSelect = function(e) {
          return Object.assign(this, e);
        }, S.WithSelect.prototype.toString = function() {
          var e = "WITH ";
          return e += this.withs.map(function(r) {
            var t = "";
            return r.columns && (t = "(" + r.columns.map(function(n) {
              return n.columnid;
            }).join(", ") + ")"), (r.recursive ? "RECURSIVE " : "") + r.name + t + " AS (" + r.select.toString() + ")";
          }).join(", ") + " ", e += this.select.toString(), e;
        };
        function ea(e, r, t) {
          var n = c.options.maxCteIterations || 1e3, i = c.databases[r], s = e.name, o = i.tables[s] = new Cn({ tableid: s });
          o.data = [];
          var a = e.select, f, m;
          if (a.unionall) f = Object.assign({}, a), delete f.unionall, m = a.unionall;
          else if (a.union) f = Object.assign({}, a), delete f.union, m = a.union;
          else return o.data = a.execute(r, t), e.columns && (o.data = renameColumns(o.data, e.columns)), o.data;
          var E;
          e.columns && e.columns.length > 0 && (E = e.columns.map(function(H) {
            return H.columnid;
          }));
          var p = new S.Select(f);
          p.modifier = "ALASQL_DETAILS";
          var h = p.execute(r, t), g = h.columns.map(function(H) {
            return H.columnid;
          });
          E || (E = g);
          var O = m4(h.data, g, E);
          o.data = O.slice();
          for (var T = O, v = O.slice(), N = 0; T.length > 0 && N < n; ) {
            N++, delete i.tables[s], o = i.tables[s] = new Cn({ tableid: s }), o.data = T;
            var b = new S.Select(m);
            b.modifier = "ALASQL_DETAILS";
            var L = b.execute(r, t);
            if (!L.data || L.data.length === 0) break;
            var C = L.columns.map(function(H) {
              return H.columnid;
            }), a1 = m4(L.data, C, E);
            T = a1;
            for (var r1 = 0; r1 < T.length; r1++) v.push(T[r1]);
          }
          return o.data = v, v;
        }
        function m4(e, r, t) {
          return e.map(function(n) {
            for (var i = {}, s = 0; s < t.length && s < r.length; s++) i[t[s]] = n[r[s]];
            return i;
          });
        }
        S.WithSelect.prototype.execute = function(e, r, t) {
          var n = this, i = [];
          n.withs.forEach(function(o) {
            if (i.push(c.databases[e].tables[o.name]), o.recursive) ea(o, e, r);
            else {
              var a = c.databases[e].tables[o.name] = new Cn({ tableid: o.name });
              a.data = o.select.execute(e, r), o.columns && (a.data = renameColumns(a.data, o.columns));
            }
          });
          var s = 1;
          return s = this.select.execute(e, r, function(o) {
            return n.withs.forEach(function(a, f) {
              i[f] ? c.databases[e].tables[a.name] = i[f] : delete c.databases[e].tables[a.name];
            }), t && (o = t(o)), o;
          }), s;
        }, S.If = function(e) {
          return Object.assign(this, e);
        }, S.If.prototype.toString = function() {
          var e = "IF ";
          return e += this.expression.toString(), e += " " + this.thenstat.toString(), this.elsestat && (e += " ELSE " + this.thenstat.toString()), e;
        }, S.If.prototype.execute = function(e, r, t) {
          var n, i = new Function("params,alasql,p", "var y;return " + this.expression.toJS("({})", "", null)).bind(this);
          return i(r, c) ? n = this.thenstat.execute(e, r, t) : this.elsestat ? n = this.elsestat.execute(e, r, t) : t && (n = t(n)), n;
        };
        function v4(e) {
          var r = function() {
            this.message = e;
          };
          return r.prototype = Object.create(Error.prototype), r.prototype.constructor = r, r;
        }
        S.BreakException = v4("BREAK"), S.ContinueException = v4("CONTINUE"), S.While = function(e) {
          return Object.assign(this, e);
        }, S.While.prototype.toString = function() {
          var e = "WHILE ";
          return e += this.expression.toString(), e += " " + this.loopstat.toString(), e;
        }, S.While.prototype.execute = function(e, r, t) {
          var n = this, i = [], s = new Function("params,alasql,p", "var y;return " + this.expression.toJS());
          if (t) {
            var o = false, a = function(m) {
              o ? i.push(m) : o = true, setTimeout(function() {
                s(r, c) ? n.loopstat.execute(e, r, a) : i = t(i);
              }, 0);
            };
            a();
          } else for (; s(r, c); ) try {
            var f = n.loopstat.execute(e, r);
            i.push(f);
          } catch (m) {
            if (m instanceof S.BreakException) break;
            if (m instanceof S.ContinueException) continue;
            throw m;
          }
          return i;
        }, S.Break = function(e) {
          return Object.assign(this, e);
        }, S.Break.prototype.toString = function() {
          var e = "BREAK";
          return e;
        }, S.Break.prototype.execute = function(e, r, t, n) {
          throw new S.BreakException();
        }, S.Continue = function(e) {
          return Object.assign(this, e);
        }, S.Continue.prototype.toString = function() {
          var e = "CONTINUE";
          return e;
        }, S.Continue.prototype.execute = function(e, r, t, n) {
          throw new S.ContinueException();
        }, S.BeginEnd = function(e) {
          return Object.assign(this, e);
        }, S.BeginEnd.prototype.toString = function() {
          var e = "BEGIN " + this.statements.toString() + " END";
          return e;
        }, S.BeginEnd.prototype.execute = function(e, r, t, n) {
          var i = this, s = [];
          if (t) {
            let m = function() {
              i.statements[o].execute(e, r, function(E) {
                if (s.push(E), o++, o < i.statements.length) return m();
                t && (s = t(s));
              });
            };
            var o = 0;
            m();
          } else for (var a = 0; a < i.statements.length; a++) {
            var f = i.statements[a].execute(e, r);
            s.push(f);
          }
          return s;
        }, S.Insert = function(e) {
          return Object.assign(this, e);
        }, S.Insert.prototype.toString = function() {
          var e = "INSERT ";
          if (this.orreplace && (e += "OR REPLACE "), this.replaceonly && (e = "REPLACE "), this.ignore && (e += "IGNORE "), e += "INTO " + this.into.toString(), this.columns && (e += "(" + this.columns.toString() + ")"), this.values) {
            var r = this.values.map(function(t) {
              return "(" + t.toString() + ")";
            });
            e += " VALUES " + r.join(",");
          }
          return this.select && (e += " " + this.select.toString()), this.setcolumns && (e += " SET ", e += this.setcolumns.map((t) => t.toString()).join(", ")), this.output && (e += " OUTPUT ", e += this.output.columns.map((t) => t.toString()).join(", "), this.output.intovar ? e += " INTO " + this.output.method + this.output.intovar : this.output.intotable && (e += " INTO " + this.output.intotable.toString(), this.output.intocolumns && (e += "(" + this.output.intocolumns.map((t) => t.toString()).join(", ") + ")"))), e;
        }, S.Insert.prototype.toJS = function(e, r, t) {
          var n = "this.queriesfn[" + (this.queriesidx - 1) + "](this.params,null," + e + ")";
          return n;
        }, S.Insert.prototype.compile = function(e) {
          var r = this;
          if (r.into instanceof S.ParamValue) return S.compileParamValue(r.into.param, "INSERT", true, e, r, "into");
          e = r.into.databaseid || e;
          var t = c.databases[e], n = r.into.tableid, i = t.tables[n];
          if (!i) throw "Table '" + n + "' could not be found";
          var s = function(a1, r1, H) {
            return `The number of values (${a1}) does not match the number of ${H} (${r1}). If using a subquery, use INSERT INTO ... SELECT instead of INSERT INTO ... VALUES (SELECT ...)`;
          }, a = "", o = "", a = "db.tables['" + n + "'].dirty=true;", f = "var a,aa=[],x;", m;
          if (this.values) {
            this.exists && (this.existsfn = this.exists.map(function(a1) {
              var r1 = a1.compile(e);
              return r1.query.modifier = "RECORDSET", r1;
            })), this.queries && (this.queriesfn = this.queries.map(function(a1) {
              var r1 = a1.compile(e);
              return r1.query.modifier = "RECORDSET", r1;
            })), r.values.forEach(function(a1) {
              var r1 = [];
              if (r.columns) {
                if (a1.length !== r.columns.length) throw new Error(s(a1.length, r.columns.length, "columns"));
                r.columns.forEach(function(H, C1) {
                  var k1 = "'" + H.columnid + "':";
                  i.xcolumns && i.xcolumns[H.columnid] ? ["INT", "FLOAT", "NUMBER", "MONEY"].indexOf(i.xcolumns[H.columnid].dbtypeid) >= 0 ? k1 += "(x=" + a1[C1].toJS() + ",x==undefined?undefined:+x)" : c.fn[i.xcolumns[H.columnid].dbtypeid] ? (k1 += "(new " + i.xcolumns[H.columnid].dbtypeid + "(", k1 += a1[C1].toJS(), k1 += "))") : k1 += a1[C1].toJS() : k1 += a1[C1].toJS(), r1.push(k1);
                });
              } else if (Array.isArray(a1) && i.columns && i.columns.length > 0) {
                if (a1.length !== i.columns.length) throw new Error(s(a1.length, i.columns.length, "table columns"));
                i.columns.forEach(function(H, C1) {
                  var k1 = "'" + H.columnid + "':";
                  ["INT", "FLOAT", "NUMBER", "MONEY"].indexOf(H.dbtypeid) >= 0 ? k1 += "+" + a1[C1].toJS() : c.fn[H.dbtypeid] ? (k1 += "(new " + H.dbtypeid + "(", k1 += a1[C1].toJS(), k1 += "))") : k1 += a1[C1].toJS(), r1.push(k1);
                });
              } else o = Rn(a1);
              t.tables[n].defaultfns && r1.unshift(t.tables[n].defaultfns), o ? a += "a=" + o + ";" : a += "a={" + r1.join(",") + "};", t.tables[n].isclass && (a += "var db=alasql.databases['" + e + "'];", a += 'a.$class="' + n + '";', a += "a.$id=db.counter++;", a += "db.objects[a.$id]=a;"), t.tables[n].insert ? (a += "var db=alasql.databases['" + e + "'];", a += "var inserted=db.tables['" + n + "'].insert(a," + (r.orreplace ? "true" : "false") + "," + (r.ignore ? "true" : "false") + ");", r.ignore && (a += "if(inserted!==false){"), (r.output || r.ignore) && (a += "aa.push(a);"), r.ignore && (a += "}")) : a += "aa.push(a);";
            }), m = f + a, t.tables[n].insert || (a += "alasql.databases['" + e + "'].tables['" + n + "'].data=alasql.databases['" + e + "'].tables['" + n + "'].data.concat(aa);"), r.output ? (a += "var output = [];", a += "for(var i=0;i<aa.length;i++){", a += "var r = aa[i];", a += "var outputRow = {};", r.output.columns.forEach(function(a1) {
              if (a1.columnid === "*") a += "for(var key in r){ outputRow[key] = r[key]; }";
              else {
                var r1 = a1.as || a1.columnid;
                a += "outputRow['" + r1 + "']=r['" + a1.columnid + "'];";
              }
            }), a += "output.push(outputRow);", a += "}", a += "return output;") : t.tables[n].insert && t.tables[n].isclass ? a += "return a.$id;" : r.ignore ? a += "return aa.length;" : a += "return " + r.values.length;
            var E = new Function("db, params, alasql", "var y;" + f + a).bind(this);
          } else if (this.select) {
            this.select.modifier = "RECORDSET", this.queries && (this.select.queries = this.queries);
            var p = this.select.compile(e);
            if (t.engineid && c.engines[t.engineid].intoTable) {
              var h = function(a1, r1) {
                var H = p(a1), C1 = c.engines[t.engineid].intoTable(t.databaseid, n, H.data, null, r1);
                return C1;
              };
              return h;
            } else var g = "var defaults={" + i.defaultfns + "};for(var key in defaults){if(!(key in r)){r[key]=defaults[key]}}return r", O = new Function("r,db,params,alasql", g), E = function(r1, H, C1) {
              var k1 = p(H).data, V1 = [];
              if (r1.tables[n].insert) for (var J1 = 0, R = k1.length; J1 < R; J1++) {
                var U1 = N2(k1[J1]);
                O(U1, r1, H, C1), r1.tables[n].insert(U1, r.orreplace, r.ignore), V1.push(U1);
              }
              else V1 = k1, r1.tables[n].data = r1.tables[n].data.concat(k1);
              if (r.output) {
                for (var ee = [], J1 = 0; J1 < V1.length; J1++) {
                  var U1 = V1[J1], _1 = {};
                  r.output.columns.forEach(function(Ie) {
                    if (Ie.columnid === "*") for (var Xe in U1) _1[Xe] = U1[Xe];
                    else {
                      var Ve = Ie.as || Ie.columnid;
                      _1[Ve] = U1[Ie.columnid];
                    }
                  }), ee.push(_1);
                }
                return ee;
              }
              if (!C1.options.nocount) return k1.length;
            };
          } else if (this.default) var T = "db.tables['" + n + "'].data.push({" + i.defaultfns + "});return 1;", E = new Function("db,params,alasql", T);
          else if (this.setcolumns) {
            var v = [], N = [];
            this.setcolumns.forEach(function(a1) {
              v.push(a1.column), N.push(a1.expression);
            });
            var b = this.columns, L = this.values;
            this.columns = v, this.values = [N];
            try {
              var C = S.Insert.prototype.compile.call(this, e);
              return C;
            } finally {
              this.columns = b, this.values = L;
            }
          } else throw new Error("Wrong INSERT parameters");
          if (t.engineid && c.engines[t.engineid].intoTable && c.options.autocommit) var h = function(r1, H) {
            var C1 = new Function("db,params,alasql", "var y;" + m + "return aa;")(t, r1, c), k1 = c.engines[t.engineid].intoTable(t.databaseid, n, C1, null, H);
            return k1;
          };
          else var h = function(r1, H) {
            var C1 = c.databases[e];
            c.options.autocommit && C1.engineid && c.engines[C1.engineid].loadTableData(e, n);
            var k1 = E(C1, r1, c);
            return c.options.autocommit && C1.engineid && c.engines[C1.engineid].saveTableData(e, n), c.options.nocount && (k1 = void 0), H && H(k1), k1;
          };
          return h;
        }, S.Insert.prototype.execute = function(e, r, t) {
          return this.compile(e)(r, t);
        }, S.CreateTrigger = function(e) {
          return Object.assign(this, e);
        }, S.CreateTrigger.prototype.toString = function() {
          var e = "CREATE TRIGGER " + this.trigger + " ";
          return this.when && (e += this.when + " "), e += this.action + " ON ", this.table.databaseid && (e += this.table.databaseid + "."), e += this.table.tableid + " ", e += this.statement.toString(), e;
        };
        const S4 = ["beforeinsert", "afterinsert", "insteadofinsert", "beforedelete", "afterdelete", "insteadofdelete", "beforeupdate", "afterupdate", "insteadofupdate"];
        S.CreateTrigger.prototype.execute = function(e, r, t) {
          let n = 1;
          const i = this.trigger;
          e = this.table.databaseid || e;
          const s = c.databases[e], { tableid: o } = this.table, a = { action: this.action, when: this.when, statement: this.statement, funcid: this.funcid, tableid: o };
          s.triggers[i] = a;
          const f = `${this.when}${this.action}`.toLowerCase();
          return S4.includes(f) && (s.tables[o] = s.tables[o] || {}, s.tables[o][f] = s.tables[o][f] || {}, s.tables[o][f][i] = a), t && (n = t(n)), n;
        }, S.DropTrigger = function(e) {
          return Object.assign(this, e);
        }, S.DropTrigger.prototype.toString = function() {
          var e = "DROP TRIGGER " + this.trigger;
          return e;
        }, S.DropTrigger.prototype.execute = function(e, r, t) {
          let n = 0;
          const i = c.databases[e], s = this.trigger, o = i.triggers[s];
          if (o) {
            const { tableid: a } = o;
            if (a) n = 1, S4.forEach((f) => {
              delete i.tables[a][f][s];
            }), delete i.triggers[s];
            else throw new Error("Trigger Table not found");
          } else throw new Error("Trigger not found");
          return t && (n = t(n)), n;
        }, c.executeTrigger = function(e, r, ...t) {
          if (e) {
            if (e.funcid) return c.fn[e.funcid](...t);
            if (e.statement) return e.statement.expression && e.statement.expression.funcid ? c.fn[e.statement.expression.funcid](...t) : e.statement.execute(r);
          }
        }, S.Delete = function(e) {
          return Object.assign(this, e);
        }, S.Delete.prototype.toString = function() {
          var e = "DELETE FROM " + this.table.toString();
          return this.where && (e += " WHERE " + this.where.toString()), this.output && (e += " OUTPUT ", e += this.output.columns.map((r) => r.toString()).join(", "), this.output.intovar ? e += " INTO " + this.output.method + this.output.intovar : this.output.intotable && (e += " INTO " + this.output.intotable.toString(), this.output.intocolumns && (e += "(" + this.output.intocolumns.map((r) => r.toString()).join(", ") + ")"))), e;
        }, S.Delete.prototype.compile = function(e) {
          var r = this;
          if (this.table instanceof S.ParamValue) return S.compileParamValue(this.table.param, "DELETE", true, e, r, "table");
          e = this.table.databaseid || e;
          var t = this.table.tableid, n, i = c.databases[e];
          if (this.where) {
            this.exists && (this.existsfn = this.exists.map(function(o) {
              var a = o.compile(e);
              return a.query.modifier = "RECORDSET", a;
            })), this.queries && (this.queriesfn = this.queries.map(function(o) {
              var a = o.compile(e);
              return a.query.modifier = "RECORDSET", a;
            }));
            var s = new Function("r,params,alasql", "var y;return (" + this.where.toJS("r", "") + ")").bind(this);
            n = function(o, a) {
              if (i.engineid && c.engines[i.engineid].deleteFromTable) return c.engines[i.engineid].deleteFromTable(e, t, s, o, a);
              c.options.autocommit && i.engineid && (i.engineid == "LOCALSTORAGE" || i.engineid == "FILESTORAGE") && c.engines[i.engineid].loadTableData(e, t);
              for (var f = i.tables[t], m = f.data.length, E = [], p = [], h = 0, g = f.data.length; h < g; h++) s(f.data[h], o, c) ? ((r.output || f.afterdelete) && p.push(N2(f.data[h])), f.delete && f.delete(h, o, c)) : E.push(f.data[h]);
              if (f.data = E, f.afterdelete) for (var h = 0; h < p.length; h++) for (var O in f.afterdelete) {
                var T = f.afterdelete[O];
                T && c.executeTrigger(T, e, p[h]);
              }
              var v = m - f.data.length;
              if (r.output) {
                for (var N = [], h = 0; h < p.length; h++) {
                  var b = p[h], L = {};
                  r.output.columns.forEach(function(a1) {
                    if (a1.columnid === "*") for (var r1 in b) L[r1] = b[r1];
                    else {
                      var H = a1.as || a1.columnid;
                      L[H] = b[a1.columnid];
                    }
                  }), N.push(L);
                }
                v = N;
              }
              return c.options.autocommit && i.engineid && (i.engineid == "LOCALSTORAGE" || i.engineid == "FILESTORAGE") && c.engines[i.engineid].saveTableData(e, t), a && (v = a(v)), v;
            };
          } else n = function(o, a) {
            c.options.autocommit && i.engineid && c.engines[i.engineid].loadTableData(e, t);
            var f = i.tables[t];
            f.dirty = true;
            var m = i.tables[t].data.length, E = [];
            r.output && (E = f.data.map(function(N) {
              return N2(N);
            })), i.tables[t].data.length = 0;
            for (var p in i.tables[t].uniqs) i.tables[t].uniqs[p] = {};
            for (var p in i.tables[t].indices) i.tables[t].indices[p] = {};
            c.options.autocommit && i.engineid && c.engines[i.engineid].saveTableData(e, t);
            var h = m;
            if (r.output) {
              for (var g = [], O = 0; O < E.length; O++) {
                var T = E[O], v = {};
                r.output.columns.forEach(function(N) {
                  if (N.columnid === "*") for (var b in T) v[b] = T[b];
                  else {
                    var L = N.as || N.columnid;
                    v[L] = T[N.columnid];
                  }
                }), g.push(v);
              }
              h = g;
            }
            return a && a(h), h;
          };
          return n;
        }, S.Delete.prototype.execute = function(e, r, t) {
          return this.compile(e)(r, t);
        }, S.Update = function(e) {
          return Object.assign(this, e);
        }, S.Update.prototype.toString = function() {
          var e = "UPDATE " + this.table.toString();
          return this.columns && (e += " SET " + this.columns.toString()), this.where && (e += " WHERE " + this.where.toString()), this.output && (e += " OUTPUT ", e += this.output.columns.map((r) => r.toString()).join(", "), this.output.intovar ? e += " INTO " + this.output.method + this.output.intovar : this.output.intotable && (e += " INTO " + this.output.intotable.toString(), this.output.intocolumns && (e += "(" + this.output.intocolumns.map((r) => r.toString()).join(", ") + ")"))), e;
        }, S.SetColumn = function(e) {
          return Object.assign(this, e);
        }, S.SetColumn.prototype.toString = function() {
          return this.column.toString() + "=" + this.expression.toString();
        }, S.Update.prototype.compile = function(e) {
          var r = this;
          if (this.table instanceof S.ParamValue) return S.compileParamValue(this.table.param, "UPDATE", false, e, r, "table");
          e = this.table.databaseid || e;
          var t = this.table.tableid;
          if (this.where) {
            this.exists && (this.existsfn = this.exists.map(function(a) {
              var f = a.compile(e);
              return f.query.modifier = "RECORDSET", f;
            })), this.queries && (this.queriesfn = this.queries.map(function(a) {
              var f = a.compile(e);
              return f.query.modifier = "RECORDSET", f;
            }));
            var n = new Function("r,params,alasql", "var y;return " + this.where.toJS("r", "")).bind(this);
          }
          var i = c.databases[e].tables[t].onupdatefns || "";
          i += ";", this.columns.forEach(function(a) {
            i += "r['" + a.column.columnid + "']=" + a.expression.toJS("r", "") + ";";
          });
          var s = new Function("r,params,alasql", "var y;" + i), o = function(a, f) {
            var m = c.databases[e];
            if (m.engineid && c.engines[m.engineid].updateTable) return c.engines[m.engineid].updateTable(e, t, s, n, a, f);
            c.options.autocommit && m.engineid && c.engines[m.engineid].loadTableData(e, t);
            var E = m.tables[t];
            if (!E) throw new Error("Table '" + t + "' not exists");
            for (var p = 0, h = [], g = 0, O = E.data.length; g < O; g++) if (!n || n(E.data[g], a, c)) {
              var T = r.output ? N2(E.data[g]) : null;
              E.update ? E.update(s, g, a) : s(E.data[g], a, c), r.output && h.push({ deleted: T, inserted: N2(E.data[g]) }), p++;
            }
            c.options.autocommit && m.engineid && c.engines[m.engineid].saveTableData(e, t);
            var v = p;
            if (r.output) {
              for (var N = [], g = 0; g < h.length; g++) {
                var b = h[g].deleted, L = h[g].inserted, C = {};
                r.output.columns.forEach(function(r1) {
                  if (r1.columnid === "*") for (var H in L) C[H] = L[H];
                  else {
                    var C1 = r1.as || r1.columnid;
                    r1.tableid === "DELETED" ? C[C1] = b[r1.columnid] : C[C1] = L[r1.columnid];
                  }
                }), N.push(C);
              }
              v = N;
            }
            return f && f(v), v;
          };
          return o;
        }, S.Update.prototype.execute = function(e, r, t) {
          return this.compile(e)(r, t);
        }, S.Merge = function(e) {
          return Object.assign(this, e);
        }, S.Merge.prototype.toString = function() {
          let e = `MERGE ${this.into.tableid} `;
          return this.into.as && (e += `AS ${this.into.as} `), e += `USING ${this.using.tableid} `, this.using.as && (e += `AS ${this.using.as} `), e += `ON ${this.on.toString()} `, this.matches.forEach((r) => {
            e += "WHEN ", r.matched || (e += "NOT "), e += "MATCHED ", r.bytarget && (e += "BY TARGET "), r.bysource && (e += "BY SOURCE "), r.expr && (e += `AND ${r.expr.toString()} `), e += "THEN ", r.action.delete && (e += "DELETE "), r.action.insert && (e += "INSERT ", r.action.columns && (e += `(${r.action.columns.toString()}) `), r.action.values && (e += `VALUES (${r.action.values.toString()}) `), r.action.defaultvalues && (e += "DEFAULT VALUES ")), r.action.update && (e += "UPDATE ", e += r.action.update.map((t) => t.toString()).join(", ") + " ");
          }), e;
        }, S.Merge.prototype.execute = function(e, r, t) {
          var n = 1;
          return t && (n = t(n)), n;
        }, S.CreateDatabase = function(e) {
          return Object.assign(this, e);
        }, S.CreateDatabase.prototype.toString = function() {
          let e = "CREATE ";
          return this.engineid && (e += `${this.engineid} `), e += "DATABASE ", this.ifnotexists && (e += "IF NOT EXISTS "), e += `${this.databaseid} `, this.args && this.args.length > 0 && (e += `(${this.args.map((r) => r.toString()).join(", ")}) `), this.as && (e += `AS ${this.as}`), e;
        }, S.CreateDatabase.prototype.execute = function(e, r, t) {
          var n;
          if (this.args && this.args.length > 0 && (n = this.args.map(function(a) {
            return new Function("params,alasql", "var y;return " + a.toJS())(r, c);
          })), this.engineid) {
            var i = c.engines[this.engineid].createDatabase(this.databaseid, this.args, this.ifnotexists, this.as, t);
            return i;
          } else {
            var s = this.databaseid;
            if (c.databases[s]) throw new Error("Database '" + s + "' already exists");
            var o = new c.Database(s), i = 1;
            return t ? t(i) : i;
          }
        }, S.AttachDatabase = function(e) {
          return Object.assign(this, e);
        }, S.AttachDatabase.prototype.toString = function(e) {
          let r = "ATTACH";
          return this.engineid && (r += ` ${this.engineid}`), r += ` DATABASE ${this.databaseid}`, e && (r += "(", e.length > 0 && (r += e.map((t) => t.toString()).join(", ")), r += ")"), this.as && (r += ` AS ${this.as}`), r;
        }, S.AttachDatabase.prototype.execute = function(e, r, t) {
          if (!c.engines[this.engineid]) throw new Error('Engine "' + this.engineid + '" is not defined.');
          var n = c.engines[this.engineid].attachDatabase(this.databaseid, this.as, this.args, r, t);
          return n;
        }, S.DetachDatabase = function(e) {
          return Object.assign(this, e);
        }, S.DetachDatabase.prototype.toString = function() {
          var e = "DETACH";
          return e += " DATABASE " + this.databaseid, e;
        }, S.DetachDatabase.prototype.execute = function(e, r, t) {
          if (!c.databases[this.databaseid].engineid) throw new Error('Cannot detach database "' + this.engineid + '", because it was not attached.');
          var n, i = this.databaseid;
          if (i === c.DEFAULTDATABASEID) throw new Error("Drop of default database is prohibited");
          if (c.databases[i]) {
            var s = c.databases[i].engineid && c.databases[i].engineid == "FILESTORAGE", o = c.databases[i].filename || "";
            delete c.databases[i], s && (c.databases[i] = {}, c.databases[i].isDetached = true, c.databases[i].filename = o), i === c.useid && c.use(), n = 1;
          } else if (this.ifexists) n = 0;
          else throw new Error("Database '" + i + "' does not exist");
          return t && t(n), n;
        }, S.UseDatabase = function(e) {
          return Object.assign(this, e);
        }, S.UseDatabase.prototype.toString = function() {
          return "USE DATABASE " + this.databaseid;
        }, S.UseDatabase.prototype.execute = function(e, r, t) {
          var n = this.databaseid;
          if (!c.databases[n]) throw new Error("Database '" + n + "' does not exist");
          c.use(n);
          var i = 1;
          return t && t(i), i;
        }, S.DropDatabase = function(e) {
          return Object.assign(this, e);
        }, S.DropDatabase.prototype.toString = function() {
          var e = "DROP";
          return this.ifexists && (e += " IF EXISTS"), e += " DATABASE " + this.databaseid, e;
        }, S.DropDatabase.prototype.execute = function(e, r, t) {
          if (this.engineid) return c.engines[this.engineid].dropDatabase(this.databaseid, this.ifexists, t);
          let n;
          const i = this.databaseid;
          if (i === c.DEFAULTDATABASEID) throw new Error("Drop of default database is prohibited");
          if (c.databases[i]) {
            if (c.databases[i].engineid) throw new Error(`Cannot drop database '${i}', because it is attached. Detach it.`);
            delete c.databases[i], i === c.useid && c.use(), n = 1;
          } else if (this.ifexists) n = 0;
          else throw new Error(`Database '${i}' does not exist`);
          return t && t(n), n;
        }, S.Declare = function(e) {
          return Object.assign(this, e);
        }, S.Declare.prototype.toString = function() {
          let e = "DECLARE ";
          return this.declares && this.declares.length > 0 && (e += this.declares.map((r) => {
            let t = `@${r.variable} ${r.dbtypeid}`;
            return r.dbsize && (t += `(${r.dbsize}`, r.dbprecision && (t += `,${r.dbprecision}`), t += ")"), r.expression && (t += ` = ${r.expression.toString()}`), t;
          }).join(",")), e;
        }, S.Declare.prototype.execute = function(e, r, t) {
          var n = 1, i = this;
          return i.declares && i.declares.length > 0 && i.declares.forEach(function(s) {
            var o = s.dbtypeid;
            c.fn[o] || (o = o.toUpperCase()), c.declares[s.variable] = { dbtypeid: o, dbsize: s.dbsize, dbprecision: s.dbprecision }, s.expression && (c.vars[s.variable] = new Function("params,alasql", "return " + s.expression.toJS("({})", "", null)).bind(i)(r, c), c.declares[s.variable] && (c.vars[s.variable] = c.stdfn.CONVERT(c.vars[s.variable], c.declares[s.variable])));
          }), t && (n = t(n)), n;
        }, S.ShowDatabases = function(e) {
          return Object.assign(this, e);
        }, S.ShowDatabases.prototype.toString = function() {
          var e = "SHOW DATABASES";
          return this.like && (e += "LIKE " + this.like.toString()), e;
        }, S.ShowDatabases.prototype.execute = function(e, r, t) {
          if (this.engineid) return c.engines[this.engineid].showDatabases(this.like, t);
          var n = this, i = [];
          for (var s in c.databases) i.push({ databaseid: s });
          return n.like && i && i.length > 0 && (i = i.filter(function(o) {
            return c.utils.like(n.like.value, o.databaseid);
          })), t && t(i), i;
        }, S.ShowTables = function(e) {
          return Object.assign(this, e);
        }, S.ShowTables.prototype.toString = function() {
          var e = "SHOW TABLES";
          return this.databaseid && (e += " FROM " + this.databaseid), this.like && (e += " LIKE " + this.like.toString()), e;
        }, S.ShowTables.prototype.execute = function(e, r, t) {
          var n = c.databases[this.databaseid || e], i = this, s = [];
          for (var o in n.tables) s.push({ tableid: o });
          return i.like && s && s.length > 0 && (s = s.filter(function(a) {
            return c.utils.like(i.like.value, a.tableid);
          })), t && t(s), s;
        }, S.ShowColumns = function(e) {
          return Object.assign(this, e);
        }, S.ShowColumns.prototype.toString = function() {
          var e = "SHOW COLUMNS";
          return this.table.tableid && (e += " FROM " + this.table.tableid), this.databaseid && (e += " FROM " + this.databaseid), e;
        }, S.ShowColumns.prototype.execute = function(e, r, t) {
          var n = c.databases[this.table.databaseid || this.databaseid || e], i = n.tables[this.table.tableid];
          if (i && i.columns) {
            var s = i.columns.map(function(o) {
              return { columnid: o.columnid, dbtypeid: o.dbtypeid, dbsize: o.dbsize };
            });
            return t && t(s), s;
          } else return t && t([]), [];
        }, S.ShowIndex = function(e) {
          return Object.assign(this, e);
        }, S.ShowIndex.prototype.toString = function() {
          var e = "SHOW INDEX";
          return this.table.tableid && (e += " FROM " + this.table.tableid), this.databaseid && (e += " FROM " + this.databaseid), e;
        }, S.ShowIndex.prototype.execute = function(e, r, t) {
          var n = c.databases[this.table.databaseid || this.databaseid || e], i = n.tables[this.table.tableid], s = [];
          if (i && i.indices) for (var o in i.indices) s.push({ hh: o, len: Object.keys(i.indices[o]).length });
          return t && t(s), s;
        }, S.ShowCreateTable = function(e) {
          return Object.assign(this, e);
        }, S.ShowCreateTable.prototype.toString = function() {
          var e = "SHOW CREATE TABLE " + this.table.tableid;
          return this.databaseid && (e += " FROM " + this.databaseid), e;
        }, S.ShowCreateTable.prototype.execute = function(e) {
          var r = c.databases[this.databaseid || e], t = r.tables[this.table.tableid];
          if (t) {
            var n = "CREATE TABLE " + this.table.tableid + " (", i = [];
            return t.columns && (t.columns.forEach(function(s) {
              var o = s.columnid + " " + s.dbtypeid;
              s.dbsize && (o += "(" + s.dbsize + ")"), s.primarykey && (o += " PRIMARY KEY"), i.push(o);
            }), n += i.join(", ")), n += ")", n;
          } else throw new Error('There is no such table "' + this.table.tableid + '"');
        }, S.SetVariable = function(e) {
          return Object.assign(this, e);
        }, S.SetVariable.prototype.toString = function() {
          var e = "SET ";
          return typeof this.value < "u" && (e += this.variable.toUpperCase() + " " + (this.value ? "ON" : "OFF")), this.expression && (e += this.method + this.variable + " = " + this.expression.toString()), e;
        }, S.SetVariable.prototype.execute = function(e, r, t) {
          if (typeof this.value < "u") {
            let i = this.value;
            i === "ON" ? i = true : i === "OFF" && (i = false), c.options[this.variable] = i;
          } else if (this.expression) {
            this.exists && (this.existsfn = this.exists.map((s) => {
              let o = s.compile(e);
              return o.query && !o.query.modifier && (o.query.modifier = "RECORDSET"), o;
            })), this.queries && (this.queriesfn = this.queries.map((s) => {
              let o = s.compile(e);
              return o.query && !o.query.modifier && (o.query.modifier = "RECORDSET"), o;
            }));
            let i = new Function("params, alasql", "return " + this.expression.toJS("({})", "", null)).bind(this)(r, c);
            if (c.declares[this.variable] && (i = c.stdfn.CONVERT(i, c.declares[this.variable])), this.props && this.props.length > 0) {
              let s;
              this.method === "@" ? s = `alasql.vars['${this.variable}']` : s = `params['${this.variable}']`, this.props.forEach((o) => {
                typeof o == "string" ? s += `['${o}']` : typeof o == "number" ? s += `[${o}]` : s += `[${o.toJS()}]`;
              }), new Function("value, params, alasql", `${s} = value`)(i, r, c);
            } else this.method === "@" ? c.vars[this.variable] = i : r[this.variable] = i;
          }
          let n = 1;
          return t && (n = t(n)), n;
        }, c.test = function(e, r, t) {
          if (arguments.length === 0) {
            c.log(c.con.results);
            return;
          }
          var n = Date.now();
          if (arguments.length === 1) {
            t(), c.con.log(Date.now() - n);
            return;
          }
          arguments.length === 2 && (t = r, r = 1);
          for (var i = 0; i < r; i++) t();
          c.con.results[e] = Date.now() - n;
        }, c.log = function(e, r) {
          var t = c.useid, n = c.options.logtarget;
          j1.isNode && (n = "console");
          var i;
          if (typeof e == "string" ? i = c(e, r) : i = e, n === "console" || j1.isNode) typeof e == "string" && c.options.logprompt && console.log(t + ">", e), Array.isArray(i) && console.table ? console.table(i) : console.log(M2(i));
          else {
            var s;
            n === "output" ? s = document.getElementsByTagName("output")[0] : typeof n == "string" ? s = document.getElementById(n) : s = n;
            var o = "";
            if (typeof e == "string" && c.options.logprompt && (o += "<pre><code>" + c.pretty(e) + "</code></pre>"), Array.isArray(i)) if (i.length === 0) o += "<p>[ ]</p>";
            else if (typeof i[0] != "object" || Array.isArray(i[0])) for (var a = 0, f = i.length; a < f; a++) o += "<p>" + ur(i[a]) + "</p>";
            else o += ur(i);
            else o += ur(i);
            s.innerHTML += o;
          }
        }, c.clear = function() {
          var e = c.options.logtarget;
          if (j1.isNode || j1.isMeteorServer) console.clear && console.clear();
          else {
            var r;
            e === "output" ? r = document.getElementsByTagName("output")[0] : typeof e == "string" ? r = document.getElementById(e) : r = e, r.innerHTML = "";
          }
        }, c.write = function(e) {
          var r = c.options.logtarget;
          if (j1.isNode || j1.isMeteorServer) console.log && console.log(e);
          else {
            var t;
            r === "output" ? t = document.getElementsByTagName("output")[0] : typeof r == "string" ? t = document.getElementById(r) : t = r, t.innerHTML += e;
          }
        };
        function ur(e) {
          var r = "";
          if (e === void 0) r += "undefined";
          else if (Array.isArray(e)) {
            r += "<style>", r += "table {border:1px black solid; border-collapse: collapse; border-spacing: 0px;}", r += "td,th {border:1px black solid; padding-left:5px; padding-right:5px}", r += "th {background-color: #EEE}", r += "</style>", r += "<table>";
            var t = [];
            for (var n in e[0]) t.push(n);
            r += "<tr><th>#", t.forEach(function(o) {
              r += "<th>" + o;
            });
            for (var i = 0, s = e.length; i < s; i++) r += "<tr><th>" + (i + 1), t.forEach(function(o) {
              r += "<td> ", e[i][o] == +e[i][o] ? (r += '<div style="text-align:right">', typeof e[i][o] > "u" ? r += "NULL" : r += e[i][o], r += "</div>") : typeof e[i][o] > "u" ? r += "NULL" : typeof e[i][o] == "string" ? r += e[i][o] : r += M2(e[i][o]);
            });
            r += "</table>";
          } else r += "<p>" + M2(e) + "</p>";
          return r;
        }
        function fr(e, r, t) {
          if (!(t <= 0)) {
            var n = r - e.scrollTop, i = n / t * 10;
            setTimeout(function() {
              e.scrollTop !== r && (e.scrollTop = e.scrollTop + i, fr(e, r, t - 10));
            }, 10);
          }
        }
        c.prompt = function(e, r, t) {
          if (j1.isNode) throw new Error("The prompt not realized for Node.js");
          var n = 0;
          if (typeof e == "string" && (e = document.getElementById(e)), typeof r == "string" && (r = document.getElementById(r)), r.textContent = c.useid, t) {
            c.prompthistory.push(t), n = c.prompthistory.length;
            try {
              var i = Date.now();
              c.log(t), c.write('<p style="color:blue">' + (Date.now() - i) + " ms</p>");
            } catch (o) {
              c.write("<p>" + c.useid + "&gt;&nbsp;<b>" + t + "</b></p>"), c.write('<p style="color:red">' + o + "<p>");
            }
          }
          var s = e.getBoundingClientRect().top + document.getElementsByTagName("body")[0].scrollTop;
          fr(document.getElementsByTagName("body")[0], s, 500), e.onkeydown = function(o) {
            if (o.which === 13) {
              var a = e.value, f = c.useid;
              e.value = "", c.prompthistory.push(a), n = c.prompthistory.length;
              try {
                var m = Date.now();
                c.log(a), c.write('<p style="color:blue">' + (Date.now() - m) + " ms</p>");
              } catch (p) {
                c.write("<p>" + f + "&gt;&nbsp;" + c.pretty(a, false) + "</p>"), c.write('<p style="color:red">' + p + "<p>");
              }
              e.focus(), r.textContent = c.useid;
              var E = e.getBoundingClientRect().top + document.getElementsByTagName("body")[0].scrollTop;
              fr(document.getElementsByTagName("body")[0], E, 500);
            } else o.which === 38 ? (n--, n < 0 && (n = 0), c.prompthistory[n] && (e.value = c.prompthistory[n], o.preventDefault())) : o.which === 40 && (n++, n >= c.prompthistory.length ? (n = c.prompthistory.length, e.value = "") : c.prompthistory[n] && (e.value = c.prompthistory[n], o.preventDefault()));
          };
        }, S.BeginTransaction = function(e) {
          return Object.assign(this, e);
        }, S.BeginTransaction.prototype.toString = function() {
          return "BEGIN TRANSACTION";
        }, S.BeginTransaction.prototype.execute = function(e, r, t) {
          var n = 1;
          return c.databases[e].engineid ? c.engines[c.databases[c.useid].engineid].begin(e, t) : (t && (n = t(n)), n);
        }, S.CommitTransaction = function(e) {
          return Object.assign(this, e);
        }, S.CommitTransaction.prototype.toString = function() {
          return "COMMIT TRANSACTION";
        }, S.CommitTransaction.prototype.execute = function(e, r, t) {
          var n = 1;
          return c.databases[e].engineid ? c.engines[c.databases[c.useid].engineid].commit(e, t) : (t && (n = t(n)), n);
        }, S.RollbackTransaction = function(e) {
          return Object.assign(this, e);
        }, S.RollbackTransaction.prototype.toString = function() {
          return "ROLLBACK TRANSACTION";
        }, S.RollbackTransaction.prototype.execute = function(e, r, t) {
          var n = 1;
          return c.databases[e].engineid ? c.engines[c.databases[e].engineid].rollback(e, t) : (t && (n = t(n)), n);
        }, c.options.tsql && (c.stdfn.OBJECT_ID = function(e, r) {
          typeof r > "u" && (r = "T"), r = r.toUpperCase();
          var t = e.split("."), n = c.useid, i = t[0];
          t.length == 2 && (n = t[0], i = t[1]);
          var s = c.databases[n].tables;
          n = c.databases[n].databaseid;
          for (var o in s) if (o == i) return s[o].view && r == "V" || !s[o].view && r == "T" ? n + "." + o : void 0;
        }), c.options.mysql && (c.fn.TIMESTAMPDIFF = function(e, r, t) {
          return c.stdfn.DATEDIFF(e, r, t);
        }), (c.options.mysql || c.options.sqlite) && (c.from.INFORMATION_SCHEMA = function(e, r, t, n, i) {
          if (e == "VIEWS" || e == "TABLES") {
            var s = [];
            for (var o in c.databases) {
              var a = c.databases[o].tables;
              for (var f in a) (a[f].view && e == "VIEWS" || !a[f].view && e == "TABLES") && s.push({ TABLE_CATALOG: o, TABLE_NAME: f });
            }
            return t && (s = t(s, n, i)), s;
          }
          throw new Error("Unknown INFORMATION_SCHEMA table");
        }), c.options.postgres, c.options.oracle, c.options.sqlite, c.into.SQL = function(e, r, t, n, i) {
          var s;
          typeof e == "object" && (r = e, e = void 0);
          var o = {};
          if (c.utils.extend(o, r), typeof o.tableid > "u") throw new Error("Table for INSERT TO is not defined.");
          var a = "";
          n.length === 0 && typeof t[0] == "object" && (n = Object.keys(t[0]).map(function(E) {
            return { columnid: E };
          }));
          for (var f = 0, m = t.length; f < m; f++) a += "INSERT INTO " + r.tableid + "(", a += n.map(function(E) {
            return E.columnid;
          }).join(","), a += ") VALUES (", a += n.map(function(E) {
            var p = t[f][E.columnid];
            if (p == null) return "NULL";
            var h = E.typeid && (E.typeid === "STRING" || E.typeid === "VARCHAR" || E.typeid === "NVARCHAR" || E.typeid === "CHAR" || E.typeid === "NCHAR") || typeof p == "string";
            return h && (p = "'" + ks(p) + "'"), p;
          }).join(","), a += `);
`;
          return e = c.utils.autoExtFilename(e, "sql", r), s = c.utils.saveFile(e, a), i && (s = i(s)), s;
        }, c.into.HTML = function(e, r, t, n, i) {
          var s = 1;
          if (typeof document != "object") {
            var o = { headers: true };
            c.utils.extend(o, r);
            var a = document.querySelector(e);
            if (!a) throw new Error("Selected HTML element is not found");
            n.length === 0 && typeof t[0] == "object" && (n = Object.keys(t[0]).map(function(T) {
              return { columnid: T };
            }));
            var f = document.createElement("table"), m = document.createElement("thead");
            if (f.appendChild(m), o.headers) {
              for (var E = document.createElement("tr"), p = 0; p < n.length; p++) {
                var h = document.createElement("th");
                h.textContent = n[p].columnid, E.appendChild(h);
              }
              m.appendChild(E);
            }
            var g = document.createElement("tbody");
            f.appendChild(g);
            for (var O = 0; O < t.length; O++) {
              for (var E = document.createElement("tr"), p = 0; p < n.length; p++) {
                var h = document.createElement("td");
                h.textContent = t[O][n[p].columnid], E.appendChild(h);
              }
              g.appendChild(E);
            }
            c.utils.domEmptyChildren(a), a.appendChild(f);
          }
          return i && (s = i(s)), s;
        }, c.into.JSON = function(e, r, t, n, i) {
          var s = 1;
          typeof e == "object" && (r = e, e = void 0);
          var o = JSON.stringify(t);
          return e = c.utils.autoExtFilename(e, "json", r), s = c.utils.saveFile(e, o), i && (s = i(s)), s;
        }, c.into.OBJECT = function(e, r, t, n, i) {
          var s;
          if (typeof e == "object" && (r = e, e = void 0), e) {
            var o = JSON.stringify(t);
            e = c.utils.autoExtFilename(e, "json", r), s = c.utils.saveFile(e, o);
          } else s = t;
          return i && (s = i(s)), s;
        }, c.into.TXT = function(e, r, t, n, i) {
          n.length === 0 && t.length > 0 && (n = Object.keys(t[0]).map(function(f) {
            return { columnid: f };
          })), typeof e == "object" && (r = e, e = void 0);
          var s = t.length, o = "";
          if (t.length > 0) {
            var a = n[0].columnid;
            o += t.map(function(f) {
              return f[a];
            }).join(`
`);
          }
          return e = c.utils.autoExtFilename(e, "txt", r), s = c.utils.saveFile(e, o), i && (s = i(s)), s;
        }, c.into.TAB = c.into.TSV = function(e, r, t, n, i) {
          var s = {};
          return c.utils.extend(s, r), s.separator = "	", e = c.utils.autoExtFilename(e, "tab", r), s.autoExt = false, c.into.CSV(e, s, t, n, i);
        }, c.into.CSV = function(e, r, t, n, i) {
          n.length === 0 && t.length > 0 && (n = Object.keys(t[0]).map(function(f) {
            return { columnid: f };
          })), typeof e == "object" && (r = e, e = void 0);
          var s = { headers: true };
          s.separator = ";", s.quote = '"', s.utf8Bom = true, r && !r.headers && typeof r.headers < "u" && (s.utf8Bom = false), c.utils.extend(s, r);
          var o = t.length, a = s.utf8Bom ? "\uFEFF" : "";
          return s.headers && (a += s.quote + n.map(function(f) {
            return f.columnid.trim();
          }).join(s.quote + s.separator + s.quote) + s.quote + `\r
`), t.forEach(function(f) {
            a += n.map(function(m) {
              var E = f[m.columnid];
              return s.quote !== "" && (E = (E + "").replace(new RegExp("\\" + s.quote, "g"), s.quote + s.quote)), +E != E && (E = s.quote + E + s.quote), E;
            }).join(s.separator) + `\r
`;
          }), e = c.utils.autoExtFilename(e, "csv", r), o = c.utils.saveFile(e, a, null, { disableAutoBom: true }), i && (o = i(o)), o;
        }, c.into.XLS = function(e, r, t, n, i) {
          typeof e == "object" && (r = e, e = void 0);
          var s = {};
          r && r.sheets && (s = r.sheets);
          var o = { headers: true };
          typeof s.Sheet1 < "u" ? o = s[0] : typeof r < "u" && (o = r), typeof o.sheetid > "u" && (o.sheetid = "Sheet1");
          var a = m();
          e = c.utils.autoExtFilename(e, "xls", r);
          var f = c.utils.saveFile(e, a);
          return i && (f = i(f)), f;
          function m() {
            var p = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" 		xmlns="http://www.w3.org/TR/REC-html40"><head> 		<meta charset="utf-8" /> 		<!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets> ';
            if (p += " <x:ExcelWorksheet><x:Name>" + o.sheetid + "</x:Name><x:WorksheetOptions><x:DisplayGridlines/>     </x:WorksheetOptions> 		</x:ExcelWorksheet>", p += "</x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head>", p += "<body", typeof o.style < "u" && (p += ' style="', typeof o.style == "function" ? p += o.style(o) : p += o.style, p += '"'), p += ">", p += "<table>", typeof o.caption < "u") {
              var h = o.caption;
              typeof h == "string" && (h = { title: h }), p += "<caption", typeof h.style < "u" && (p += ' style="', typeof h.style == "function" ? p += h.style(o, h) : p += h.style, p += '" '), p += ">", p += h.title, p += "</caption>";
            }
            return typeof o.columns < "u" ? n = o.columns : n.length == 0 && t.length > 0 && typeof t[0] == "object" && (Array.isArray(t[0]) ? n = t[0].map(function(g, O) {
              return { columnid: O };
            }) : n = Object.keys(t[0]).map(function(g) {
              return { columnid: g };
            })), n.forEach(function(g, O) {
              typeof o.column < "u" && Be(g, o.column), typeof g.width > "u" && (o.column && o.column.width != "undefined" ? g.width = o.column.width : g.width = "120px"), typeof g.width == "number" && (g.width = g.width + "px"), typeof g.columnid > "u" && (g.columnid = O), typeof g.title > "u" && (g.title = "" + g.columnid.trim()), o.headers && Array.isArray(o.headers) && (g.title = o.headers[O]);
            }), p += "<colgroups>", n.forEach(function(g) {
              p += '<col style="width: ' + g.width + '"></col>';
            }), p += "</colgroups>", o.headers && (p += "<thead>", p += "<tr>", n.forEach(function(g, O) {
              p += "<th ", typeof g.style < "u" && (p += ' style="', typeof g.style == "function" ? p += g.style(o, g, O) : p += g.style, p += '" '), p += ">", typeof g.title < "u" && (typeof g.title == "function" ? p += g.title(o, g, O) : p += g.title), p += "</th>";
            }), p += "</tr>", p += "</thead>"), p += "<tbody>", t && t.length > 0 && t.forEach(function(g, O) {
              if (!(O > o.limit)) {
                p += "<tr";
                var T = {};
                Be(T, o.row), o.rows && o.rows[O] && Be(T, o.rows[O]), typeof T < "u" && typeof T.style < "u" && (p += ' style="', typeof T.style == "function" ? p += T.style(o, g, O) : p += T.style, p += '" '), p += ">", n.forEach(function(v, N) {
                  var b = {};
                  Be(b, o.cell), Be(b, T.cell), typeof o.column < "u" && Be(b, o.column.cell), Be(b, v.cell), o.cells && o.cells[O] && o.cells[O][N] && Be(b, o.cells[O][N]);
                  var L = g[v.columnid];
                  typeof b.value == "function" && (L = b.value(L, o, g, v, b, O, N));
                  var C = b.typeid;
                  typeof C == "function" && (C = C(L, o, g, v, b, O, N)), typeof C > "u" && (typeof L == "number" ? C = "number" : typeof L == "string" ? C = "string" : typeof L == "boolean" ? C = "boolean" : typeof L == "object" && L instanceof Date && (C = "date"));
                  var a1 = "";
                  C == "money" ? a1 = 'mso-number-format:"\\#\\,\\#\\#0\\\\ _\u0440_\\.";white-space:normal;' : C == "number" ? a1 = " " : C == "date" ? a1 = 'mso-number-format:"Short Date";' : r.types && r.types[C] && r.types[C].typestyle && (a1 = r.types[C].typestyle), a1 = a1 || 'mso-number-format:"\\@";', p += "<td style='" + a1 + "' ", typeof b.style < "u" && (p += ' style="', typeof b.style == "function" ? p += b.style(L, o, g, v, O, N) : p += b.style, p += '" '), p += ">";
                  var r1 = b.format;
                  if (typeof L > "u") p += "";
                  else if (typeof r1 < "u") if (typeof r1 == "function") p += r1(L);
                  else if (typeof r1 == "string") p += L;
                  else throw new Error("Unknown format type. Should be function or string");
                  else C == "number" || C == "date" ? p += L.toString() : C == "money" ? p += (+L).toFixed(2) : p += L;
                  p += "</td>";
                }), p += "</tr>";
              }
            }), p += "</tbody>", p += "</table>", p += "</body>", p += "</html>", p;
          }
          function E(p) {
            var h = ' style="';
            return p && typeof p.style < "u" && (h += p.style + ";"), h += '" ', h;
          }
        }, c.into.XLSXML = function(e, r, t, n, i) {
          r = r || {}, typeof e == "object" && (r = e, e = void 0);
          var s = {}, o, a;
          r && r.sheets ? (s = r.sheets, o = t, a = n) : (s.Sheet1 = r, o = [t], a = [n]), e = c.utils.autoExtFilename(e, "xls", r);
          var f = c.utils.saveFile(e, m());
          return i && (f = i(f)), f;
          function m() {
            function E(C1) {
              return C1 == null ? "" : String(C1).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;");
            }
            var p = '<?xml version="1.0"?> 		<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" 		 xmlns:o="urn:schemas-microsoft-com:office:office" 		 xmlns:x="urn:schemas-microsoft-com:office:excel" 		 xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" 		 xmlns:html="http://www.w3.org/TR/REC-html40"> 		 <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"> 		 </DocumentProperties> 		 <OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office"> 		  <AllowPNG/> 		 </OfficeDocumentSettings> 		 <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel"> 		  <ActiveSheet>0</ActiveSheet> 		 </ExcelWorkbook> 		 <Styles> 		  <Style ss:ID="Default" ss:Name="Normal"> 		   <Alignment ss:Vertical="Bottom"/> 		   <Borders/> 		   <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="12" ss:Color="#000000"/> 		   <Interior/> 		   <NumberFormat/> 		   <Protection/> 		  </Style>', h = "", g = " </Styles>", O = {}, T = 62;
            function v(C1) {
              var k1 = "";
              for (var V1 in C1) {
                k1 += "<" + V1;
                for (var J1 in C1[V1]) k1 += " ", J1.substr(0, 2) == "x:" ? k1 += J1 : k1 += "ss:", k1 += J1 + "=" + JSON.stringify(C1[V1][J1]);
                k1 += "/>";
              }
              var R = d2(k1);
              return O[R] || (O[R] = { styleid: T }, h += `<Style ss:ID=${JSON.stringify("s" + T)}>`, h += k1.replace(/<\s*\/\s*Style /gi, "<"), h += "</Style>", T++), "s" + O[R].styleid;
            }
            function N(C1) {
              try {
                return Object.values(C1);
              } catch {
                return Object.keys(C1).map(function(V1) {
                  return C1[V1];
                });
              }
            }
            var b = 0;
            for (var L in s) {
              var C = s[L], a1 = typeof C.dataidx < "u" ? C.dataidx : b++, r1 = N(o[a1]), H = void 0;
              typeof C.columns < "u" ? H = C.columns : (H = a[a1], (H === void 0 || H.length == 0 && r1.length > 0) && typeof r1[0] == "object" && (Array.isArray(r1[0]) ? H = r1[0].map(function(C1, k1) {
                return { columnid: k1 };
              }) : H = Object.keys(r1[0]).map(function(C1) {
                return { columnid: C1 };
              }))), H.forEach(function(C1, k1) {
                typeof C.column < "u" && Be(C1, C.column), typeof C1.width > "u" && (C.column && typeof C.column.width < "u" ? C1.width = C.column.width : C1.width = 120), typeof C1.width == "number" && (C1.width = C1.width), typeof C1.columnid > "u" && (C1.columnid = k1), typeof C1.title > "u" && (C1.title = "" + C1.columnid.trim()), C.headers && Array.isArray(C.headers) && (C1.title = C.headers[k1]);
              }), g += "<Worksheet ss:Name=" + JSON.stringify(L) + '> 	  			<Table ss:ExpandedColumnCount="' + H.length + '" ss:ExpandedRowCount="' + ((C.headers ? 1 : 0) + Math.min(r1.length, C.limit || r1.length)) + '" x:FullColumns="1" 	   			x:FullRows="1" ss:DefaultColumnWidth="65" ss:DefaultRowHeight="15">', H.forEach(function(C1, k1) {
                g += `
					<Column 
						ss:Index="${k1 + 1}" 
						ss:AutoFitWidth="0" 
						ss:Width=${JSON.stringify("" + C1.width)}
					/>`;
              }), C.headers && (g += '<Row ss:AutoFitHeight="0">', H.forEach(function(C1, k1) {
                if (g += "<Cell ", typeof C1.style < "u") {
                  var V1 = {};
                  typeof C1.style == "function" ? Be(V1, C1.style(C, C1, k1)) : Be(V1, C1.style), g += "ss:StyleID=" + JSON.stringify(v(V1));
                }
                g += '><Data ss:Type="String">', typeof C1.title < "u" && (typeof C1.title == "function" ? g += E(C1.title(C, C1, k1)) : g += E(C1.title)), g += "</Data></Cell>";
              }), g += "</Row>"), r1 && r1.length > 0 && r1.forEach(function(C1, k1) {
                if (!(k1 > C.limit)) {
                  var V1 = {};
                  if (Be(V1, C.row), C.rows && C.rows[k1] && Be(V1, C.rows[k1]), g += "<Row ", typeof V1 < "u") {
                    var J1 = {};
                    typeof V1.style < "u" && (typeof V1.style == "function" ? Be(J1, V1.style(C, C1, k1)) : Be(J1, V1.style), g += "ss:StyleID=" + JSON.stringify(v(J1)));
                  }
                  g += ">", H.forEach(function(R, U1) {
                    var ee = {};
                    Be(ee, C.cell), Be(ee, V1.cell), typeof C.column < "u" && Be(ee, C.column.cell), Be(ee, R.cell), C.cells && C.cells[k1] && C.cells[k1][U1] && Be(ee, C.cells[k1][U1]);
                    var _1 = C1[R.columnid];
                    typeof ee.value == "function" && (_1 = ee.value(_1, C, C1, R, ee, k1, U1));
                    var K1 = ee.typeid;
                    typeof K1 == "function" && (K1 = K1(_1, C, C1, R, ee, k1, U1)), typeof K1 > "u" && (typeof _1 == "number" ? K1 = "number" : typeof _1 == "string" ? K1 = "string" : typeof _1 == "boolean" ? K1 = "boolean" : typeof _1 == "object" && _1 instanceof Date && (K1 = "date"));
                    var Se = "String";
                    K1 == "number" ? Se = "Number" : K1 == "date" && (Se = "Date");
                    var Ie = "";
                    K1 == "money" ? Ie = 'mso-number-format:"\\#\\,\\#\\#0\\\\ _\u0440_\\.";white-space:normal;' : K1 == "number" ? Ie = " " : K1 == "date" ? Ie = 'mso-number-format:"Short Date";' : r.types && r.types[K1] && r.types[K1].typestyle && (Ie = r.types[K1].typestyle), Ie = Ie || 'mso-number-format:"\\@";', g += "<Cell ";
                    var Xe = {};
                    typeof ee.style < "u" && (typeof ee.style == "function" ? Be(Xe, ee.style(_1, C, C1, R, k1, U1)) : Be(Xe, ee.style), g += "ss:StyleID=" + JSON.stringify(v(Xe))), g += ">", g += "<Data ss:Type=" + JSON.stringify(Se) + ">";
                    var Ve = ee.format;
                    if (typeof _1 > "u") g += "";
                    else if (typeof Ve < "u") if (typeof Ve == "function") g += E(Ve(_1));
                    else if (typeof Ve == "string") g += E(_1);
                    else throw new Error("Unknown format type. Should be function or string");
                    else K1 == "number" || K1 == "date" ? g += E(_1.toString()) : K1 == "money" ? g += E((+_1).toFixed(2)) : g += E(_1);
                    g += "</Data></Cell>";
                  }), g += "</Row>";
                }
              }), g += "</Table></Worksheet>";
            }
            return g += "</Workbook>", p + h + g;
          }
        }, c.into.XLSX = function(e, r, t, n, i) {
          var s = 1;
          r = r || {}, gt(n, [{ columnid: "_" }]) && (t = t.map(function(p) {
            return p._;
          }), n = void 0), e = c.utils.autoExtFilename(e, "xlsx", r);
          var o = Wt();
          typeof e == "object" && (r = e, e = void 0);
          var a = { SheetNames: [], Sheets: {} };
          return r.sourcefilename ? c.utils.loadBinaryFile(r.sourcefilename, !!i, function(p) {
            a = o.read(p, { type: "binary", ...c.options.excel, ...r }), f(), i && (s = i(s));
          }) : (f(), i && (s = i(s))), s;
          function f() {
            typeof r == "object" && Array.isArray(r) ? t && t.length > 0 && t.forEach(function(p, h) {
              m(r[h], p, void 0, h + 1);
            }) : m(r, t, n, 1), E(i);
          }
          function m(p, h, g, O) {
            var T = { sheetid: "Sheet " + O, headers: true };
            c.utils.extend(T, p);
            var v = Object.keys(h).length;
            (!g || g.length == 0) && (v > 0 ? g = Object.keys(h[0]).map(function(U1) {
              return { columnid: U1 };
            }) : g = []);
            var N = {};
            a.SheetNames.indexOf(T.sheetid) > -1 || (a.SheetNames.push(T.sheetid), a.Sheets[T.sheetid] = {}), N = a.Sheets[T.sheetid];
            var b = "A1";
            T.range && (b = T.range);
            var L = c.utils.xlscn(b.match(/[A-Z]+/)[0]), C = +b.match(/[0-9]+/)[0] - 1;
            if (a.Sheets[T.sheetid]["!ref"]) var a1 = a.Sheets[T.sheetid]["!ref"], r1 = c.utils.xlscn(a1.match(/[A-Z]+/)[0]), H = +a1.match(/[0-9]+/)[0] - 1;
            else var r1 = 1, H = 1;
            var C1 = g.length ? 0 : 1, k1 = Math.max(L + g.length - 1 + C1, r1), V1 = Math.max(C + v + 2, H), J1 = C + 1;
            a.Sheets[T.sheetid]["!ref"] = "A1:" + c.utils.xlsnc(k1) + V1, T.headers && (g.forEach(function(U1, ee) {
              N[c.utils.xlsnc(L + ee) + "" + J1] = { v: U1.columnid.trim() };
            }), J1++);
            for (var R = 0; R < v; R++) g.forEach(function(U1, ee) {
              var _1 = { v: h[R][U1.columnid] };
              typeof h[R][U1.columnid] == "number" ? _1.t = "n" : typeof h[R][U1.columnid] == "string" ? _1.t = "s" : typeof h[R][U1.columnid] == "boolean" ? _1.t = "b" : typeof h[R][U1.columnid] == "object" && h[R][U1.columnid] instanceof Date && (_1.t = "d"), N[c.utils.xlsnc(L + ee) + "" + J1] = _1;
            }), J1++;
          }
          function E(p) {
            var h;
            if (typeof e > "u") s = a;
            else if (h = Wt(), j1.isNode || j1.isMeteorServer) h.writeFile(a, e);
            else {
              var g = { bookType: "xlsx", bookSST: false, type: "binary" }, O = h.write(a, g), T = function(v) {
                for (var N = new ArrayBuffer(v.length), b = new Uint8Array(N), L = 0; L != v.length; ++L) b[L] = v.charCodeAt(L) & 255;
                return N;
              };
              mt(new Blob([T(O)], { type: "application/octet-stream" }), e);
            }
          }
        }, c.from.METEOR = function(e, r, t, n, i) {
          var s = e.find(r).fetch();
          return t && (s = t(s, n, i)), s;
        }, c.from.TABLETOP = function(e, r, t, n, i) {
          var s = [], o = { headers: true, simpleSheet: true, key: e };
          return c.utils.extend(o, r), o.callback = function(a) {
            s = a, t && (s = t(s, n, i));
          }, Tabletop.init(o), null;
        }, c.from.HTML = function(e, r, t, n, i) {
          var s = {};
          c.utils.extend(s, r);
          var o = document.querySelector(e);
          if (!o || o.tagName !== "TABLE") throw new Error("Selected HTML element is not a TABLE");
          var a = [], f = s.headers;
          if (f && !Array.isArray(f)) {
            f = [];
            for (var m = o.querySelector("thead tr").children, E = 0; E < m.length; E++) m.item(E).style && m.item(E).style.display === "none" && s.skipdisplaynone ? f.push(void 0) : f.push(m.item(E).textContent);
          }
          for (var p = o.querySelectorAll("tbody tr"), h = 0; h < p.length; h++) {
            var g = p.item(h).children, O = {};
            for (E = 0; E < g.length; E++) g.item(E).style && g.item(E).style.display === "none" && s.skipdisplaynone || (f ? O[f[E]] = g.item(E).textContent : O[E] = g.item(E).textContent);
            a.push(O);
          }
          return t && (a = t(a, n, i)), a;
        }, c.from.RANGE = function(e, r, t, n, i) {
          for (var s = [], o = e; o <= r; o++) s.push(o);
          return t && (s = t(s, n, i)), s;
        }, c.from.UNNEST = function(e, r, t, n, i) {
          var s = e;
          return Array.isArray(s) || (s = []), t && (s = t(s, n, i)), s;
        }, c.from.FILE = function(e, r, t, n, i) {
          var s;
          if (typeof e == "string") s = e;
          else if (e instanceof Event) s = e.target.files[0].name;
          else throw new Error("Wrong usage of FILE() function");
          var o = s.split("."), a = o[o.length - 1].toUpperCase();
          if (c.from[a]) return c.from[a](e, r, t, n, i);
          throw new Error("Cannot recognize file type for loading");
        }, c.from.JSON = function(e, r, t, n, i) {
          var s;
          return e = c.utils.autoExtFilename(e, "json", r), c.utils.loadFile(e, !!t, function(o) {
            s = JSON.parse(o), t && (s = t(s, n, i));
          }), s;
        };
        const T4 = (e) => function(r, t, n, i, s) {
          let o = [];
          return r = c.utils.autoExtFilename(r, e, t), c.utils.loadFile(r, !!n, function(a) {
            a.split(/\r?\n/).forEach((f, m) => {
              const E = f.trim();
              if (E !== "") try {
                o.push(JSON.parse(E));
              } catch (p) {
                throw new Error(`Could not parse JSON at line ${m}: ${p.toString()}`);
              }
            }), n && (o = n(o, i, s));
          }, (a) => {
            const f = a instanceof Error ? a : new Error(a);
            if (s && s.cb) {
              s.cb(null, f);
              return;
            }
            throw f;
          }), o;
        };
        c.from.JSONL = T4("jsonl"), c.from.NDJSON = T4("ndjson"), c.from.TXT = function(e, r, t, n, i) {
          var s;
          return e = c.utils.autoExtFilename(e, "txt", r), c.utils.loadFile(e, !!t, function(o) {
            s = o.split(/\r?\n/), s[s.length - 1] === "" && s.pop();
            for (var a = 0, f = s.length; a < f; a++) s[a] == +s[a] && (s[a] = +s[a]), s[a] = [s[a]];
            t && (s = t(s, n, i));
          }), s;
        }, c.from.TAB = c.from.TSV = function(e, r, t, n, i) {
          return r = r || {}, r.separator = "	", e = c.utils.autoExtFilename(e, "tab", r), r.autoext = false, c.from.CSV(e, r, t, n, i);
        }, c.from.CSV = function(e, r, t, n, i) {
          e = "" + e;
          var s = { separator: ",", quote: '"', headers: true, raw: false };
          c.utils.extend(s, r);
          var o, a = [];
          const f = !s.raw && !i?.intofns;
          function m(p) {
            return f && p !== void 0 && p.length !== 0 && p == +p ? +p : p;
          }
          function E(p) {
            var h = s.separator.charCodeAt(0), g = s.quote.charCodeAt(0), O = {}, T = {}, v = [], N = p.length, b = 0, L = 0, C, a1;
            function r1() {
              if (b >= N) return T;
              if (a1) return a1 = false, O;
              var V1 = b;
              if (p.charCodeAt(V1) === g) {
                for (var J1 = V1; J1++ < N; ) if (p.charCodeAt(J1) === g) {
                  if (p.charCodeAt(J1 + 1) !== g) break;
                  ++J1;
                }
                b = J1 + 2;
                var R = p.charCodeAt(J1 + 1);
                return R === 13 ? (a1 = true, p.charCodeAt(J1 + 2) === 10 && ++b) : R === 10 && (a1 = true), p.substring(V1 + 1, J1).replace(/""/g, '"');
              }
              for (; b < N; ) {
                var R = p.charCodeAt(b++), U1 = 1;
                if (R === 10) a1 = true;
                else if (R === 13) a1 = true, p.charCodeAt(b) === 10 && (++b, ++U1);
                else if (R !== h) continue;
                return p.substring(V1, b - U1);
              }
              return p.substring(V1);
            }
            for (; (C = r1()) !== T; ) {
              for (var H = []; C !== O && C !== T; ) H.push(C.trim()), C = r1();
              if (s.headers) {
                if (L === 0) {
                  if (typeof s.headers == "boolean") a = H;
                  else if (Array.isArray(s.headers)) {
                    a = s.headers;
                    var C1 = {};
                    a.forEach(function(V1, J1) {
                      C1[V1] = m(H[J1]);
                    }), v.push(C1);
                  }
                } else {
                  var C1 = {};
                  a.forEach(function(J1, R) {
                    C1[J1] = m(H[R]);
                  }), v.push(C1);
                }
                L++;
              } else {
                var C1 = {};
                H.forEach(function(J1, R) {
                  C1[R] = m(H[R]);
                }), v.push(C1);
              }
            }
            if (o = v, s.headers && i && i.sources && i.sources[n]) {
              var k1 = i.sources[n].columns = [];
              a.forEach(function(V1) {
                k1.push({ columnid: V1 });
              });
            }
            t && (o = t(o, n, i));
          }
          return new RegExp(`
`).test(e) ? E(e) : (e = c.utils.autoExtFilename(e, "csv", r), c.utils.loadFile(e, !!t, E, (p) => i.cb(null, p))), o;
        };
        function cr(e, r, t, n, i, s) {
          var o = {};
          t = t || {}, c.utils.extend(o, t), typeof o.headers > "u" && (o.headers = true);
          var a;
          function f(p) {
            for (var h = "", g = 0, O = 10240; g < p.byteLength / O; ++g) h += String.fromCharCode.apply(null, new Uint8Array(p.slice(g * O, g * O + O)));
            return h += String.fromCharCode.apply(null, new Uint8Array(p.slice(g * O))), h;
          }
          function m(p) {
            return p && c.options.casesensitive === false ? p.toLowerCase() : p;
          }
          function E(p, h, g) {
            var O, T = [];
            if (typeof g.range > "u" ? O = p.Sheets[h]["!ref"] : (O = g.range, p.Sheets[h][O] && (O = p.Sheets[h][O])), O) {
              for (var v = O.split(":"), N = v[0].match(/[A-Z]+/)[0], b = +v[0].match(/[0-9]+/)[0], L = v[1].match(/[A-Z]+/)[0], C = +v[1].match(/[0-9]+/)[0], a1 = {}, r1 = c.utils.xlscn(N), H = c.utils.xlscn(L), C1 = r1; C1 <= H; C1++) {
                var k1 = c.utils.xlsnc(C1);
                g.headers ? p.Sheets[h][k1 + "" + b] ? a1[k1] = m(p.Sheets[h][k1 + "" + b].v) : a1[k1] = m(k1) : a1[k1] = k1;
              }
              g.headers && b++;
              for (var V1 = b; V1 <= C; V1++) {
                for (var J1 = {}, C1 = r1; C1 <= H; C1++) {
                  var k1 = c.utils.xlsnc(C1);
                  p.Sheets[h][k1 + "" + V1] && (J1[a1[k1]] = p.Sheets[h][k1 + "" + V1].v);
                }
                T.push(J1);
              }
            } else T.push([]);
            return T.length > 0 && T[T.length - 1] && Object.keys(T[T.length - 1]).length == 0 && T.pop(), T;
          }
          return r = c.utils.autoExtFilename(r, "xls", t), c.utils.loadBinaryFile(r, !!n, function(p) {
            if (p instanceof ArrayBuffer) var h = f(p), g = e.read(btoa(h), { type: "base64", ...c.options.excel, ...t });
            else var g = e.read(p, { type: "binary", ...c.options.excel, ...t });
            var O = o.sheetid === "*" || Array.isArray(o.sheetid) && o.sheetid.length > 0;
            if (O) {
              a = [];
              for (var T = o.sheetid === "*" ? g.SheetNames : o.sheetid, v = 0; v < T.length; v++) {
                var N = o.sheetid === "*" ? T[v] : typeof T[v] == "number" ? g.SheetNames[T[v]] : T[v];
                if (g.Sheets[N]) {
                  for (var b = E(g, N, o), L = 0; L < b.length; L++) b[L]._sheet = N;
                  a = a.concat(b);
                }
              }
            } else {
              var C;
              typeof o.sheetid > "u" ? C = g.SheetNames[0] : typeof o.sheetid == "number" ? C = g.SheetNames[o.sheetid] : C = o.sheetid, a = E(g, C, o);
            }
            n && (a = n(a, i, s));
          }, function(p) {
            if (s && s.cb) {
              s.cb(null, p);
              return;
            }
            throw p;
          }), a;
        }
        c.from.XLS = function(e, r, t, n, i) {
          return r = r || {}, e = c.utils.autoExtFilename(e, "xls", r), r.autoExt = false, cr(Wt(), e, r, t, n, i);
        }, c.from.XLSX = function(e, r, t, n, i) {
          return r = r || {}, e = c.utils.autoExtFilename(e, "xlsx", r), r.autoExt = false, cr(Wt(), e, r, t, n, i);
        }, c.from.ODS = function(e, r, t, n, i) {
          return r = r || {}, e = c.utils.autoExtFilename(e, "ods", r), r.autoExt = false, cr(Wt(), e, r, t, n, i);
        }, c.from.XML = function(e, r, t, n, i) {
          var s;
          return c.utils.loadFile(e, !!t, function(o) {
            s = ta(o).root, t && (s = t(s, n, i));
          }), s;
        };
        function ta(e) {
          return e = e.trim(), e = e.replace(/<!--[\s\S]*?-->/g, ""), r();
          function r() {
            return { declaration: t(), root: n() };
          }
          function t() {
            var E = a(/^<\?xml\s*/);
            if (E) {
              for (var p = { attributes: {} }; !(f() || m("?>")); ) {
                var h = s();
                if (!h) return p;
                p.attributes[h.name] = h.value;
              }
              return a(/\?>\s*/), p;
            }
          }
          function n() {
            var E = a(/^<([\w-:.]+)\s*/);
            if (E) {
              for (var p = { name: E[1], attributes: {}, children: [] }; !(f() || m(">") || m("?>") || m("/>")); ) {
                var h = s();
                if (!h) return p;
                p.attributes[h.name] = h.value;
              }
              if (a(/^\s*\/>\s*/)) return p;
              a(/\??>\s*/), p.content = i();
              for (var g; g = n(); ) p.children.push(g);
              return a(/^<\/[\w-:.]+>\s*/), p;
            }
          }
          function i() {
            var E = a(/^([^<]*)/);
            return E ? E[1] : "";
          }
          function s() {
            var E = a(/([\w:-]+)\s*=\s*("[^"]*"|'[^']*'|\w+)\s*/);
            if (E) return { name: E[1], value: o(E[2]) };
          }
          function o(E) {
            return E.replace(/^['"]|['"]$/g, "");
          }
          function a(E) {
            var p = e.match(E);
            if (p) return e = e.slice(p[0].length), p;
          }
          function f() {
            return e.length == 0;
          }
          function m(E) {
            return e.indexOf(E) == 0;
          }
        }
        c.from.GEXF = function(e, r, t, n, i) {
          var s;
          return c("SEARCH FROM XML(" + e + ")", [], function(o) {
            s = o, t && (s = t(s));
          }), s;
        }, S.Print = function(e) {
          return Object.assign(this, e);
        }, S.Print.prototype.toString = function() {
          var e = "PRINT";
          return this.statement && (e += " " + this.statement.toString()), e;
        }, S.Print.prototype.execute = function(e, r, t) {
          var n = this, i = 1;
          if (c.precompile(this, e, r), this.exprs && this.exprs.length > 0) {
            var s = this.exprs.map(function(a) {
              var f = new Function("params,alasql,p", "var y;return " + a.toJS("({})", "", null)).bind(n), m = f(r, c);
              return M2(m);
            });
            console.log.apply(console, s);
          } else if (this.select) {
            var o = this.select.execute(e, r);
            console.log(M2(o));
          } else console.log();
          return t && (i = t(i)), i;
        }, S.Source = function(e) {
          return Object.assign(this, e);
        }, S.Source.prototype.toString = function() {
          var e = "SOURCE";
          return this.url && (e += " '" + this.url + " '"), e;
        }, S.Source.prototype.execute = function(e, r, t) {
          var n;
          return On(this.url, !!t, function(i) {
            return n = c(i), t && (n = t(n)), n;
          }, function(i) {
            throw i;
          }), n;
        }, S.Require = function(e) {
          return Object.assign(this, e);
        }, S.Require.prototype.toString = function() {
          var e = "REQUIRE";
          return this.paths && this.paths.length > 0 && (e += this.paths.map(function(r) {
            return r.toString();
          }).join(",")), this.plugins && this.plugins.length > 0 && (e += this.plugins.map(function(r) {
            return r.toUpperCase();
          }).join(",")), e;
        }, S.Require.prototype.execute = function(e, r, t) {
          var n = this, i = 0, s = "";
          return this.paths && this.paths.length > 0 ? this.paths.forEach(function(o) {
            On(o.value, !!t, function(a) {
              i++, s += a, !(i < n.paths.length) && (new Function("params,alasql", s)(r, c), t && (i = t(i)));
            });
          }) : this.plugins && this.plugins.length > 0 ? this.plugins.forEach(function(o) {
            c.plugins[o] || On(c.path + "/alasql-" + o.toLowerCase() + ".js", !!t, function(a) {
              i++, s += a, !(i < n.plugins.length) && (new Function("params,alasql", s)(r, c), c.plugins[o] = true, t && (i = t(i)));
            });
          }) : t && (i = t(i)), i;
        }, S.Assert = function(e) {
          return Object.assign(this, e);
        }, S.Source.prototype.toString = function() {
          var e = "ASSERT";
          return this.value && (e += " " + JSON.stringify(this.value)), e;
        }, S.Assert.prototype.execute = function(e) {
          if (!gt(c.res, this.value)) throw new Error((this.message || "Assert wrong") + ": " + JSON.stringify(c.res) + " == " + JSON.stringify(this.value));
          return 1;
        };
        var o2 = c.engines.INDEXEDDB = function() {
          "";
        };
        async function Qt(e) {
          const r = globalThis.indexedDB;
          if (!r) throw new Error("IndexedDB is not supported in this browser");
          if (r.databases) return (await r.databases()).find((s) => s.name === e) || 0;
          const t = r.open(e);
          return new Promise(function(n, i) {
            t.onsuccess = () => {
              t.result.close(), n({ name: e, version: t.result.version });
            }, t.onupgradeneeded = (s) => {
              s.target.transaction.abort(), n(0);
            }, t.onerror = () => {
              i(new Error("IndexedDB error"));
            }, t.onblocked = () => {
              n({ name: e, version: t.result.version });
            };
          });
        }
        o2.showDatabases = function(e, r) {
          if (!indexedDB.databases) {
            r(null, new Error("SHOW DATABASE is not supported in this browser"));
            return;
          }
          indexedDB.databases().then((t) => {
            const n = [], i = e && new RegExp(e.value.replace(/\%/g, ".*"), "g");
            for (var s = 0; s < t.length; s++) (!e || t[s].name.match(i)) && n.push({ databaseid: t[s].name });
            r(n);
          });
        }, o2.createDatabase = async function(e, r, t, n, i) {
          const s = await Qt(e).catch((o) => {
            if (i) return i(null, o), null;
            throw o;
          });
          if (s !== null) if (s) if (t) i && i(0);
          else {
            const o = new Error(`IndexedDB: Cannot create new database "${e}" because it already exists`);
            if (i) {
              i(null, o);
              return;
            }
            throw o;
          }
          else {
            const o = indexedDB.open(e, 1);
            o.onsuccess = () => {
              o.result.close(), i(1);
            };
          }
        }, o2.dropDatabase = async function(e, r, t) {
          const n = await Qt(e).catch((i) => {
            if (t) return t(null, i), null;
            throw i;
          });
          if (n !== null) if (n) {
            const i = indexedDB.deleteDatabase(e);
            i.onsuccess = () => {
              t && t(1);
            };
          } else if (r) t && t(0);
          else {
            if (t) {
              t(null, new Error(`IndexedDB: Cannot drop database "${e}" because it does not exist`));
              return;
            }
            throw new Error(`IndexedDB: Cannot drop database "${e}" because it does not exist`);
          }
        }, o2.attachDatabase = async function(e, r, t, n, i) {
          const s = await Qt(e).catch((m) => {
            if (i) return i(null, m), null;
            throw m;
          });
          if (s === null) return;
          if (!s) {
            const m = new Error(`IndexedDB: Cannot attach database "${e}" because it does not exist`);
            if (i) {
              i(null, m);
              return;
            }
            throw m;
          }
          const o = await new Promise((m, E) => {
            const p = indexedDB.open(e);
            p.onsuccess = () => {
              m(p.result.objectStoreNames), p.result.close();
            };
          }), a = new c.Database(r || e);
          a.engineid = "INDEXEDDB", a.ixdbid = e, a.tables = [];
          for (var f = 0; f < o.length; f++) a.tables[o[f]] = {};
          i && i(1);
        }, o2.createTable = async function(e, r, t, n) {
          const i = c.databases[e].ixdbid, s = await Qt(i).catch((a) => {
            if (n) return n(null, a), null;
            throw a;
          });
          if (s === null) return;
          if (!s) {
            const a = new Error('IndexedDB: Cannot create table in database "' + i + '" because it does not exist');
            if (n) {
              n(null, a);
              return;
            }
            throw a;
          }
          const o = indexedDB.open(i, s.version + 1);
          o.onupgradeneeded = function(a) {
            o.result.createObjectStore(r, { autoIncrement: true });
          }, o.onsuccess = function(a) {
            o.result.close(), n && n(1);
          }, o.onerror = (a) => {
            n(null, a);
          }, o.onblocked = function(a) {
            n(null, new Error(`Cannot create table "${r}" because database "${e}"  is blocked`));
          };
        }, o2.dropTable = async function(e, r, t, n) {
          const i = c.databases[e].ixdbid, s = await Qt(i).catch((f) => {
            if (n) return n(null, f), null;
            throw f;
          });
          if (s === null) return;
          if (!s) {
            const f = new Error('IndexedDB: Cannot drop table in database "' + i + '" because it does not exist');
            if (n) {
              n(null, f);
              return;
            }
            throw f;
          }
          const o = indexedDB.open(i, s.version + 1);
          let a;
          o.onupgradeneeded = function(f) {
            var m = o.result;
            m.objectStoreNames.contains(r) ? (m.deleteObjectStore(r), delete c.databases[e].tables[r]) : t || (a = new Error(`IndexedDB: Cannot drop table "${r}" because it does not exist`), f.target.transaction.abort());
          }, o.onsuccess = function(f) {
            o.result.close(), n && n(1);
          }, o.onerror = function(f) {
            n && n(null, a || f);
          }, o.onblocked = function(f) {
            n(null, new Error(`Cannot drop table "${r}" because database "${e}" is blocked`));
          };
        }, o2.intoTable = function(e, r, t, n, i) {
          const s = c.databases[e].ixdbid, o = indexedDB.open(s);
          var a = c.databases[e], f = a.tables[r];
          o.onupgradeneeded = (m) => {
            m.target.transaction.abort();
            const E = new Error(`Cannot insert into table "${r}" because database "${e}" does not exist`);
            i && i(null, E);
          }, o.onsuccess = () => {
            for (var m = o.result, E = m.transaction([r], "readwrite"), p = E.objectStore(r), h = 0, g = t.length; h < g; h++) p.add(t[h]);
            E.oncomplete = function() {
              m.close();
              for (var O in f.afterinsert) if (f.afterinsert[O]) {
                var T = f.afterinsert[O];
                T.funcid ? c.fn[T.funcid](t) : T.statement && T.statement.execute(e);
              }
              i && i(g);
            };
          };
        }, o2.fromTable = function(e, r, t, n, i) {
          const s = c.databases[e].ixdbid, o = indexedDB.open(s);
          o.onupgradeneeded = (a) => {
            a.target.transaction.abort();
            const f = new Error(`Cannot select from table "${r}" because database "${e}" does not exist`);
            t && t(null, f);
          }, o.onsuccess = () => {
            const a = [], f = o.result, m = f.transaction([r]).objectStore(r).openCursor();
            m.onsuccess = () => {
              const E = m.result;
              if (E) {
                const p = typeof E == "object" ? E.value : { [E.key]: E.value };
                a.push(p), E.continue();
              } else f.close(), t && t(a, n, i);
            };
          };
        }, o2.deleteFromTable = function(e, r, t, n, i) {
          const s = c.databases[e].ixdbid, o = indexedDB.open(s);
          o.onsuccess = () => {
            const a = o.result, f = a.transaction([r], "readwrite").objectStore(r).openCursor();
            let m = 0;
            f.onsuccess = () => {
              var E = f.result;
              E ? ((!t || t(E.value, n, c)) && (E.delete(), m++), E.continue()) : (a.close(), i && i(m));
            };
          };
        }, o2.updateTable = function(e, r, t, n, i, s) {
          const o = c.databases[e].ixdbid, a = indexedDB.open(o);
          a.onsuccess = function() {
            const f = a.result, m = f.transaction([r], "readwrite").objectStore(r).openCursor();
            let E = 0;
            m.onsuccess = () => {
              var p = m.result;
              if (p) {
                if (!n || n(p.value, i)) {
                  var h = p.value;
                  t(h, i), p.update(h), E++;
                }
                p.continue();
              } else f.close(), s && s(E);
            };
          };
        }, o2.commit = function(e, r) {
          return r ? r(1) : 1;
        }, o2.begin = o2.commit, o2.rollback = function(e, r) {
          return r ? r(1) : 1;
        };
        var Ne = c.engines.LOCALSTORAGE = function() {
        };
        Ne.get = function(e) {
          var r = localStorage.getItem(e);
          if (!(typeof r > "u")) {
            var t;
            try {
              t = JSON.parse(r);
            } catch {
              throw new Error("Cannot parse JSON object from localStorage" + r);
            }
            return t;
          }
        }, Ne.set = function(e, r) {
          typeof r > "u" ? localStorage.removeItem(e) : localStorage.setItem(e, JSON.stringify(r));
        }, Ne.storeTable = function(e, r) {
          var t = c.databases[e], n = t.tables[r], i = {};
          i.columns = n.columns, i.data = n.data, i.identities = n.identities, i.defaultfns = n.defaultfns, i.onupdatefns = n.onupdatefns, Ne.set(t.lsdbid + "." + r, i);
        }, Ne.restoreTable = function(e, r) {
          var t = c.databases[e], n = Ne.get(t.lsdbid + "." + r), i = new c.Table();
          for (var s in n) i[s] = n[s];
          return t.tables[r] = i, i.indexColumns(), i;
        }, Ne.removeTable = function(e, r) {
          var t = c.databases[e];
          localStorage.removeItem(t.lsdbid + "." + r);
        }, Ne.createDatabase = function(e, r, t, n, i) {
          var s = 1, o = Ne.get("alasql");
          if (t && o && o.databases && o.databases[e]) s = 0;
          else {
            if (o || (o = { databases: {} }), o.databases && o.databases[e]) throw new Error('localStorage: Cannot create new database "' + e + '" because it already exists');
            o.databases[e] = true, Ne.set("alasql", o), Ne.set(e, { databaseid: e, tables: {} });
          }
          return i && (s = i(s)), s;
        }, Ne.dropDatabase = function(e, r, t) {
          var n = 1, i = Ne.get("alasql");
          if (r && i && i.databases && !i.databases[e]) n = 0;
          else {
            if (!i) {
              if (r) return t ? t(0) : 0;
              throw new Error("There is no any AlaSQL databases in localStorage");
            }
            if (i.databases && !i.databases[e]) throw new Error('localStorage: Cannot drop database "' + e + '" because there is no such database');
            delete i.databases[e], Ne.set("alasql", i);
            var s = Ne.get(e);
            for (var o in s.tables) localStorage.removeItem(e + "." + o);
            localStorage.removeItem(e);
          }
          return t && (n = t(n)), n;
        }, Ne.attachDatabase = function(e, r, t, n, i) {
          var s = 1;
          if (c.databases[r]) throw new Error('Unable to attach database as "' + r + '" because it already exists');
          r || (r = e);
          var o = new c.Database(r);
          if (o.engineid = "LOCALSTORAGE", o.lsdbid = e, o.tables = Ne.get(e).tables, !c.options.autocommit && o.tables) for (var a in o.tables) Ne.restoreTable(r, a);
          return i && (s = i(s)), s;
        }, Ne.showDatabases = function(e, r) {
          var t = [], n = Ne.get("alasql");
          if (e) var i = new RegExp(e.value.replace(/%/g, ".*"), "g");
          if (n && n.databases) {
            for (var s in n.databases) t.push({ databaseid: s });
            e && t && t.length > 0 && (t = t.filter(function(o) {
              return o.databaseid.match(i);
            }));
          }
          return r && (t = r(t)), t;
        }, Ne.createTable = function(e, r, t, n) {
          var i = 1, s = c.databases[e].lsdbid, o = Ne.get(s + "." + r);
          if (o && !t) throw new Error('Table "' + r + '" alsready exists in localStorage database "' + s + '"');
          var a = Ne.get(s), f = c.databases[e].tables[r];
          return a.tables[r] = true, Ne.set(s, a), Ne.storeTable(e, r), n && (i = n(i)), i;
        }, Ne.truncateTable = function(e, r, t, n) {
          var i = 1, s = c.databases[e].lsdbid, o;
          if (c.options.autocommit ? o = Ne.get(s) : o = c.databases[e], !t && !o.tables[r]) throw new Error('Cannot truncate table "' + r + '" in localStorage, because it does not exist');
          var a = Ne.restoreTable(e, r);
          return a.data = [], Ne.storeTable(e, r), n && (i = n(i)), i;
        }, Ne.dropTable = function(e, r, t, n) {
          var i = 1, s = c.databases[e].lsdbid, o;
          if (c.options.autocommit ? o = Ne.get(s) : o = c.databases[e], !t && !o.tables[r]) throw new Error('Cannot drop table "' + r + '" in localStorage, because it does not exist');
          return delete o.tables[r], Ne.set(s, o), Ne.removeTable(e, r), n && (i = n(i)), i;
        }, Ne.fromTable = function(e, r, t, n, i) {
          var s = c.databases[e].lsdbid, o = Ne.restoreTable(e, r).data;
          return t && (o = t(o, n, i)), o;
        }, Ne.intoTable = function(e, r, t, n, i) {
          var s = c.databases[e].lsdbid, o = t.length, a = Ne.restoreTable(e, r);
          for (var f in a.identities) {
            var m = a.identities[f];
            for (var E in t) t[E][f] = m.value, m.value += m.step;
          }
          return a.data || (a.data = []), a.data = a.data.concat(t), Ne.storeTable(e, r), i && (o = i(o)), o;
        }, Ne.loadTableData = function(e, r) {
          var t = c.databases[e], n = c.databases[e].lsdbid;
          Ne.restoreTable(e, r);
        }, Ne.saveTableData = function(e, r) {
          var t = c.databases[e], n = c.databases[e].lsdbid;
          Ne.storeTable(n, r), t.tables[r].data = void 0;
        }, Ne.commit = function(e, r) {
          var t = c.databases[e], n = c.databases[e].lsdbid, i = { databaseid: n, tables: {} };
          if (t.tables) for (var s in t.tables) i.tables[s] = true, Ne.storeTable(e, s);
          return Ne.set(n, i), r ? r(1) : 1;
        }, Ne.begin = Ne.commit, Ne.rollback = function(e, r) {
          return;
          var t, n, i;
          if (i.tables) for (var s in i.tables) Ne.restoreTable(e, s);
        };
        var zt = c.engines.SQLITE = function() {
        };
        zt.createDatabase = function(e, r, t, n, i) {
          throw new Error("Connot create SQLITE database in memory. Attach it.");
        }, zt.dropDatabase = function(e) {
          throw new Error("This is impossible to drop SQLite database. Detach it.");
        }, zt.attachDatabase = function(e, r, t, n, i) {
          var s = 1;
          if (c.databases[r]) throw new Error('Unable to attach database as "' + r + '" because it already exists');
          if (t[0] && t[0] instanceof S.StringValue || t[0] instanceof S.ParamValue) {
            if (t[0] instanceof S.StringValue) var o = t[0].value;
            else if (t[0] instanceof S.ParamValue) var o = n[t[0].param];
            return c.utils.loadBinaryFile(o, true, function(a) {
              var f = new c.Database(r || e);
              f.engineid = "SQLITE", f.sqldbid = e;
              var m = f.sqldb = new SQL.Database(a);
              f.tables = [];
              var E = m.exec("SELECT * FROM sqlite_master WHERE type='table'")[0].values;
              E.forEach(function(p) {
                f.tables[p[1]] = {};
                var h = f.tables[p[1]].columns = [], g = c.parse(p[4]), O = g.statements[0].columns;
                O && O.length > 0 && O.forEach(function(T) {
                  h.push(T);
                });
              }), i(1);
            }, function(a) {
              throw new Error('Cannot open SQLite database file "' + t[0].value + '"');
            }), s;
          } else throw new Error("Cannot attach SQLite database without a file");
          return s;
        }, zt.fromTable = function(e, r, t, n, i) {
          var s = c.databases[e].sqldb.exec("SELECT * FROM " + r), o = i.sources[n].columns = [];
          s[0].columns.length > 0 && s[0].columns.forEach(function(f) {
            o.push({ columnid: f });
          });
          var a = [];
          s[0].values.length > 0 && s[0].values.forEach(function(f) {
            var m = {};
            o.forEach(function(E, p) {
              m[E.columnid] = f[p];
            }), a.push(m);
          }), t && t(a, n, i);
        }, zt.intoTable = function(e, r, t, n, i) {
          for (var s = c.databases[e].sqldb, o = 0, a = t.length; o < a; o++) {
            var f = "INSERT INTO " + r + " (", m = t[o], E = Object.keys(m);
            f += E.join(","), f += ") VALUES (", f += E.map(function(h) {
              var g = m[h];
              return typeof g == "string" && (g = "'" + g + "'"), g;
            }).join(","), f += ")", s.exec(f);
          }
          var p = a;
          return i && i(p), p;
        };
        var e3 = c.engines.FILESTORAGE = c.engines.FILE = function() {
        };
        if (e3.createDatabase = function(e, r, t, n, i) {
          var s = 1, o = r[0].value;
          return c.utils.fileExists(o, function(a) {
            if (a) {
              if (t) return s = 0, i && (s = i(s)), s;
              throw new Error("Cannot create new database file, because it already exists");
            } else {
              var f = { tables: {} };
              c.utils.saveFile(o, JSON.stringify(f), function(m) {
                i && (s = i(s));
              });
            }
          }), s;
        }, e3.dropDatabase = function(e, r, t) {
          var n, i = "";
          if (typeof e == "object" && e.value) i = e.value;
          else {
            var s = c.databases[e] || {};
            i = s.filename || "", delete c.databases[e];
          }
          return c.utils.fileExists(i, function(o) {
            if (o) n = 1, c.utils.deleteFile(i, function() {
              n = 1, t && (n = t(n));
            });
            else {
              if (!r) throw new Error("Cannot drop database file, because it does not exist");
              n = 0, t && (n = t(n));
            }
          }), n;
        }, e3.attachDatabase = function(e, r, t, n, i) {
          var s = 1;
          if (c.databases[r]) throw new Error('Unable to attach database as "' + r + '" because it already exists');
          var o = new c.Database(r || e);
          return o.engineid = "FILESTORAGE", o.filename = t[0].value, On(o.filename, !!i, function(a) {
            try {
              o.data = JSON.parse(a);
            } catch {
              throw new Error("Data in FileStorage database are corrupted");
            }
            if (o.tables = o.data.tables, !c.options.autocommit && o.tables) for (var f in o.tables) o.tables[f].data = o.data[f];
            i && (s = i(s));
          }), s;
        }, e3.createTable = function(e, r, t, n) {
          var i = c.databases[e], s = i.data[r], o = 1;
          if (s && !t) throw new Error('Table "' + r + '" alsready exists in the database "' + fsdbid + '"');
          var a = c.databases[e].tables[r];
          return i.data.tables[r] = { columns: a.columns, defaultfns: a.defaultfns, onupdatefns: a.onupdatefns }, i.data[r] = [], e3.updateFile(e), n && n(o), o;
        }, e3.updateFile = function(e) {
          var r = c.databases[e];
          if (r.issaving) {
            r.postsave = true;
            return;
          }
          r.issaving = true, r.postsave = false, c.utils.saveFile(r.filename, JSON.stringify(r.data), function() {
            r.issaving = false, r.postsave && setTimeout(function() {
              e3.updateFile(e);
            }, 50);
          });
        }, e3.dropTable = function(e, r, t, n) {
          var i = 1, s = c.databases[e];
          if (!t && !s.tables[r]) throw new Error('Cannot drop table "' + r + '" in fileStorage, because it does not exist');
          return delete s.tables[r], delete s.data.tables[r], delete s.data[r], e3.updateFile(e), n && n(i), i;
        }, e3.fromTable = function(e, r, t, n, i) {
          var s = c.databases[e], o = s.data[r];
          return t && (o = t(o, n, i)), o;
        }, e3.intoTable = function(e, r, t, n, i) {
          var s = c.databases[e], o = t.length, a = s.data[r];
          return a || (a = []), s.data[r] = a.concat(t), e3.updateFile(e), i && i(o), o;
        }, e3.loadTableData = function(e, r) {
          var t = c.databases[e];
          t.tables[r].data = t.data[r];
        }, e3.saveTableData = function(e, r) {
          var t = c.databases[e];
          t.data[r] = t.tables[r].data, t.tables[r].data = null, e3.updateFile(e);
        }, e3.commit = function(e, r) {
          var t = c.databases[e], n = { tables: {} };
          if (t.tables) for (var i in t.tables) t.data.tables[i] = { columns: t.tables[i].columns, defaultfns: t.tables[i].defaultfns, onupdatefns: t.tables[i].onupdatefns }, t.data[i] = t.tables[i].data;
          return e3.updateFile(e), r ? r(1) : 1;
        }, e3.begin = e3.commit, e3.rollback = function(e, r) {
          var t = 1, n = c.databases[e];
          n.dbversion++, i();
          function i() {
            setTimeout(function() {
              if (n.issaving) return i();
              c.loadFile(n.filename, !!r, function(s) {
                n.data = s, n.tables = {};
                for (var o in n.data.tables) {
                  var a = new c.Table({ columns: n.data.tables[o].columns });
                  Be(a, n.data.tables[o]), n.tables[o] = a, c.options.autocommit || (n.tables[o].data = n.data[o]), n.tables[o].indexColumns();
                }
                delete c.databases[e], c.databases[e] = new c.Database(e), Be(c.databases[e], n), c.databases[e].engineid = "FILESTORAGE", c.databases[e].filename = n.filename, r && (t = r(t));
              });
            }, 100);
          }
        }, j1.isBrowser && !j1.isWebWorker) {
          if (c = c || false, !c) throw new Error("alasql was not found");
          c.worker = function() {
            throw new Error("Can find webworker in this enviroment");
          }, typeof Worker < "u" && (c.worker = function(e, r, t) {
            if (e === true && (e = void 0), typeof e > "u") {
              for (var n = document.getElementsByTagName("script"), i = 0; i < n.length; i++) if (n[i].src.substr(-16).toLowerCase() === "alasql-worker.js") {
                e = n[i].src.substr(0, n[i].src.length - 16) + "alasql.js";
                break;
              } else if (n[i].src.substr(-20).toLowerCase() === "alasql-worker.min.js") {
                e = n[i].src.substr(0, n[i].src.length - 20) + "alasql.min.js";
                break;
              } else if (n[i].src.substr(-9).toLowerCase() === "alasql.js") {
                e = n[i].src;
                break;
              } else if (n[i].src.substr(-13).toLowerCase() === "alasql.min.js") {
                e = n[i].src.substr(0, n[i].src.length - 13) + "alasql.min.js";
                break;
              }
            }
            if (typeof e > "u") throw new Error("Path to alasql.js is not specified");
            if (e !== false) {
              var s = "importScripts('";
              s += e, s += "');self.onmessage = function(event) {alasql(event.data.sql,event.data.params, function(data){postMessage({id:event.data.id, data:data});});}";
              var o = new Blob([s], { type: "text/plain" });
              if (c.webworker = new Worker(URL.createObjectURL(o)), c.webworker.onmessage = function(f) {
                var m = f.data.id;
                c.buffer[m](f.data.data), delete c.buffer[m];
              }, c.webworker.onerror = function(f) {
                throw f;
              }, arguments.length > 1) {
                var a = "REQUIRE " + r.map(function(f) {
                  return '"' + f + '"';
                }).join(",");
                c(a, [], t);
              }
            } else if (e === false) {
              delete c.webworker;
              return;
            }
          });
          var mt = mt || (function(e) {
            "use strict";
            if (!(typeof e > "u" || typeof navigator < "u" && /MSIE [1-9]\./.test(navigator.userAgent))) {
              var r = e.document, t = function() {
                return e.URL || e.webkitURL || e;
              }, n = r.createElementNS("http://www.w3.org/1999/xhtml", "a"), i = "download" in n, s = function(N) {
                var b = new MouseEvent("click");
                N.dispatchEvent(b);
              }, o = /constructor/i.test(e.HTMLElement) || e.safari, a = /CriOS\/[\d]+/.test(navigator.userAgent), f = function(N) {
                (e.setImmediate || e.setTimeout)(function() {
                  throw N;
                }, 0);
              }, m = "application/octet-stream", E = 1e3 * 40, p = function(N) {
                var b = function() {
                  typeof N == "string" ? t().revokeObjectURL(N) : N.remove();
                };
                setTimeout(b, E);
              }, h = function(N, b, L) {
                b = [].concat(b);
                for (var C = b.length; C--; ) {
                  var a1 = N["on" + b[C]];
                  if (typeof a1 == "function") try {
                    a1.call(N, L || N);
                  } catch (r1) {
                    f(r1);
                  }
                }
              }, g = function(N) {
                return /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(N.type) ? new Blob(["\uFEFF", N], { type: N.type }) : N;
              }, O = function(N, b, L) {
                L || (N = g(N));
                var C = this, a1 = N.type, r1 = a1 === m, H, C1 = function() {
                  h(C, "writestart progress write writeend".split(" "));
                }, k1 = function() {
                  if ((a || r1 && o) && e.FileReader) {
                    var V1 = new FileReader();
                    V1.onloadend = function() {
                      var R = a ? V1.result : V1.result.replace(/^data:[^;]*;/, "data:attachment/file;"), U1 = e.open(R, "_blank");
                      U1 || (e.location.href = R), R = void 0, C.readyState = C.DONE, C1();
                    }, V1.readAsDataURL(N), C.readyState = C.INIT;
                    return;
                  }
                  if (H || (H = t().createObjectURL(N)), r1) e.location.href = H;
                  else {
                    var J1 = e.open(H, "_blank");
                    J1 || (e.location.href = H);
                  }
                  C.readyState = C.DONE, C1(), p(H);
                };
                if (C.readyState = C.INIT, i) {
                  H = t().createObjectURL(N), setTimeout(function() {
                    n.href = H, n.download = b, s(n), C1(), p(H), C.readyState = C.DONE;
                  });
                  return;
                }
                k1();
              }, T = O.prototype, v = function(N, b, L) {
                return new O(N, b || N.name || "download", L);
              };
              return typeof navigator < "u" && navigator.msSaveOrOpenBlob ? function(N, b, L) {
                return b = b || N.name || "download", L || (N = g(N)), navigator.msSaveOrOpenBlob(N, b);
              } : (T.abort = function() {
              }, T.readyState = T.INIT = 0, T.WRITING = 1, T.DONE = 2, T.error = T.onwritestart = T.onprogress = T.onwrite = T.onabort = T.onerror = T.onwriteend = null, v);
            }
          })(typeof self < "u" && self || typeof window < "u" && window || this.content);
          typeof module < "u" && module.exports ? module.exports.saveAs = mt : typeof define < "u" && define !== null && define.amd !== null && define("FileSaver.js", function() {
            return mt;
          }), (j1.isCordova || j1.isMeteorServer || j1.isNode) && console.log("It looks like you are using the browser version of AlaSQL. Please use the alasql.fs.js file instead."), c.utils.saveAs = mt;
        }
        return new Kt("alasql"), c.use("alasql"), c;
      });
    }
  });

  // node_modules/pub-sub-es/dist/index.js
  function createUnsubscribe(stack, options) {
    function unsubscribe(eventOrSubscription, handlerOrUndefined) {
      let event;
      let handler;
      if (isSubscription(eventOrSubscription)) {
        handler = eventOrSubscription.handler;
        event = eventOrSubscription.event;
      } else {
        event = eventOrSubscription;
        handler = handlerOrUndefined;
      }
      const e = getEventName(event, options?.caseInsensitive);
      const listeners = stack[e];
      if (!listeners) {
        return;
      }
      const idx = listeners.findIndex((listener) => listener.handler === handler);
      if (idx === -1 || idx >= listeners.length) {
        return;
      }
      listeners.splice(idx, 1);
    }
    return unsubscribe;
  }
  function keys(obj) {
    return Object.keys(obj);
  }
  var broadcastChannel, isString, getEventName, createSubscribe, isSubscription, hasListeners, createPublish, createClear, createStack, createPubSub, globalPubSubStack, globalPubSub, dist_default;
  var init_dist = __esm({
    "node_modules/pub-sub-es/dist/index.js"() {
      broadcastChannel = new window.BroadcastChannel("pub-sub-es");
      isString = (key) => typeof key === "string";
      getEventName = (eventName, caseInsensitive) => {
        if (isString(eventName) && caseInsensitive) {
          return eventName.toLowerCase();
        }
        return eventName;
      };
      createSubscribe = (stack, options) => (event, handler, times = Number.POSITIVE_INFINITY) => {
        const e = getEventName(event, options?.caseInsensitive);
        const listeners = stack[e] || [];
        listeners.push({
          handler,
          times: +times || Number.POSITIVE_INFINITY
        });
        stack[e] = listeners;
        return { event: e, handler };
      };
      isSubscription = (event) => typeof event === "object";
      hasListeners = (listeners) => {
        return Boolean(listeners);
      };
      createPublish = (stack, options) => {
        const unsubscribe = createUnsubscribe(stack);
        return (...args) => {
          const [event, news, callOptions] = args;
          const eventName = getEventName(event, options?.caseInsensitive);
          const listenersOrUndefined = stack[eventName];
          if (!hasListeners(listenersOrUndefined)) {
            return;
          }
          const listeners = [...listenersOrUndefined];
          for (const listener of listeners) {
            if (--listener.times < 1) {
              unsubscribe(eventName, listener.handler);
            }
          }
          const isAsync = callOptions?.async !== void 0 ? callOptions.async : options?.async;
          const inform = () => {
            for (const listener of listeners) {
              listener.handler(news);
            }
          };
          if (isAsync) {
            setTimeout(inform, 0);
          } else {
            inform();
          }
          if (options?.isGlobal && !callOptions?.isNoGlobalBroadcast) {
            try {
              broadcastChannel.postMessage({ event: eventName, news });
            } catch (error) {
              if (error instanceof Error && error.name === "DataCloneError") {
                console.warn(`Could not broadcast '${eventName.toString()}' globally. Payload is not clonable.`);
              } else {
                throw error;
              }
            }
          }
        };
      };
      createClear = (stack) => () => {
        for (const event of keys(stack)) {
          delete stack[event];
        }
      };
      createStack = () => ({});
      createPubSub = (options) => {
        const async = Boolean(options?.async);
        const caseInsensitive = Boolean(options?.caseInsensitive);
        const stack = options?.stack || createStack();
        return {
          publish: createPublish(stack, { async, caseInsensitive }),
          subscribe: createSubscribe(stack, { caseInsensitive }),
          unsubscribe: createUnsubscribe(stack, { caseInsensitive }),
          clear: createClear(stack),
          stack
        };
      };
      globalPubSubStack = createStack();
      globalPubSub = {
        publish: createPublish(globalPubSubStack, { isGlobal: true }),
        subscribe: createSubscribe(globalPubSubStack),
        unsubscribe: createUnsubscribe(globalPubSubStack),
        clear: createClear(globalPubSubStack),
        stack: globalPubSubStack
      };
      broadcastChannel.onmessage = ({ data: { event, news } }) => globalPubSub.publish(event, news, { isNoGlobalBroadcast: true });
      dist_default = createPubSub;
    }
  });

  // node_modules/regl/dist/regl.js
  var require_regl = __commonJS({
    "node_modules/regl/dist/regl.js"(exports, module) {
      (function(global2, factory) {
        typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : global2.createREGL = factory();
      })(exports, (function() {
        "use strict";
        var isTypedArray = function(x) {
          return x instanceof Uint8Array || x instanceof Uint16Array || x instanceof Uint32Array || x instanceof Int8Array || x instanceof Int16Array || x instanceof Int32Array || x instanceof Float32Array || x instanceof Float64Array || x instanceof Uint8ClampedArray;
        };
        var extend = function(base, opts) {
          var keys2 = Object.keys(opts);
          for (var i = 0; i < keys2.length; ++i) {
            base[keys2[i]] = opts[keys2[i]];
          }
          return base;
        };
        var endl = "\n";
        function decodeB64(str) {
          if (typeof atob !== "undefined") {
            return atob(str);
          }
          return "base64:" + str;
        }
        function raise(message) {
          var error = new Error("(regl) " + message);
          console.error(error);
          throw error;
        }
        function check(pred, message) {
          if (!pred) {
            raise(message);
          }
        }
        function encolon(message) {
          if (message) {
            return ": " + message;
          }
          return "";
        }
        function checkParameter(param, possibilities, message) {
          if (!(param in possibilities)) {
            raise("unknown parameter (" + param + ")" + encolon(message) + ". possible values: " + Object.keys(possibilities).join());
          }
        }
        function checkIsTypedArray(data, message) {
          if (!isTypedArray(data)) {
            raise(
              "invalid parameter type" + encolon(message) + ". must be a typed array"
            );
          }
        }
        function standardTypeEh(value, type) {
          switch (type) {
            case "number":
              return typeof value === "number";
            case "object":
              return typeof value === "object";
            case "string":
              return typeof value === "string";
            case "boolean":
              return typeof value === "boolean";
            case "function":
              return typeof value === "function";
            case "undefined":
              return typeof value === "undefined";
            case "symbol":
              return typeof value === "symbol";
          }
        }
        function checkTypeOf(value, type, message) {
          if (!standardTypeEh(value, type)) {
            raise(
              "invalid parameter type" + encolon(message) + ". expected " + type + ", got " + typeof value
            );
          }
        }
        function checkNonNegativeInt(value, message) {
          if (!(value >= 0 && (value | 0) === value)) {
            raise("invalid parameter type, (" + value + ")" + encolon(message) + ". must be a nonnegative integer");
          }
        }
        function checkOneOf(value, list, message) {
          if (list.indexOf(value) < 0) {
            raise("invalid value" + encolon(message) + ". must be one of: " + list);
          }
        }
        var constructorKeys = [
          "gl",
          "canvas",
          "container",
          "attributes",
          "pixelRatio",
          "extensions",
          "optionalExtensions",
          "profile",
          "onDone"
        ];
        function checkConstructor(obj) {
          Object.keys(obj).forEach(function(key) {
            if (constructorKeys.indexOf(key) < 0) {
              raise('invalid regl constructor argument "' + key + '". must be one of ' + constructorKeys);
            }
          });
        }
        function leftPad(str, n) {
          str = str + "";
          while (str.length < n) {
            str = " " + str;
          }
          return str;
        }
        function ShaderFile() {
          this.name = "unknown";
          this.lines = [];
          this.index = {};
          this.hasErrors = false;
        }
        function ShaderLine(number, line2) {
          this.number = number;
          this.line = line2;
          this.errors = [];
        }
        function ShaderError(fileNumber, lineNumber, message) {
          this.file = fileNumber;
          this.line = lineNumber;
          this.message = message;
        }
        function guessCommand() {
          var error = new Error();
          var stack = (error.stack || error).toString();
          var pat = /compileProcedure.*\n\s*at.*\((.*)\)/.exec(stack);
          if (pat) {
            return pat[1];
          }
          var pat2 = /compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(stack);
          if (pat2) {
            return pat2[1];
          }
          return "unknown";
        }
        function guessCallSite() {
          var error = new Error();
          var stack = (error.stack || error).toString();
          var pat = /at REGLCommand.*\n\s+at.*\((.*)\)/.exec(stack);
          if (pat) {
            return pat[1];
          }
          var pat2 = /at REGLCommand.*\n\s+at\s+(.*)\n/.exec(stack);
          if (pat2) {
            return pat2[1];
          }
          return "unknown";
        }
        function parseSource(source, command) {
          var lines2 = source.split("\n");
          var lineNumber = 1;
          var fileNumber = 0;
          var files = {
            unknown: new ShaderFile(),
            0: new ShaderFile()
          };
          files.unknown.name = files[0].name = command || guessCommand();
          files.unknown.lines.push(new ShaderLine(0, ""));
          for (var i = 0; i < lines2.length; ++i) {
            var line2 = lines2[i];
            var parts = /^\s*#\s*(\w+)\s+(.+)\s*$/.exec(line2);
            if (parts) {
              switch (parts[1]) {
                case "line":
                  var lineNumberInfo = /(\d+)(\s+\d+)?/.exec(parts[2]);
                  if (lineNumberInfo) {
                    lineNumber = lineNumberInfo[1] | 0;
                    if (lineNumberInfo[2]) {
                      fileNumber = lineNumberInfo[2] | 0;
                      if (!(fileNumber in files)) {
                        files[fileNumber] = new ShaderFile();
                      }
                    }
                  }
                  break;
                case "define":
                  var nameInfo = /SHADER_NAME(_B64)?\s+(.*)$/.exec(parts[2]);
                  if (nameInfo) {
                    files[fileNumber].name = nameInfo[1] ? decodeB64(nameInfo[2]) : nameInfo[2];
                  }
                  break;
              }
            }
            files[fileNumber].lines.push(new ShaderLine(lineNumber++, line2));
          }
          Object.keys(files).forEach(function(fileNumber2) {
            var file = files[fileNumber2];
            file.lines.forEach(function(line3) {
              file.index[line3.number] = line3;
            });
          });
          return files;
        }
        function parseErrorLog(errLog) {
          var result = [];
          errLog.split("\n").forEach(function(errMsg) {
            if (errMsg.length < 5) {
              return;
            }
            var parts = /^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(errMsg);
            if (parts) {
              result.push(new ShaderError(
                parts[1] | 0,
                parts[2] | 0,
                parts[3].trim()
              ));
            } else if (errMsg.length > 0) {
              result.push(new ShaderError("unknown", 0, errMsg));
            }
          });
          return result;
        }
        function annotateFiles(files, errors) {
          errors.forEach(function(error) {
            var file = files[error.file];
            if (file) {
              var line2 = file.index[error.line];
              if (line2) {
                line2.errors.push(error);
                file.hasErrors = true;
                return;
              }
            }
            files.unknown.hasErrors = true;
            files.unknown.lines[0].errors.push(error);
          });
        }
        function checkShaderError(gl, shader, source, type, command) {
          if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
            var errLog = gl.getShaderInfoLog(shader);
            var typeName = type === gl.FRAGMENT_SHADER ? "fragment" : "vertex";
            checkCommandType(source, "string", typeName + " shader source must be a string", command);
            var files = parseSource(source, command);
            var errors = parseErrorLog(errLog);
            annotateFiles(files, errors);
            Object.keys(files).forEach(function(fileNumber) {
              var file = files[fileNumber];
              if (!file.hasErrors) {
                return;
              }
              var strings = [""];
              var styles = [""];
              function push2(str, style) {
                strings.push(str);
                styles.push(style || "");
              }
              push2("file number " + fileNumber + ": " + file.name + "\n", "color:red;text-decoration:underline;font-weight:bold");
              file.lines.forEach(function(line2) {
                if (line2.errors.length > 0) {
                  push2(leftPad(line2.number, 4) + "|  ", "background-color:yellow; font-weight:bold");
                  push2(line2.line + endl, "color:red; background-color:yellow; font-weight:bold");
                  var offset = 0;
                  line2.errors.forEach(function(error) {
                    var message = error.message;
                    var token = /^\s*'(.*)'\s*:\s*(.*)$/.exec(message);
                    if (token) {
                      var tokenPat = token[1];
                      message = token[2];
                      switch (tokenPat) {
                        case "assign":
                          tokenPat = "=";
                          break;
                      }
                      offset = Math.max(line2.line.indexOf(tokenPat, offset), 0);
                    } else {
                      offset = 0;
                    }
                    push2(leftPad("| ", 6));
                    push2(leftPad("^^^", offset + 3) + endl, "font-weight:bold");
                    push2(leftPad("| ", 6));
                    push2(message + endl, "font-weight:bold");
                  });
                  push2(leftPad("| ", 6) + endl);
                } else {
                  push2(leftPad(line2.number, 4) + "|  ");
                  push2(line2.line + endl, "color:red");
                }
              });
              if (typeof document !== "undefined" && !window.chrome) {
                styles[0] = strings.join("%c");
                console.log.apply(console, styles);
              } else {
                console.log(strings.join(""));
              }
            });
            check.raise("Error compiling " + typeName + " shader, " + files[0].name);
          }
        }
        function checkLinkError(gl, program, fragShader, vertShader, command) {
          if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
            var errLog = gl.getProgramInfoLog(program);
            var fragParse = parseSource(fragShader, command);
            var vertParse = parseSource(vertShader, command);
            var header = 'Error linking program with vertex shader, "' + vertParse[0].name + '", and fragment shader "' + fragParse[0].name + '"';
            if (typeof document !== "undefined") {
              console.log(
                "%c" + header + endl + "%c" + errLog,
                "color:red;text-decoration:underline;font-weight:bold",
                "color:red"
              );
            } else {
              console.log(header + endl + errLog);
            }
            check.raise(header);
          }
        }
        function saveCommandRef(object) {
          object._commandRef = guessCommand();
        }
        function saveDrawCommandInfo(opts, uniforms, attributes, stringStore) {
          saveCommandRef(opts);
          function id(str) {
            if (str) {
              return stringStore.id(str);
            }
            return 0;
          }
          opts._fragId = id(opts.static.frag);
          opts._vertId = id(opts.static.vert);
          function addProps(dict, set) {
            Object.keys(set).forEach(function(u) {
              dict[stringStore.id(u)] = true;
            });
          }
          var uniformSet = opts._uniformSet = {};
          addProps(uniformSet, uniforms.static);
          addProps(uniformSet, uniforms.dynamic);
          var attributeSet = opts._attributeSet = {};
          addProps(attributeSet, attributes.static);
          addProps(attributeSet, attributes.dynamic);
          opts._hasCount = "count" in opts.static || "count" in opts.dynamic || "elements" in opts.static || "elements" in opts.dynamic;
        }
        function commandRaise(message, command) {
          var callSite = guessCallSite();
          raise(message + " in command " + (command || guessCommand()) + (callSite === "unknown" ? "" : " called from " + callSite));
        }
        function checkCommand(pred, message, command) {
          if (!pred) {
            commandRaise(message, command || guessCommand());
          }
        }
        function checkParameterCommand(param, possibilities, message, command) {
          if (!(param in possibilities)) {
            commandRaise(
              "unknown parameter (" + param + ")" + encolon(message) + ". possible values: " + Object.keys(possibilities).join(),
              command || guessCommand()
            );
          }
        }
        function checkCommandType(value, type, message, command) {
          if (!standardTypeEh(value, type)) {
            commandRaise(
              "invalid parameter type" + encolon(message) + ". expected " + type + ", got " + typeof value,
              command || guessCommand()
            );
          }
        }
        function checkOptional(block) {
          block();
        }
        function checkFramebufferFormat(attachment, texFormats, rbFormats) {
          if (attachment.texture) {
            checkOneOf(
              attachment.texture._texture.internalformat,
              texFormats,
              "unsupported texture format for attachment"
            );
          } else {
            checkOneOf(
              attachment.renderbuffer._renderbuffer.format,
              rbFormats,
              "unsupported renderbuffer format for attachment"
            );
          }
        }
        var GL_CLAMP_TO_EDGE = 33071;
        var GL_NEAREST = 9728;
        var GL_NEAREST_MIPMAP_NEAREST = 9984;
        var GL_LINEAR_MIPMAP_NEAREST = 9985;
        var GL_NEAREST_MIPMAP_LINEAR = 9986;
        var GL_LINEAR_MIPMAP_LINEAR = 9987;
        var GL_BYTE = 5120;
        var GL_UNSIGNED_BYTE = 5121;
        var GL_SHORT = 5122;
        var GL_UNSIGNED_SHORT = 5123;
        var GL_INT = 5124;
        var GL_UNSIGNED_INT = 5125;
        var GL_FLOAT = 5126;
        var GL_UNSIGNED_SHORT_4_4_4_4 = 32819;
        var GL_UNSIGNED_SHORT_5_5_5_1 = 32820;
        var GL_UNSIGNED_SHORT_5_6_5 = 33635;
        var GL_UNSIGNED_INT_24_8_WEBGL = 34042;
        var GL_HALF_FLOAT_OES = 36193;
        var TYPE_SIZE = {};
        TYPE_SIZE[GL_BYTE] = TYPE_SIZE[GL_UNSIGNED_BYTE] = 1;
        TYPE_SIZE[GL_SHORT] = TYPE_SIZE[GL_UNSIGNED_SHORT] = TYPE_SIZE[GL_HALF_FLOAT_OES] = TYPE_SIZE[GL_UNSIGNED_SHORT_5_6_5] = TYPE_SIZE[GL_UNSIGNED_SHORT_4_4_4_4] = TYPE_SIZE[GL_UNSIGNED_SHORT_5_5_5_1] = 2;
        TYPE_SIZE[GL_INT] = TYPE_SIZE[GL_UNSIGNED_INT] = TYPE_SIZE[GL_FLOAT] = TYPE_SIZE[GL_UNSIGNED_INT_24_8_WEBGL] = 4;
        function pixelSize(type, channels) {
          if (type === GL_UNSIGNED_SHORT_5_5_5_1 || type === GL_UNSIGNED_SHORT_4_4_4_4 || type === GL_UNSIGNED_SHORT_5_6_5) {
            return 2;
          } else if (type === GL_UNSIGNED_INT_24_8_WEBGL) {
            return 4;
          } else {
            return TYPE_SIZE[type] * channels;
          }
        }
        function isPow2(v) {
          return !(v & v - 1) && !!v;
        }
        function checkTexture2D(info, mipData, limits) {
          var i;
          var w = mipData.width;
          var h = mipData.height;
          var c = mipData.channels;
          check(
            w > 0 && w <= limits.maxTextureSize && h > 0 && h <= limits.maxTextureSize,
            "invalid texture shape"
          );
          if (info.wrapS !== GL_CLAMP_TO_EDGE || info.wrapT !== GL_CLAMP_TO_EDGE) {
            check(
              isPow2(w) && isPow2(h),
              "incompatible wrap mode for texture, both width and height must be power of 2"
            );
          }
          if (mipData.mipmask === 1) {
            if (w !== 1 && h !== 1) {
              check(
                info.minFilter !== GL_NEAREST_MIPMAP_NEAREST && info.minFilter !== GL_NEAREST_MIPMAP_LINEAR && info.minFilter !== GL_LINEAR_MIPMAP_NEAREST && info.minFilter !== GL_LINEAR_MIPMAP_LINEAR,
                "min filter requires mipmap"
              );
            }
          } else {
            check(
              isPow2(w) && isPow2(h),
              "texture must be a square power of 2 to support mipmapping"
            );
            check(
              mipData.mipmask === (w << 1) - 1,
              "missing or incomplete mipmap data"
            );
          }
          if (mipData.type === GL_FLOAT) {
            if (limits.extensions.indexOf("oes_texture_float_linear") < 0) {
              check(
                info.minFilter === GL_NEAREST && info.magFilter === GL_NEAREST,
                "filter not supported, must enable oes_texture_float_linear"
              );
            }
            check(
              !info.genMipmaps,
              "mipmap generation not supported with float textures"
            );
          }
          var mipimages = mipData.images;
          for (i = 0; i < 16; ++i) {
            if (mipimages[i]) {
              var mw = w >> i;
              var mh = h >> i;
              check(mipData.mipmask & 1 << i, "missing mipmap data");
              var img = mipimages[i];
              check(
                img.width === mw && img.height === mh,
                "invalid shape for mip images"
              );
              check(
                img.format === mipData.format && img.internalformat === mipData.internalformat && img.type === mipData.type,
                "incompatible type for mip image"
              );
              if (img.compressed) {
              } else if (img.data) {
                var rowSize = Math.ceil(pixelSize(img.type, c) * mw / img.unpackAlignment) * img.unpackAlignment;
                check(
                  img.data.byteLength === rowSize * mh,
                  "invalid data for image, buffer size is inconsistent with image format"
                );
              } else if (img.element) {
              } else if (img.copy) {
              }
            } else if (!info.genMipmaps) {
              check((mipData.mipmask & 1 << i) === 0, "extra mipmap data");
            }
          }
          if (mipData.compressed) {
            check(
              !info.genMipmaps,
              "mipmap generation for compressed images not supported"
            );
          }
        }
        function checkTextureCube(texture, info, faces, limits) {
          var w = texture.width;
          var h = texture.height;
          var c = texture.channels;
          check(
            w > 0 && w <= limits.maxTextureSize && h > 0 && h <= limits.maxTextureSize,
            "invalid texture shape"
          );
          check(
            w === h,
            "cube map must be square"
          );
          check(
            info.wrapS === GL_CLAMP_TO_EDGE && info.wrapT === GL_CLAMP_TO_EDGE,
            "wrap mode not supported by cube map"
          );
          for (var i = 0; i < faces.length; ++i) {
            var face = faces[i];
            check(
              face.width === w && face.height === h,
              "inconsistent cube map face shape"
            );
            if (info.genMipmaps) {
              check(
                !face.compressed,
                "can not generate mipmap for compressed textures"
              );
              check(
                face.mipmask === 1,
                "can not specify mipmaps and generate mipmaps"
              );
            } else {
            }
            var mipmaps = face.images;
            for (var j = 0; j < 16; ++j) {
              var img = mipmaps[j];
              if (img) {
                var mw = w >> j;
                var mh = h >> j;
                check(face.mipmask & 1 << j, "missing mipmap data");
                check(
                  img.width === mw && img.height === mh,
                  "invalid shape for mip images"
                );
                check(
                  img.format === texture.format && img.internalformat === texture.internalformat && img.type === texture.type,
                  "incompatible type for mip image"
                );
                if (img.compressed) {
                } else if (img.data) {
                  check(
                    img.data.byteLength === mw * mh * Math.max(pixelSize(img.type, c), img.unpackAlignment),
                    "invalid data for image, buffer size is inconsistent with image format"
                  );
                } else if (img.element) {
                } else if (img.copy) {
                }
              }
            }
          }
        }
        var check$1 = extend(check, {
          optional: checkOptional,
          raise,
          commandRaise,
          command: checkCommand,
          parameter: checkParameter,
          commandParameter: checkParameterCommand,
          constructor: checkConstructor,
          type: checkTypeOf,
          commandType: checkCommandType,
          isTypedArray: checkIsTypedArray,
          nni: checkNonNegativeInt,
          oneOf: checkOneOf,
          shaderError: checkShaderError,
          linkError: checkLinkError,
          callSite: guessCallSite,
          saveCommandRef,
          saveDrawInfo: saveDrawCommandInfo,
          framebufferFormat: checkFramebufferFormat,
          guessCommand,
          texture2D: checkTexture2D,
          textureCube: checkTextureCube
        });
        var VARIABLE_COUNTER = 0;
        var DYN_FUNC = 0;
        var DYN_CONSTANT = 5;
        var DYN_ARRAY = 6;
        function DynamicVariable(type, data) {
          this.id = VARIABLE_COUNTER++;
          this.type = type;
          this.data = data;
        }
        function escapeStr(str) {
          return str.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
        }
        function splitParts(str) {
          if (str.length === 0) {
            return [];
          }
          var firstChar = str.charAt(0);
          var lastChar = str.charAt(str.length - 1);
          if (str.length > 1 && firstChar === lastChar && (firstChar === '"' || firstChar === "'")) {
            return ['"' + escapeStr(str.substr(1, str.length - 2)) + '"'];
          }
          var parts = /\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(str);
          if (parts) {
            return splitParts(str.substr(0, parts.index)).concat(splitParts(parts[1])).concat(splitParts(str.substr(parts.index + parts[0].length)));
          }
          var subparts = str.split(".");
          if (subparts.length === 1) {
            return ['"' + escapeStr(str) + '"'];
          }
          var result = [];
          for (var i = 0; i < subparts.length; ++i) {
            result = result.concat(splitParts(subparts[i]));
          }
          return result;
        }
        function toAccessorString(str) {
          return "[" + splitParts(str).join("][") + "]";
        }
        function defineDynamic(type, data) {
          return new DynamicVariable(type, toAccessorString(data + ""));
        }
        function isDynamic(x) {
          return typeof x === "function" && !x._reglType || x instanceof DynamicVariable;
        }
        function unbox(x, path) {
          if (typeof x === "function") {
            return new DynamicVariable(DYN_FUNC, x);
          } else if (typeof x === "number" || typeof x === "boolean") {
            return new DynamicVariable(DYN_CONSTANT, x);
          } else if (Array.isArray(x)) {
            return new DynamicVariable(DYN_ARRAY, x.map(function(y, i) {
              return unbox(y, path + "[" + i + "]");
            }));
          } else if (x instanceof DynamicVariable) {
            return x;
          }
          check$1(false, "invalid option type in uniform " + path);
        }
        var dynamic = {
          DynamicVariable,
          define: defineDynamic,
          isDynamic,
          unbox,
          accessor: toAccessorString
        };
        var raf = {
          next: typeof requestAnimationFrame === "function" ? function(cb) {
            return requestAnimationFrame(cb);
          } : function(cb) {
            return setTimeout(cb, 16);
          },
          cancel: typeof cancelAnimationFrame === "function" ? function(raf2) {
            return cancelAnimationFrame(raf2);
          } : clearTimeout
        };
        var clock = typeof performance !== "undefined" && performance.now ? function() {
          return performance.now();
        } : function() {
          return +/* @__PURE__ */ new Date();
        };
        function createStringStore() {
          var stringIds = { "": 0 };
          var stringValues = [""];
          return {
            id: function(str) {
              var result = stringIds[str];
              if (result) {
                return result;
              }
              result = stringIds[str] = stringValues.length;
              stringValues.push(str);
              return result;
            },
            str: function(id) {
              return stringValues[id];
            }
          };
        }
        function createCanvas(element, onDone, pixelRatio) {
          var canvas = document.createElement("canvas");
          extend(canvas.style, {
            border: 0,
            margin: 0,
            padding: 0,
            top: 0,
            left: 0,
            width: "100%",
            height: "100%"
          });
          element.appendChild(canvas);
          if (element === document.body) {
            canvas.style.position = "absolute";
            extend(element.style, {
              margin: 0,
              padding: 0
            });
          }
          function resize() {
            var w = window.innerWidth;
            var h = window.innerHeight;
            if (element !== document.body) {
              var bounds = canvas.getBoundingClientRect();
              w = bounds.right - bounds.left;
              h = bounds.bottom - bounds.top;
            }
            canvas.width = pixelRatio * w;
            canvas.height = pixelRatio * h;
          }
          var resizeObserver;
          if (element !== document.body && typeof ResizeObserver === "function") {
            resizeObserver = new ResizeObserver(function() {
              setTimeout(resize);
            });
            resizeObserver.observe(element);
          } else {
            window.addEventListener("resize", resize, false);
          }
          function onDestroy() {
            if (resizeObserver) {
              resizeObserver.disconnect();
            } else {
              window.removeEventListener("resize", resize);
            }
            element.removeChild(canvas);
          }
          resize();
          return {
            canvas,
            onDestroy
          };
        }
        function createContext(canvas, contextAttributes) {
          function get(name) {
            try {
              return canvas.getContext(name, contextAttributes);
            } catch (e) {
              return null;
            }
          }
          return get("webgl") || get("experimental-webgl") || get("webgl-experimental");
        }
        function isHTMLElement(obj) {
          return typeof obj.nodeName === "string" && typeof obj.appendChild === "function" && typeof obj.getBoundingClientRect === "function";
        }
        function isWebGLContext(obj) {
          return typeof obj.drawArrays === "function" || typeof obj.drawElements === "function";
        }
        function parseExtensions(input) {
          if (typeof input === "string") {
            return input.split();
          }
          check$1(Array.isArray(input), "invalid extension array");
          return input;
        }
        function getElement(desc) {
          if (typeof desc === "string") {
            check$1(typeof document !== "undefined", "not supported outside of DOM");
            return document.querySelector(desc);
          }
          return desc;
        }
        function parseArgs(args_) {
          var args = args_ || {};
          var element, container, canvas, gl;
          var contextAttributes = {};
          var extensions = [];
          var optionalExtensions = [];
          var pixelRatio = typeof window === "undefined" ? 1 : window.devicePixelRatio;
          var profile = false;
          var onDone = function(err) {
            if (err) {
              check$1.raise(err);
            }
          };
          var onDestroy = function() {
          };
          if (typeof args === "string") {
            check$1(
              typeof document !== "undefined",
              "selector queries only supported in DOM environments"
            );
            element = document.querySelector(args);
            check$1(element, "invalid query string for element");
          } else if (typeof args === "object") {
            if (isHTMLElement(args)) {
              element = args;
            } else if (isWebGLContext(args)) {
              gl = args;
              canvas = gl.canvas;
            } else {
              check$1.constructor(args);
              if ("gl" in args) {
                gl = args.gl;
              } else if ("canvas" in args) {
                canvas = getElement(args.canvas);
              } else if ("container" in args) {
                container = getElement(args.container);
              }
              if ("attributes" in args) {
                contextAttributes = args.attributes;
                check$1.type(contextAttributes, "object", "invalid context attributes");
              }
              if ("extensions" in args) {
                extensions = parseExtensions(args.extensions);
              }
              if ("optionalExtensions" in args) {
                optionalExtensions = parseExtensions(args.optionalExtensions);
              }
              if ("onDone" in args) {
                check$1.type(
                  args.onDone,
                  "function",
                  "invalid or missing onDone callback"
                );
                onDone = args.onDone;
              }
              if ("profile" in args) {
                profile = !!args.profile;
              }
              if ("pixelRatio" in args) {
                pixelRatio = +args.pixelRatio;
                check$1(pixelRatio > 0, "invalid pixel ratio");
              }
            }
          } else {
            check$1.raise("invalid arguments to regl");
          }
          if (element) {
            if (element.nodeName.toLowerCase() === "canvas") {
              canvas = element;
            } else {
              container = element;
            }
          }
          if (!gl) {
            if (!canvas) {
              check$1(
                typeof document !== "undefined",
                "must manually specify webgl context outside of DOM environments"
              );
              var result = createCanvas(container || document.body, onDone, pixelRatio);
              if (!result) {
                return null;
              }
              canvas = result.canvas;
              onDestroy = result.onDestroy;
            }
            if (contextAttributes.premultipliedAlpha === void 0) contextAttributes.premultipliedAlpha = true;
            gl = createContext(canvas, contextAttributes);
          }
          if (!gl) {
            onDestroy();
            onDone("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org");
            return null;
          }
          return {
            gl,
            canvas,
            container,
            extensions,
            optionalExtensions,
            pixelRatio,
            profile,
            onDone,
            onDestroy
          };
        }
        function createExtensionCache(gl, config) {
          var extensions = {};
          function tryLoadExtension(name_) {
            check$1.type(name_, "string", "extension name must be string");
            var name2 = name_.toLowerCase();
            var ext;
            try {
              ext = extensions[name2] = gl.getExtension(name2);
            } catch (e) {
            }
            return !!ext;
          }
          for (var i = 0; i < config.extensions.length; ++i) {
            var name = config.extensions[i];
            if (!tryLoadExtension(name)) {
              config.onDestroy();
              config.onDone('"' + name + '" extension is not supported by the current WebGL context, try upgrading your system or a different browser');
              return null;
            }
          }
          config.optionalExtensions.forEach(tryLoadExtension);
          return {
            extensions,
            restore: function() {
              Object.keys(extensions).forEach(function(name2) {
                if (extensions[name2] && !tryLoadExtension(name2)) {
                  throw new Error("(regl): error restoring extension " + name2);
                }
              });
            }
          };
        }
        function loop(n, f) {
          var result = Array(n);
          for (var i = 0; i < n; ++i) {
            result[i] = f(i);
          }
          return result;
        }
        var GL_BYTE$1 = 5120;
        var GL_UNSIGNED_BYTE$2 = 5121;
        var GL_SHORT$1 = 5122;
        var GL_UNSIGNED_SHORT$1 = 5123;
        var GL_INT$1 = 5124;
        var GL_UNSIGNED_INT$1 = 5125;
        var GL_FLOAT$2 = 5126;
        function nextPow16(v) {
          for (var i = 16; i <= 1 << 28; i *= 16) {
            if (v <= i) {
              return i;
            }
          }
          return 0;
        }
        function log2(v) {
          var r, shift;
          r = (v > 65535) << 4;
          v >>>= r;
          shift = (v > 255) << 3;
          v >>>= shift;
          r |= shift;
          shift = (v > 15) << 2;
          v >>>= shift;
          r |= shift;
          shift = (v > 3) << 1;
          v >>>= shift;
          r |= shift;
          return r | v >> 1;
        }
        function createPool() {
          var bufferPool = loop(8, function() {
            return [];
          });
          function alloc(n) {
            var sz = nextPow16(n);
            var bin = bufferPool[log2(sz) >> 2];
            if (bin.length > 0) {
              return bin.pop();
            }
            return new ArrayBuffer(sz);
          }
          function free(buf) {
            bufferPool[log2(buf.byteLength) >> 2].push(buf);
          }
          function allocType(type, n) {
            var result = null;
            switch (type) {
              case GL_BYTE$1:
                result = new Int8Array(alloc(n), 0, n);
                break;
              case GL_UNSIGNED_BYTE$2:
                result = new Uint8Array(alloc(n), 0, n);
                break;
              case GL_SHORT$1:
                result = new Int16Array(alloc(2 * n), 0, n);
                break;
              case GL_UNSIGNED_SHORT$1:
                result = new Uint16Array(alloc(2 * n), 0, n);
                break;
              case GL_INT$1:
                result = new Int32Array(alloc(4 * n), 0, n);
                break;
              case GL_UNSIGNED_INT$1:
                result = new Uint32Array(alloc(4 * n), 0, n);
                break;
              case GL_FLOAT$2:
                result = new Float32Array(alloc(4 * n), 0, n);
                break;
              default:
                return null;
            }
            if (result.length !== n) {
              return result.subarray(0, n);
            }
            return result;
          }
          function freeType(array) {
            free(array.buffer);
          }
          return {
            alloc,
            free,
            allocType,
            freeType
          };
        }
        var pool = createPool();
        pool.zero = createPool();
        var GL_SUBPIXEL_BITS = 3408;
        var GL_RED_BITS = 3410;
        var GL_GREEN_BITS = 3411;
        var GL_BLUE_BITS = 3412;
        var GL_ALPHA_BITS = 3413;
        var GL_DEPTH_BITS = 3414;
        var GL_STENCIL_BITS = 3415;
        var GL_ALIASED_POINT_SIZE_RANGE = 33901;
        var GL_ALIASED_LINE_WIDTH_RANGE = 33902;
        var GL_MAX_TEXTURE_SIZE = 3379;
        var GL_MAX_VIEWPORT_DIMS = 3386;
        var GL_MAX_VERTEX_ATTRIBS = 34921;
        var GL_MAX_VERTEX_UNIFORM_VECTORS = 36347;
        var GL_MAX_VARYING_VECTORS = 36348;
        var GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = 35661;
        var GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 35660;
        var GL_MAX_TEXTURE_IMAGE_UNITS = 34930;
        var GL_MAX_FRAGMENT_UNIFORM_VECTORS = 36349;
        var GL_MAX_CUBE_MAP_TEXTURE_SIZE = 34076;
        var GL_MAX_RENDERBUFFER_SIZE = 34024;
        var GL_VENDOR = 7936;
        var GL_RENDERER = 7937;
        var GL_VERSION = 7938;
        var GL_SHADING_LANGUAGE_VERSION = 35724;
        var GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT = 34047;
        var GL_MAX_COLOR_ATTACHMENTS_WEBGL = 36063;
        var GL_MAX_DRAW_BUFFERS_WEBGL = 34852;
        var GL_TEXTURE_2D = 3553;
        var GL_TEXTURE_CUBE_MAP = 34067;
        var GL_TEXTURE_CUBE_MAP_POSITIVE_X = 34069;
        var GL_TEXTURE0 = 33984;
        var GL_RGBA = 6408;
        var GL_FLOAT$1 = 5126;
        var GL_UNSIGNED_BYTE$1 = 5121;
        var GL_FRAMEBUFFER = 36160;
        var GL_FRAMEBUFFER_COMPLETE = 36053;
        var GL_COLOR_ATTACHMENT0 = 36064;
        var GL_COLOR_BUFFER_BIT$1 = 16384;
        var wrapLimits = function(gl, extensions) {
          var maxAnisotropic = 1;
          if (extensions.ext_texture_filter_anisotropic) {
            maxAnisotropic = gl.getParameter(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT);
          }
          var maxDrawbuffers = 1;
          var maxColorAttachments = 1;
          if (extensions.webgl_draw_buffers) {
            maxDrawbuffers = gl.getParameter(GL_MAX_DRAW_BUFFERS_WEBGL);
            maxColorAttachments = gl.getParameter(GL_MAX_COLOR_ATTACHMENTS_WEBGL);
          }
          var readFloat = !!extensions.oes_texture_float;
          if (readFloat) {
            var readFloatTexture = gl.createTexture();
            gl.bindTexture(GL_TEXTURE_2D, readFloatTexture);
            gl.texImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_FLOAT$1, null);
            var fbo = gl.createFramebuffer();
            gl.bindFramebuffer(GL_FRAMEBUFFER, fbo);
            gl.framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, readFloatTexture, 0);
            gl.bindTexture(GL_TEXTURE_2D, null);
            if (gl.checkFramebufferStatus(GL_FRAMEBUFFER) !== GL_FRAMEBUFFER_COMPLETE) readFloat = false;
            else {
              gl.viewport(0, 0, 1, 1);
              gl.clearColor(1, 0, 0, 1);
              gl.clear(GL_COLOR_BUFFER_BIT$1);
              var pixels = pool.allocType(GL_FLOAT$1, 4);
              gl.readPixels(0, 0, 1, 1, GL_RGBA, GL_FLOAT$1, pixels);
              if (gl.getError()) readFloat = false;
              else {
                gl.deleteFramebuffer(fbo);
                gl.deleteTexture(readFloatTexture);
                readFloat = pixels[0] === 1;
              }
              pool.freeType(pixels);
            }
          }
          var isIE = typeof navigator !== "undefined" && (/MSIE/.test(navigator.userAgent) || /Trident\//.test(navigator.appVersion) || /Edge/.test(navigator.userAgent));
          var npotTextureCube = true;
          if (!isIE) {
            var cubeTexture = gl.createTexture();
            var data = pool.allocType(GL_UNSIGNED_BYTE$1, 36);
            gl.activeTexture(GL_TEXTURE0);
            gl.bindTexture(GL_TEXTURE_CUBE_MAP, cubeTexture);
            gl.texImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL_RGBA, 3, 3, 0, GL_RGBA, GL_UNSIGNED_BYTE$1, data);
            pool.freeType(data);
            gl.bindTexture(GL_TEXTURE_CUBE_MAP, null);
            gl.deleteTexture(cubeTexture);
            npotTextureCube = !gl.getError();
          }
          return {
            // drawing buffer bit depth
            colorBits: [
              gl.getParameter(GL_RED_BITS),
              gl.getParameter(GL_GREEN_BITS),
              gl.getParameter(GL_BLUE_BITS),
              gl.getParameter(GL_ALPHA_BITS)
            ],
            depthBits: gl.getParameter(GL_DEPTH_BITS),
            stencilBits: gl.getParameter(GL_STENCIL_BITS),
            subpixelBits: gl.getParameter(GL_SUBPIXEL_BITS),
            // supported extensions
            extensions: Object.keys(extensions).filter(function(ext) {
              return !!extensions[ext];
            }),
            // max aniso samples
            maxAnisotropic,
            // max draw buffers
            maxDrawbuffers,
            maxColorAttachments,
            // point and line size ranges
            pointSizeDims: gl.getParameter(GL_ALIASED_POINT_SIZE_RANGE),
            lineWidthDims: gl.getParameter(GL_ALIASED_LINE_WIDTH_RANGE),
            maxViewportDims: gl.getParameter(GL_MAX_VIEWPORT_DIMS),
            maxCombinedTextureUnits: gl.getParameter(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS),
            maxCubeMapSize: gl.getParameter(GL_MAX_CUBE_MAP_TEXTURE_SIZE),
            maxRenderbufferSize: gl.getParameter(GL_MAX_RENDERBUFFER_SIZE),
            maxTextureUnits: gl.getParameter(GL_MAX_TEXTURE_IMAGE_UNITS),
            maxTextureSize: gl.getParameter(GL_MAX_TEXTURE_SIZE),
            maxAttributes: gl.getParameter(GL_MAX_VERTEX_ATTRIBS),
            maxVertexUniforms: gl.getParameter(GL_MAX_VERTEX_UNIFORM_VECTORS),
            maxVertexTextureUnits: gl.getParameter(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS),
            maxVaryingVectors: gl.getParameter(GL_MAX_VARYING_VECTORS),
            maxFragmentUniforms: gl.getParameter(GL_MAX_FRAGMENT_UNIFORM_VECTORS),
            // vendor info
            glsl: gl.getParameter(GL_SHADING_LANGUAGE_VERSION),
            renderer: gl.getParameter(GL_RENDERER),
            vendor: gl.getParameter(GL_VENDOR),
            version: gl.getParameter(GL_VERSION),
            // quirks
            readFloat,
            npotTextureCube
          };
        };
        function isNDArrayLike(obj) {
          return !!obj && typeof obj === "object" && Array.isArray(obj.shape) && Array.isArray(obj.stride) && typeof obj.offset === "number" && obj.shape.length === obj.stride.length && (Array.isArray(obj.data) || isTypedArray(obj.data));
        }
        var values = function(obj) {
          return Object.keys(obj).map(function(key) {
            return obj[key];
          });
        };
        var flattenUtils = {
          shape: arrayShape$1,
          flatten: flattenArray
        };
        function flatten1D(array, nx, out) {
          for (var i = 0; i < nx; ++i) {
            out[i] = array[i];
          }
        }
        function flatten2D(array, nx, ny, out) {
          var ptr = 0;
          for (var i = 0; i < nx; ++i) {
            var row = array[i];
            for (var j = 0; j < ny; ++j) {
              out[ptr++] = row[j];
            }
          }
        }
        function flatten3D(array, nx, ny, nz, out, ptr_) {
          var ptr = ptr_;
          for (var i = 0; i < nx; ++i) {
            var row = array[i];
            for (var j = 0; j < ny; ++j) {
              var col = row[j];
              for (var k = 0; k < nz; ++k) {
                out[ptr++] = col[k];
              }
            }
          }
        }
        function flattenRec(array, shape, level, out, ptr) {
          var stride = 1;
          for (var i = level + 1; i < shape.length; ++i) {
            stride *= shape[i];
          }
          var n = shape[level];
          if (shape.length - level === 4) {
            var nx = shape[level + 1];
            var ny = shape[level + 2];
            var nz = shape[level + 3];
            for (i = 0; i < n; ++i) {
              flatten3D(array[i], nx, ny, nz, out, ptr);
              ptr += stride;
            }
          } else {
            for (i = 0; i < n; ++i) {
              flattenRec(array[i], shape, level + 1, out, ptr);
              ptr += stride;
            }
          }
        }
        function flattenArray(array, shape, type, out_) {
          var sz = 1;
          if (shape.length) {
            for (var i = 0; i < shape.length; ++i) {
              sz *= shape[i];
            }
          } else {
            sz = 0;
          }
          var out = out_ || pool.allocType(type, sz);
          switch (shape.length) {
            case 0:
              break;
            case 1:
              flatten1D(array, shape[0], out);
              break;
            case 2:
              flatten2D(array, shape[0], shape[1], out);
              break;
            case 3:
              flatten3D(array, shape[0], shape[1], shape[2], out, 0);
              break;
            default:
              flattenRec(array, shape, 0, out, 0);
          }
          return out;
        }
        function arrayShape$1(array_) {
          var shape = [];
          for (var array = array_; array.length; array = array[0]) {
            shape.push(array.length);
          }
          return shape;
        }
        var arrayTypes = {
          "[object Int8Array]": 5120,
          "[object Int16Array]": 5122,
          "[object Int32Array]": 5124,
          "[object Uint8Array]": 5121,
          "[object Uint8ClampedArray]": 5121,
          "[object Uint16Array]": 5123,
          "[object Uint32Array]": 5125,
          "[object Float32Array]": 5126,
          "[object Float64Array]": 5121,
          "[object ArrayBuffer]": 5121
        };
        var int8 = 5120;
        var int16 = 5122;
        var int322 = 5124;
        var uint8 = 5121;
        var uint16 = 5123;
        var uint32 = 5125;
        var float = 5126;
        var float322 = 5126;
        var glTypes = {
          int8,
          int16,
          int32: int322,
          uint8,
          uint16,
          uint32,
          float,
          float32: float322
        };
        var dynamic$1 = 35048;
        var stream = 35040;
        var usageTypes = {
          dynamic: dynamic$1,
          stream,
          "static": 35044
        };
        var arrayFlatten = flattenUtils.flatten;
        var arrayShape = flattenUtils.shape;
        var GL_STATIC_DRAW = 35044;
        var GL_STREAM_DRAW = 35040;
        var GL_UNSIGNED_BYTE$3 = 5121;
        var GL_FLOAT$3 = 5126;
        var DTYPES_SIZES = [];
        DTYPES_SIZES[5120] = 1;
        DTYPES_SIZES[5122] = 2;
        DTYPES_SIZES[5124] = 4;
        DTYPES_SIZES[5121] = 1;
        DTYPES_SIZES[5123] = 2;
        DTYPES_SIZES[5125] = 4;
        DTYPES_SIZES[5126] = 4;
        function typedArrayCode(data) {
          return arrayTypes[Object.prototype.toString.call(data)] | 0;
        }
        function copyArray(out, inp) {
          for (var i = 0; i < inp.length; ++i) {
            out[i] = inp[i];
          }
        }
        function transpose(result, data, shapeX, shapeY, strideX, strideY, offset) {
          var ptr = 0;
          for (var i = 0; i < shapeX; ++i) {
            for (var j = 0; j < shapeY; ++j) {
              result[ptr++] = data[strideX * i + strideY * j + offset];
            }
          }
        }
        function wrapBufferState(gl, stats2, config, destroyBuffer) {
          var bufferCount = 0;
          var bufferSet = {};
          function REGLBuffer(type) {
            this.id = bufferCount++;
            this.buffer = gl.createBuffer();
            this.type = type;
            this.usage = GL_STATIC_DRAW;
            this.byteLength = 0;
            this.dimension = 1;
            this.dtype = GL_UNSIGNED_BYTE$3;
            this.persistentData = null;
            if (config.profile) {
              this.stats = { size: 0 };
            }
          }
          REGLBuffer.prototype.bind = function() {
            gl.bindBuffer(this.type, this.buffer);
          };
          REGLBuffer.prototype.destroy = function() {
            destroy(this);
          };
          var streamPool = [];
          function createStream(type, data) {
            var buffer = streamPool.pop();
            if (!buffer) {
              buffer = new REGLBuffer(type);
            }
            buffer.bind();
            initBufferFromData(buffer, data, GL_STREAM_DRAW, 0, 1, false);
            return buffer;
          }
          function destroyStream(stream$$1) {
            streamPool.push(stream$$1);
          }
          function initBufferFromTypedArray(buffer, data, usage) {
            buffer.byteLength = data.byteLength;
            gl.bufferData(buffer.type, data, usage);
          }
          function initBufferFromData(buffer, data, usage, dtype, dimension, persist) {
            var shape;
            buffer.usage = usage;
            if (Array.isArray(data)) {
              buffer.dtype = dtype || GL_FLOAT$3;
              if (data.length > 0) {
                var flatData;
                if (Array.isArray(data[0])) {
                  shape = arrayShape(data);
                  var dim = 1;
                  for (var i = 1; i < shape.length; ++i) {
                    dim *= shape[i];
                  }
                  buffer.dimension = dim;
                  flatData = arrayFlatten(data, shape, buffer.dtype);
                  initBufferFromTypedArray(buffer, flatData, usage);
                  if (persist) {
                    buffer.persistentData = flatData;
                  } else {
                    pool.freeType(flatData);
                  }
                } else if (typeof data[0] === "number") {
                  buffer.dimension = dimension;
                  var typedData = pool.allocType(buffer.dtype, data.length);
                  copyArray(typedData, data);
                  initBufferFromTypedArray(buffer, typedData, usage);
                  if (persist) {
                    buffer.persistentData = typedData;
                  } else {
                    pool.freeType(typedData);
                  }
                } else if (isTypedArray(data[0])) {
                  buffer.dimension = data[0].length;
                  buffer.dtype = dtype || typedArrayCode(data[0]) || GL_FLOAT$3;
                  flatData = arrayFlatten(
                    data,
                    [data.length, data[0].length],
                    buffer.dtype
                  );
                  initBufferFromTypedArray(buffer, flatData, usage);
                  if (persist) {
                    buffer.persistentData = flatData;
                  } else {
                    pool.freeType(flatData);
                  }
                } else {
                  check$1.raise("invalid buffer data");
                }
              }
            } else if (isTypedArray(data)) {
              buffer.dtype = dtype || typedArrayCode(data);
              buffer.dimension = dimension;
              initBufferFromTypedArray(buffer, data, usage);
              if (persist) {
                buffer.persistentData = new Uint8Array(new Uint8Array(data.buffer));
              }
            } else if (isNDArrayLike(data)) {
              shape = data.shape;
              var stride = data.stride;
              var offset = data.offset;
              var shapeX = 0;
              var shapeY = 0;
              var strideX = 0;
              var strideY = 0;
              if (shape.length === 1) {
                shapeX = shape[0];
                shapeY = 1;
                strideX = stride[0];
                strideY = 0;
              } else if (shape.length === 2) {
                shapeX = shape[0];
                shapeY = shape[1];
                strideX = stride[0];
                strideY = stride[1];
              } else {
                check$1.raise("invalid shape");
              }
              buffer.dtype = dtype || typedArrayCode(data.data) || GL_FLOAT$3;
              buffer.dimension = shapeY;
              var transposeData2 = pool.allocType(buffer.dtype, shapeX * shapeY);
              transpose(
                transposeData2,
                data.data,
                shapeX,
                shapeY,
                strideX,
                strideY,
                offset
              );
              initBufferFromTypedArray(buffer, transposeData2, usage);
              if (persist) {
                buffer.persistentData = transposeData2;
              } else {
                pool.freeType(transposeData2);
              }
            } else if (data instanceof ArrayBuffer) {
              buffer.dtype = GL_UNSIGNED_BYTE$3;
              buffer.dimension = dimension;
              initBufferFromTypedArray(buffer, data, usage);
              if (persist) {
                buffer.persistentData = new Uint8Array(new Uint8Array(data));
              }
            } else {
              check$1.raise("invalid buffer data");
            }
          }
          function destroy(buffer) {
            stats2.bufferCount--;
            destroyBuffer(buffer);
            var handle = buffer.buffer;
            check$1(handle, "buffer must not be deleted already");
            gl.deleteBuffer(handle);
            buffer.buffer = null;
            delete bufferSet[buffer.id];
          }
          function createBuffer(options, type, deferInit, persistent) {
            stats2.bufferCount++;
            var buffer = new REGLBuffer(type);
            bufferSet[buffer.id] = buffer;
            function reglBuffer(options2) {
              var usage = GL_STATIC_DRAW;
              var data = null;
              var byteLength = 0;
              var dtype = 0;
              var dimension = 1;
              if (Array.isArray(options2) || isTypedArray(options2) || isNDArrayLike(options2) || options2 instanceof ArrayBuffer) {
                data = options2;
              } else if (typeof options2 === "number") {
                byteLength = options2 | 0;
              } else if (options2) {
                check$1.type(
                  options2,
                  "object",
                  "buffer arguments must be an object, a number or an array"
                );
                if ("data" in options2) {
                  check$1(
                    data === null || Array.isArray(data) || isTypedArray(data) || isNDArrayLike(data),
                    "invalid data for buffer"
                  );
                  data = options2.data;
                }
                if ("usage" in options2) {
                  check$1.parameter(options2.usage, usageTypes, "invalid buffer usage");
                  usage = usageTypes[options2.usage];
                }
                if ("type" in options2) {
                  check$1.parameter(options2.type, glTypes, "invalid buffer type");
                  dtype = glTypes[options2.type];
                }
                if ("dimension" in options2) {
                  check$1.type(options2.dimension, "number", "invalid dimension");
                  dimension = options2.dimension | 0;
                }
                if ("length" in options2) {
                  check$1.nni(byteLength, "buffer length must be a nonnegative integer");
                  byteLength = options2.length | 0;
                }
              }
              buffer.bind();
              if (!data) {
                if (byteLength) gl.bufferData(buffer.type, byteLength, usage);
                buffer.dtype = dtype || GL_UNSIGNED_BYTE$3;
                buffer.usage = usage;
                buffer.dimension = dimension;
                buffer.byteLength = byteLength;
              } else {
                initBufferFromData(buffer, data, usage, dtype, dimension, persistent);
              }
              if (config.profile) {
                buffer.stats.size = buffer.byteLength * DTYPES_SIZES[buffer.dtype];
              }
              return reglBuffer;
            }
            function setSubData(data, offset) {
              check$1(
                offset + data.byteLength <= buffer.byteLength,
                "invalid buffer subdata call, buffer is too small.  Can't write data of size " + data.byteLength + " starting from offset " + offset + " to a buffer of size " + buffer.byteLength
              );
              gl.bufferSubData(buffer.type, offset, data);
            }
            function subdata(data, offset_) {
              var offset = (offset_ || 0) | 0;
              var shape;
              buffer.bind();
              if (isTypedArray(data) || data instanceof ArrayBuffer) {
                setSubData(data, offset);
              } else if (Array.isArray(data)) {
                if (data.length > 0) {
                  if (typeof data[0] === "number") {
                    var converted = pool.allocType(buffer.dtype, data.length);
                    copyArray(converted, data);
                    setSubData(converted, offset);
                    pool.freeType(converted);
                  } else if (Array.isArray(data[0]) || isTypedArray(data[0])) {
                    shape = arrayShape(data);
                    var flatData = arrayFlatten(data, shape, buffer.dtype);
                    setSubData(flatData, offset);
                    pool.freeType(flatData);
                  } else {
                    check$1.raise("invalid buffer data");
                  }
                }
              } else if (isNDArrayLike(data)) {
                shape = data.shape;
                var stride = data.stride;
                var shapeX = 0;
                var shapeY = 0;
                var strideX = 0;
                var strideY = 0;
                if (shape.length === 1) {
                  shapeX = shape[0];
                  shapeY = 1;
                  strideX = stride[0];
                  strideY = 0;
                } else if (shape.length === 2) {
                  shapeX = shape[0];
                  shapeY = shape[1];
                  strideX = stride[0];
                  strideY = stride[1];
                } else {
                  check$1.raise("invalid shape");
                }
                var dtype = Array.isArray(data.data) ? buffer.dtype : typedArrayCode(data.data);
                var transposeData2 = pool.allocType(dtype, shapeX * shapeY);
                transpose(
                  transposeData2,
                  data.data,
                  shapeX,
                  shapeY,
                  strideX,
                  strideY,
                  data.offset
                );
                setSubData(transposeData2, offset);
                pool.freeType(transposeData2);
              } else {
                check$1.raise("invalid data for buffer subdata");
              }
              return reglBuffer;
            }
            if (!deferInit) {
              reglBuffer(options);
            }
            reglBuffer._reglType = "buffer";
            reglBuffer._buffer = buffer;
            reglBuffer.subdata = subdata;
            if (config.profile) {
              reglBuffer.stats = buffer.stats;
            }
            reglBuffer.destroy = function() {
              destroy(buffer);
            };
            return reglBuffer;
          }
          function restoreBuffers() {
            values(bufferSet).forEach(function(buffer) {
              buffer.buffer = gl.createBuffer();
              gl.bindBuffer(buffer.type, buffer.buffer);
              gl.bufferData(
                buffer.type,
                buffer.persistentData || buffer.byteLength,
                buffer.usage
              );
            });
          }
          if (config.profile) {
            stats2.getTotalBufferSize = function() {
              var total = 0;
              Object.keys(bufferSet).forEach(function(key) {
                total += bufferSet[key].stats.size;
              });
              return total;
            };
          }
          return {
            create: createBuffer,
            createStream,
            destroyStream,
            clear: function() {
              values(bufferSet).forEach(destroy);
              streamPool.forEach(destroy);
            },
            getBuffer: function(wrapper) {
              if (wrapper && wrapper._buffer instanceof REGLBuffer) {
                return wrapper._buffer;
              }
              return null;
            },
            restore: restoreBuffers,
            _initBuffer: initBufferFromData
          };
        }
        var points = 0;
        var point = 0;
        var lines = 1;
        var line = 1;
        var triangles = 4;
        var triangle = 4;
        var primTypes = {
          points,
          point,
          lines,
          line,
          triangles,
          triangle,
          "line loop": 2,
          "line strip": 3,
          "triangle strip": 5,
          "triangle fan": 6
        };
        var GL_POINTS = 0;
        var GL_LINES = 1;
        var GL_TRIANGLES = 4;
        var GL_BYTE$2 = 5120;
        var GL_UNSIGNED_BYTE$4 = 5121;
        var GL_SHORT$2 = 5122;
        var GL_UNSIGNED_SHORT$2 = 5123;
        var GL_INT$2 = 5124;
        var GL_UNSIGNED_INT$2 = 5125;
        var GL_ELEMENT_ARRAY_BUFFER = 34963;
        var GL_STREAM_DRAW$1 = 35040;
        var GL_STATIC_DRAW$1 = 35044;
        function wrapElementsState(gl, extensions, bufferState, stats2) {
          var elementSet = {};
          var elementCount = 0;
          var elementTypes = {
            "uint8": GL_UNSIGNED_BYTE$4,
            "uint16": GL_UNSIGNED_SHORT$2
          };
          if (extensions.oes_element_index_uint) {
            elementTypes.uint32 = GL_UNSIGNED_INT$2;
          }
          function REGLElementBuffer(buffer) {
            this.id = elementCount++;
            elementSet[this.id] = this;
            this.buffer = buffer;
            this.primType = GL_TRIANGLES;
            this.vertCount = 0;
            this.type = 0;
          }
          REGLElementBuffer.prototype.bind = function() {
            this.buffer.bind();
          };
          var bufferPool = [];
          function createElementStream(data) {
            var result = bufferPool.pop();
            if (!result) {
              result = new REGLElementBuffer(bufferState.create(
                null,
                GL_ELEMENT_ARRAY_BUFFER,
                true,
                false
              )._buffer);
            }
            initElements(result, data, GL_STREAM_DRAW$1, -1, -1, 0, 0);
            return result;
          }
          function destroyElementStream(elements) {
            bufferPool.push(elements);
          }
          function initElements(elements, data, usage, prim, count, byteLength, type) {
            elements.buffer.bind();
            var dtype;
            if (data) {
              var predictedType = type;
              if (!type && (!isTypedArray(data) || isNDArrayLike(data) && !isTypedArray(data.data))) {
                predictedType = extensions.oes_element_index_uint ? GL_UNSIGNED_INT$2 : GL_UNSIGNED_SHORT$2;
              }
              bufferState._initBuffer(
                elements.buffer,
                data,
                usage,
                predictedType,
                3
              );
            } else {
              gl.bufferData(GL_ELEMENT_ARRAY_BUFFER, byteLength, usage);
              elements.buffer.dtype = dtype || GL_UNSIGNED_BYTE$4;
              elements.buffer.usage = usage;
              elements.buffer.dimension = 3;
              elements.buffer.byteLength = byteLength;
            }
            dtype = type;
            if (!type) {
              switch (elements.buffer.dtype) {
                case GL_UNSIGNED_BYTE$4:
                case GL_BYTE$2:
                  dtype = GL_UNSIGNED_BYTE$4;
                  break;
                case GL_UNSIGNED_SHORT$2:
                case GL_SHORT$2:
                  dtype = GL_UNSIGNED_SHORT$2;
                  break;
                case GL_UNSIGNED_INT$2:
                case GL_INT$2:
                  dtype = GL_UNSIGNED_INT$2;
                  break;
                default:
                  check$1.raise("unsupported type for element array");
              }
              elements.buffer.dtype = dtype;
            }
            elements.type = dtype;
            check$1(
              dtype !== GL_UNSIGNED_INT$2 || !!extensions.oes_element_index_uint,
              "32 bit element buffers not supported, enable oes_element_index_uint first"
            );
            var vertCount = count;
            if (vertCount < 0) {
              vertCount = elements.buffer.byteLength;
              if (dtype === GL_UNSIGNED_SHORT$2) {
                vertCount >>= 1;
              } else if (dtype === GL_UNSIGNED_INT$2) {
                vertCount >>= 2;
              }
            }
            elements.vertCount = vertCount;
            var primType = prim;
            if (prim < 0) {
              primType = GL_TRIANGLES;
              var dimension = elements.buffer.dimension;
              if (dimension === 1) primType = GL_POINTS;
              if (dimension === 2) primType = GL_LINES;
              if (dimension === 3) primType = GL_TRIANGLES;
            }
            elements.primType = primType;
          }
          function destroyElements(elements) {
            stats2.elementsCount--;
            check$1(elements.buffer !== null, "must not double destroy elements");
            delete elementSet[elements.id];
            elements.buffer.destroy();
            elements.buffer = null;
          }
          function createElements(options, persistent) {
            var buffer = bufferState.create(null, GL_ELEMENT_ARRAY_BUFFER, true);
            var elements = new REGLElementBuffer(buffer._buffer);
            stats2.elementsCount++;
            function reglElements(options2) {
              if (!options2) {
                buffer();
                elements.primType = GL_TRIANGLES;
                elements.vertCount = 0;
                elements.type = GL_UNSIGNED_BYTE$4;
              } else if (typeof options2 === "number") {
                buffer(options2);
                elements.primType = GL_TRIANGLES;
                elements.vertCount = options2 | 0;
                elements.type = GL_UNSIGNED_BYTE$4;
              } else {
                var data = null;
                var usage = GL_STATIC_DRAW$1;
                var primType = -1;
                var vertCount = -1;
                var byteLength = 0;
                var dtype = 0;
                if (Array.isArray(options2) || isTypedArray(options2) || isNDArrayLike(options2)) {
                  data = options2;
                } else {
                  check$1.type(options2, "object", "invalid arguments for elements");
                  if ("data" in options2) {
                    data = options2.data;
                    check$1(
                      Array.isArray(data) || isTypedArray(data) || isNDArrayLike(data),
                      "invalid data for element buffer"
                    );
                  }
                  if ("usage" in options2) {
                    check$1.parameter(
                      options2.usage,
                      usageTypes,
                      "invalid element buffer usage"
                    );
                    usage = usageTypes[options2.usage];
                  }
                  if ("primitive" in options2) {
                    check$1.parameter(
                      options2.primitive,
                      primTypes,
                      "invalid element buffer primitive"
                    );
                    primType = primTypes[options2.primitive];
                  }
                  if ("count" in options2) {
                    check$1(
                      typeof options2.count === "number" && options2.count >= 0,
                      "invalid vertex count for elements"
                    );
                    vertCount = options2.count | 0;
                  }
                  if ("type" in options2) {
                    check$1.parameter(
                      options2.type,
                      elementTypes,
                      "invalid buffer type"
                    );
                    dtype = elementTypes[options2.type];
                  }
                  if ("length" in options2) {
                    byteLength = options2.length | 0;
                  } else {
                    byteLength = vertCount;
                    if (dtype === GL_UNSIGNED_SHORT$2 || dtype === GL_SHORT$2) {
                      byteLength *= 2;
                    } else if (dtype === GL_UNSIGNED_INT$2 || dtype === GL_INT$2) {
                      byteLength *= 4;
                    }
                  }
                }
                initElements(
                  elements,
                  data,
                  usage,
                  primType,
                  vertCount,
                  byteLength,
                  dtype
                );
              }
              return reglElements;
            }
            reglElements(options);
            reglElements._reglType = "elements";
            reglElements._elements = elements;
            reglElements.subdata = function(data, offset) {
              buffer.subdata(data, offset);
              return reglElements;
            };
            reglElements.destroy = function() {
              destroyElements(elements);
            };
            return reglElements;
          }
          return {
            create: createElements,
            createStream: createElementStream,
            destroyStream: destroyElementStream,
            getElements: function(elements) {
              if (typeof elements === "function" && elements._elements instanceof REGLElementBuffer) {
                return elements._elements;
              }
              return null;
            },
            clear: function() {
              values(elementSet).forEach(destroyElements);
            }
          };
        }
        var FLOAT = new Float32Array(1);
        var INT = new Uint32Array(FLOAT.buffer);
        var GL_UNSIGNED_SHORT$4 = 5123;
        function convertToHalfFloat(array) {
          var ushorts = pool.allocType(GL_UNSIGNED_SHORT$4, array.length);
          for (var i = 0; i < array.length; ++i) {
            if (isNaN(array[i])) {
              ushorts[i] = 65535;
            } else if (array[i] === Infinity) {
              ushorts[i] = 31744;
            } else if (array[i] === -Infinity) {
              ushorts[i] = 64512;
            } else {
              FLOAT[0] = array[i];
              var x = INT[0];
              var sgn = x >>> 31 << 15;
              var exp = (x << 1 >>> 24) - 127;
              var frac = x >> 13 & (1 << 10) - 1;
              if (exp < -24) {
                ushorts[i] = sgn;
              } else if (exp < -14) {
                var s = -14 - exp;
                ushorts[i] = sgn + (frac + (1 << 10) >> s);
              } else if (exp > 15) {
                ushorts[i] = sgn + 31744;
              } else {
                ushorts[i] = sgn + (exp + 15 << 10) + frac;
              }
            }
          }
          return ushorts;
        }
        function isArrayLike(s) {
          return Array.isArray(s) || isTypedArray(s);
        }
        var isPow2$1 = function(v) {
          return !(v & v - 1) && !!v;
        };
        var GL_COMPRESSED_TEXTURE_FORMATS = 34467;
        var GL_TEXTURE_2D$1 = 3553;
        var GL_TEXTURE_CUBE_MAP$1 = 34067;
        var GL_TEXTURE_CUBE_MAP_POSITIVE_X$1 = 34069;
        var GL_RGBA$1 = 6408;
        var GL_ALPHA = 6406;
        var GL_RGB = 6407;
        var GL_LUMINANCE = 6409;
        var GL_LUMINANCE_ALPHA = 6410;
        var GL_RGBA4 = 32854;
        var GL_RGB5_A1 = 32855;
        var GL_RGB565 = 36194;
        var GL_UNSIGNED_SHORT_4_4_4_4$1 = 32819;
        var GL_UNSIGNED_SHORT_5_5_5_1$1 = 32820;
        var GL_UNSIGNED_SHORT_5_6_5$1 = 33635;
        var GL_UNSIGNED_INT_24_8_WEBGL$1 = 34042;
        var GL_DEPTH_COMPONENT = 6402;
        var GL_DEPTH_STENCIL = 34041;
        var GL_SRGB_EXT = 35904;
        var GL_SRGB_ALPHA_EXT = 35906;
        var GL_HALF_FLOAT_OES$1 = 36193;
        var GL_COMPRESSED_RGB_S3TC_DXT1_EXT = 33776;
        var GL_COMPRESSED_RGBA_S3TC_DXT1_EXT = 33777;
        var GL_COMPRESSED_RGBA_S3TC_DXT3_EXT = 33778;
        var GL_COMPRESSED_RGBA_S3TC_DXT5_EXT = 33779;
        var GL_COMPRESSED_RGB_ATC_WEBGL = 35986;
        var GL_COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL = 35987;
        var GL_COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL = 34798;
        var GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 35840;
        var GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 35841;
        var GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 35842;
        var GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 35843;
        var GL_COMPRESSED_RGB_ETC1_WEBGL = 36196;
        var GL_UNSIGNED_BYTE$5 = 5121;
        var GL_UNSIGNED_SHORT$3 = 5123;
        var GL_UNSIGNED_INT$3 = 5125;
        var GL_FLOAT$4 = 5126;
        var GL_TEXTURE_WRAP_S = 10242;
        var GL_TEXTURE_WRAP_T = 10243;
        var GL_REPEAT = 10497;
        var GL_CLAMP_TO_EDGE$1 = 33071;
        var GL_MIRRORED_REPEAT = 33648;
        var GL_TEXTURE_MAG_FILTER = 10240;
        var GL_TEXTURE_MIN_FILTER = 10241;
        var GL_NEAREST$1 = 9728;
        var GL_LINEAR = 9729;
        var GL_NEAREST_MIPMAP_NEAREST$1 = 9984;
        var GL_LINEAR_MIPMAP_NEAREST$1 = 9985;
        var GL_NEAREST_MIPMAP_LINEAR$1 = 9986;
        var GL_LINEAR_MIPMAP_LINEAR$1 = 9987;
        var GL_GENERATE_MIPMAP_HINT = 33170;
        var GL_DONT_CARE = 4352;
        var GL_FASTEST = 4353;
        var GL_NICEST = 4354;
        var GL_TEXTURE_MAX_ANISOTROPY_EXT = 34046;
        var GL_UNPACK_ALIGNMENT = 3317;
        var GL_UNPACK_FLIP_Y_WEBGL = 37440;
        var GL_UNPACK_PREMULTIPLY_ALPHA_WEBGL = 37441;
        var GL_UNPACK_COLORSPACE_CONVERSION_WEBGL = 37443;
        var GL_BROWSER_DEFAULT_WEBGL = 37444;
        var GL_TEXTURE0$1 = 33984;
        var MIPMAP_FILTERS = [
          GL_NEAREST_MIPMAP_NEAREST$1,
          GL_NEAREST_MIPMAP_LINEAR$1,
          GL_LINEAR_MIPMAP_NEAREST$1,
          GL_LINEAR_MIPMAP_LINEAR$1
        ];
        var CHANNELS_FORMAT = [
          0,
          GL_LUMINANCE,
          GL_LUMINANCE_ALPHA,
          GL_RGB,
          GL_RGBA$1
        ];
        var FORMAT_CHANNELS = {};
        FORMAT_CHANNELS[GL_LUMINANCE] = FORMAT_CHANNELS[GL_ALPHA] = FORMAT_CHANNELS[GL_DEPTH_COMPONENT] = 1;
        FORMAT_CHANNELS[GL_DEPTH_STENCIL] = FORMAT_CHANNELS[GL_LUMINANCE_ALPHA] = 2;
        FORMAT_CHANNELS[GL_RGB] = FORMAT_CHANNELS[GL_SRGB_EXT] = 3;
        FORMAT_CHANNELS[GL_RGBA$1] = FORMAT_CHANNELS[GL_SRGB_ALPHA_EXT] = 4;
        function objectName(str) {
          return "[object " + str + "]";
        }
        var CANVAS_CLASS = objectName("HTMLCanvasElement");
        var OFFSCREENCANVAS_CLASS = objectName("OffscreenCanvas");
        var CONTEXT2D_CLASS = objectName("CanvasRenderingContext2D");
        var BITMAP_CLASS = objectName("ImageBitmap");
        var IMAGE_CLASS = objectName("HTMLImageElement");
        var VIDEO_CLASS = objectName("HTMLVideoElement");
        var PIXEL_CLASSES = Object.keys(arrayTypes).concat([
          CANVAS_CLASS,
          OFFSCREENCANVAS_CLASS,
          CONTEXT2D_CLASS,
          BITMAP_CLASS,
          IMAGE_CLASS,
          VIDEO_CLASS
        ]);
        var TYPE_SIZES = [];
        TYPE_SIZES[GL_UNSIGNED_BYTE$5] = 1;
        TYPE_SIZES[GL_FLOAT$4] = 4;
        TYPE_SIZES[GL_HALF_FLOAT_OES$1] = 2;
        TYPE_SIZES[GL_UNSIGNED_SHORT$3] = 2;
        TYPE_SIZES[GL_UNSIGNED_INT$3] = 4;
        var FORMAT_SIZES_SPECIAL = [];
        FORMAT_SIZES_SPECIAL[GL_RGBA4] = 2;
        FORMAT_SIZES_SPECIAL[GL_RGB5_A1] = 2;
        FORMAT_SIZES_SPECIAL[GL_RGB565] = 2;
        FORMAT_SIZES_SPECIAL[GL_DEPTH_STENCIL] = 4;
        FORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGB_S3TC_DXT1_EXT] = 0.5;
        FORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGBA_S3TC_DXT1_EXT] = 0.5;
        FORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGBA_S3TC_DXT3_EXT] = 1;
        FORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGBA_S3TC_DXT5_EXT] = 1;
        FORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGB_ATC_WEBGL] = 0.5;
        FORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL] = 1;
        FORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL] = 1;
        FORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG] = 0.5;
        FORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG] = 0.25;
        FORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG] = 0.5;
        FORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG] = 0.25;
        FORMAT_SIZES_SPECIAL[GL_COMPRESSED_RGB_ETC1_WEBGL] = 0.5;
        function isNumericArray(arr) {
          return Array.isArray(arr) && (arr.length === 0 || typeof arr[0] === "number");
        }
        function isRectArray(arr) {
          if (!Array.isArray(arr)) {
            return false;
          }
          var width = arr.length;
          if (width === 0 || !isArrayLike(arr[0])) {
            return false;
          }
          return true;
        }
        function classString(x) {
          return Object.prototype.toString.call(x);
        }
        function isCanvasElement(object) {
          return classString(object) === CANVAS_CLASS;
        }
        function isOffscreenCanvas(object) {
          return classString(object) === OFFSCREENCANVAS_CLASS;
        }
        function isContext2D(object) {
          return classString(object) === CONTEXT2D_CLASS;
        }
        function isBitmap(object) {
          return classString(object) === BITMAP_CLASS;
        }
        function isImageElement(object) {
          return classString(object) === IMAGE_CLASS;
        }
        function isVideoElement(object) {
          return classString(object) === VIDEO_CLASS;
        }
        function isPixelData(object) {
          if (!object) {
            return false;
          }
          var className = classString(object);
          if (PIXEL_CLASSES.indexOf(className) >= 0) {
            return true;
          }
          return isNumericArray(object) || isRectArray(object) || isNDArrayLike(object);
        }
        function typedArrayCode$1(data) {
          return arrayTypes[Object.prototype.toString.call(data)] | 0;
        }
        function convertData(result, data) {
          var n = data.length;
          switch (result.type) {
            case GL_UNSIGNED_BYTE$5:
            case GL_UNSIGNED_SHORT$3:
            case GL_UNSIGNED_INT$3:
            case GL_FLOAT$4:
              var converted = pool.allocType(result.type, n);
              converted.set(data);
              result.data = converted;
              break;
            case GL_HALF_FLOAT_OES$1:
              result.data = convertToHalfFloat(data);
              break;
            default:
              check$1.raise("unsupported texture type, must specify a typed array");
          }
        }
        function preConvert(image, n) {
          return pool.allocType(
            image.type === GL_HALF_FLOAT_OES$1 ? GL_FLOAT$4 : image.type,
            n
          );
        }
        function postConvert(image, data) {
          if (image.type === GL_HALF_FLOAT_OES$1) {
            image.data = convertToHalfFloat(data);
            pool.freeType(data);
          } else {
            image.data = data;
          }
        }
        function transposeData(image, array, strideX, strideY, strideC, offset) {
          var w = image.width;
          var h = image.height;
          var c = image.channels;
          var n = w * h * c;
          var data = preConvert(image, n);
          var p = 0;
          for (var i = 0; i < h; ++i) {
            for (var j = 0; j < w; ++j) {
              for (var k = 0; k < c; ++k) {
                data[p++] = array[strideX * j + strideY * i + strideC * k + offset];
              }
            }
          }
          postConvert(image, data);
        }
        function getTextureSize(format, type, width, height, isMipmap, isCube) {
          var s;
          if (typeof FORMAT_SIZES_SPECIAL[format] !== "undefined") {
            s = FORMAT_SIZES_SPECIAL[format];
          } else {
            s = FORMAT_CHANNELS[format] * TYPE_SIZES[type];
          }
          if (isCube) {
            s *= 6;
          }
          if (isMipmap) {
            var total = 0;
            var w = width;
            while (w >= 1) {
              total += s * w * w;
              w /= 2;
            }
            return total;
          } else {
            return s * width * height;
          }
        }
        function createTextureSet(gl, extensions, limits, reglPoll, contextState, stats2, config) {
          var mipmapHint = {
            "don't care": GL_DONT_CARE,
            "dont care": GL_DONT_CARE,
            "nice": GL_NICEST,
            "fast": GL_FASTEST
          };
          var wrapModes = {
            "repeat": GL_REPEAT,
            "clamp": GL_CLAMP_TO_EDGE$1,
            "mirror": GL_MIRRORED_REPEAT
          };
          var magFilters = {
            "nearest": GL_NEAREST$1,
            "linear": GL_LINEAR
          };
          var minFilters = extend({
            "mipmap": GL_LINEAR_MIPMAP_LINEAR$1,
            "nearest mipmap nearest": GL_NEAREST_MIPMAP_NEAREST$1,
            "linear mipmap nearest": GL_LINEAR_MIPMAP_NEAREST$1,
            "nearest mipmap linear": GL_NEAREST_MIPMAP_LINEAR$1,
            "linear mipmap linear": GL_LINEAR_MIPMAP_LINEAR$1
          }, magFilters);
          var colorSpace = {
            "none": 0,
            "browser": GL_BROWSER_DEFAULT_WEBGL
          };
          var textureTypes = {
            "uint8": GL_UNSIGNED_BYTE$5,
            "rgba4": GL_UNSIGNED_SHORT_4_4_4_4$1,
            "rgb565": GL_UNSIGNED_SHORT_5_6_5$1,
            "rgb5 a1": GL_UNSIGNED_SHORT_5_5_5_1$1
          };
          var textureFormats = {
            "alpha": GL_ALPHA,
            "luminance": GL_LUMINANCE,
            "luminance alpha": GL_LUMINANCE_ALPHA,
            "rgb": GL_RGB,
            "rgba": GL_RGBA$1,
            "rgba4": GL_RGBA4,
            "rgb5 a1": GL_RGB5_A1,
            "rgb565": GL_RGB565
          };
          var compressedTextureFormats = {};
          if (extensions.ext_srgb) {
            textureFormats.srgb = GL_SRGB_EXT;
            textureFormats.srgba = GL_SRGB_ALPHA_EXT;
          }
          if (extensions.oes_texture_float) {
            textureTypes.float32 = textureTypes.float = GL_FLOAT$4;
          }
          if (extensions.oes_texture_half_float) {
            textureTypes["float16"] = textureTypes["half float"] = GL_HALF_FLOAT_OES$1;
          }
          if (extensions.webgl_depth_texture) {
            extend(textureFormats, {
              "depth": GL_DEPTH_COMPONENT,
              "depth stencil": GL_DEPTH_STENCIL
            });
            extend(textureTypes, {
              "uint16": GL_UNSIGNED_SHORT$3,
              "uint32": GL_UNSIGNED_INT$3,
              "depth stencil": GL_UNSIGNED_INT_24_8_WEBGL$1
            });
          }
          if (extensions.webgl_compressed_texture_s3tc) {
            extend(compressedTextureFormats, {
              "rgb s3tc dxt1": GL_COMPRESSED_RGB_S3TC_DXT1_EXT,
              "rgba s3tc dxt1": GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,
              "rgba s3tc dxt3": GL_COMPRESSED_RGBA_S3TC_DXT3_EXT,
              "rgba s3tc dxt5": GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
            });
          }
          if (extensions.webgl_compressed_texture_atc) {
            extend(compressedTextureFormats, {
              "rgb atc": GL_COMPRESSED_RGB_ATC_WEBGL,
              "rgba atc explicit alpha": GL_COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,
              "rgba atc interpolated alpha": GL_COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL
            });
          }
          if (extensions.webgl_compressed_texture_pvrtc) {
            extend(compressedTextureFormats, {
              "rgb pvrtc 4bppv1": GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG,
              "rgb pvrtc 2bppv1": GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG,
              "rgba pvrtc 4bppv1": GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,
              "rgba pvrtc 2bppv1": GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
            });
          }
          if (extensions.webgl_compressed_texture_etc1) {
            compressedTextureFormats["rgb etc1"] = GL_COMPRESSED_RGB_ETC1_WEBGL;
          }
          var supportedCompressedFormats = Array.prototype.slice.call(
            gl.getParameter(GL_COMPRESSED_TEXTURE_FORMATS)
          );
          Object.keys(compressedTextureFormats).forEach(function(name) {
            var format = compressedTextureFormats[name];
            if (supportedCompressedFormats.indexOf(format) >= 0) {
              textureFormats[name] = format;
            }
          });
          var supportedFormats = Object.keys(textureFormats);
          limits.textureFormats = supportedFormats;
          var textureFormatsInvert = [];
          Object.keys(textureFormats).forEach(function(key) {
            var val = textureFormats[key];
            textureFormatsInvert[val] = key;
          });
          var textureTypesInvert = [];
          Object.keys(textureTypes).forEach(function(key) {
            var val = textureTypes[key];
            textureTypesInvert[val] = key;
          });
          var magFiltersInvert = [];
          Object.keys(magFilters).forEach(function(key) {
            var val = magFilters[key];
            magFiltersInvert[val] = key;
          });
          var minFiltersInvert = [];
          Object.keys(minFilters).forEach(function(key) {
            var val = minFilters[key];
            minFiltersInvert[val] = key;
          });
          var wrapModesInvert = [];
          Object.keys(wrapModes).forEach(function(key) {
            var val = wrapModes[key];
            wrapModesInvert[val] = key;
          });
          var colorFormats = supportedFormats.reduce(function(color, key) {
            var glenum = textureFormats[key];
            if (glenum === GL_LUMINANCE || glenum === GL_ALPHA || glenum === GL_LUMINANCE || glenum === GL_LUMINANCE_ALPHA || glenum === GL_DEPTH_COMPONENT || glenum === GL_DEPTH_STENCIL || extensions.ext_srgb && (glenum === GL_SRGB_EXT || glenum === GL_SRGB_ALPHA_EXT)) {
              color[glenum] = glenum;
            } else if (glenum === GL_RGB5_A1 || key.indexOf("rgba") >= 0) {
              color[glenum] = GL_RGBA$1;
            } else {
              color[glenum] = GL_RGB;
            }
            return color;
          }, {});
          function TexFlags() {
            this.internalformat = GL_RGBA$1;
            this.format = GL_RGBA$1;
            this.type = GL_UNSIGNED_BYTE$5;
            this.compressed = false;
            this.premultiplyAlpha = false;
            this.flipY = false;
            this.unpackAlignment = 1;
            this.colorSpace = GL_BROWSER_DEFAULT_WEBGL;
            this.width = 0;
            this.height = 0;
            this.channels = 0;
          }
          function copyFlags(result, other) {
            result.internalformat = other.internalformat;
            result.format = other.format;
            result.type = other.type;
            result.compressed = other.compressed;
            result.premultiplyAlpha = other.premultiplyAlpha;
            result.flipY = other.flipY;
            result.unpackAlignment = other.unpackAlignment;
            result.colorSpace = other.colorSpace;
            result.width = other.width;
            result.height = other.height;
            result.channels = other.channels;
          }
          function parseFlags(flags, options) {
            if (typeof options !== "object" || !options) {
              return;
            }
            if ("premultiplyAlpha" in options) {
              check$1.type(
                options.premultiplyAlpha,
                "boolean",
                "invalid premultiplyAlpha"
              );
              flags.premultiplyAlpha = options.premultiplyAlpha;
            }
            if ("flipY" in options) {
              check$1.type(
                options.flipY,
                "boolean",
                "invalid texture flip"
              );
              flags.flipY = options.flipY;
            }
            if ("alignment" in options) {
              check$1.oneOf(
                options.alignment,
                [1, 2, 4, 8],
                "invalid texture unpack alignment"
              );
              flags.unpackAlignment = options.alignment;
            }
            if ("colorSpace" in options) {
              check$1.parameter(
                options.colorSpace,
                colorSpace,
                "invalid colorSpace"
              );
              flags.colorSpace = colorSpace[options.colorSpace];
            }
            if ("type" in options) {
              var type = options.type;
              check$1(
                extensions.oes_texture_float || !(type === "float" || type === "float32"),
                "you must enable the OES_texture_float extension in order to use floating point textures."
              );
              check$1(
                extensions.oes_texture_half_float || !(type === "half float" || type === "float16"),
                "you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."
              );
              check$1(
                extensions.webgl_depth_texture || !(type === "uint16" || type === "uint32" || type === "depth stencil"),
                "you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."
              );
              check$1.parameter(
                type,
                textureTypes,
                "invalid texture type"
              );
              flags.type = textureTypes[type];
            }
            var w = flags.width;
            var h = flags.height;
            var c = flags.channels;
            var hasChannels = false;
            if ("shape" in options) {
              check$1(
                Array.isArray(options.shape) && options.shape.length >= 2,
                "shape must be an array"
              );
              w = options.shape[0];
              h = options.shape[1];
              if (options.shape.length === 3) {
                c = options.shape[2];
                check$1(c > 0 && c <= 4, "invalid number of channels");
                hasChannels = true;
              }
              check$1(w >= 0 && w <= limits.maxTextureSize, "invalid width");
              check$1(h >= 0 && h <= limits.maxTextureSize, "invalid height");
            } else {
              if ("radius" in options) {
                w = h = options.radius;
                check$1(w >= 0 && w <= limits.maxTextureSize, "invalid radius");
              }
              if ("width" in options) {
                w = options.width;
                check$1(w >= 0 && w <= limits.maxTextureSize, "invalid width");
              }
              if ("height" in options) {
                h = options.height;
                check$1(h >= 0 && h <= limits.maxTextureSize, "invalid height");
              }
              if ("channels" in options) {
                c = options.channels;
                check$1(c > 0 && c <= 4, "invalid number of channels");
                hasChannels = true;
              }
            }
            flags.width = w | 0;
            flags.height = h | 0;
            flags.channels = c | 0;
            var hasFormat = false;
            if ("format" in options) {
              var formatStr = options.format;
              check$1(
                extensions.webgl_depth_texture || !(formatStr === "depth" || formatStr === "depth stencil"),
                "you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."
              );
              check$1.parameter(
                formatStr,
                textureFormats,
                "invalid texture format"
              );
              var internalformat = flags.internalformat = textureFormats[formatStr];
              flags.format = colorFormats[internalformat];
              if (formatStr in textureTypes) {
                if (!("type" in options)) {
                  flags.type = textureTypes[formatStr];
                }
              }
              if (formatStr in compressedTextureFormats) {
                flags.compressed = true;
              }
              hasFormat = true;
            }
            if (!hasChannels && hasFormat) {
              flags.channels = FORMAT_CHANNELS[flags.format];
            } else if (hasChannels && !hasFormat) {
              if (flags.channels !== CHANNELS_FORMAT[flags.format]) {
                flags.format = flags.internalformat = CHANNELS_FORMAT[flags.channels];
              }
            } else if (hasFormat && hasChannels) {
              check$1(
                flags.channels === FORMAT_CHANNELS[flags.format],
                "number of channels inconsistent with specified format"
              );
            }
          }
          function setFlags(flags) {
            gl.pixelStorei(GL_UNPACK_FLIP_Y_WEBGL, flags.flipY);
            gl.pixelStorei(GL_UNPACK_PREMULTIPLY_ALPHA_WEBGL, flags.premultiplyAlpha);
            gl.pixelStorei(GL_UNPACK_COLORSPACE_CONVERSION_WEBGL, flags.colorSpace);
            gl.pixelStorei(GL_UNPACK_ALIGNMENT, flags.unpackAlignment);
          }
          function TexImage() {
            TexFlags.call(this);
            this.xOffset = 0;
            this.yOffset = 0;
            this.data = null;
            this.needsFree = false;
            this.element = null;
            this.needsCopy = false;
          }
          function parseImage(image, options) {
            var data = null;
            if (isPixelData(options)) {
              data = options;
            } else if (options) {
              check$1.type(options, "object", "invalid pixel data type");
              parseFlags(image, options);
              if ("x" in options) {
                image.xOffset = options.x | 0;
              }
              if ("y" in options) {
                image.yOffset = options.y | 0;
              }
              if (isPixelData(options.data)) {
                data = options.data;
              }
            }
            check$1(
              !image.compressed || data instanceof Uint8Array,
              "compressed texture data must be stored in a uint8array"
            );
            if (options.copy) {
              check$1(!data, "can not specify copy and data field for the same texture");
              var viewW = contextState.viewportWidth;
              var viewH = contextState.viewportHeight;
              image.width = image.width || viewW - image.xOffset;
              image.height = image.height || viewH - image.yOffset;
              image.needsCopy = true;
              check$1(
                image.xOffset >= 0 && image.xOffset < viewW && image.yOffset >= 0 && image.yOffset < viewH && image.width > 0 && image.width <= viewW && image.height > 0 && image.height <= viewH,
                "copy texture read out of bounds"
              );
            } else if (!data) {
              image.width = image.width || 1;
              image.height = image.height || 1;
              image.channels = image.channels || 4;
            } else if (isTypedArray(data)) {
              image.channels = image.channels || 4;
              image.data = data;
              if (!("type" in options) && image.type === GL_UNSIGNED_BYTE$5) {
                image.type = typedArrayCode$1(data);
              }
            } else if (isNumericArray(data)) {
              image.channels = image.channels || 4;
              convertData(image, data);
              image.alignment = 1;
              image.needsFree = true;
            } else if (isNDArrayLike(data)) {
              var array = data.data;
              if (!Array.isArray(array) && image.type === GL_UNSIGNED_BYTE$5) {
                image.type = typedArrayCode$1(array);
              }
              var shape = data.shape;
              var stride = data.stride;
              var shapeX, shapeY, shapeC, strideX, strideY, strideC;
              if (shape.length === 3) {
                shapeC = shape[2];
                strideC = stride[2];
              } else {
                check$1(shape.length === 2, "invalid ndarray pixel data, must be 2 or 3D");
                shapeC = 1;
                strideC = 1;
              }
              shapeX = shape[0];
              shapeY = shape[1];
              strideX = stride[0];
              strideY = stride[1];
              image.alignment = 1;
              image.width = shapeX;
              image.height = shapeY;
              image.channels = shapeC;
              image.format = image.internalformat = CHANNELS_FORMAT[shapeC];
              image.needsFree = true;
              transposeData(image, array, strideX, strideY, strideC, data.offset);
            } else if (isCanvasElement(data) || isOffscreenCanvas(data) || isContext2D(data)) {
              if (isCanvasElement(data) || isOffscreenCanvas(data)) {
                image.element = data;
              } else {
                image.element = data.canvas;
              }
              image.width = image.element.width;
              image.height = image.element.height;
              image.channels = 4;
            } else if (isBitmap(data)) {
              image.element = data;
              image.width = data.width;
              image.height = data.height;
              image.channels = 4;
            } else if (isImageElement(data)) {
              image.element = data;
              image.width = data.naturalWidth;
              image.height = data.naturalHeight;
              image.channels = 4;
            } else if (isVideoElement(data)) {
              image.element = data;
              image.width = data.videoWidth;
              image.height = data.videoHeight;
              image.channels = 4;
            } else if (isRectArray(data)) {
              var w = image.width || data[0].length;
              var h = image.height || data.length;
              var c = image.channels;
              if (isArrayLike(data[0][0])) {
                c = c || data[0][0].length;
              } else {
                c = c || 1;
              }
              var arrayShape2 = flattenUtils.shape(data);
              var n = 1;
              for (var dd = 0; dd < arrayShape2.length; ++dd) {
                n *= arrayShape2[dd];
              }
              var allocData = preConvert(image, n);
              flattenUtils.flatten(data, arrayShape2, "", allocData);
              postConvert(image, allocData);
              image.alignment = 1;
              image.width = w;
              image.height = h;
              image.channels = c;
              image.format = image.internalformat = CHANNELS_FORMAT[c];
              image.needsFree = true;
            }
            if (image.type === GL_FLOAT$4) {
              check$1(
                limits.extensions.indexOf("oes_texture_float") >= 0,
                "oes_texture_float extension not enabled"
              );
            } else if (image.type === GL_HALF_FLOAT_OES$1) {
              check$1(
                limits.extensions.indexOf("oes_texture_half_float") >= 0,
                "oes_texture_half_float extension not enabled"
              );
            }
          }
          function setImage(info, target, miplevel) {
            var element = info.element;
            var data = info.data;
            var internalformat = info.internalformat;
            var format = info.format;
            var type = info.type;
            var width = info.width;
            var height = info.height;
            setFlags(info);
            if (element) {
              gl.texImage2D(target, miplevel, format, format, type, element);
            } else if (info.compressed) {
              gl.compressedTexImage2D(target, miplevel, internalformat, width, height, 0, data);
            } else if (info.needsCopy) {
              reglPoll();
              gl.copyTexImage2D(
                target,
                miplevel,
                format,
                info.xOffset,
                info.yOffset,
                width,
                height,
                0
              );
            } else {
              gl.texImage2D(target, miplevel, format, width, height, 0, format, type, data || null);
            }
          }
          function setSubImage(info, target, x, y, miplevel) {
            var element = info.element;
            var data = info.data;
            var internalformat = info.internalformat;
            var format = info.format;
            var type = info.type;
            var width = info.width;
            var height = info.height;
            setFlags(info);
            if (element) {
              gl.texSubImage2D(
                target,
                miplevel,
                x,
                y,
                format,
                type,
                element
              );
            } else if (info.compressed) {
              gl.compressedTexSubImage2D(
                target,
                miplevel,
                x,
                y,
                internalformat,
                width,
                height,
                data
              );
            } else if (info.needsCopy) {
              reglPoll();
              gl.copyTexSubImage2D(
                target,
                miplevel,
                x,
                y,
                info.xOffset,
                info.yOffset,
                width,
                height
              );
            } else {
              gl.texSubImage2D(
                target,
                miplevel,
                x,
                y,
                width,
                height,
                format,
                type,
                data
              );
            }
          }
          var imagePool = [];
          function allocImage() {
            return imagePool.pop() || new TexImage();
          }
          function freeImage(image) {
            if (image.needsFree) {
              pool.freeType(image.data);
            }
            TexImage.call(image);
            imagePool.push(image);
          }
          function MipMap() {
            TexFlags.call(this);
            this.genMipmaps = false;
            this.mipmapHint = GL_DONT_CARE;
            this.mipmask = 0;
            this.images = Array(16);
          }
          function parseMipMapFromShape(mipmap, width, height) {
            var img = mipmap.images[0] = allocImage();
            mipmap.mipmask = 1;
            img.width = mipmap.width = width;
            img.height = mipmap.height = height;
            img.channels = mipmap.channels = 4;
          }
          function parseMipMapFromObject(mipmap, options) {
            var imgData = null;
            if (isPixelData(options)) {
              imgData = mipmap.images[0] = allocImage();
              copyFlags(imgData, mipmap);
              parseImage(imgData, options);
              mipmap.mipmask = 1;
            } else {
              parseFlags(mipmap, options);
              if (Array.isArray(options.mipmap)) {
                var mipData = options.mipmap;
                for (var i = 0; i < mipData.length; ++i) {
                  imgData = mipmap.images[i] = allocImage();
                  copyFlags(imgData, mipmap);
                  imgData.width >>= i;
                  imgData.height >>= i;
                  parseImage(imgData, mipData[i]);
                  mipmap.mipmask |= 1 << i;
                }
              } else {
                imgData = mipmap.images[0] = allocImage();
                copyFlags(imgData, mipmap);
                parseImage(imgData, options);
                mipmap.mipmask = 1;
              }
            }
            copyFlags(mipmap, mipmap.images[0]);
            if (mipmap.compressed && (mipmap.internalformat === GL_COMPRESSED_RGB_S3TC_DXT1_EXT || mipmap.internalformat === GL_COMPRESSED_RGBA_S3TC_DXT1_EXT || mipmap.internalformat === GL_COMPRESSED_RGBA_S3TC_DXT3_EXT || mipmap.internalformat === GL_COMPRESSED_RGBA_S3TC_DXT5_EXT)) {
              check$1(
                mipmap.width % 4 === 0 && mipmap.height % 4 === 0,
                "for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4"
              );
            }
          }
          function setMipMap(mipmap, target) {
            var images = mipmap.images;
            for (var i = 0; i < images.length; ++i) {
              if (!images[i]) {
                return;
              }
              setImage(images[i], target, i);
            }
          }
          var mipPool = [];
          function allocMipMap() {
            var result = mipPool.pop() || new MipMap();
            TexFlags.call(result);
            result.mipmask = 0;
            for (var i = 0; i < 16; ++i) {
              result.images[i] = null;
            }
            return result;
          }
          function freeMipMap(mipmap) {
            var images = mipmap.images;
            for (var i = 0; i < images.length; ++i) {
              if (images[i]) {
                freeImage(images[i]);
              }
              images[i] = null;
            }
            mipPool.push(mipmap);
          }
          function TexInfo() {
            this.minFilter = GL_NEAREST$1;
            this.magFilter = GL_NEAREST$1;
            this.wrapS = GL_CLAMP_TO_EDGE$1;
            this.wrapT = GL_CLAMP_TO_EDGE$1;
            this.anisotropic = 1;
            this.genMipmaps = false;
            this.mipmapHint = GL_DONT_CARE;
          }
          function parseTexInfo(info, options) {
            if ("min" in options) {
              var minFilter = options.min;
              check$1.parameter(minFilter, minFilters);
              info.minFilter = minFilters[minFilter];
              if (MIPMAP_FILTERS.indexOf(info.minFilter) >= 0 && !("faces" in options)) {
                info.genMipmaps = true;
              }
            }
            if ("mag" in options) {
              var magFilter = options.mag;
              check$1.parameter(magFilter, magFilters);
              info.magFilter = magFilters[magFilter];
            }
            var wrapS = info.wrapS;
            var wrapT = info.wrapT;
            if ("wrap" in options) {
              var wrap = options.wrap;
              if (typeof wrap === "string") {
                check$1.parameter(wrap, wrapModes);
                wrapS = wrapT = wrapModes[wrap];
              } else if (Array.isArray(wrap)) {
                check$1.parameter(wrap[0], wrapModes);
                check$1.parameter(wrap[1], wrapModes);
                wrapS = wrapModes[wrap[0]];
                wrapT = wrapModes[wrap[1]];
              }
            } else {
              if ("wrapS" in options) {
                var optWrapS = options.wrapS;
                check$1.parameter(optWrapS, wrapModes);
                wrapS = wrapModes[optWrapS];
              }
              if ("wrapT" in options) {
                var optWrapT = options.wrapT;
                check$1.parameter(optWrapT, wrapModes);
                wrapT = wrapModes[optWrapT];
              }
            }
            info.wrapS = wrapS;
            info.wrapT = wrapT;
            if ("anisotropic" in options) {
              var anisotropic = options.anisotropic;
              check$1(
                typeof anisotropic === "number" && anisotropic >= 1 && anisotropic <= limits.maxAnisotropic,
                "aniso samples must be between 1 and "
              );
              info.anisotropic = options.anisotropic;
            }
            if ("mipmap" in options) {
              var hasMipMap = false;
              switch (typeof options.mipmap) {
                case "string":
                  check$1.parameter(
                    options.mipmap,
                    mipmapHint,
                    "invalid mipmap hint"
                  );
                  info.mipmapHint = mipmapHint[options.mipmap];
                  info.genMipmaps = true;
                  hasMipMap = true;
                  break;
                case "boolean":
                  hasMipMap = info.genMipmaps = options.mipmap;
                  break;
                case "object":
                  check$1(Array.isArray(options.mipmap), "invalid mipmap type");
                  info.genMipmaps = false;
                  hasMipMap = true;
                  break;
                default:
                  check$1.raise("invalid mipmap type");
              }
              if (hasMipMap && !("min" in options)) {
                info.minFilter = GL_NEAREST_MIPMAP_NEAREST$1;
              }
            }
          }
          function setTexInfo(info, target) {
            gl.texParameteri(target, GL_TEXTURE_MIN_FILTER, info.minFilter);
            gl.texParameteri(target, GL_TEXTURE_MAG_FILTER, info.magFilter);
            gl.texParameteri(target, GL_TEXTURE_WRAP_S, info.wrapS);
            gl.texParameteri(target, GL_TEXTURE_WRAP_T, info.wrapT);
            if (extensions.ext_texture_filter_anisotropic) {
              gl.texParameteri(target, GL_TEXTURE_MAX_ANISOTROPY_EXT, info.anisotropic);
            }
            if (info.genMipmaps) {
              gl.hint(GL_GENERATE_MIPMAP_HINT, info.mipmapHint);
              gl.generateMipmap(target);
            }
          }
          var textureCount = 0;
          var textureSet = {};
          var numTexUnits = limits.maxTextureUnits;
          var textureUnits = Array(numTexUnits).map(function() {
            return null;
          });
          function REGLTexture(target) {
            TexFlags.call(this);
            this.mipmask = 0;
            this.internalformat = GL_RGBA$1;
            this.id = textureCount++;
            this.refCount = 1;
            this.target = target;
            this.texture = gl.createTexture();
            this.unit = -1;
            this.bindCount = 0;
            this.texInfo = new TexInfo();
            if (config.profile) {
              this.stats = { size: 0 };
            }
          }
          function tempBind(texture) {
            gl.activeTexture(GL_TEXTURE0$1);
            gl.bindTexture(texture.target, texture.texture);
          }
          function tempRestore() {
            var prev = textureUnits[0];
            if (prev) {
              gl.bindTexture(prev.target, prev.texture);
            } else {
              gl.bindTexture(GL_TEXTURE_2D$1, null);
            }
          }
          function destroy(texture) {
            var handle = texture.texture;
            check$1(handle, "must not double destroy texture");
            var unit = texture.unit;
            var target = texture.target;
            if (unit >= 0) {
              gl.activeTexture(GL_TEXTURE0$1 + unit);
              gl.bindTexture(target, null);
              textureUnits[unit] = null;
            }
            gl.deleteTexture(handle);
            texture.texture = null;
            texture.params = null;
            texture.pixels = null;
            texture.refCount = 0;
            delete textureSet[texture.id];
            stats2.textureCount--;
          }
          extend(REGLTexture.prototype, {
            bind: function() {
              var texture = this;
              texture.bindCount += 1;
              var unit = texture.unit;
              if (unit < 0) {
                for (var i = 0; i < numTexUnits; ++i) {
                  var other = textureUnits[i];
                  if (other) {
                    if (other.bindCount > 0) {
                      continue;
                    }
                    other.unit = -1;
                  }
                  textureUnits[i] = texture;
                  unit = i;
                  break;
                }
                if (unit >= numTexUnits) {
                  check$1.raise("insufficient number of texture units");
                }
                if (config.profile && stats2.maxTextureUnits < unit + 1) {
                  stats2.maxTextureUnits = unit + 1;
                }
                texture.unit = unit;
                gl.activeTexture(GL_TEXTURE0$1 + unit);
                gl.bindTexture(texture.target, texture.texture);
              }
              return unit;
            },
            unbind: function() {
              this.bindCount -= 1;
            },
            decRef: function() {
              if (--this.refCount <= 0) {
                destroy(this);
              }
            }
          });
          function createTexture2D(a, b) {
            var texture = new REGLTexture(GL_TEXTURE_2D$1);
            textureSet[texture.id] = texture;
            stats2.textureCount++;
            function reglTexture2D(a2, b2) {
              var texInfo = texture.texInfo;
              TexInfo.call(texInfo);
              var mipData = allocMipMap();
              if (typeof a2 === "number") {
                if (typeof b2 === "number") {
                  parseMipMapFromShape(mipData, a2 | 0, b2 | 0);
                } else {
                  parseMipMapFromShape(mipData, a2 | 0, a2 | 0);
                }
              } else if (a2) {
                check$1.type(a2, "object", "invalid arguments to regl.texture");
                parseTexInfo(texInfo, a2);
                parseMipMapFromObject(mipData, a2);
              } else {
                parseMipMapFromShape(mipData, 1, 1);
              }
              if (texInfo.genMipmaps) {
                mipData.mipmask = (mipData.width << 1) - 1;
              }
              texture.mipmask = mipData.mipmask;
              copyFlags(texture, mipData);
              check$1.texture2D(texInfo, mipData, limits);
              texture.internalformat = mipData.internalformat;
              reglTexture2D.width = mipData.width;
              reglTexture2D.height = mipData.height;
              tempBind(texture);
              setMipMap(mipData, GL_TEXTURE_2D$1);
              setTexInfo(texInfo, GL_TEXTURE_2D$1);
              tempRestore();
              freeMipMap(mipData);
              if (config.profile) {
                texture.stats.size = getTextureSize(
                  texture.internalformat,
                  texture.type,
                  mipData.width,
                  mipData.height,
                  texInfo.genMipmaps,
                  false
                );
              }
              reglTexture2D.format = textureFormatsInvert[texture.internalformat];
              reglTexture2D.type = textureTypesInvert[texture.type];
              reglTexture2D.mag = magFiltersInvert[texInfo.magFilter];
              reglTexture2D.min = minFiltersInvert[texInfo.minFilter];
              reglTexture2D.wrapS = wrapModesInvert[texInfo.wrapS];
              reglTexture2D.wrapT = wrapModesInvert[texInfo.wrapT];
              return reglTexture2D;
            }
            function subimage(image, x_, y_, level_) {
              check$1(!!image, "must specify image data");
              var x = x_ | 0;
              var y = y_ | 0;
              var level = level_ | 0;
              var imageData = allocImage();
              copyFlags(imageData, texture);
              imageData.width = 0;
              imageData.height = 0;
              parseImage(imageData, image);
              imageData.width = imageData.width || (texture.width >> level) - x;
              imageData.height = imageData.height || (texture.height >> level) - y;
              check$1(
                texture.type === imageData.type && texture.format === imageData.format && texture.internalformat === imageData.internalformat,
                "incompatible format for texture.subimage"
              );
              check$1(
                x >= 0 && y >= 0 && x + imageData.width <= texture.width && y + imageData.height <= texture.height,
                "texture.subimage write out of bounds"
              );
              check$1(
                texture.mipmask & 1 << level,
                "missing mipmap data"
              );
              check$1(
                imageData.data || imageData.element || imageData.needsCopy,
                "missing image data"
              );
              tempBind(texture);
              setSubImage(imageData, GL_TEXTURE_2D$1, x, y, level);
              tempRestore();
              freeImage(imageData);
              return reglTexture2D;
            }
            function resize(w_, h_) {
              var w = w_ | 0;
              var h = h_ | 0 || w;
              if (w === texture.width && h === texture.height) {
                return reglTexture2D;
              }
              reglTexture2D.width = texture.width = w;
              reglTexture2D.height = texture.height = h;
              tempBind(texture);
              for (var i = 0; texture.mipmask >> i; ++i) {
                var _w2 = w >> i;
                var _h2 = h >> i;
                if (!_w2 || !_h2) break;
                gl.texImage2D(
                  GL_TEXTURE_2D$1,
                  i,
                  texture.format,
                  _w2,
                  _h2,
                  0,
                  texture.format,
                  texture.type,
                  null
                );
              }
              tempRestore();
              if (config.profile) {
                texture.stats.size = getTextureSize(
                  texture.internalformat,
                  texture.type,
                  w,
                  h,
                  false,
                  false
                );
              }
              return reglTexture2D;
            }
            reglTexture2D(a, b);
            reglTexture2D.subimage = subimage;
            reglTexture2D.resize = resize;
            reglTexture2D._reglType = "texture2d";
            reglTexture2D._texture = texture;
            if (config.profile) {
              reglTexture2D.stats = texture.stats;
            }
            reglTexture2D.destroy = function() {
              texture.decRef();
            };
            return reglTexture2D;
          }
          function createTextureCube(a0, a1, a2, a3, a4, a5) {
            var texture = new REGLTexture(GL_TEXTURE_CUBE_MAP$1);
            textureSet[texture.id] = texture;
            stats2.cubeCount++;
            var faces = new Array(6);
            function reglTextureCube(a02, a12, a22, a32, a42, a52) {
              var i;
              var texInfo = texture.texInfo;
              TexInfo.call(texInfo);
              for (i = 0; i < 6; ++i) {
                faces[i] = allocMipMap();
              }
              if (typeof a02 === "number" || !a02) {
                var s = a02 | 0 || 1;
                for (i = 0; i < 6; ++i) {
                  parseMipMapFromShape(faces[i], s, s);
                }
              } else if (typeof a02 === "object") {
                if (a12) {
                  parseMipMapFromObject(faces[0], a02);
                  parseMipMapFromObject(faces[1], a12);
                  parseMipMapFromObject(faces[2], a22);
                  parseMipMapFromObject(faces[3], a32);
                  parseMipMapFromObject(faces[4], a42);
                  parseMipMapFromObject(faces[5], a52);
                } else {
                  parseTexInfo(texInfo, a02);
                  parseFlags(texture, a02);
                  if ("faces" in a02) {
                    var faceInput = a02.faces;
                    check$1(
                      Array.isArray(faceInput) && faceInput.length === 6,
                      "cube faces must be a length 6 array"
                    );
                    for (i = 0; i < 6; ++i) {
                      check$1(
                        typeof faceInput[i] === "object" && !!faceInput[i],
                        "invalid input for cube map face"
                      );
                      copyFlags(faces[i], texture);
                      parseMipMapFromObject(faces[i], faceInput[i]);
                    }
                  } else {
                    for (i = 0; i < 6; ++i) {
                      parseMipMapFromObject(faces[i], a02);
                    }
                  }
                }
              } else {
                check$1.raise("invalid arguments to cube map");
              }
              copyFlags(texture, faces[0]);
              check$1.optional(function() {
                if (!limits.npotTextureCube) {
                  check$1(isPow2$1(texture.width) && isPow2$1(texture.height), "your browser does not support non power or two texture dimensions");
                }
              });
              if (texInfo.genMipmaps) {
                texture.mipmask = (faces[0].width << 1) - 1;
              } else {
                texture.mipmask = faces[0].mipmask;
              }
              check$1.textureCube(texture, texInfo, faces, limits);
              texture.internalformat = faces[0].internalformat;
              reglTextureCube.width = faces[0].width;
              reglTextureCube.height = faces[0].height;
              tempBind(texture);
              for (i = 0; i < 6; ++i) {
                setMipMap(faces[i], GL_TEXTURE_CUBE_MAP_POSITIVE_X$1 + i);
              }
              setTexInfo(texInfo, GL_TEXTURE_CUBE_MAP$1);
              tempRestore();
              if (config.profile) {
                texture.stats.size = getTextureSize(
                  texture.internalformat,
                  texture.type,
                  reglTextureCube.width,
                  reglTextureCube.height,
                  texInfo.genMipmaps,
                  true
                );
              }
              reglTextureCube.format = textureFormatsInvert[texture.internalformat];
              reglTextureCube.type = textureTypesInvert[texture.type];
              reglTextureCube.mag = magFiltersInvert[texInfo.magFilter];
              reglTextureCube.min = minFiltersInvert[texInfo.minFilter];
              reglTextureCube.wrapS = wrapModesInvert[texInfo.wrapS];
              reglTextureCube.wrapT = wrapModesInvert[texInfo.wrapT];
              for (i = 0; i < 6; ++i) {
                freeMipMap(faces[i]);
              }
              return reglTextureCube;
            }
            function subimage(face, image, x_, y_, level_) {
              check$1(!!image, "must specify image data");
              check$1(typeof face === "number" && face === (face | 0) && face >= 0 && face < 6, "invalid face");
              var x = x_ | 0;
              var y = y_ | 0;
              var level = level_ | 0;
              var imageData = allocImage();
              copyFlags(imageData, texture);
              imageData.width = 0;
              imageData.height = 0;
              parseImage(imageData, image);
              imageData.width = imageData.width || (texture.width >> level) - x;
              imageData.height = imageData.height || (texture.height >> level) - y;
              check$1(
                texture.type === imageData.type && texture.format === imageData.format && texture.internalformat === imageData.internalformat,
                "incompatible format for texture.subimage"
              );
              check$1(
                x >= 0 && y >= 0 && x + imageData.width <= texture.width && y + imageData.height <= texture.height,
                "texture.subimage write out of bounds"
              );
              check$1(
                texture.mipmask & 1 << level,
                "missing mipmap data"
              );
              check$1(
                imageData.data || imageData.element || imageData.needsCopy,
                "missing image data"
              );
              tempBind(texture);
              setSubImage(imageData, GL_TEXTURE_CUBE_MAP_POSITIVE_X$1 + face, x, y, level);
              tempRestore();
              freeImage(imageData);
              return reglTextureCube;
            }
            function resize(radius_) {
              var radius = radius_ | 0;
              if (radius === texture.width) {
                return;
              }
              reglTextureCube.width = texture.width = radius;
              reglTextureCube.height = texture.height = radius;
              tempBind(texture);
              for (var i = 0; i < 6; ++i) {
                for (var j = 0; texture.mipmask >> j; ++j) {
                  gl.texImage2D(
                    GL_TEXTURE_CUBE_MAP_POSITIVE_X$1 + i,
                    j,
                    texture.format,
                    radius >> j,
                    radius >> j,
                    0,
                    texture.format,
                    texture.type,
                    null
                  );
                }
              }
              tempRestore();
              if (config.profile) {
                texture.stats.size = getTextureSize(
                  texture.internalformat,
                  texture.type,
                  reglTextureCube.width,
                  reglTextureCube.height,
                  false,
                  true
                );
              }
              return reglTextureCube;
            }
            reglTextureCube(a0, a1, a2, a3, a4, a5);
            reglTextureCube.subimage = subimage;
            reglTextureCube.resize = resize;
            reglTextureCube._reglType = "textureCube";
            reglTextureCube._texture = texture;
            if (config.profile) {
              reglTextureCube.stats = texture.stats;
            }
            reglTextureCube.destroy = function() {
              texture.decRef();
            };
            return reglTextureCube;
          }
          function destroyTextures() {
            for (var i = 0; i < numTexUnits; ++i) {
              gl.activeTexture(GL_TEXTURE0$1 + i);
              gl.bindTexture(GL_TEXTURE_2D$1, null);
              textureUnits[i] = null;
            }
            values(textureSet).forEach(destroy);
            stats2.cubeCount = 0;
            stats2.textureCount = 0;
          }
          if (config.profile) {
            stats2.getTotalTextureSize = function() {
              var total = 0;
              Object.keys(textureSet).forEach(function(key) {
                total += textureSet[key].stats.size;
              });
              return total;
            };
          }
          function restoreTextures() {
            for (var i = 0; i < numTexUnits; ++i) {
              var tex = textureUnits[i];
              if (tex) {
                tex.bindCount = 0;
                tex.unit = -1;
                textureUnits[i] = null;
              }
            }
            values(textureSet).forEach(function(texture) {
              texture.texture = gl.createTexture();
              gl.bindTexture(texture.target, texture.texture);
              for (var i2 = 0; i2 < 32; ++i2) {
                if ((texture.mipmask & 1 << i2) === 0) {
                  continue;
                }
                if (texture.target === GL_TEXTURE_2D$1) {
                  gl.texImage2D(
                    GL_TEXTURE_2D$1,
                    i2,
                    texture.internalformat,
                    texture.width >> i2,
                    texture.height >> i2,
                    0,
                    texture.internalformat,
                    texture.type,
                    null
                  );
                } else {
                  for (var j = 0; j < 6; ++j) {
                    gl.texImage2D(
                      GL_TEXTURE_CUBE_MAP_POSITIVE_X$1 + j,
                      i2,
                      texture.internalformat,
                      texture.width >> i2,
                      texture.height >> i2,
                      0,
                      texture.internalformat,
                      texture.type,
                      null
                    );
                  }
                }
              }
              setTexInfo(texture.texInfo, texture.target);
            });
          }
          function refreshTextures() {
            for (var i = 0; i < numTexUnits; ++i) {
              var tex = textureUnits[i];
              if (tex) {
                tex.bindCount = 0;
                tex.unit = -1;
                textureUnits[i] = null;
              }
              gl.activeTexture(GL_TEXTURE0$1 + i);
              gl.bindTexture(GL_TEXTURE_2D$1, null);
              gl.bindTexture(GL_TEXTURE_CUBE_MAP$1, null);
            }
          }
          return {
            create2D: createTexture2D,
            createCube: createTextureCube,
            clear: destroyTextures,
            getTexture: function(wrapper) {
              return null;
            },
            restore: restoreTextures,
            refresh: refreshTextures
          };
        }
        var GL_RENDERBUFFER = 36161;
        var GL_RGBA4$1 = 32854;
        var GL_RGB5_A1$1 = 32855;
        var GL_RGB565$1 = 36194;
        var GL_DEPTH_COMPONENT16 = 33189;
        var GL_STENCIL_INDEX8 = 36168;
        var GL_DEPTH_STENCIL$1 = 34041;
        var GL_SRGB8_ALPHA8_EXT = 35907;
        var GL_RGBA32F_EXT = 34836;
        var GL_RGBA16F_EXT = 34842;
        var GL_RGB16F_EXT = 34843;
        var FORMAT_SIZES = [];
        FORMAT_SIZES[GL_RGBA4$1] = 2;
        FORMAT_SIZES[GL_RGB5_A1$1] = 2;
        FORMAT_SIZES[GL_RGB565$1] = 2;
        FORMAT_SIZES[GL_DEPTH_COMPONENT16] = 2;
        FORMAT_SIZES[GL_STENCIL_INDEX8] = 1;
        FORMAT_SIZES[GL_DEPTH_STENCIL$1] = 4;
        FORMAT_SIZES[GL_SRGB8_ALPHA8_EXT] = 4;
        FORMAT_SIZES[GL_RGBA32F_EXT] = 16;
        FORMAT_SIZES[GL_RGBA16F_EXT] = 8;
        FORMAT_SIZES[GL_RGB16F_EXT] = 6;
        function getRenderbufferSize(format, width, height) {
          return FORMAT_SIZES[format] * width * height;
        }
        var wrapRenderbuffers = function(gl, extensions, limits, stats2, config) {
          var formatTypes = {
            "rgba4": GL_RGBA4$1,
            "rgb565": GL_RGB565$1,
            "rgb5 a1": GL_RGB5_A1$1,
            "depth": GL_DEPTH_COMPONENT16,
            "stencil": GL_STENCIL_INDEX8,
            "depth stencil": GL_DEPTH_STENCIL$1
          };
          if (extensions.ext_srgb) {
            formatTypes["srgba"] = GL_SRGB8_ALPHA8_EXT;
          }
          if (extensions.ext_color_buffer_half_float) {
            formatTypes["rgba16f"] = GL_RGBA16F_EXT;
            formatTypes["rgb16f"] = GL_RGB16F_EXT;
          }
          if (extensions.webgl_color_buffer_float) {
            formatTypes["rgba32f"] = GL_RGBA32F_EXT;
          }
          var formatTypesInvert = [];
          Object.keys(formatTypes).forEach(function(key) {
            var val = formatTypes[key];
            formatTypesInvert[val] = key;
          });
          var renderbufferCount = 0;
          var renderbufferSet = {};
          function REGLRenderbuffer(renderbuffer) {
            this.id = renderbufferCount++;
            this.refCount = 1;
            this.renderbuffer = renderbuffer;
            this.format = GL_RGBA4$1;
            this.width = 0;
            this.height = 0;
            if (config.profile) {
              this.stats = { size: 0 };
            }
          }
          REGLRenderbuffer.prototype.decRef = function() {
            if (--this.refCount <= 0) {
              destroy(this);
            }
          };
          function destroy(rb) {
            var handle = rb.renderbuffer;
            check$1(handle, "must not double destroy renderbuffer");
            gl.bindRenderbuffer(GL_RENDERBUFFER, null);
            gl.deleteRenderbuffer(handle);
            rb.renderbuffer = null;
            rb.refCount = 0;
            delete renderbufferSet[rb.id];
            stats2.renderbufferCount--;
          }
          function createRenderbuffer(a, b) {
            var renderbuffer = new REGLRenderbuffer(gl.createRenderbuffer());
            renderbufferSet[renderbuffer.id] = renderbuffer;
            stats2.renderbufferCount++;
            function reglRenderbuffer(a2, b2) {
              var w = 0;
              var h = 0;
              var format = GL_RGBA4$1;
              if (typeof a2 === "object" && a2) {
                var options = a2;
                if ("shape" in options) {
                  var shape = options.shape;
                  check$1(
                    Array.isArray(shape) && shape.length >= 2,
                    "invalid renderbuffer shape"
                  );
                  w = shape[0] | 0;
                  h = shape[1] | 0;
                } else {
                  if ("radius" in options) {
                    w = h = options.radius | 0;
                  }
                  if ("width" in options) {
                    w = options.width | 0;
                  }
                  if ("height" in options) {
                    h = options.height | 0;
                  }
                }
                if ("format" in options) {
                  check$1.parameter(
                    options.format,
                    formatTypes,
                    "invalid renderbuffer format"
                  );
                  format = formatTypes[options.format];
                }
              } else if (typeof a2 === "number") {
                w = a2 | 0;
                if (typeof b2 === "number") {
                  h = b2 | 0;
                } else {
                  h = w;
                }
              } else if (!a2) {
                w = h = 1;
              } else {
                check$1.raise("invalid arguments to renderbuffer constructor");
              }
              check$1(
                w > 0 && h > 0 && w <= limits.maxRenderbufferSize && h <= limits.maxRenderbufferSize,
                "invalid renderbuffer size"
              );
              if (w === renderbuffer.width && h === renderbuffer.height && format === renderbuffer.format) {
                return;
              }
              reglRenderbuffer.width = renderbuffer.width = w;
              reglRenderbuffer.height = renderbuffer.height = h;
              renderbuffer.format = format;
              gl.bindRenderbuffer(GL_RENDERBUFFER, renderbuffer.renderbuffer);
              gl.renderbufferStorage(GL_RENDERBUFFER, format, w, h);
              check$1(
                gl.getError() === 0,
                "invalid render buffer format"
              );
              if (config.profile) {
                renderbuffer.stats.size = getRenderbufferSize(renderbuffer.format, renderbuffer.width, renderbuffer.height);
              }
              reglRenderbuffer.format = formatTypesInvert[renderbuffer.format];
              return reglRenderbuffer;
            }
            function resize(w_, h_) {
              var w = w_ | 0;
              var h = h_ | 0 || w;
              if (w === renderbuffer.width && h === renderbuffer.height) {
                return reglRenderbuffer;
              }
              check$1(
                w > 0 && h > 0 && w <= limits.maxRenderbufferSize && h <= limits.maxRenderbufferSize,
                "invalid renderbuffer size"
              );
              reglRenderbuffer.width = renderbuffer.width = w;
              reglRenderbuffer.height = renderbuffer.height = h;
              gl.bindRenderbuffer(GL_RENDERBUFFER, renderbuffer.renderbuffer);
              gl.renderbufferStorage(GL_RENDERBUFFER, renderbuffer.format, w, h);
              check$1(
                gl.getError() === 0,
                "invalid render buffer format"
              );
              if (config.profile) {
                renderbuffer.stats.size = getRenderbufferSize(
                  renderbuffer.format,
                  renderbuffer.width,
                  renderbuffer.height
                );
              }
              return reglRenderbuffer;
            }
            reglRenderbuffer(a, b);
            reglRenderbuffer.resize = resize;
            reglRenderbuffer._reglType = "renderbuffer";
            reglRenderbuffer._renderbuffer = renderbuffer;
            if (config.profile) {
              reglRenderbuffer.stats = renderbuffer.stats;
            }
            reglRenderbuffer.destroy = function() {
              renderbuffer.decRef();
            };
            return reglRenderbuffer;
          }
          if (config.profile) {
            stats2.getTotalRenderbufferSize = function() {
              var total = 0;
              Object.keys(renderbufferSet).forEach(function(key) {
                total += renderbufferSet[key].stats.size;
              });
              return total;
            };
          }
          function restoreRenderbuffers() {
            values(renderbufferSet).forEach(function(rb) {
              rb.renderbuffer = gl.createRenderbuffer();
              gl.bindRenderbuffer(GL_RENDERBUFFER, rb.renderbuffer);
              gl.renderbufferStorage(GL_RENDERBUFFER, rb.format, rb.width, rb.height);
            });
            gl.bindRenderbuffer(GL_RENDERBUFFER, null);
          }
          return {
            create: createRenderbuffer,
            clear: function() {
              values(renderbufferSet).forEach(destroy);
            },
            restore: restoreRenderbuffers
          };
        };
        var GL_FRAMEBUFFER$1 = 36160;
        var GL_RENDERBUFFER$1 = 36161;
        var GL_TEXTURE_2D$2 = 3553;
        var GL_TEXTURE_CUBE_MAP_POSITIVE_X$2 = 34069;
        var GL_COLOR_ATTACHMENT0$1 = 36064;
        var GL_DEPTH_ATTACHMENT = 36096;
        var GL_STENCIL_ATTACHMENT = 36128;
        var GL_DEPTH_STENCIL_ATTACHMENT = 33306;
        var GL_FRAMEBUFFER_COMPLETE$1 = 36053;
        var GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 36054;
        var GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 36055;
        var GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 36057;
        var GL_FRAMEBUFFER_UNSUPPORTED = 36061;
        var GL_HALF_FLOAT_OES$2 = 36193;
        var GL_UNSIGNED_BYTE$6 = 5121;
        var GL_FLOAT$5 = 5126;
        var GL_RGB$1 = 6407;
        var GL_RGBA$2 = 6408;
        var GL_DEPTH_COMPONENT$1 = 6402;
        var colorTextureFormatEnums = [
          GL_RGB$1,
          GL_RGBA$2
        ];
        var textureFormatChannels = [];
        textureFormatChannels[GL_RGBA$2] = 4;
        textureFormatChannels[GL_RGB$1] = 3;
        var textureTypeSizes = [];
        textureTypeSizes[GL_UNSIGNED_BYTE$6] = 1;
        textureTypeSizes[GL_FLOAT$5] = 4;
        textureTypeSizes[GL_HALF_FLOAT_OES$2] = 2;
        var GL_RGBA4$2 = 32854;
        var GL_RGB5_A1$2 = 32855;
        var GL_RGB565$2 = 36194;
        var GL_DEPTH_COMPONENT16$1 = 33189;
        var GL_STENCIL_INDEX8$1 = 36168;
        var GL_DEPTH_STENCIL$2 = 34041;
        var GL_SRGB8_ALPHA8_EXT$1 = 35907;
        var GL_RGBA32F_EXT$1 = 34836;
        var GL_RGBA16F_EXT$1 = 34842;
        var GL_RGB16F_EXT$1 = 34843;
        var colorRenderbufferFormatEnums = [
          GL_RGBA4$2,
          GL_RGB5_A1$2,
          GL_RGB565$2,
          GL_SRGB8_ALPHA8_EXT$1,
          GL_RGBA16F_EXT$1,
          GL_RGB16F_EXT$1,
          GL_RGBA32F_EXT$1
        ];
        var statusCode = {};
        statusCode[GL_FRAMEBUFFER_COMPLETE$1] = "complete";
        statusCode[GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT] = "incomplete attachment";
        statusCode[GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS] = "incomplete dimensions";
        statusCode[GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT] = "incomplete, missing attachment";
        statusCode[GL_FRAMEBUFFER_UNSUPPORTED] = "unsupported";
        function wrapFBOState(gl, extensions, limits, textureState, renderbufferState, stats2) {
          var framebufferState = {
            cur: null,
            next: null,
            dirty: false,
            setFBO: null
          };
          var colorTextureFormats = ["rgba"];
          var colorRenderbufferFormats = ["rgba4", "rgb565", "rgb5 a1"];
          if (extensions.ext_srgb) {
            colorRenderbufferFormats.push("srgba");
          }
          if (extensions.ext_color_buffer_half_float) {
            colorRenderbufferFormats.push("rgba16f", "rgb16f");
          }
          if (extensions.webgl_color_buffer_float) {
            colorRenderbufferFormats.push("rgba32f");
          }
          var colorTypes = ["uint8"];
          if (extensions.oes_texture_half_float) {
            colorTypes.push("half float", "float16");
          }
          if (extensions.oes_texture_float) {
            colorTypes.push("float", "float32");
          }
          function FramebufferAttachment(target, texture, renderbuffer) {
            this.target = target;
            this.texture = texture;
            this.renderbuffer = renderbuffer;
            var w = 0;
            var h = 0;
            if (texture) {
              w = texture.width;
              h = texture.height;
            } else if (renderbuffer) {
              w = renderbuffer.width;
              h = renderbuffer.height;
            }
            this.width = w;
            this.height = h;
          }
          function decRef(attachment) {
            if (attachment) {
              if (attachment.texture) {
                attachment.texture._texture.decRef();
              }
              if (attachment.renderbuffer) {
                attachment.renderbuffer._renderbuffer.decRef();
              }
            }
          }
          function incRefAndCheckShape(attachment, width, height) {
            if (!attachment) {
              return;
            }
            if (attachment.texture) {
              var texture = attachment.texture._texture;
              var tw = Math.max(1, texture.width);
              var th = Math.max(1, texture.height);
              check$1(
                tw === width && th === height,
                "inconsistent width/height for supplied texture"
              );
              texture.refCount += 1;
            } else {
              var renderbuffer = attachment.renderbuffer._renderbuffer;
              check$1(
                renderbuffer.width === width && renderbuffer.height === height,
                "inconsistent width/height for renderbuffer"
              );
              renderbuffer.refCount += 1;
            }
          }
          function attach(location, attachment) {
            if (attachment) {
              if (attachment.texture) {
                gl.framebufferTexture2D(
                  GL_FRAMEBUFFER$1,
                  location,
                  attachment.target,
                  attachment.texture._texture.texture,
                  0
                );
              } else {
                gl.framebufferRenderbuffer(
                  GL_FRAMEBUFFER$1,
                  location,
                  GL_RENDERBUFFER$1,
                  attachment.renderbuffer._renderbuffer.renderbuffer
                );
              }
            }
          }
          function parseAttachment(attachment) {
            var target = GL_TEXTURE_2D$2;
            var texture = null;
            var renderbuffer = null;
            var data = attachment;
            if (typeof attachment === "object") {
              data = attachment.data;
              if ("target" in attachment) {
                target = attachment.target | 0;
              }
            }
            check$1.type(data, "function", "invalid attachment data");
            var type = data._reglType;
            if (type === "texture2d") {
              texture = data;
              check$1(target === GL_TEXTURE_2D$2);
            } else if (type === "textureCube") {
              texture = data;
              check$1(
                target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X$2 && target < GL_TEXTURE_CUBE_MAP_POSITIVE_X$2 + 6,
                "invalid cube map target"
              );
            } else if (type === "renderbuffer") {
              renderbuffer = data;
              target = GL_RENDERBUFFER$1;
            } else {
              check$1.raise("invalid regl object for attachment");
            }
            return new FramebufferAttachment(target, texture, renderbuffer);
          }
          function allocAttachment(width, height, isTexture, format, type) {
            if (isTexture) {
              var texture = textureState.create2D({
                width,
                height,
                format,
                type
              });
              texture._texture.refCount = 0;
              return new FramebufferAttachment(GL_TEXTURE_2D$2, texture, null);
            } else {
              var rb = renderbufferState.create({
                width,
                height,
                format
              });
              rb._renderbuffer.refCount = 0;
              return new FramebufferAttachment(GL_RENDERBUFFER$1, null, rb);
            }
          }
          function unwrapAttachment(attachment) {
            return attachment && (attachment.texture || attachment.renderbuffer);
          }
          function resizeAttachment(attachment, w, h) {
            if (attachment) {
              if (attachment.texture) {
                attachment.texture.resize(w, h);
              } else if (attachment.renderbuffer) {
                attachment.renderbuffer.resize(w, h);
              }
              attachment.width = w;
              attachment.height = h;
            }
          }
          var framebufferCount = 0;
          var framebufferSet = {};
          function REGLFramebuffer() {
            this.id = framebufferCount++;
            framebufferSet[this.id] = this;
            this.framebuffer = gl.createFramebuffer();
            this.width = 0;
            this.height = 0;
            this.colorAttachments = [];
            this.depthAttachment = null;
            this.stencilAttachment = null;
            this.depthStencilAttachment = null;
          }
          function decFBORefs(framebuffer) {
            framebuffer.colorAttachments.forEach(decRef);
            decRef(framebuffer.depthAttachment);
            decRef(framebuffer.stencilAttachment);
            decRef(framebuffer.depthStencilAttachment);
          }
          function destroy(framebuffer) {
            var handle = framebuffer.framebuffer;
            check$1(handle, "must not double destroy framebuffer");
            gl.deleteFramebuffer(handle);
            framebuffer.framebuffer = null;
            stats2.framebufferCount--;
            delete framebufferSet[framebuffer.id];
          }
          function updateFramebuffer(framebuffer) {
            var i;
            gl.bindFramebuffer(GL_FRAMEBUFFER$1, framebuffer.framebuffer);
            var colorAttachments = framebuffer.colorAttachments;
            for (i = 0; i < colorAttachments.length; ++i) {
              attach(GL_COLOR_ATTACHMENT0$1 + i, colorAttachments[i]);
            }
            for (i = colorAttachments.length; i < limits.maxColorAttachments; ++i) {
              gl.framebufferTexture2D(
                GL_FRAMEBUFFER$1,
                GL_COLOR_ATTACHMENT0$1 + i,
                GL_TEXTURE_2D$2,
                null,
                0
              );
            }
            gl.framebufferTexture2D(
              GL_FRAMEBUFFER$1,
              GL_DEPTH_STENCIL_ATTACHMENT,
              GL_TEXTURE_2D$2,
              null,
              0
            );
            gl.framebufferTexture2D(
              GL_FRAMEBUFFER$1,
              GL_DEPTH_ATTACHMENT,
              GL_TEXTURE_2D$2,
              null,
              0
            );
            gl.framebufferTexture2D(
              GL_FRAMEBUFFER$1,
              GL_STENCIL_ATTACHMENT,
              GL_TEXTURE_2D$2,
              null,
              0
            );
            attach(GL_DEPTH_ATTACHMENT, framebuffer.depthAttachment);
            attach(GL_STENCIL_ATTACHMENT, framebuffer.stencilAttachment);
            attach(GL_DEPTH_STENCIL_ATTACHMENT, framebuffer.depthStencilAttachment);
            var status = gl.checkFramebufferStatus(GL_FRAMEBUFFER$1);
            if (!gl.isContextLost() && status !== GL_FRAMEBUFFER_COMPLETE$1) {
              check$1.raise("framebuffer configuration not supported, status = " + statusCode[status]);
            }
            gl.bindFramebuffer(GL_FRAMEBUFFER$1, framebufferState.next ? framebufferState.next.framebuffer : null);
            framebufferState.cur = framebufferState.next;
            gl.getError();
          }
          function createFBO(a0, a1) {
            var framebuffer = new REGLFramebuffer();
            stats2.framebufferCount++;
            function reglFramebuffer(a, b) {
              var i;
              check$1(
                framebufferState.next !== framebuffer,
                "can not update framebuffer which is currently in use"
              );
              var width = 0;
              var height = 0;
              var needsDepth = true;
              var needsStencil = true;
              var colorBuffer = null;
              var colorTexture = true;
              var colorFormat = "rgba";
              var colorType = "uint8";
              var colorCount = 1;
              var depthBuffer = null;
              var stencilBuffer = null;
              var depthStencilBuffer = null;
              var depthStencilTexture = false;
              if (typeof a === "number") {
                width = a | 0;
                height = b | 0 || width;
              } else if (!a) {
                width = height = 1;
              } else {
                check$1.type(a, "object", "invalid arguments for framebuffer");
                var options = a;
                if ("shape" in options) {
                  var shape = options.shape;
                  check$1(
                    Array.isArray(shape) && shape.length >= 2,
                    "invalid shape for framebuffer"
                  );
                  width = shape[0];
                  height = shape[1];
                } else {
                  if ("radius" in options) {
                    width = height = options.radius;
                  }
                  if ("width" in options) {
                    width = options.width;
                  }
                  if ("height" in options) {
                    height = options.height;
                  }
                }
                if ("color" in options || "colors" in options) {
                  colorBuffer = options.color || options.colors;
                  if (Array.isArray(colorBuffer)) {
                    check$1(
                      colorBuffer.length === 1 || extensions.webgl_draw_buffers,
                      "multiple render targets not supported"
                    );
                  }
                }
                if (!colorBuffer) {
                  if ("colorCount" in options) {
                    colorCount = options.colorCount | 0;
                    check$1(colorCount > 0, "invalid color buffer count");
                  }
                  if ("colorTexture" in options) {
                    colorTexture = !!options.colorTexture;
                    colorFormat = "rgba4";
                  }
                  if ("colorType" in options) {
                    colorType = options.colorType;
                    if (!colorTexture) {
                      if (colorType === "half float" || colorType === "float16") {
                        check$1(
                          extensions.ext_color_buffer_half_float,
                          "you must enable EXT_color_buffer_half_float to use 16-bit render buffers"
                        );
                        colorFormat = "rgba16f";
                      } else if (colorType === "float" || colorType === "float32") {
                        check$1(
                          extensions.webgl_color_buffer_float,
                          "you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"
                        );
                        colorFormat = "rgba32f";
                      }
                    } else {
                      check$1(
                        extensions.oes_texture_float || !(colorType === "float" || colorType === "float32"),
                        "you must enable OES_texture_float in order to use floating point framebuffer objects"
                      );
                      check$1(
                        extensions.oes_texture_half_float || !(colorType === "half float" || colorType === "float16"),
                        "you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects"
                      );
                    }
                    check$1.oneOf(colorType, colorTypes, "invalid color type");
                  }
                  if ("colorFormat" in options) {
                    colorFormat = options.colorFormat;
                    if (colorTextureFormats.indexOf(colorFormat) >= 0) {
                      colorTexture = true;
                    } else if (colorRenderbufferFormats.indexOf(colorFormat) >= 0) {
                      colorTexture = false;
                    } else {
                      check$1.optional(function() {
                        if (colorTexture) {
                          check$1.oneOf(
                            options.colorFormat,
                            colorTextureFormats,
                            "invalid color format for texture"
                          );
                        } else {
                          check$1.oneOf(
                            options.colorFormat,
                            colorRenderbufferFormats,
                            "invalid color format for renderbuffer"
                          );
                        }
                      });
                    }
                  }
                }
                if ("depthTexture" in options || "depthStencilTexture" in options) {
                  depthStencilTexture = !!(options.depthTexture || options.depthStencilTexture);
                  check$1(
                    !depthStencilTexture || extensions.webgl_depth_texture,
                    "webgl_depth_texture extension not supported"
                  );
                }
                if ("depth" in options) {
                  if (typeof options.depth === "boolean") {
                    needsDepth = options.depth;
                  } else {
                    depthBuffer = options.depth;
                    needsStencil = false;
                  }
                }
                if ("stencil" in options) {
                  if (typeof options.stencil === "boolean") {
                    needsStencil = options.stencil;
                  } else {
                    stencilBuffer = options.stencil;
                    needsDepth = false;
                  }
                }
                if ("depthStencil" in options) {
                  if (typeof options.depthStencil === "boolean") {
                    needsDepth = needsStencil = options.depthStencil;
                  } else {
                    depthStencilBuffer = options.depthStencil;
                    needsDepth = false;
                    needsStencil = false;
                  }
                }
              }
              var colorAttachments = null;
              var depthAttachment = null;
              var stencilAttachment = null;
              var depthStencilAttachment = null;
              if (Array.isArray(colorBuffer)) {
                colorAttachments = colorBuffer.map(parseAttachment);
              } else if (colorBuffer) {
                colorAttachments = [parseAttachment(colorBuffer)];
              } else {
                colorAttachments = new Array(colorCount);
                for (i = 0; i < colorCount; ++i) {
                  colorAttachments[i] = allocAttachment(
                    width,
                    height,
                    colorTexture,
                    colorFormat,
                    colorType
                  );
                }
              }
              check$1(
                extensions.webgl_draw_buffers || colorAttachments.length <= 1,
                "you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers."
              );
              check$1(
                colorAttachments.length <= limits.maxColorAttachments,
                "too many color attachments, not supported"
              );
              width = width || colorAttachments[0].width;
              height = height || colorAttachments[0].height;
              if (depthBuffer) {
                depthAttachment = parseAttachment(depthBuffer);
              } else if (needsDepth && !needsStencil) {
                depthAttachment = allocAttachment(
                  width,
                  height,
                  depthStencilTexture,
                  "depth",
                  "uint32"
                );
              }
              if (stencilBuffer) {
                stencilAttachment = parseAttachment(stencilBuffer);
              } else if (needsStencil && !needsDepth) {
                stencilAttachment = allocAttachment(
                  width,
                  height,
                  false,
                  "stencil",
                  "uint8"
                );
              }
              if (depthStencilBuffer) {
                depthStencilAttachment = parseAttachment(depthStencilBuffer);
              } else if (!depthBuffer && !stencilBuffer && needsStencil && needsDepth) {
                depthStencilAttachment = allocAttachment(
                  width,
                  height,
                  depthStencilTexture,
                  "depth stencil",
                  "depth stencil"
                );
              }
              check$1(
                !!depthBuffer + !!stencilBuffer + !!depthStencilBuffer <= 1,
                "invalid framebuffer configuration, can specify exactly one depth/stencil attachment"
              );
              var commonColorAttachmentSize = null;
              for (i = 0; i < colorAttachments.length; ++i) {
                incRefAndCheckShape(colorAttachments[i], width, height);
                check$1(
                  !colorAttachments[i] || colorAttachments[i].texture && colorTextureFormatEnums.indexOf(colorAttachments[i].texture._texture.format) >= 0 || colorAttachments[i].renderbuffer && colorRenderbufferFormatEnums.indexOf(colorAttachments[i].renderbuffer._renderbuffer.format) >= 0,
                  "framebuffer color attachment " + i + " is invalid"
                );
                if (colorAttachments[i] && colorAttachments[i].texture) {
                  var colorAttachmentSize = textureFormatChannels[colorAttachments[i].texture._texture.format] * textureTypeSizes[colorAttachments[i].texture._texture.type];
                  if (commonColorAttachmentSize === null) {
                    commonColorAttachmentSize = colorAttachmentSize;
                  } else {
                    check$1(
                      commonColorAttachmentSize === colorAttachmentSize,
                      "all color attachments much have the same number of bits per pixel."
                    );
                  }
                }
              }
              incRefAndCheckShape(depthAttachment, width, height);
              check$1(
                !depthAttachment || depthAttachment.texture && depthAttachment.texture._texture.format === GL_DEPTH_COMPONENT$1 || depthAttachment.renderbuffer && depthAttachment.renderbuffer._renderbuffer.format === GL_DEPTH_COMPONENT16$1,
                "invalid depth attachment for framebuffer object"
              );
              incRefAndCheckShape(stencilAttachment, width, height);
              check$1(
                !stencilAttachment || stencilAttachment.renderbuffer && stencilAttachment.renderbuffer._renderbuffer.format === GL_STENCIL_INDEX8$1,
                "invalid stencil attachment for framebuffer object"
              );
              incRefAndCheckShape(depthStencilAttachment, width, height);
              check$1(
                !depthStencilAttachment || depthStencilAttachment.texture && depthStencilAttachment.texture._texture.format === GL_DEPTH_STENCIL$2 || depthStencilAttachment.renderbuffer && depthStencilAttachment.renderbuffer._renderbuffer.format === GL_DEPTH_STENCIL$2,
                "invalid depth-stencil attachment for framebuffer object"
              );
              decFBORefs(framebuffer);
              framebuffer.width = width;
              framebuffer.height = height;
              framebuffer.colorAttachments = colorAttachments;
              framebuffer.depthAttachment = depthAttachment;
              framebuffer.stencilAttachment = stencilAttachment;
              framebuffer.depthStencilAttachment = depthStencilAttachment;
              reglFramebuffer.color = colorAttachments.map(unwrapAttachment);
              reglFramebuffer.depth = unwrapAttachment(depthAttachment);
              reglFramebuffer.stencil = unwrapAttachment(stencilAttachment);
              reglFramebuffer.depthStencil = unwrapAttachment(depthStencilAttachment);
              reglFramebuffer.width = framebuffer.width;
              reglFramebuffer.height = framebuffer.height;
              updateFramebuffer(framebuffer);
              return reglFramebuffer;
            }
            function resize(w_, h_) {
              check$1(
                framebufferState.next !== framebuffer,
                "can not resize a framebuffer which is currently in use"
              );
              var w = Math.max(w_ | 0, 1);
              var h = Math.max(h_ | 0 || w, 1);
              if (w === framebuffer.width && h === framebuffer.height) {
                return reglFramebuffer;
              }
              var colorAttachments = framebuffer.colorAttachments;
              for (var i = 0; i < colorAttachments.length; ++i) {
                resizeAttachment(colorAttachments[i], w, h);
              }
              resizeAttachment(framebuffer.depthAttachment, w, h);
              resizeAttachment(framebuffer.stencilAttachment, w, h);
              resizeAttachment(framebuffer.depthStencilAttachment, w, h);
              framebuffer.width = reglFramebuffer.width = w;
              framebuffer.height = reglFramebuffer.height = h;
              updateFramebuffer(framebuffer);
              return reglFramebuffer;
            }
            reglFramebuffer(a0, a1);
            return extend(reglFramebuffer, {
              resize,
              _reglType: "framebuffer",
              _framebuffer: framebuffer,
              destroy: function() {
                destroy(framebuffer);
                decFBORefs(framebuffer);
              },
              use: function(block) {
                framebufferState.setFBO({
                  framebuffer: reglFramebuffer
                }, block);
              }
            });
          }
          function createCubeFBO(options) {
            var faces = Array(6);
            function reglFramebufferCube(a) {
              var i;
              check$1(
                faces.indexOf(framebufferState.next) < 0,
                "can not update framebuffer which is currently in use"
              );
              var params = {
                color: null
              };
              var radius = 0;
              var colorBuffer = null;
              var colorFormat = "rgba";
              var colorType = "uint8";
              var colorCount = 1;
              if (typeof a === "number") {
                radius = a | 0;
              } else if (!a) {
                radius = 1;
              } else {
                check$1.type(a, "object", "invalid arguments for framebuffer");
                var options2 = a;
                if ("shape" in options2) {
                  var shape = options2.shape;
                  check$1(
                    Array.isArray(shape) && shape.length >= 2,
                    "invalid shape for framebuffer"
                  );
                  check$1(
                    shape[0] === shape[1],
                    "cube framebuffer must be square"
                  );
                  radius = shape[0];
                } else {
                  if ("radius" in options2) {
                    radius = options2.radius | 0;
                  }
                  if ("width" in options2) {
                    radius = options2.width | 0;
                    if ("height" in options2) {
                      check$1(options2.height === radius, "must be square");
                    }
                  } else if ("height" in options2) {
                    radius = options2.height | 0;
                  }
                }
                if ("color" in options2 || "colors" in options2) {
                  colorBuffer = options2.color || options2.colors;
                  if (Array.isArray(colorBuffer)) {
                    check$1(
                      colorBuffer.length === 1 || extensions.webgl_draw_buffers,
                      "multiple render targets not supported"
                    );
                  }
                }
                if (!colorBuffer) {
                  if ("colorCount" in options2) {
                    colorCount = options2.colorCount | 0;
                    check$1(colorCount > 0, "invalid color buffer count");
                  }
                  if ("colorType" in options2) {
                    check$1.oneOf(
                      options2.colorType,
                      colorTypes,
                      "invalid color type"
                    );
                    colorType = options2.colorType;
                  }
                  if ("colorFormat" in options2) {
                    colorFormat = options2.colorFormat;
                    check$1.oneOf(
                      options2.colorFormat,
                      colorTextureFormats,
                      "invalid color format for texture"
                    );
                  }
                }
                if ("depth" in options2) {
                  params.depth = options2.depth;
                }
                if ("stencil" in options2) {
                  params.stencil = options2.stencil;
                }
                if ("depthStencil" in options2) {
                  params.depthStencil = options2.depthStencil;
                }
              }
              var colorCubes;
              if (colorBuffer) {
                if (Array.isArray(colorBuffer)) {
                  colorCubes = [];
                  for (i = 0; i < colorBuffer.length; ++i) {
                    colorCubes[i] = colorBuffer[i];
                  }
                } else {
                  colorCubes = [colorBuffer];
                }
              } else {
                colorCubes = Array(colorCount);
                var cubeMapParams = {
                  radius,
                  format: colorFormat,
                  type: colorType
                };
                for (i = 0; i < colorCount; ++i) {
                  colorCubes[i] = textureState.createCube(cubeMapParams);
                }
              }
              params.color = Array(colorCubes.length);
              for (i = 0; i < colorCubes.length; ++i) {
                var cube = colorCubes[i];
                check$1(
                  typeof cube === "function" && cube._reglType === "textureCube",
                  "invalid cube map"
                );
                radius = radius || cube.width;
                check$1(
                  cube.width === radius && cube.height === radius,
                  "invalid cube map shape"
                );
                params.color[i] = {
                  target: GL_TEXTURE_CUBE_MAP_POSITIVE_X$2,
                  data: colorCubes[i]
                };
              }
              for (i = 0; i < 6; ++i) {
                for (var j = 0; j < colorCubes.length; ++j) {
                  params.color[j].target = GL_TEXTURE_CUBE_MAP_POSITIVE_X$2 + i;
                }
                if (i > 0) {
                  params.depth = faces[0].depth;
                  params.stencil = faces[0].stencil;
                  params.depthStencil = faces[0].depthStencil;
                }
                if (faces[i]) {
                  faces[i](params);
                } else {
                  faces[i] = createFBO(params);
                }
              }
              return extend(reglFramebufferCube, {
                width: radius,
                height: radius,
                color: colorCubes
              });
            }
            function resize(radius_) {
              var i;
              var radius = radius_ | 0;
              check$1(
                radius > 0 && radius <= limits.maxCubeMapSize,
                "invalid radius for cube fbo"
              );
              if (radius === reglFramebufferCube.width) {
                return reglFramebufferCube;
              }
              var colors = reglFramebufferCube.color;
              for (i = 0; i < colors.length; ++i) {
                colors[i].resize(radius);
              }
              for (i = 0; i < 6; ++i) {
                faces[i].resize(radius);
              }
              reglFramebufferCube.width = reglFramebufferCube.height = radius;
              return reglFramebufferCube;
            }
            reglFramebufferCube(options);
            return extend(reglFramebufferCube, {
              faces,
              resize,
              _reglType: "framebufferCube",
              destroy: function() {
                faces.forEach(function(f) {
                  f.destroy();
                });
              }
            });
          }
          function restoreFramebuffers() {
            framebufferState.cur = null;
            framebufferState.next = null;
            framebufferState.dirty = true;
            values(framebufferSet).forEach(function(fb) {
              fb.framebuffer = gl.createFramebuffer();
              updateFramebuffer(fb);
            });
          }
          return extend(framebufferState, {
            getFramebuffer: function(object) {
              if (typeof object === "function" && object._reglType === "framebuffer") {
                var fbo = object._framebuffer;
                if (fbo instanceof REGLFramebuffer) {
                  return fbo;
                }
              }
              return null;
            },
            create: createFBO,
            createCube: createCubeFBO,
            clear: function() {
              values(framebufferSet).forEach(destroy);
            },
            restore: restoreFramebuffers
          });
        }
        var GL_FLOAT$6 = 5126;
        var GL_ARRAY_BUFFER$1 = 34962;
        var GL_ELEMENT_ARRAY_BUFFER$1 = 34963;
        var VAO_OPTIONS = [
          "attributes",
          "elements",
          "offset",
          "count",
          "primitive",
          "instances"
        ];
        function AttributeRecord() {
          this.state = 0;
          this.x = 0;
          this.y = 0;
          this.z = 0;
          this.w = 0;
          this.buffer = null;
          this.size = 0;
          this.normalized = false;
          this.type = GL_FLOAT$6;
          this.offset = 0;
          this.stride = 0;
          this.divisor = 0;
        }
        function wrapAttributeState(gl, extensions, limits, stats2, bufferState, elementState, drawState) {
          var NUM_ATTRIBUTES = limits.maxAttributes;
          var attributeBindings = new Array(NUM_ATTRIBUTES);
          for (var i = 0; i < NUM_ATTRIBUTES; ++i) {
            attributeBindings[i] = new AttributeRecord();
          }
          var vaoCount = 0;
          var vaoSet = {};
          var state = {
            Record: AttributeRecord,
            scope: {},
            state: attributeBindings,
            currentVAO: null,
            targetVAO: null,
            restore: extVAO() ? restoreVAO : function() {
            },
            createVAO,
            getVAO,
            destroyBuffer,
            setVAO: extVAO() ? setVAOEXT : setVAOEmulated,
            clear: extVAO() ? destroyVAOEXT : function() {
            }
          };
          function destroyBuffer(buffer) {
            for (var i2 = 0; i2 < attributeBindings.length; ++i2) {
              var record = attributeBindings[i2];
              if (record.buffer === buffer) {
                gl.disableVertexAttribArray(i2);
                record.buffer = null;
              }
            }
          }
          function extVAO() {
            return extensions.oes_vertex_array_object;
          }
          function extInstanced() {
            return extensions.angle_instanced_arrays;
          }
          function getVAO(vao) {
            if (typeof vao === "function" && vao._vao) {
              return vao._vao;
            }
            return null;
          }
          function setVAOEXT(vao) {
            if (vao === state.currentVAO) {
              return;
            }
            var ext = extVAO();
            if (vao) {
              ext.bindVertexArrayOES(vao.vao);
            } else {
              ext.bindVertexArrayOES(null);
            }
            state.currentVAO = vao;
          }
          function setVAOEmulated(vao) {
            if (vao === state.currentVAO) {
              return;
            }
            if (vao) {
              vao.bindAttrs();
            } else {
              var exti = extInstanced();
              for (var i2 = 0; i2 < attributeBindings.length; ++i2) {
                var binding = attributeBindings[i2];
                if (binding.buffer) {
                  gl.enableVertexAttribArray(i2);
                  binding.buffer.bind();
                  gl.vertexAttribPointer(i2, binding.size, binding.type, binding.normalized, binding.stride, binding.offfset);
                  if (exti && binding.divisor) {
                    exti.vertexAttribDivisorANGLE(i2, binding.divisor);
                  }
                } else {
                  gl.disableVertexAttribArray(i2);
                  gl.vertexAttrib4f(i2, binding.x, binding.y, binding.z, binding.w);
                }
              }
              if (drawState.elements) {
                gl.bindBuffer(GL_ELEMENT_ARRAY_BUFFER$1, drawState.elements.buffer.buffer);
              } else {
                gl.bindBuffer(GL_ELEMENT_ARRAY_BUFFER$1, null);
              }
            }
            state.currentVAO = vao;
          }
          function destroyVAOEXT() {
            values(vaoSet).forEach(function(vao) {
              vao.destroy();
            });
          }
          function REGLVAO() {
            this.id = ++vaoCount;
            this.attributes = [];
            this.elements = null;
            this.ownsElements = false;
            this.count = 0;
            this.offset = 0;
            this.instances = -1;
            this.primitive = 4;
            var extension = extVAO();
            if (extension) {
              this.vao = extension.createVertexArrayOES();
            } else {
              this.vao = null;
            }
            vaoSet[this.id] = this;
            this.buffers = [];
          }
          REGLVAO.prototype.bindAttrs = function() {
            var exti = extInstanced();
            var attributes = this.attributes;
            for (var i2 = 0; i2 < attributes.length; ++i2) {
              var attr = attributes[i2];
              if (attr.buffer) {
                gl.enableVertexAttribArray(i2);
                gl.bindBuffer(GL_ARRAY_BUFFER$1, attr.buffer.buffer);
                gl.vertexAttribPointer(i2, attr.size, attr.type, attr.normalized, attr.stride, attr.offset);
                if (exti && attr.divisor) {
                  exti.vertexAttribDivisorANGLE(i2, attr.divisor);
                }
              } else {
                gl.disableVertexAttribArray(i2);
                gl.vertexAttrib4f(i2, attr.x, attr.y, attr.z, attr.w);
              }
            }
            for (var j = attributes.length; j < NUM_ATTRIBUTES; ++j) {
              gl.disableVertexAttribArray(j);
            }
            var elements = elementState.getElements(this.elements);
            if (elements) {
              gl.bindBuffer(GL_ELEMENT_ARRAY_BUFFER$1, elements.buffer.buffer);
            } else {
              gl.bindBuffer(GL_ELEMENT_ARRAY_BUFFER$1, null);
            }
          };
          REGLVAO.prototype.refresh = function() {
            var ext = extVAO();
            if (ext) {
              ext.bindVertexArrayOES(this.vao);
              this.bindAttrs();
              state.currentVAO = null;
              ext.bindVertexArrayOES(null);
            }
          };
          REGLVAO.prototype.destroy = function() {
            if (this.vao) {
              var extension = extVAO();
              if (this === state.currentVAO) {
                state.currentVAO = null;
                extension.bindVertexArrayOES(null);
              }
              extension.deleteVertexArrayOES(this.vao);
              this.vao = null;
            }
            if (this.ownsElements) {
              this.elements.destroy();
              this.elements = null;
              this.ownsElements = false;
            }
            if (vaoSet[this.id]) {
              delete vaoSet[this.id];
              stats2.vaoCount -= 1;
            }
          };
          function restoreVAO() {
            var ext = extVAO();
            if (ext) {
              values(vaoSet).forEach(function(vao) {
                vao.refresh();
              });
            }
          }
          function createVAO(_attr) {
            var vao = new REGLVAO();
            stats2.vaoCount += 1;
            function updateVAO(options) {
              var attributes;
              if (Array.isArray(options)) {
                attributes = options;
                if (vao.elements && vao.ownsElements) {
                  vao.elements.destroy();
                }
                vao.elements = null;
                vao.ownsElements = false;
                vao.offset = 0;
                vao.count = 0;
                vao.instances = -1;
                vao.primitive = 4;
              } else {
                check$1(typeof options === "object", "invalid arguments for create vao");
                check$1("attributes" in options, "must specify attributes for vao");
                if (options.elements) {
                  var elements = options.elements;
                  if (vao.ownsElements) {
                    if (typeof elements === "function" && elements._reglType === "elements") {
                      vao.elements.destroy();
                      vao.ownsElements = false;
                    } else {
                      vao.elements(elements);
                      vao.ownsElements = false;
                    }
                  } else if (elementState.getElements(options.elements)) {
                    vao.elements = options.elements;
                    vao.ownsElements = false;
                  } else {
                    vao.elements = elementState.create(options.elements);
                    vao.ownsElements = true;
                  }
                } else {
                  vao.elements = null;
                  vao.ownsElements = false;
                }
                attributes = options.attributes;
                vao.offset = 0;
                vao.count = -1;
                vao.instances = -1;
                vao.primitive = 4;
                if (vao.elements) {
                  vao.count = vao.elements._elements.vertCount;
                  vao.primitive = vao.elements._elements.primType;
                }
                if ("offset" in options) {
                  vao.offset = options.offset | 0;
                }
                if ("count" in options) {
                  vao.count = options.count | 0;
                }
                if ("instances" in options) {
                  vao.instances = options.instances | 0;
                }
                if ("primitive" in options) {
                  check$1(options.primitive in primTypes, "bad primitive type: " + options.primitive);
                  vao.primitive = primTypes[options.primitive];
                }
                check$1.optional(() => {
                  var keys2 = Object.keys(options);
                  for (var i3 = 0; i3 < keys2.length; ++i3) {
                    check$1(VAO_OPTIONS.indexOf(keys2[i3]) >= 0, 'invalid option for vao: "' + keys2[i3] + '" valid options are ' + VAO_OPTIONS);
                  }
                });
                check$1(Array.isArray(attributes), "attributes must be an array");
              }
              check$1(attributes.length < NUM_ATTRIBUTES, "too many attributes");
              check$1(attributes.length > 0, "must specify at least one attribute");
              var bufUpdated = {};
              var nattributes = vao.attributes;
              nattributes.length = attributes.length;
              for (var i2 = 0; i2 < attributes.length; ++i2) {
                var spec = attributes[i2];
                var rec = nattributes[i2] = new AttributeRecord();
                var data = spec.data || spec;
                if (Array.isArray(data) || isTypedArray(data) || isNDArrayLike(data)) {
                  var buf;
                  if (vao.buffers[i2]) {
                    buf = vao.buffers[i2];
                    if (isTypedArray(data) && buf._buffer.byteLength >= data.byteLength) {
                      buf.subdata(data);
                    } else {
                      buf.destroy();
                      vao.buffers[i2] = null;
                    }
                  }
                  if (!vao.buffers[i2]) {
                    buf = vao.buffers[i2] = bufferState.create(spec, GL_ARRAY_BUFFER$1, false, true);
                  }
                  rec.buffer = bufferState.getBuffer(buf);
                  rec.size = rec.buffer.dimension | 0;
                  rec.normalized = false;
                  rec.type = rec.buffer.dtype;
                  rec.offset = 0;
                  rec.stride = 0;
                  rec.divisor = 0;
                  rec.state = 1;
                  bufUpdated[i2] = 1;
                } else if (bufferState.getBuffer(spec)) {
                  rec.buffer = bufferState.getBuffer(spec);
                  rec.size = rec.buffer.dimension | 0;
                  rec.normalized = false;
                  rec.type = rec.buffer.dtype;
                  rec.offset = 0;
                  rec.stride = 0;
                  rec.divisor = 0;
                  rec.state = 1;
                } else if (bufferState.getBuffer(spec.buffer)) {
                  rec.buffer = bufferState.getBuffer(spec.buffer);
                  rec.size = (+spec.size || rec.buffer.dimension) | 0;
                  rec.normalized = !!spec.normalized || false;
                  if ("type" in spec) {
                    check$1.parameter(spec.type, glTypes, "invalid buffer type");
                    rec.type = glTypes[spec.type];
                  } else {
                    rec.type = rec.buffer.dtype;
                  }
                  rec.offset = (spec.offset || 0) | 0;
                  rec.stride = (spec.stride || 0) | 0;
                  rec.divisor = (spec.divisor || 0) | 0;
                  rec.state = 1;
                  check$1(rec.size >= 1 && rec.size <= 4, "size must be between 1 and 4");
                  check$1(rec.offset >= 0, "invalid offset");
                  check$1(rec.stride >= 0 && rec.stride <= 255, "stride must be between 0 and 255");
                  check$1(rec.divisor >= 0, "divisor must be positive");
                  check$1(!rec.divisor || !!extensions.angle_instanced_arrays, "ANGLE_instanced_arrays must be enabled to use divisor");
                } else if ("x" in spec) {
                  check$1(i2 > 0, "first attribute must not be a constant");
                  rec.x = +spec.x || 0;
                  rec.y = +spec.y || 0;
                  rec.z = +spec.z || 0;
                  rec.w = +spec.w || 0;
                  rec.state = 2;
                } else {
                  check$1(false, "invalid attribute spec for location " + i2);
                }
              }
              for (var j = 0; j < vao.buffers.length; ++j) {
                if (!bufUpdated[j] && vao.buffers[j]) {
                  vao.buffers[j].destroy();
                  vao.buffers[j] = null;
                }
              }
              vao.refresh();
              return updateVAO;
            }
            updateVAO.destroy = function() {
              for (var j = 0; j < vao.buffers.length; ++j) {
                if (vao.buffers[j]) {
                  vao.buffers[j].destroy();
                }
              }
              vao.buffers.length = 0;
              if (vao.ownsElements) {
                vao.elements.destroy();
                vao.elements = null;
                vao.ownsElements = false;
              }
              vao.destroy();
            };
            updateVAO._vao = vao;
            updateVAO._reglType = "vao";
            return updateVAO(_attr);
          }
          return state;
        }
        var GL_FRAGMENT_SHADER = 35632;
        var GL_VERTEX_SHADER = 35633;
        var GL_ACTIVE_UNIFORMS = 35718;
        var GL_ACTIVE_ATTRIBUTES = 35721;
        function wrapShaderState(gl, stringStore, stats2, config) {
          var fragShaders = {};
          var vertShaders = {};
          function ActiveInfo(name, id, location, info) {
            this.name = name;
            this.id = id;
            this.location = location;
            this.info = info;
          }
          function insertActiveInfo(list, info) {
            for (var i = 0; i < list.length; ++i) {
              if (list[i].id === info.id) {
                list[i].location = info.location;
                return;
              }
            }
            list.push(info);
          }
          function getShader(type, id, command) {
            var cache = type === GL_FRAGMENT_SHADER ? fragShaders : vertShaders;
            var shader = cache[id];
            if (!shader) {
              var source = stringStore.str(id);
              shader = gl.createShader(type);
              gl.shaderSource(shader, source);
              gl.compileShader(shader);
              check$1.shaderError(gl, shader, source, type, command);
              cache[id] = shader;
            }
            return shader;
          }
          var programCache = {};
          var programList = [];
          var PROGRAM_COUNTER = 0;
          function REGLProgram(fragId, vertId) {
            this.id = PROGRAM_COUNTER++;
            this.fragId = fragId;
            this.vertId = vertId;
            this.program = null;
            this.uniforms = [];
            this.attributes = [];
            this.refCount = 1;
            if (config.profile) {
              this.stats = {
                uniformsCount: 0,
                attributesCount: 0
              };
            }
          }
          function linkProgram(desc, command, attributeLocations) {
            var i, info;
            var fragShader = getShader(GL_FRAGMENT_SHADER, desc.fragId);
            var vertShader = getShader(GL_VERTEX_SHADER, desc.vertId);
            var program = desc.program = gl.createProgram();
            gl.attachShader(program, fragShader);
            gl.attachShader(program, vertShader);
            if (attributeLocations) {
              for (i = 0; i < attributeLocations.length; ++i) {
                var binding = attributeLocations[i];
                gl.bindAttribLocation(program, binding[0], binding[1]);
              }
            }
            gl.linkProgram(program);
            check$1.linkError(
              gl,
              program,
              stringStore.str(desc.fragId),
              stringStore.str(desc.vertId),
              command
            );
            var numUniforms = gl.getProgramParameter(program, GL_ACTIVE_UNIFORMS);
            if (config.profile) {
              desc.stats.uniformsCount = numUniforms;
            }
            var uniforms = desc.uniforms;
            for (i = 0; i < numUniforms; ++i) {
              info = gl.getActiveUniform(program, i);
              if (info) {
                if (info.size > 1) {
                  for (var j = 0; j < info.size; ++j) {
                    var name = info.name.replace("[0]", "[" + j + "]");
                    insertActiveInfo(uniforms, new ActiveInfo(
                      name,
                      stringStore.id(name),
                      gl.getUniformLocation(program, name),
                      info
                    ));
                  }
                } else {
                  insertActiveInfo(uniforms, new ActiveInfo(
                    info.name,
                    stringStore.id(info.name),
                    gl.getUniformLocation(program, info.name),
                    info
                  ));
                }
              }
            }
            var numAttributes = gl.getProgramParameter(program, GL_ACTIVE_ATTRIBUTES);
            if (config.profile) {
              desc.stats.attributesCount = numAttributes;
            }
            var attributes = desc.attributes;
            for (i = 0; i < numAttributes; ++i) {
              info = gl.getActiveAttrib(program, i);
              if (info) {
                insertActiveInfo(attributes, new ActiveInfo(
                  info.name,
                  stringStore.id(info.name),
                  gl.getAttribLocation(program, info.name),
                  info
                ));
              }
            }
          }
          if (config.profile) {
            stats2.getMaxUniformsCount = function() {
              var m = 0;
              programList.forEach(function(desc) {
                if (desc.stats.uniformsCount > m) {
                  m = desc.stats.uniformsCount;
                }
              });
              return m;
            };
            stats2.getMaxAttributesCount = function() {
              var m = 0;
              programList.forEach(function(desc) {
                if (desc.stats.attributesCount > m) {
                  m = desc.stats.attributesCount;
                }
              });
              return m;
            };
          }
          function restoreShaders() {
            fragShaders = {};
            vertShaders = {};
            for (var i = 0; i < programList.length; ++i) {
              linkProgram(programList[i], null, programList[i].attributes.map(function(info) {
                return [info.location, info.name];
              }));
            }
          }
          return {
            clear: function() {
              var deleteShader = gl.deleteShader.bind(gl);
              values(fragShaders).forEach(deleteShader);
              fragShaders = {};
              values(vertShaders).forEach(deleteShader);
              vertShaders = {};
              programList.forEach(function(desc) {
                gl.deleteProgram(desc.program);
              });
              programList.length = 0;
              programCache = {};
              stats2.shaderCount = 0;
            },
            program: function(vertId, fragId, command, attribLocations) {
              check$1.command(vertId >= 0, "missing vertex shader", command);
              check$1.command(fragId >= 0, "missing fragment shader", command);
              var cache = programCache[fragId];
              if (!cache) {
                cache = programCache[fragId] = {};
              }
              var prevProgram = cache[vertId];
              if (prevProgram) {
                prevProgram.refCount++;
                if (!attribLocations) {
                  return prevProgram;
                }
              }
              var program = new REGLProgram(fragId, vertId);
              stats2.shaderCount++;
              linkProgram(program, command, attribLocations);
              if (!prevProgram) {
                cache[vertId] = program;
              }
              programList.push(program);
              return extend(program, {
                destroy: function() {
                  program.refCount--;
                  if (program.refCount <= 0) {
                    gl.deleteProgram(program.program);
                    var idx = programList.indexOf(program);
                    programList.splice(idx, 1);
                    stats2.shaderCount--;
                  }
                  if (cache[program.vertId].refCount <= 0) {
                    gl.deleteShader(vertShaders[program.vertId]);
                    delete vertShaders[program.vertId];
                    delete programCache[program.fragId][program.vertId];
                  }
                  if (!Object.keys(programCache[program.fragId]).length) {
                    gl.deleteShader(fragShaders[program.fragId]);
                    delete fragShaders[program.fragId];
                    delete programCache[program.fragId];
                  }
                }
              });
            },
            restore: restoreShaders,
            shader: getShader,
            frag: -1,
            vert: -1
          };
        }
        var GL_RGBA$3 = 6408;
        var GL_UNSIGNED_BYTE$7 = 5121;
        var GL_PACK_ALIGNMENT = 3333;
        var GL_FLOAT$7 = 5126;
        function wrapReadPixels(gl, framebufferState, reglPoll, context, glAttributes, extensions, limits) {
          function readPixelsImpl(input) {
            var type;
            if (framebufferState.next === null) {
              check$1(
                glAttributes.preserveDrawingBuffer,
                'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'
              );
              type = GL_UNSIGNED_BYTE$7;
            } else {
              check$1(
                framebufferState.next.colorAttachments[0].texture !== null,
                "You cannot read from a renderbuffer"
              );
              type = framebufferState.next.colorAttachments[0].texture._texture.type;
              check$1.optional(function() {
                if (extensions.oes_texture_float) {
                  check$1(
                    type === GL_UNSIGNED_BYTE$7 || type === GL_FLOAT$7,
                    "Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"
                  );
                  if (type === GL_FLOAT$7) {
                    check$1(limits.readFloat, "Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float");
                  }
                } else {
                  check$1(
                    type === GL_UNSIGNED_BYTE$7,
                    "Reading from a framebuffer is only allowed for the type 'uint8'"
                  );
                }
              });
            }
            var x = 0;
            var y = 0;
            var width = context.framebufferWidth;
            var height = context.framebufferHeight;
            var data = null;
            if (isTypedArray(input)) {
              data = input;
            } else if (input) {
              check$1.type(input, "object", "invalid arguments to regl.read()");
              x = input.x | 0;
              y = input.y | 0;
              check$1(
                x >= 0 && x < context.framebufferWidth,
                "invalid x offset for regl.read"
              );
              check$1(
                y >= 0 && y < context.framebufferHeight,
                "invalid y offset for regl.read"
              );
              width = (input.width || context.framebufferWidth - x) | 0;
              height = (input.height || context.framebufferHeight - y) | 0;
              data = input.data || null;
            }
            if (data) {
              if (type === GL_UNSIGNED_BYTE$7) {
                check$1(
                  data instanceof Uint8Array,
                  "buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"
                );
              } else if (type === GL_FLOAT$7) {
                check$1(
                  data instanceof Float32Array,
                  "buffer must be 'Float32Array' when reading from a framebuffer of type 'float'"
                );
              }
            }
            check$1(
              width > 0 && width + x <= context.framebufferWidth,
              "invalid width for read pixels"
            );
            check$1(
              height > 0 && height + y <= context.framebufferHeight,
              "invalid height for read pixels"
            );
            reglPoll();
            var size = width * height * 4;
            if (!data) {
              if (type === GL_UNSIGNED_BYTE$7) {
                data = new Uint8Array(size);
              } else if (type === GL_FLOAT$7) {
                data = data || new Float32Array(size);
              }
            }
            check$1.isTypedArray(data, "data buffer for regl.read() must be a typedarray");
            check$1(data.byteLength >= size, "data buffer for regl.read() too small");
            gl.pixelStorei(GL_PACK_ALIGNMENT, 4);
            gl.readPixels(
              x,
              y,
              width,
              height,
              GL_RGBA$3,
              type,
              data
            );
            return data;
          }
          function readPixelsFBO(options) {
            var result;
            framebufferState.setFBO({
              framebuffer: options.framebuffer
            }, function() {
              result = readPixelsImpl(options);
            });
            return result;
          }
          function readPixels(options) {
            if (!options || !("framebuffer" in options)) {
              return readPixelsImpl(options);
            } else {
              return readPixelsFBO(options);
            }
          }
          return readPixels;
        }
        function slice(x) {
          return Array.prototype.slice.call(x);
        }
        function join(x) {
          return slice(x).join("");
        }
        function createEnvironment() {
          var varCounter = 0;
          var linkedNames = [];
          var linkedValues = [];
          function link(value) {
            for (var i = 0; i < linkedValues.length; ++i) {
              if (linkedValues[i] === value) {
                return linkedNames[i];
              }
            }
            var name = "g" + varCounter++;
            linkedNames.push(name);
            linkedValues.push(value);
            return name;
          }
          function block() {
            var code = [];
            function push2() {
              code.push.apply(code, slice(arguments));
            }
            var vars = [];
            function def() {
              var name = "v" + varCounter++;
              vars.push(name);
              if (arguments.length > 0) {
                code.push(name, "=");
                code.push.apply(code, slice(arguments));
                code.push(";");
              }
              return name;
            }
            return extend(push2, {
              def,
              toString: function() {
                return join([
                  vars.length > 0 ? "var " + vars.join(",") + ";" : "",
                  join(code)
                ]);
              }
            });
          }
          function scope() {
            var entry = block();
            var exit = block();
            var entryToString = entry.toString;
            var exitToString = exit.toString;
            function save(object, prop) {
              exit(object, prop, "=", entry.def(object, prop), ";");
            }
            return extend(function() {
              entry.apply(entry, slice(arguments));
            }, {
              def: entry.def,
              entry,
              exit,
              save,
              set: function(object, prop, value) {
                save(object, prop);
                entry(object, prop, "=", value, ";");
              },
              toString: function() {
                return entryToString() + exitToString();
              }
            });
          }
          function conditional() {
            var pred = join(arguments);
            var thenBlock = scope();
            var elseBlock = scope();
            var thenToString = thenBlock.toString;
            var elseToString = elseBlock.toString;
            return extend(thenBlock, {
              then: function() {
                thenBlock.apply(thenBlock, slice(arguments));
                return this;
              },
              else: function() {
                elseBlock.apply(elseBlock, slice(arguments));
                return this;
              },
              toString: function() {
                var elseClause = elseToString();
                if (elseClause) {
                  elseClause = "else{" + elseClause + "}";
                }
                return join([
                  "if(",
                  pred,
                  "){",
                  thenToString(),
                  "}",
                  elseClause
                ]);
              }
            });
          }
          var globalBlock = block();
          var procedures = {};
          function proc(name, count) {
            var args = [];
            function arg() {
              var name2 = "a" + args.length;
              args.push(name2);
              return name2;
            }
            count = count || 0;
            for (var i = 0; i < count; ++i) {
              arg();
            }
            var body = scope();
            var bodyToString = body.toString;
            var result = procedures[name] = extend(body, {
              arg,
              toString: function() {
                return join([
                  "function(",
                  args.join(),
                  "){",
                  bodyToString(),
                  "}"
                ]);
              }
            });
            return result;
          }
          function compile() {
            var code = [
              '"use strict";',
              globalBlock,
              "return {"
            ];
            Object.keys(procedures).forEach(function(name) {
              code.push('"', name, '":', procedures[name].toString(), ",");
            });
            code.push("}");
            var src = join(code).replace(/;/g, ";\n").replace(/}/g, "}\n").replace(/{/g, "{\n");
            var proc2 = Function.apply(null, linkedNames.concat(src));
            return proc2.apply(null, linkedValues);
          }
          return {
            global: globalBlock,
            link,
            block,
            proc,
            scope,
            cond: conditional,
            compile
          };
        }
        var CUTE_COMPONENTS = "xyzw".split("");
        var GL_UNSIGNED_BYTE$8 = 5121;
        var ATTRIB_STATE_POINTER = 1;
        var ATTRIB_STATE_CONSTANT = 2;
        var DYN_FUNC$1 = 0;
        var DYN_PROP$1 = 1;
        var DYN_CONTEXT$1 = 2;
        var DYN_STATE$1 = 3;
        var DYN_THUNK = 4;
        var DYN_CONSTANT$1 = 5;
        var DYN_ARRAY$1 = 6;
        var S_DITHER = "dither";
        var S_BLEND_ENABLE = "blend.enable";
        var S_BLEND_COLOR = "blend.color";
        var S_BLEND_EQUATION = "blend.equation";
        var S_BLEND_FUNC = "blend.func";
        var S_DEPTH_ENABLE = "depth.enable";
        var S_DEPTH_FUNC = "depth.func";
        var S_DEPTH_RANGE = "depth.range";
        var S_DEPTH_MASK = "depth.mask";
        var S_COLOR_MASK = "colorMask";
        var S_CULL_ENABLE = "cull.enable";
        var S_CULL_FACE = "cull.face";
        var S_FRONT_FACE = "frontFace";
        var S_LINE_WIDTH = "lineWidth";
        var S_POLYGON_OFFSET_ENABLE = "polygonOffset.enable";
        var S_POLYGON_OFFSET_OFFSET = "polygonOffset.offset";
        var S_SAMPLE_ALPHA = "sample.alpha";
        var S_SAMPLE_ENABLE = "sample.enable";
        var S_SAMPLE_COVERAGE = "sample.coverage";
        var S_STENCIL_ENABLE = "stencil.enable";
        var S_STENCIL_MASK = "stencil.mask";
        var S_STENCIL_FUNC = "stencil.func";
        var S_STENCIL_OPFRONT = "stencil.opFront";
        var S_STENCIL_OPBACK = "stencil.opBack";
        var S_SCISSOR_ENABLE = "scissor.enable";
        var S_SCISSOR_BOX = "scissor.box";
        var S_VIEWPORT = "viewport";
        var S_PROFILE = "profile";
        var S_FRAMEBUFFER = "framebuffer";
        var S_VERT = "vert";
        var S_FRAG = "frag";
        var S_ELEMENTS = "elements";
        var S_PRIMITIVE = "primitive";
        var S_COUNT = "count";
        var S_OFFSET = "offset";
        var S_INSTANCES = "instances";
        var S_VAO = "vao";
        var SUFFIX_WIDTH = "Width";
        var SUFFIX_HEIGHT = "Height";
        var S_FRAMEBUFFER_WIDTH = S_FRAMEBUFFER + SUFFIX_WIDTH;
        var S_FRAMEBUFFER_HEIGHT = S_FRAMEBUFFER + SUFFIX_HEIGHT;
        var S_VIEWPORT_WIDTH = S_VIEWPORT + SUFFIX_WIDTH;
        var S_VIEWPORT_HEIGHT = S_VIEWPORT + SUFFIX_HEIGHT;
        var S_DRAWINGBUFFER = "drawingBuffer";
        var S_DRAWINGBUFFER_WIDTH = S_DRAWINGBUFFER + SUFFIX_WIDTH;
        var S_DRAWINGBUFFER_HEIGHT = S_DRAWINGBUFFER + SUFFIX_HEIGHT;
        var NESTED_OPTIONS = [
          S_BLEND_FUNC,
          S_BLEND_EQUATION,
          S_STENCIL_FUNC,
          S_STENCIL_OPFRONT,
          S_STENCIL_OPBACK,
          S_SAMPLE_COVERAGE,
          S_VIEWPORT,
          S_SCISSOR_BOX,
          S_POLYGON_OFFSET_OFFSET
        ];
        var GL_ARRAY_BUFFER$2 = 34962;
        var GL_ELEMENT_ARRAY_BUFFER$2 = 34963;
        var GL_FRAGMENT_SHADER$1 = 35632;
        var GL_VERTEX_SHADER$1 = 35633;
        var GL_TEXTURE_2D$3 = 3553;
        var GL_TEXTURE_CUBE_MAP$2 = 34067;
        var GL_CULL_FACE = 2884;
        var GL_BLEND = 3042;
        var GL_DITHER = 3024;
        var GL_STENCIL_TEST = 2960;
        var GL_DEPTH_TEST = 2929;
        var GL_SCISSOR_TEST = 3089;
        var GL_POLYGON_OFFSET_FILL = 32823;
        var GL_SAMPLE_ALPHA_TO_COVERAGE = 32926;
        var GL_SAMPLE_COVERAGE = 32928;
        var GL_FLOAT$8 = 5126;
        var GL_FLOAT_VEC2 = 35664;
        var GL_FLOAT_VEC3 = 35665;
        var GL_FLOAT_VEC4 = 35666;
        var GL_INT$3 = 5124;
        var GL_INT_VEC2 = 35667;
        var GL_INT_VEC3 = 35668;
        var GL_INT_VEC4 = 35669;
        var GL_BOOL = 35670;
        var GL_BOOL_VEC2 = 35671;
        var GL_BOOL_VEC3 = 35672;
        var GL_BOOL_VEC4 = 35673;
        var GL_FLOAT_MAT2 = 35674;
        var GL_FLOAT_MAT3 = 35675;
        var GL_FLOAT_MAT4 = 35676;
        var GL_SAMPLER_2D = 35678;
        var GL_SAMPLER_CUBE = 35680;
        var GL_TRIANGLES$1 = 4;
        var GL_FRONT = 1028;
        var GL_BACK = 1029;
        var GL_CW = 2304;
        var GL_CCW = 2305;
        var GL_MIN_EXT = 32775;
        var GL_MAX_EXT = 32776;
        var GL_ALWAYS = 519;
        var GL_KEEP = 7680;
        var GL_ZERO = 0;
        var GL_ONE = 1;
        var GL_FUNC_ADD = 32774;
        var GL_LESS = 513;
        var GL_FRAMEBUFFER$2 = 36160;
        var GL_COLOR_ATTACHMENT0$2 = 36064;
        var blendFuncs = {
          "0": 0,
          "1": 1,
          "zero": 0,
          "one": 1,
          "src color": 768,
          "one minus src color": 769,
          "src alpha": 770,
          "one minus src alpha": 771,
          "dst color": 774,
          "one minus dst color": 775,
          "dst alpha": 772,
          "one minus dst alpha": 773,
          "constant color": 32769,
          "one minus constant color": 32770,
          "constant alpha": 32771,
          "one minus constant alpha": 32772,
          "src alpha saturate": 776
        };
        var invalidBlendCombinations = [
          "constant color, constant alpha",
          "one minus constant color, constant alpha",
          "constant color, one minus constant alpha",
          "one minus constant color, one minus constant alpha",
          "constant alpha, constant color",
          "constant alpha, one minus constant color",
          "one minus constant alpha, constant color",
          "one minus constant alpha, one minus constant color"
        ];
        var compareFuncs = {
          "never": 512,
          "less": 513,
          "<": 513,
          "equal": 514,
          "=": 514,
          "==": 514,
          "===": 514,
          "lequal": 515,
          "<=": 515,
          "greater": 516,
          ">": 516,
          "notequal": 517,
          "!=": 517,
          "!==": 517,
          "gequal": 518,
          ">=": 518,
          "always": 519
        };
        var stencilOps = {
          "0": 0,
          "zero": 0,
          "keep": 7680,
          "replace": 7681,
          "increment": 7682,
          "decrement": 7683,
          "increment wrap": 34055,
          "decrement wrap": 34056,
          "invert": 5386
        };
        var shaderType = {
          "frag": GL_FRAGMENT_SHADER$1,
          "vert": GL_VERTEX_SHADER$1
        };
        var orientationType = {
          "cw": GL_CW,
          "ccw": GL_CCW
        };
        function isBufferArgs(x) {
          return Array.isArray(x) || isTypedArray(x) || isNDArrayLike(x);
        }
        function sortState(state) {
          return state.sort(function(a, b) {
            if (a === S_VIEWPORT) {
              return -1;
            } else if (b === S_VIEWPORT) {
              return 1;
            }
            return a < b ? -1 : 1;
          });
        }
        function Declaration(thisDep, contextDep, propDep, append) {
          this.thisDep = thisDep;
          this.contextDep = contextDep;
          this.propDep = propDep;
          this.append = append;
        }
        function isStatic(decl) {
          return decl && !(decl.thisDep || decl.contextDep || decl.propDep);
        }
        function createStaticDecl(append) {
          return new Declaration(false, false, false, append);
        }
        function createDynamicDecl(dyn, append) {
          var type = dyn.type;
          if (type === DYN_FUNC$1) {
            var numArgs = dyn.data.length;
            return new Declaration(
              true,
              numArgs >= 1,
              numArgs >= 2,
              append
            );
          } else if (type === DYN_THUNK) {
            var data = dyn.data;
            return new Declaration(
              data.thisDep,
              data.contextDep,
              data.propDep,
              append
            );
          } else if (type === DYN_CONSTANT$1) {
            return new Declaration(
              false,
              false,
              false,
              append
            );
          } else if (type === DYN_ARRAY$1) {
            var thisDep = false;
            var contextDep = false;
            var propDep = false;
            for (var i = 0; i < dyn.data.length; ++i) {
              var subDyn = dyn.data[i];
              if (subDyn.type === DYN_PROP$1) {
                propDep = true;
              } else if (subDyn.type === DYN_CONTEXT$1) {
                contextDep = true;
              } else if (subDyn.type === DYN_STATE$1) {
                thisDep = true;
              } else if (subDyn.type === DYN_FUNC$1) {
                thisDep = true;
                var subArgs = subDyn.data;
                if (subArgs >= 1) {
                  contextDep = true;
                }
                if (subArgs >= 2) {
                  propDep = true;
                }
              } else if (subDyn.type === DYN_THUNK) {
                thisDep = thisDep || subDyn.data.thisDep;
                contextDep = contextDep || subDyn.data.contextDep;
                propDep = propDep || subDyn.data.propDep;
              }
            }
            return new Declaration(
              thisDep,
              contextDep,
              propDep,
              append
            );
          } else {
            return new Declaration(
              type === DYN_STATE$1,
              type === DYN_CONTEXT$1,
              type === DYN_PROP$1,
              append
            );
          }
        }
        var SCOPE_DECL = new Declaration(false, false, false, function() {
        });
        function reglCore(gl, stringStore, extensions, limits, bufferState, elementState, textureState, framebufferState, uniformState, attributeState, shaderState, drawState, contextState, timer, config) {
          var AttributeRecord2 = attributeState.Record;
          var blendEquations = {
            "add": 32774,
            "subtract": 32778,
            "reverse subtract": 32779
          };
          if (extensions.ext_blend_minmax) {
            blendEquations.min = GL_MIN_EXT;
            blendEquations.max = GL_MAX_EXT;
          }
          var extInstancing = extensions.angle_instanced_arrays;
          var extDrawBuffers = extensions.webgl_draw_buffers;
          var extVertexArrays = extensions.oes_vertex_array_object;
          var currentState = {
            dirty: true,
            profile: config.profile
          };
          var nextState = {};
          var GL_STATE_NAMES = [];
          var GL_FLAGS = {};
          var GL_VARIABLES = {};
          function propName(name) {
            return name.replace(".", "_");
          }
          function stateFlag(sname, cap, init) {
            var name = propName(sname);
            GL_STATE_NAMES.push(sname);
            nextState[name] = currentState[name] = !!init;
            GL_FLAGS[name] = cap;
          }
          function stateVariable(sname, func, init) {
            var name = propName(sname);
            GL_STATE_NAMES.push(sname);
            if (Array.isArray(init)) {
              currentState[name] = init.slice();
              nextState[name] = init.slice();
            } else {
              currentState[name] = nextState[name] = init;
            }
            GL_VARIABLES[name] = func;
          }
          stateFlag(S_DITHER, GL_DITHER);
          stateFlag(S_BLEND_ENABLE, GL_BLEND);
          stateVariable(S_BLEND_COLOR, "blendColor", [0, 0, 0, 0]);
          stateVariable(
            S_BLEND_EQUATION,
            "blendEquationSeparate",
            [GL_FUNC_ADD, GL_FUNC_ADD]
          );
          stateVariable(
            S_BLEND_FUNC,
            "blendFuncSeparate",
            [GL_ONE, GL_ZERO, GL_ONE, GL_ZERO]
          );
          stateFlag(S_DEPTH_ENABLE, GL_DEPTH_TEST, true);
          stateVariable(S_DEPTH_FUNC, "depthFunc", GL_LESS);
          stateVariable(S_DEPTH_RANGE, "depthRange", [0, 1]);
          stateVariable(S_DEPTH_MASK, "depthMask", true);
          stateVariable(S_COLOR_MASK, S_COLOR_MASK, [true, true, true, true]);
          stateFlag(S_CULL_ENABLE, GL_CULL_FACE);
          stateVariable(S_CULL_FACE, "cullFace", GL_BACK);
          stateVariable(S_FRONT_FACE, S_FRONT_FACE, GL_CCW);
          stateVariable(S_LINE_WIDTH, S_LINE_WIDTH, 1);
          stateFlag(S_POLYGON_OFFSET_ENABLE, GL_POLYGON_OFFSET_FILL);
          stateVariable(S_POLYGON_OFFSET_OFFSET, "polygonOffset", [0, 0]);
          stateFlag(S_SAMPLE_ALPHA, GL_SAMPLE_ALPHA_TO_COVERAGE);
          stateFlag(S_SAMPLE_ENABLE, GL_SAMPLE_COVERAGE);
          stateVariable(S_SAMPLE_COVERAGE, "sampleCoverage", [1, false]);
          stateFlag(S_STENCIL_ENABLE, GL_STENCIL_TEST);
          stateVariable(S_STENCIL_MASK, "stencilMask", -1);
          stateVariable(S_STENCIL_FUNC, "stencilFunc", [GL_ALWAYS, 0, -1]);
          stateVariable(
            S_STENCIL_OPFRONT,
            "stencilOpSeparate",
            [GL_FRONT, GL_KEEP, GL_KEEP, GL_KEEP]
          );
          stateVariable(
            S_STENCIL_OPBACK,
            "stencilOpSeparate",
            [GL_BACK, GL_KEEP, GL_KEEP, GL_KEEP]
          );
          stateFlag(S_SCISSOR_ENABLE, GL_SCISSOR_TEST);
          stateVariable(
            S_SCISSOR_BOX,
            "scissor",
            [0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight]
          );
          stateVariable(
            S_VIEWPORT,
            S_VIEWPORT,
            [0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight]
          );
          var sharedState = {
            gl,
            context: contextState,
            strings: stringStore,
            next: nextState,
            current: currentState,
            draw: drawState,
            elements: elementState,
            buffer: bufferState,
            shader: shaderState,
            attributes: attributeState.state,
            vao: attributeState,
            uniforms: uniformState,
            framebuffer: framebufferState,
            extensions,
            timer,
            isBufferArgs
          };
          var sharedConstants = {
            primTypes,
            compareFuncs,
            blendFuncs,
            blendEquations,
            stencilOps,
            glTypes,
            orientationType
          };
          check$1.optional(function() {
            sharedState.isArrayLike = isArrayLike;
          });
          if (extDrawBuffers) {
            sharedConstants.backBuffer = [GL_BACK];
            sharedConstants.drawBuffer = loop(limits.maxDrawbuffers, function(i) {
              if (i === 0) {
                return [0];
              }
              return loop(i, function(j) {
                return GL_COLOR_ATTACHMENT0$2 + j;
              });
            });
          }
          var drawCallCounter = 0;
          function createREGLEnvironment() {
            var env = createEnvironment();
            var link = env.link;
            var global2 = env.global;
            env.id = drawCallCounter++;
            env.batchId = "0";
            var SHARED = link(sharedState);
            var shared = env.shared = {
              props: "a0"
            };
            Object.keys(sharedState).forEach(function(prop) {
              shared[prop] = global2.def(SHARED, ".", prop);
            });
            check$1.optional(function() {
              env.CHECK = link(check$1);
              env.commandStr = check$1.guessCommand();
              env.command = link(env.commandStr);
              env.assert = function(block, pred, message) {
                block(
                  "if(!(",
                  pred,
                  "))",
                  this.CHECK,
                  ".commandRaise(",
                  link(message),
                  ",",
                  this.command,
                  ");"
                );
              };
              sharedConstants.invalidBlendCombinations = invalidBlendCombinations;
            });
            var nextVars = env.next = {};
            var currentVars = env.current = {};
            Object.keys(GL_VARIABLES).forEach(function(variable) {
              if (Array.isArray(currentState[variable])) {
                nextVars[variable] = global2.def(shared.next, ".", variable);
                currentVars[variable] = global2.def(shared.current, ".", variable);
              }
            });
            var constants = env.constants = {};
            Object.keys(sharedConstants).forEach(function(name) {
              constants[name] = global2.def(JSON.stringify(sharedConstants[name]));
            });
            env.invoke = function(block, x) {
              switch (x.type) {
                case DYN_FUNC$1:
                  var argList = [
                    "this",
                    shared.context,
                    shared.props,
                    env.batchId
                  ];
                  return block.def(
                    link(x.data),
                    ".call(",
                    argList.slice(0, Math.max(x.data.length + 1, 4)),
                    ")"
                  );
                case DYN_PROP$1:
                  return block.def(shared.props, x.data);
                case DYN_CONTEXT$1:
                  return block.def(shared.context, x.data);
                case DYN_STATE$1:
                  return block.def("this", x.data);
                case DYN_THUNK:
                  x.data.append(env, block);
                  return x.data.ref;
                case DYN_CONSTANT$1:
                  return x.data.toString();
                case DYN_ARRAY$1:
                  return x.data.map(function(y) {
                    return env.invoke(block, y);
                  });
              }
            };
            env.attribCache = {};
            var scopeAttribs = {};
            env.scopeAttrib = function(name) {
              var id = stringStore.id(name);
              if (id in scopeAttribs) {
                return scopeAttribs[id];
              }
              var binding = attributeState.scope[id];
              if (!binding) {
                binding = attributeState.scope[id] = new AttributeRecord2();
              }
              var result = scopeAttribs[id] = link(binding);
              return result;
            };
            return env;
          }
          function parseProfile(options) {
            var staticOptions = options.static;
            var dynamicOptions = options.dynamic;
            var profileEnable;
            if (S_PROFILE in staticOptions) {
              var value = !!staticOptions[S_PROFILE];
              profileEnable = createStaticDecl(function(env, scope) {
                return value;
              });
              profileEnable.enable = value;
            } else if (S_PROFILE in dynamicOptions) {
              var dyn = dynamicOptions[S_PROFILE];
              profileEnable = createDynamicDecl(dyn, function(env, scope) {
                return env.invoke(scope, dyn);
              });
            }
            return profileEnable;
          }
          function parseFramebuffer(options, env) {
            var staticOptions = options.static;
            var dynamicOptions = options.dynamic;
            if (S_FRAMEBUFFER in staticOptions) {
              var framebuffer = staticOptions[S_FRAMEBUFFER];
              if (framebuffer) {
                framebuffer = framebufferState.getFramebuffer(framebuffer);
                check$1.command(framebuffer, "invalid framebuffer object");
                return createStaticDecl(function(env2, block) {
                  var FRAMEBUFFER = env2.link(framebuffer);
                  var shared = env2.shared;
                  block.set(
                    shared.framebuffer,
                    ".next",
                    FRAMEBUFFER
                  );
                  var CONTEXT = shared.context;
                  block.set(
                    CONTEXT,
                    "." + S_FRAMEBUFFER_WIDTH,
                    FRAMEBUFFER + ".width"
                  );
                  block.set(
                    CONTEXT,
                    "." + S_FRAMEBUFFER_HEIGHT,
                    FRAMEBUFFER + ".height"
                  );
                  return FRAMEBUFFER;
                });
              } else {
                return createStaticDecl(function(env2, scope) {
                  var shared = env2.shared;
                  scope.set(
                    shared.framebuffer,
                    ".next",
                    "null"
                  );
                  var CONTEXT = shared.context;
                  scope.set(
                    CONTEXT,
                    "." + S_FRAMEBUFFER_WIDTH,
                    CONTEXT + "." + S_DRAWINGBUFFER_WIDTH
                  );
                  scope.set(
                    CONTEXT,
                    "." + S_FRAMEBUFFER_HEIGHT,
                    CONTEXT + "." + S_DRAWINGBUFFER_HEIGHT
                  );
                  return "null";
                });
              }
            } else if (S_FRAMEBUFFER in dynamicOptions) {
              var dyn = dynamicOptions[S_FRAMEBUFFER];
              return createDynamicDecl(dyn, function(env2, scope) {
                var FRAMEBUFFER_FUNC = env2.invoke(scope, dyn);
                var shared = env2.shared;
                var FRAMEBUFFER_STATE = shared.framebuffer;
                var FRAMEBUFFER = scope.def(
                  FRAMEBUFFER_STATE,
                  ".getFramebuffer(",
                  FRAMEBUFFER_FUNC,
                  ")"
                );
                check$1.optional(function() {
                  env2.assert(
                    scope,
                    "!" + FRAMEBUFFER_FUNC + "||" + FRAMEBUFFER,
                    "invalid framebuffer object"
                  );
                });
                scope.set(
                  FRAMEBUFFER_STATE,
                  ".next",
                  FRAMEBUFFER
                );
                var CONTEXT = shared.context;
                scope.set(
                  CONTEXT,
                  "." + S_FRAMEBUFFER_WIDTH,
                  FRAMEBUFFER + "?" + FRAMEBUFFER + ".width:" + CONTEXT + "." + S_DRAWINGBUFFER_WIDTH
                );
                scope.set(
                  CONTEXT,
                  "." + S_FRAMEBUFFER_HEIGHT,
                  FRAMEBUFFER + "?" + FRAMEBUFFER + ".height:" + CONTEXT + "." + S_DRAWINGBUFFER_HEIGHT
                );
                return FRAMEBUFFER;
              });
            } else {
              return null;
            }
          }
          function parseViewportScissor(options, framebuffer, env) {
            var staticOptions = options.static;
            var dynamicOptions = options.dynamic;
            function parseBox(param) {
              if (param in staticOptions) {
                var box = staticOptions[param];
                check$1.commandType(box, "object", "invalid " + param, env.commandStr);
                var isStatic2 = true;
                var x = box.x | 0;
                var y = box.y | 0;
                var w, h;
                if ("width" in box) {
                  w = box.width | 0;
                  check$1.command(w >= 0, "invalid " + param, env.commandStr);
                } else {
                  isStatic2 = false;
                }
                if ("height" in box) {
                  h = box.height | 0;
                  check$1.command(h >= 0, "invalid " + param, env.commandStr);
                } else {
                  isStatic2 = false;
                }
                return new Declaration(
                  !isStatic2 && framebuffer && framebuffer.thisDep,
                  !isStatic2 && framebuffer && framebuffer.contextDep,
                  !isStatic2 && framebuffer && framebuffer.propDep,
                  function(env2, scope) {
                    var CONTEXT = env2.shared.context;
                    var BOX_W = w;
                    if (!("width" in box)) {
                      BOX_W = scope.def(CONTEXT, ".", S_FRAMEBUFFER_WIDTH, "-", x);
                    }
                    var BOX_H = h;
                    if (!("height" in box)) {
                      BOX_H = scope.def(CONTEXT, ".", S_FRAMEBUFFER_HEIGHT, "-", y);
                    }
                    return [x, y, BOX_W, BOX_H];
                  }
                );
              } else if (param in dynamicOptions) {
                var dynBox = dynamicOptions[param];
                var result = createDynamicDecl(dynBox, function(env2, scope) {
                  var BOX = env2.invoke(scope, dynBox);
                  check$1.optional(function() {
                    env2.assert(
                      scope,
                      BOX + "&&typeof " + BOX + '==="object"',
                      "invalid " + param
                    );
                  });
                  var CONTEXT = env2.shared.context;
                  var BOX_X = scope.def(BOX, ".x|0");
                  var BOX_Y = scope.def(BOX, ".y|0");
                  var BOX_W = scope.def(
                    '"width" in ',
                    BOX,
                    "?",
                    BOX,
                    ".width|0:",
                    "(",
                    CONTEXT,
                    ".",
                    S_FRAMEBUFFER_WIDTH,
                    "-",
                    BOX_X,
                    ")"
                  );
                  var BOX_H = scope.def(
                    '"height" in ',
                    BOX,
                    "?",
                    BOX,
                    ".height|0:",
                    "(",
                    CONTEXT,
                    ".",
                    S_FRAMEBUFFER_HEIGHT,
                    "-",
                    BOX_Y,
                    ")"
                  );
                  check$1.optional(function() {
                    env2.assert(
                      scope,
                      BOX_W + ">=0&&" + BOX_H + ">=0",
                      "invalid " + param
                    );
                  });
                  return [BOX_X, BOX_Y, BOX_W, BOX_H];
                });
                if (framebuffer) {
                  result.thisDep = result.thisDep || framebuffer.thisDep;
                  result.contextDep = result.contextDep || framebuffer.contextDep;
                  result.propDep = result.propDep || framebuffer.propDep;
                }
                return result;
              } else if (framebuffer) {
                return new Declaration(
                  framebuffer.thisDep,
                  framebuffer.contextDep,
                  framebuffer.propDep,
                  function(env2, scope) {
                    var CONTEXT = env2.shared.context;
                    return [
                      0,
                      0,
                      scope.def(CONTEXT, ".", S_FRAMEBUFFER_WIDTH),
                      scope.def(CONTEXT, ".", S_FRAMEBUFFER_HEIGHT)
                    ];
                  }
                );
              } else {
                return null;
              }
            }
            var viewport = parseBox(S_VIEWPORT);
            if (viewport) {
              var prevViewport = viewport;
              viewport = new Declaration(
                viewport.thisDep,
                viewport.contextDep,
                viewport.propDep,
                function(env2, scope) {
                  var VIEWPORT = prevViewport.append(env2, scope);
                  var CONTEXT = env2.shared.context;
                  scope.set(
                    CONTEXT,
                    "." + S_VIEWPORT_WIDTH,
                    VIEWPORT[2]
                  );
                  scope.set(
                    CONTEXT,
                    "." + S_VIEWPORT_HEIGHT,
                    VIEWPORT[3]
                  );
                  return VIEWPORT;
                }
              );
            }
            return {
              viewport,
              scissor_box: parseBox(S_SCISSOR_BOX)
            };
          }
          function parseAttribLocations(options, attributes) {
            var staticOptions = options.static;
            var staticProgram = typeof staticOptions[S_FRAG] === "string" && typeof staticOptions[S_VERT] === "string";
            if (staticProgram) {
              if (Object.keys(attributes.dynamic).length > 0) {
                return null;
              }
              var staticAttributes = attributes.static;
              var sAttributes = Object.keys(staticAttributes);
              if (sAttributes.length > 0 && typeof staticAttributes[sAttributes[0]] === "number") {
                var bindings = [];
                for (var i = 0; i < sAttributes.length; ++i) {
                  check$1(typeof staticAttributes[sAttributes[i]] === "number", "must specify all vertex attribute locations when using vaos");
                  bindings.push([staticAttributes[sAttributes[i]] | 0, sAttributes[i]]);
                }
                return bindings;
              }
            }
            return null;
          }
          function parseProgram(options, env, attribLocations) {
            var staticOptions = options.static;
            var dynamicOptions = options.dynamic;
            function parseShader(name) {
              if (name in staticOptions) {
                var id = stringStore.id(staticOptions[name]);
                check$1.optional(function() {
                  shaderState.shader(shaderType[name], id, check$1.guessCommand());
                });
                var result = createStaticDecl(function() {
                  return id;
                });
                result.id = id;
                return result;
              } else if (name in dynamicOptions) {
                var dyn = dynamicOptions[name];
                return createDynamicDecl(dyn, function(env2, scope) {
                  var str = env2.invoke(scope, dyn);
                  var id2 = scope.def(env2.shared.strings, ".id(", str, ")");
                  check$1.optional(function() {
                    scope(
                      env2.shared.shader,
                      ".shader(",
                      shaderType[name],
                      ",",
                      id2,
                      ",",
                      env2.command,
                      ");"
                    );
                  });
                  return id2;
                });
              }
              return null;
            }
            var frag = parseShader(S_FRAG);
            var vert = parseShader(S_VERT);
            var program = null;
            var progVar;
            if (isStatic(frag) && isStatic(vert)) {
              program = shaderState.program(vert.id, frag.id, null, attribLocations);
              progVar = createStaticDecl(function(env2, scope) {
                return env2.link(program);
              });
            } else {
              progVar = new Declaration(
                frag && frag.thisDep || vert && vert.thisDep,
                frag && frag.contextDep || vert && vert.contextDep,
                frag && frag.propDep || vert && vert.propDep,
                function(env2, scope) {
                  var SHADER_STATE = env2.shared.shader;
                  var fragId;
                  if (frag) {
                    fragId = frag.append(env2, scope);
                  } else {
                    fragId = scope.def(SHADER_STATE, ".", S_FRAG);
                  }
                  var vertId;
                  if (vert) {
                    vertId = vert.append(env2, scope);
                  } else {
                    vertId = scope.def(SHADER_STATE, ".", S_VERT);
                  }
                  var progDef = SHADER_STATE + ".program(" + vertId + "," + fragId;
                  check$1.optional(function() {
                    progDef += "," + env2.command;
                  });
                  return scope.def(progDef + ")");
                }
              );
            }
            return {
              frag,
              vert,
              progVar,
              program
            };
          }
          function parseDraw(options, env) {
            var staticOptions = options.static;
            var dynamicOptions = options.dynamic;
            var staticDraw = {};
            var vaoActive = false;
            function parseVAO() {
              if (S_VAO in staticOptions) {
                var vao2 = staticOptions[S_VAO];
                if (vao2 !== null && attributeState.getVAO(vao2) === null) {
                  vao2 = attributeState.createVAO(vao2);
                }
                vaoActive = true;
                staticDraw.vao = vao2;
                return createStaticDecl(function(env2) {
                  var vaoRef = attributeState.getVAO(vao2);
                  if (vaoRef) {
                    return env2.link(vaoRef);
                  } else {
                    return "null";
                  }
                });
              } else if (S_VAO in dynamicOptions) {
                vaoActive = true;
                var dyn = dynamicOptions[S_VAO];
                return createDynamicDecl(dyn, function(env2, scope) {
                  var vaoRef = env2.invoke(scope, dyn);
                  return scope.def(env2.shared.vao + ".getVAO(" + vaoRef + ")");
                });
              }
              return null;
            }
            var vao = parseVAO();
            var elementsActive = false;
            function parseElements() {
              if (S_ELEMENTS in staticOptions) {
                var elements2 = staticOptions[S_ELEMENTS];
                staticDraw.elements = elements2;
                if (isBufferArgs(elements2)) {
                  var e = staticDraw.elements = elementState.create(elements2, true);
                  elements2 = elementState.getElements(e);
                  elementsActive = true;
                } else if (elements2) {
                  elements2 = elementState.getElements(elements2);
                  elementsActive = true;
                  check$1.command(elements2, "invalid elements", env.commandStr);
                }
                var result = createStaticDecl(function(env2, scope) {
                  if (elements2) {
                    var result2 = env2.link(elements2);
                    env2.ELEMENTS = result2;
                    return result2;
                  }
                  env2.ELEMENTS = null;
                  return null;
                });
                result.value = elements2;
                return result;
              } else if (S_ELEMENTS in dynamicOptions) {
                elementsActive = true;
                var dyn = dynamicOptions[S_ELEMENTS];
                return createDynamicDecl(dyn, function(env2, scope) {
                  var shared = env2.shared;
                  var IS_BUFFER_ARGS = shared.isBufferArgs;
                  var ELEMENT_STATE = shared.elements;
                  var elementDefn = env2.invoke(scope, dyn);
                  var elements3 = scope.def("null");
                  var elementStream = scope.def(IS_BUFFER_ARGS, "(", elementDefn, ")");
                  var ifte = env2.cond(elementStream).then(elements3, "=", ELEMENT_STATE, ".createStream(", elementDefn, ");").else(elements3, "=", ELEMENT_STATE, ".getElements(", elementDefn, ");");
                  check$1.optional(function() {
                    env2.assert(
                      ifte.else,
                      "!" + elementDefn + "||" + elements3,
                      "invalid elements"
                    );
                  });
                  scope.entry(ifte);
                  scope.exit(
                    env2.cond(elementStream).then(ELEMENT_STATE, ".destroyStream(", elements3, ");")
                  );
                  env2.ELEMENTS = elements3;
                  return elements3;
                });
              } else if (vaoActive) {
                return new Declaration(
                  vao.thisDep,
                  vao.contextDep,
                  vao.propDep,
                  function(env2, scope) {
                    return scope.def(env2.shared.vao + ".currentVAO?" + env2.shared.elements + ".getElements(" + env2.shared.vao + ".currentVAO.elements):null");
                  }
                );
              }
              return null;
            }
            var elements = parseElements();
            function parsePrimitive() {
              if (S_PRIMITIVE in staticOptions) {
                var primitive2 = staticOptions[S_PRIMITIVE];
                staticDraw.primitive = primitive2;
                check$1.commandParameter(primitive2, primTypes, "invalid primitve", env.commandStr);
                return createStaticDecl(function(env2, scope) {
                  return primTypes[primitive2];
                });
              } else if (S_PRIMITIVE in dynamicOptions) {
                var dynPrimitive = dynamicOptions[S_PRIMITIVE];
                return createDynamicDecl(dynPrimitive, function(env2, scope) {
                  var PRIM_TYPES = env2.constants.primTypes;
                  var prim = env2.invoke(scope, dynPrimitive);
                  check$1.optional(function() {
                    env2.assert(
                      scope,
                      prim + " in " + PRIM_TYPES,
                      "invalid primitive, must be one of " + Object.keys(primTypes)
                    );
                  });
                  return scope.def(PRIM_TYPES, "[", prim, "]");
                });
              } else if (elementsActive) {
                if (isStatic(elements)) {
                  if (elements.value) {
                    return createStaticDecl(function(env2, scope) {
                      return scope.def(env2.ELEMENTS, ".primType");
                    });
                  } else {
                    return createStaticDecl(function() {
                      return GL_TRIANGLES$1;
                    });
                  }
                } else {
                  return new Declaration(
                    elements.thisDep,
                    elements.contextDep,
                    elements.propDep,
                    function(env2, scope) {
                      var elements2 = env2.ELEMENTS;
                      return scope.def(elements2, "?", elements2, ".primType:", GL_TRIANGLES$1);
                    }
                  );
                }
              } else if (vaoActive) {
                return new Declaration(
                  vao.thisDep,
                  vao.contextDep,
                  vao.propDep,
                  function(env2, scope) {
                    return scope.def(env2.shared.vao + ".currentVAO?" + env2.shared.vao + ".currentVAO.primitive:" + GL_TRIANGLES$1);
                  }
                );
              }
              return null;
            }
            function parseParam(param, isOffset) {
              if (param in staticOptions) {
                var value = staticOptions[param] | 0;
                if (isOffset) {
                  staticDraw.offset = value;
                } else {
                  staticDraw.instances = value;
                }
                check$1.command(!isOffset || value >= 0, "invalid " + param, env.commandStr);
                return createStaticDecl(function(env2, scope) {
                  if (isOffset) {
                    env2.OFFSET = value;
                  }
                  return value;
                });
              } else if (param in dynamicOptions) {
                var dynValue = dynamicOptions[param];
                return createDynamicDecl(dynValue, function(env2, scope) {
                  var result = env2.invoke(scope, dynValue);
                  if (isOffset) {
                    env2.OFFSET = result;
                    check$1.optional(function() {
                      env2.assert(
                        scope,
                        result + ">=0",
                        "invalid " + param
                      );
                    });
                  }
                  return result;
                });
              } else if (isOffset) {
                if (elementsActive) {
                  return createStaticDecl(function(env2, scope) {
                    env2.OFFSET = 0;
                    return 0;
                  });
                } else if (vaoActive) {
                  return new Declaration(
                    vao.thisDep,
                    vao.contextDep,
                    vao.propDep,
                    function(env2, scope) {
                      return scope.def(env2.shared.vao + ".currentVAO?" + env2.shared.vao + ".currentVAO.offset:0");
                    }
                  );
                }
              } else if (vaoActive) {
                return new Declaration(
                  vao.thisDep,
                  vao.contextDep,
                  vao.propDep,
                  function(env2, scope) {
                    return scope.def(env2.shared.vao + ".currentVAO?" + env2.shared.vao + ".currentVAO.instances:-1");
                  }
                );
              }
              return null;
            }
            var OFFSET = parseParam(S_OFFSET, true);
            function parseVertCount() {
              if (S_COUNT in staticOptions) {
                var count2 = staticOptions[S_COUNT] | 0;
                staticDraw.count = count2;
                check$1.command(
                  typeof count2 === "number" && count2 >= 0,
                  "invalid vertex count",
                  env.commandStr
                );
                return createStaticDecl(function() {
                  return count2;
                });
              } else if (S_COUNT in dynamicOptions) {
                var dynCount = dynamicOptions[S_COUNT];
                return createDynamicDecl(dynCount, function(env2, scope) {
                  var result2 = env2.invoke(scope, dynCount);
                  check$1.optional(function() {
                    env2.assert(
                      scope,
                      "typeof " + result2 + '==="number"&&' + result2 + ">=0&&" + result2 + "===(" + result2 + "|0)",
                      "invalid vertex count"
                    );
                  });
                  return result2;
                });
              } else if (elementsActive) {
                if (isStatic(elements)) {
                  if (elements) {
                    if (OFFSET) {
                      return new Declaration(
                        OFFSET.thisDep,
                        OFFSET.contextDep,
                        OFFSET.propDep,
                        function(env2, scope) {
                          var result2 = scope.def(
                            env2.ELEMENTS,
                            ".vertCount-",
                            env2.OFFSET
                          );
                          check$1.optional(function() {
                            env2.assert(
                              scope,
                              result2 + ">=0",
                              "invalid vertex offset/element buffer too small"
                            );
                          });
                          return result2;
                        }
                      );
                    } else {
                      return createStaticDecl(function(env2, scope) {
                        return scope.def(env2.ELEMENTS, ".vertCount");
                      });
                    }
                  } else {
                    var result = createStaticDecl(function() {
                      return -1;
                    });
                    check$1.optional(function() {
                      result.MISSING = true;
                    });
                    return result;
                  }
                } else {
                  var variable = new Declaration(
                    elements.thisDep || OFFSET.thisDep,
                    elements.contextDep || OFFSET.contextDep,
                    elements.propDep || OFFSET.propDep,
                    function(env2, scope) {
                      var elements2 = env2.ELEMENTS;
                      if (env2.OFFSET) {
                        return scope.def(
                          elements2,
                          "?",
                          elements2,
                          ".vertCount-",
                          env2.OFFSET,
                          ":-1"
                        );
                      }
                      return scope.def(elements2, "?", elements2, ".vertCount:-1");
                    }
                  );
                  check$1.optional(function() {
                    variable.DYNAMIC = true;
                  });
                  return variable;
                }
              } else if (vaoActive) {
                var countVariable = new Declaration(
                  vao.thisDep,
                  vao.contextDep,
                  vao.propDep,
                  function(env2, scope) {
                    return scope.def(env2.shared.vao, ".currentVAO?", env2.shared.vao, ".currentVAO.count:-1");
                  }
                );
                return countVariable;
              }
              return null;
            }
            var primitive = parsePrimitive();
            var count = parseVertCount();
            var instances = parseParam(S_INSTANCES, false);
            return {
              elements,
              primitive,
              count,
              instances,
              offset: OFFSET,
              vao,
              vaoActive,
              elementsActive,
              // static draw props
              static: staticDraw
            };
          }
          function parseGLState(options, env) {
            var staticOptions = options.static;
            var dynamicOptions = options.dynamic;
            var STATE = {};
            GL_STATE_NAMES.forEach(function(prop) {
              var param = propName(prop);
              function parseParam(parseStatic, parseDynamic) {
                if (prop in staticOptions) {
                  var value = parseStatic(staticOptions[prop]);
                  STATE[param] = createStaticDecl(function() {
                    return value;
                  });
                } else if (prop in dynamicOptions) {
                  var dyn = dynamicOptions[prop];
                  STATE[param] = createDynamicDecl(dyn, function(env2, scope) {
                    return parseDynamic(env2, scope, env2.invoke(scope, dyn));
                  });
                }
              }
              switch (prop) {
                case S_CULL_ENABLE:
                case S_BLEND_ENABLE:
                case S_DITHER:
                case S_STENCIL_ENABLE:
                case S_DEPTH_ENABLE:
                case S_SCISSOR_ENABLE:
                case S_POLYGON_OFFSET_ENABLE:
                case S_SAMPLE_ALPHA:
                case S_SAMPLE_ENABLE:
                case S_DEPTH_MASK:
                  return parseParam(
                    function(value) {
                      check$1.commandType(value, "boolean", prop, env.commandStr);
                      return value;
                    },
                    function(env2, scope, value) {
                      check$1.optional(function() {
                        env2.assert(
                          scope,
                          "typeof " + value + '==="boolean"',
                          "invalid flag " + prop,
                          env2.commandStr
                        );
                      });
                      return value;
                    }
                  );
                case S_DEPTH_FUNC:
                  return parseParam(
                    function(value) {
                      check$1.commandParameter(value, compareFuncs, "invalid " + prop, env.commandStr);
                      return compareFuncs[value];
                    },
                    function(env2, scope, value) {
                      var COMPARE_FUNCS = env2.constants.compareFuncs;
                      check$1.optional(function() {
                        env2.assert(
                          scope,
                          value + " in " + COMPARE_FUNCS,
                          "invalid " + prop + ", must be one of " + Object.keys(compareFuncs)
                        );
                      });
                      return scope.def(COMPARE_FUNCS, "[", value, "]");
                    }
                  );
                case S_DEPTH_RANGE:
                  return parseParam(
                    function(value) {
                      check$1.command(
                        isArrayLike(value) && value.length === 2 && typeof value[0] === "number" && typeof value[1] === "number" && value[0] <= value[1],
                        "depth range is 2d array",
                        env.commandStr
                      );
                      return value;
                    },
                    function(env2, scope, value) {
                      check$1.optional(function() {
                        env2.assert(
                          scope,
                          env2.shared.isArrayLike + "(" + value + ")&&" + value + ".length===2&&typeof " + value + '[0]==="number"&&typeof ' + value + '[1]==="number"&&' + value + "[0]<=" + value + "[1]",
                          "depth range must be a 2d array"
                        );
                      });
                      var Z_NEAR = scope.def("+", value, "[0]");
                      var Z_FAR = scope.def("+", value, "[1]");
                      return [Z_NEAR, Z_FAR];
                    }
                  );
                case S_BLEND_FUNC:
                  return parseParam(
                    function(value) {
                      check$1.commandType(value, "object", "blend.func", env.commandStr);
                      var srcRGB = "srcRGB" in value ? value.srcRGB : value.src;
                      var srcAlpha = "srcAlpha" in value ? value.srcAlpha : value.src;
                      var dstRGB = "dstRGB" in value ? value.dstRGB : value.dst;
                      var dstAlpha = "dstAlpha" in value ? value.dstAlpha : value.dst;
                      check$1.commandParameter(srcRGB, blendFuncs, param + ".srcRGB", env.commandStr);
                      check$1.commandParameter(srcAlpha, blendFuncs, param + ".srcAlpha", env.commandStr);
                      check$1.commandParameter(dstRGB, blendFuncs, param + ".dstRGB", env.commandStr);
                      check$1.commandParameter(dstAlpha, blendFuncs, param + ".dstAlpha", env.commandStr);
                      check$1.command(
                        invalidBlendCombinations.indexOf(srcRGB + ", " + dstRGB) === -1,
                        "unallowed blending combination (srcRGB, dstRGB) = (" + srcRGB + ", " + dstRGB + ")",
                        env.commandStr
                      );
                      return [
                        blendFuncs[srcRGB],
                        blendFuncs[dstRGB],
                        blendFuncs[srcAlpha],
                        blendFuncs[dstAlpha]
                      ];
                    },
                    function(env2, scope, value) {
                      var BLEND_FUNCS = env2.constants.blendFuncs;
                      check$1.optional(function() {
                        env2.assert(
                          scope,
                          value + "&&typeof " + value + '==="object"',
                          "invalid blend func, must be an object"
                        );
                      });
                      function read(prefix, suffix) {
                        var func = scope.def(
                          '"',
                          prefix,
                          suffix,
                          '" in ',
                          value,
                          "?",
                          value,
                          ".",
                          prefix,
                          suffix,
                          ":",
                          value,
                          ".",
                          prefix
                        );
                        check$1.optional(function() {
                          env2.assert(
                            scope,
                            func + " in " + BLEND_FUNCS,
                            "invalid " + prop + "." + prefix + suffix + ", must be one of " + Object.keys(blendFuncs)
                          );
                        });
                        return func;
                      }
                      var srcRGB = read("src", "RGB");
                      var dstRGB = read("dst", "RGB");
                      check$1.optional(function() {
                        var INVALID_BLEND_COMBINATIONS = env2.constants.invalidBlendCombinations;
                        env2.assert(
                          scope,
                          INVALID_BLEND_COMBINATIONS + ".indexOf(" + srcRGB + '+", "+' + dstRGB + ") === -1 ",
                          "unallowed blending combination for (srcRGB, dstRGB)"
                        );
                      });
                      var SRC_RGB = scope.def(BLEND_FUNCS, "[", srcRGB, "]");
                      var SRC_ALPHA = scope.def(BLEND_FUNCS, "[", read("src", "Alpha"), "]");
                      var DST_RGB = scope.def(BLEND_FUNCS, "[", dstRGB, "]");
                      var DST_ALPHA = scope.def(BLEND_FUNCS, "[", read("dst", "Alpha"), "]");
                      return [SRC_RGB, DST_RGB, SRC_ALPHA, DST_ALPHA];
                    }
                  );
                case S_BLEND_EQUATION:
                  return parseParam(
                    function(value) {
                      if (typeof value === "string") {
                        check$1.commandParameter(value, blendEquations, "invalid " + prop, env.commandStr);
                        return [
                          blendEquations[value],
                          blendEquations[value]
                        ];
                      } else if (typeof value === "object") {
                        check$1.commandParameter(
                          value.rgb,
                          blendEquations,
                          prop + ".rgb",
                          env.commandStr
                        );
                        check$1.commandParameter(
                          value.alpha,
                          blendEquations,
                          prop + ".alpha",
                          env.commandStr
                        );
                        return [
                          blendEquations[value.rgb],
                          blendEquations[value.alpha]
                        ];
                      } else {
                        check$1.commandRaise("invalid blend.equation", env.commandStr);
                      }
                    },
                    function(env2, scope, value) {
                      var BLEND_EQUATIONS = env2.constants.blendEquations;
                      var RGB = scope.def();
                      var ALPHA = scope.def();
                      var ifte = env2.cond("typeof ", value, '==="string"');
                      check$1.optional(function() {
                        function checkProp(block, name, value2) {
                          env2.assert(
                            block,
                            value2 + " in " + BLEND_EQUATIONS,
                            "invalid " + name + ", must be one of " + Object.keys(blendEquations)
                          );
                        }
                        checkProp(ifte.then, prop, value);
                        env2.assert(
                          ifte.else,
                          value + "&&typeof " + value + '==="object"',
                          "invalid " + prop
                        );
                        checkProp(ifte.else, prop + ".rgb", value + ".rgb");
                        checkProp(ifte.else, prop + ".alpha", value + ".alpha");
                      });
                      ifte.then(
                        RGB,
                        "=",
                        ALPHA,
                        "=",
                        BLEND_EQUATIONS,
                        "[",
                        value,
                        "];"
                      );
                      ifte.else(
                        RGB,
                        "=",
                        BLEND_EQUATIONS,
                        "[",
                        value,
                        ".rgb];",
                        ALPHA,
                        "=",
                        BLEND_EQUATIONS,
                        "[",
                        value,
                        ".alpha];"
                      );
                      scope(ifte);
                      return [RGB, ALPHA];
                    }
                  );
                case S_BLEND_COLOR:
                  return parseParam(
                    function(value) {
                      check$1.command(
                        isArrayLike(value) && value.length === 4,
                        "blend.color must be a 4d array",
                        env.commandStr
                      );
                      return loop(4, function(i) {
                        return +value[i];
                      });
                    },
                    function(env2, scope, value) {
                      check$1.optional(function() {
                        env2.assert(
                          scope,
                          env2.shared.isArrayLike + "(" + value + ")&&" + value + ".length===4",
                          "blend.color must be a 4d array"
                        );
                      });
                      return loop(4, function(i) {
                        return scope.def("+", value, "[", i, "]");
                      });
                    }
                  );
                case S_STENCIL_MASK:
                  return parseParam(
                    function(value) {
                      check$1.commandType(value, "number", param, env.commandStr);
                      return value | 0;
                    },
                    function(env2, scope, value) {
                      check$1.optional(function() {
                        env2.assert(
                          scope,
                          "typeof " + value + '==="number"',
                          "invalid stencil.mask"
                        );
                      });
                      return scope.def(value, "|0");
                    }
                  );
                case S_STENCIL_FUNC:
                  return parseParam(
                    function(value) {
                      check$1.commandType(value, "object", param, env.commandStr);
                      var cmp = value.cmp || "keep";
                      var ref = value.ref || 0;
                      var mask = "mask" in value ? value.mask : -1;
                      check$1.commandParameter(cmp, compareFuncs, prop + ".cmp", env.commandStr);
                      check$1.commandType(ref, "number", prop + ".ref", env.commandStr);
                      check$1.commandType(mask, "number", prop + ".mask", env.commandStr);
                      return [
                        compareFuncs[cmp],
                        ref,
                        mask
                      ];
                    },
                    function(env2, scope, value) {
                      var COMPARE_FUNCS = env2.constants.compareFuncs;
                      check$1.optional(function() {
                        function assert() {
                          env2.assert(
                            scope,
                            Array.prototype.join.call(arguments, ""),
                            "invalid stencil.func"
                          );
                        }
                        assert(value + "&&typeof ", value, '==="object"');
                        assert(
                          '!("cmp" in ',
                          value,
                          ")||(",
                          value,
                          ".cmp in ",
                          COMPARE_FUNCS,
                          ")"
                        );
                      });
                      var cmp = scope.def(
                        '"cmp" in ',
                        value,
                        "?",
                        COMPARE_FUNCS,
                        "[",
                        value,
                        ".cmp]",
                        ":",
                        GL_KEEP
                      );
                      var ref = scope.def(value, ".ref|0");
                      var mask = scope.def(
                        '"mask" in ',
                        value,
                        "?",
                        value,
                        ".mask|0:-1"
                      );
                      return [cmp, ref, mask];
                    }
                  );
                case S_STENCIL_OPFRONT:
                case S_STENCIL_OPBACK:
                  return parseParam(
                    function(value) {
                      check$1.commandType(value, "object", param, env.commandStr);
                      var fail = value.fail || "keep";
                      var zfail = value.zfail || "keep";
                      var zpass = value.zpass || "keep";
                      check$1.commandParameter(fail, stencilOps, prop + ".fail", env.commandStr);
                      check$1.commandParameter(zfail, stencilOps, prop + ".zfail", env.commandStr);
                      check$1.commandParameter(zpass, stencilOps, prop + ".zpass", env.commandStr);
                      return [
                        prop === S_STENCIL_OPBACK ? GL_BACK : GL_FRONT,
                        stencilOps[fail],
                        stencilOps[zfail],
                        stencilOps[zpass]
                      ];
                    },
                    function(env2, scope, value) {
                      var STENCIL_OPS = env2.constants.stencilOps;
                      check$1.optional(function() {
                        env2.assert(
                          scope,
                          value + "&&typeof " + value + '==="object"',
                          "invalid " + prop
                        );
                      });
                      function read(name) {
                        check$1.optional(function() {
                          env2.assert(
                            scope,
                            '!("' + name + '" in ' + value + ")||(" + value + "." + name + " in " + STENCIL_OPS + ")",
                            "invalid " + prop + "." + name + ", must be one of " + Object.keys(stencilOps)
                          );
                        });
                        return scope.def(
                          '"',
                          name,
                          '" in ',
                          value,
                          "?",
                          STENCIL_OPS,
                          "[",
                          value,
                          ".",
                          name,
                          "]:",
                          GL_KEEP
                        );
                      }
                      return [
                        prop === S_STENCIL_OPBACK ? GL_BACK : GL_FRONT,
                        read("fail"),
                        read("zfail"),
                        read("zpass")
                      ];
                    }
                  );
                case S_POLYGON_OFFSET_OFFSET:
                  return parseParam(
                    function(value) {
                      check$1.commandType(value, "object", param, env.commandStr);
                      var factor = value.factor | 0;
                      var units = value.units | 0;
                      check$1.commandType(factor, "number", param + ".factor", env.commandStr);
                      check$1.commandType(units, "number", param + ".units", env.commandStr);
                      return [factor, units];
                    },
                    function(env2, scope, value) {
                      check$1.optional(function() {
                        env2.assert(
                          scope,
                          value + "&&typeof " + value + '==="object"',
                          "invalid " + prop
                        );
                      });
                      var FACTOR = scope.def(value, ".factor|0");
                      var UNITS = scope.def(value, ".units|0");
                      return [FACTOR, UNITS];
                    }
                  );
                case S_CULL_FACE:
                  return parseParam(
                    function(value) {
                      var face = 0;
                      if (value === "front") {
                        face = GL_FRONT;
                      } else if (value === "back") {
                        face = GL_BACK;
                      }
                      check$1.command(!!face, param, env.commandStr);
                      return face;
                    },
                    function(env2, scope, value) {
                      check$1.optional(function() {
                        env2.assert(
                          scope,
                          value + '==="front"||' + value + '==="back"',
                          "invalid cull.face"
                        );
                      });
                      return scope.def(value, '==="front"?', GL_FRONT, ":", GL_BACK);
                    }
                  );
                case S_LINE_WIDTH:
                  return parseParam(
                    function(value) {
                      check$1.command(
                        typeof value === "number" && value >= limits.lineWidthDims[0] && value <= limits.lineWidthDims[1],
                        "invalid line width, must be a positive number between " + limits.lineWidthDims[0] + " and " + limits.lineWidthDims[1],
                        env.commandStr
                      );
                      return value;
                    },
                    function(env2, scope, value) {
                      check$1.optional(function() {
                        env2.assert(
                          scope,
                          "typeof " + value + '==="number"&&' + value + ">=" + limits.lineWidthDims[0] + "&&" + value + "<=" + limits.lineWidthDims[1],
                          "invalid line width"
                        );
                      });
                      return value;
                    }
                  );
                case S_FRONT_FACE:
                  return parseParam(
                    function(value) {
                      check$1.commandParameter(value, orientationType, param, env.commandStr);
                      return orientationType[value];
                    },
                    function(env2, scope, value) {
                      check$1.optional(function() {
                        env2.assert(
                          scope,
                          value + '==="cw"||' + value + '==="ccw"',
                          "invalid frontFace, must be one of cw,ccw"
                        );
                      });
                      return scope.def(value + '==="cw"?' + GL_CW + ":" + GL_CCW);
                    }
                  );
                case S_COLOR_MASK:
                  return parseParam(
                    function(value) {
                      check$1.command(
                        isArrayLike(value) && value.length === 4,
                        "color.mask must be length 4 array",
                        env.commandStr
                      );
                      return value.map(function(v) {
                        return !!v;
                      });
                    },
                    function(env2, scope, value) {
                      check$1.optional(function() {
                        env2.assert(
                          scope,
                          env2.shared.isArrayLike + "(" + value + ")&&" + value + ".length===4",
                          "invalid color.mask"
                        );
                      });
                      return loop(4, function(i) {
                        return "!!" + value + "[" + i + "]";
                      });
                    }
                  );
                case S_SAMPLE_COVERAGE:
                  return parseParam(
                    function(value) {
                      check$1.command(typeof value === "object" && value, param, env.commandStr);
                      var sampleValue = "value" in value ? value.value : 1;
                      var sampleInvert = !!value.invert;
                      check$1.command(
                        typeof sampleValue === "number" && sampleValue >= 0 && sampleValue <= 1,
                        "sample.coverage.value must be a number between 0 and 1",
                        env.commandStr
                      );
                      return [sampleValue, sampleInvert];
                    },
                    function(env2, scope, value) {
                      check$1.optional(function() {
                        env2.assert(
                          scope,
                          value + "&&typeof " + value + '==="object"',
                          "invalid sample.coverage"
                        );
                      });
                      var VALUE = scope.def(
                        '"value" in ',
                        value,
                        "?+",
                        value,
                        ".value:1"
                      );
                      var INVERT = scope.def("!!", value, ".invert");
                      return [VALUE, INVERT];
                    }
                  );
              }
            });
            return STATE;
          }
          function parseUniforms(uniforms, env) {
            var staticUniforms = uniforms.static;
            var dynamicUniforms = uniforms.dynamic;
            var UNIFORMS = {};
            Object.keys(staticUniforms).forEach(function(name) {
              var value = staticUniforms[name];
              var result;
              if (typeof value === "number" || typeof value === "boolean") {
                result = createStaticDecl(function() {
                  return value;
                });
              } else if (typeof value === "function") {
                var reglType = value._reglType;
                if (reglType === "texture2d" || reglType === "textureCube") {
                  result = createStaticDecl(function(env2) {
                    return env2.link(value);
                  });
                } else if (reglType === "framebuffer" || reglType === "framebufferCube") {
                  check$1.command(
                    value.color.length > 0,
                    'missing color attachment for framebuffer sent to uniform "' + name + '"',
                    env.commandStr
                  );
                  result = createStaticDecl(function(env2) {
                    return env2.link(value.color[0]);
                  });
                } else {
                  check$1.commandRaise('invalid data for uniform "' + name + '"', env.commandStr);
                }
              } else if (isArrayLike(value)) {
                result = createStaticDecl(function(env2) {
                  var ITEM = env2.global.def(
                    "[",
                    loop(value.length, function(i) {
                      check$1.command(
                        typeof value[i] === "number" || typeof value[i] === "boolean",
                        "invalid uniform " + name,
                        env2.commandStr
                      );
                      return value[i];
                    }),
                    "]"
                  );
                  return ITEM;
                });
              } else {
                check$1.commandRaise('invalid or missing data for uniform "' + name + '"', env.commandStr);
              }
              result.value = value;
              UNIFORMS[name] = result;
            });
            Object.keys(dynamicUniforms).forEach(function(key) {
              var dyn = dynamicUniforms[key];
              UNIFORMS[key] = createDynamicDecl(dyn, function(env2, scope) {
                return env2.invoke(scope, dyn);
              });
            });
            return UNIFORMS;
          }
          function parseAttributes(attributes, env) {
            var staticAttributes = attributes.static;
            var dynamicAttributes = attributes.dynamic;
            var attributeDefs = {};
            Object.keys(staticAttributes).forEach(function(attribute) {
              var value = staticAttributes[attribute];
              var id = stringStore.id(attribute);
              var record = new AttributeRecord2();
              if (isBufferArgs(value)) {
                record.state = ATTRIB_STATE_POINTER;
                record.buffer = bufferState.getBuffer(
                  bufferState.create(value, GL_ARRAY_BUFFER$2, false, true)
                );
                record.type = 0;
              } else {
                var buffer = bufferState.getBuffer(value);
                if (buffer) {
                  record.state = ATTRIB_STATE_POINTER;
                  record.buffer = buffer;
                  record.type = 0;
                } else {
                  check$1.command(
                    typeof value === "object" && value,
                    "invalid data for attribute " + attribute,
                    env.commandStr
                  );
                  if ("constant" in value) {
                    var constant = value.constant;
                    record.buffer = "null";
                    record.state = ATTRIB_STATE_CONSTANT;
                    if (typeof constant === "number") {
                      record.x = constant;
                    } else {
                      check$1.command(
                        isArrayLike(constant) && constant.length > 0 && constant.length <= 4,
                        "invalid constant for attribute " + attribute,
                        env.commandStr
                      );
                      CUTE_COMPONENTS.forEach(function(c, i) {
                        if (i < constant.length) {
                          record[c] = constant[i];
                        }
                      });
                    }
                  } else {
                    if (isBufferArgs(value.buffer)) {
                      buffer = bufferState.getBuffer(
                        bufferState.create(value.buffer, GL_ARRAY_BUFFER$2, false, true)
                      );
                    } else {
                      buffer = bufferState.getBuffer(value.buffer);
                    }
                    check$1.command(!!buffer, 'missing buffer for attribute "' + attribute + '"', env.commandStr);
                    var offset = value.offset | 0;
                    check$1.command(
                      offset >= 0,
                      'invalid offset for attribute "' + attribute + '"',
                      env.commandStr
                    );
                    var stride = value.stride | 0;
                    check$1.command(
                      stride >= 0 && stride < 256,
                      'invalid stride for attribute "' + attribute + '", must be integer betweeen [0, 255]',
                      env.commandStr
                    );
                    var size = value.size | 0;
                    check$1.command(
                      !("size" in value) || size > 0 && size <= 4,
                      'invalid size for attribute "' + attribute + '", must be 1,2,3,4',
                      env.commandStr
                    );
                    var normalized = !!value.normalized;
                    var type = 0;
                    if ("type" in value) {
                      check$1.commandParameter(
                        value.type,
                        glTypes,
                        "invalid type for attribute " + attribute,
                        env.commandStr
                      );
                      type = glTypes[value.type];
                    }
                    var divisor = value.divisor | 0;
                    check$1.optional(function() {
                      if ("divisor" in value) {
                        check$1.command(
                          divisor === 0 || extInstancing,
                          'cannot specify divisor for attribute "' + attribute + '", instancing not supported',
                          env.commandStr
                        );
                        check$1.command(
                          divisor >= 0,
                          'invalid divisor for attribute "' + attribute + '"',
                          env.commandStr
                        );
                      }
                      var command = env.commandStr;
                      var VALID_KEYS = [
                        "buffer",
                        "offset",
                        "divisor",
                        "normalized",
                        "type",
                        "size",
                        "stride"
                      ];
                      Object.keys(value).forEach(function(prop) {
                        check$1.command(
                          VALID_KEYS.indexOf(prop) >= 0,
                          'unknown parameter "' + prop + '" for attribute pointer "' + attribute + '" (valid parameters are ' + VALID_KEYS + ")",
                          command
                        );
                      });
                    });
                    record.buffer = buffer;
                    record.state = ATTRIB_STATE_POINTER;
                    record.size = size;
                    record.normalized = normalized;
                    record.type = type || buffer.dtype;
                    record.offset = offset;
                    record.stride = stride;
                    record.divisor = divisor;
                  }
                }
              }
              attributeDefs[attribute] = createStaticDecl(function(env2, scope) {
                var cache = env2.attribCache;
                if (id in cache) {
                  return cache[id];
                }
                var result = {
                  isStream: false
                };
                Object.keys(record).forEach(function(key) {
                  result[key] = record[key];
                });
                if (record.buffer) {
                  result.buffer = env2.link(record.buffer);
                  result.type = result.type || result.buffer + ".dtype";
                }
                cache[id] = result;
                return result;
              });
            });
            Object.keys(dynamicAttributes).forEach(function(attribute) {
              var dyn = dynamicAttributes[attribute];
              function appendAttributeCode(env2, block) {
                var VALUE = env2.invoke(block, dyn);
                var shared = env2.shared;
                var constants = env2.constants;
                var IS_BUFFER_ARGS = shared.isBufferArgs;
                var BUFFER_STATE = shared.buffer;
                check$1.optional(function() {
                  env2.assert(
                    block,
                    VALUE + "&&(typeof " + VALUE + '==="object"||typeof ' + VALUE + '==="function")&&(' + IS_BUFFER_ARGS + "(" + VALUE + ")||" + BUFFER_STATE + ".getBuffer(" + VALUE + ")||" + BUFFER_STATE + ".getBuffer(" + VALUE + ".buffer)||" + IS_BUFFER_ARGS + "(" + VALUE + '.buffer)||("constant" in ' + VALUE + "&&(typeof " + VALUE + '.constant==="number"||' + shared.isArrayLike + "(" + VALUE + ".constant))))",
                    'invalid dynamic attribute "' + attribute + '"'
                  );
                });
                var result = {
                  isStream: block.def(false)
                };
                var defaultRecord = new AttributeRecord2();
                defaultRecord.state = ATTRIB_STATE_POINTER;
                Object.keys(defaultRecord).forEach(function(key) {
                  result[key] = block.def("" + defaultRecord[key]);
                });
                var BUFFER = result.buffer;
                var TYPE = result.type;
                block(
                  "if(",
                  IS_BUFFER_ARGS,
                  "(",
                  VALUE,
                  ")){",
                  result.isStream,
                  "=true;",
                  BUFFER,
                  "=",
                  BUFFER_STATE,
                  ".createStream(",
                  GL_ARRAY_BUFFER$2,
                  ",",
                  VALUE,
                  ");",
                  TYPE,
                  "=",
                  BUFFER,
                  ".dtype;",
                  "}else{",
                  BUFFER,
                  "=",
                  BUFFER_STATE,
                  ".getBuffer(",
                  VALUE,
                  ");",
                  "if(",
                  BUFFER,
                  "){",
                  TYPE,
                  "=",
                  BUFFER,
                  ".dtype;",
                  '}else if("constant" in ',
                  VALUE,
                  "){",
                  result.state,
                  "=",
                  ATTRIB_STATE_CONSTANT,
                  ";",
                  "if(typeof " + VALUE + '.constant === "number"){',
                  result[CUTE_COMPONENTS[0]],
                  "=",
                  VALUE,
                  ".constant;",
                  CUTE_COMPONENTS.slice(1).map(function(n) {
                    return result[n];
                  }).join("="),
                  "=0;",
                  "}else{",
                  CUTE_COMPONENTS.map(function(name, i) {
                    return result[name] + "=" + VALUE + ".constant.length>" + i + "?" + VALUE + ".constant[" + i + "]:0;";
                  }).join(""),
                  "}}else{",
                  "if(",
                  IS_BUFFER_ARGS,
                  "(",
                  VALUE,
                  ".buffer)){",
                  BUFFER,
                  "=",
                  BUFFER_STATE,
                  ".createStream(",
                  GL_ARRAY_BUFFER$2,
                  ",",
                  VALUE,
                  ".buffer);",
                  "}else{",
                  BUFFER,
                  "=",
                  BUFFER_STATE,
                  ".getBuffer(",
                  VALUE,
                  ".buffer);",
                  "}",
                  TYPE,
                  '="type" in ',
                  VALUE,
                  "?",
                  constants.glTypes,
                  "[",
                  VALUE,
                  ".type]:",
                  BUFFER,
                  ".dtype;",
                  result.normalized,
                  "=!!",
                  VALUE,
                  ".normalized;"
                );
                function emitReadRecord(name) {
                  block(result[name], "=", VALUE, ".", name, "|0;");
                }
                emitReadRecord("size");
                emitReadRecord("offset");
                emitReadRecord("stride");
                emitReadRecord("divisor");
                block("}}");
                block.exit(
                  "if(",
                  result.isStream,
                  "){",
                  BUFFER_STATE,
                  ".destroyStream(",
                  BUFFER,
                  ");",
                  "}"
                );
                return result;
              }
              attributeDefs[attribute] = createDynamicDecl(dyn, appendAttributeCode);
            });
            return attributeDefs;
          }
          function parseContext(context) {
            var staticContext = context.static;
            var dynamicContext = context.dynamic;
            var result = {};
            Object.keys(staticContext).forEach(function(name) {
              var value = staticContext[name];
              result[name] = createStaticDecl(function(env, scope) {
                if (typeof value === "number" || typeof value === "boolean") {
                  return "" + value;
                } else {
                  return env.link(value);
                }
              });
            });
            Object.keys(dynamicContext).forEach(function(name) {
              var dyn = dynamicContext[name];
              result[name] = createDynamicDecl(dyn, function(env, scope) {
                return env.invoke(scope, dyn);
              });
            });
            return result;
          }
          function parseArguments(options, attributes, uniforms, context, env) {
            var staticOptions = options.static;
            var dynamicOptions = options.dynamic;
            check$1.optional(function() {
              var KEY_NAMES = [
                S_FRAMEBUFFER,
                S_VERT,
                S_FRAG,
                S_ELEMENTS,
                S_PRIMITIVE,
                S_OFFSET,
                S_COUNT,
                S_INSTANCES,
                S_PROFILE,
                S_VAO
              ].concat(GL_STATE_NAMES);
              function checkKeys(dict) {
                Object.keys(dict).forEach(function(key) {
                  check$1.command(
                    KEY_NAMES.indexOf(key) >= 0,
                    'unknown parameter "' + key + '"',
                    env.commandStr
                  );
                });
              }
              checkKeys(staticOptions);
              checkKeys(dynamicOptions);
            });
            var attribLocations = parseAttribLocations(options, attributes);
            var framebuffer = parseFramebuffer(options, env);
            var viewportAndScissor = parseViewportScissor(options, framebuffer, env);
            var draw = parseDraw(options, env);
            var state = parseGLState(options, env);
            var shader = parseProgram(options, env, attribLocations);
            function copyBox(name) {
              var defn = viewportAndScissor[name];
              if (defn) {
                state[name] = defn;
              }
            }
            copyBox(S_VIEWPORT);
            copyBox(propName(S_SCISSOR_BOX));
            var dirty = Object.keys(state).length > 0;
            var result = {
              framebuffer,
              draw,
              shader,
              state,
              dirty,
              scopeVAO: null,
              drawVAO: null,
              useVAO: false,
              attributes: {}
            };
            result.profile = parseProfile(options, env);
            result.uniforms = parseUniforms(uniforms, env);
            result.drawVAO = result.scopeVAO = draw.vao;
            if (!result.drawVAO && shader.program && !attribLocations && extensions.angle_instanced_arrays && draw.static.elements) {
              var useVAO = true;
              var staticBindings = shader.program.attributes.map(function(attr) {
                var binding = attributes.static[attr];
                useVAO = useVAO && !!binding;
                return binding;
              });
              if (useVAO && staticBindings.length > 0) {
                var vao = attributeState.getVAO(attributeState.createVAO({
                  attributes: staticBindings,
                  elements: draw.static.elements
                }));
                result.drawVAO = new Declaration(null, null, null, function(env2, scope) {
                  return env2.link(vao);
                });
                result.useVAO = true;
              }
            }
            if (attribLocations) {
              result.useVAO = true;
            } else {
              result.attributes = parseAttributes(attributes, env);
            }
            result.context = parseContext(context, env);
            return result;
          }
          function emitContext(env, scope, context) {
            var shared = env.shared;
            var CONTEXT = shared.context;
            var contextEnter = env.scope();
            Object.keys(context).forEach(function(name) {
              scope.save(CONTEXT, "." + name);
              var defn = context[name];
              var value = defn.append(env, scope);
              if (Array.isArray(value)) {
                contextEnter(CONTEXT, ".", name, "=[", value.join(), "];");
              } else {
                contextEnter(CONTEXT, ".", name, "=", value, ";");
              }
            });
            scope(contextEnter);
          }
          function emitPollFramebuffer(env, scope, framebuffer, skipCheck) {
            var shared = env.shared;
            var GL = shared.gl;
            var FRAMEBUFFER_STATE = shared.framebuffer;
            var EXT_DRAW_BUFFERS;
            if (extDrawBuffers) {
              EXT_DRAW_BUFFERS = scope.def(shared.extensions, ".webgl_draw_buffers");
            }
            var constants = env.constants;
            var DRAW_BUFFERS = constants.drawBuffer;
            var BACK_BUFFER = constants.backBuffer;
            var NEXT;
            if (framebuffer) {
              NEXT = framebuffer.append(env, scope);
            } else {
              NEXT = scope.def(FRAMEBUFFER_STATE, ".next");
            }
            if (!skipCheck) {
              scope("if(", NEXT, "!==", FRAMEBUFFER_STATE, ".cur){");
            }
            scope(
              "if(",
              NEXT,
              "){",
              GL,
              ".bindFramebuffer(",
              GL_FRAMEBUFFER$2,
              ",",
              NEXT,
              ".framebuffer);"
            );
            if (extDrawBuffers) {
              scope(
                EXT_DRAW_BUFFERS,
                ".drawBuffersWEBGL(",
                DRAW_BUFFERS,
                "[",
                NEXT,
                ".colorAttachments.length]);"
              );
            }
            scope(
              "}else{",
              GL,
              ".bindFramebuffer(",
              GL_FRAMEBUFFER$2,
              ",null);"
            );
            if (extDrawBuffers) {
              scope(EXT_DRAW_BUFFERS, ".drawBuffersWEBGL(", BACK_BUFFER, ");");
            }
            scope(
              "}",
              FRAMEBUFFER_STATE,
              ".cur=",
              NEXT,
              ";"
            );
            if (!skipCheck) {
              scope("}");
            }
          }
          function emitPollState(env, scope, args) {
            var shared = env.shared;
            var GL = shared.gl;
            var CURRENT_VARS = env.current;
            var NEXT_VARS = env.next;
            var CURRENT_STATE = shared.current;
            var NEXT_STATE = shared.next;
            var block = env.cond(CURRENT_STATE, ".dirty");
            GL_STATE_NAMES.forEach(function(prop) {
              var param = propName(prop);
              if (param in args.state) {
                return;
              }
              var NEXT, CURRENT;
              if (param in NEXT_VARS) {
                NEXT = NEXT_VARS[param];
                CURRENT = CURRENT_VARS[param];
                var parts = loop(currentState[param].length, function(i) {
                  return block.def(NEXT, "[", i, "]");
                });
                block(env.cond(parts.map(function(p, i) {
                  return p + "!==" + CURRENT + "[" + i + "]";
                }).join("||")).then(
                  GL,
                  ".",
                  GL_VARIABLES[param],
                  "(",
                  parts,
                  ");",
                  parts.map(function(p, i) {
                    return CURRENT + "[" + i + "]=" + p;
                  }).join(";"),
                  ";"
                ));
              } else {
                NEXT = block.def(NEXT_STATE, ".", param);
                var ifte = env.cond(NEXT, "!==", CURRENT_STATE, ".", param);
                block(ifte);
                if (param in GL_FLAGS) {
                  ifte(
                    env.cond(NEXT).then(GL, ".enable(", GL_FLAGS[param], ");").else(GL, ".disable(", GL_FLAGS[param], ");"),
                    CURRENT_STATE,
                    ".",
                    param,
                    "=",
                    NEXT,
                    ";"
                  );
                } else {
                  ifte(
                    GL,
                    ".",
                    GL_VARIABLES[param],
                    "(",
                    NEXT,
                    ");",
                    CURRENT_STATE,
                    ".",
                    param,
                    "=",
                    NEXT,
                    ";"
                  );
                }
              }
            });
            if (Object.keys(args.state).length === 0) {
              block(CURRENT_STATE, ".dirty=false;");
            }
            scope(block);
          }
          function emitSetOptions(env, scope, options, filter) {
            var shared = env.shared;
            var CURRENT_VARS = env.current;
            var CURRENT_STATE = shared.current;
            var GL = shared.gl;
            sortState(Object.keys(options)).forEach(function(param) {
              var defn = options[param];
              if (filter && !filter(defn)) {
                return;
              }
              var variable = defn.append(env, scope);
              if (GL_FLAGS[param]) {
                var flag = GL_FLAGS[param];
                if (isStatic(defn)) {
                  if (variable) {
                    scope(GL, ".enable(", flag, ");");
                  } else {
                    scope(GL, ".disable(", flag, ");");
                  }
                } else {
                  scope(env.cond(variable).then(GL, ".enable(", flag, ");").else(GL, ".disable(", flag, ");"));
                }
                scope(CURRENT_STATE, ".", param, "=", variable, ";");
              } else if (isArrayLike(variable)) {
                var CURRENT = CURRENT_VARS[param];
                scope(
                  GL,
                  ".",
                  GL_VARIABLES[param],
                  "(",
                  variable,
                  ");",
                  variable.map(function(v, i) {
                    return CURRENT + "[" + i + "]=" + v;
                  }).join(";"),
                  ";"
                );
              } else {
                scope(
                  GL,
                  ".",
                  GL_VARIABLES[param],
                  "(",
                  variable,
                  ");",
                  CURRENT_STATE,
                  ".",
                  param,
                  "=",
                  variable,
                  ";"
                );
              }
            });
          }
          function injectExtensions(env, scope) {
            if (extInstancing) {
              env.instancing = scope.def(
                env.shared.extensions,
                ".angle_instanced_arrays"
              );
            }
          }
          function emitProfile(env, scope, args, useScope, incrementCounter) {
            var shared = env.shared;
            var STATS = env.stats;
            var CURRENT_STATE = shared.current;
            var TIMER = shared.timer;
            var profileArg = args.profile;
            function perfCounter() {
              if (typeof performance === "undefined") {
                return "Date.now()";
              } else {
                return "performance.now()";
              }
            }
            var CPU_START, QUERY_COUNTER;
            function emitProfileStart(block) {
              CPU_START = scope.def();
              block(CPU_START, "=", perfCounter(), ";");
              if (typeof incrementCounter === "string") {
                block(STATS, ".count+=", incrementCounter, ";");
              } else {
                block(STATS, ".count++;");
              }
              if (timer) {
                if (useScope) {
                  QUERY_COUNTER = scope.def();
                  block(QUERY_COUNTER, "=", TIMER, ".getNumPendingQueries();");
                } else {
                  block(TIMER, ".beginQuery(", STATS, ");");
                }
              }
            }
            function emitProfileEnd(block) {
              block(STATS, ".cpuTime+=", perfCounter(), "-", CPU_START, ";");
              if (timer) {
                if (useScope) {
                  block(
                    TIMER,
                    ".pushScopeStats(",
                    QUERY_COUNTER,
                    ",",
                    TIMER,
                    ".getNumPendingQueries(),",
                    STATS,
                    ");"
                  );
                } else {
                  block(TIMER, ".endQuery();");
                }
              }
            }
            function scopeProfile(value) {
              var prev = scope.def(CURRENT_STATE, ".profile");
              scope(CURRENT_STATE, ".profile=", value, ";");
              scope.exit(CURRENT_STATE, ".profile=", prev, ";");
            }
            var USE_PROFILE;
            if (profileArg) {
              if (isStatic(profileArg)) {
                if (profileArg.enable) {
                  emitProfileStart(scope);
                  emitProfileEnd(scope.exit);
                  scopeProfile("true");
                } else {
                  scopeProfile("false");
                }
                return;
              }
              USE_PROFILE = profileArg.append(env, scope);
              scopeProfile(USE_PROFILE);
            } else {
              USE_PROFILE = scope.def(CURRENT_STATE, ".profile");
            }
            var start = env.block();
            emitProfileStart(start);
            scope("if(", USE_PROFILE, "){", start, "}");
            var end = env.block();
            emitProfileEnd(end);
            scope.exit("if(", USE_PROFILE, "){", end, "}");
          }
          function emitAttributes(env, scope, args, attributes, filter) {
            var shared = env.shared;
            function typeLength(x) {
              switch (x) {
                case GL_FLOAT_VEC2:
                case GL_INT_VEC2:
                case GL_BOOL_VEC2:
                  return 2;
                case GL_FLOAT_VEC3:
                case GL_INT_VEC3:
                case GL_BOOL_VEC3:
                  return 3;
                case GL_FLOAT_VEC4:
                case GL_INT_VEC4:
                case GL_BOOL_VEC4:
                  return 4;
                default:
                  return 1;
              }
            }
            function emitBindAttribute(ATTRIBUTE, size, record) {
              var GL = shared.gl;
              var LOCATION = scope.def(ATTRIBUTE, ".location");
              var BINDING = scope.def(shared.attributes, "[", LOCATION, "]");
              var STATE = record.state;
              var BUFFER = record.buffer;
              var CONST_COMPONENTS = [
                record.x,
                record.y,
                record.z,
                record.w
              ];
              var COMMON_KEYS = [
                "buffer",
                "normalized",
                "offset",
                "stride"
              ];
              function emitBuffer() {
                scope(
                  "if(!",
                  BINDING,
                  ".buffer){",
                  GL,
                  ".enableVertexAttribArray(",
                  LOCATION,
                  ");}"
                );
                var TYPE = record.type;
                var SIZE;
                if (!record.size) {
                  SIZE = size;
                } else {
                  SIZE = scope.def(record.size, "||", size);
                }
                scope(
                  "if(",
                  BINDING,
                  ".type!==",
                  TYPE,
                  "||",
                  BINDING,
                  ".size!==",
                  SIZE,
                  "||",
                  COMMON_KEYS.map(function(key) {
                    return BINDING + "." + key + "!==" + record[key];
                  }).join("||"),
                  "){",
                  GL,
                  ".bindBuffer(",
                  GL_ARRAY_BUFFER$2,
                  ",",
                  BUFFER,
                  ".buffer);",
                  GL,
                  ".vertexAttribPointer(",
                  [
                    LOCATION,
                    SIZE,
                    TYPE,
                    record.normalized,
                    record.stride,
                    record.offset
                  ],
                  ");",
                  BINDING,
                  ".type=",
                  TYPE,
                  ";",
                  BINDING,
                  ".size=",
                  SIZE,
                  ";",
                  COMMON_KEYS.map(function(key) {
                    return BINDING + "." + key + "=" + record[key] + ";";
                  }).join(""),
                  "}"
                );
                if (extInstancing) {
                  var DIVISOR = record.divisor;
                  scope(
                    "if(",
                    BINDING,
                    ".divisor!==",
                    DIVISOR,
                    "){",
                    env.instancing,
                    ".vertexAttribDivisorANGLE(",
                    [LOCATION, DIVISOR],
                    ");",
                    BINDING,
                    ".divisor=",
                    DIVISOR,
                    ";}"
                  );
                }
              }
              function emitConstant() {
                scope(
                  "if(",
                  BINDING,
                  ".buffer){",
                  GL,
                  ".disableVertexAttribArray(",
                  LOCATION,
                  ");",
                  BINDING,
                  ".buffer=null;",
                  "}if(",
                  CUTE_COMPONENTS.map(function(c, i) {
                    return BINDING + "." + c + "!==" + CONST_COMPONENTS[i];
                  }).join("||"),
                  "){",
                  GL,
                  ".vertexAttrib4f(",
                  LOCATION,
                  ",",
                  CONST_COMPONENTS,
                  ");",
                  CUTE_COMPONENTS.map(function(c, i) {
                    return BINDING + "." + c + "=" + CONST_COMPONENTS[i] + ";";
                  }).join(""),
                  "}"
                );
              }
              if (STATE === ATTRIB_STATE_POINTER) {
                emitBuffer();
              } else if (STATE === ATTRIB_STATE_CONSTANT) {
                emitConstant();
              } else {
                scope("if(", STATE, "===", ATTRIB_STATE_POINTER, "){");
                emitBuffer();
                scope("}else{");
                emitConstant();
                scope("}");
              }
            }
            attributes.forEach(function(attribute) {
              var name = attribute.name;
              var arg = args.attributes[name];
              var record;
              if (arg) {
                if (!filter(arg)) {
                  return;
                }
                record = arg.append(env, scope);
              } else {
                if (!filter(SCOPE_DECL)) {
                  return;
                }
                var scopeAttrib = env.scopeAttrib(name);
                check$1.optional(function() {
                  env.assert(
                    scope,
                    scopeAttrib + ".state",
                    "missing attribute " + name
                  );
                });
                record = {};
                Object.keys(new AttributeRecord2()).forEach(function(key) {
                  record[key] = scope.def(scopeAttrib, ".", key);
                });
              }
              emitBindAttribute(
                env.link(attribute),
                typeLength(attribute.info.type),
                record
              );
            });
          }
          function emitUniforms(env, scope, args, uniforms, filter, isBatchInnerLoop) {
            var shared = env.shared;
            var GL = shared.gl;
            var infix;
            for (var i = 0; i < uniforms.length; ++i) {
              var uniform = uniforms[i];
              var name = uniform.name;
              var type = uniform.info.type;
              var arg = args.uniforms[name];
              var UNIFORM = env.link(uniform);
              var LOCATION = UNIFORM + ".location";
              var VALUE;
              if (arg) {
                if (!filter(arg)) {
                  continue;
                }
                if (isStatic(arg)) {
                  var value = arg.value;
                  check$1.command(
                    value !== null && typeof value !== "undefined",
                    'missing uniform "' + name + '"',
                    env.commandStr
                  );
                  if (type === GL_SAMPLER_2D || type === GL_SAMPLER_CUBE) {
                    check$1.command(
                      typeof value === "function" && (type === GL_SAMPLER_2D && (value._reglType === "texture2d" || value._reglType === "framebuffer") || type === GL_SAMPLER_CUBE && (value._reglType === "textureCube" || value._reglType === "framebufferCube")),
                      "invalid texture for uniform " + name,
                      env.commandStr
                    );
                    var TEX_VALUE = env.link(value._texture || value.color[0]._texture);
                    scope(GL, ".uniform1i(", LOCATION, ",", TEX_VALUE + ".bind());");
                    scope.exit(TEX_VALUE, ".unbind();");
                  } else if (type === GL_FLOAT_MAT2 || type === GL_FLOAT_MAT3 || type === GL_FLOAT_MAT4) {
                    check$1.optional(function() {
                      check$1.command(
                        isArrayLike(value),
                        "invalid matrix for uniform " + name,
                        env.commandStr
                      );
                      check$1.command(
                        type === GL_FLOAT_MAT2 && value.length === 4 || type === GL_FLOAT_MAT3 && value.length === 9 || type === GL_FLOAT_MAT4 && value.length === 16,
                        "invalid length for matrix uniform " + name,
                        env.commandStr
                      );
                    });
                    var MAT_VALUE = env.global.def("new Float32Array([" + Array.prototype.slice.call(value) + "])");
                    var dim = 2;
                    if (type === GL_FLOAT_MAT3) {
                      dim = 3;
                    } else if (type === GL_FLOAT_MAT4) {
                      dim = 4;
                    }
                    scope(
                      GL,
                      ".uniformMatrix",
                      dim,
                      "fv(",
                      LOCATION,
                      ",false,",
                      MAT_VALUE,
                      ");"
                    );
                  } else {
                    switch (type) {
                      case GL_FLOAT$8:
                        check$1.commandType(value, "number", "uniform " + name, env.commandStr);
                        infix = "1f";
                        break;
                      case GL_FLOAT_VEC2:
                        check$1.command(
                          isArrayLike(value) && value.length === 2,
                          "uniform " + name,
                          env.commandStr
                        );
                        infix = "2f";
                        break;
                      case GL_FLOAT_VEC3:
                        check$1.command(
                          isArrayLike(value) && value.length === 3,
                          "uniform " + name,
                          env.commandStr
                        );
                        infix = "3f";
                        break;
                      case GL_FLOAT_VEC4:
                        check$1.command(
                          isArrayLike(value) && value.length === 4,
                          "uniform " + name,
                          env.commandStr
                        );
                        infix = "4f";
                        break;
                      case GL_BOOL:
                        check$1.commandType(value, "boolean", "uniform " + name, env.commandStr);
                        infix = "1i";
                        break;
                      case GL_INT$3:
                        check$1.commandType(value, "number", "uniform " + name, env.commandStr);
                        infix = "1i";
                        break;
                      case GL_BOOL_VEC2:
                        check$1.command(
                          isArrayLike(value) && value.length === 2,
                          "uniform " + name,
                          env.commandStr
                        );
                        infix = "2i";
                        break;
                      case GL_INT_VEC2:
                        check$1.command(
                          isArrayLike(value) && value.length === 2,
                          "uniform " + name,
                          env.commandStr
                        );
                        infix = "2i";
                        break;
                      case GL_BOOL_VEC3:
                        check$1.command(
                          isArrayLike(value) && value.length === 3,
                          "uniform " + name,
                          env.commandStr
                        );
                        infix = "3i";
                        break;
                      case GL_INT_VEC3:
                        check$1.command(
                          isArrayLike(value) && value.length === 3,
                          "uniform " + name,
                          env.commandStr
                        );
                        infix = "3i";
                        break;
                      case GL_BOOL_VEC4:
                        check$1.command(
                          isArrayLike(value) && value.length === 4,
                          "uniform " + name,
                          env.commandStr
                        );
                        infix = "4i";
                        break;
                      case GL_INT_VEC4:
                        check$1.command(
                          isArrayLike(value) && value.length === 4,
                          "uniform " + name,
                          env.commandStr
                        );
                        infix = "4i";
                        break;
                    }
                    scope(
                      GL,
                      ".uniform",
                      infix,
                      "(",
                      LOCATION,
                      ",",
                      isArrayLike(value) ? Array.prototype.slice.call(value) : value,
                      ");"
                    );
                  }
                  continue;
                } else {
                  VALUE = arg.append(env, scope);
                }
              } else {
                if (!filter(SCOPE_DECL)) {
                  continue;
                }
                VALUE = scope.def(shared.uniforms, "[", stringStore.id(name), "]");
              }
              if (type === GL_SAMPLER_2D) {
                check$1(!Array.isArray(VALUE), "must specify a scalar prop for textures");
                scope(
                  "if(",
                  VALUE,
                  "&&",
                  VALUE,
                  '._reglType==="framebuffer"){',
                  VALUE,
                  "=",
                  VALUE,
                  ".color[0];",
                  "}"
                );
              } else if (type === GL_SAMPLER_CUBE) {
                check$1(!Array.isArray(VALUE), "must specify a scalar prop for cube maps");
                scope(
                  "if(",
                  VALUE,
                  "&&",
                  VALUE,
                  '._reglType==="framebufferCube"){',
                  VALUE,
                  "=",
                  VALUE,
                  ".color[0];",
                  "}"
                );
              }
              check$1.optional(function() {
                function emitCheck(pred, message) {
                  env.assert(
                    scope,
                    pred,
                    'bad data or missing for uniform "' + name + '".  ' + message
                  );
                }
                function checkType(type2) {
                  check$1(!Array.isArray(VALUE), "must not specify an array type for uniform");
                  emitCheck(
                    "typeof " + VALUE + '==="' + type2 + '"',
                    "invalid type, expected " + type2
                  );
                }
                function checkVector(n, type2) {
                  if (Array.isArray(VALUE)) {
                    check$1(VALUE.length === n, "must have length " + n);
                  } else {
                    emitCheck(
                      shared.isArrayLike + "(" + VALUE + ")&&" + VALUE + ".length===" + n,
                      "invalid vector, should have length " + n,
                      env.commandStr
                    );
                  }
                }
                function checkTexture(target) {
                  check$1(!Array.isArray(VALUE), "must not specify a value type");
                  emitCheck(
                    "typeof " + VALUE + '==="function"&&' + VALUE + '._reglType==="texture' + (target === GL_TEXTURE_2D$3 ? "2d" : "Cube") + '"',
                    "invalid texture type",
                    env.commandStr
                  );
                }
                switch (type) {
                  case GL_INT$3:
                    checkType("number");
                    break;
                  case GL_INT_VEC2:
                    checkVector(2, "number");
                    break;
                  case GL_INT_VEC3:
                    checkVector(3, "number");
                    break;
                  case GL_INT_VEC4:
                    checkVector(4, "number");
                    break;
                  case GL_FLOAT$8:
                    checkType("number");
                    break;
                  case GL_FLOAT_VEC2:
                    checkVector(2, "number");
                    break;
                  case GL_FLOAT_VEC3:
                    checkVector(3, "number");
                    break;
                  case GL_FLOAT_VEC4:
                    checkVector(4, "number");
                    break;
                  case GL_BOOL:
                    checkType("boolean");
                    break;
                  case GL_BOOL_VEC2:
                    checkVector(2, "boolean");
                    break;
                  case GL_BOOL_VEC3:
                    checkVector(3, "boolean");
                    break;
                  case GL_BOOL_VEC4:
                    checkVector(4, "boolean");
                    break;
                  case GL_FLOAT_MAT2:
                    checkVector(4, "number");
                    break;
                  case GL_FLOAT_MAT3:
                    checkVector(9, "number");
                    break;
                  case GL_FLOAT_MAT4:
                    checkVector(16, "number");
                    break;
                  case GL_SAMPLER_2D:
                    checkTexture(GL_TEXTURE_2D$3);
                    break;
                  case GL_SAMPLER_CUBE:
                    checkTexture(GL_TEXTURE_CUBE_MAP$2);
                    break;
                }
              });
              var unroll = 1;
              switch (type) {
                case GL_SAMPLER_2D:
                case GL_SAMPLER_CUBE:
                  var TEX = scope.def(VALUE, "._texture");
                  scope(GL, ".uniform1i(", LOCATION, ",", TEX, ".bind());");
                  scope.exit(TEX, ".unbind();");
                  continue;
                case GL_INT$3:
                case GL_BOOL:
                  infix = "1i";
                  break;
                case GL_INT_VEC2:
                case GL_BOOL_VEC2:
                  infix = "2i";
                  unroll = 2;
                  break;
                case GL_INT_VEC3:
                case GL_BOOL_VEC3:
                  infix = "3i";
                  unroll = 3;
                  break;
                case GL_INT_VEC4:
                case GL_BOOL_VEC4:
                  infix = "4i";
                  unroll = 4;
                  break;
                case GL_FLOAT$8:
                  infix = "1f";
                  break;
                case GL_FLOAT_VEC2:
                  infix = "2f";
                  unroll = 2;
                  break;
                case GL_FLOAT_VEC3:
                  infix = "3f";
                  unroll = 3;
                  break;
                case GL_FLOAT_VEC4:
                  infix = "4f";
                  unroll = 4;
                  break;
                case GL_FLOAT_MAT2:
                  infix = "Matrix2fv";
                  break;
                case GL_FLOAT_MAT3:
                  infix = "Matrix3fv";
                  break;
                case GL_FLOAT_MAT4:
                  infix = "Matrix4fv";
                  break;
              }
              if (infix.charAt(0) === "M") {
                scope(GL, ".uniform", infix, "(", LOCATION, ",");
                var matSize = Math.pow(type - GL_FLOAT_MAT2 + 2, 2);
                var STORAGE = env.global.def("new Float32Array(", matSize, ")");
                if (Array.isArray(VALUE)) {
                  scope(
                    "false,(",
                    loop(matSize, function(i2) {
                      return STORAGE + "[" + i2 + "]=" + VALUE[i2];
                    }),
                    ",",
                    STORAGE,
                    ")"
                  );
                } else {
                  scope(
                    "false,(Array.isArray(",
                    VALUE,
                    ")||",
                    VALUE,
                    " instanceof Float32Array)?",
                    VALUE,
                    ":(",
                    loop(matSize, function(i2) {
                      return STORAGE + "[" + i2 + "]=" + VALUE + "[" + i2 + "]";
                    }),
                    ",",
                    STORAGE,
                    ")"
                  );
                }
                scope(");");
              } else if (unroll > 1) {
                var prev = [];
                var cur = [];
                for (var j = 0; j < unroll; ++j) {
                  if (Array.isArray(VALUE)) {
                    cur.push(VALUE[j]);
                  } else {
                    cur.push(scope.def(VALUE + "[" + j + "]"));
                  }
                  if (isBatchInnerLoop) {
                    prev.push(scope.def());
                  }
                }
                if (isBatchInnerLoop) {
                  scope("if(!", env.batchId, "||", prev.map(function(p, i2) {
                    return p + "!==" + cur[i2];
                  }).join("||"), "){", prev.map(function(p, i2) {
                    return p + "=" + cur[i2] + ";";
                  }).join(""));
                }
                scope(GL, ".uniform", infix, "(", LOCATION, ",", cur.join(","), ");");
                if (isBatchInnerLoop) {
                  scope("}");
                }
              } else {
                check$1(!Array.isArray(VALUE), "uniform value must not be an array");
                if (isBatchInnerLoop) {
                  var prevS = scope.def();
                  scope(
                    "if(!",
                    env.batchId,
                    "||",
                    prevS,
                    "!==",
                    VALUE,
                    "){",
                    prevS,
                    "=",
                    VALUE,
                    ";"
                  );
                }
                scope(GL, ".uniform", infix, "(", LOCATION, ",", VALUE, ");");
                if (isBatchInnerLoop) {
                  scope("}");
                }
              }
            }
          }
          function emitDraw(env, outer, inner, args) {
            var shared = env.shared;
            var GL = shared.gl;
            var DRAW_STATE = shared.draw;
            var drawOptions = args.draw;
            function emitElements() {
              var defn = drawOptions.elements;
              var ELEMENTS2;
              var scope = outer;
              if (defn) {
                if (defn.contextDep && args.contextDynamic || defn.propDep) {
                  scope = inner;
                }
                ELEMENTS2 = defn.append(env, scope);
                if (drawOptions.elementsActive) {
                  scope(
                    "if(" + ELEMENTS2 + ")" + GL + ".bindBuffer(" + GL_ELEMENT_ARRAY_BUFFER$2 + "," + ELEMENTS2 + ".buffer.buffer);"
                  );
                }
              } else {
                ELEMENTS2 = scope.def();
                scope(
                  ELEMENTS2,
                  "=",
                  DRAW_STATE,
                  ".",
                  S_ELEMENTS,
                  ";",
                  "if(",
                  ELEMENTS2,
                  "){",
                  GL,
                  ".bindBuffer(",
                  GL_ELEMENT_ARRAY_BUFFER$2,
                  ",",
                  ELEMENTS2,
                  ".buffer.buffer);}",
                  "else if(",
                  shared.vao,
                  ".currentVAO){",
                  ELEMENTS2,
                  "=",
                  env.shared.elements + ".getElements(" + shared.vao,
                  ".currentVAO.elements);",
                  !extVertexArrays ? "if(" + ELEMENTS2 + ")" + GL + ".bindBuffer(" + GL_ELEMENT_ARRAY_BUFFER$2 + "," + ELEMENTS2 + ".buffer.buffer);" : "",
                  "}"
                );
              }
              return ELEMENTS2;
            }
            function emitCount() {
              var defn = drawOptions.count;
              var COUNT2;
              var scope = outer;
              if (defn) {
                if (defn.contextDep && args.contextDynamic || defn.propDep) {
                  scope = inner;
                }
                COUNT2 = defn.append(env, scope);
                check$1.optional(function() {
                  if (defn.MISSING) {
                    env.assert(outer, "false", "missing vertex count");
                  }
                  if (defn.DYNAMIC) {
                    env.assert(scope, COUNT2 + ">=0", "missing vertex count");
                  }
                });
              } else {
                COUNT2 = scope.def(DRAW_STATE, ".", S_COUNT);
                check$1.optional(function() {
                  env.assert(scope, COUNT2 + ">=0", "missing vertex count");
                });
              }
              return COUNT2;
            }
            var ELEMENTS = emitElements();
            function emitValue(name) {
              var defn = drawOptions[name];
              if (defn) {
                if (defn.contextDep && args.contextDynamic || defn.propDep) {
                  return defn.append(env, inner);
                } else {
                  return defn.append(env, outer);
                }
              } else {
                return outer.def(DRAW_STATE, ".", name);
              }
            }
            var PRIMITIVE = emitValue(S_PRIMITIVE);
            var OFFSET = emitValue(S_OFFSET);
            var COUNT = emitCount();
            if (typeof COUNT === "number") {
              if (COUNT === 0) {
                return;
              }
            } else {
              inner("if(", COUNT, "){");
              inner.exit("}");
            }
            var INSTANCES, EXT_INSTANCING;
            if (extInstancing) {
              INSTANCES = emitValue(S_INSTANCES);
              EXT_INSTANCING = env.instancing;
            }
            var ELEMENT_TYPE = ELEMENTS + ".type";
            var elementsStatic = drawOptions.elements && isStatic(drawOptions.elements) && !drawOptions.vaoActive;
            function emitInstancing() {
              function drawElements() {
                inner(EXT_INSTANCING, ".drawElementsInstancedANGLE(", [
                  PRIMITIVE,
                  COUNT,
                  ELEMENT_TYPE,
                  OFFSET + "<<((" + ELEMENT_TYPE + "-" + GL_UNSIGNED_BYTE$8 + ")>>1)",
                  INSTANCES
                ], ");");
              }
              function drawArrays() {
                inner(
                  EXT_INSTANCING,
                  ".drawArraysInstancedANGLE(",
                  [PRIMITIVE, OFFSET, COUNT, INSTANCES],
                  ");"
                );
              }
              if (ELEMENTS && ELEMENTS !== "null") {
                if (!elementsStatic) {
                  inner("if(", ELEMENTS, "){");
                  drawElements();
                  inner("}else{");
                  drawArrays();
                  inner("}");
                } else {
                  drawElements();
                }
              } else {
                drawArrays();
              }
            }
            function emitRegular() {
              function drawElements() {
                inner(GL + ".drawElements(" + [
                  PRIMITIVE,
                  COUNT,
                  ELEMENT_TYPE,
                  OFFSET + "<<((" + ELEMENT_TYPE + "-" + GL_UNSIGNED_BYTE$8 + ")>>1)"
                ] + ");");
              }
              function drawArrays() {
                inner(GL + ".drawArrays(" + [PRIMITIVE, OFFSET, COUNT] + ");");
              }
              if (ELEMENTS && ELEMENTS !== "null") {
                if (!elementsStatic) {
                  inner("if(", ELEMENTS, "){");
                  drawElements();
                  inner("}else{");
                  drawArrays();
                  inner("}");
                } else {
                  drawElements();
                }
              } else {
                drawArrays();
              }
            }
            if (extInstancing && (typeof INSTANCES !== "number" || INSTANCES >= 0)) {
              if (typeof INSTANCES === "string") {
                inner("if(", INSTANCES, ">0){");
                emitInstancing();
                inner("}else if(", INSTANCES, "<0){");
                emitRegular();
                inner("}");
              } else {
                emitInstancing();
              }
            } else {
              emitRegular();
            }
          }
          function createBody(emitBody, parentEnv, args, program, count) {
            var env = createREGLEnvironment();
            var scope = env.proc("body", count);
            check$1.optional(function() {
              env.commandStr = parentEnv.commandStr;
              env.command = env.link(parentEnv.commandStr);
            });
            if (extInstancing) {
              env.instancing = scope.def(
                env.shared.extensions,
                ".angle_instanced_arrays"
              );
            }
            emitBody(env, scope, args, program);
            return env.compile().body;
          }
          function emitDrawBody(env, draw, args, program) {
            injectExtensions(env, draw);
            if (args.useVAO) {
              if (args.drawVAO) {
                draw(env.shared.vao, ".setVAO(", args.drawVAO.append(env, draw), ");");
              } else {
                draw(env.shared.vao, ".setVAO(", env.shared.vao, ".targetVAO);");
              }
            } else {
              draw(env.shared.vao, ".setVAO(null);");
              emitAttributes(env, draw, args, program.attributes, function() {
                return true;
              });
            }
            emitUniforms(env, draw, args, program.uniforms, function() {
              return true;
            }, false);
            emitDraw(env, draw, draw, args);
          }
          function emitDrawProc(env, args) {
            var draw = env.proc("draw", 1);
            injectExtensions(env, draw);
            emitContext(env, draw, args.context);
            emitPollFramebuffer(env, draw, args.framebuffer);
            emitPollState(env, draw, args);
            emitSetOptions(env, draw, args.state);
            emitProfile(env, draw, args, false, true);
            var program = args.shader.progVar.append(env, draw);
            draw(env.shared.gl, ".useProgram(", program, ".program);");
            if (args.shader.program) {
              emitDrawBody(env, draw, args, args.shader.program);
            } else {
              draw(env.shared.vao, ".setVAO(null);");
              var drawCache = env.global.def("{}");
              var PROG_ID = draw.def(program, ".id");
              var CACHED_PROC = draw.def(drawCache, "[", PROG_ID, "]");
              draw(
                env.cond(CACHED_PROC).then(CACHED_PROC, ".call(this,a0);").else(
                  CACHED_PROC,
                  "=",
                  drawCache,
                  "[",
                  PROG_ID,
                  "]=",
                  env.link(function(program2) {
                    return createBody(emitDrawBody, env, args, program2, 1);
                  }),
                  "(",
                  program,
                  ");",
                  CACHED_PROC,
                  ".call(this,a0);"
                )
              );
            }
            if (Object.keys(args.state).length > 0) {
              draw(env.shared.current, ".dirty=true;");
            }
            if (env.shared.vao) {
              draw(env.shared.vao, ".setVAO(null);");
            }
          }
          function emitBatchDynamicShaderBody(env, scope, args, program) {
            env.batchId = "a1";
            injectExtensions(env, scope);
            function all() {
              return true;
            }
            emitAttributes(env, scope, args, program.attributes, all);
            emitUniforms(env, scope, args, program.uniforms, all, false);
            emitDraw(env, scope, scope, args);
          }
          function emitBatchBody(env, scope, args, program) {
            injectExtensions(env, scope);
            var contextDynamic = args.contextDep;
            var BATCH_ID = scope.def();
            var PROP_LIST = "a0";
            var NUM_PROPS = "a1";
            var PROPS = scope.def();
            env.shared.props = PROPS;
            env.batchId = BATCH_ID;
            var outer = env.scope();
            var inner = env.scope();
            scope(
              outer.entry,
              "for(",
              BATCH_ID,
              "=0;",
              BATCH_ID,
              "<",
              NUM_PROPS,
              ";++",
              BATCH_ID,
              "){",
              PROPS,
              "=",
              PROP_LIST,
              "[",
              BATCH_ID,
              "];",
              inner,
              "}",
              outer.exit
            );
            function isInnerDefn(defn) {
              return defn.contextDep && contextDynamic || defn.propDep;
            }
            function isOuterDefn(defn) {
              return !isInnerDefn(defn);
            }
            if (args.needsContext) {
              emitContext(env, inner, args.context);
            }
            if (args.needsFramebuffer) {
              emitPollFramebuffer(env, inner, args.framebuffer);
            }
            emitSetOptions(env, inner, args.state, isInnerDefn);
            if (args.profile && isInnerDefn(args.profile)) {
              emitProfile(env, inner, args, false, true);
            }
            if (!program) {
              var progCache = env.global.def("{}");
              var PROGRAM = args.shader.progVar.append(env, inner);
              var PROG_ID = inner.def(PROGRAM, ".id");
              var CACHED_PROC = inner.def(progCache, "[", PROG_ID, "]");
              inner(
                env.shared.gl,
                ".useProgram(",
                PROGRAM,
                ".program);",
                "if(!",
                CACHED_PROC,
                "){",
                CACHED_PROC,
                "=",
                progCache,
                "[",
                PROG_ID,
                "]=",
                env.link(function(program2) {
                  return createBody(
                    emitBatchDynamicShaderBody,
                    env,
                    args,
                    program2,
                    2
                  );
                }),
                "(",
                PROGRAM,
                ");}",
                CACHED_PROC,
                ".call(this,a0[",
                BATCH_ID,
                "],",
                BATCH_ID,
                ");"
              );
            } else {
              if (args.useVAO) {
                if (args.drawVAO) {
                  if (isInnerDefn(args.drawVAO)) {
                    inner(env.shared.vao, ".setVAO(", args.drawVAO.append(env, inner), ");");
                  } else {
                    outer(env.shared.vao, ".setVAO(", args.drawVAO.append(env, outer), ");");
                  }
                } else {
                  outer(env.shared.vao, ".setVAO(", env.shared.vao, ".targetVAO);");
                }
              } else {
                outer(env.shared.vao, ".setVAO(null);");
                emitAttributes(env, outer, args, program.attributes, isOuterDefn);
                emitAttributes(env, inner, args, program.attributes, isInnerDefn);
              }
              emitUniforms(env, outer, args, program.uniforms, isOuterDefn, false);
              emitUniforms(env, inner, args, program.uniforms, isInnerDefn, true);
              emitDraw(env, outer, inner, args);
            }
          }
          function emitBatchProc(env, args) {
            var batch = env.proc("batch", 2);
            env.batchId = "0";
            injectExtensions(env, batch);
            var contextDynamic = false;
            var needsContext = true;
            Object.keys(args.context).forEach(function(name) {
              contextDynamic = contextDynamic || args.context[name].propDep;
            });
            if (!contextDynamic) {
              emitContext(env, batch, args.context);
              needsContext = false;
            }
            var framebuffer = args.framebuffer;
            var needsFramebuffer = false;
            if (framebuffer) {
              if (framebuffer.propDep) {
                contextDynamic = needsFramebuffer = true;
              } else if (framebuffer.contextDep && contextDynamic) {
                needsFramebuffer = true;
              }
              if (!needsFramebuffer) {
                emitPollFramebuffer(env, batch, framebuffer);
              }
            } else {
              emitPollFramebuffer(env, batch, null);
            }
            if (args.state.viewport && args.state.viewport.propDep) {
              contextDynamic = true;
            }
            function isInnerDefn(defn) {
              return defn.contextDep && contextDynamic || defn.propDep;
            }
            emitPollState(env, batch, args);
            emitSetOptions(env, batch, args.state, function(defn) {
              return !isInnerDefn(defn);
            });
            if (!args.profile || !isInnerDefn(args.profile)) {
              emitProfile(env, batch, args, false, "a1");
            }
            args.contextDep = contextDynamic;
            args.needsContext = needsContext;
            args.needsFramebuffer = needsFramebuffer;
            var progDefn = args.shader.progVar;
            if (progDefn.contextDep && contextDynamic || progDefn.propDep) {
              emitBatchBody(
                env,
                batch,
                args,
                null
              );
            } else {
              var PROGRAM = progDefn.append(env, batch);
              batch(env.shared.gl, ".useProgram(", PROGRAM, ".program);");
              if (args.shader.program) {
                emitBatchBody(
                  env,
                  batch,
                  args,
                  args.shader.program
                );
              } else {
                batch(env.shared.vao, ".setVAO(null);");
                var batchCache = env.global.def("{}");
                var PROG_ID = batch.def(PROGRAM, ".id");
                var CACHED_PROC = batch.def(batchCache, "[", PROG_ID, "]");
                batch(
                  env.cond(CACHED_PROC).then(CACHED_PROC, ".call(this,a0,a1);").else(
                    CACHED_PROC,
                    "=",
                    batchCache,
                    "[",
                    PROG_ID,
                    "]=",
                    env.link(function(program) {
                      return createBody(emitBatchBody, env, args, program, 2);
                    }),
                    "(",
                    PROGRAM,
                    ");",
                    CACHED_PROC,
                    ".call(this,a0,a1);"
                  )
                );
              }
            }
            if (Object.keys(args.state).length > 0) {
              batch(env.shared.current, ".dirty=true;");
            }
            if (env.shared.vao) {
              batch(env.shared.vao, ".setVAO(null);");
            }
          }
          function emitScopeProc(env, args) {
            var scope = env.proc("scope", 3);
            env.batchId = "a2";
            var shared = env.shared;
            var CURRENT_STATE = shared.current;
            emitContext(env, scope, args.context);
            if (args.framebuffer) {
              args.framebuffer.append(env, scope);
            }
            sortState(Object.keys(args.state)).forEach(function(name) {
              var defn = args.state[name];
              var value = defn.append(env, scope);
              if (isArrayLike(value)) {
                value.forEach(function(v, i) {
                  scope.set(env.next[name], "[" + i + "]", v);
                });
              } else {
                scope.set(shared.next, "." + name, value);
              }
            });
            emitProfile(env, scope, args, true, true);
            [S_ELEMENTS, S_OFFSET, S_COUNT, S_INSTANCES, S_PRIMITIVE].forEach(
              function(opt) {
                var variable = args.draw[opt];
                if (!variable) {
                  return;
                }
                scope.set(shared.draw, "." + opt, "" + variable.append(env, scope));
              }
            );
            Object.keys(args.uniforms).forEach(function(opt) {
              var value = args.uniforms[opt].append(env, scope);
              if (Array.isArray(value)) {
                value = "[" + value.join() + "]";
              }
              scope.set(
                shared.uniforms,
                "[" + stringStore.id(opt) + "]",
                value
              );
            });
            Object.keys(args.attributes).forEach(function(name) {
              var record = args.attributes[name].append(env, scope);
              var scopeAttrib = env.scopeAttrib(name);
              Object.keys(new AttributeRecord2()).forEach(function(prop) {
                scope.set(scopeAttrib, "." + prop, record[prop]);
              });
            });
            if (args.scopeVAO) {
              scope.set(shared.vao, ".targetVAO", args.scopeVAO.append(env, scope));
            }
            function saveShader(name) {
              var shader = args.shader[name];
              if (shader) {
                scope.set(shared.shader, "." + name, shader.append(env, scope));
              }
            }
            saveShader(S_VERT);
            saveShader(S_FRAG);
            if (Object.keys(args.state).length > 0) {
              scope(CURRENT_STATE, ".dirty=true;");
              scope.exit(CURRENT_STATE, ".dirty=true;");
            }
            scope("a1(", env.shared.context, ",a0,", env.batchId, ");");
          }
          function isDynamicObject(object) {
            if (typeof object !== "object" || isArrayLike(object)) {
              return;
            }
            var props = Object.keys(object);
            for (var i = 0; i < props.length; ++i) {
              if (dynamic.isDynamic(object[props[i]])) {
                return true;
              }
            }
            return false;
          }
          function splatObject(env, options, name) {
            var object = options.static[name];
            if (!object || !isDynamicObject(object)) {
              return;
            }
            var globals = env.global;
            var keys2 = Object.keys(object);
            var thisDep = false;
            var contextDep = false;
            var propDep = false;
            var objectRef = env.global.def("{}");
            keys2.forEach(function(key) {
              var value = object[key];
              if (dynamic.isDynamic(value)) {
                if (typeof value === "function") {
                  value = object[key] = dynamic.unbox(value);
                }
                var deps = createDynamicDecl(value, null);
                thisDep = thisDep || deps.thisDep;
                propDep = propDep || deps.propDep;
                contextDep = contextDep || deps.contextDep;
              } else {
                globals(objectRef, ".", key, "=");
                switch (typeof value) {
                  case "number":
                    globals(value);
                    break;
                  case "string":
                    globals('"', value, '"');
                    break;
                  case "object":
                    if (Array.isArray(value)) {
                      globals("[", value.join(), "]");
                    }
                    break;
                  default:
                    globals(env.link(value));
                    break;
                }
                globals(";");
              }
            });
            function appendBlock(env2, block) {
              keys2.forEach(function(key) {
                var value = object[key];
                if (!dynamic.isDynamic(value)) {
                  return;
                }
                var ref = env2.invoke(block, value);
                block(objectRef, ".", key, "=", ref, ";");
              });
            }
            options.dynamic[name] = new dynamic.DynamicVariable(DYN_THUNK, {
              thisDep,
              contextDep,
              propDep,
              ref: objectRef,
              append: appendBlock
            });
            delete options.static[name];
          }
          function compileCommand(options, attributes, uniforms, context, stats2) {
            var env = createREGLEnvironment();
            env.stats = env.link(stats2);
            Object.keys(attributes.static).forEach(function(key) {
              splatObject(env, attributes, key);
            });
            NESTED_OPTIONS.forEach(function(name) {
              splatObject(env, options, name);
            });
            var args = parseArguments(options, attributes, uniforms, context, env);
            emitDrawProc(env, args);
            emitScopeProc(env, args);
            emitBatchProc(env, args);
            return extend(env.compile(), {
              destroy: function() {
                args.shader.program.destroy();
              }
            });
          }
          return {
            next: nextState,
            current: currentState,
            procs: (function() {
              var env = createREGLEnvironment();
              var poll = env.proc("poll");
              var refresh = env.proc("refresh");
              var common = env.block();
              poll(common);
              refresh(common);
              var shared = env.shared;
              var GL = shared.gl;
              var NEXT_STATE = shared.next;
              var CURRENT_STATE = shared.current;
              common(CURRENT_STATE, ".dirty=false;");
              emitPollFramebuffer(env, poll);
              emitPollFramebuffer(env, refresh, null, true);
              var INSTANCING;
              if (extInstancing) {
                INSTANCING = env.link(extInstancing);
              }
              if (extensions.oes_vertex_array_object) {
                refresh(env.link(extensions.oes_vertex_array_object), ".bindVertexArrayOES(null);");
              }
              for (var i = 0; i < limits.maxAttributes; ++i) {
                var BINDING = refresh.def(shared.attributes, "[", i, "]");
                var ifte = env.cond(BINDING, ".buffer");
                ifte.then(
                  GL,
                  ".enableVertexAttribArray(",
                  i,
                  ");",
                  GL,
                  ".bindBuffer(",
                  GL_ARRAY_BUFFER$2,
                  ",",
                  BINDING,
                  ".buffer.buffer);",
                  GL,
                  ".vertexAttribPointer(",
                  i,
                  ",",
                  BINDING,
                  ".size,",
                  BINDING,
                  ".type,",
                  BINDING,
                  ".normalized,",
                  BINDING,
                  ".stride,",
                  BINDING,
                  ".offset);"
                ).else(
                  GL,
                  ".disableVertexAttribArray(",
                  i,
                  ");",
                  GL,
                  ".vertexAttrib4f(",
                  i,
                  ",",
                  BINDING,
                  ".x,",
                  BINDING,
                  ".y,",
                  BINDING,
                  ".z,",
                  BINDING,
                  ".w);",
                  BINDING,
                  ".buffer=null;"
                );
                refresh(ifte);
                if (extInstancing) {
                  refresh(
                    INSTANCING,
                    ".vertexAttribDivisorANGLE(",
                    i,
                    ",",
                    BINDING,
                    ".divisor);"
                  );
                }
              }
              refresh(
                env.shared.vao,
                ".currentVAO=null;",
                env.shared.vao,
                ".setVAO(",
                env.shared.vao,
                ".targetVAO);"
              );
              Object.keys(GL_FLAGS).forEach(function(flag) {
                var cap = GL_FLAGS[flag];
                var NEXT = common.def(NEXT_STATE, ".", flag);
                var block = env.block();
                block(
                  "if(",
                  NEXT,
                  "){",
                  GL,
                  ".enable(",
                  cap,
                  ")}else{",
                  GL,
                  ".disable(",
                  cap,
                  ")}",
                  CURRENT_STATE,
                  ".",
                  flag,
                  "=",
                  NEXT,
                  ";"
                );
                refresh(block);
                poll(
                  "if(",
                  NEXT,
                  "!==",
                  CURRENT_STATE,
                  ".",
                  flag,
                  "){",
                  block,
                  "}"
                );
              });
              Object.keys(GL_VARIABLES).forEach(function(name) {
                var func = GL_VARIABLES[name];
                var init = currentState[name];
                var NEXT, CURRENT;
                var block = env.block();
                block(GL, ".", func, "(");
                if (isArrayLike(init)) {
                  var n = init.length;
                  NEXT = env.global.def(NEXT_STATE, ".", name);
                  CURRENT = env.global.def(CURRENT_STATE, ".", name);
                  block(
                    loop(n, function(i2) {
                      return NEXT + "[" + i2 + "]";
                    }),
                    ");",
                    loop(n, function(i2) {
                      return CURRENT + "[" + i2 + "]=" + NEXT + "[" + i2 + "];";
                    }).join("")
                  );
                  poll(
                    "if(",
                    loop(n, function(i2) {
                      return NEXT + "[" + i2 + "]!==" + CURRENT + "[" + i2 + "]";
                    }).join("||"),
                    "){",
                    block,
                    "}"
                  );
                } else {
                  NEXT = common.def(NEXT_STATE, ".", name);
                  CURRENT = common.def(CURRENT_STATE, ".", name);
                  block(
                    NEXT,
                    ");",
                    CURRENT_STATE,
                    ".",
                    name,
                    "=",
                    NEXT,
                    ";"
                  );
                  poll(
                    "if(",
                    NEXT,
                    "!==",
                    CURRENT,
                    "){",
                    block,
                    "}"
                  );
                }
                refresh(block);
              });
              return env.compile();
            })(),
            compile: compileCommand
          };
        }
        function stats() {
          return {
            vaoCount: 0,
            bufferCount: 0,
            elementsCount: 0,
            framebufferCount: 0,
            shaderCount: 0,
            textureCount: 0,
            cubeCount: 0,
            renderbufferCount: 0,
            maxTextureUnits: 0
          };
        }
        var GL_QUERY_RESULT_EXT = 34918;
        var GL_QUERY_RESULT_AVAILABLE_EXT = 34919;
        var GL_TIME_ELAPSED_EXT = 35007;
        var createTimer = function(gl, extensions) {
          if (!extensions.ext_disjoint_timer_query) {
            return null;
          }
          var queryPool = [];
          function allocQuery() {
            return queryPool.pop() || extensions.ext_disjoint_timer_query.createQueryEXT();
          }
          function freeQuery(query) {
            queryPool.push(query);
          }
          var pendingQueries = [];
          function beginQuery(stats2) {
            var query = allocQuery();
            extensions.ext_disjoint_timer_query.beginQueryEXT(GL_TIME_ELAPSED_EXT, query);
            pendingQueries.push(query);
            pushScopeStats(pendingQueries.length - 1, pendingQueries.length, stats2);
          }
          function endQuery() {
            extensions.ext_disjoint_timer_query.endQueryEXT(GL_TIME_ELAPSED_EXT);
          }
          function PendingStats() {
            this.startQueryIndex = -1;
            this.endQueryIndex = -1;
            this.sum = 0;
            this.stats = null;
          }
          var pendingStatsPool = [];
          function allocPendingStats() {
            return pendingStatsPool.pop() || new PendingStats();
          }
          function freePendingStats(pendingStats2) {
            pendingStatsPool.push(pendingStats2);
          }
          var pendingStats = [];
          function pushScopeStats(start, end, stats2) {
            var ps = allocPendingStats();
            ps.startQueryIndex = start;
            ps.endQueryIndex = end;
            ps.sum = 0;
            ps.stats = stats2;
            pendingStats.push(ps);
          }
          var timeSum = [];
          var queryPtr = [];
          function update() {
            var ptr, i;
            var n = pendingQueries.length;
            if (n === 0) {
              return;
            }
            queryPtr.length = Math.max(queryPtr.length, n + 1);
            timeSum.length = Math.max(timeSum.length, n + 1);
            timeSum[0] = 0;
            queryPtr[0] = 0;
            var queryTime = 0;
            ptr = 0;
            for (i = 0; i < pendingQueries.length; ++i) {
              var query = pendingQueries[i];
              if (extensions.ext_disjoint_timer_query.getQueryObjectEXT(query, GL_QUERY_RESULT_AVAILABLE_EXT)) {
                queryTime += extensions.ext_disjoint_timer_query.getQueryObjectEXT(query, GL_QUERY_RESULT_EXT);
                freeQuery(query);
              } else {
                pendingQueries[ptr++] = query;
              }
              timeSum[i + 1] = queryTime;
              queryPtr[i + 1] = ptr;
            }
            pendingQueries.length = ptr;
            ptr = 0;
            for (i = 0; i < pendingStats.length; ++i) {
              var stats2 = pendingStats[i];
              var start = stats2.startQueryIndex;
              var end = stats2.endQueryIndex;
              stats2.sum += timeSum[end] - timeSum[start];
              var startPtr = queryPtr[start];
              var endPtr = queryPtr[end];
              if (endPtr === startPtr) {
                stats2.stats.gpuTime += stats2.sum / 1e6;
                freePendingStats(stats2);
              } else {
                stats2.startQueryIndex = startPtr;
                stats2.endQueryIndex = endPtr;
                pendingStats[ptr++] = stats2;
              }
            }
            pendingStats.length = ptr;
          }
          return {
            beginQuery,
            endQuery,
            pushScopeStats,
            update,
            getNumPendingQueries: function() {
              return pendingQueries.length;
            },
            clear: function() {
              queryPool.push.apply(queryPool, pendingQueries);
              for (var i = 0; i < queryPool.length; i++) {
                extensions.ext_disjoint_timer_query.deleteQueryEXT(queryPool[i]);
              }
              pendingQueries.length = 0;
              queryPool.length = 0;
            },
            restore: function() {
              pendingQueries.length = 0;
              queryPool.length = 0;
            }
          };
        };
        var GL_COLOR_BUFFER_BIT = 16384;
        var GL_DEPTH_BUFFER_BIT = 256;
        var GL_STENCIL_BUFFER_BIT = 1024;
        var GL_ARRAY_BUFFER = 34962;
        var CONTEXT_LOST_EVENT = "webglcontextlost";
        var CONTEXT_RESTORED_EVENT = "webglcontextrestored";
        var DYN_PROP = 1;
        var DYN_CONTEXT = 2;
        var DYN_STATE = 3;
        function find(haystack, needle) {
          for (var i = 0; i < haystack.length; ++i) {
            if (haystack[i] === needle) {
              return i;
            }
          }
          return -1;
        }
        function wrapREGL(args) {
          var config = parseArgs(args);
          if (!config) {
            return null;
          }
          var gl = config.gl;
          var glAttributes = gl.getContextAttributes();
          var contextLost = gl.isContextLost();
          var extensionState = createExtensionCache(gl, config);
          if (!extensionState) {
            return null;
          }
          var stringStore = createStringStore();
          var stats$$1 = stats();
          var extensions = extensionState.extensions;
          var timer = createTimer(gl, extensions);
          var START_TIME = clock();
          var WIDTH = gl.drawingBufferWidth;
          var HEIGHT = gl.drawingBufferHeight;
          var contextState = {
            tick: 0,
            time: 0,
            viewportWidth: WIDTH,
            viewportHeight: HEIGHT,
            framebufferWidth: WIDTH,
            framebufferHeight: HEIGHT,
            drawingBufferWidth: WIDTH,
            drawingBufferHeight: HEIGHT,
            pixelRatio: config.pixelRatio
          };
          var uniformState = {};
          var drawState = {
            elements: null,
            primitive: 4,
            // GL_TRIANGLES
            count: -1,
            offset: 0,
            instances: -1
          };
          var limits = wrapLimits(gl, extensions);
          var bufferState = wrapBufferState(
            gl,
            stats$$1,
            config,
            destroyBuffer
          );
          var elementState = wrapElementsState(gl, extensions, bufferState, stats$$1);
          var attributeState = wrapAttributeState(
            gl,
            extensions,
            limits,
            stats$$1,
            bufferState,
            elementState,
            drawState
          );
          function destroyBuffer(buffer) {
            return attributeState.destroyBuffer(buffer);
          }
          var shaderState = wrapShaderState(gl, stringStore, stats$$1, config);
          var textureState = createTextureSet(
            gl,
            extensions,
            limits,
            function() {
              core.procs.poll();
            },
            contextState,
            stats$$1,
            config
          );
          var renderbufferState = wrapRenderbuffers(gl, extensions, limits, stats$$1, config);
          var framebufferState = wrapFBOState(
            gl,
            extensions,
            limits,
            textureState,
            renderbufferState,
            stats$$1
          );
          var core = reglCore(
            gl,
            stringStore,
            extensions,
            limits,
            bufferState,
            elementState,
            textureState,
            framebufferState,
            uniformState,
            attributeState,
            shaderState,
            drawState,
            contextState,
            timer,
            config
          );
          var readPixels = wrapReadPixels(
            gl,
            framebufferState,
            core.procs.poll,
            contextState,
            glAttributes,
            extensions,
            limits
          );
          var nextState = core.next;
          var canvas = gl.canvas;
          var rafCallbacks = [];
          var lossCallbacks = [];
          var restoreCallbacks = [];
          var destroyCallbacks = [config.onDestroy];
          var activeRAF = null;
          function handleRAF() {
            if (rafCallbacks.length === 0) {
              if (timer) {
                timer.update();
              }
              activeRAF = null;
              return;
            }
            activeRAF = raf.next(handleRAF);
            poll();
            for (var i = rafCallbacks.length - 1; i >= 0; --i) {
              var cb = rafCallbacks[i];
              if (cb) {
                cb(contextState, null, 0);
              }
            }
            gl.flush();
            if (timer) {
              timer.update();
            }
          }
          function startRAF() {
            if (!activeRAF && rafCallbacks.length > 0) {
              activeRAF = raf.next(handleRAF);
            }
          }
          function stopRAF() {
            if (activeRAF) {
              raf.cancel(handleRAF);
              activeRAF = null;
            }
          }
          function handleContextLoss(event) {
            event.preventDefault();
            contextLost = true;
            stopRAF();
            lossCallbacks.forEach(function(cb) {
              cb();
            });
          }
          function handleContextRestored(event) {
            gl.getError();
            contextLost = false;
            extensionState.restore();
            shaderState.restore();
            bufferState.restore();
            textureState.restore();
            renderbufferState.restore();
            framebufferState.restore();
            attributeState.restore();
            if (timer) {
              timer.restore();
            }
            core.procs.refresh();
            startRAF();
            restoreCallbacks.forEach(function(cb) {
              cb();
            });
          }
          if (canvas) {
            canvas.addEventListener(CONTEXT_LOST_EVENT, handleContextLoss, false);
            canvas.addEventListener(CONTEXT_RESTORED_EVENT, handleContextRestored, false);
          }
          function destroy() {
            rafCallbacks.length = 0;
            stopRAF();
            if (canvas) {
              canvas.removeEventListener(CONTEXT_LOST_EVENT, handleContextLoss);
              canvas.removeEventListener(CONTEXT_RESTORED_EVENT, handleContextRestored);
            }
            shaderState.clear();
            framebufferState.clear();
            renderbufferState.clear();
            attributeState.clear();
            textureState.clear();
            elementState.clear();
            bufferState.clear();
            if (timer) {
              timer.clear();
            }
            destroyCallbacks.forEach(function(cb) {
              cb();
            });
          }
          function compileProcedure(options) {
            check$1(!!options, "invalid args to regl({...})");
            check$1.type(options, "object", "invalid args to regl({...})");
            function flattenNestedOptions(options2) {
              var result = extend({}, options2);
              delete result.uniforms;
              delete result.attributes;
              delete result.context;
              delete result.vao;
              if ("stencil" in result && result.stencil.op) {
                result.stencil.opBack = result.stencil.opFront = result.stencil.op;
                delete result.stencil.op;
              }
              function merge(name) {
                if (name in result) {
                  var child = result[name];
                  delete result[name];
                  Object.keys(child).forEach(function(prop) {
                    result[name + "." + prop] = child[prop];
                  });
                }
              }
              merge("blend");
              merge("depth");
              merge("cull");
              merge("stencil");
              merge("polygonOffset");
              merge("scissor");
              merge("sample");
              if ("vao" in options2) {
                result.vao = options2.vao;
              }
              return result;
            }
            function separateDynamic(object, useArrays) {
              var staticItems = {};
              var dynamicItems = {};
              Object.keys(object).forEach(function(option) {
                var value = object[option];
                if (dynamic.isDynamic(value)) {
                  dynamicItems[option] = dynamic.unbox(value, option);
                  return;
                } else if (useArrays && Array.isArray(value)) {
                  for (var i = 0; i < value.length; ++i) {
                    if (dynamic.isDynamic(value[i])) {
                      dynamicItems[option] = dynamic.unbox(value, option);
                      return;
                    }
                  }
                }
                staticItems[option] = value;
              });
              return {
                dynamic: dynamicItems,
                static: staticItems
              };
            }
            var context = separateDynamic(options.context || {}, true);
            var uniforms = separateDynamic(options.uniforms || {}, true);
            var attributes = separateDynamic(options.attributes || {}, false);
            var opts = separateDynamic(flattenNestedOptions(options), false);
            var stats$$12 = {
              gpuTime: 0,
              cpuTime: 0,
              count: 0
            };
            var compiled = core.compile(opts, attributes, uniforms, context, stats$$12);
            var draw = compiled.draw;
            var batch = compiled.batch;
            var scope = compiled.scope;
            var EMPTY_ARRAY = [];
            function reserve(count) {
              while (EMPTY_ARRAY.length < count) {
                EMPTY_ARRAY.push(null);
              }
              return EMPTY_ARRAY;
            }
            function REGLCommand(args2, body) {
              var i;
              if (contextLost) {
                check$1.raise("context lost");
              }
              if (typeof args2 === "function") {
                return scope.call(this, null, args2, 0);
              } else if (typeof body === "function") {
                if (typeof args2 === "number") {
                  for (i = 0; i < args2; ++i) {
                    scope.call(this, null, body, i);
                  }
                } else if (Array.isArray(args2)) {
                  for (i = 0; i < args2.length; ++i) {
                    scope.call(this, args2[i], body, i);
                  }
                } else {
                  return scope.call(this, args2, body, 0);
                }
              } else if (typeof args2 === "number") {
                if (args2 > 0) {
                  return batch.call(this, reserve(args2 | 0), args2 | 0);
                }
              } else if (Array.isArray(args2)) {
                if (args2.length) {
                  return batch.call(this, args2, args2.length);
                }
              } else {
                return draw.call(this, args2);
              }
            }
            return extend(REGLCommand, {
              stats: stats$$12,
              destroy: function() {
                compiled.destroy();
              }
            });
          }
          var setFBO = framebufferState.setFBO = compileProcedure({
            framebuffer: dynamic.define.call(null, DYN_PROP, "framebuffer")
          });
          function clearImpl(_, options) {
            var clearFlags = 0;
            core.procs.poll();
            var c = options.color;
            if (c) {
              gl.clearColor(+c[0] || 0, +c[1] || 0, +c[2] || 0, +c[3] || 0);
              clearFlags |= GL_COLOR_BUFFER_BIT;
            }
            if ("depth" in options) {
              gl.clearDepth(+options.depth);
              clearFlags |= GL_DEPTH_BUFFER_BIT;
            }
            if ("stencil" in options) {
              gl.clearStencil(options.stencil | 0);
              clearFlags |= GL_STENCIL_BUFFER_BIT;
            }
            check$1(!!clearFlags, "called regl.clear with no buffer specified");
            gl.clear(clearFlags);
          }
          function clear(options) {
            check$1(
              typeof options === "object" && options,
              "regl.clear() takes an object as input"
            );
            if ("framebuffer" in options) {
              if (options.framebuffer && options.framebuffer_reglType === "framebufferCube") {
                for (var i = 0; i < 6; ++i) {
                  setFBO(extend({
                    framebuffer: options.framebuffer.faces[i]
                  }, options), clearImpl);
                }
              } else {
                setFBO(options, clearImpl);
              }
            } else {
              clearImpl(null, options);
            }
          }
          function frame(cb) {
            check$1.type(cb, "function", "regl.frame() callback must be a function");
            rafCallbacks.push(cb);
            function cancel() {
              var i = find(rafCallbacks, cb);
              check$1(i >= 0, "cannot cancel a frame twice");
              function pendingCancel() {
                var index = find(rafCallbacks, pendingCancel);
                rafCallbacks[index] = rafCallbacks[rafCallbacks.length - 1];
                rafCallbacks.length -= 1;
                if (rafCallbacks.length <= 0) {
                  stopRAF();
                }
              }
              rafCallbacks[i] = pendingCancel;
            }
            startRAF();
            return {
              cancel
            };
          }
          function pollViewport() {
            var viewport = nextState.viewport;
            var scissorBox = nextState.scissor_box;
            viewport[0] = viewport[1] = scissorBox[0] = scissorBox[1] = 0;
            contextState.viewportWidth = contextState.framebufferWidth = contextState.drawingBufferWidth = viewport[2] = scissorBox[2] = gl.drawingBufferWidth;
            contextState.viewportHeight = contextState.framebufferHeight = contextState.drawingBufferHeight = viewport[3] = scissorBox[3] = gl.drawingBufferHeight;
          }
          function poll() {
            contextState.tick += 1;
            contextState.time = now();
            pollViewport();
            core.procs.poll();
          }
          function refresh() {
            textureState.refresh();
            pollViewport();
            core.procs.refresh();
            if (timer) {
              timer.update();
            }
          }
          function now() {
            return (clock() - START_TIME) / 1e3;
          }
          refresh();
          function addListener(event, callback) {
            check$1.type(callback, "function", "listener callback must be a function");
            var callbacks;
            switch (event) {
              case "frame":
                return frame(callback);
              case "lost":
                callbacks = lossCallbacks;
                break;
              case "restore":
                callbacks = restoreCallbacks;
                break;
              case "destroy":
                callbacks = destroyCallbacks;
                break;
              default:
                check$1.raise("invalid event, must be one of frame,lost,restore,destroy");
            }
            callbacks.push(callback);
            return {
              cancel: function() {
                for (var i = 0; i < callbacks.length; ++i) {
                  if (callbacks[i] === callback) {
                    callbacks[i] = callbacks[callbacks.length - 1];
                    callbacks.pop();
                    return;
                  }
                }
              }
            };
          }
          var regl = extend(compileProcedure, {
            // Clear current FBO
            clear,
            // Short cuts for dynamic variables
            prop: dynamic.define.bind(null, DYN_PROP),
            context: dynamic.define.bind(null, DYN_CONTEXT),
            this: dynamic.define.bind(null, DYN_STATE),
            // executes an empty draw command
            draw: compileProcedure({}),
            // Resources
            buffer: function(options) {
              return bufferState.create(options, GL_ARRAY_BUFFER, false, false);
            },
            elements: function(options) {
              return elementState.create(options, false);
            },
            texture: textureState.create2D,
            cube: textureState.createCube,
            renderbuffer: renderbufferState.create,
            framebuffer: framebufferState.create,
            framebufferCube: framebufferState.createCube,
            vao: attributeState.createVAO,
            // Expose context attributes
            attributes: glAttributes,
            // Frame rendering
            frame,
            on: addListener,
            // System limits
            limits,
            hasExtension: function(name) {
              return limits.extensions.indexOf(name.toLowerCase()) >= 0;
            },
            // Read pixels
            read: readPixels,
            // Destroy regl and all associated resources
            destroy,
            // Direct GL state manipulation
            _gl: gl,
            _refresh: refresh,
            poll: function() {
              poll();
              if (timer) {
                timer.update();
              }
            },
            // Current time
            now,
            // regl Statistics Information
            stats: stats$$1
          });
          config.onDone(null, regl);
          return regl;
        }
        return wrapREGL;
      }));
    }
  });

  // node_modules/regl-scatterplot/dist/regl-scatterplot.esm.js
  var regl_scatterplot_esm_exports = {};
  __export(regl_scatterplot_esm_exports, {
    checkSupport: () => checkReglExtensions,
    createRegl: () => createRegl,
    createRenderer: () => createRenderer,
    createSpatialIndex: () => createSpatialIndex,
    createTextureFromUrl: () => createTextureFromUrl,
    default: () => createScatterplot
  });
  function pipe(...fns) {
    return (x) => fns.reduce((y, f) => f(y), x);
  }
  function create$2() {
    var out = new ARRAY_TYPE(16);
    if (ARRAY_TYPE != Float32Array) {
      out[1] = 0;
      out[2] = 0;
      out[3] = 0;
      out[4] = 0;
      out[6] = 0;
      out[7] = 0;
      out[8] = 0;
      out[9] = 0;
      out[11] = 0;
      out[12] = 0;
      out[13] = 0;
      out[14] = 0;
    }
    out[0] = 1;
    out[5] = 1;
    out[10] = 1;
    out[15] = 1;
    return out;
  }
  function clone(a) {
    var out = new ARRAY_TYPE(16);
    out[0] = a[0];
    out[1] = a[1];
    out[2] = a[2];
    out[3] = a[3];
    out[4] = a[4];
    out[5] = a[5];
    out[6] = a[6];
    out[7] = a[7];
    out[8] = a[8];
    out[9] = a[9];
    out[10] = a[10];
    out[11] = a[11];
    out[12] = a[12];
    out[13] = a[13];
    out[14] = a[14];
    out[15] = a[15];
    return out;
  }
  function invert(out, a) {
    var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];
    var a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];
    var a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];
    var a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];
    var b00 = a00 * a11 - a01 * a10;
    var b01 = a00 * a12 - a02 * a10;
    var b02 = a00 * a13 - a03 * a10;
    var b03 = a01 * a12 - a02 * a11;
    var b04 = a01 * a13 - a03 * a11;
    var b05 = a02 * a13 - a03 * a12;
    var b06 = a20 * a31 - a21 * a30;
    var b07 = a20 * a32 - a22 * a30;
    var b08 = a20 * a33 - a23 * a30;
    var b09 = a21 * a32 - a22 * a31;
    var b10 = a21 * a33 - a23 * a31;
    var b11 = a22 * a33 - a23 * a32;
    var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;
    if (!det) {
      return null;
    }
    det = 1 / det;
    out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;
    out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;
    out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;
    out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;
    out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;
    out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;
    out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;
    out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;
    out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;
    out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;
    out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;
    out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;
    out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;
    out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;
    out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;
    out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;
    return out;
  }
  function multiply(out, a, b) {
    var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];
    var a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];
    var a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];
    var a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];
    var b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3];
    out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;
    out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;
    out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;
    out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;
    b0 = b[4];
    b1 = b[5];
    b2 = b[6];
    b3 = b[7];
    out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;
    out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;
    out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;
    out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;
    b0 = b[8];
    b1 = b[9];
    b2 = b[10];
    b3 = b[11];
    out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;
    out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;
    out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;
    out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;
    b0 = b[12];
    b1 = b[13];
    b2 = b[14];
    b3 = b[15];
    out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;
    out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;
    out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;
    out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;
    return out;
  }
  function fromTranslation(out, v) {
    out[0] = 1;
    out[1] = 0;
    out[2] = 0;
    out[3] = 0;
    out[4] = 0;
    out[5] = 1;
    out[6] = 0;
    out[7] = 0;
    out[8] = 0;
    out[9] = 0;
    out[10] = 1;
    out[11] = 0;
    out[12] = v[0];
    out[13] = v[1];
    out[14] = v[2];
    out[15] = 1;
    return out;
  }
  function fromScaling(out, v) {
    out[0] = v[0];
    out[1] = 0;
    out[2] = 0;
    out[3] = 0;
    out[4] = 0;
    out[5] = v[1];
    out[6] = 0;
    out[7] = 0;
    out[8] = 0;
    out[9] = 0;
    out[10] = v[2];
    out[11] = 0;
    out[12] = 0;
    out[13] = 0;
    out[14] = 0;
    out[15] = 1;
    return out;
  }
  function fromRotation(out, rad, axis) {
    var x = axis[0], y = axis[1], z = axis[2];
    var len = Math.sqrt(x * x + y * y + z * z);
    var s, c, t;
    if (len < EPSILON) {
      return null;
    }
    len = 1 / len;
    x *= len;
    y *= len;
    z *= len;
    s = Math.sin(rad);
    c = Math.cos(rad);
    t = 1 - c;
    out[0] = x * x * t + c;
    out[1] = y * x * t + z * s;
    out[2] = z * x * t - y * s;
    out[3] = 0;
    out[4] = x * y * t - z * s;
    out[5] = y * y * t + c;
    out[6] = z * y * t + x * s;
    out[7] = 0;
    out[8] = x * z * t + y * s;
    out[9] = y * z * t - x * s;
    out[10] = z * z * t + c;
    out[11] = 0;
    out[12] = 0;
    out[13] = 0;
    out[14] = 0;
    out[15] = 1;
    return out;
  }
  function getTranslation(out, mat) {
    out[0] = mat[12];
    out[1] = mat[13];
    out[2] = mat[14];
    return out;
  }
  function getScaling(out, mat) {
    var m11 = mat[0];
    var m12 = mat[1];
    var m13 = mat[2];
    var m21 = mat[4];
    var m22 = mat[5];
    var m23 = mat[6];
    var m31 = mat[8];
    var m32 = mat[9];
    var m33 = mat[10];
    out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);
    out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);
    out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);
    return out;
  }
  function create$1() {
    var out = new ARRAY_TYPE(4);
    if (ARRAY_TYPE != Float32Array) {
      out[0] = 0;
      out[1] = 0;
      out[2] = 0;
      out[3] = 0;
    }
    return out;
  }
  function transformMat4(out, a, m) {
    var x = a[0], y = a[1], z = a[2], w = a[3];
    out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;
    out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;
    out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;
    out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;
    return out;
  }
  function create() {
    var out = new ARRAY_TYPE(2);
    if (ARRAY_TYPE != Float32Array) {
      out[0] = 0;
      out[1] = 0;
    }
    return out;
  }
  function angle(a, b) {
    var ax = a[0], ay = a[1], bx = b[0], by = b[1];
    return Math.abs(Math.atan2(ay * bx - ax * by, ax * bx + ay * by));
  }
  function earcut(data, holeIndices, dim = 2) {
    const outerLen = data.length;
    let outerNode = linkedList(data, 0, outerLen, dim, true);
    const triangles = [];
    if (!outerNode || outerNode.next === outerNode.prev) return triangles;
    let minX, minY, invSize;
    if (data.length > 80 * dim) {
      minX = data[0];
      minY = data[1];
      let maxX = minX;
      let maxY = minY;
      for (let i = dim; i < outerLen; i += dim) {
        const x = data[i];
        const y = data[i + 1];
        if (x < minX) minX = x;
        if (y < minY) minY = y;
        if (x > maxX) maxX = x;
        if (y > maxY) maxY = y;
      }
      invSize = Math.max(maxX - minX, maxY - minY);
      invSize = invSize !== 0 ? 32767 / invSize : 0;
    }
    earcutLinked(outerNode, triangles, dim, minX, minY, invSize, 0);
    return triangles;
  }
  function linkedList(data, start, end, dim, clockwise) {
    let last;
    if (clockwise === signedArea(data, start, end, dim) > 0) {
      for (let i = start; i < end; i += dim) last = insertNode(i / dim | 0, data[i], data[i + 1], last);
    } else {
      for (let i = end - dim; i >= start; i -= dim) last = insertNode(i / dim | 0, data[i], data[i + 1], last);
    }
    if (last && equals(last, last.next)) {
      removeNode(last);
      last = last.next;
    }
    return last;
  }
  function filterPoints(start, end) {
    if (!start) return start;
    if (!end) end = start;
    let p = start, again;
    do {
      again = false;
      if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {
        removeNode(p);
        p = end = p.prev;
        if (p === p.next) break;
        again = true;
      } else {
        p = p.next;
      }
    } while (again || p !== end);
    return end;
  }
  function earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) {
    if (!ear) return;
    if (!pass && invSize) indexCurve(ear, minX, minY, invSize);
    let stop = ear;
    while (ear.prev !== ear.next) {
      const prev = ear.prev;
      const next = ear.next;
      if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {
        triangles.push(prev.i, ear.i, next.i);
        removeNode(ear);
        ear = next.next;
        stop = next.next;
        continue;
      }
      ear = next;
      if (ear === stop) {
        if (!pass) {
          earcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1);
        } else if (pass === 1) {
          ear = cureLocalIntersections(filterPoints(ear), triangles);
          earcutLinked(ear, triangles, dim, minX, minY, invSize, 2);
        } else if (pass === 2) {
          splitEarcut(ear, triangles, dim, minX, minY, invSize);
        }
        break;
      }
    }
  }
  function isEar(ear) {
    const a = ear.prev, b = ear, c = ear.next;
    if (area(a, b, c) >= 0) return false;
    const ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;
    const x0 = Math.min(ax, bx, cx), y0 = Math.min(ay, by, cy), x1 = Math.max(ax, bx, cx), y1 = Math.max(ay, by, cy);
    let p = c.next;
    while (p !== a) {
      if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;
      p = p.next;
    }
    return true;
  }
  function isEarHashed(ear, minX, minY, invSize) {
    const a = ear.prev, b = ear, c = ear.next;
    if (area(a, b, c) >= 0) return false;
    const ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;
    const x0 = Math.min(ax, bx, cx), y0 = Math.min(ay, by, cy), x1 = Math.max(ax, bx, cx), y1 = Math.max(ay, by, cy);
    const minZ = zOrder(x0, y0, minX, minY, invSize), maxZ = zOrder(x1, y1, minX, minY, invSize);
    let p = ear.prevZ, n = ear.nextZ;
    while (p && p.z >= minZ && n && n.z <= maxZ) {
      if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c && pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;
      p = p.prevZ;
      if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c && pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;
      n = n.nextZ;
    }
    while (p && p.z >= minZ) {
      if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c && pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;
      p = p.prevZ;
    }
    while (n && n.z <= maxZ) {
      if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c && pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;
      n = n.nextZ;
    }
    return true;
  }
  function cureLocalIntersections(start, triangles) {
    let p = start;
    do {
      const a = p.prev, b = p.next.next;
      if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {
        triangles.push(a.i, p.i, b.i);
        removeNode(p);
        removeNode(p.next);
        p = start = b;
      }
      p = p.next;
    } while (p !== start);
    return filterPoints(p);
  }
  function splitEarcut(start, triangles, dim, minX, minY, invSize) {
    let a = start;
    do {
      let b = a.next.next;
      while (b !== a.prev) {
        if (a.i !== b.i && isValidDiagonal(a, b)) {
          let c = splitPolygon(a, b);
          a = filterPoints(a, a.next);
          c = filterPoints(c, c.next);
          earcutLinked(a, triangles, dim, minX, minY, invSize, 0);
          earcutLinked(c, triangles, dim, minX, minY, invSize, 0);
          return;
        }
        b = b.next;
      }
      a = a.next;
    } while (a !== start);
  }
  function indexCurve(start, minX, minY, invSize) {
    let p = start;
    do {
      if (p.z === 0) p.z = zOrder(p.x, p.y, minX, minY, invSize);
      p.prevZ = p.prev;
      p.nextZ = p.next;
      p = p.next;
    } while (p !== start);
    p.prevZ.nextZ = null;
    p.prevZ = null;
    sortLinked(p);
  }
  function sortLinked(list) {
    let numMerges;
    let inSize = 1;
    do {
      let p = list;
      let e;
      list = null;
      let tail = null;
      numMerges = 0;
      while (p) {
        numMerges++;
        let q = p;
        let pSize = 0;
        for (let i = 0; i < inSize; i++) {
          pSize++;
          q = q.nextZ;
          if (!q) break;
        }
        let qSize = inSize;
        while (pSize > 0 || qSize > 0 && q) {
          if (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) {
            e = p;
            p = p.nextZ;
            pSize--;
          } else {
            e = q;
            q = q.nextZ;
            qSize--;
          }
          if (tail) tail.nextZ = e;
          else list = e;
          e.prevZ = tail;
          tail = e;
        }
        p = q;
      }
      tail.nextZ = null;
      inSize *= 2;
    } while (numMerges > 1);
    return list;
  }
  function zOrder(x, y, minX, minY, invSize) {
    x = (x - minX) * invSize | 0;
    y = (y - minY) * invSize | 0;
    x = (x | x << 8) & 16711935;
    x = (x | x << 4) & 252645135;
    x = (x | x << 2) & 858993459;
    x = (x | x << 1) & 1431655765;
    y = (y | y << 8) & 16711935;
    y = (y | y << 4) & 252645135;
    y = (y | y << 2) & 858993459;
    y = (y | y << 1) & 1431655765;
    return x | y << 1;
  }
  function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {
    return (cx - px) * (ay - py) >= (ax - px) * (cy - py) && (ax - px) * (by - py) >= (bx - px) * (ay - py) && (bx - px) * (cy - py) >= (cx - px) * (by - py);
  }
  function pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, px, py) {
    return !(ax === px && ay === py) && pointInTriangle(ax, ay, bx, by, cx, cy, px, py);
  }
  function isValidDiagonal(a, b) {
    return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // doesn't intersect other edges
    (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && // locally visible
    (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors
    equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0);
  }
  function area(p, q, r) {
    return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);
  }
  function equals(p1, p2) {
    return p1.x === p2.x && p1.y === p2.y;
  }
  function intersects(p1, q1, p2, q2) {
    const o1 = sign(area(p1, q1, p2));
    const o2 = sign(area(p1, q1, q2));
    const o3 = sign(area(p2, q2, p1));
    const o4 = sign(area(p2, q2, q1));
    if (o1 !== o2 && o3 !== o4) return true;
    if (o1 === 0 && onSegment(p1, p2, q1)) return true;
    if (o2 === 0 && onSegment(p1, q2, q1)) return true;
    if (o3 === 0 && onSegment(p2, p1, q2)) return true;
    if (o4 === 0 && onSegment(p2, q1, q2)) return true;
    return false;
  }
  function onSegment(p, q, r) {
    return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);
  }
  function sign(num) {
    return num > 0 ? 1 : num < 0 ? -1 : 0;
  }
  function intersectsPolygon(a, b) {
    let p = a;
    do {
      if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i && intersects(p, p.next, a, b)) return true;
      p = p.next;
    } while (p !== a);
    return false;
  }
  function locallyInside(a, b) {
    return area(a.prev, a, a.next) < 0 ? area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 : area(a, b, a.prev) < 0 || area(a, a.next, b) < 0;
  }
  function middleInside(a, b) {
    let p = a;
    let inside = false;
    const px = (a.x + b.x) / 2;
    const py = (a.y + b.y) / 2;
    do {
      if (p.y > py !== p.next.y > py && p.next.y !== p.y && px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x)
        inside = !inside;
      p = p.next;
    } while (p !== a);
    return inside;
  }
  function splitPolygon(a, b) {
    const a2 = createNode(a.i, a.x, a.y), b2 = createNode(b.i, b.x, b.y), an = a.next, bp = b.prev;
    a.next = b;
    b.prev = a;
    a2.next = an;
    an.prev = a2;
    b2.next = a2;
    a2.prev = b2;
    bp.next = b2;
    b2.prev = bp;
    return b2;
  }
  function insertNode(i, x, y, last) {
    const p = createNode(i, x, y);
    if (!last) {
      p.prev = p;
      p.next = p;
    } else {
      p.next = last.next;
      p.prev = last;
      last.next.prev = p;
      last.next = p;
    }
    return p;
  }
  function removeNode(p) {
    p.next.prev = p.prev;
    p.prev.next = p.next;
    if (p.prevZ) p.prevZ.nextZ = p.nextZ;
    if (p.nextZ) p.nextZ.prevZ = p.prevZ;
  }
  function createNode(i, x, y) {
    return {
      i,
      // vertex index in coordinates array
      x,
      y,
      // vertex coordinates
      prev: null,
      // previous and next vertex nodes in a polygon ring
      next: null,
      z: 0,
      // z-order curve value
      prevZ: null,
      // previous and next nodes in z-order
      nextZ: null,
      steiner: false
      // indicates whether this is a steiner point
    };
  }
  function signedArea(data, start, end, dim) {
    let sum = 0;
    for (let i = start, j = end - dim; i < end; i += dim) {
      sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);
      j = i;
    }
    return sum;
  }
  function bufferDuplicate(buffer, stride = 1, dupScale = 1) {
    const out = [];
    const component = new Array(stride * 2);
    for (let i = 0, il = buffer.length / stride; i < il; i++) {
      const index = i * stride;
      for (let j = 0; j < stride; j++) {
        const value = buffer[index + j];
        component[j] = value;
        component[j + stride] = value * dupScale;
      }
      push.apply(out, component);
    }
    return out;
  }
  function bufferCopyElement(buffer, sourceElementIndex, targetIndex, stride) {
    const component = new Array(stride);
    const ai = sourceElementIndex * stride;
    for (let i = 0; i < stride; i++) {
      component[i] = buffer[ai + i];
    }
    splice.call(buffer, targetIndex * stride, 0, ...component);
    return buffer;
  }
  function bufferIncreaseStride(buffer, stride, newStride, undefValue = 0) {
    const out = [];
    const component = new Array(newStride).fill(undefValue);
    for (let i = 0, il = buffer.length / stride; i < il; i++) {
      const index = i * stride;
      for (let j = 0; j < stride; j++) {
        component[j] = buffer[index + j];
      }
      push.apply(out, component);
    }
    return out;
  }
  function crossProduct(x1, y1, x2, y2, px, py) {
    return (x2 - x1) * (py - y1) - (px - x1) * (y2 - y1);
  }
  var import_regl, cubicIn, cubicInOut, cubicOut, linear, quadIn, quadInOut, quadOut, identity, hasSameElements, l2Norm, max$1, rangeMap, unionIntegers, assign, withConstructor, withStaticProperty, l2PointDist, createWorker$1, nextAnimationFrame, throttleAndDebounce, EPSILON, ARRAY_TYPE, createCamera, MOUSE_DOWN_MOVE_ACTIONS, KEY_MAP, dom2dCamera, FRAGMENT_SHADER$3, VERTEX_SHADER$1, I, FLOAT_BYTES$1, isPositiveNumber$1, isNestedArray, push, splice, createMesh, createLine, version, FRAGMENT_SHADER$2, VERTEX_SHADER, AUTO, COLOR_NORMAL_IDX, COLOR_ACTIVE_IDX, COLOR_HOVER_IDX, COLOR_BG_IDX, COLOR_NUM_STATES, FLOAT_BYTES, GL_EXTENSIONS, CLEAR_OPTIONS, MOUSE_MODE_PANZOOM, MOUSE_MODE_LASSO, MOUSE_MODE_ROTATE, MOUSE_MODES, DEFAULT_MOUSE_MODE, EASING_FNS, DEFAULT_EASING, CONTINUOUS, CATEGORICAL, VALUE_ZW_DATA_TYPES, LASSO_CLEAR_ON_DESELECT, LASSO_CLEAR_ON_END, LASSO_CLEAR_EVENTS, LASSO_BRUSH_MIN_MIN_DIST, DEFAULT_LASSO_COLOR, DEFAULT_LASSO_LINE_WIDTH, DEFAULT_LASSO_INITIATOR, DEFAULT_LASSO_MIN_DELAY$1, DEFAULT_LASSO_MIN_DIST$1, DEFAULT_LASSO_CLEAR_EVENT, DEFAULT_LASSO_ON_LONG_PRESS, DEFAULT_LASSO_LONG_PRESS_TIME, DEFAULT_LASSO_LONG_PRESS_AFTER_EFFECT_TIME, DEFAULT_LASSO_LONG_PRESS_EFFECT_DELAY, DEFAULT_LASSO_LONG_PRESS_REVERT_EFFECT_TIME, DEFAULT_LASSO_BRUSH_SIZE, KEY_ACTION_LASSO, KEY_ACTION_ROTATE, KEY_ACTION_MERGE, KEY_ACTION_REMOVE, KEY_ACTIONS, KEY_ALT, KEY_CMD, KEY_CTRL, KEY_META, KEY_SHIFT, KEYS, DEFAULT_ACTION_KEY_MAP, DEFAULT_DATA_ASPECT_RATIO, DEFAULT_WIDTH, DEFAULT_HEIGHT, DEFAULT_GAMMA, MIN_POINT_SIZE, DEFAULT_POINT_SCALE_MODE, DEFAULT_POINT_SIZE, DEFAULT_POINT_SIZE_SELECTED, DEFAULT_POINT_OUTLINE_WIDTH, DEFAULT_SIZE_BY, DEFAULT_POINT_CONNECTION_SIZE, DEFAULT_POINT_CONNECTION_SIZE_ACTIVE, DEFAULT_POINT_CONNECTION_SIZE_BY, DEFAULT_POINT_CONNECTION_OPACITY, DEFAULT_POINT_CONNECTION_OPACITY_BY, DEFAULT_POINT_CONNECTION_OPACITY_ACTIVE, DEFAULT_OPACITY, DEFAULT_OPACITY_BY, DEFAULT_OPACITY_BY_DENSITY_FILL, DEFAULT_OPACITY_BY_DENSITY_DEBOUNCE_TIME, DEFAULT_OPACITY_INACTIVE_MAX, DEFAULT_OPACITY_INACTIVE_SCALE, DEFAULT_COLOR_BY, DEFAULT_COLOR_NORMAL, DEFAULT_COLOR_ACTIVE, DEFAULT_COLOR_HOVER, DEFAULT_COLOR_BG, DEFAULT_POINT_CONNECTION_COLOR_BY, DEFAULT_POINT_CONNECTION_COLOR_NORMAL, DEFAULT_POINT_CONNECTION_COLOR_ACTIVE, DEFAULT_POINT_CONNECTION_COLOR_HOVER, DEFAULT_ANNOTATION_LINE_COLOR, DEFAULT_ANNOTATION_LINE_WIDTH, DEFAULT_ANNOTATION_HVLINE_LIMIT, DEFAULT_TARGET, DEFAULT_DISTANCE, DEFAULT_ROTATION, DEFAULT_VIEW, IMAGE_LOAD_ERROR, DEFAULT_BACKGROUND_IMAGE, DEFAULT_SHOW_RETICLE, DEFAULT_RETICLE_COLOR, DEFAULT_DESELECT_ON_DBL_CLICK, DEFAULT_DESELECT_ON_ESCAPE, DEFAULT_SHOW_POINT_CONNECTIONS, DEFAULT_POINT_CONNECTION_MAX_INT_POINTS_PER_SEGMENT, DEFAULT_POINT_CONNECTION_INT_POINTS_TOLERANCE, DEFAULT_POINT_SIZE_MOUSE_DETECTION, DEFAULT_PERFORMANCE_MODE, SINGLE_CLICK_DELAY, LONG_CLICK_TIME, Z_NAMES, W_NAMES, DEFAULT_IMAGE_LOAD_TIMEOUT, DEFAULT_SPATIAL_INDEX_USE_WORKER, DEFAULT_CAMERA_IS_FIXED, DEFAULT_ANTI_ALIASING, DEFAULT_PIXEL_ALIGNED, DEFAULT_LASSO_TYPE$1, SKIP_DEPRECATION_VALUE_TRANSLATION, ERROR_POINTS_NOT_DRAWN, ERROR_INSTANCE_IS_DESTROYED, ERROR_IS_DRAWING, createKDBushClass, workerFn, KDBush$1, WORKER_THRESHOLD, createWorker, createKdbush, DEFAULT_LASSO_START_INITIATOR_SHOW, DEFAULT_LASSO_MIN_DELAY, DEFAULT_LASSO_MIN_DIST, DEFAULT_LASSO_TYPE, DEFAULT_BRUSH_SIZE, LASSO_SHOW_START_INITIATOR_TIME, LASSO_HIDE_START_INITIATOR_TIME, getInTime, getMainInAnimation, getEffectInAnimation, getCircleLeftInAnimation, getCircleRightInAnimation, getCircleInAnimation, getMainIn, getEffectIn, getCircleIn, getCircleLeftIn, getCircleRightIn, createLongPressInAnimations, getMainOutAnimation, getEffectOutAnimation, getCircleLeftOutAnimation, getCircleRightOutAnimation, getCircleOutAnimation, getMainOut, getEffectOut, getCircleRightOut, getCircleLeftOut, getCircleOut, createLongPressOutAnimations, createLongPressElements, exponentialMovingAverage, ifNotNull, cachedLassoStylesheets, getLassoStylesheets, addRule, removeRule, inAnimation, createInAnimationRule, inAnimationRuleIndex, outAnimation, createOutAnimationRule, outAnimationRuleIndex, createLasso, FRAGMENT_SHADER$1, createVertexShader, FRAGMENT_SHADER, SHADER$1, SHADER, checkReglExtensions, createRegl, dist, getBBox, isValidBBox, REGEX_HEX_TO_RGB, hexToRgb, isConditionalArray, isPositiveNumber, isStrictlyPositiveNumber, limit, loadImage, createTextureFromUrl, hexToRgba, REGEX_IS_HEX, isHex, isNormFloat, isNormFloatArray, isPointInPolygon, isString2, isUint8, isUint8Array, isRgb, isRgba, isMultipleColors, isSameRgbas, max, min, toRgba, flipObj, rgbBrightness, clip, toArrayOrientedPoints, isHorizontalLine, isVerticalLine, isDomRect, isRect, isPolygonAnnotation, isVertices, verticesToPolygon, insertionSort, createRenderer, worker, createSplineCurve, deprecations, checkDeprecations, getEncodingType, getEncodingIdx, createScatterplot, createSpatialIndex;
  var init_regl_scatterplot_esm = __esm({
    "node_modules/regl-scatterplot/dist/regl-scatterplot.esm.js"() {
      init_dist();
      import_regl = __toESM(require_regl(), 1);
      cubicIn = (t) => t * t * t;
      cubicInOut = (t) => t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;
      cubicOut = (t) => --t * t * t + 1;
      linear = (t) => t;
      quadIn = (t) => t * t;
      quadInOut = (t) => t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
      quadOut = (t) => t * (2 - t);
      identity = (x) => x;
      hasSameElements = (a, b) => {
        if (a === b) {
          return true;
        }
        if (a.length !== b.length) {
          return false;
        }
        const aSet = new Set(a);
        const bSet = new Set(b);
        if (aSet.size !== bSet.size) {
          return false;
        }
        return b.every((element) => aSet.has(element));
      };
      l2Norm = (v) => Math.sqrt(v.reduce((sum, x) => sum + x ** 2, 0));
      max$1 = (v) => v.reduce((_max, a) => a > _max ? a : _max, Number.NEGATIVE_INFINITY);
      rangeMap = (length, mapFn = identity) => {
        const out = [];
        for (let i = 0; i < length; i++) {
          out.push(mapFn(i, length));
        }
        return out;
      };
      unionIntegers = (v, w) => {
        const a = [];
        v.forEach((x) => {
          a[x] = true;
        });
        w.forEach((x) => {
          a[x] = true;
        });
        return a.reduce((union, value, i) => {
          if (value)
            union.push(i);
          return union;
        }, []);
      };
      assign = (target, ...sources) => {
        sources.forEach((source) => {
          const descriptors = Object.keys(source).reduce((descriptors2, key) => {
            descriptors2[key] = Object.getOwnPropertyDescriptor(source, key);
            return descriptors2;
          }, {});
          Object.getOwnPropertySymbols(source).forEach((symbol) => {
            const descriptor = Object.getOwnPropertyDescriptor(source, symbol);
            if (descriptor?.enumerable) {
              descriptors[symbol] = descriptor;
            }
          });
          Object.defineProperties(target, descriptors);
        });
        return target;
      };
      withConstructor = (constructorFn) => (self2) => assign({
        __proto__: {
          constructor: constructorFn
        }
      }, self2);
      withStaticProperty = (name, value) => (self2) => assign(self2, {
        get [name]() {
          return value;
        }
      });
      l2PointDist = (fromX, fromY, toX, toY) => Math.sqrt((fromX - toX) ** 2 + (fromY - toY) ** 2);
      createWorker$1 = (fn) => new Worker(window.URL.createObjectURL(new Blob([`(${fn.toString()})()`], { type: "text/javascript" })));
      nextAnimationFrame = (n = 1) => new Promise((resolve) => {
        let i = 0;
        const raf = () => requestAnimationFrame(() => {
          i++;
          if (i < n)
            raf();
          else
            resolve(void 0);
        });
        raf();
      });
      throttleAndDebounce = (fn, throttleTime, debounceTime) => {
        let timeout;
        let blockedCalls = 0;
        debounceTime = debounceTime === null ? throttleTime : debounceTime;
        const debounced = (...args) => {
          const later = () => {
            if (blockedCalls > 0) {
              fn(...args);
              blockedCalls = 0;
            }
          };
          clearTimeout(timeout);
          timeout = setTimeout(later, debounceTime);
        };
        let isWaiting = false;
        const throttledAndDebounced = (...args) => {
          if (isWaiting) {
            blockedCalls++;
            debounced(...args);
          } else {
            fn(...args);
            debounced(...args);
            isWaiting = true;
            blockedCalls = 0;
            setTimeout(() => {
              isWaiting = false;
            }, throttleTime);
          }
        };
        throttledAndDebounced.reset = () => {
          isWaiting = false;
        };
        throttledAndDebounced.cancel = () => {
          clearTimeout(timeout);
        };
        throttledAndDebounced.now = (...args) => fn(...args);
        return throttledAndDebounced;
      };
      EPSILON = 1e-6;
      ARRAY_TYPE = typeof Float32Array !== "undefined" ? Float32Array : Array;
      (function() {
        var vec = create$1();
        return function(a, stride, offset, count, fn, arg) {
          var i, l;
          if (!stride) {
            stride = 4;
          }
          if (!offset) {
            offset = 0;
          }
          if (count) {
            l = Math.min(count * stride + offset, a.length);
          } else {
            l = a.length;
          }
          for (i = offset; i < l; i += stride) {
            vec[0] = a[i];
            vec[1] = a[i + 1];
            vec[2] = a[i + 2];
            vec[3] = a[i + 3];
            fn(vec, vec, arg);
            a[i] = vec[0];
            a[i + 1] = vec[1];
            a[i + 2] = vec[2];
            a[i + 3] = vec[3];
          }
          return a;
        };
      })();
      (function() {
        var vec = create();
        return function(a, stride, offset, count, fn, arg) {
          var i, l;
          if (!stride) {
            stride = 2;
          }
          if (!offset) {
            offset = 0;
          }
          if (count) {
            l = Math.min(count * stride + offset, a.length);
          } else {
            l = a.length;
          }
          for (i = offset; i < l; i += stride) {
            vec[0] = a[i];
            vec[1] = a[i + 1];
            fn(vec, vec, arg);
            a[i] = vec[0];
            a[i + 1] = vec[1];
          }
          return a;
        };
      })();
      createCamera = (initTarget = [0, 0], initDistance = 1, initRotation = 0, initViewCenter = [0, 0], initScaleBounds = [
        [0, Infinity],
        [0, Infinity]
      ], initTranslationBounds = [
        [-Infinity, Infinity],
        [-Infinity, Infinity]
      ]) => {
        const scratch0 = new Float32Array(16);
        const scratch1 = new Float32Array(16);
        const scratch2 = new Float32Array(16);
        let view = create$2();
        let viewCenter = [...initViewCenter.slice(0, 2), 0, 1];
        const scaleXBounds = Array.isArray(initScaleBounds[0]) ? [...initScaleBounds[0]] : [...initScaleBounds];
        const scaleYBounds = Array.isArray(initScaleBounds[0]) ? [...initScaleBounds[1]] : [...initScaleBounds];
        const translationXBounds = Array.isArray(initTranslationBounds[0]) ? [...initTranslationBounds[0]] : [...initTranslationBounds];
        const translationYBounds = Array.isArray(initTranslationBounds[0]) ? [...initTranslationBounds[1]] : [...initTranslationBounds];
        const getScaling$1 = () => getScaling(scratch0, view).slice(0, 2);
        const getMinScaling = () => {
          const scaling = getScaling$1();
          return Math.min(scaling[0], scaling[1]);
        };
        const getMaxScaling = () => {
          const scaling = getScaling$1();
          return Math.max(scaling[0], scaling[1]);
        };
        const getRotation = () => Math.acos(view[0] / getMaxScaling());
        const getScaleBounds = () => [[...scaleXBounds], [...scaleYBounds]];
        const getTranslationBounds = () => [
          [...translationXBounds],
          [...translationYBounds]
        ];
        const getDistance = () => {
          const scaling = getScaling$1();
          return [1 / scaling[0], 1 / scaling[1]];
        };
        const getMinDistance = () => 1 / getMinScaling();
        const getMaxDistance = () => 1 / getMaxScaling();
        const getTranslation$1 = () => getTranslation(scratch0, view).slice(0, 2);
        const getTarget = () => transformMat4(scratch0, viewCenter, invert(scratch2, view)).slice(0, 2);
        const getView = () => view;
        const getViewCenter = () => viewCenter.slice(0, 2);
        const lookAt = ([x = 0, y = 0] = [], newDistance = 1, newRotation = 0) => {
          view = create$2();
          translate([-x, -y]);
          rotate(newRotation);
          scale(1 / newDistance);
        };
        const translate = ([x = 0, y = 0] = []) => {
          scratch0[0] = x;
          scratch0[1] = y;
          scratch0[2] = 0;
          const t = fromTranslation(scratch1, scratch0);
          multiply(view, t, view);
        };
        const scale = (d, mousePos) => {
          const isArray = Array.isArray(d);
          let dx = isArray ? d[0] : d;
          let dy = isArray ? d[1] : d;
          if (dx <= 0 || dy <= 0 || dx === 1 && dy === 1) return;
          const scaling = getScaling$1();
          const newXScale = scaling[0] * dx;
          const newYScale = scaling[1] * dy;
          dx = Math.max(scaleXBounds[0], Math.min(newXScale, scaleXBounds[1])) / scaling[0];
          dy = Math.max(scaleYBounds[0], Math.min(newYScale, scaleYBounds[1])) / scaling[1];
          if (dx === 1 && dy === 1) return;
          scratch0[0] = dx;
          scratch0[1] = dy;
          scratch0[2] = 1;
          const s = fromScaling(scratch1, scratch0);
          const scaleCenter = mousePos ? [...mousePos, 0] : viewCenter;
          const a = fromTranslation(scratch0, scaleCenter);
          multiply(
            view,
            a,
            multiply(
              view,
              s,
              multiply(view, invert(scratch2, a), view)
            )
          );
        };
        const rotate = (rad) => {
          const r = create$2();
          fromRotation(r, rad, [0, 0, 1]);
          multiply(view, r, view);
        };
        const setScaleBounds = (newBounds) => {
          const isArray = Array.isArray(newBounds[0]);
          scaleXBounds[0] = isArray ? newBounds[0][0] : newBounds[0];
          scaleXBounds[1] = isArray ? newBounds[0][1] : newBounds[1];
          scaleYBounds[0] = isArray ? newBounds[1][0] : newBounds[0];
          scaleYBounds[1] = isArray ? newBounds[1][1] : newBounds[1];
        };
        const setTranslationBounds = (newBounds) => {
          const isArray = Array.isArray(newBounds[0]);
          translationXBounds[0] = isArray ? newBounds[0][0] : newBounds[0];
          translationXBounds[1] = isArray ? newBounds[0][1] : newBounds[1];
          translationYBounds[0] = isArray ? newBounds[1][0] : newBounds[0];
          translationYBounds[1] = isArray ? newBounds[1][1] : newBounds[1];
        };
        const setView = (newView) => {
          if (!newView || newView.length < 16) return;
          view = newView;
        };
        const setViewCenter = (newViewCenter) => {
          viewCenter = [...newViewCenter.slice(0, 2), 0, 1];
        };
        const reset = () => {
          lookAt(initTarget, initDistance, initRotation);
        };
        lookAt(initTarget, initDistance, initRotation);
        return {
          get translation() {
            return getTranslation$1();
          },
          get target() {
            return getTarget();
          },
          get scaling() {
            return getScaling$1();
          },
          get minScaling() {
            return getMinScaling();
          },
          get maxScaling() {
            return getMaxScaling();
          },
          get scaleBounds() {
            return getScaleBounds();
          },
          get translationBounds() {
            return getTranslationBounds();
          },
          get distance() {
            return getDistance();
          },
          get minDistance() {
            return getMinDistance();
          },
          get maxDistance() {
            return getMaxDistance();
          },
          get rotation() {
            return getRotation();
          },
          get view() {
            return getView();
          },
          get viewCenter() {
            return getViewCenter();
          },
          lookAt,
          translate,
          pan: translate,
          rotate,
          scale,
          zoom: scale,
          reset,
          set: (...args) => {
            console.warn("`set()` is deprecated. Please use `setView()` instead.");
            return setView(...args);
          },
          setScaleBounds,
          setTranslationBounds,
          setView,
          setViewCenter
        };
      };
      MOUSE_DOWN_MOVE_ACTIONS = ["pan", "rotate"];
      KEY_MAP = {
        alt: "altKey",
        cmd: "metaKey",
        ctrl: "ctrlKey",
        meta: "metaKey",
        shift: "shiftKey"
      };
      dom2dCamera = (element, {
        distance = 1,
        target = [0, 0],
        rotation = 0,
        isNdc = true,
        isFixed = false,
        isPan = true,
        isPanInverted = [false, true],
        panSpeed = 1,
        isRotate = true,
        rotateSpeed = 1,
        defaultMouseDownMoveAction = "pan",
        mouseDownMoveModKey = "alt",
        isZoom = true,
        zoomSpeed = 1,
        viewCenter,
        scaleBounds,
        translationBounds,
        onKeyDown = () => {
        },
        onKeyUp = () => {
        },
        onMouseDown = () => {
        },
        onMouseUp = () => {
        },
        onMouseMove = () => {
        },
        onWheel = () => {
        }
      } = {}) => {
        let camera = createCamera(
          target,
          distance,
          rotation,
          viewCenter,
          scaleBounds,
          translationBounds
        );
        let mouseX = 0;
        let mouseY = 0;
        let mouseRelX = 0;
        let mouseRelY = 0;
        let prevMouseX = 0;
        let prevMouseY = 0;
        let isLeftMousePressed = false;
        let scrollDist = 0;
        let width = 1;
        let height = 1;
        let aspectRatio = 1;
        let isInteractivelyChanged = false;
        let isProgrammaticallyChanged = false;
        let isMouseDownMoveModActive = false;
        let panOnMouseDownMove = defaultMouseDownMoveAction === "pan";
        let isPanX = isPan;
        let isPanY = isPan;
        let isPanXInverted = isPanInverted;
        let isPanYInverted = isPanInverted;
        let isZoomX = isZoom;
        let isZoomY = isZoom;
        const spreadXYSettings = () => {
          isPanX = Array.isArray(isPan) ? Boolean(isPan[0]) : isPan;
          isPanY = Array.isArray(isPan) ? Boolean(isPan[1]) : isPan;
          isPanXInverted = Array.isArray(isPanInverted) ? Boolean(isPanInverted[0]) : isPanInverted;
          isPanYInverted = Array.isArray(isPanInverted) ? Boolean(isPanInverted[1]) : isPanInverted;
          isZoomX = Array.isArray(isZoom) ? Boolean(isZoom[0]) : isZoom;
          isZoomY = Array.isArray(isZoom) ? Boolean(isZoom[1]) : isZoom;
        };
        spreadXYSettings();
        const transformPanX = isNdc ? (dX) => dX / width * 2 * aspectRatio : (dX) => dX;
        const transformPanY = isNdc ? (dY) => dY / height * 2 : (dY) => -dY;
        const transformScaleX = isNdc ? (x) => (-1 + x / width * 2) * aspectRatio : (x) => x;
        const transformScaleY = isNdc ? (y) => 1 - y / height * 2 : (y) => y;
        const tick = () => {
          if (isFixed) {
            const isChanged2 = isProgrammaticallyChanged;
            isProgrammaticallyChanged = false;
            return isChanged2;
          }
          isInteractivelyChanged = false;
          const currentMouseX = mouseX;
          const currentMouseY = mouseY;
          if ((isPanX || isPanY) && isLeftMousePressed && (panOnMouseDownMove && !isMouseDownMoveModActive || !panOnMouseDownMove && isMouseDownMoveModActive)) {
            const dX = isPanXInverted ? prevMouseX - currentMouseX : currentMouseX - prevMouseX;
            const transformedPanX = isPanX ? transformPanX(panSpeed * dX) : 0;
            const dY = isPanYInverted ? prevMouseY - currentMouseY : currentMouseY - prevMouseY;
            const transformedPanY = isPanY ? transformPanY(panSpeed * dY) : 0;
            if (transformedPanX !== 0 || transformedPanY !== 0) {
              camera.pan([transformedPanX, transformedPanY]);
              isInteractivelyChanged = true;
            }
          }
          if ((isZoomX || isZoomY) && scrollDist) {
            const dZ = zoomSpeed * Math.exp(scrollDist / height);
            const transformedX = transformScaleX(mouseRelX);
            const transformedY = transformScaleY(mouseRelY);
            camera.scale(
              [isZoomX ? 1 / dZ : 1, isZoomY ? 1 / dZ : 1],
              [transformedX, transformedY]
            );
            isInteractivelyChanged = true;
          }
          if (isRotate && isLeftMousePressed && (panOnMouseDownMove && isMouseDownMoveModActive || !panOnMouseDownMove && !isMouseDownMoveModActive) && Math.abs(prevMouseX - currentMouseX) + Math.abs(prevMouseY - currentMouseY) > 0) {
            const wh = width / 2;
            const hh = height / 2;
            const x1 = prevMouseX - wh;
            const y1 = hh - prevMouseY;
            const x2 = currentMouseX - wh;
            const y2 = hh - currentMouseY;
            const radians = angle([x1, y1], [x2, y2]);
            const cross = x1 * y2 - x2 * y1;
            camera.rotate(rotateSpeed * radians * Math.sign(cross));
            isInteractivelyChanged = true;
          }
          scrollDist = 0;
          prevMouseX = currentMouseX;
          prevMouseY = currentMouseY;
          const isChanged = isInteractivelyChanged || isProgrammaticallyChanged;
          isProgrammaticallyChanged = false;
          return isChanged;
        };
        const config = ({
          defaultMouseDownMoveAction: newDefaultMouseDownMoveAction = null,
          isFixed: newIsFixed = null,
          isPan: newIsPan = null,
          isPanInverted: newIsPanInverted = null,
          isRotate: newIsRotate = null,
          isZoom: newIsZoom = null,
          panSpeed: newPanSpeed = null,
          rotateSpeed: newRotateSpeed = null,
          zoomSpeed: newZoomSpeed = null,
          mouseDownMoveModKey: newMouseDownMoveModKey = null
        } = {}) => {
          defaultMouseDownMoveAction = newDefaultMouseDownMoveAction !== null && MOUSE_DOWN_MOVE_ACTIONS.includes(newDefaultMouseDownMoveAction) ? newDefaultMouseDownMoveAction : defaultMouseDownMoveAction;
          panOnMouseDownMove = defaultMouseDownMoveAction === "pan";
          isFixed = newIsFixed !== null ? newIsFixed : isFixed;
          isPan = newIsPan !== null ? newIsPan : isPan;
          isPanInverted = newIsPanInverted !== null ? newIsPanInverted : isPanInverted;
          isRotate = newIsRotate !== null ? newIsRotate : isRotate;
          isZoom = newIsZoom !== null ? newIsZoom : isZoom;
          panSpeed = +newPanSpeed > 0 ? newPanSpeed : panSpeed;
          rotateSpeed = +newRotateSpeed > 0 ? newRotateSpeed : rotateSpeed;
          zoomSpeed = +newZoomSpeed > 0 ? newZoomSpeed : zoomSpeed;
          spreadXYSettings();
          mouseDownMoveModKey = newMouseDownMoveModKey !== null && Object.keys(KEY_MAP).includes(newMouseDownMoveModKey) ? newMouseDownMoveModKey : mouseDownMoveModKey;
        };
        const refresh = () => {
          const bBox = element.getBoundingClientRect();
          width = bBox.width;
          height = bBox.height;
          aspectRatio = width / height;
        };
        const keyUpHandler = (event) => {
          isMouseDownMoveModActive = false;
          onKeyUp(event);
        };
        const keyDownHandler = (event) => {
          isMouseDownMoveModActive = event[KEY_MAP[mouseDownMoveModKey]];
          onKeyDown(event);
        };
        const mouseUpHandler = (event) => {
          isLeftMousePressed = false;
          onMouseUp(event);
        };
        const mouseDownHandler = (event) => {
          isLeftMousePressed = event.buttons === 1;
          onMouseDown(event);
        };
        const offsetXSupport = document.createEvent("MouseEvent").offsetX !== void 0;
        const updateMouseRelXY = offsetXSupport ? (event) => {
          mouseRelX = event.offsetX;
          mouseRelY = event.offsetY;
        } : (event) => {
          const bBox = element.getBoundingClientRect();
          mouseRelX = event.clientX - bBox.left;
          mouseRelY = event.clientY - bBox.top;
        };
        const updateMouseXY = (event) => {
          mouseX = event.clientX;
          mouseY = event.clientY;
        };
        const mouseMoveHandler = (event) => {
          updateMouseXY(event);
          onMouseMove(event);
        };
        const wheelHandler = (event) => {
          if ((isZoomX || isZoomY) && !isFixed) {
            event.preventDefault();
            updateMouseXY(event);
            updateMouseRelXY(event);
            const scale = event.deltaMode === 1 ? 12 : 1;
            scrollDist += scale * (event.deltaY || event.deltaX || 0);
          }
          onWheel(event);
        };
        const dispose = () => {
          camera = void 0;
          window.removeEventListener("keydown", keyDownHandler);
          window.removeEventListener("keyup", keyUpHandler);
          element.removeEventListener("mousedown", mouseDownHandler);
          window.removeEventListener("mouseup", mouseUpHandler);
          window.removeEventListener("mousemove", mouseMoveHandler);
          element.removeEventListener("wheel", wheelHandler);
        };
        window.addEventListener("keydown", keyDownHandler, { passive: true });
        window.addEventListener("keyup", keyUpHandler, { passive: true });
        element.addEventListener("mousedown", mouseDownHandler, { passive: true });
        window.addEventListener("mouseup", mouseUpHandler, { passive: true });
        window.addEventListener("mousemove", mouseMoveHandler, { passive: true });
        element.addEventListener("wheel", wheelHandler, { passive: false });
        camera.config = config;
        camera.dispose = dispose;
        camera.refresh = refresh;
        camera.tick = tick;
        const withProgrammaticChange = (fn) => function() {
          fn.apply(null, arguments);
          isProgrammaticallyChanged = true;
        };
        camera.lookAt = withProgrammaticChange(camera.lookAt);
        camera.translate = withProgrammaticChange(camera.translate);
        camera.pan = withProgrammaticChange(camera.pan);
        camera.rotate = withProgrammaticChange(camera.rotate);
        camera.scale = withProgrammaticChange(camera.scale);
        camera.zoom = withProgrammaticChange(camera.zoom);
        camera.reset = withProgrammaticChange(camera.reset);
        camera.set = withProgrammaticChange(camera.set);
        camera.setScaleBounds = withProgrammaticChange(camera.setScaleBounds);
        camera.setTranslationBounds = withProgrammaticChange(
          camera.setTranslationBounds
        );
        camera.setView = withProgrammaticChange(camera.setView);
        camera.setViewCenter = withProgrammaticChange(camera.setViewCenter);
        refresh();
        return camera;
      };
      FRAGMENT_SHADER$3 = `
precision mediump float;
varying vec4 color;
void main() {
  gl_FragColor = color;
}`;
      VERTEX_SHADER$1 = `
uniform mat4 projectionViewModel;
uniform float aspectRatio;

uniform sampler2D colorTex;
uniform float colorTexRes;
uniform float colorTexEps;
uniform float width;
uniform float useOpacity;
uniform float useColorOpacity;
uniform int miter;

attribute vec3 prevPosition;
attribute vec3 currPosition;
attribute vec3 nextPosition;
attribute float opacity;
attribute float offsetScale;
attribute float colorIndex;

varying vec4 color;

void main() {
  vec2 aspectVec = vec2(aspectRatio, 1.0);
  vec4 prevProjected = projectionViewModel * vec4(prevPosition, 1.0);
  vec4 currProjected = projectionViewModel * vec4(currPosition, 1.0);
  vec4 nextProjected = projectionViewModel * vec4(nextPosition, 1.0);

  // get 2D screen space with W divide and aspect correction
  vec2 prevScreen = prevProjected.xy / prevProjected.w * aspectVec;
  vec2 currScreen = currProjected.xy / currProjected.w * aspectVec;
  vec2 nextScreen = nextProjected.xy / nextProjected.w * aspectVec;

  float len = width;

  // starting point uses (next - current)
  vec2 dir = vec2(0.0);
  if (currScreen == prevScreen) {
    dir = normalize(nextScreen - currScreen);
  }
  // ending point uses (current - previous)
  else if (currScreen == nextScreen) {
    dir = normalize(currScreen - prevScreen);
  }
  // somewhere in middle, needs a join
  else {
    // get directions from (C - B) and (B - A)
    vec2 dirA = normalize((currScreen - prevScreen));
    if (miter == 1) {
      vec2 dirB = normalize((nextScreen - currScreen));
      // now compute the miter join normal and length
      vec2 tangent = normalize(dirA + dirB);
      vec2 perp = vec2(-dirA.y, dirA.x);
      vec2 miter = vec2(-tangent.y, tangent.x);
      len = width / dot(miter, perp);
      dir = tangent;
    } else {
      dir = dirA;
    }
  }

  vec2 normal = vec2(-dir.y, dir.x) * len;
  normal.x /= aspectRatio;
  vec4 offset = vec4(normal * offsetScale, 0.0, 0.0);
  gl_Position = currProjected + offset;

  // Get color from texture
  float colorRowIndex = floor((colorIndex + colorTexEps) / colorTexRes);
  vec2 colorTexIndex = vec2(
    (colorIndex / colorTexRes) - colorRowIndex + colorTexEps,
    colorRowIndex / colorTexRes + colorTexEps
  );

  color = texture2D(colorTex, colorTexIndex);
  color.a = useColorOpacity * color.a + useOpacity * opacity;
}`;
      I = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
      FLOAT_BYTES$1 = Float32Array.BYTES_PER_ELEMENT;
      isPositiveNumber$1 = (n) => {
        return n !== void 0 && Number.isFinite(n);
      };
      isNestedArray = (arr) => {
        return arr.length > 0 && Array.isArray(arr[0]);
      };
      ({ push, splice } = Array.prototype);
      createMesh = (numPointsPerLine, buffer = []) => {
        let numPrevPoints = 0;
        for (const numPoints of numPointsPerLine) {
          for (let i = 0; i < numPoints - 1; i++) {
            const a = numPrevPoints + i * 2;
            const b = a + 1;
            const c = a + 2;
            const d = a + 3;
            buffer.push(a, b, c, c, b, d);
          }
          numPrevPoints += (numPoints + 2) * 2;
        }
        return buffer;
      };
      createLine = (regl, { projection = I, model = I, view = I, points = [], colorIndices = [], color = [0.8, 0.5, 0, 1], opacity = null, opacities = [], width = 1, widths = [], miter = true, is2d = false, zPos2d = 0 } = {}) => {
        if (!regl) {
          console.error("Regl instance is undefined.");
          return;
        }
        const pvm = new Float32Array(16);
        let numLines;
        let numPoints;
        let numPointsPerLine;
        let pointsPadded;
        let pointsDup;
        let colorIndicesDup;
        let opacitiesDup;
        let widthsDup;
        let indices;
        let pointBuffer;
        let opacityBuffer;
        let widthBuffer;
        let colorTex;
        let colorTexRes;
        let colorIndexBuffer;
        let attributes;
        let elements;
        let drawLine;
        let dim = is2d ? 2 : 3;
        const useOpacity = () => +(opacities.length === numPoints || opacity !== null);
        const init = () => {
          pointBuffer = regl.buffer();
          opacityBuffer = regl.buffer();
          widthBuffer = regl.buffer();
          colorIndexBuffer = regl.buffer();
          attributes = {
            prevPosition: {
              // Typing issue in Regl
              buffer: (() => pointBuffer),
              offset: 0,
              stride: FLOAT_BYTES$1 * 3
            },
            currPosition: {
              // Typing issue in Regl
              buffer: (() => pointBuffer),
              // note that each point is duplicated, hence we need to skip over the first two
              offset: FLOAT_BYTES$1 * 3 * 2,
              stride: FLOAT_BYTES$1 * 3
            },
            nextPosition: {
              // Typing issue in Regl
              buffer: (() => pointBuffer),
              // note that each point is duplicated, hence we need to skip over the first four
              offset: FLOAT_BYTES$1 * 3 * 4,
              stride: FLOAT_BYTES$1 * 3
            },
            opacity: {
              // Typing issue in Regl
              buffer: (() => opacityBuffer),
              // note that each point is duplicated, hence we need to skip over the first two
              offset: FLOAT_BYTES$1 * 2,
              stride: FLOAT_BYTES$1
            },
            offsetScale: {
              // Typing issue in Regl
              buffer: (() => widthBuffer),
              // note that each point is duplicated, hence we need to skip over the first two
              offset: FLOAT_BYTES$1 * 2,
              stride: FLOAT_BYTES$1
            },
            colorIndex: {
              // Typing issue in Regl
              buffer: (() => colorIndexBuffer),
              // note that each point is duplicated, hence we need to skip over the first two
              offset: FLOAT_BYTES$1 * 2,
              stride: FLOAT_BYTES$1
            }
          };
          elements = regl.elements();
          drawLine = regl({
            attributes,
            depth: { enable: !is2d },
            blend: {
              enable: true,
              func: {
                // biome-ignore lint/style/useNamingConvention: predefined property
                srcRGB: "src alpha",
                srcAlpha: "one",
                // biome-ignore lint/style/useNamingConvention: predefined property
                dstRGB: "one minus src alpha",
                dstAlpha: "one minus src alpha"
              }
            },
            uniforms: {
              projectionViewModel: (context, props) => {
                const projection2 = context.projection || props.projection;
                const model2 = context.model || props.model;
                const view2 = context.view || props.view;
                return multiply(pvm, projection2, multiply(pvm, view2, model2));
              },
              aspectRatio: ({ viewportWidth, viewportHeight }) => viewportWidth / viewportHeight,
              colorTex: () => colorTex,
              colorTexRes: () => colorTexRes,
              colorTexEps: () => 0.5 / colorTexRes,
              pixelRatio: ({ pixelRatio }) => pixelRatio,
              width: ({ pixelRatio, viewportHeight }) => width / viewportHeight * pixelRatio,
              useOpacity,
              useColorOpacity: () => Number(!useOpacity()),
              miter: Number(Boolean(miter))
            },
            elements: () => elements,
            vert: VERTEX_SHADER$1,
            frag: FRAGMENT_SHADER$3
          });
        };
        const prepare = () => {
          if (numLines === 1 && points.length % dim > 0) {
            console.warn(`The length of points (${numPoints}) does not match the dimensions (${dim}). Incomplete points are ignored.`);
          }
          pointsPadded = points.flat().slice(0, numPoints * dim);
          if (is2d) {
            pointsPadded = bufferIncreaseStride(pointsPadded, 2, 3, zPos2d);
          }
          if (colorIndices.length !== numPoints) {
            colorIndices = new Array(numPoints).fill(0);
          }
          if (widths.length !== numPoints) {
            widths = new Array(numPoints).fill(1);
          }
          const finalColorIndices = colorIndices.slice();
          const finalOpacities = opacities.length === numPoints ? opacities.slice() : new Array(numPoints).fill(opacity === null ? 1 : opacity);
          const finalWidths = widths.slice();
          let k = 0;
          for (const n of numPointsPerLine) {
            const lastPointIdx = k + n - 1;
            bufferCopyElement(pointsPadded, lastPointIdx, lastPointIdx, 3);
            bufferCopyElement(pointsPadded, k, k, 3);
            bufferCopyElement(finalColorIndices, lastPointIdx, lastPointIdx, 1);
            bufferCopyElement(finalColorIndices, k, k, 1);
            bufferCopyElement(finalOpacities, lastPointIdx, lastPointIdx, 1);
            bufferCopyElement(finalOpacities, k, k, 1);
            bufferCopyElement(finalWidths, lastPointIdx, lastPointIdx, 1);
            bufferCopyElement(finalWidths, k, k, 1);
            k += n + 2;
          }
          pointsDup = new Float32Array(bufferDuplicate(pointsPadded, 3));
          colorIndicesDup = bufferDuplicate(finalColorIndices);
          opacitiesDup = bufferDuplicate(finalOpacities);
          widthsDup = bufferDuplicate(finalWidths, 1, -1);
          indices = createMesh(numPointsPerLine);
          pointBuffer({
            usage: "dynamic",
            type: "float",
            length: pointsDup.length * FLOAT_BYTES$1,
            data: pointsDup
          });
          opacityBuffer({
            usage: "dynamic",
            type: "float",
            length: opacitiesDup.length * FLOAT_BYTES$1,
            data: opacitiesDup
          });
          widthBuffer({
            usage: "dynamic",
            type: "float",
            length: widthsDup.length * FLOAT_BYTES$1,
            data: widthsDup
          });
          colorIndexBuffer({
            usage: "dynamic",
            type: "float",
            length: colorIndicesDup.length * FLOAT_BYTES$1,
            data: colorIndicesDup
          });
          elements({
            primitive: "triangles",
            usage: "dynamic",
            type: indices.length > 2 ** 16 ? "uint32" : "uint16",
            data: indices
          });
        };
        const clear = () => {
          destroy();
          init();
        };
        const destroy = () => {
          points = [];
          pointsPadded = [];
          pointsDup = new Float32Array();
          widthsDup = [];
          indices = [];
          pointBuffer.destroy();
          widthBuffer.destroy();
          elements.destroy();
        };
        const draw = ({ projection: newProjection, model: newModel, view: newView } = {}) => {
          if (newProjection) {
            projection = newProjection;
          }
          if (newModel) {
            model = newModel;
          }
          if (newView) {
            view = newView;
          }
          if (points && points.length > 1) {
            drawLine({ projection, model, view });
          }
        };
        const getPerPointProperty = (property, newValues) => {
          const flatValues = newValues.flat(2);
          if (flatValues.length === numPoints) {
            return flatValues;
          }
          if (flatValues.length === numLines) {
            return numPointsPerLine.flatMap((n, i) => Array(n).fill(flatValues[i]));
          }
          return property;
        };
        const getPoints = () => points;
        const setPoints = (newPoints = [], { colorIndices: newColorIndices = colorIndices, opacities: newOpacities = opacities, widths: newWidths = widths, is2d: newIs2d = is2d } = {}) => {
          points = newPoints;
          is2d = newIs2d;
          dim = is2d ? 2 : 3;
          numLines = isNestedArray(points) ? points.length : 1;
          numPointsPerLine = isNestedArray(points) ? points.map((pts) => Math.floor(pts.length / dim)) : [Math.floor(points.length / dim)];
          numPoints = numPointsPerLine.reduce((n, nPts) => n + nPts, 0);
          colorIndices = getPerPointProperty(colorIndices, newColorIndices);
          opacities = getPerPointProperty(opacities, newOpacities);
          widths = getPerPointProperty(widths, newWidths);
          if (points && numPoints > 1) {
            prepare();
          } else {
            clear();
          }
        };
        const createColorTexture = () => {
          const colors = isNestedArray(color) ? color : [color];
          colorTexRes = Math.max(2, Math.ceil(Math.sqrt(colors.length)));
          const rgba = new Uint8Array(colorTexRes ** 2 * 4);
          colors.forEach((color2, i) => {
            rgba[i * 4] = Math.min(255, Math.max(0, Math.round(color2[0] * 255)));
            rgba[i * 4 + 1] = Math.min(255, Math.max(0, Math.round(color2[1] * 255)));
            rgba[i * 4 + 2] = Math.min(255, Math.max(0, Math.round(color2[2] * 255)));
            rgba[i * 4 + 3] = Number.isNaN(+color2[3]) ? 255 : Math.min(255, Math.max(0, Math.round(color2[3] * 255)));
          });
          colorTex = regl.texture({
            data: rgba,
            shape: [colorTexRes, colorTexRes, 4]
          });
        };
        const setColor = (newColor, newOpacity = opacity) => {
          color = newColor;
          opacity = newOpacity;
          if (colorTex) {
            colorTex.destroy();
          }
          createColorTexture();
        };
        const getStyle = () => ({ color, miter, width });
        const setStyle = ({ color: newColor, opacity: newOpacity, miter: newMiter, width: newWidth } = {}) => {
          if (newColor) {
            setColor(newColor, newOpacity || opacity);
          }
          if (newMiter) {
            miter = Boolean(newMiter);
          }
          if (isPositiveNumber$1(newWidth)) {
            width = newWidth;
          }
        };
        const getBuffer = () => ({
          points: pointBuffer,
          widths: widthBuffer,
          opacities: opacityBuffer,
          colorIndices: colorIndexBuffer
        });
        const getData = () => ({
          points: pointsDup,
          widths: widthsDup,
          opacities: opacitiesDup,
          colorIndices: colorIndicesDup
        });
        init();
        createColorTexture();
        if (points && points.length > 1) {
          setPoints(points);
        }
        return {
          clear,
          destroy,
          draw,
          getPoints,
          setPoints,
          getData,
          getBuffer,
          getStyle,
          setStyle
        };
      };
      version = "1.15.0";
      FRAGMENT_SHADER$2 = `
precision mediump float;

uniform sampler2D texture;

varying vec2 uv;

void main () {
  gl_FragColor = texture2D(texture, uv);
}
`;
      VERTEX_SHADER = `
precision mediump float;

uniform mat4 modelViewProjection;

attribute vec2 position;

varying vec2 uv;

void main () {
  uv = position;
  gl_Position = modelViewProjection * vec4(-1.0 + 2.0 * uv.x, 1.0 - 2.0 * uv.y, 0, 1);
}
`;
      AUTO = "auto";
      COLOR_NORMAL_IDX = 0;
      COLOR_ACTIVE_IDX = 1;
      COLOR_HOVER_IDX = 2;
      COLOR_BG_IDX = 3;
      COLOR_NUM_STATES = 4;
      FLOAT_BYTES = Float32Array.BYTES_PER_ELEMENT;
      GL_EXTENSIONS = [
        "OES_texture_float",
        "OES_element_index_uint",
        "WEBGL_color_buffer_float",
        "EXT_float_blend"
      ];
      CLEAR_OPTIONS = {
        color: [0, 0, 0, 0],
        // Transparent background color
        depth: 1
      };
      MOUSE_MODE_PANZOOM = "panZoom";
      MOUSE_MODE_LASSO = "lasso";
      MOUSE_MODE_ROTATE = "rotate";
      MOUSE_MODES = [
        MOUSE_MODE_PANZOOM,
        MOUSE_MODE_LASSO,
        MOUSE_MODE_ROTATE
      ];
      DEFAULT_MOUSE_MODE = MOUSE_MODE_PANZOOM;
      EASING_FNS = {
        cubicIn,
        cubicInOut,
        cubicOut,
        linear,
        quadIn,
        quadInOut,
        quadOut
      };
      DEFAULT_EASING = cubicInOut;
      CONTINUOUS = "continuous";
      CATEGORICAL = "categorical";
      VALUE_ZW_DATA_TYPES = [CONTINUOUS, CATEGORICAL];
      LASSO_CLEAR_ON_DESELECT = "deselect";
      LASSO_CLEAR_ON_END = "lassoEnd";
      LASSO_CLEAR_EVENTS = [LASSO_CLEAR_ON_DESELECT, LASSO_CLEAR_ON_END];
      LASSO_BRUSH_MIN_MIN_DIST = 3;
      DEFAULT_LASSO_COLOR = [0, 0.666666667, 1, 1];
      DEFAULT_LASSO_LINE_WIDTH = 2;
      DEFAULT_LASSO_INITIATOR = false;
      DEFAULT_LASSO_MIN_DELAY$1 = 10;
      DEFAULT_LASSO_MIN_DIST$1 = 3;
      DEFAULT_LASSO_CLEAR_EVENT = LASSO_CLEAR_ON_END;
      DEFAULT_LASSO_ON_LONG_PRESS = false;
      DEFAULT_LASSO_LONG_PRESS_TIME = 750;
      DEFAULT_LASSO_LONG_PRESS_AFTER_EFFECT_TIME = 500;
      DEFAULT_LASSO_LONG_PRESS_EFFECT_DELAY = 100;
      DEFAULT_LASSO_LONG_PRESS_REVERT_EFFECT_TIME = 250;
      DEFAULT_LASSO_BRUSH_SIZE = 24;
      KEY_ACTION_LASSO = "lasso";
      KEY_ACTION_ROTATE = "rotate";
      KEY_ACTION_MERGE = "merge";
      KEY_ACTION_REMOVE = "remove";
      KEY_ACTIONS = [
        KEY_ACTION_LASSO,
        KEY_ACTION_ROTATE,
        KEY_ACTION_MERGE,
        KEY_ACTION_REMOVE
      ];
      KEY_ALT = "alt";
      KEY_CMD = "cmd";
      KEY_CTRL = "ctrl";
      KEY_META = "meta";
      KEY_SHIFT = "shift";
      KEYS = [KEY_ALT, KEY_CMD, KEY_CTRL, KEY_META, KEY_SHIFT];
      DEFAULT_ACTION_KEY_MAP = {
        [KEY_ACTION_REMOVE]: KEY_ALT,
        [KEY_ACTION_ROTATE]: KEY_ALT,
        [KEY_ACTION_LASSO]: KEY_SHIFT,
        [KEY_ACTION_MERGE]: KEY_CMD
      };
      DEFAULT_DATA_ASPECT_RATIO = 1;
      DEFAULT_WIDTH = AUTO;
      DEFAULT_HEIGHT = AUTO;
      DEFAULT_GAMMA = 1;
      MIN_POINT_SIZE = 1;
      DEFAULT_POINT_SCALE_MODE = "asinh";
      DEFAULT_POINT_SIZE = 6;
      DEFAULT_POINT_SIZE_SELECTED = 2;
      DEFAULT_POINT_OUTLINE_WIDTH = 2;
      DEFAULT_SIZE_BY = null;
      DEFAULT_POINT_CONNECTION_SIZE = 2;
      DEFAULT_POINT_CONNECTION_SIZE_ACTIVE = 2;
      DEFAULT_POINT_CONNECTION_SIZE_BY = null;
      DEFAULT_POINT_CONNECTION_OPACITY = null;
      DEFAULT_POINT_CONNECTION_OPACITY_BY = null;
      DEFAULT_POINT_CONNECTION_OPACITY_ACTIVE = 0.66;
      DEFAULT_OPACITY = 1;
      DEFAULT_OPACITY_BY = null;
      DEFAULT_OPACITY_BY_DENSITY_FILL = 0.15;
      DEFAULT_OPACITY_BY_DENSITY_DEBOUNCE_TIME = 25;
      DEFAULT_OPACITY_INACTIVE_MAX = 1;
      DEFAULT_OPACITY_INACTIVE_SCALE = 1;
      DEFAULT_COLOR_BY = null;
      DEFAULT_COLOR_NORMAL = [0.66, 0.66, 0.66, DEFAULT_OPACITY];
      DEFAULT_COLOR_ACTIVE = [0, 0.55, 1, 1];
      DEFAULT_COLOR_HOVER = [1, 1, 1, 1];
      DEFAULT_COLOR_BG = [0, 0, 0, 1];
      DEFAULT_POINT_CONNECTION_COLOR_BY = null;
      DEFAULT_POINT_CONNECTION_COLOR_NORMAL = [0.66, 0.66, 0.66, 0.2];
      DEFAULT_POINT_CONNECTION_COLOR_ACTIVE = [0, 0.55, 1, 1];
      DEFAULT_POINT_CONNECTION_COLOR_HOVER = [1, 1, 1, 1];
      DEFAULT_ANNOTATION_LINE_COLOR = [1, 1, 1, 0.5];
      DEFAULT_ANNOTATION_LINE_WIDTH = 1;
      DEFAULT_ANNOTATION_HVLINE_LIMIT = 1e3;
      DEFAULT_TARGET = [0, 0];
      DEFAULT_DISTANCE = 1;
      DEFAULT_ROTATION = 0;
      DEFAULT_VIEW = new Float32Array([
        1,
        0,
        0,
        0,
        0,
        1,
        0,
        0,
        0,
        0,
        1,
        0,
        0,
        0,
        0,
        1
      ]);
      IMAGE_LOAD_ERROR = "IMAGE_LOAD_ERROR";
      DEFAULT_BACKGROUND_IMAGE = null;
      DEFAULT_SHOW_RETICLE = false;
      DEFAULT_RETICLE_COLOR = [1, 1, 1, 0.5];
      DEFAULT_DESELECT_ON_DBL_CLICK = true;
      DEFAULT_DESELECT_ON_ESCAPE = true;
      DEFAULT_SHOW_POINT_CONNECTIONS = false;
      DEFAULT_POINT_CONNECTION_MAX_INT_POINTS_PER_SEGMENT = 100;
      DEFAULT_POINT_CONNECTION_INT_POINTS_TOLERANCE = 1 / 500;
      DEFAULT_POINT_SIZE_MOUSE_DETECTION = "auto";
      DEFAULT_PERFORMANCE_MODE = false;
      SINGLE_CLICK_DELAY = 200;
      LONG_CLICK_TIME = 500;
      Z_NAMES = /* @__PURE__ */ new Set(["z", "valueZ", "valueA", "value1", "category"]);
      W_NAMES = /* @__PURE__ */ new Set(["w", "valueW", "valueB", "value2", "value"]);
      DEFAULT_IMAGE_LOAD_TIMEOUT = 15e3;
      DEFAULT_SPATIAL_INDEX_USE_WORKER = void 0;
      DEFAULT_CAMERA_IS_FIXED = false;
      DEFAULT_ANTI_ALIASING = 0.5;
      DEFAULT_PIXEL_ALIGNED = false;
      DEFAULT_LASSO_TYPE$1 = "lasso";
      SKIP_DEPRECATION_VALUE_TRANSLATION = Symbol(
        "SKIP_DEPRECATION_VALUE_TRANSLATION"
      );
      ERROR_POINTS_NOT_DRAWN = "Points have not been drawn";
      ERROR_INSTANCE_IS_DESTROYED = "The instance was already destroyed";
      ERROR_IS_DRAWING = "Ignoring draw call as the previous draw call has not yet finished. To avoid this warning `await` the draw call.";
      createKDBushClass = () => {
        const ARRAY_TYPES = [
          Int8Array,
          Uint8Array,
          Uint8ClampedArray,
          Int16Array,
          Uint16Array,
          Int32Array,
          Uint32Array,
          Float32Array,
          Float64Array
        ];
        const VERSION = 1;
        const HEADER_SIZE = 8;
        class KDBush2 {
          /**
           * Creates an index from raw `ArrayBuffer` data.
           * @param {ArrayBuffer} data
           */
          static from(data) {
            if (!(data instanceof ArrayBuffer)) {
              throw new Error("Data must be an instance of ArrayBuffer.");
            }
            const [magic, versionAndType] = new Uint8Array(data, 0, 2);
            if (magic !== 219) {
              throw new Error("Data does not appear to be in a KDBush format.");
            }
            const version2 = versionAndType >> 4;
            if (version2 !== VERSION) {
              throw new Error(`Got v${version2} data when expected v${VERSION}.`);
            }
            const ArrayType = ARRAY_TYPES[versionAndType & 15];
            if (!ArrayType) {
              throw new Error("Unrecognized array type.");
            }
            const [nodeSize] = new Uint16Array(data, 2, 1);
            const [numItems] = new Uint32Array(data, 4, 1);
            return new KDBush2(numItems, nodeSize, ArrayType, data);
          }
          /**
           * Creates an index that will hold a given number of items.
           * @param {number} numItems
           * @param {number} [nodeSize=64] Size of the KD-tree node (64 by default).
           * @param {TypedArrayConstructor} [ArrayType=Float64Array] The array type used for coordinates storage (`Float64Array` by default).
           * @param {ArrayBuffer} [data] (For internal use only)
           */
          constructor(numItems, nodeSize = 64, ArrayType = Float64Array, data) {
            if (isNaN(numItems) || numItems < 0)
              throw new Error(`Unexpected numItems value: ${numItems}.`);
            this.numItems = +numItems;
            this.nodeSize = Math.min(Math.max(+nodeSize, 2), 65535);
            this.ArrayType = ArrayType;
            this.IndexArrayType = numItems < 65536 ? Uint16Array : Uint32Array;
            const arrayTypeIndex = ARRAY_TYPES.indexOf(this.ArrayType);
            const coordsByteSize = numItems * 2 * this.ArrayType.BYTES_PER_ELEMENT;
            const idsByteSize = numItems * this.IndexArrayType.BYTES_PER_ELEMENT;
            const padCoords = (8 - idsByteSize % 8) % 8;
            if (arrayTypeIndex < 0) {
              throw new Error(`Unexpected typed array class: ${ArrayType}.`);
            }
            if (data && data instanceof ArrayBuffer) {
              this.data = data;
              this.ids = new this.IndexArrayType(this.data, HEADER_SIZE, numItems);
              this.coords = new this.ArrayType(
                this.data,
                HEADER_SIZE + idsByteSize + padCoords,
                numItems * 2
              );
              this._pos = numItems * 2;
              this._finished = true;
            } else {
              this.data = new ArrayBuffer(
                HEADER_SIZE + coordsByteSize + idsByteSize + padCoords
              );
              this.ids = new this.IndexArrayType(this.data, HEADER_SIZE, numItems);
              this.coords = new this.ArrayType(
                this.data,
                HEADER_SIZE + idsByteSize + padCoords,
                numItems * 2
              );
              this._pos = 0;
              this._finished = false;
              new Uint8Array(this.data, 0, 2).set([
                219,
                (VERSION << 4) + arrayTypeIndex
              ]);
              new Uint16Array(this.data, 2, 1)[0] = nodeSize;
              new Uint32Array(this.data, 4, 1)[0] = numItems;
            }
          }
          /**
           * Add a point to the index.
           * @param {number} x
           * @param {number} y
           * @returns {number} An incremental index associated with the added item (starting from `0`).
           */
          add(x, y) {
            const index = this._pos >> 1;
            this.ids[index] = index;
            this.coords[this._pos++] = x;
            this.coords[this._pos++] = y;
            return index;
          }
          /**
           * Perform indexing of the added points.
           */
          finish() {
            const numAdded = this._pos >> 1;
            if (numAdded !== this.numItems) {
              throw new Error(
                `Added ${numAdded} items when expected ${this.numItems}.`
              );
            }
            sort(this.ids, this.coords, this.nodeSize, 0, this.numItems - 1, 0);
            this._finished = true;
            return this;
          }
          /**
           * Search the index for items within a given bounding box.
           * @param {number} minX
           * @param {number} minY
           * @param {number} maxX
           * @param {number} maxY
           * @returns {number[]} An array of indices correponding to the found items.
           */
          range(minX, minY, maxX, maxY) {
            if (!this._finished)
              throw new Error("Data not yet indexed - call index.finish().");
            const { ids, coords, nodeSize } = this;
            const stack = [0, ids.length - 1, 0];
            const result = [];
            while (stack.length) {
              const axis = stack.pop() || 0;
              const right = stack.pop() || 0;
              const left = stack.pop() || 0;
              if (right - left <= nodeSize) {
                for (let i = left; i <= right; i++) {
                  const x2 = coords[2 * i];
                  const y2 = coords[2 * i + 1];
                  if (x2 >= minX && x2 <= maxX && y2 >= minY && y2 <= maxY)
                    result.push(ids[i]);
                }
                continue;
              }
              const m = left + right >> 1;
              const x = coords[2 * m];
              const y = coords[2 * m + 1];
              if (x >= minX && x <= maxX && y >= minY && y <= maxY)
                result.push(ids[m]);
              if (axis === 0 ? minX <= x : minY <= y) {
                stack.push(left);
                stack.push(m - 1);
                stack.push(1 - axis);
              }
              if (axis === 0 ? maxX >= x : maxY >= y) {
                stack.push(m + 1);
                stack.push(right);
                stack.push(1 - axis);
              }
            }
            return result;
          }
          /**
           * Search the index for items within a given radius.
           * @param {number} qx
           * @param {number} qy
           * @param {number} r Query radius.
           * @returns {number[]} An array of indices correponding to the found items.
           */
          within(qx, qy, r) {
            if (!this._finished)
              throw new Error("Data not yet indexed - call index.finish().");
            const { ids, coords, nodeSize } = this;
            const stack = [0, ids.length - 1, 0];
            const result = [];
            const r2 = r * r;
            while (stack.length) {
              const axis = stack.pop() || 0;
              const right = stack.pop() || 0;
              const left = stack.pop() || 0;
              if (right - left <= nodeSize) {
                for (let i = left; i <= right; i++) {
                  if (sqDist(coords[2 * i], coords[2 * i + 1], qx, qy) <= r2)
                    result.push(ids[i]);
                }
                continue;
              }
              const m = left + right >> 1;
              const x = coords[2 * m];
              const y = coords[2 * m + 1];
              if (sqDist(x, y, qx, qy) <= r2) result.push(ids[m]);
              if (axis === 0 ? qx - r <= x : qy - r <= y) {
                stack.push(left);
                stack.push(m - 1);
                stack.push(1 - axis);
              }
              if (axis === 0 ? qx + r >= x : qy + r >= y) {
                stack.push(m + 1);
                stack.push(right);
                stack.push(1 - axis);
              }
            }
            return result;
          }
        }
        function sort(ids, coords, nodeSize, left, right, axis) {
          if (right - left <= nodeSize) return;
          const m = left + right >> 1;
          select(ids, coords, m, left, right, axis);
          sort(ids, coords, nodeSize, left, m - 1, 1 - axis);
          sort(ids, coords, nodeSize, m + 1, right, 1 - axis);
        }
        function select(ids, coords, k, left, right, axis) {
          while (right > left) {
            if (right - left > 600) {
              const n = right - left + 1;
              const m = k - left + 1;
              const z = Math.log(n);
              const s = 0.5 * Math.exp(2 * z / 3);
              const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);
              const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));
              const newRight = Math.min(
                right,
                Math.floor(k + (n - m) * s / n + sd)
              );
              select(ids, coords, k, newLeft, newRight, axis);
            }
            const t = coords[2 * k + axis];
            let i = left;
            let j = right;
            swapItem(ids, coords, left, k);
            if (coords[2 * right + axis] > t) swapItem(ids, coords, left, right);
            while (i < j) {
              swapItem(ids, coords, i, j);
              i++;
              j--;
              while (coords[2 * i + axis] < t) i++;
              while (coords[2 * j + axis] > t) j--;
            }
            if (coords[2 * left + axis] === t) swapItem(ids, coords, left, j);
            else {
              j++;
              swapItem(ids, coords, j, right);
            }
            if (j <= k) left = j + 1;
            if (k <= j) right = j - 1;
          }
        }
        function swapItem(ids, coords, i, j) {
          swap(ids, i, j);
          swap(coords, 2 * i, 2 * j);
          swap(coords, 2 * i + 1, 2 * j + 1);
        }
        function swap(arr, i, j) {
          const tmp2 = arr[i];
          arr[i] = arr[j];
          arr[j] = tmp2;
        }
        function sqDist(ax, ay, bx, by) {
          const dx = ax - bx;
          const dy = ay - by;
          return dx * dx + dy * dy;
        }
        return KDBush2;
      };
      workerFn = () => {
        addEventListener("message", (event) => {
          const points = event.data.points;
          if (points.length === 0) {
            self.postMessage({ error: new Error("Invalid point data") });
          }
          const index = new KDBush(points.length, event.data.nodeSize);
          for (const [x, y] of points) {
            index.add(x, y);
          }
          index.finish();
          postMessage(index.data, [index.data]);
        });
      };
      KDBush$1 = createKDBushClass();
      WORKER_THRESHOLD = 1e6;
      createWorker = (fn) => {
        const kdbushStr = createKDBushClass.toString();
        const fnStr = fn.toString();
        const workerStr = `const createKDBushClass = ${kdbushStr};KDBush = createKDBushClass();const createWorker = ${fnStr};createWorker();`;
        const blob = new Blob([workerStr], { type: "text/javascript" });
        const workerUrl = URL.createObjectURL(blob);
        const worker3 = new Worker(workerUrl, { name: "KDBush" });
        URL.revokeObjectURL(workerUrl);
        return worker3;
      };
      createKdbush = (pointsOrIndex, options = { nodeSize: 16, useWorker: void 0 }) => new Promise((resolve, reject) => {
        if (pointsOrIndex instanceof ArrayBuffer) {
          resolve(KDBush$1.from(pointsOrIndex));
        } else if ((pointsOrIndex.length < WORKER_THRESHOLD || options.useWorker === false) && options.useWorker !== true) {
          const index = new KDBush$1(pointsOrIndex.length, options.nodeSize);
          for (const pointOrIndex of pointsOrIndex) {
            index.add(pointOrIndex[0], pointOrIndex[1]);
          }
          index.finish();
          resolve(index);
        } else {
          const worker3 = createWorker(workerFn);
          worker3.onmessage = (e) => {
            if (e.data.error) {
              reject(e.data.error);
            } else {
              resolve(KDBush$1.from(e.data));
            }
            worker3.terminate();
          };
          worker3.postMessage({ points: pointsOrIndex, nodeSize: options.nodeSize });
        }
      });
      DEFAULT_LASSO_START_INITIATOR_SHOW = true;
      DEFAULT_LASSO_MIN_DELAY = 8;
      DEFAULT_LASSO_MIN_DIST = 2;
      DEFAULT_LASSO_TYPE = "freeform";
      DEFAULT_BRUSH_SIZE = 24;
      LASSO_SHOW_START_INITIATOR_TIME = 2500;
      LASSO_HIDE_START_INITIATOR_TIME = 250;
      getInTime = (p, time, extraTime) => (1 - p) * time + extraTime;
      getMainInAnimation = (t, d) => `${t}ms ease-out mainIn ${d}ms 1 normal forwards`;
      getEffectInAnimation = (t, d) => `${t}ms ease-out effectIn ${d}ms 1 normal forwards`;
      getCircleLeftInAnimation = (t, d) => `${t}ms linear leftSpinIn ${d}ms 1 normal forwards`;
      getCircleRightInAnimation = (t, d) => `${t}ms linear rightSpinIn ${d}ms 1 normal forwards`;
      getCircleInAnimation = (t, d) => `${t}ms linear circleIn ${d}ms 1 normal forwards`;
      getMainIn = (mainEffectPercent, currentColor, targetColor) => `
  @keyframes mainIn {
    0% {
      color: ${currentColor};
      opacity: 0;
    }
    0%, ${mainEffectPercent}% {
      color: ${currentColor};
      opacity: 1;
    }
    100% {
      color: ${targetColor};
      opacity: 0.8;
    }
  }
`;
      getEffectIn = (mainEffectPercent, afterEffectPercent, opacity, scale) => `
  @keyframes effectIn {
    0%, ${mainEffectPercent}% {
      opacity: ${opacity};
      transform: scale(${scale});
    }
    ${afterEffectPercent}% {
      opacity: 0.66;
      transform: scale(1.5);
    }
    99% {
      opacity: 0;
      transform: scale(2);
    }
    100% {
      opacity: 0;
      transform: scale(0);
    }
  }
`;
      getCircleIn = (halfMainEffectPercent, clipPath, opacity) => `
  @keyframes circleIn {
    0% {
      clip-path: ${clipPath};
      opacity: ${opacity};
    }
    ${halfMainEffectPercent}% {
      clip-path: ${clipPath};
      opacity: 1;
    }
    ${halfMainEffectPercent + 0.01}%, 100% {
      clip-path: inset(0);
      opacity: 1;
    }
  }
`;
      getCircleLeftIn = (mainEffectPercent, angle2) => `
  @keyframes leftSpinIn {
    0% {
      transform: rotate(${angle2}deg);
    }
    ${mainEffectPercent}%, 100% {
      transform: rotate(360deg);
    }
  }
`;
      getCircleRightIn = (halfMainEffectPercent, angle2) => `
  @keyframes rightSpinIn {
    0% {
      transform: rotate(${angle2}deg);
    }
    ${halfMainEffectPercent}%, 100% {
      transform: rotate(180deg);
    }
  }
`;
      createLongPressInAnimations = ({
        time = DEFAULT_LASSO_LONG_PRESS_TIME,
        extraTime = DEFAULT_LASSO_LONG_PRESS_AFTER_EFFECT_TIME,
        delay = DEFAULT_LASSO_LONG_PRESS_EFFECT_DELAY,
        currentColor,
        targetColor,
        effectOpacity,
        effectScale,
        circleLeftRotation,
        circleRightRotation,
        circleClipPath,
        circleOpacity
      }) => {
        const p = circleLeftRotation / 360;
        const actualTime = getInTime(p, time, extraTime);
        const longPressPercent = Math.round((1 - p) * time / actualTime * 100);
        const halfLongPressPercent = Math.round(longPressPercent / 2);
        const afterEffectPercent = longPressPercent + (100 - longPressPercent) / 4;
        return {
          rules: {
            main: getMainIn(longPressPercent, currentColor, targetColor),
            effect: getEffectIn(
              longPressPercent,
              afterEffectPercent,
              effectOpacity,
              effectScale
            ),
            circleRight: getCircleRightIn(halfLongPressPercent, circleRightRotation),
            circleLeft: getCircleLeftIn(longPressPercent, circleLeftRotation),
            circle: getCircleIn(halfLongPressPercent, circleClipPath, circleOpacity)
          },
          names: {
            main: getMainInAnimation(actualTime, delay),
            effect: getEffectInAnimation(actualTime, delay),
            circleLeft: getCircleLeftInAnimation(actualTime, delay),
            circleRight: getCircleRightInAnimation(actualTime, delay),
            circle: getCircleInAnimation(actualTime, delay)
          }
        };
      };
      getMainOutAnimation = (t) => `${t}ms linear mainOut 0s 1 normal forwards`;
      getEffectOutAnimation = (t) => `${t}ms linear effectOut 0s 1 normal forwards`;
      getCircleLeftOutAnimation = (t) => `${t}ms linear leftSpinOut 0s 1 normal forwards`;
      getCircleRightOutAnimation = (t) => `${t}ms linear rightSpinOut 0s 1 normal forwards`;
      getCircleOutAnimation = (t) => `${t}ms linear circleOut 0s 1 normal forwards`;
      getMainOut = (currentColor, targetColor) => `
  @keyframes mainOut {
    0% {
      color: ${currentColor};
    }
    100% {
      color: ${targetColor};
    }
  }
`;
      getEffectOut = (opacity, scale) => `
  @keyframes effectOut {
    0% {
      opacity: ${opacity};
      transform: scale(${scale});
    }
    99% {
      opacity: 0;
      transform: scale(${scale + 0.5});
    }
    100% {
      opacity: 0;
      transform: scale(0);
    }
  }
`;
      getCircleRightOut = (halfEffectPercent, angle2) => `
  @keyframes rightSpinOut {
    0%, ${halfEffectPercent}% {
      transform: rotate(${angle2}deg);
    }
    100% {
      transform: rotate(0deg);
    }
`;
      getCircleLeftOut = (angle2) => `
  @keyframes leftSpinOut {
    0% {
      transform: rotate(${angle2}deg);
    }
    100% {
      transform: rotate(0deg);
    }
  }
`;
      getCircleOut = (halfEffectPercent, clipPath, opacity) => `
  @keyframes circleOut {
    0%, ${halfEffectPercent}% {
      clip-path: ${clipPath};
      opacity: ${opacity};
    }
    ${halfEffectPercent + 0.01}% {
      clip-path: inset(0 0 0 50%);
      opacity: ${opacity};
    }
    100% {
      clip-path: inset(0 0 0 50%);
      opacity: 0;
    }
  }
`;
      createLongPressOutAnimations = ({
        time = DEFAULT_LASSO_LONG_PRESS_REVERT_EFFECT_TIME,
        currentColor,
        targetColor,
        effectOpacity,
        effectScale,
        circleLeftRotation,
        circleRightRotation,
        circleClipPath,
        circleOpacity
      }) => {
        const p = circleLeftRotation / 360;
        const actualTime = p * time;
        const rotatedPercent = Math.min(100, p * 100);
        const halfPercent = rotatedPercent > 50 ? Math.round((1 - 50 / rotatedPercent) * 100) : 0;
        return {
          rules: {
            main: getMainOut(currentColor, targetColor),
            effect: getEffectOut(effectOpacity, effectScale),
            circleRight: getCircleRightOut(halfPercent, circleRightRotation),
            circleLeft: getCircleLeftOut(circleLeftRotation),
            circle: getCircleOut(halfPercent, circleClipPath, circleOpacity)
          },
          names: {
            main: getMainOutAnimation(actualTime),
            effect: getEffectOutAnimation(actualTime),
            circleRight: getCircleLeftOutAnimation(actualTime),
            circleLeft: getCircleRightOutAnimation(actualTime),
            circle: getCircleOutAnimation(actualTime)
          }
        };
      };
      createLongPressElements = () => {
        const longPress = document.createElement("div");
        const longPressId = Math.random().toString(36).substring(2, 5) + Math.random().toString(36).substring(2, 5);
        longPress.id = `lasso-long-press-${longPressId}`;
        longPress.style.position = "fixed";
        longPress.style.width = "1.25rem";
        longPress.style.height = "1.25rem";
        longPress.style.pointerEvents = "none";
        longPress.style.transform = "translate(-50%,-50%)";
        const longPressCircle = document.createElement("div");
        longPressCircle.style.position = "absolute";
        longPressCircle.style.top = 0;
        longPressCircle.style.left = 0;
        longPressCircle.style.width = "1.25rem";
        longPressCircle.style.height = "1.25rem";
        longPressCircle.style.clipPath = "inset(0px 0px 0px 50%)";
        longPressCircle.style.opacity = 0;
        longPress.appendChild(longPressCircle);
        const longPressCircleLeft = document.createElement("div");
        longPressCircleLeft.style.position = "absolute";
        longPressCircleLeft.style.top = 0;
        longPressCircleLeft.style.left = 0;
        longPressCircleLeft.style.width = "0.8rem";
        longPressCircleLeft.style.height = "0.8rem";
        longPressCircleLeft.style.border = "0.2rem solid currentcolor";
        longPressCircleLeft.style.borderRadius = "0.8rem";
        longPressCircleLeft.style.clipPath = "inset(0px 50% 0px 0px)";
        longPressCircleLeft.style.transform = "rotate(0deg)";
        longPressCircle.appendChild(longPressCircleLeft);
        const longPressCircleRight = document.createElement("div");
        longPressCircleRight.style.position = "absolute";
        longPressCircleRight.style.top = 0;
        longPressCircleRight.style.left = 0;
        longPressCircleRight.style.width = "0.8rem";
        longPressCircleRight.style.height = "0.8rem";
        longPressCircleRight.style.border = "0.2rem solid currentcolor";
        longPressCircleRight.style.borderRadius = "0.8rem";
        longPressCircleRight.style.clipPath = "inset(0px 50% 0px 0px)";
        longPressCircleRight.style.transform = "rotate(0deg)";
        longPressCircle.appendChild(longPressCircleRight);
        const longPressEffect = document.createElement("div");
        longPressEffect.style.position = "absolute";
        longPressEffect.style.top = 0;
        longPressEffect.style.left = 0;
        longPressEffect.style.width = "1.25rem";
        longPressEffect.style.height = "1.25rem";
        longPressEffect.style.borderRadius = "1.25rem";
        longPressEffect.style.background = "currentcolor";
        longPressEffect.style.transform = "scale(0)";
        longPressEffect.style.opacity = 0;
        longPress.appendChild(longPressEffect);
        return {
          longPress,
          longPressCircle,
          longPressCircleLeft,
          longPressCircleRight,
          longPressEffect
        };
      };
      exponentialMovingAverage = (values, halfLife, windowSize) => {
        if (values.length === 0) {
          return 0;
        }
        if (values.length === 1) {
          return values[0];
        }
        const decayBase = 2 ** (-1 / halfLife);
        const startIdx = Math.max(0, values.length - windowSize);
        const relevantValues = values.slice(startIdx);
        let weightedSumX = 0;
        let weightedSumY = 0;
        let weightSum = 0;
        for (let i = relevantValues.length - 1; i >= 0; i--) {
          const steps = relevantValues.length - 1 - i;
          const weight = decayBase ** steps;
          weightedSumX += relevantValues[i][0] * weight;
          weightedSumY += relevantValues[i][1] * weight;
          weightSum += weight;
        }
        return [weightedSumX / weightSum, weightedSumY / weightSum];
      };
      ifNotNull = (v, alternative = null) => v === null ? alternative : v;
      getLassoStylesheets = () => {
        if (!cachedLassoStylesheets) {
          const lassoStyleEl = document.createElement("style");
          document.head.appendChild(lassoStyleEl);
          cachedLassoStylesheets = lassoStyleEl.sheet;
        }
        return cachedLassoStylesheets;
      };
      addRule = (rule) => {
        const lassoStylesheets = getLassoStylesheets();
        const currentNumRules = lassoStylesheets.rules.length;
        lassoStylesheets.insertRule(rule, currentNumRules);
        return currentNumRules;
      };
      removeRule = (index) => {
        getLassoStylesheets().deleteRule(index);
      };
      inAnimation = `${LASSO_SHOW_START_INITIATOR_TIME}ms ease scaleInFadeOut 0s 1 normal backwards`;
      createInAnimationRule = (opacity, scale, rotate) => `
@keyframes scaleInFadeOut {
  0% {
    opacity: ${opacity};
    transform: translate(-50%,-50%) scale(${scale}) rotate(${rotate}deg);
  }
  10% {
    opacity: 1;
    transform: translate(-50%,-50%) scale(1) rotate(${rotate + 20}deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%,-50%) scale(0.9) rotate(${rotate + 60}deg);
  }
}
`;
      inAnimationRuleIndex = null;
      outAnimation = `${LASSO_HIDE_START_INITIATOR_TIME}ms ease fadeScaleOut 0s 1 normal backwards`;
      createOutAnimationRule = (opacity, scale, rotate) => `
@keyframes fadeScaleOut {
  0% {
    opacity: ${opacity};
    transform: translate(-50%,-50%) scale(${scale}) rotate(${rotate}deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%,-50%) scale(0) rotate(${rotate}deg);
  }
}
`;
      outAnimationRuleIndex = null;
      createLasso = (element, {
        onDraw: initialOnDraw = identity,
        onStart: initialOnStart = identity,
        onEnd: initialOnEnd = identity,
        enableInitiator: initialenableInitiator = DEFAULT_LASSO_START_INITIATOR_SHOW,
        initiatorParentElement: initialInitiatorParentElement = document.body,
        longPressIndicatorParentElement: initialLongPressIndicatorParentElement = document.body,
        minDelay: initialMinDelay = DEFAULT_LASSO_MIN_DELAY,
        minDist: initialMinDist = DEFAULT_LASSO_MIN_DIST,
        pointNorm: initialPointNorm = identity,
        type: initialType = DEFAULT_LASSO_TYPE,
        brushSize: initialBrushSize = DEFAULT_BRUSH_SIZE
      } = {}) => {
        let enableInitiator = initialenableInitiator;
        let initiatorParentElement = initialInitiatorParentElement;
        let longPressIndicatorParentElement = initialLongPressIndicatorParentElement;
        let onDraw = initialOnDraw;
        let onStart = initialOnStart;
        let onEnd = initialOnEnd;
        let minDelay = initialMinDelay;
        let minDist = initialMinDist;
        let pointNorm = initialPointNorm;
        let type = initialType;
        let brushSize = initialBrushSize;
        const initiator = document.createElement("div");
        const initiatorId = Math.random().toString(36).substring(2, 5) + Math.random().toString(36).substring(2, 5);
        initiator.id = `lasso-initiator-${initiatorId}`;
        initiator.style.position = "fixed";
        initiator.style.display = "flex";
        initiator.style.justifyContent = "center";
        initiator.style.alignItems = "center";
        initiator.style.zIndex = 99;
        initiator.style.width = "4rem";
        initiator.style.height = "4rem";
        initiator.style.borderRadius = "4rem";
        initiator.style.opacity = 0.5;
        initiator.style.transform = "translate(-50%,-50%) scale(0) rotate(0deg)";
        const {
          longPress,
          longPressCircle,
          longPressCircleLeft,
          longPressCircleRight,
          longPressEffect
        } = createLongPressElements();
        let isMouseDown = false;
        let isLasso = false;
        let lassoPos = [];
        let lassoPosFlat = [];
        let lassoBrushCenterPos = [];
        let lassoBrushNormals = [];
        let prevMousePos;
        let longPressIsStarting = false;
        let longPressMainInAnimationRuleIndex = null;
        let longPressEffectInAnimationRuleIndex = null;
        let longPressCircleLeftInAnimationRuleIndex = null;
        let longPressCircleRightInAnimationRuleIndex = null;
        let longPressCircleInAnimationRuleIndex = null;
        let longPressMainOutAnimationRuleIndex = null;
        let longPressEffectOutAnimationRuleIndex = null;
        let longPressCircleLeftOutAnimationRuleIndex = null;
        let longPressCircleRightOutAnimationRuleIndex = null;
        let longPressCircleOutAnimationRuleIndex = null;
        const mouseUpHandler = () => {
          isMouseDown = false;
        };
        const getMousePosition = (event) => {
          const { left, top } = element.getBoundingClientRect();
          return [event.clientX - left, event.clientY - top];
        };
        window.addEventListener("mouseup", mouseUpHandler);
        const resetInitiatorStyle = () => {
          initiator.style.opacity = 0.5;
          initiator.style.transform = "translate(-50%,-50%) scale(0) rotate(0deg)";
        };
        const getCurrentTransformStyle = (node, hasRotated) => {
          const computedStyle = getComputedStyle(node);
          const opacity = +computedStyle.opacity;
          const m = computedStyle.transform.match(/([0-9.-]+)+/g);
          const a = +m[0];
          const b = +m[1];
          const scale = Math.sqrt(a * a + b * b);
          let rotate = Math.atan2(b, a) * (180 / Math.PI);
          rotate = hasRotated && rotate <= 0 ? 360 + rotate : rotate;
          return { opacity, scale, rotate };
        };
        const showInitiator = (event) => {
          if (!enableInitiator || isMouseDown) {
            return;
          }
          const x = event.clientX;
          const y = event.clientY;
          initiator.style.top = `${y}px`;
          initiator.style.left = `${x}px`;
          const style = getCurrentTransformStyle(initiator);
          const opacity = style.opacity;
          const scale = style.scale;
          const rotate = style.rotate;
          initiator.style.opacity = opacity;
          initiator.style.transform = `translate(-50%,-50%) scale(${scale}) rotate(${rotate}deg)`;
          initiator.style.animation = "none";
          nextAnimationFrame().then(() => {
            if (inAnimationRuleIndex !== null) {
              removeRule(inAnimationRuleIndex);
            }
            inAnimationRuleIndex = addRule(
              createInAnimationRule(opacity, scale, rotate)
            );
            initiator.style.animation = inAnimation;
            nextAnimationFrame().then(() => {
              resetInitiatorStyle();
            });
          });
        };
        const hideInitiator = () => {
          const { opacity, scale, rotate } = getCurrentTransformStyle(initiator);
          initiator.style.opacity = opacity;
          initiator.style.transform = `translate(-50%,-50%) scale(${scale}) rotate(${rotate}deg)`;
          initiator.style.animation = "none";
          nextAnimationFrame(2).then(() => {
            if (outAnimationRuleIndex !== null) {
              removeRule(outAnimationRuleIndex);
            }
            outAnimationRuleIndex = addRule(
              createOutAnimationRule(opacity, scale, rotate)
            );
            initiator.style.animation = outAnimation;
            nextAnimationFrame().then(() => {
              resetInitiatorStyle();
            });
          });
        };
        const showLongPressIndicator = (x, y, {
          time = DEFAULT_LASSO_LONG_PRESS_TIME,
          extraTime = DEFAULT_LASSO_LONG_PRESS_AFTER_EFFECT_TIME,
          delay = DEFAULT_LASSO_LONG_PRESS_EFFECT_DELAY
        } = {
          time: DEFAULT_LASSO_LONG_PRESS_TIME,
          extraTime: DEFAULT_LASSO_LONG_PRESS_AFTER_EFFECT_TIME,
          delay: DEFAULT_LASSO_LONG_PRESS_EFFECT_DELAY
        }) => {
          longPressIsStarting = true;
          const mainStyle = getComputedStyle(longPress);
          longPress.style.color = mainStyle.color;
          longPress.style.top = `${y}px`;
          longPress.style.left = `${x}px`;
          longPress.style.animation = "none";
          const circleStyle = getComputedStyle(longPressCircle);
          longPressCircle.style.clipPath = circleStyle.clipPath;
          longPressCircle.style.opacity = circleStyle.opacity;
          longPressCircle.style.animation = "none";
          const effectStyle = getCurrentTransformStyle(longPressEffect);
          longPressEffect.style.opacity = effectStyle.opacity;
          longPressEffect.style.transform = `scale(${effectStyle.scale})`;
          longPressEffect.style.animation = "none";
          const circleLeftStyle = getCurrentTransformStyle(longPressCircleLeft);
          longPressCircleLeft.style.transform = `rotate(${circleLeftStyle.rotate}deg)`;
          longPressCircleLeft.style.animation = "none";
          const circleRightStyle = getCurrentTransformStyle(longPressCircleRight);
          longPressCircleRight.style.transform = `rotate(${circleRightStyle.rotate}deg)`;
          longPressCircleRight.style.animation = "none";
          nextAnimationFrame().then(() => {
            if (!longPressIsStarting) {
              return;
            }
            if (longPressCircleInAnimationRuleIndex !== null) {
              removeRule(longPressCircleInAnimationRuleIndex);
            }
            if (longPressCircleRightInAnimationRuleIndex !== null) {
              removeRule(longPressCircleRightInAnimationRuleIndex);
            }
            if (longPressCircleLeftInAnimationRuleIndex !== null) {
              removeRule(longPressCircleLeftInAnimationRuleIndex);
            }
            if (longPressEffectInAnimationRuleIndex !== null) {
              removeRule(longPressEffectInAnimationRuleIndex);
            }
            if (longPressMainInAnimationRuleIndex !== null) {
              removeRule(longPressMainInAnimationRuleIndex);
            }
            const { rules, names } = createLongPressInAnimations({
              time,
              extraTime,
              delay,
              currentColor: mainStyle.color || "currentcolor",
              targetColor: longPress.dataset.activeColor,
              effectOpacity: effectStyle.opacity || 0,
              effectScale: effectStyle.scale || 0,
              circleLeftRotation: circleLeftStyle.rotate || 0,
              circleRightRotation: circleRightStyle.rotate || 0,
              circleClipPath: circleStyle.clipPath || "inset(0 0 0 50%)",
              circleOpacity: circleStyle.opacity || 0
            });
            longPressMainInAnimationRuleIndex = addRule(rules.main);
            longPressEffectInAnimationRuleIndex = addRule(rules.effect);
            longPressCircleLeftInAnimationRuleIndex = addRule(rules.circleLeft);
            longPressCircleRightInAnimationRuleIndex = addRule(rules.circleRight);
            longPressCircleInAnimationRuleIndex = addRule(rules.circle);
            longPress.style.animation = names.main;
            longPressEffect.style.animation = names.effect;
            longPressCircleLeft.style.animation = names.circleLeft;
            longPressCircleRight.style.animation = names.circleRight;
            longPressCircle.style.animation = names.circle;
          });
        };
        const hideLongPressIndicator = ({ time = DEFAULT_LASSO_LONG_PRESS_REVERT_EFFECT_TIME } = {
          time: DEFAULT_LASSO_LONG_PRESS_REVERT_EFFECT_TIME
        }) => {
          if (!longPressIsStarting) {
            return;
          }
          longPressIsStarting = false;
          const mainStyle = getComputedStyle(longPress);
          longPress.style.color = mainStyle.color;
          longPress.style.animation = "none";
          const circleStyle = getComputedStyle(longPressCircle);
          longPressCircle.style.clipPath = circleStyle.clipPath;
          longPressCircle.style.opacity = circleStyle.opacity;
          longPressCircle.style.animation = "none";
          const effectStyle = getCurrentTransformStyle(longPressEffect);
          longPressEffect.style.opacity = effectStyle.opacity;
          longPressEffect.style.transform = `scale(${effectStyle.scale})`;
          longPressEffect.style.animation = "none";
          const isAnimatedMoreThan50Percent = circleStyle.clipPath.slice(-2, -1) === "x";
          const circleLeftStyle = getCurrentTransformStyle(
            longPressCircleLeft,
            isAnimatedMoreThan50Percent
          );
          longPressCircleLeft.style.transform = `rotate(${circleLeftStyle.rotate}deg)`;
          longPressCircleLeft.style.animation = "none";
          const circleRightStyle = getCurrentTransformStyle(longPressCircleRight);
          longPressCircleRight.style.transform = `rotate(${circleRightStyle.rotate}deg)`;
          longPressCircleRight.style.animation = "none";
          nextAnimationFrame().then(() => {
            if (longPressCircleOutAnimationRuleIndex !== null) {
              removeRule(longPressCircleOutAnimationRuleIndex);
            }
            if (longPressCircleRightOutAnimationRuleIndex !== null) {
              removeRule(longPressCircleRightOutAnimationRuleIndex);
            }
            if (longPressCircleLeftOutAnimationRuleIndex !== null) {
              removeRule(longPressCircleLeftOutAnimationRuleIndex);
            }
            if (longPressEffectOutAnimationRuleIndex !== null) {
              removeRule(longPressEffectOutAnimationRuleIndex);
            }
            if (longPressMainOutAnimationRuleIndex !== null) {
              removeRule(longPressMainOutAnimationRuleIndex);
            }
            const { rules, names } = createLongPressOutAnimations({
              time,
              currentColor: mainStyle.color || "currentcolor",
              targetColor: longPress.dataset.color,
              effectOpacity: effectStyle.opacity || 0,
              effectScale: effectStyle.scale || 0,
              circleLeftRotation: circleLeftStyle.rotate || 0,
              circleRightRotation: circleRightStyle.rotate || 0,
              circleClipPath: circleStyle.clipPath || "inset(0px)",
              circleOpacity: circleStyle.opacity || 1
            });
            longPressMainOutAnimationRuleIndex = addRule(rules.main);
            longPressEffectOutAnimationRuleIndex = addRule(rules.effect);
            longPressCircleLeftOutAnimationRuleIndex = addRule(rules.circleLeft);
            longPressCircleRightOutAnimationRuleIndex = addRule(rules.circleRight);
            longPressCircleOutAnimationRuleIndex = addRule(rules.circle);
            longPress.style.animation = names.main;
            longPressEffect.style.animation = names.effect;
            longPressCircleLeft.style.animation = names.circleLeft;
            longPressCircleRight.style.animation = names.circleRight;
            longPressCircle.style.animation = names.circle;
          });
        };
        const draw = () => {
          onDraw(lassoPos, lassoPosFlat);
        };
        const extendFreeform = (point) => {
          lassoPos.push(point);
          lassoPosFlat.push(point[0], point[1]);
        };
        const extendRectangle = (point) => {
          const [x, y] = point;
          const [startX, startY] = lassoPos[0];
          lassoPos[1] = [x, startY];
          lassoPos[2] = [x, y];
          lassoPos[3] = [startX, y];
          lassoPos[4] = [startX, startY];
          lassoPosFlat[2] = x;
          lassoPosFlat[3] = startY;
          lassoPosFlat[4] = x;
          lassoPosFlat[5] = y;
          lassoPosFlat[6] = startX;
          lassoPosFlat[7] = y;
          lassoPosFlat[8] = startX;
          lassoPosFlat[9] = startY;
        };
        const startBrush = (point) => {
          lassoBrushCenterPos.push(point);
        };
        const getNormalizedBrushSize = () => Math.abs(pointNorm([0, 0])[0] - pointNorm([brushSize / 2, 0])[0]);
        const getBrushNormal = (point1, point2, w) => {
          const [x1, y1] = point1;
          const [x2, y2] = point2;
          const dx = x1 - x2;
          const dy = y1 - y2;
          const dn = l2Norm([dx, dy]);
          return [+dy / dn * w, -dx / dn * w];
        };
        const extendBrush = (point) => {
          const prevPoint = lassoBrushCenterPos.at(-1);
          const width = getNormalizedBrushSize();
          let [nx, ny] = getBrushNormal(point, prevPoint, width);
          const N = lassoBrushCenterPos.length;
          if (N === 1) {
            const pl2 = [prevPoint[0] + nx, prevPoint[1] + ny];
            const pr2 = [prevPoint[0] - nx, prevPoint[1] - ny];
            lassoPos.push(pl2, pr2);
            lassoPosFlat.push(pl2[0], pl2[1], pr2[0], pr2[1]);
            lassoBrushNormals.push([nx, ny]);
          } else {
            [nx, ny] = getBrushNormal(point, prevPoint, width);
            const nextRawBrushNormals = [...lassoBrushNormals, [nx, ny]];
            [nx, ny] = exponentialMovingAverage(nextRawBrushNormals, 1, 10);
            const [pnx, pny] = lassoBrushNormals.at(-1);
            const pnx2 = (nx + pnx) / 2;
            const pny2 = (ny + pny) / 2;
            const pl2 = [prevPoint[0] + pnx2, prevPoint[1] + pny2];
            const pr2 = [prevPoint[0] - pnx2, prevPoint[1] - pny2];
            lassoPos.splice(N - 1, 2, pl2, pr2);
            lassoPosFlat.splice(2 * (N - 1), 4, pl2[0], pl2[1], pr2[0], pr2[1]);
            lassoBrushNormals.splice(N, 1, [pnx2, pny2]);
          }
          const pl = [point[0] + nx, point[1] + ny];
          const pr = [point[0] - nx, point[1] - ny];
          lassoPos.splice(N, 0, pl, pr);
          lassoPosFlat.splice(2 * N, 0, pl[0], pl[1], pr[0], pr[1]);
          lassoBrushCenterPos.push(point);
          lassoBrushNormals.push([nx, ny]);
        };
        let extendLasso = extendFreeform;
        let startLasso = extendFreeform;
        const extend = (currMousePos) => {
          if (prevMousePos) {
            const d = l2PointDist(
              currMousePos[0],
              currMousePos[1],
              prevMousePos[0],
              prevMousePos[1]
            );
            if (d > minDist) {
              prevMousePos = currMousePos;
              extendLasso(pointNorm(currMousePos));
              if (lassoPos.length > 1) {
                draw();
              }
            }
          } else {
            if (!isLasso) {
              isLasso = true;
              onStart();
            }
            prevMousePos = currMousePos;
            const point = pointNorm(currMousePos);
            startLasso(point);
          }
        };
        const extendDb = throttleAndDebounce(extend, minDelay, minDelay);
        const extendPublic = (event, debounced) => {
          const mousePosition = getMousePosition(event);
          if (debounced) {
            return extendDb(mousePosition);
          }
          return extend(mousePosition);
        };
        const clear = () => {
          lassoPos = [];
          lassoPosFlat = [];
          lassoBrushCenterPos = [];
          lassoBrushNormals = [];
          prevMousePos = void 0;
          draw();
        };
        const initiatorClickHandler = (event) => {
          showInitiator(event);
        };
        const initiatorMouseDownHandler = () => {
          isMouseDown = true;
          isLasso = true;
          clear();
          onStart();
        };
        const initiatorMouseLeaveHandler = () => {
          hideInitiator();
        };
        const end = ({ merge = false, remove = false } = {}) => {
          isLasso = false;
          const currLassoPos = [...lassoPos];
          const currLassoPosFlat = [...lassoPosFlat];
          extendDb.cancel();
          clear();
          if (currLassoPos.length > 0) {
            onEnd(currLassoPos, currLassoPosFlat, { merge, remove });
          }
          return currLassoPos;
        };
        const setExtendLasso = (newType) => {
          switch (newType) {
            case "rectangle": {
              type = newType;
              extendLasso = extendRectangle;
              startLasso = extendFreeform;
              break;
            }
            case "brush": {
              type = newType;
              extendLasso = extendBrush;
              startLasso = startBrush;
              break;
            }
            default: {
              type = "freeform";
              extendLasso = extendFreeform;
              startLasso = extendFreeform;
              break;
            }
          }
        };
        const get = (property) => {
          if (property === "onDraw") {
            return onDraw;
          }
          if (property === "onStart") {
            return onStart;
          }
          if (property === "onEnd") {
            return onEnd;
          }
          if (property === "enableInitiator") {
            return enableInitiator;
          }
          if (property === "minDelay") {
            return minDelay;
          }
          if (property === "minDist") {
            return minDist;
          }
          if (property === "pointNorm") {
            return pointNorm;
          }
          if (property === "type") {
            return type;
          }
          if (property === "brushSize") {
            return brushSize;
          }
        };
        const set = ({
          onDraw: newOnDraw = null,
          onStart: newOnStart = null,
          onEnd: newOnEnd = null,
          enableInitiator: newEnableInitiator = null,
          initiatorParentElement: newInitiatorParentElement = null,
          longPressIndicatorParentElement: newLongPressIndicatorParentElement = null,
          minDelay: newMinDelay = null,
          minDist: newMinDist = null,
          pointNorm: newPointNorm = null,
          type: newType = null,
          brushSize: newBrushSize = null
        } = {}) => {
          onDraw = ifNotNull(newOnDraw, onDraw);
          onStart = ifNotNull(newOnStart, onStart);
          onEnd = ifNotNull(newOnEnd, onEnd);
          enableInitiator = ifNotNull(newEnableInitiator, enableInitiator);
          minDelay = ifNotNull(newMinDelay, minDelay);
          minDist = ifNotNull(newMinDist, minDist);
          pointNorm = ifNotNull(newPointNorm, pointNorm);
          brushSize = ifNotNull(newBrushSize, brushSize);
          if (newInitiatorParentElement !== null && newInitiatorParentElement !== initiatorParentElement) {
            initiatorParentElement.removeChild(initiator);
            newInitiatorParentElement.appendChild(initiator);
            initiatorParentElement = newInitiatorParentElement;
          }
          if (newLongPressIndicatorParentElement !== null && newLongPressIndicatorParentElement !== longPressIndicatorParentElement) {
            longPressIndicatorParentElement.removeChild(longPress);
            newLongPressIndicatorParentElement.appendChild(longPress);
            longPressIndicatorParentElement = newLongPressIndicatorParentElement;
          }
          if (enableInitiator) {
            initiator.addEventListener("click", initiatorClickHandler);
            initiator.addEventListener("mousedown", initiatorMouseDownHandler);
            initiator.addEventListener("mouseleave", initiatorMouseLeaveHandler);
          } else {
            initiator.removeEventListener("mousedown", initiatorMouseDownHandler);
            initiator.removeEventListener("mouseleave", initiatorMouseLeaveHandler);
          }
          if (newType !== null) {
            setExtendLasso(newType);
          }
        };
        const destroy = () => {
          initiatorParentElement.removeChild(initiator);
          longPressIndicatorParentElement.removeChild(longPress);
          window.removeEventListener("mouseup", mouseUpHandler);
          initiator.removeEventListener("click", initiatorClickHandler);
          initiator.removeEventListener("mousedown", initiatorMouseDownHandler);
          initiator.removeEventListener("mouseleave", initiatorMouseLeaveHandler);
        };
        const withPublicMethods = () => (self2) => assign(self2, {
          clear,
          destroy,
          end,
          extend: extendPublic,
          get,
          set,
          showInitiator,
          hideInitiator,
          showLongPressIndicator,
          hideLongPressIndicator
        });
        initiatorParentElement.appendChild(initiator);
        longPressIndicatorParentElement.appendChild(longPress);
        set({
          onDraw,
          onStart,
          onEnd,
          enableInitiator,
          initiatorParentElement,
          type,
          brushSize
        });
        return pipe(
          withStaticProperty("initiator", initiator),
          withStaticProperty("longPressIndicator", longPress),
          withPublicMethods(),
          withConstructor(createLasso)
        )({});
      };
      FRAGMENT_SHADER$1 = `
precision highp float;

uniform float antiAliasing;

varying vec4 color;
varying float finalPointSize;

float linearstep(float edge0, float edge1, float x) {
  return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
}

void main() {
  vec2 c = gl_PointCoord * 2.0 - 1.0;
  float sdf = length(c) * finalPointSize;
  float alpha = linearstep(finalPointSize + antiAliasing, finalPointSize - antiAliasing, sdf);

  gl_FragColor = vec4(color.rgb, alpha * color.a);
}
`;
      createVertexShader = (globalState) => `
precision highp float;

uniform sampler2D colorTex;
uniform float colorTexRes;
uniform float colorTexEps;
uniform sampler2D stateTex;
uniform float stateTexRes;
uniform float stateTexEps;
uniform float devicePixelRatio;
uniform sampler2D encodingTex;
uniform float encodingTexRes;
uniform float encodingTexEps;
uniform float pointSizeExtra;
uniform float pointOpacityMax;
uniform float pointOpacityScale;
uniform float numPoints;
uniform float globalState;
uniform float isColoredByZ;
uniform float isColoredByW;
uniform float isOpacityByZ;
uniform float isOpacityByW;
uniform float isOpacityByDensity;
uniform float isSizedByZ;
uniform float isSizedByW;
uniform float isPixelAligned;
uniform float colorMultiplicator;
uniform float opacityMultiplicator;
uniform float opacityDensity;
uniform float sizeMultiplicator;
uniform float numColorStates;
uniform float pointScale;
uniform float drawingBufferWidth;
uniform float drawingBufferHeight;
uniform mat4 modelViewProjection;

attribute vec2 stateIndex;

varying vec4 color;
varying float finalPointSize;

void main() {
  vec4 state = texture2D(stateTex, stateIndex);

  if (isPixelAligned < 0.5) {
    gl_Position = modelViewProjection * vec4(state.x, state.y, 0.0, 1.0);
  } else {
    vec4 clipSpacePosition = modelViewProjection * vec4(state.x, state.y, 0.0, 1.0);
    vec2 ndcPosition = clipSpacePosition.xy / clipSpacePosition.w;
    vec2 pixelPos = 0.5 * (ndcPosition + 1.0) * vec2(drawingBufferWidth, drawingBufferHeight);
    pixelPos = floor(pixelPos + 0.5); // Snap to nearest pixel
    vec2 snappedPosition = (pixelPos / vec2(drawingBufferWidth, drawingBufferHeight)) * 2.0 - 1.0;
    gl_Position = vec4(snappedPosition, 0.0, 1.0);
  }


  // Determine color index
  float colorIndexZ =  isColoredByZ * floor(state.z * colorMultiplicator);
  float colorIndexW =  isColoredByW * floor(state.w * colorMultiplicator);

  // Multiply by the number of color states per color
  // I.e., normal, active, hover, background, etc.
  float colorIndex = (colorIndexZ + colorIndexW) * numColorStates;

  // Half a "pixel" or "texel" in texture coordinates
  float colorLinearIndex = colorIndex + globalState;

  // Need to add cEps here to avoid floating point issue that can lead to
  // dramatic changes in which color is loaded as floor(3/2.9999) = 1 but
  // floor(3/3.0001) = 0!
  float colorRowIndex = floor((colorLinearIndex + colorTexEps) / colorTexRes);

  vec2 colorTexIndex = vec2(
    (colorLinearIndex / colorTexRes) - colorRowIndex + colorTexEps,
    colorRowIndex / colorTexRes + colorTexEps
  );

  color = texture2D(colorTex, colorTexIndex);

  // Retrieve point size
  float pointSizeIndexZ = isSizedByZ * floor(state.z * sizeMultiplicator);
  float pointSizeIndexW = isSizedByW * floor(state.w * sizeMultiplicator);
  float pointSizeIndex = pointSizeIndexZ + pointSizeIndexW;

  float pointSizeRowIndex = floor((pointSizeIndex + encodingTexEps) / encodingTexRes);
  vec2 pointSizeTexIndex = vec2(
    (pointSizeIndex / encodingTexRes) - pointSizeRowIndex + encodingTexEps,
    pointSizeRowIndex / encodingTexRes + encodingTexEps
  );
  float pointSize = texture2D(encodingTex, pointSizeTexIndex).x;

  // Retrieve opacity
  ${(() => {
        if (globalState === 3) return "";
        return `
        if (isOpacityByDensity < 0.5) {
          float opacityIndexZ = isOpacityByZ * floor(state.z * opacityMultiplicator);
          float opacityIndexW = isOpacityByW * floor(state.w * opacityMultiplicator);
          float opacityIndex = opacityIndexZ + opacityIndexW;

          float opacityRowIndex = floor((opacityIndex + encodingTexEps) / encodingTexRes);
          vec2 opacityTexIndex = vec2(
            (opacityIndex / encodingTexRes) - opacityRowIndex + encodingTexEps,
            opacityRowIndex / encodingTexRes + encodingTexEps
          );
          color.a = texture2D(encodingTex, opacityTexIndex)[${1 + globalState}];
        } else {
          color.a = min(1.0, opacityDensity + globalState);
        }
      `;
      })()}

  color.a = min(pointOpacityMax, color.a) * pointOpacityScale;
  finalPointSize = (pointSize * pointScale) + pointSizeExtra;
  gl_PointSize = finalPointSize;
}
`;
      FRAGMENT_SHADER = `precision highp float;

varying vec4 color;

void main() {
  gl_FragColor = color;
}
`;
      SHADER$1 = `precision highp float;

uniform sampler2D startStateTex;
uniform sampler2D endStateTex;
uniform float t;

varying vec2 particleTextureIndex;

void main() {
  // Interpolate x, y, and value
  vec3 start = texture2D(startStateTex, particleTextureIndex).xyw;
  vec3 end = texture2D(endStateTex, particleTextureIndex).xyw;
  vec3 curr = start * (1.0 - t) + end * t;

  // The category cannot be interpolated
  float endCategory = texture2D(endStateTex, particleTextureIndex).z;

  gl_FragColor = vec4(curr.xy, endCategory, curr.z);
}`;
      SHADER = `precision highp float;

attribute vec2 position;
varying vec2 particleTextureIndex;

void main() {
  // map normalized device coords to texture coords
  particleTextureIndex = 0.5 * (1.0 + position);

  gl_Position = vec4(position, 0, 1);
}`;
      checkReglExtensions = (regl, silent) => {
        if (!regl) {
          return false;
        }
        return GL_EXTENSIONS.reduce((every, extension) => {
          if (!regl.hasExtension(extension)) {
            if (!silent) {
              console.warn(
                `WebGL: ${extension} extension not supported. Scatterplot might not render properly`
              );
            }
            return false;
          }
          return every;
        }, true);
      };
      createRegl = (canvas) => {
        const gl = canvas.getContext("webgl", {
          antialias: true,
          preserveDrawingBuffer: true
        });
        const extensions = [];
        for (const extension of GL_EXTENSIONS) {
          if (gl.getExtension(extension)) {
            extensions.push(extension);
          } else {
            console.warn(
              `WebGL: ${extension} extension not supported. Scatterplot might not render properly`
            );
          }
        }
        return (0, import_regl.default)({ gl, extensions });
      };
      dist = (x1, y1, x2, y2) => Math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2);
      getBBox = (positions2d) => {
        let xMin = Number.POSITIVE_INFINITY;
        let xMax = Number.NEGATIVE_INFINITY;
        let yMin = Number.POSITIVE_INFINITY;
        let yMax = Number.NEGATIVE_INFINITY;
        for (let i = 0; i < positions2d.length; i += 2) {
          xMin = positions2d[i] < xMin ? positions2d[i] : xMin;
          xMax = positions2d[i] > xMax ? positions2d[i] : xMax;
          yMin = positions2d[i + 1] < yMin ? positions2d[i + 1] : yMin;
          yMax = positions2d[i + 1] > yMax ? positions2d[i + 1] : yMax;
        }
        return [xMin, yMin, xMax, yMax];
      };
      isValidBBox = ([xMin, yMin, xMax, yMax]) => Number.isFinite(xMin) && Number.isFinite(yMin) && Number.isFinite(xMax) && Number.isFinite(yMax) && xMax - xMin > 0 && yMax - yMin > 0;
      REGEX_HEX_TO_RGB = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
      hexToRgb = (hex, isNormalize = false) => hex.replace(REGEX_HEX_TO_RGB, (_m2, r, g, b) => `#${r}${r}${g}${g}${b}${b}`).substring(1).match(/.{2}/g).map((x) => Number.parseInt(x, 16) / 255 ** isNormalize);
      isConditionalArray = (a, condition, { minLength = 0 } = {}) => Array.isArray(a) && a.length >= minLength && a.every(condition);
      isPositiveNumber = (x) => !Number.isNaN(+x) && +x >= 0;
      isStrictlyPositiveNumber = (x) => !Number.isNaN(+x) && +x > 0;
      limit = (choices, defaultChoice) => (choice) => choices.indexOf(choice) >= 0 ? choice : defaultChoice;
      loadImage = (src, isCrossOrigin = false, timeout = DEFAULT_IMAGE_LOAD_TIMEOUT) => new Promise((resolve, reject) => {
        const image = new Image();
        if (isCrossOrigin) {
          image.crossOrigin = "anonymous";
        }
        image.src = src;
        image.onload = () => {
          resolve(image);
        };
        const rejectPromise = () => {
          reject(new Error(IMAGE_LOAD_ERROR));
        };
        image.onerror = rejectPromise;
        setTimeout(rejectPromise, timeout);
      });
      createTextureFromUrl = (regl, url, timeout = DEFAULT_IMAGE_LOAD_TIMEOUT) => new Promise((resolve, reject) => {
        loadImage(
          url,
          url.indexOf(window.location.origin) !== 0 && url.indexOf("base64") === -1,
          timeout
        ).then((image) => {
          resolve(regl.texture(image));
        }).catch((error) => {
          reject(error);
        });
      });
      hexToRgba = (hex, isNormalize = false) => [
        ...hexToRgb(hex, isNormalize),
        255 ** !isNormalize
      ];
      REGEX_IS_HEX = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i;
      isHex = (hex) => REGEX_IS_HEX.test(hex);
      isNormFloat = (x) => x >= 0 && x <= 1;
      isNormFloatArray = (a) => Array.isArray(a) && a.every(isNormFloat);
      isPointInPolygon = (polygon, [px, py] = []) => {
        let winding = 0;
        for (let i = 0, j = polygon.length - 2; i < polygon.length; i += 2) {
          const x1 = polygon[i];
          const y1 = polygon[i + 1];
          const x2 = polygon[j];
          const y2 = polygon[j + 1];
          if (y1 <= py) {
            if (y2 > py) {
              const orientation = crossProduct(x1, y1, x2, y2, px, py);
              if (orientation > 0) {
                winding++;
              }
            }
          } else if (y2 <= py) {
            const orientation = crossProduct(x1, y1, x2, y2, px, py);
            if (orientation < 0) {
              winding--;
            }
          }
          j = i;
        }
        return winding !== 0;
      };
      isString2 = (s) => typeof s === "string" || s instanceof String;
      isUint8 = (x) => Number.isInteger(x) && x >= 0 && x <= 255;
      isUint8Array = (a) => Array.isArray(a) && a.every(isUint8);
      isRgb = (rgb) => rgb.length === 3 && (isNormFloatArray(rgb) || isUint8Array(rgb));
      isRgba = (rgba) => rgba.length === 4 && (isNormFloatArray(rgba) || isUint8Array(rgba));
      isMultipleColors = (color) => Array.isArray(color) && color.length > 0 && (Array.isArray(color[0]) || isString2(color[0]));
      isSameRgbas = (a, b) => {
        if (!(Array.isArray(a) && Array.isArray(b)) || a.length !== b.length) {
          return false;
        }
        if (a.length === 0) {
          return true;
        }
        if (!(Array.isArray(a[0]) && Array.isArray(b[0]))) {
          return false;
        }
        return a.every(([r1, g1, b1, a1], i) => {
          const [r2, g2, b2, a2] = b[i];
          return r1 === r2 && g1 === g2 && b1 === b2 && a1 === a2;
        });
      };
      max = (a, b) => a > b ? a : b;
      min = (a, b) => a < b ? a : b;
      toRgba = (color, shouldNormalize) => {
        if (isRgba(color)) {
          const isNormalized = isNormFloatArray(color);
          if (shouldNormalize && isNormalized || !(shouldNormalize || isNormalized)) {
            return color;
          }
          if (shouldNormalize && !isNormalized) {
            return color.map((x) => x / 255);
          }
          return color.map((x) => x * 255);
        }
        if (isRgb(color)) {
          const base = 255 ** !shouldNormalize;
          const isNormalized = isNormFloatArray(color);
          if (shouldNormalize && isNormalized || !(shouldNormalize || isNormalized)) {
            return [...color, base];
          }
          if (shouldNormalize && !isNormalized) {
            return [...color.map((x) => x / 255), base];
          }
          return [...color.map((x) => x * 255), base];
        }
        if (isHex(color)) {
          return hexToRgba(color, shouldNormalize);
        }
        console.warn(
          "Only HEX, RGB, and RGBA are handled by this function. Returning white instead."
        );
        return shouldNormalize ? [1, 1, 1, 1] : [255, 255, 255, 255];
      };
      flipObj = (obj) => Object.entries(obj).reduce((out, [key, value]) => {
        if (out[value]) {
          out[value] = [...out[value], key];
        } else {
          out[value] = key;
        }
        return out;
      }, {});
      rgbBrightness = (rgb) => 0.21 * rgb[0] + 0.72 * rgb[1] + 0.07 * rgb[2];
      clip = (value, minValue, maxValue) => Math.min(maxValue, Math.max(minValue, value));
      toArrayOrientedPoints = (points) => new Promise((resolve, reject) => {
        if (!points || Array.isArray(points)) {
          resolve(points);
        } else {
          const length = Array.isArray(points.x) || ArrayBuffer.isView(points.x) ? points.x.length : 0;
          const getX = (Array.isArray(points.x) || ArrayBuffer.isView(points.x)) && ((i) => points.x[i]);
          const getY = (Array.isArray(points.y) || ArrayBuffer.isView(points.y)) && ((i) => points.y[i]);
          const getL = (Array.isArray(points.line) || ArrayBuffer.isView(points.line)) && ((i) => points.line[i]);
          const getLO = (Array.isArray(points.lineOrder) || ArrayBuffer.isView(points.lineOrder)) && ((i) => points.lineOrder[i]);
          const components = Object.keys(points);
          const getZ = (() => {
            const z = components.find((c) => Z_NAMES.has(c));
            return z && (Array.isArray(points[z]) || ArrayBuffer.isView(points[z])) && ((i) => points[z][i]);
          })();
          const getW = (() => {
            const w = components.find((c) => W_NAMES.has(c));
            return w && (Array.isArray(points[w]) || ArrayBuffer.isView(points[w])) && ((i) => points[w][i]);
          })();
          if (getX && getY && getZ && getW && getL && getLO) {
            resolve(
              points.x.map((x, i) => [
                x,
                getY(i),
                getZ(i),
                getW(i),
                getL(i),
                getLO(i)
              ])
            );
          } else if (getX && getY && getZ && getW && getL) {
            resolve(
              Array.from({ length }, (_, i) => [
                getX(i),
                getY(i),
                getZ(i),
                getW(i),
                getL(i)
              ])
            );
          } else if (getX && getY && getZ && getW) {
            resolve(
              Array.from({ length }, (_, i) => [
                getX(i),
                getY(i),
                getZ(i),
                getW(i)
              ])
            );
          } else if (getX && getY && getZ) {
            resolve(Array.from({ length }, (_, i) => [getX(i), getY(i), getZ(i)]));
          } else if (getX && getY) {
            resolve(Array.from({ length }, (_, i) => [getX(i), getY(i)]));
          } else {
            reject(new Error("You need to specify at least x and y"));
          }
        }
      });
      isHorizontalLine = (annotation) => Number.isFinite(annotation.y) && !("x" in annotation);
      isVerticalLine = (annotation) => Number.isFinite(annotation.x) && !("y" in annotation);
      isDomRect = (annotation) => Number.isFinite(annotation.x) && Number.isFinite(annotation.y) && Number.isFinite(annotation.width) && Number.isFinite(annotation.height);
      isRect = (annotation) => Number.isFinite(annotation.x1) && Number.isFinite(annotation.y1) && Number.isFinite(annotation.x2) && Number.isFinite(annotation.x2);
      isPolygonAnnotation = (annotation) => "vertices" in annotation && annotation.vertices.length > 1;
      isVertices = (arg) => {
        if (!Array.isArray(arg) || arg.length < 3) {
          return false;
        }
        for (const vertex of arg) {
          if (!Array.isArray(vertex) || vertex.length !== 2 || typeof vertex[0] !== "number" || typeof vertex[1] !== "number") {
            return false;
          }
        }
        return true;
      };
      verticesToPolygon = (vertices) => {
        const polygon = [...vertices];
        const firstVertex = vertices.at(0);
        const lastVertex = vertices.at(-1);
        if (firstVertex[0] !== lastVertex[0] || firstVertex[1] !== lastVertex[1]) {
          polygon.push(firstVertex);
        }
        return polygon;
      };
      insertionSort = (array) => {
        const end = array.length;
        for (let i = 1; i < end; i++) {
          const current = array[i];
          let j = i - 1;
          while (j > -1 && current < array[j]) {
            array[j + 1] = array[j];
            j--;
          }
          array[j + 1] = current;
        }
        return array;
      };
      createRenderer = (options = {}) => {
        let {
          regl,
          canvas = document.createElement("canvas"),
          gamma = DEFAULT_GAMMA
        } = options;
        let isDestroyed = false;
        if (!regl) {
          regl = createRegl(canvas);
        }
        const isSupportingAllGlExtensions = checkReglExtensions(regl);
        const fboRes = [canvas.width, canvas.height];
        const fbo = regl.framebuffer({
          width: fboRes[0],
          height: fboRes[1],
          colorFormat: "rgba",
          colorType: "float"
        });
        const renderToCanvas = regl({
          vert: `
      precision highp float;
      attribute vec2 xy;
      void main () {
        gl_Position = vec4(xy, 0, 1);
      }`,
          frag: `
      precision highp float;
      uniform vec2 srcRes;
      uniform sampler2D src;
      uniform float gamma;

      vec3 approxLinearToSRGB (vec3 rgb, float gamma) {
        return pow(clamp(rgb, vec3(0), vec3(1)), vec3(1.0 / gamma));
      }

      void main () {
        vec4 color = texture2D(src, gl_FragCoord.xy / srcRes);
        gl_FragColor = vec4(approxLinearToSRGB(color.rgb, gamma), color.a);
      }`,
          attributes: {
            xy: [-4, -4, 4, -4, 0, 4]
          },
          uniforms: {
            src: () => fbo,
            srcRes: () => fboRes,
            gamma: () => gamma
          },
          count: 3,
          depth: { enable: false },
          blend: {
            enable: true,
            func: {
              srcRGB: "one",
              srcAlpha: "one",
              dstRGB: "one minus src alpha",
              dstAlpha: "one minus src alpha"
            }
          }
        });
        const copyTo = (targetCanvas) => {
          const ctx = targetCanvas.getContext("2d");
          ctx.clearRect(0, 0, targetCanvas.width, targetCanvas.height);
          ctx.drawImage(
            canvas,
            (canvas.width - targetCanvas.width) / 2,
            (canvas.height - targetCanvas.height) / 2,
            targetCanvas.width,
            targetCanvas.height,
            0,
            0,
            targetCanvas.width,
            targetCanvas.height
          );
        };
        const render = (draw, targetCanvas) => {
          regl.clear(CLEAR_OPTIONS);
          fbo.use(() => {
            regl.clear(CLEAR_OPTIONS);
            draw();
          });
          renderToCanvas();
          copyTo(targetCanvas);
        };
        const refresh = () => {
          regl.poll();
        };
        const drawFns = /* @__PURE__ */ new Set();
        const onFrame = (draw) => {
          drawFns.add(draw);
          return () => {
            drawFns.delete(draw);
          };
        };
        const frame = regl.frame(() => {
          const iterator = drawFns.values();
          let result = iterator.next();
          while (!result.done) {
            result.value();
            result = iterator.next();
          }
        });
        const resize = (customWidth, customHeight) => {
          const width = customWidth === void 0 ? Math.min(window.innerWidth, window.screen.availWidth) : customWidth;
          const height = customHeight === void 0 ? Math.min(window.innerHeight, window.screen.availHeight) : customHeight;
          canvas.width = width * window.devicePixelRatio;
          canvas.height = height * window.devicePixelRatio;
          fboRes[0] = canvas.width;
          fboRes[1] = canvas.height;
          fbo.resize(...fboRes);
        };
        const resizeHandler = () => {
          resize();
        };
        if (!options.canvas) {
          window.addEventListener("resize", resizeHandler);
          window.addEventListener("orientationchange", resizeHandler);
          resize();
        }
        const destroy = () => {
          isDestroyed = true;
          window.removeEventListener("resize", resizeHandler);
          window.removeEventListener("orientationchange", resizeHandler);
          frame.cancel();
          canvas = void 0;
          regl.destroy();
          regl = void 0;
        };
        return {
          /**
           * Get the associated canvas element
           * @return {HTMLCanvasElement} The associated canvas element
           */
          get canvas() {
            return canvas;
          },
          /**
           * Get the associated Regl instance
           * @return {import('regl').Regl} The associated Regl instance
           */
          get regl() {
            return regl;
          },
          /**
           * Get the gamma value
           * @return {number} The gamma value
           */
          get gamma() {
            return gamma;
          },
          /**
           * Set gamma to a new value
           * @param {number} newGamma - The new gamma value
           */
          set gamma(newGamma) {
            gamma = +newGamma;
          },
          /**
           * Get whether the browser supports all necessary WebGL features
           * @return {boolean} If `true` the browser supports all necessary WebGL features
           */
          get isSupported() {
            return isSupportingAllGlExtensions;
          },
          /**
           * Get whether the renderer (and its Regl instance) is destroyed
           * @return {boolean} If `true` the renderer is destroyed
           */
          get isDestroyed() {
            return isDestroyed;
          },
          render,
          resize,
          onFrame,
          refresh,
          destroy
        };
      };
      worker = function worker2() {
        const catmullRom = (t, p0, p1, p2, p3) => {
          const v0 = (p2 - p0) * 0.5;
          const v1 = (p3 - p1) * 0.5;
          return (2 * p1 - 2 * p2 + v0 + v1) * t * t * t + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t * t + v0 * t + p1;
        };
        const interpolatePoint = (t, points, maxPointIdx) => {
          const p = maxPointIdx * t;
          const intPoint = Math.floor(p);
          const weight = p - intPoint;
          const p0 = points[Math.max(0, intPoint - 1)];
          const p1 = points[intPoint];
          const p2 = points[Math.min(maxPointIdx, intPoint + 1)];
          const p3 = points[Math.min(maxPointIdx, intPoint + 2)];
          return [
            catmullRom(weight, p0[0], p1[0], p2[0], p3[0]),
            catmullRom(weight, p0[1], p1[1], p2[1], p3[1])
          ];
        };
        const sqDist = (x1, y1, x2, y2) => (x1 - x2) ** 2 + (y1 - y2) ** 2;
        const sqSegDist = (p, p1, p2) => {
          let x = p1[0];
          let y = p1[1];
          let dx = p2[0] - x;
          let dy = p2[1] - y;
          if (dx !== 0 || dy !== 0) {
            const t = ((p[0] - x) * dx + (p[1] - y) * dy) / (dx * dx + dy * dy);
            if (t > 1) {
              x = p2[0];
              y = p2[1];
            } else if (t > 0) {
              x += dx * t;
              y += dy * t;
            }
          }
          dx = p[0] - x;
          dy = p[1] - y;
          return dx * dx + dy * dy;
        };
        const simplifyDPStep = (points, first, last, tolerance, simplified) => {
          let maxDist = tolerance;
          let index;
          for (let i = first + 1; i < last; i++) {
            const dist2 = sqSegDist(points[i], points[first], points[last]);
            if (dist2 > maxDist) {
              index = i;
              maxDist = dist2;
            }
          }
          if (maxDist > tolerance) {
            if (index - first > 1) {
              simplifyDPStep(points, first, index, tolerance, simplified);
            }
            simplified.push(points[index]);
            if (last - index > 1) {
              simplifyDPStep(points, index, last, tolerance, simplified);
            }
          }
        };
        const simplifyDouglasPeucker = (points, tolerance) => {
          const last = points.length - 1;
          const simplified = [points[0]];
          simplifyDPStep(points, 0, last, tolerance, simplified);
          simplified.push(points[last]);
          return simplified;
        };
        const interpolatePoints = (points, { maxIntPointsPerSegment = 100, tolerance = 2e-3 } = {}) => {
          const numPoints = points.length;
          const maxPointIdx = numPoints - 1;
          const maxOutPoints = maxPointIdx * maxIntPointsPerSegment + 1;
          const sqTolerance = tolerance ** 2;
          let outPoints = [];
          let prevPoint;
          for (let i = 0; i < numPoints - 1; i++) {
            let segmentPoints = [points[i].slice(0, 2)];
            prevPoint = points[i];
            for (let j = 1; j < maxIntPointsPerSegment; j++) {
              const t = (i * maxIntPointsPerSegment + j) / maxOutPoints;
              const intPoint = interpolatePoint(t, points, maxPointIdx);
              if (sqDist(prevPoint[0], prevPoint[1], intPoint[0], intPoint[1]) > sqTolerance) {
                segmentPoints.push(intPoint);
                prevPoint = intPoint;
              }
            }
            segmentPoints.push(points[i + 1]);
            segmentPoints = simplifyDouglasPeucker(segmentPoints, sqTolerance);
            outPoints = outPoints.concat(
              segmentPoints.slice(0, segmentPoints.length - 1)
            );
          }
          outPoints.push(points[points.length - 1].slice(0, 2));
          return outPoints.flat();
        };
        const groupPoints = (points) => {
          const groupedPoints = {};
          const isOrdered = !Number.isNaN(+points[0][5]);
          points.forEach((point) => {
            const segId = point[4];
            if (!groupedPoints[segId]) {
              groupedPoints[segId] = [];
            }
            if (isOrdered) {
              groupedPoints[segId][point[5]] = point;
            } else {
              groupedPoints[segId].push(point);
            }
          });
          Object.entries(groupedPoints).forEach((idPoints) => {
            groupedPoints[idPoints[0]] = idPoints[1].filter((v) => v);
            groupedPoints[idPoints[0]].reference = idPoints[1][0];
          });
          return groupedPoints;
        };
        self.onmessage = function onmessage(event) {
          const numPoints = event.data.points ? +event.data.points.length : 0;
          if (!numPoints) {
            self.postMessage({ error: new Error("No points provided") });
          }
          event.data.points;
          const groupedPoints = groupPoints(event.data.points);
          self.postMessage({
            points: Object.entries(groupedPoints).reduce(
              (curvePoints, idAndPoints) => {
                curvePoints[idAndPoints[0]] = interpolatePoints(
                  idAndPoints[1],
                  event.data.options
                );
                curvePoints[idAndPoints[0]].reference = idAndPoints[1].reference;
                return curvePoints;
              },
              {}
            )
          });
        };
      };
      createSplineCurve = (points, options = { tolerance: 2e-3, maxIntPointsPerSegment: 100 }) => new Promise((resolve, reject) => {
        const worker$1 = createWorker$1(worker);
        worker$1.onmessage = (e) => {
          if (e.data.error) {
            reject(e.data.error);
          } else {
            resolve(e.data.points);
          }
          worker$1.terminate();
        };
        worker$1.postMessage({ points, options });
      });
      deprecations = {
        showRecticle: {
          replacement: "showReticle",
          removalVersion: "2",
          translation: identity
        },
        recticleColor: {
          replacement: "reticleColor",
          removalVersion: "2",
          translation: identity
        },
        keyMap: {
          replacement: "actionKeyMap",
          removalVersion: "2",
          translation: flipObj
        }
      };
      checkDeprecations = (properties) => {
        const deprecatedProps = Object.keys(properties).filter(
          (prop) => deprecations[prop]
        );
        for (const prop of deprecatedProps) {
          const { replacement, removalVersion, translation } = deprecations[prop];
          console.warn(
            `regl-scatterplot: the "${prop}" property is deprecated and will be removed in v${removalVersion}. Please use "${replacement}" instead.`
          );
          properties[deprecations[prop].replacement] = properties[prop] !== SKIP_DEPRECATION_VALUE_TRANSLATION ? translation(properties[prop]) : properties[prop];
          delete properties[prop];
        }
        return properties;
      };
      getEncodingType = (type, defaultValue, { allowSegment = false, allowDensity = false, allowInherit = false } = {}) => {
        if (Z_NAMES.has(type)) {
          return "valueZ";
        }
        if (W_NAMES.has(type)) {
          return "valueW";
        }
        if (type === "segment") {
          return allowSegment ? "segment" : defaultValue;
        }
        if (type === "density") {
          return allowDensity ? "density" : defaultValue;
        }
        if (type === "inherit") {
          return allowInherit ? "inherit" : defaultValue;
        }
        return defaultValue;
      };
      getEncodingIdx = (type) => {
        switch (type) {
          case "valueZ":
            return 2;
          case "valueW":
            return 3;
          default:
            return null;
        }
      };
      createScatterplot = (initialProperties = {}) => {
        const pubSub = dist_default({
          async: !initialProperties.syncEvents,
          caseInsensitive: true
        });
        const scratch = new Float32Array(16);
        const pvm = new Float32Array(16);
        const mousePosition = [0, 0];
        checkDeprecations(initialProperties);
        let {
          renderer,
          antiAliasing = DEFAULT_ANTI_ALIASING,
          pixelAligned = DEFAULT_PIXEL_ALIGNED,
          backgroundColor = DEFAULT_COLOR_BG,
          backgroundImage = DEFAULT_BACKGROUND_IMAGE,
          canvas = document.createElement("canvas"),
          colorBy = DEFAULT_COLOR_BY,
          deselectOnDblClick = DEFAULT_DESELECT_ON_DBL_CLICK,
          deselectOnEscape = DEFAULT_DESELECT_ON_ESCAPE,
          lassoColor = DEFAULT_LASSO_COLOR,
          lassoLineWidth = DEFAULT_LASSO_LINE_WIDTH,
          lassoMinDelay = DEFAULT_LASSO_MIN_DELAY$1,
          lassoMinDist = DEFAULT_LASSO_MIN_DIST$1,
          lassoClearEvent = DEFAULT_LASSO_CLEAR_EVENT,
          lassoInitiator = DEFAULT_LASSO_INITIATOR,
          lassoInitiatorParentElement = document.body,
          lassoLongPressIndicatorParentElement = document.body,
          lassoOnLongPress = DEFAULT_LASSO_ON_LONG_PRESS,
          lassoLongPressTime = DEFAULT_LASSO_LONG_PRESS_TIME,
          lassoLongPressAfterEffectTime = DEFAULT_LASSO_LONG_PRESS_AFTER_EFFECT_TIME,
          lassoLongPressEffectDelay = DEFAULT_LASSO_LONG_PRESS_EFFECT_DELAY,
          lassoLongPressRevertEffectTime = DEFAULT_LASSO_LONG_PRESS_REVERT_EFFECT_TIME,
          lassoType = DEFAULT_LASSO_TYPE$1,
          lassoBrushSize = DEFAULT_LASSO_BRUSH_SIZE,
          actionKeyMap = DEFAULT_ACTION_KEY_MAP,
          mouseMode = DEFAULT_MOUSE_MODE,
          showReticle = DEFAULT_SHOW_RETICLE,
          reticleColor = DEFAULT_RETICLE_COLOR,
          pointColor = DEFAULT_COLOR_NORMAL,
          pointColorActive = DEFAULT_COLOR_ACTIVE,
          pointColorHover = DEFAULT_COLOR_HOVER,
          showPointConnections = DEFAULT_SHOW_POINT_CONNECTIONS,
          pointConnectionColor = DEFAULT_POINT_CONNECTION_COLOR_NORMAL,
          pointConnectionColorActive = DEFAULT_POINT_CONNECTION_COLOR_ACTIVE,
          pointConnectionColorHover = DEFAULT_POINT_CONNECTION_COLOR_HOVER,
          pointConnectionColorBy = DEFAULT_POINT_CONNECTION_COLOR_BY,
          pointConnectionOpacity = DEFAULT_POINT_CONNECTION_OPACITY,
          pointConnectionOpacityBy = DEFAULT_POINT_CONNECTION_OPACITY_BY,
          pointConnectionOpacityActive = DEFAULT_POINT_CONNECTION_OPACITY_ACTIVE,
          pointConnectionSize = DEFAULT_POINT_CONNECTION_SIZE,
          pointConnectionSizeActive = DEFAULT_POINT_CONNECTION_SIZE_ACTIVE,
          pointConnectionSizeBy = DEFAULT_POINT_CONNECTION_SIZE_BY,
          pointConnectionMaxIntPointsPerSegment = DEFAULT_POINT_CONNECTION_MAX_INT_POINTS_PER_SEGMENT,
          pointConnectionTolerance = DEFAULT_POINT_CONNECTION_INT_POINTS_TOLERANCE,
          pointSize = DEFAULT_POINT_SIZE,
          pointSizeSelected = DEFAULT_POINT_SIZE_SELECTED,
          pointSizeMouseDetection = DEFAULT_POINT_SIZE_MOUSE_DETECTION,
          pointOutlineWidth = DEFAULT_POINT_OUTLINE_WIDTH,
          opacity = AUTO,
          opacityBy = DEFAULT_OPACITY_BY,
          opacityByDensityFill = DEFAULT_OPACITY_BY_DENSITY_FILL,
          opacityInactiveMax = DEFAULT_OPACITY_INACTIVE_MAX,
          opacityInactiveScale = DEFAULT_OPACITY_INACTIVE_SCALE,
          sizeBy = DEFAULT_SIZE_BY,
          pointScaleMode = DEFAULT_POINT_SCALE_MODE,
          height = DEFAULT_HEIGHT,
          width = DEFAULT_WIDTH,
          annotationLineColor = DEFAULT_ANNOTATION_LINE_COLOR,
          annotationLineWidth = DEFAULT_ANNOTATION_LINE_WIDTH,
          annotationHVLineLimit = DEFAULT_ANNOTATION_HVLINE_LIMIT,
          cameraIsFixed = DEFAULT_CAMERA_IS_FIXED
        } = initialProperties;
        let currentWidth = width === AUTO ? 1 : width;
        let currentHeight = height === AUTO ? 1 : height;
        const {
          performanceMode = DEFAULT_PERFORMANCE_MODE,
          opacityByDensityDebounceTime = DEFAULT_OPACITY_BY_DENSITY_DEBOUNCE_TIME,
          spatialIndexUseWorker = DEFAULT_SPATIAL_INDEX_USE_WORKER
        } = initialProperties;
        const renderPointsAsSquares = Boolean(
          initialProperties.renderPointsAsSquares || performanceMode
        );
        const disableAlphaBlending = Boolean(
          initialProperties.disableAlphaBlending || performanceMode
        );
        mouseMode = limit(MOUSE_MODES, MOUSE_MODE_PANZOOM)(mouseMode);
        if (!renderer) {
          renderer = createRenderer({
            regl: initialProperties.regl,
            gamma: initialProperties.gamma
          });
        }
        backgroundColor = toRgba(backgroundColor, true);
        lassoColor = toRgba(lassoColor, true);
        reticleColor = toRgba(reticleColor, true);
        let isDrawing = false;
        let isDestroyed = false;
        let backgroundColorBrightness = rgbBrightness(backgroundColor);
        let camera;
        let lasso;
        let annotations;
        let mouseDown = false;
        let mouseDownTime = null;
        let mouseDownPosition = [0, 0];
        let mouseDownTimeout = -1;
        let selectedPoints = [];
        const selectedPointsSet = /* @__PURE__ */ new Set();
        const selectedPointsConnectionSet = /* @__PURE__ */ new Set();
        let isPointsFiltered = false;
        const filteredPointsSet = /* @__PURE__ */ new Set();
        let points = [];
        let numPoints = 0;
        let numPointsInView = 0;
        let lassoActive = false;
        let lassoPointsCurr = [];
        let spatialIndex;
        let viewAspectRatio;
        let dataAspectRatio = initialProperties.aspectRatio || DEFAULT_DATA_ASPECT_RATIO;
        let projectionLocal;
        let projection;
        let model;
        let pointConnections;
        let pointConnectionMap;
        let computingPointConnectionCurves;
        let reticleHLine;
        let reticleVLine;
        let computedPointSizeMouseDetection;
        let lassoInitiatorTimeout;
        let topRightNdc;
        let bottomLeftNdc;
        let preventEventView = false;
        let draw = true;
        let drawReticleOnce = false;
        let canvasObserver;
        pointColor = isMultipleColors(pointColor) ? [...pointColor] : [pointColor];
        pointColorActive = isMultipleColors(pointColorActive) ? [...pointColorActive] : [pointColorActive];
        pointColorHover = isMultipleColors(pointColorHover) ? [...pointColorHover] : [pointColorHover];
        pointColor = pointColor.map((color) => toRgba(color, true));
        pointColorActive = pointColorActive.map((color) => toRgba(color, true));
        pointColorHover = pointColorHover.map((color) => toRgba(color, true));
        opacity = !Array.isArray(opacity) && Number.isNaN(+opacity) ? pointColor[0][3] : opacity;
        opacity = isConditionalArray(opacity, isPositiveNumber, {
          minLength: 1
        }) ? [...opacity] : [opacity];
        pointSize = isConditionalArray(pointSize, isPositiveNumber, {
          minLength: 1
        }) ? [...pointSize] : [pointSize];
        let minPointScale = MIN_POINT_SIZE / pointSize[0];
        if (pointConnectionColor === "inherit") {
          pointConnectionColor = [...pointColor];
        } else {
          pointConnectionColor = isMultipleColors(pointConnectionColor) ? [...pointConnectionColor] : [pointConnectionColor];
          pointConnectionColor = pointConnectionColor.map(
            (color) => toRgba(color, true)
          );
        }
        if (pointConnectionColorActive === "inherit") {
          pointConnectionColorActive = [...pointColorActive];
        } else {
          pointConnectionColorActive = isMultipleColors(pointConnectionColorActive) ? [...pointConnectionColorActive] : [pointConnectionColorActive];
          pointConnectionColorActive = pointConnectionColorActive.map(
            (color) => toRgba(color, true)
          );
        }
        if (pointConnectionColorHover === "inherit") {
          pointConnectionColorHover = [...pointColorHover];
        } else {
          pointConnectionColorHover = isMultipleColors(pointConnectionColorHover) ? [...pointConnectionColorHover] : [pointConnectionColorHover];
          pointConnectionColorHover = pointConnectionColorHover.map(
            (color) => toRgba(color, true)
          );
        }
        if (pointConnectionOpacity === "inherit") {
          pointConnectionOpacity = [...opacity];
        } else {
          pointConnectionOpacity = isConditionalArray(
            pointConnectionOpacity,
            isPositiveNumber,
            {
              minLength: 1
            }
          ) ? [...pointConnectionOpacity] : [pointConnectionOpacity];
        }
        if (pointConnectionSize === "inherit") {
          pointConnectionSize = [...pointSize];
        } else {
          pointConnectionSize = isConditionalArray(
            pointConnectionSize,
            isPositiveNumber,
            {
              minLength: 1
            }
          ) ? [...pointConnectionSize] : [pointConnectionSize];
        }
        colorBy = getEncodingType(colorBy, DEFAULT_COLOR_BY);
        opacityBy = getEncodingType(opacityBy, DEFAULT_OPACITY_BY, {
          allowDensity: true
        });
        sizeBy = getEncodingType(sizeBy, DEFAULT_SIZE_BY);
        pointConnectionColorBy = getEncodingType(
          pointConnectionColorBy,
          DEFAULT_POINT_CONNECTION_COLOR_BY,
          { allowSegment: true, allowInherit: true }
        );
        pointConnectionOpacityBy = getEncodingType(
          pointConnectionOpacityBy,
          DEFAULT_POINT_CONNECTION_OPACITY_BY,
          { allowSegment: true }
        );
        pointConnectionSizeBy = getEncodingType(
          pointConnectionSizeBy,
          DEFAULT_POINT_CONNECTION_SIZE_BY,
          { allowSegment: true }
        );
        let stateTex;
        let prevStateTex;
        let tmpStateTex;
        let tmpStateBuffer;
        let stateTexRes = 0;
        let stateTexEps = 0;
        let normalPointsIndexBuffer;
        let selectedPointsIndexBuffer;
        let hoveredPointIndexBuffer;
        let cameraZoomTargetStart;
        let cameraZoomTargetEnd;
        let cameraZoomDistanceStart;
        let cameraZoomDistanceEnd;
        let isTransitioning = false;
        let transitionStartTime = null;
        let transitionDuration;
        let transitionEasing;
        let preTransitionShowReticle = showReticle;
        let colorTex;
        let colorTexRes = 0;
        let encodingTex;
        let encodingTexRes = 0;
        let isViewChanged = false;
        let isPointsDrawn = false;
        let isAnnotationsDrawn = false;
        let isMouseOverCanvasChecked = false;
        let valueZDataType = CATEGORICAL;
        let valueWDataType = CATEGORICAL;
        let hoveredPoint;
        let isMouseInCanvas = false;
        let xScale = initialProperties.xScale || null;
        let yScale = initialProperties.yScale || null;
        let xDomainStart = 0;
        let xDomainSize = 0;
        let yDomainStart = 0;
        let yDomainSize = 0;
        if (xScale) {
          xDomainStart = xScale.domain()[0];
          xDomainSize = xScale.domain()[1] - xScale.domain()[0];
          xScale.range([0, currentWidth]);
        }
        if (yScale) {
          yDomainStart = yScale.domain()[0];
          yDomainSize = yScale.domain()[1] - yScale.domain()[0];
          yScale.range([currentHeight, 0]);
        }
        const getNdcX = (x) => -1 + x / currentWidth * 2;
        const getNdcY = (y) => 1 + y / currentHeight * -2;
        const getMouseGlPos = () => [
          getNdcX(mousePosition[0]),
          getNdcY(mousePosition[1])
        ];
        const getScatterGlPos = (xGl, yGl) => {
          const v = [xGl, yGl, 1, 1];
          const mvp = invert(
            scratch,
            multiply(
              scratch,
              projectionLocal,
              multiply(scratch, camera.view, model)
            )
          );
          transformMat4(v, v, mvp);
          return v.slice(0, 2);
        };
        const getPointSizeNdc = (pointSizeIncrease = 0) => {
          const pointScale = getPointScale();
          const heightNdc = topRightNdc[1] - bottomLeftNdc[1];
          const pxNdc = heightNdc / canvas.height;
          return (computedPointSizeMouseDetection * pointScale + pointSizeIncrease) * pxNdc;
        };
        const getPoints = () => {
          if (isPointsFiltered) {
            return points.filter((_, i) => filteredPointsSet.has(i));
          }
          return points;
        };
        const getPointsInBBox = (x0, y0, x1, y1) => {
          const pointsInBBox = spatialIndex.range(x0, y0, x1, y1);
          if (isPointsFiltered) {
            return pointsInBBox.filter((i) => filteredPointsSet.has(i));
          }
          return pointsInBBox;
        };
        const raycast = () => {
          const [xGl, yGl] = getMouseGlPos();
          const [xNdc, yNdc] = getScatterGlPos(xGl, yGl);
          const pointSizeNdc = getPointSizeNdc(4);
          const pointsInBBox = getPointsInBBox(
            xNdc - pointSizeNdc,
            yNdc - pointSizeNdc,
            xNdc + pointSizeNdc,
            yNdc + pointSizeNdc
          );
          let minDist = pointSizeNdc;
          let clostestPointIdx = -1;
          for (const pointIdx of pointsInBBox) {
            const [ptX, ptY] = points[pointIdx];
            const d = dist(ptX, ptY, xNdc, yNdc);
            if (d < minDist) {
              minDist = d;
              clostestPointIdx = pointIdx;
            }
          }
          return clostestPointIdx;
        };
        const lassoExtend = (lassoPoints, lassoPointsFlat) => {
          lassoPointsCurr = lassoPoints;
          lasso.setPoints(lassoPointsFlat);
          pubSub.publish("lassoExtend", { coordinates: lassoPoints });
        };
        const findPointsInLasso = (lassoPolygon) => {
          const bBox = getBBox(lassoPolygon);
          if (!isValidBBox(bBox)) {
            return [];
          }
          const pointsInBBox = getPointsInBBox(...bBox);
          const pointsInPolygon = [];
          for (const pointIdx of pointsInBBox) {
            if (isPointInPolygon(lassoPolygon, points[pointIdx])) {
              pointsInPolygon.push(pointIdx);
            }
          }
          return pointsInPolygon;
        };
        const lassoClear = () => {
          lassoPointsCurr = [];
          if (lasso) {
            lasso.clear();
          }
        };
        const hasPointConnections = (point) => point && point.length > 4;
        const setPointConnectionColorState = (pointIdxs, stateIndex) => {
          if (computingPointConnectionCurves || !showPointConnections || !hasPointConnections(points[pointIdxs[0]])) {
            return;
          }
          const isNormal = stateIndex === 0;
          const lineIdCacher = stateIndex === 1 ? (lineId) => selectedPointsConnectionSet.add(lineId) : identity;
          const lineIds = Object.keys(
            pointIdxs.reduce((ids, pointIdx) => {
              const point = points[pointIdx];
              const isStruct = Array.isArray(point[4]);
              const lineId = isStruct ? point[4][0] : point[4];
              ids[lineId] = true;
              return ids;
            }, {})
          );
          const buffer = pointConnections.getData().opacities;
          const unselectedLineIds = lineIds.filter(
            (lineId) => !selectedPointsConnectionSet.has(+lineId)
          );
          for (const lineId of unselectedLineIds) {
            const index = pointConnectionMap[lineId][0];
            const numPointPerLine = pointConnectionMap[lineId][2];
            const pointOffset = pointConnectionMap[lineId][3];
            const bufferStart = index * 4 + pointOffset * 2;
            const bufferEnd = bufferStart + numPointPerLine * 2 + 4;
            if (buffer.__original__ === void 0) {
              buffer.__original__ = buffer.slice();
            }
            for (let i = bufferStart; i < bufferEnd; i++) {
              buffer[i] = isNormal ? buffer.__original__[i] : pointConnectionOpacityActive;
            }
            lineIdCacher(lineId);
          }
          pointConnections.getBuffer().opacities.subdata(buffer, 0);
        };
        const indexToStateTexCoord = (index) => [
          index % stateTexRes / stateTexRes + stateTexEps,
          Math.floor(index / stateTexRes) / stateTexRes + stateTexEps
        ];
        const isPointsFilteredOut = (pointIdx) => isPointsFiltered && !filteredPointsSet.has(pointIdx);
        const deselect = ({ preventEvent = false } = {}) => {
          if (lassoClearEvent === LASSO_CLEAR_ON_DESELECT) {
            lassoClear();
          }
          if (selectedPoints.length > 0) {
            if (!preventEvent) {
              pubSub.publish("deselect");
            }
            selectedPointsConnectionSet.clear();
            setPointConnectionColorState(selectedPoints, 0);
            selectedPoints = [];
            selectedPointsSet.clear();
            draw = true;
          }
        };
        const verticesFromDataToGl = (vertices) => {
          if (!(xScale && yScale)) {
            console.warn(
              "xScale and yScale must be defined for programmatic lasso selection"
            );
            return null;
          }
          const verticesGl = [];
          for (const [x, y] of vertices) {
            const xNorm = (x - xDomainStart) / xDomainSize;
            const yNorm = (y - yDomainStart) / yDomainSize;
            const xNdc = xNorm * 2 - 1;
            const yNdc = yNorm * 2 - 1;
            const [xGl, yGl] = getScatterGlPos(xNdc, yNdc);
            verticesGl.push(xGl, yGl);
          }
          return verticesGl;
        };
        const select = (pointIdxs, { merge = false, remove = false, preventEvent = false } = {}) => {
          const newSelectedPoints = Array.isArray(pointIdxs) ? pointIdxs : [pointIdxs];
          const currSelectedPoints = [...selectedPoints];
          if (merge) {
            selectedPoints = unionIntegers(selectedPoints, newSelectedPoints);
            if (currSelectedPoints.length === selectedPoints.length) {
              draw = true;
              return;
            }
          } else if (remove) {
            const newSelectedPointsSet = new Set(newSelectedPoints);
            selectedPoints = selectedPoints.filter(
              (point) => !newSelectedPointsSet.has(point)
            );
            if (currSelectedPoints.length === selectedPoints.length) {
              draw = true;
              return;
            }
          } else {
            if (selectedPoints?.length > 0) {
              setPointConnectionColorState(selectedPoints, 0);
            }
            if (currSelectedPoints.length > 0 && newSelectedPoints.length === 0) {
              deselect({ preventEvent });
              return;
            }
            selectedPoints = newSelectedPoints;
          }
          if (hasSameElements(currSelectedPoints, selectedPoints)) {
            draw = true;
            return;
          }
          const selectedPointsBuffer = [];
          selectedPointsSet.clear();
          selectedPointsConnectionSet.clear();
          for (let i = selectedPoints.length - 1; i >= 0; i--) {
            const pointIdx = selectedPoints[i];
            if (pointIdx < 0 || pointIdx >= numPoints || isPointsFilteredOut(pointIdx)) {
              selectedPoints.splice(i, 1);
              continue;
            }
            selectedPointsSet.add(pointIdx);
            selectedPointsBuffer.push.apply(
              selectedPointsBuffer,
              indexToStateTexCoord(pointIdx)
            );
          }
          selectedPointsIndexBuffer({
            usage: "dynamic",
            type: "float",
            data: selectedPointsBuffer
          });
          setPointConnectionColorState(selectedPoints, 1);
          if (!preventEvent) {
            pubSub.publish("select", { points: selectedPoints });
          }
          draw = true;
        };
        const lassoSelect = (vertices, { merge = false, remove = false, isGl = false } = {}) => {
          if (!isVertices(vertices)) {
            throw new Error(
              "Lasso selection requires at least 3 vertices as [x, y] coordinate pairs"
            );
          }
          const closedPolygon = verticesToPolygon(vertices);
          let polygonGl;
          let polygonGlFlat;
          if (isGl) {
            polygonGl = closedPolygon;
            polygonGlFlat = closedPolygon.flat();
          } else {
            polygonGlFlat = verticesFromDataToGl(closedPolygon);
            if (!polygonGlFlat) {
              throw new Error(
                "xScale and yScale must be defined to convert lasso vertices from data space to GL space"
              );
            }
            polygonGl = [];
            for (let i = 0; i < polygonGlFlat.length; i += 2) {
              polygonGl.push([polygonGlFlat[i], polygonGlFlat[i + 1]]);
            }
          }
          lassoEnd(polygonGl, polygonGlFlat, { merge, remove });
        };
        const hover = (point, { showReticleOnce = false, preventEvent = false } = {}) => {
          let needsRedraw = false;
          const isFilteredOut = isPointsFiltered && !filteredPointsSet.has(point);
          if (!isFilteredOut && point >= 0 && point < numPoints) {
            needsRedraw = true;
            const oldHoveredPoint = hoveredPoint;
            const newHoveredPoint = point !== hoveredPoint;
            if (+oldHoveredPoint >= 0 && newHoveredPoint && !selectedPointsSet.has(oldHoveredPoint)) {
              setPointConnectionColorState([oldHoveredPoint], 0);
            }
            hoveredPoint = point;
            hoveredPointIndexBuffer.subdata(indexToStateTexCoord(point));
            if (!selectedPointsSet.has(point)) {
              setPointConnectionColorState([point], 2);
            }
            if (newHoveredPoint && !preventEvent) {
              pubSub.publish("pointover", hoveredPoint);
            }
          } else {
            needsRedraw = +hoveredPoint >= 0;
            if (needsRedraw) {
              if (!selectedPointsSet.has(hoveredPoint)) {
                setPointConnectionColorState([hoveredPoint], 0);
              }
              if (!preventEvent) {
                pubSub.publish("pointout", hoveredPoint);
              }
            }
            hoveredPoint = void 0;
          }
          if (needsRedraw) {
            draw = true;
            drawReticleOnce = showReticleOnce;
          }
        };
        const getRelativeMousePosition = (event) => {
          const rect = canvas.getBoundingClientRect();
          mousePosition[0] = event.clientX - rect.left;
          mousePosition[1] = event.clientY - rect.top;
          return [...mousePosition];
        };
        const lassoStart = () => {
          camera.config({ isFixed: true });
          mouseDown = true;
          lassoActive = true;
          lassoClear();
          if (mouseDownTimeout >= 0) {
            clearTimeout(mouseDownTimeout);
            mouseDownTimeout = -1;
          }
          pubSub.publish("lassoStart");
        };
        const lassoEnd = (lassoPoints, lassoPointsFlat, { merge = false, remove = false } = {}) => {
          camera.config({ isFixed: cameraIsFixed });
          lassoPointsCurr = [...lassoPoints];
          const pointsInLasso = findPointsInLasso(lassoPointsFlat);
          select(pointsInLasso, { merge, remove });
          pubSub.publish("lassoEnd", {
            coordinates: lassoPointsCurr
          });
          if (lassoClearEvent === LASSO_CLEAR_ON_END) {
            lassoClear();
          }
        };
        const lassoManager = createLasso(canvas, {
          onStart: lassoStart,
          onDraw: lassoExtend,
          onEnd: lassoEnd,
          enableInitiator: lassoInitiator,
          initiatorParentElement: lassoInitiatorParentElement,
          longPressIndicatorParentElement: lassoLongPressIndicatorParentElement,
          pointNorm: ([x, y]) => getScatterGlPos(getNdcX(x), getNdcY(y)),
          minDelay: lassoMinDelay,
          minDist: lassoType === "brush" ? Math.max(LASSO_BRUSH_MIN_MIN_DIST, lassoMinDist) : lassoMinDist,
          type: lassoType
        });
        const checkLassoMode = () => mouseMode === MOUSE_MODE_LASSO;
        const checkModKey = (event, action) => {
          switch (actionKeyMap[action]) {
            case KEY_ALT:
              return event.altKey;
            case KEY_CMD:
              return event.metaKey;
            case KEY_CTRL:
              return event.ctrlKey;
            case KEY_META:
              return event.metaKey;
            case KEY_SHIFT:
              return event.shiftKey;
            default:
              return false;
          }
        };
        const checkIfMouseIsOverCanvas = (event) => document.elementsFromPoint(event.clientX, event.clientY).some((element) => element === canvas);
        const mouseDownHandler = (event) => {
          if (!isPointsDrawn || event.buttons !== 1) {
            return;
          }
          mouseDown = true;
          mouseDownTime = performance.now();
          mouseDownPosition = getRelativeMousePosition(event);
          lassoActive = checkLassoMode() || checkModKey(event, KEY_ACTION_LASSO);
          if (!lassoActive && lassoOnLongPress) {
            lassoManager.showLongPressIndicator(event.clientX, event.clientY, {
              time: lassoLongPressTime,
              extraTime: lassoLongPressAfterEffectTime,
              delay: lassoLongPressEffectDelay
            });
            mouseDownTimeout = setTimeout(() => {
              mouseDownTimeout = -1;
              lassoActive = true;
            }, lassoLongPressTime);
          }
        };
        const mouseUpHandler = (event) => {
          if (!isPointsDrawn) {
            return;
          }
          mouseDown = false;
          if (mouseDownTimeout >= 0) {
            clearTimeout(mouseDownTimeout);
            mouseDownTimeout = -1;
          }
          if (lassoActive) {
            event.preventDefault();
            lassoActive = false;
            lassoManager.end({
              merge: checkModKey(event, KEY_ACTION_MERGE),
              remove: checkModKey(event, KEY_ACTION_REMOVE)
            });
          }
          if (lassoOnLongPress) {
            lassoManager.hideLongPressIndicator({
              time: lassoLongPressRevertEffectTime
            });
          }
        };
        const mouseClickHandler = (event) => {
          if (!isPointsDrawn) {
            return;
          }
          event.preventDefault();
          const currentMousePosition = getRelativeMousePosition(event);
          if (dist(...currentMousePosition, ...mouseDownPosition) >= lassoMinDist) {
            return;
          }
          const clickTime = performance.now() - mouseDownTime;
          if (!lassoInitiator || clickTime < LONG_CLICK_TIME) {
            const clostestPoint = raycast();
            if (clostestPoint >= 0) {
              if (selectedPoints.length > 0 && lassoClearEvent === LASSO_CLEAR_ON_DESELECT) {
                lassoClear();
              }
              select([clostestPoint], {
                merge: checkModKey(event, KEY_ACTION_MERGE),
                remove: checkModKey(event, KEY_ACTION_REMOVE)
              });
            } else if (!lassoInitiatorTimeout) {
              lassoInitiatorTimeout = setTimeout(() => {
                lassoInitiatorTimeout = null;
                lassoManager.showInitiator(event);
              }, SINGLE_CLICK_DELAY);
            }
          }
        };
        const mouseDblClickHandler = (event) => {
          lassoManager.hideInitiator();
          if (lassoInitiatorTimeout) {
            clearTimeout(lassoInitiatorTimeout);
            lassoInitiatorTimeout = null;
          }
          if (deselectOnDblClick) {
            event.preventDefault();
            deselect();
          }
        };
        const mouseMoveHandler = (event) => {
          if (!isMouseOverCanvasChecked) {
            isMouseInCanvas = checkIfMouseIsOverCanvas(event);
            isMouseOverCanvasChecked = true;
          }
          if (!(isPointsDrawn && (isMouseInCanvas || mouseDown))) {
            return;
          }
          const currentMousePosition = getRelativeMousePosition(event);
          const mouseMoveDist = dist(...currentMousePosition, ...mouseDownPosition);
          const mouseMovedMin = mouseMoveDist >= lassoMinDist;
          if (isMouseInCanvas && !lassoActive) {
            hover(raycast());
          }
          if (lassoActive) {
            event.preventDefault();
            lassoManager.extend(event, true);
          } else if (mouseDown && lassoOnLongPress && mouseMovedMin) {
            lassoManager.hideLongPressIndicator({
              time: lassoLongPressRevertEffectTime
            });
          }
          if (mouseDownTimeout >= 0 && mouseMovedMin) {
            clearTimeout(mouseDownTimeout);
            mouseDownTimeout = -1;
          }
          if (mouseDown) {
            draw = true;
          }
        };
        const blurHandler = () => {
          hoveredPoint = void 0;
          isMouseInCanvas = false;
          isMouseOverCanvasChecked = false;
          if (!isPointsDrawn) {
            return;
          }
          if (+hoveredPoint >= 0 && !selectedPointsSet.has(hoveredPoint)) {
            setPointConnectionColorState([hoveredPoint], 0);
          }
          mouseUpHandler();
          draw = true;
        };
        const createEncodingTexture = () => {
          const maxEncoding = Math.max(pointSize.length, opacity.length);
          encodingTexRes = Math.max(2, Math.ceil(Math.sqrt(maxEncoding)));
          const rgba = new Float32Array(encodingTexRes ** 2 * 4);
          for (let i = 0; i < maxEncoding; i++) {
            rgba[i * 4] = pointSize[i] || 0;
            rgba[i * 4 + 1] = Math.min(1, opacity[i] || 0);
            const activeOpacity = Number(
              (pointColorActive[i] || pointColorActive[0])[3]
            );
            rgba[i * 4 + 2] = Math.min(
              1,
              Number.isNaN(activeOpacity) ? 1 : activeOpacity
            );
            const hoverOpacity = Number(
              (pointColorHover[i] || pointColorHover[0])[3]
            );
            rgba[i * 4 + 3] = Math.min(
              1,
              Number.isNaN(hoverOpacity) ? 1 : hoverOpacity
            );
          }
          return renderer.regl.texture({
            data: rgba,
            shape: [encodingTexRes, encodingTexRes, 4],
            type: "float"
          });
        };
        const getColors = (baseColor = pointColor, activeColor = pointColorActive, hoverColor = pointColorHover) => {
          const n = baseColor.length;
          const n2 = activeColor.length;
          const n3 = hoverColor.length;
          const colors = [];
          if (n === n2 && n2 === n3) {
            for (let i = 0; i < n; i++) {
              colors.push(
                baseColor[i],
                activeColor[i],
                hoverColor[i],
                backgroundColor
              );
            }
          } else {
            for (let i = 0; i < n; i++) {
              const rgbaOpaque = [
                baseColor[i][0],
                baseColor[i][1],
                baseColor[i][2],
                1
              ];
              const colorActive = colorBy === DEFAULT_COLOR_BY ? activeColor[0] : rgbaOpaque;
              const colorHover = colorBy === DEFAULT_COLOR_BY ? hoverColor[0] : rgbaOpaque;
              colors.push(baseColor[i], colorActive, colorHover, backgroundColor);
            }
          }
          return colors;
        };
        const createColorTexture = () => {
          const colors = getColors();
          const numColors = colors.length;
          colorTexRes = Math.max(2, Math.ceil(Math.sqrt(numColors)));
          const rgba = new Float32Array(colorTexRes ** 2 * 4);
          colors.forEach((color, i) => {
            rgba[i * 4] = color[0];
            rgba[i * 4 + 1] = color[1];
            rgba[i * 4 + 2] = color[2];
            rgba[i * 4 + 3] = color[3];
          });
          return renderer.regl.texture({
            data: rgba,
            shape: [colorTexRes, colorTexRes, 4],
            type: "float"
          });
        };
        const updateProjectionMatrix = (widthRatio, heightRatio) => {
          projection[0] = widthRatio / viewAspectRatio;
          projection[5] = heightRatio;
        };
        const updateViewAspectRatio = () => {
          viewAspectRatio = currentWidth / currentHeight;
          projectionLocal = fromScaling([], [1 / viewAspectRatio, 1, 1]);
          projection = fromScaling([], [1 / viewAspectRatio, 1, 1]);
          model = fromScaling([], [dataAspectRatio, 1, 1]);
        };
        const setDataAspectRatio = (newDataAspectRatio) => {
          if (+newDataAspectRatio <= 0) {
            return;
          }
          dataAspectRatio = newDataAspectRatio;
        };
        const setColors = (getter, setter) => (newColors) => {
          if (!newColors || newColors.length === 0) {
            return;
          }
          const colors = getter();
          const prevColors = [...colors];
          let tmpColors = isMultipleColors(newColors) ? newColors : [newColors];
          tmpColors = tmpColors.map((color) => toRgba(color, true));
          if (isSameRgbas(prevColors, tmpColors)) {
            return;
          }
          if (colorTex) {
            colorTex.destroy();
          }
          try {
            setter(tmpColors);
            colorTex = createColorTexture();
          } catch (_error) {
            console.error("Invalid colors. Switching back to default colors.");
            setter(prevColors);
            colorTex = createColorTexture();
          }
        };
        const setPointColor = setColors(
          () => pointColor,
          (colors) => {
            pointColor = colors;
          }
        );
        const setPointColorActive = setColors(
          () => pointColorActive,
          (colors) => {
            pointColorActive = colors;
          }
        );
        const setPointColorHover = setColors(
          () => pointColorHover,
          (colors) => {
            pointColorHover = colors;
          }
        );
        const computeDomainView = () => {
          const xyStartPt = getScatterGlPos(-1, -1);
          const xyEndPt = getScatterGlPos(1, 1);
          const xStart = (xyStartPt[0] + 1) / 2;
          const xEnd = (xyEndPt[0] + 1) / 2;
          const yStart = (xyStartPt[1] + 1) / 2;
          const yEnd = (xyEndPt[1] + 1) / 2;
          const xDomainView = [
            xDomainStart + xStart * xDomainSize,
            xDomainStart + xEnd * xDomainSize
          ];
          const yDomainView = [
            yDomainStart + yStart * yDomainSize,
            yDomainStart + yEnd * yDomainSize
          ];
          return [xDomainView, yDomainView];
        };
        const updateScales = () => {
          if (!(xScale || yScale)) {
            return;
          }
          const [xDomainView, yDomainView] = computeDomainView();
          if (xScale) {
            xScale.domain(xDomainView);
          }
          if (yScale) {
            yScale.domain(yDomainView);
          }
        };
        const setCurrentHeight = (newCurrentHeight, skipScaleUpdates) => {
          currentHeight = Math.max(1, newCurrentHeight);
          canvas.height = Math.floor(currentHeight * window.devicePixelRatio);
          if (yScale) {
            yScale.range([currentHeight, 0]);
            if (!skipScaleUpdates) {
              updateScales();
            }
          }
        };
        const setHeight = (newHeight) => {
          if (newHeight === AUTO) {
            height = newHeight;
            canvas.style.height = "100%";
            window.requestAnimationFrame(() => {
              if (canvas) {
                setCurrentHeight(canvas.getBoundingClientRect().height);
              }
            });
            return;
          }
          if (!+newHeight || +newHeight <= 0) {
            return;
          }
          height = +newHeight;
          setCurrentHeight(height);
          canvas.style.height = `${height}px`;
        };
        const computePointSizeMouseDetection = () => {
          computedPointSizeMouseDetection = pointSizeMouseDetection;
          if (pointSizeMouseDetection === AUTO) {
            computedPointSizeMouseDetection = Array.isArray(pointSize) ? max$1(pointSize) : pointSize;
          }
        };
        const setPointSize = (newPointSize) => {
          const oldPointSize = Array.isArray(pointSize) ? [...pointSize] : pointSize;
          if (isConditionalArray(newPointSize, isPositiveNumber, { minLength: 1 })) {
            pointSize = [...newPointSize];
          } else if (isStrictlyPositiveNumber(+newPointSize)) {
            pointSize = [+newPointSize];
          }
          if (oldPointSize === pointSize || hasSameElements(oldPointSize, pointSize)) {
            return;
          }
          if (encodingTex) {
            encodingTex.destroy();
          }
          minPointScale = MIN_POINT_SIZE / pointSize[0];
          encodingTex = createEncodingTexture();
          computePointSizeMouseDetection();
        };
        const setPointSizeSelected = (newPointSizeSelected) => {
          if (!+newPointSizeSelected || +newPointSizeSelected < 0) {
            return;
          }
          pointSizeSelected = +newPointSizeSelected;
        };
        const setPointOutlineWidth = (newPointOutlineWidth) => {
          if (!+newPointOutlineWidth || +newPointOutlineWidth < 0) {
            return;
          }
          pointOutlineWidth = +newPointOutlineWidth;
        };
        const setCurrentWidth = (newCurrentWidth, skipScaleUpdates) => {
          currentWidth = Math.max(1, newCurrentWidth);
          canvas.width = Math.floor(currentWidth * window.devicePixelRatio);
          if (xScale) {
            xScale.range([0, currentWidth]);
            if (!skipScaleUpdates) {
              updateScales();
            }
          }
        };
        const setWidth = (newWidth) => {
          if (newWidth === AUTO) {
            width = newWidth;
            canvas.style.width = "100%";
            window.requestAnimationFrame(() => {
              if (canvas) {
                setCurrentWidth(canvas.getBoundingClientRect().width);
              }
            });
            return;
          }
          if (!+newWidth || +newWidth <= 0) {
            return;
          }
          width = +newWidth;
          setCurrentWidth(width);
          canvas.style.width = `${currentWidth}px`;
        };
        const setOpacity = (newOpacity) => {
          const oldOpacity = Array.isArray(opacity) ? [...opacity] : opacity;
          if (isConditionalArray(newOpacity, isPositiveNumber, { minLength: 1 })) {
            opacity = [...newOpacity];
          } else if (isStrictlyPositiveNumber(+newOpacity)) {
            opacity = [+newOpacity];
          }
          if (oldOpacity === opacity || hasSameElements(oldOpacity, opacity)) {
            return;
          }
          if (encodingTex) {
            encodingTex.destroy();
          }
          encodingTex = createEncodingTexture();
        };
        const getEncodingDataType = (type) => {
          switch (type) {
            case "valueZ":
              return valueZDataType;
            case "valueW":
              return valueWDataType;
            default:
              return null;
          }
        };
        const getEncodingValueToIdx = (type, rangeValues) => {
          switch (type) {
            case CONTINUOUS:
              return (value) => Math.round(value * (rangeValues.length - 1));
            default:
              return identity;
          }
        };
        const setColorBy = (type) => {
          colorBy = getEncodingType(type, DEFAULT_COLOR_BY);
        };
        const setOpacityBy = (type) => {
          opacityBy = getEncodingType(type, DEFAULT_OPACITY_BY, {
            allowDensity: true
          });
        };
        const setSizeBy = (type) => {
          sizeBy = getEncodingType(type, DEFAULT_SIZE_BY);
        };
        const setPointConnectionColorBy = (type) => {
          pointConnectionColorBy = getEncodingType(
            type,
            DEFAULT_POINT_CONNECTION_COLOR_BY,
            { allowSegment: true, allowInherit: true }
          );
        };
        const setPointConnectionOpacityBy = (type) => {
          pointConnectionOpacityBy = getEncodingType(
            type,
            DEFAULT_POINT_CONNECTION_OPACITY_BY,
            { allowSegment: true }
          );
        };
        const setPointConnectionSizeBy = (type) => {
          pointConnectionSizeBy = getEncodingType(
            type,
            DEFAULT_POINT_CONNECTION_SIZE_BY,
            { allowSegment: true }
          );
        };
        const getAntiAliasing = () => antiAliasing;
        const getResolution = () => [canvas.width, canvas.height];
        const getBackgroundImage = () => backgroundImage;
        const getColorTex = () => colorTex;
        const getColorTexRes = () => colorTexRes;
        const getColorTexEps = () => 0.5 / colorTexRes;
        const getDevicePixelRatio = () => window.devicePixelRatio;
        const getNormalPointsIndexBuffer = () => normalPointsIndexBuffer;
        const getSelectedPointsIndexBuffer = () => selectedPointsIndexBuffer;
        const getEncodingTex = () => encodingTex;
        const getEncodingTexRes = () => encodingTexRes;
        const getEncodingTexEps = () => 0.5 / encodingTexRes;
        const getNormalPointSizeExtra = () => 0;
        const getStateTex = () => tmpStateTex || stateTex;
        const getStateTexRes = () => stateTexRes;
        const getStateTexEps = () => 0.5 / stateTexRes;
        const getProjection = () => projection;
        const getView = () => camera.view;
        const getModel = () => model;
        const getModelViewProjection = () => multiply(pvm, projection, multiply(pvm, camera.view, model));
        const getConstantPointScale = () => {
          return window.devicePixelRatio;
        };
        const getLinearPointScale = () => {
          return max(minPointScale, camera.scaling[0]) * window.devicePixelRatio;
        };
        const getAsinhPointScale = () => {
          if (camera.scaling[0] > 1) {
            return Math.asinh(max(1, camera.scaling[0])) / Math.asinh(1) * window.devicePixelRatio;
          }
          return max(minPointScale, camera.scaling[0]) * window.devicePixelRatio;
        };
        let getPointScale = getAsinhPointScale;
        if (pointScaleMode === "linear") {
          getPointScale = getLinearPointScale;
        } else if (pointScaleMode === "constant") {
          getPointScale = getConstantPointScale;
        }
        const getNormalNumPoints = () => isPointsFiltered ? filteredPointsSet.size : numPoints;
        const getSelectedNumPoints = () => selectedPoints.length;
        const getPointOpacityMaxBase = () => getSelectedNumPoints() > 0 ? opacityInactiveMax : 1;
        const getPointOpacityScaleBase = () => getSelectedNumPoints() > 0 ? opacityInactiveScale : 1;
        const getIsColoredByZ = () => +(colorBy === "valueZ");
        const getIsColoredByW = () => +(colorBy === "valueW");
        const getIsOpacityByZ = () => +(opacityBy === "valueZ");
        const getIsOpacityByW = () => +(opacityBy === "valueW");
        const getIsOpacityByDensity = () => +(opacityBy === "density");
        const getIsSizedByZ = () => +(sizeBy === "valueZ");
        const getIsSizedByW = () => +(sizeBy === "valueW");
        const getIsPixelAligned = () => +pixelAligned;
        const getColorMultiplicator = () => {
          if (colorBy === "valueZ") {
            return valueZDataType === CONTINUOUS ? pointColor.length - 1 : 1;
          }
          return valueWDataType === CONTINUOUS ? pointColor.length - 1 : 1;
        };
        const getOpacityMultiplicator = () => {
          if (opacityBy === "valueZ") {
            return valueZDataType === CONTINUOUS ? opacity.length - 1 : 1;
          }
          return valueWDataType === CONTINUOUS ? opacity.length - 1 : 1;
        };
        const getSizeMultiplicator = () => {
          if (sizeBy === "valueZ") {
            return valueZDataType === CONTINUOUS ? pointSize.length - 1 : 1;
          }
          return valueWDataType === CONTINUOUS ? pointSize.length - 1 : 1;
        };
        const getOpacityDensity = (context) => {
          if (opacityBy !== "density") {
            return 1;
          }
          const pointScale = getPointScale();
          const p = pointSize[0] * pointScale;
          const s = 2 / (2 / camera.view[0]) * (2 / (2 / camera.view[5]));
          const H = context.viewportHeight;
          const W = context.viewportWidth;
          let alpha = opacityByDensityFill * W * H / (numPointsInView * p * p) * min(1, s);
          alpha *= renderPointsAsSquares ? 1 : 1 / (0.25 * Math.PI);
          const clampedPointDeviceSize = max(MIN_POINT_SIZE, p) + 0.5;
          alpha *= (p / clampedPointDeviceSize) ** 2;
          return min(1, max(0, alpha));
        };
        const updatePoints = renderer.regl({
          framebuffer: () => tmpStateBuffer,
          vert: SHADER,
          frag: SHADER$1,
          attributes: {
            position: [-4, 0, 4, 4, 4, -4]
          },
          uniforms: {
            startStateTex: () => prevStateTex,
            endStateTex: () => stateTex,
            t: (_ctx, props) => props.t
          },
          count: 3
        });
        const drawPoints = (getPointSizeExtra, getNumPoints, getStateIndexBuffer, globalState = COLOR_NORMAL_IDX, getPointOpacityMax = getPointOpacityMaxBase, getPointOpacityScale = getPointOpacityScaleBase) => renderer.regl({
          frag: renderPointsAsSquares ? FRAGMENT_SHADER : FRAGMENT_SHADER$1,
          vert: createVertexShader(globalState),
          blend: {
            enable: !disableAlphaBlending,
            func: {
              srcRGB: "src alpha",
              srcAlpha: "one",
              dstRGB: "one minus src alpha",
              dstAlpha: "one minus src alpha"
            }
          },
          depth: { enable: false },
          attributes: {
            stateIndex: {
              buffer: getStateIndexBuffer,
              size: 2
            }
          },
          uniforms: {
            antiAliasing: getAntiAliasing,
            resolution: getResolution,
            modelViewProjection: getModelViewProjection,
            devicePixelRatio: getDevicePixelRatio,
            pointScale: () => getPointScale(),
            encodingTex: getEncodingTex,
            encodingTexRes: getEncodingTexRes,
            encodingTexEps: getEncodingTexEps,
            pointOpacityMax: getPointOpacityMax,
            pointOpacityScale: getPointOpacityScale,
            pointSizeExtra: getPointSizeExtra,
            globalState,
            colorTex: getColorTex,
            colorTexRes: getColorTexRes,
            colorTexEps: getColorTexEps,
            stateTex: getStateTex,
            stateTexRes: getStateTexRes,
            stateTexEps: getStateTexEps,
            isColoredByZ: getIsColoredByZ,
            isColoredByW: getIsColoredByW,
            isOpacityByZ: getIsOpacityByZ,
            isOpacityByW: getIsOpacityByW,
            isOpacityByDensity: getIsOpacityByDensity,
            isSizedByZ: getIsSizedByZ,
            isSizedByW: getIsSizedByW,
            isPixelAligned: getIsPixelAligned,
            colorMultiplicator: getColorMultiplicator,
            opacityMultiplicator: getOpacityMultiplicator,
            opacityDensity: getOpacityDensity,
            sizeMultiplicator: getSizeMultiplicator,
            numColorStates: COLOR_NUM_STATES,
            drawingBufferWidth: (context) => context.drawingBufferWidth,
            drawingBufferHeight: (context) => context.drawingBufferHeight
          },
          count: getNumPoints,
          primitive: "points"
        });
        const drawPointBodies = drawPoints(
          getNormalPointSizeExtra,
          getNormalNumPoints,
          getNormalPointsIndexBuffer
        );
        const drawHoveredPoint = drawPoints(
          getNormalPointSizeExtra,
          () => 1,
          () => hoveredPointIndexBuffer,
          COLOR_HOVER_IDX,
          () => 1,
          () => 1
        );
        const drawSelectedPointOutlines = drawPoints(
          () => (pointSizeSelected + pointOutlineWidth * 2) * window.devicePixelRatio,
          getSelectedNumPoints,
          getSelectedPointsIndexBuffer,
          COLOR_ACTIVE_IDX,
          () => 1,
          () => 1
        );
        const drawSelectedPointInnerBorder = drawPoints(
          () => (pointSizeSelected + pointOutlineWidth) * window.devicePixelRatio,
          getSelectedNumPoints,
          getSelectedPointsIndexBuffer,
          COLOR_BG_IDX,
          () => 1,
          () => 1
        );
        const drawSelectedPointBodies = drawPoints(
          () => pointSizeSelected * window.devicePixelRatio,
          getSelectedNumPoints,
          getSelectedPointsIndexBuffer,
          COLOR_ACTIVE_IDX,
          () => 1,
          () => 1
        );
        const drawSelectedPoints = () => {
          drawSelectedPointOutlines();
          drawSelectedPointInnerBorder();
          drawSelectedPointBodies();
        };
        const drawBackgroundImage = renderer.regl({
          frag: FRAGMENT_SHADER$2,
          vert: VERTEX_SHADER,
          attributes: {
            position: [0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0]
          },
          uniforms: {
            modelViewProjection: getModelViewProjection,
            texture: getBackgroundImage
          },
          count: 6
        });
        const drawLassoPolygon = renderer.regl({
          vert: `
      precision mediump float;
      uniform mat4 modelViewProjection;
      attribute vec2 position;
      void main () {
        gl_Position = modelViewProjection * vec4(position, 0, 1);
      }`,
          frag: `
      precision mediump float;
      uniform vec4 color;
      void main () {
        gl_FragColor = vec4(color.rgb, 0.2);
      }`,
          depth: { enable: false },
          blend: {
            enable: true,
            func: {
              srcRGB: "src alpha",
              srcAlpha: "one",
              dstRGB: "one minus src alpha",
              dstAlpha: "one minus src alpha"
            }
          },
          attributes: {
            position: () => lassoPointsCurr
          },
          uniforms: {
            modelViewProjection: getModelViewProjection,
            color: () => lassoColor
          },
          elements: () => earcut(lasso.getPoints())
        });
        const drawReticle = () => {
          if (!(hoveredPoint >= 0)) {
            return;
          }
          const [x, y] = points[hoveredPoint].slice(0, 2);
          const v = [x, y, 0, 1];
          multiply(
            scratch,
            projection,
            multiply(scratch, camera.view, model)
          );
          transformMat4(v, v, scratch);
          reticleHLine.setPoints([-1, v[1], 1, v[1]]);
          reticleVLine.setPoints([v[0], 1, v[0], -1]);
          reticleHLine.draw();
          reticleVLine.draw();
          drawPoints(
            () => (pointSizeSelected + pointOutlineWidth * 2) * window.devicePixelRatio,
            () => 1,
            hoveredPointIndexBuffer,
            COLOR_ACTIVE_IDX
          )();
          drawPoints(
            () => (pointSizeSelected + pointOutlineWidth) * window.devicePixelRatio,
            () => 1,
            hoveredPointIndexBuffer,
            COLOR_BG_IDX
          )();
        };
        const createPointIndex = (numNewPoints) => {
          const index = new Float32Array(numNewPoints * 2);
          let j = 0;
          for (let i = 0; i < numNewPoints; ++i) {
            const texCoord = indexToStateTexCoord(i);
            index[j] = texCoord[0];
            index[j + 1] = texCoord[1];
            j += 2;
          }
          return index;
        };
        const createStateTexture = (newPoints, dataTypes = {}) => {
          const numNewPoints = newPoints.length;
          stateTexRes = Math.max(2, Math.ceil(Math.sqrt(numNewPoints)));
          stateTexEps = 0.5 / stateTexRes;
          const data = new Float32Array(stateTexRes ** 2 * 4);
          let zIsInts = true;
          let wIsInts = true;
          let k = 0;
          let z = 0;
          let w = 0;
          for (let i = 0; i < numNewPoints; ++i) {
            k = i * 4;
            data[k] = newPoints[i][0];
            data[k + 1] = newPoints[i][1];
            z = newPoints[i][2] || 0;
            w = newPoints[i][3] || 0;
            data[k + 2] = z;
            data[k + 3] = w;
            zIsInts &&= Number.isInteger(z);
            wIsInts &&= Number.isInteger(w);
          }
          if (dataTypes.z && VALUE_ZW_DATA_TYPES.includes(dataTypes.z)) {
            valueZDataType = dataTypes.z;
          } else {
            valueZDataType = zIsInts ? CATEGORICAL : CONTINUOUS;
          }
          if (dataTypes.w && VALUE_ZW_DATA_TYPES.includes(dataTypes.w)) {
            valueWDataType = dataTypes.w;
          } else {
            valueWDataType = wIsInts ? CATEGORICAL : CONTINUOUS;
          }
          return renderer.regl.texture({
            data,
            shape: [stateTexRes, stateTexRes, 4],
            type: "float"
          });
        };
        const cachePoints = (newPoints, dataTypes = {}) => {
          if (!stateTex) {
            return false;
          }
          if (isTransitioning) {
            const tmp2 = prevStateTex;
            prevStateTex = tmpStateTex;
            tmp2.destroy();
          } else {
            prevStateTex = stateTex;
          }
          tmpStateTex = createStateTexture(newPoints, dataTypes);
          tmpStateBuffer = renderer.regl.framebuffer({
            color: tmpStateTex,
            depth: false,
            stencil: false
          });
          stateTex = void 0;
          return true;
        };
        const hasCachedPoints = () => Boolean(prevStateTex && tmpStateTex);
        const clearCachedPoints = () => {
          if (prevStateTex) {
            prevStateTex.destroy();
            prevStateTex = void 0;
          }
          if (tmpStateTex) {
            tmpStateTex.destroy();
            tmpStateTex = void 0;
          }
        };
        const setPoints = (newPoints, options = {}) => new Promise((resolve) => {
          isPointsDrawn = false;
          const preventFilterReset = options?.preventFilterReset && newPoints.length === numPoints;
          numPoints = newPoints.length;
          numPointsInView = numPoints;
          if (stateTex) {
            stateTex.destroy();
          }
          stateTex = createStateTexture(newPoints, {
            z: options.zDataType,
            w: options.wDataType
          });
          if (!preventFilterReset) {
            normalPointsIndexBuffer({
              usage: "static",
              type: "float",
              data: createPointIndex(numPoints)
            });
          }
          createKdbush(options.spatialIndex || newPoints, {
            useWorker: spatialIndexUseWorker
          }).then((newSearchIndex) => {
            spatialIndex = newSearchIndex;
            points = newPoints;
            isPointsDrawn = true;
          }).then(resolve);
        });
        const cacheCamera = (newTarget, newDistance) => {
          cameraZoomTargetStart = camera.target;
          cameraZoomTargetEnd = newTarget;
          cameraZoomDistanceStart = camera.distance[0];
          cameraZoomDistanceEnd = newDistance;
        };
        const hasCachedCamera = () => Boolean(
          cameraZoomTargetStart !== void 0 && cameraZoomTargetEnd !== void 0 && cameraZoomDistanceStart !== void 0 && cameraZoomDistanceEnd !== void 0
        );
        const clearCachedCamera = () => {
          cameraZoomTargetStart = void 0;
          cameraZoomTargetEnd = void 0;
          cameraZoomDistanceStart = void 0;
          cameraZoomDistanceEnd = void 0;
        };
        const getPointConnectionColorIndices = (curvePoints) => {
          const colorEncoding = pointConnectionColorBy === "inherit" ? colorBy : pointConnectionColorBy;
          if (colorEncoding === "segment") {
            const maxColorIdx = pointConnectionColor.length - 1;
            if (maxColorIdx < 1) {
              return [];
            }
            return curvePoints.reduce((colorIndices, curve, index) => {
              let totalLength = 0;
              const segLengths = [];
              for (let i = 2; i < curve.length; i += 2) {
                const segLength = Math.sqrt(
                  (curve[i - 2] - curve[i]) ** 2 + (curve[i - 1] - curve[i + 1]) ** 2
                );
                segLengths.push(segLength);
                totalLength += segLength;
              }
              colorIndices[index] = [0];
              let cumLength = 0;
              for (let i = 0; i < curve.length / 2 - 1; i++) {
                cumLength += segLengths[i];
                colorIndices[index].push(
                  Math.floor(cumLength / totalLength * maxColorIdx) * 4
                );
              }
              return colorIndices;
            }, []);
          }
          if (colorEncoding) {
            const encodingIdx = getEncodingIdx(colorEncoding);
            const encodingValueToIdx = getEncodingValueToIdx(
              getEncodingDataType(colorEncoding),
              pointConnectionColorBy === "inherit" ? pointColor : pointConnectionColor
            );
            return pointConnectionMap.reduce(
              (colorIndices, [index, referencePoint]) => {
                colorIndices[index] = encodingValueToIdx(referencePoint[encodingIdx]) * 4;
                return colorIndices;
              },
              []
            );
          }
          return new Array(pointConnectionMap.length).fill(0);
        };
        const getPointConnectionOpacities = () => {
          const opacityEncoding = pointConnectionOpacityBy === "inherit" ? opacityBy : pointConnectionOpacityBy;
          if (opacityEncoding === "segment") {
            const maxOpacityIdx = pointConnectionOpacity.length - 1;
            if (maxOpacityIdx < 1) {
              return [];
            }
            return pointConnectionMap.reduce(
              (opacities, [index, _referencePoint, length]) => {
                opacities[index] = rangeMap(
                  length,
                  (i) => pointConnectionOpacity[Math.floor(i / (length - 1) * maxOpacityIdx)]
                );
                return opacities;
              },
              []
            );
          }
          if (opacityEncoding) {
            const encodingIdx = getEncodingIdx(opacityEncoding);
            const encodingRangeMap = pointConnectionOpacityBy === "inherit" ? opacity : pointConnectionOpacity;
            const encodingValueToIdx = getEncodingValueToIdx(
              getEncodingDataType(opacityEncoding),
              encodingRangeMap
            );
            return pointConnectionMap.reduce((opacities, [index, referencePoint]) => {
              opacities[index] = encodingRangeMap[encodingValueToIdx(referencePoint[encodingIdx])];
              return opacities;
            }, []);
          }
          return void 0;
        };
        const getPointConnectionWidths = () => {
          const sizeEncoding = pointConnectionSizeBy === "inherit" ? sizeBy : pointConnectionSizeBy;
          if (sizeEncoding === "segment") {
            const maxSizeIdx = pointConnectionSize.length - 1;
            if (maxSizeIdx < 1) {
              return [];
            }
            return pointConnectionMap.reduce(
              (widths, [index, _referencePoint, length]) => {
                widths[index] = rangeMap(
                  length,
                  (i) => pointConnectionSize[Math.floor(i / (length - 1) * maxSizeIdx)]
                );
                return widths;
              },
              []
            );
          }
          if (sizeEncoding) {
            const encodingIdx = getEncodingIdx(sizeEncoding);
            const encodingRangeMap = pointConnectionSizeBy === "inherit" ? pointSize : pointConnectionSize;
            const encodingValueToIdx = getEncodingValueToIdx(
              getEncodingDataType(sizeEncoding),
              encodingRangeMap
            );
            return pointConnectionMap.reduce((widths, [index, referencePoint]) => {
              widths[index] = encodingRangeMap[encodingValueToIdx(referencePoint[encodingIdx])];
              return widths;
            }, []);
          }
          return void 0;
        };
        const setPointConnectionMap = (curvePoints) => {
          pointConnectionMap = [];
          let cumLinePoints = 0;
          Object.keys(curvePoints).forEach((id, index) => {
            pointConnectionMap[id] = [
              index,
              curvePoints[id].reference,
              curvePoints[id].length / 2,
              // Used for offsetting in the buffer manipulations on
              // hovering and selecting
              cumLinePoints
            ];
            cumLinePoints += curvePoints[id].length / 2;
          });
        };
        const setPointConnections = (newPoints) => new Promise((resolve) => {
          pointConnections.setPoints([]);
          if (newPoints?.length > 0) {
            computingPointConnectionCurves = true;
            createSplineCurve(newPoints, {
              maxIntPointsPerSegment: pointConnectionMaxIntPointsPerSegment,
              tolerance: pointConnectionTolerance
            }).then((curvePoints) => {
              setPointConnectionMap(curvePoints);
              const curvePointValues = Object.values(curvePoints);
              pointConnections.setPoints(
                curvePointValues.length === 1 ? curvePointValues[0] : curvePointValues,
                {
                  colorIndices: getPointConnectionColorIndices(curvePointValues),
                  opacities: getPointConnectionOpacities(),
                  widths: getPointConnectionWidths()
                }
              );
              computingPointConnectionCurves = false;
              resolve();
            });
          } else {
            resolve();
          }
        });
        const unfilter = ({ preventEvent = false } = {}) => {
          isPointsFiltered = false;
          filteredPointsSet.clear();
          normalPointsIndexBuffer.subdata(createPointIndex(numPoints));
          return new Promise((resolve) => {
            const finish = () => {
              pubSub.subscribe(
                "draw",
                () => {
                  if (!preventEvent) {
                    pubSub.publish("unfilter");
                  }
                  resolve();
                },
                1
              );
              draw = true;
            };
            if (showPointConnections || hasPointConnections(points[0])) {
              setPointConnections(getPoints()).then(() => {
                if (!preventEvent) {
                  pubSub.publish("pointConnectionsDraw");
                }
                finish();
              });
            } else {
              finish();
            }
          });
        };
        const filter = (pointIdxs, { preventEvent = false } = {}) => {
          isPointsFiltered = true;
          filteredPointsSet.clear();
          const pointIdxsArray = Array.isArray(pointIdxs) ? pointIdxs : [pointIdxs];
          const filteredPoints = [];
          const filteredPointsBuffer = [];
          const filteredSelectedPoints = [];
          for (const pointIdx of pointIdxsArray) {
            if (!Number.isFinite(pointIdx) || pointIdx < 0 || pointIdx >= numPoints) {
              continue;
            }
            filteredPoints.push(pointIdx);
            filteredPointsSet.add(pointIdx);
            if (selectedPointsSet.has(pointIdx)) {
              filteredSelectedPoints.push(pointIdx);
            }
          }
          const sortedFilteredPoints = insertionSort([...filteredPoints]);
          for (const pointIdx of sortedFilteredPoints) {
            filteredPointsBuffer.push.apply(
              filteredPointsBuffer,
              indexToStateTexCoord(pointIdx)
            );
          }
          normalPointsIndexBuffer.subdata(filteredPointsBuffer);
          select(filteredSelectedPoints, { preventEvent });
          if (!filteredPointsSet.has(hoveredPoint)) {
            hover(-1, { preventEvent });
          }
          return new Promise((resolve) => {
            const finish = () => {
              pubSub.subscribe(
                "draw",
                () => {
                  if (!preventEvent) {
                    pubSub.publish("filter", { points: filteredPoints });
                  }
                  resolve();
                },
                1
              );
              draw = true;
            };
            if (showPointConnections || hasPointConnections(points[0])) {
              setPointConnections(getPoints()).then(() => {
                if (!preventEvent) {
                  pubSub.publish("pointConnectionsDraw");
                }
                select(filteredSelectedPoints, { preventEvent });
                finish();
              });
            } else {
              finish();
            }
          });
        };
        const getPointsInView = () => getPointsInBBox(
          bottomLeftNdc[0],
          bottomLeftNdc[1],
          topRightNdc[0],
          topRightNdc[1]
        );
        const getNumPointsInView = () => {
          numPointsInView = getPointsInView().length;
        };
        const getNumPointsInViewDb = throttleAndDebounce(
          getNumPointsInView,
          opacityByDensityDebounceTime
        );
        const tweenCamera = (t) => {
          const [xStart, yStart] = cameraZoomTargetStart;
          const [xEnd, yEnd] = cameraZoomTargetEnd;
          const ti = 1 - t;
          const targetX = xStart * ti + xEnd * t;
          const targetY = yStart * ti + yEnd * t;
          const distance = cameraZoomDistanceStart * ti + cameraZoomDistanceEnd * t;
          camera.lookAt([targetX, targetY], distance);
        };
        const isTransitioningPoints = () => hasCachedPoints();
        const isTransitioningCamera = () => hasCachedCamera();
        const tween = (duration, easing) => {
          if (!transitionStartTime) {
            transitionStartTime = performance.now();
          }
          const dt = performance.now() - transitionStartTime;
          const t = clip(easing(dt / duration), 0, 1);
          if (isTransitioningPoints()) {
            updatePoints({ t });
          }
          if (isTransitioningCamera()) {
            tweenCamera(t);
          }
          return dt < duration;
        };
        const endTransition = () => {
          isTransitioning = false;
          transitionStartTime = null;
          transitionDuration = void 0;
          transitionEasing = void 0;
          showReticle = preTransitionShowReticle;
          clearCachedPoints();
          clearCachedCamera();
          pubSub.publish("transitionEnd");
        };
        const startTransition = ({ duration = 500, easing = DEFAULT_EASING }) => {
          if (isTransitioning) {
            pubSub.publish("transitionEnd");
          }
          isTransitioning = true;
          transitionStartTime = null;
          transitionDuration = duration;
          transitionEasing = isString2(easing) ? EASING_FNS[easing] || DEFAULT_EASING : easing;
          preTransitionShowReticle = showReticle;
          showReticle = false;
          pubSub.publish("transitionStart");
        };
        const publicDraw = (newPoints, options = {}) => {
          if (isDestroyed) {
            return Promise.reject(new Error(ERROR_INSTANCE_IS_DESTROYED));
          }
          if (isDrawing) {
            return Promise.reject(new Error(ERROR_IS_DRAWING));
          }
          isDrawing = true;
          return toArrayOrientedPoints(newPoints).then(
            (newPointsArray) => new Promise((resolve) => {
              if (isDestroyed) {
                resolve();
                return;
              }
              let pointsCached = false;
              if (!options.preventFilterReset || newPointsArray?.length !== numPoints) {
                isPointsFiltered = false;
                filteredPointsSet.clear();
              }
              const drawPointConnections = newPointsArray && hasPointConnections(newPointsArray[0]) && (showPointConnections || options.showPointConnectionsOnce);
              const { zDataType, wDataType } = options;
              new Promise((resolveDraw) => {
                if (newPointsArray) {
                  if (options.transition) {
                    if (newPointsArray.length === numPoints) {
                      pointsCached = cachePoints(newPointsArray, {
                        z: zDataType,
                        w: wDataType
                      });
                    } else {
                      console.warn(
                        "Cannot transition! The number of points between the previous and current draw call must be identical."
                      );
                    }
                  }
                  setPoints(newPointsArray, {
                    zDataType,
                    wDataType,
                    preventFilterReset: options.preventFilterReset,
                    spatialIndex: options.spatialIndex
                  }).then(() => {
                    if (options.hover !== void 0) {
                      hover(options.hover, { preventEvent: true });
                    }
                    if (options.select !== void 0) {
                      select(options.select, { preventEvent: true });
                    }
                    if (options.filter !== void 0) {
                      filter(options.filter, { preventEvent: true });
                    }
                    if (drawPointConnections) {
                      setPointConnections(newPointsArray).then(() => {
                        pubSub.publish("pointConnectionsDraw");
                        draw = true;
                        drawReticleOnce = options.showReticleOnce;
                      }).then(() => resolve());
                    } else {
                      resolveDraw();
                    }
                  });
                } else {
                  resolveDraw();
                }
              }).then(() => {
                if (options.transition && pointsCached) {
                  if (drawPointConnections) {
                    Promise.all([
                      new Promise((resolveTransition) => {
                        pubSub.subscribe(
                          "transitionEnd",
                          () => {
                            draw = true;
                            drawReticleOnce = options.showReticleOnce;
                            resolveTransition();
                          },
                          1
                        );
                      }),
                      new Promise((resolveDraw) => {
                        pubSub.subscribe("pointConnectionsDraw", resolveDraw, 1);
                      })
                    ]).then(() => resolve());
                  } else {
                    pubSub.subscribe(
                      "transitionEnd",
                      () => {
                        draw = true;
                        drawReticleOnce = options.showReticleOnce;
                        resolve();
                      },
                      1
                    );
                  }
                  startTransition({
                    duration: options.transitionDuration,
                    easing: options.transitionEasing
                  });
                } else {
                  if (drawPointConnections) {
                    Promise.all([
                      new Promise((resolveDraw) => {
                        pubSub.subscribe("draw", resolveDraw, 1);
                      }),
                      new Promise((resolveDraw) => {
                        pubSub.subscribe("pointConnectionsDraw", resolveDraw, 1);
                      })
                    ]).then(() => resolve());
                  } else {
                    pubSub.subscribe("draw", () => resolve(), 1);
                  }
                  draw = true;
                  drawReticleOnce = options.showReticleOnce;
                }
              });
            }).finally(() => {
              isDrawing = false;
            })
          );
        };
        const drawAnnotations = (newAnnotations) => {
          if (isDestroyed) {
            return Promise.reject(new ERROR_INSTANCE_IS_DESTROYED());
          }
          isAnnotationsDrawn = false;
          if (newAnnotations.length === 0) {
            return new Promise((resolve) => {
              annotations.clear();
              pubSub.subscribe("draw", resolve, 1);
              isAnnotationsDrawn = true;
              draw = true;
            });
          }
          return new Promise((resolve) => {
            const newPoints = [];
            const newColors = /* @__PURE__ */ new Map();
            const newColorIndices = [];
            const newWidths = [];
            let maxNewColorIdx = -1;
            const addColorAndWidth = (annotation) => {
              newWidths.push(annotation.lineWidth || annotationLineWidth);
              const color = toRgba(annotation.lineColor || annotationLineColor, true);
              const colorId = `[${color.join(",")}]`;
              if (newColors.has(colorId)) {
                const { idx } = newColors.get(colorId);
                newColorIndices.push(idx);
              } else {
                const idx = ++maxNewColorIdx;
                newColors.set(colorId, { idx, color });
                newColorIndices.push(idx);
              }
            };
            for (const annotation of newAnnotations) {
              if (isHorizontalLine(annotation)) {
                newPoints.push([
                  annotation.x1 ?? -annotationHVLineLimit,
                  annotation.y,
                  annotation.x2 ?? annotationHVLineLimit,
                  annotation.y
                ]);
                addColorAndWidth(annotation);
                continue;
              }
              if (isVerticalLine(annotation)) {
                newPoints.push([
                  annotation.x,
                  annotation.y1 ?? -annotationHVLineLimit,
                  annotation.x,
                  annotation.y2 ?? annotationHVLineLimit
                ]);
                addColorAndWidth(annotation);
                continue;
              }
              if (isRect(annotation)) {
                newPoints.push([
                  annotation.x1,
                  annotation.y1,
                  annotation.x2,
                  annotation.y1,
                  annotation.x2,
                  annotation.y2,
                  annotation.x1,
                  annotation.y2,
                  annotation.x1,
                  annotation.y1
                ]);
                addColorAndWidth(annotation);
                continue;
              }
              if (isDomRect(annotation)) {
                newPoints.push([
                  annotation.x,
                  annotation.y,
                  annotation.x + annotation.width,
                  annotation.y,
                  annotation.x + annotation.width,
                  annotation.y + annotation.height,
                  annotation.x,
                  annotation.y + annotation.height,
                  annotation.x,
                  annotation.y
                ]);
                addColorAndWidth(annotation);
                continue;
              }
              if (isPolygonAnnotation(annotation)) {
                newPoints.push(annotation.vertices.flatMap(identity));
                addColorAndWidth(annotation);
              }
            }
            annotations.setStyle({
              color: Array.from(newColors.values()).sort((a, b) => a.idx > b.idx ? 1 : -1).map(({ color }) => color)
            });
            annotations.setPoints(
              newPoints.length === 1 ? newPoints.flat() : newPoints,
              {
                colorIndices: newColorIndices,
                widths: newWidths
              }
            );
            pubSub.subscribe("draw", resolve, 1);
            isAnnotationsDrawn = true;
            draw = true;
          });
        };
        const withDraw = (f) => (...args) => {
          const out = f(...args);
          draw = true;
          return new Promise((resolve) => {
            pubSub.subscribe("draw", () => resolve(out), 1);
          });
        };
        const getBBoxOfPoints = (pointIdxs) => {
          let xMin = Number.POSITIVE_INFINITY;
          let xMax = Number.NEGATIVE_INFINITY;
          let yMin = Number.POSITIVE_INFINITY;
          let yMax = Number.NEGATIVE_INFINITY;
          for (const pointIdx of pointIdxs) {
            const [x, y] = points[pointIdx];
            xMin = Math.min(xMin, x);
            xMax = Math.max(xMax, x);
            yMin = Math.min(yMin, y);
            yMax = Math.max(yMax, y);
          }
          return { x: xMin, y: yMin, width: xMax - xMin, height: yMax - yMin };
        };
        const zoomToArea = (rect, options = {}) => new Promise((resolve) => {
          const target = transformMat4(
            [],
            [rect.x + rect.width / 2, rect.y + rect.height / 2, 0, 0],
            model
          ).slice(0, 2);
          const vFOV = 2 * Math.atan(1);
          const aspectRatio = viewAspectRatio / dataAspectRatio;
          const distance = rect.height * aspectRatio >= rect.width ? (
            // Distance is based on the height of the bounding box
            rect.height / 2 / Math.tan(vFOV / 2)
          ) : (
            // Distance is based on the width of the bounding box
            rect.width / 2 / Math.tan(vFOV / 2) / aspectRatio
          );
          if (options.transition) {
            camera.config({ isFixed: true });
            cacheCamera(target, distance);
            pubSub.subscribe(
              "transitionEnd",
              () => {
                resolve();
                camera.config({ isFixed: cameraIsFixed });
              },
              1
            );
            startTransition({
              duration: options.transitionDuration,
              easing: options.transitionEasing
            });
          } else {
            camera.lookAt(target, distance);
            pubSub.subscribe("draw", resolve, 1);
            draw = true;
          }
        });
        const zoomToPoints = (pointIdxs, options = {}) => {
          if (!isPointsDrawn) {
            return Promise.reject(new Error(ERROR_POINTS_NOT_DRAWN));
          }
          const rect = getBBoxOfPoints(pointIdxs);
          const cX = rect.x + rect.width / 2;
          const cY = rect.y + rect.height / 2;
          const pointSizeNdc = getPointSizeNdc();
          const scale = 1 + (options.padding || 0);
          const w = Math.max(rect.width, pointSizeNdc) * scale;
          const h = Math.max(rect.height, pointSizeNdc) * scale;
          const x = cX - w / 2;
          const y = cY - h / 2;
          return zoomToArea({ x, y, width: w, height: h }, options);
        };
        const zoomToLocation = (target, distance, options = {}) => new Promise((resolve) => {
          if (options.transition) {
            camera.config({ isFixed: true });
            cacheCamera(target, distance);
            pubSub.subscribe(
              "transitionEnd",
              () => {
                resolve();
                camera.config({ isFixed: cameraIsFixed });
              },
              1
            );
            startTransition({
              duration: options.transitionDuration,
              easing: options.transitionEasing
            });
          } else {
            camera.lookAt(target, distance);
            pubSub.subscribe("draw", resolve, 1);
            draw = true;
          }
        });
        const zoomToOrigin = (options = {}) => zoomToLocation([0, 0], 1, options);
        const getScreenPosition = (pointIdx) => {
          if (!isPointsDrawn) {
            throw new Error(ERROR_POINTS_NOT_DRAWN);
          }
          const point = points[pointIdx];
          if (!point) {
            return void 0;
          }
          const v = [point[0], point[1], 0, 1];
          multiply(
            scratch,
            projectionLocal,
            multiply(scratch, camera.view, model)
          );
          transformMat4(v, v, scratch);
          const x = currentWidth * (v[0] + 1) / 2;
          const y = currentHeight * (0.5 - v[1] / 2);
          return [x, y];
        };
        const updatePointConnectionStyle = () => {
          pointConnections.setStyle({
            color: getColors(
              pointConnectionColor,
              pointConnectionColorActive,
              pointConnectionColorHover
            ),
            opacity: pointConnectionOpacity === null ? null : pointConnectionOpacity[0],
            width: pointConnectionSize[0]
          });
        };
        const updateLassoInitiatorStyle = () => {
          const v = Math.round(backgroundColorBrightness) > 0.5 ? 0 : 255;
          lassoManager.initiator.style.border = `1px dashed rgba(${v}, ${v}, ${v}, 0.33)`;
          lassoManager.initiator.style.background = `rgba(${v}, ${v}, ${v}, 0.1)`;
        };
        const updateLassoLongPressIndicatorStyle = () => {
          const v = Math.round(backgroundColorBrightness) > 0.5 ? 0 : 255;
          lassoManager.longPressIndicator.style.color = `rgb(${v}, ${v}, ${v})`;
          lassoManager.longPressIndicator.dataset.color = `rgb(${v}, ${v}, ${v})`;
          const rgb = lassoColor.map((c) => Math.round(c * 255));
          lassoManager.longPressIndicator.dataset.activeColor = `rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`;
        };
        const setBackgroundColor = (newBackgroundColor) => {
          if (!newBackgroundColor) {
            return;
          }
          backgroundColor = toRgba(newBackgroundColor, true);
          backgroundColorBrightness = rgbBrightness(backgroundColor);
          updateLassoInitiatorStyle();
          updateLassoLongPressIndicatorStyle();
        };
        const setBackgroundImage = (newBackgroundImage) => {
          if (!newBackgroundImage) {
            backgroundImage = null;
          } else if (isString2(newBackgroundImage)) {
            createTextureFromUrl(renderer.regl, newBackgroundImage).then((texture) => {
              backgroundImage = texture;
              draw = true;
              pubSub.publish("backgroundImageReady");
            }).catch(() => {
              console.error(`Count not create texture from ${newBackgroundImage}`);
              backgroundImage = null;
            });
          } else if (newBackgroundImage._reglType === "texture2d") {
            backgroundImage = newBackgroundImage;
          } else {
            backgroundImage = null;
          }
        };
        const setCameraDistance = (distance) => {
          if (distance > 0) {
            camera.lookAt(camera.target, distance, camera.rotation);
          }
        };
        const setCameraRotation = (rotation) => {
          if (rotation !== null) {
            camera.lookAt(camera.target, camera.distance[0], rotation);
          }
        };
        const setCameraTarget = (target) => {
          if (target) {
            camera.lookAt(target, camera.distance[0], camera.rotation);
          }
        };
        const setCameraView = (view2) => {
          if (view2) {
            camera.setView(view2);
          }
        };
        const setCameraIsFixed = (isFixed) => {
          cameraIsFixed = Boolean(isFixed);
          camera.config({ isFixed: cameraIsFixed });
        };
        const setLassoColor = (newLassoColor) => {
          if (!newLassoColor) {
            return;
          }
          lassoColor = toRgba(newLassoColor, true);
          lasso.setStyle({ color: lassoColor });
          const rgb = lassoColor.map((c) => Math.round(c * 255));
          lassoManager.longPressIndicator.dataset.activeColor = `rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`;
        };
        const setLassoLineWidth = (newLassoLineWidth) => {
          if (Number.isNaN(+newLassoLineWidth) || +newLassoLineWidth < 1) {
            return;
          }
          lassoLineWidth = +newLassoLineWidth;
          lasso.setStyle({ width: lassoLineWidth });
        };
        const setLassoMinDelay = (newLassoMinDelay) => {
          if (!+newLassoMinDelay) {
            return;
          }
          lassoMinDelay = +newLassoMinDelay;
          lassoManager.set({
            minDelay: lassoMinDelay
          });
        };
        const setLassoMinDist = (newLassoMinDist) => {
          if (!+newLassoMinDist) {
            return;
          }
          lassoMinDist = +newLassoMinDist;
          lassoManager.set({
            minDist: lassoMinDist
          });
        };
        const setLassoClearEvent = (newLassoClearEvent) => {
          lassoClearEvent = limit(
            LASSO_CLEAR_EVENTS,
            lassoClearEvent
          )(newLassoClearEvent);
        };
        const setLassoInitiator = (newLassoInitiator) => {
          lassoInitiator = Boolean(newLassoInitiator);
          lassoManager.set({
            enableInitiator: lassoInitiator
          });
        };
        const setLassoInitiatorParentElement = (newLassoInitiatorParentElement) => {
          lassoInitiatorParentElement = newLassoInitiatorParentElement;
          lassoManager.set({
            initiatorParentElement: lassoInitiatorParentElement
          });
        };
        const setLassoLongPressIndicatorParentElement = (newParentElement) => {
          lassoLongPressIndicatorParentElement = newParentElement;
          lassoManager.set({
            longPressIndicatorParentElement: lassoLongPressIndicatorParentElement
          });
        };
        const setLassoOnLongPress = (newLassoOnLongPress) => {
          lassoOnLongPress = Boolean(newLassoOnLongPress);
        };
        const setLassoLongPressTime = (newLassoOnLongPressTime) => {
          lassoLongPressTime = Number(newLassoOnLongPressTime);
        };
        const setLassoLongPressAfterEffectTime = (newTime) => {
          lassoLongPressAfterEffectTime = Number(newTime);
        };
        const setLassoLongPressEffectDelay = (newDelay) => {
          lassoLongPressEffectDelay = Number(newDelay);
        };
        const setLassoLongPressRevertEffectTime = (newTime) => {
          lassoLongPressRevertEffectTime = Number(newTime);
        };
        const setLassoType = (newType) => {
          if (newType === "brush") {
            lassoManager.set({
              type: newType,
              minDist: Math.max(LASSO_BRUSH_MIN_MIN_DIST, lassoMinDist)
            });
          } else {
            lassoManager.set({
              type: newType,
              minDist: lassoMinDist
            });
          }
          lassoType = lassoManager.get("type");
        };
        const setLassoBrushSize = (newBrushSize) => {
          lassoBrushSize = Number(newBrushSize) || lassoBrushSize;
          lassoManager.set({ brushSize: lassoBrushSize });
        };
        const updateActionKeyMapChange = () => {
          if (actionKeyMap[KEY_ACTION_ROTATE]) {
            camera.config({
              isRotate: true,
              mouseDownMoveModKey: actionKeyMap[KEY_ACTION_ROTATE]
            });
          } else {
            camera.config({
              isRotate: false
            });
          }
        };
        const setActionKeyMap = (newActionKeyMap) => {
          actionKeyMap = Object.entries(newActionKeyMap).reduce(
            (map, [action, key]) => {
              if (KEYS.includes(key) && KEY_ACTIONS.includes(action)) {
                map[action] = key;
              }
              return map;
            },
            {}
          );
          updateActionKeyMapChange();
        };
        const setMouseMode = (newMouseMode) => {
          mouseMode = limit(MOUSE_MODES, MOUSE_MODE_PANZOOM)(newMouseMode);
          camera.config({
            defaultMouseDownMoveAction: mouseMode === MOUSE_MODE_ROTATE ? "rotate" : "pan"
          });
        };
        const setShowReticle = (newShowReticle) => {
          if (newShowReticle === null) {
            return;
          }
          showReticle = newShowReticle;
        };
        const setReticleColor = (newReticleColor) => {
          if (!newReticleColor) {
            return;
          }
          reticleColor = toRgba(newReticleColor, true);
          reticleHLine.setStyle({ color: reticleColor });
          reticleVLine.setStyle({ color: reticleColor });
        };
        const setXScale = (newXScale) => {
          if (!newXScale) {
            return;
          }
          xScale = newXScale;
          xDomainStart = newXScale.domain()[0];
          xDomainSize = newXScale ? newXScale.domain()[1] - newXScale.domain()[0] : 0;
          xScale.range([0, currentWidth]);
          updateScales();
        };
        const setYScale = (newYScale) => {
          if (!newYScale) {
            return;
          }
          yScale = newYScale;
          yDomainStart = yScale.domain()[0];
          yDomainSize = yScale ? yScale.domain()[1] - yScale.domain()[0] : 0;
          yScale.range([currentHeight, 0]);
          updateScales();
        };
        const setDeselectOnDblClick = (newDeselectOnDblClick) => {
          deselectOnDblClick = !!newDeselectOnDblClick;
        };
        const setDeselectOnEscape = (newDeselectOnEscape) => {
          deselectOnEscape = !!newDeselectOnEscape;
        };
        const setShowPointConnections = (newShowPointConnections) => {
          showPointConnections = !!newShowPointConnections;
          if (showPointConnections) {
            if (isPointsDrawn && hasPointConnections(points[0])) {
              setPointConnections(getPoints()).then(() => {
                pubSub.publish("pointConnectionsDraw");
                draw = true;
              });
            }
          } else {
            setPointConnections();
          }
        };
        const setPointConnectionColors = (setter, getInheritance) => (newColors) => {
          if (newColors === "inherit") {
            setter([...getInheritance()]);
          } else {
            const tmpColors = isMultipleColors(newColors) ? newColors : [newColors];
            setter(tmpColors.map((color) => toRgba(color, true)));
          }
          updatePointConnectionStyle();
        };
        const setPointConnectionColor = setPointConnectionColors(
          (newColors) => {
            pointConnectionColor = newColors;
          },
          () => pointColor
        );
        const setPointConnectionColorActive = setPointConnectionColors(
          (newColors) => {
            pointConnectionColorActive = newColors;
          },
          () => pointColorActive
        );
        const setPointConnectionColorHover = setPointConnectionColors(
          (newColors) => {
            pointConnectionColorHover = newColors;
          },
          () => pointColorHover
        );
        const setPointConnectionOpacity = (newOpacity) => {
          if (isConditionalArray(newOpacity, isPositiveNumber, { minLength: 1 })) {
            pointConnectionOpacity = [...newOpacity];
          }
          if (isStrictlyPositiveNumber(+newOpacity)) {
            pointConnectionOpacity = [+newOpacity];
          }
          pointConnectionColor = pointConnectionColor.map((color) => {
            color[3] = Number.isNaN(+pointConnectionOpacity[0]) ? color[3] : +pointConnectionOpacity[0];
            return color;
          });
          updatePointConnectionStyle();
        };
        const setPointConnectionOpacityActive = (newOpacity) => {
          if (!Number.isNaN(+newOpacity) && +newOpacity) {
            pointConnectionOpacityActive = +newOpacity;
          }
        };
        const setPointConnectionSize = (newPointConnectionSize) => {
          if (isConditionalArray(newPointConnectionSize, isPositiveNumber, {
            minLength: 1
          })) {
            pointConnectionSize = [...newPointConnectionSize];
          }
          if (isStrictlyPositiveNumber(+newPointConnectionSize)) {
            pointConnectionSize = [+newPointConnectionSize];
          }
          updatePointConnectionStyle();
        };
        const setPointConnectionSizeActive = (newPointConnectionSizeActive) => {
          if (!Number.isNaN(+newPointConnectionSizeActive) && +newPointConnectionSizeActive) {
            pointConnectionSizeActive = Math.max(0, newPointConnectionSizeActive);
          }
        };
        const setPointConnectionMaxIntPointsPerSegment = (newPointConnectionMaxIntPointsPerSegment) => {
          pointConnectionMaxIntPointsPerSegment = Math.max(
            0,
            newPointConnectionMaxIntPointsPerSegment
          );
        };
        const setPointConnectionTolerance = (newPointConnectionTolerance) => {
          pointConnectionTolerance = Math.max(0, newPointConnectionTolerance);
        };
        const setPointSizeMouseDetection = (newPointSizeMouseDetection) => {
          pointSizeMouseDetection = newPointSizeMouseDetection;
          computePointSizeMouseDetection();
        };
        const setPointScaleMode = (newPointScaleMode) => {
          switch (newPointScaleMode) {
            case "linear": {
              pointScaleMode = newPointScaleMode;
              getPointScale = getLinearPointScale;
              break;
            }
            case "constant": {
              pointScaleMode = newPointScaleMode;
              getPointScale = getConstantPointScale;
              break;
            }
            default: {
              pointScaleMode = "asinh";
              getPointScale = getAsinhPointScale;
              break;
            }
          }
        };
        const setOpacityByDensityFill = (newOpacityByDensityFill) => {
          opacityByDensityFill = +newOpacityByDensityFill;
        };
        const setOpacityInactiveMax = (newOpacityInactiveMax) => {
          opacityInactiveMax = +newOpacityInactiveMax;
        };
        const setOpacityInactiveScale = (newOpacityInactiveScale) => {
          opacityInactiveScale = +newOpacityInactiveScale;
        };
        const setAnnotationLineColor = (newAnnotationLineColor) => {
          annotationLineColor = toRgba(newAnnotationLineColor);
        };
        const setAnnotationLineWidth = (newAnnotationLineWidth) => {
          annotationLineWidth = +newAnnotationLineWidth;
        };
        const setAnnotationHVLineLimit = (newAnnotationHVLineLimit) => {
          annotationHVLineLimit = +newAnnotationHVLineLimit;
        };
        const setGamma = (newGamma) => {
          renderer.gamma = newGamma;
        };
        const setAntiAliasing = (newAntiAliasing) => {
          antiAliasing = Number(newAntiAliasing) || 0.5;
        };
        const setPixelAligned = (newPixelAligned) => {
          pixelAligned = Boolean(newPixelAligned);
        };
        const get = (prop) => {
          const [property] = Object.keys(
            checkDeprecations({
              [prop]: SKIP_DEPRECATION_VALUE_TRANSLATION
            })
          );
          if (property === "aspectRatio") {
            return dataAspectRatio;
          }
          if (property === "background") {
            return backgroundColor;
          }
          if (property === "backgroundColor") {
            return backgroundColor;
          }
          if (property === "backgroundImage") {
            return backgroundImage;
          }
          if (property === "camera") {
            return camera;
          }
          if (property === "cameraTarget") {
            return camera.target;
          }
          if (property === "cameraDistance") {
            return camera.distance[0];
          }
          if (property === "cameraRotation") {
            return camera.rotation;
          }
          if (property === "cameraView") {
            return camera.view;
          }
          if (property === "cameraIsFixed") {
            return cameraIsFixed;
          }
          if (property === "canvas") {
            return canvas;
          }
          if (property === "colorBy") {
            return colorBy;
          }
          if (property === "sizeBy") {
            return sizeBy;
          }
          if (property === "deselectOnDblClick") {
            return deselectOnDblClick;
          }
          if (property === "deselectOnEscape") {
            return deselectOnEscape;
          }
          if (property === "height") {
            return height;
          }
          if (property === "lassoColor") {
            return lassoColor;
          }
          if (property === "lassoLineWidth") {
            return lassoLineWidth;
          }
          if (property === "lassoMinDelay") {
            return lassoMinDelay;
          }
          if (property === "lassoMinDist") {
            return lassoMinDist;
          }
          if (property === "lassoClearEvent") {
            return lassoClearEvent;
          }
          if (property === "lassoInitiator") {
            return lassoInitiator;
          }
          if (property === "lassoInitiatorElement") {
            return lassoManager.initiator;
          }
          if (property === "lassoInitiatorParentElement") {
            return lassoInitiatorParentElement;
          }
          if (property === "lassoLongPressIndicatorParentElement") {
            return lassoLongPressIndicatorParentElement;
          }
          if (property === "lassoOnLongPress") {
            return lassoOnLongPress;
          }
          if (property === "lassoType") {
            return lassoType;
          }
          if (property === "lassoBrushSize") {
            return lassoBrushSize;
          }
          if (property === "mouseMode") {
            return mouseMode;
          }
          if (property === "opacity") {
            return opacity.length === 1 ? opacity[0] : opacity;
          }
          if (property === "opacityBy") {
            return opacityBy;
          }
          if (property === "opacityByDensityFill") {
            return opacityByDensityFill;
          }
          if (property === "opacityByDensityDebounceTime") {
            return opacityByDensityDebounceTime;
          }
          if (property === "opacityInactiveMax") {
            return opacityInactiveMax;
          }
          if (property === "opacityInactiveScale") {
            return opacityInactiveScale;
          }
          if (property === "points") {
            return points;
          }
          if (property === "hoveredPoint") {
            return hoveredPoint;
          }
          if (property === "selectedPoints") {
            return [...selectedPoints];
          }
          if (property === "filteredPoints") {
            return isPointsFiltered ? Array.from(filteredPointsSet) : Array.from({ length: points.length }, (_, i) => i);
          }
          if (property === "pointsInView") {
            return getPointsInView();
          }
          if (property === "pointColor") {
            return pointColor.length === 1 ? pointColor[0] : pointColor;
          }
          if (property === "pointColorActive") {
            return pointColorActive.length === 1 ? pointColorActive[0] : pointColorActive;
          }
          if (property === "pointColorHover") {
            return pointColorHover.length === 1 ? pointColorHover[0] : pointColorHover;
          }
          if (property === "pointOutlineWidth") {
            return pointOutlineWidth;
          }
          if (property === "pointSize") {
            return pointSize.length === 1 ? pointSize[0] : pointSize;
          }
          if (property === "pointSizeSelected") {
            return pointSizeSelected;
          }
          if (property === "pointSizeMouseDetection") {
            return pointSizeMouseDetection;
          }
          if (property === "showPointConnections") {
            return showPointConnections;
          }
          if (property === "pointConnectionColor") {
            return pointConnectionColor.length === 1 ? pointConnectionColor[0] : pointConnectionColor;
          }
          if (property === "pointConnectionColorActive") {
            return pointConnectionColorActive.length === 1 ? pointConnectionColorActive[0] : pointConnectionColorActive;
          }
          if (property === "pointConnectionColorHover") {
            return pointConnectionColorHover.length === 1 ? pointConnectionColorHover[0] : pointConnectionColorHover;
          }
          if (property === "pointConnectionColorBy") {
            return pointConnectionColorBy;
          }
          if (property === "pointConnectionOpacity") {
            return pointConnectionOpacity.length === 1 ? pointConnectionOpacity[0] : pointConnectionOpacity;
          }
          if (property === "pointConnectionOpacityBy") {
            return pointConnectionOpacityBy;
          }
          if (property === "pointConnectionOpacityActive") {
            return pointConnectionOpacityActive;
          }
          if (property === "pointConnectionSize") {
            return pointConnectionSize.length === 1 ? pointConnectionSize[0] : pointConnectionSize;
          }
          if (property === "pointConnectionSizeActive") {
            return pointConnectionSizeActive;
          }
          if (property === "pointConnectionSizeBy") {
            return pointConnectionSizeBy;
          }
          if (property === "pointConnectionMaxIntPointsPerSegment") {
            return pointConnectionMaxIntPointsPerSegment;
          }
          if (property === "pointConnectionTolerance") {
            return pointConnectionTolerance;
          }
          if (property === "pointScaleMode") {
            return pointScaleMode;
          }
          if (property === "reticleColor") {
            return reticleColor;
          }
          if (property === "regl") {
            return renderer.regl;
          }
          if (property === "showReticle") {
            return showReticle;
          }
          if (property === "version") {
            return version;
          }
          if (property === "width") {
            return width;
          }
          if (property === "xScale") {
            return xScale;
          }
          if (property === "yScale") {
            return yScale;
          }
          if (property === "performanceMode") {
            return performanceMode;
          }
          if (property === "renderPointsAsSquares") {
            return renderPointsAsSquares;
          }
          if (property === "disableAlphaBlending") {
            return disableAlphaBlending;
          }
          if (property === "gamma") {
            return renderer.gamma;
          }
          if (property === "renderer") {
            return renderer;
          }
          if (property === "isDestroyed") {
            return isDestroyed;
          }
          if (property === "isDrawing") {
            return isDrawing;
          }
          if (property === "isPointsDrawn") {
            return isPointsDrawn;
          }
          if (property === "isPointsFiltered") {
            return isPointsFiltered;
          }
          if (property === "isAnnotationsDrawn") {
            return isAnnotationsDrawn;
          }
          if (property === "zDataType") {
            return valueZDataType;
          }
          if (property === "wDataType") {
            return valueWDataType;
          }
          if (property === "spatialIndex") {
            return spatialIndex?.data;
          }
          if (property === "annotationLineColor") {
            return annotationLineColor;
          }
          if (property === "annotationLineWidth") {
            return annotationLineWidth;
          }
          if (property === "annotationHVLineLimit") {
            return annotationHVLineLimit;
          }
          if (property === "antiAliasing") {
            return antiAliasing;
          }
          if (property === "pixelAligned") {
            return pixelAligned;
          }
          if (property === "actionKeyMap") {
            return { ...actionKeyMap };
          }
          return void 0;
        };
        const set = (properties = {}) => {
          if (isDestroyed) {
            return Promise.reject(new Error(ERROR_INSTANCE_IS_DESTROYED));
          }
          checkDeprecations(properties);
          if (properties.backgroundColor !== void 0 || properties.background !== void 0) {
            setBackgroundColor(properties.backgroundColor || properties.background);
          }
          if (properties.backgroundImage !== void 0) {
            setBackgroundImage(properties.backgroundImage);
          }
          if (properties.cameraTarget !== void 0) {
            setCameraTarget(properties.cameraTarget);
          }
          if (properties.cameraDistance !== void 0) {
            setCameraDistance(properties.cameraDistance);
          }
          if (properties.cameraRotation !== void 0) {
            setCameraRotation(properties.cameraRotation);
          }
          if (properties.cameraView !== void 0) {
            setCameraView(properties.cameraView);
          }
          if (properties.cameraIsFixed !== void 0) {
            setCameraIsFixed(properties.cameraIsFixed);
          }
          if (properties.colorBy !== void 0) {
            setColorBy(properties.colorBy);
          }
          if (properties.pointColor !== void 0) {
            setPointColor(properties.pointColor);
          }
          if (properties.pointColorActive !== void 0) {
            setPointColorActive(properties.pointColorActive);
          }
          if (properties.pointColorHover !== void 0) {
            setPointColorHover(properties.pointColorHover);
          }
          if (properties.pointSize !== void 0) {
            setPointSize(properties.pointSize);
          }
          if (properties.pointSizeSelected !== void 0) {
            setPointSizeSelected(properties.pointSizeSelected);
          }
          if (properties.pointSizeMouseDetection !== void 0) {
            setPointSizeMouseDetection(properties.pointSizeMouseDetection);
          }
          if (properties.sizeBy !== void 0) {
            setSizeBy(properties.sizeBy);
          }
          if (properties.opacity !== void 0) {
            setOpacity(properties.opacity);
          }
          if (properties.showPointConnections !== void 0) {
            setShowPointConnections(properties.showPointConnections);
          }
          if (properties.pointConnectionColor !== void 0) {
            setPointConnectionColor(properties.pointConnectionColor);
          }
          if (properties.pointConnectionColorActive !== void 0) {
            setPointConnectionColorActive(properties.pointConnectionColorActive);
          }
          if (properties.pointConnectionColorHover !== void 0) {
            setPointConnectionColorHover(properties.pointConnectionColorHover);
          }
          if (properties.pointConnectionColorBy !== void 0) {
            setPointConnectionColorBy(properties.pointConnectionColorBy);
          }
          if (properties.pointConnectionOpacityBy !== void 0) {
            setPointConnectionOpacityBy(properties.pointConnectionOpacityBy);
          }
          if (properties.pointConnectionOpacity !== void 0) {
            setPointConnectionOpacity(properties.pointConnectionOpacity);
          }
          if (properties.pointConnectionOpacityActive !== void 0) {
            setPointConnectionOpacityActive(properties.pointConnectionOpacityActive);
          }
          if (properties.pointConnectionSize !== void 0) {
            setPointConnectionSize(properties.pointConnectionSize);
          }
          if (properties.pointConnectionSizeActive !== void 0) {
            setPointConnectionSizeActive(properties.pointConnectionSizeActive);
          }
          if (properties.pointConnectionSizeBy !== void 0) {
            setPointConnectionSizeBy(properties.pointConnectionSizeBy);
          }
          if (properties.pointConnectionMaxIntPointsPerSegment !== void 0) {
            setPointConnectionMaxIntPointsPerSegment(
              properties.pointConnectionMaxIntPointsPerSegment
            );
          }
          if (properties.pointConnectionTolerance !== void 0) {
            setPointConnectionTolerance(properties.pointConnectionTolerance);
          }
          if (properties.pointScaleMode !== void 0) {
            setPointScaleMode(properties.pointScaleMode);
          }
          if (properties.opacityBy !== void 0) {
            setOpacityBy(properties.opacityBy);
          }
          if (properties.lassoColor !== void 0) {
            setLassoColor(properties.lassoColor);
          }
          if (properties.lassoLineWidth !== void 0) {
            setLassoLineWidth(properties.lassoLineWidth);
          }
          if (properties.lassoMinDelay !== void 0) {
            setLassoMinDelay(properties.lassoMinDelay);
          }
          if (properties.lassoMinDist !== void 0) {
            setLassoMinDist(properties.lassoMinDist);
          }
          if (properties.lassoClearEvent !== void 0) {
            setLassoClearEvent(properties.lassoClearEvent);
          }
          if (properties.lassoInitiator !== void 0) {
            setLassoInitiator(properties.lassoInitiator);
          }
          if (properties.lassoInitiatorParentElement !== void 0) {
            setLassoInitiatorParentElement(properties.lassoInitiatorParentElement);
          }
          if (properties.lassoLongPressIndicatorParentElement !== void 0) {
            setLassoLongPressIndicatorParentElement(
              properties.lassoLongPressIndicatorParentElement
            );
          }
          if (properties.lassoOnLongPress !== void 0) {
            setLassoOnLongPress(properties.lassoOnLongPress);
          }
          if (properties.lassoLongPressTime !== void 0) {
            setLassoLongPressTime(properties.lassoLongPressTime);
          }
          if (properties.lassoLongPressAfterEffectTime !== void 0) {
            setLassoLongPressAfterEffectTime(
              properties.lassoLongPressAfterEffectTime
            );
          }
          if (properties.lassoLongPressEffectDelay !== void 0) {
            setLassoLongPressEffectDelay(properties.lassoLongPressEffectDelay);
          }
          if (properties.lassoLongPressRevertEffectTime !== void 0) {
            setLassoLongPressRevertEffectTime(
              properties.lassoLongPressRevertEffectTime
            );
          }
          if (properties.lassoType !== void 0) {
            setLassoType(properties.lassoType);
          }
          if (properties.lassoBrushSize !== void 0) {
            setLassoBrushSize(properties.lassoBrushSize);
          }
          if (properties.actionKeyMap !== void 0) {
            setActionKeyMap(properties.actionKeyMap);
          }
          if (properties.mouseMode !== void 0) {
            setMouseMode(properties.mouseMode);
          }
          if (properties.showReticle !== void 0) {
            setShowReticle(properties.showReticle);
          }
          if (properties.reticleColor !== void 0) {
            setReticleColor(properties.reticleColor);
          }
          if (properties.pointOutlineWidth !== void 0) {
            setPointOutlineWidth(properties.pointOutlineWidth);
          }
          if (properties.height !== void 0) {
            setHeight(properties.height);
          }
          if (properties.width !== void 0) {
            setWidth(properties.width);
          }
          if (properties.aspectRatio !== void 0) {
            setDataAspectRatio(properties.aspectRatio);
          }
          if (properties.xScale !== void 0) {
            setXScale(properties.xScale);
          }
          if (properties.yScale !== void 0) {
            setYScale(properties.yScale);
          }
          if (properties.deselectOnDblClick !== void 0) {
            setDeselectOnDblClick(properties.deselectOnDblClick);
          }
          if (properties.deselectOnEscape !== void 0) {
            setDeselectOnEscape(properties.deselectOnEscape);
          }
          if (properties.opacityByDensityFill !== void 0) {
            setOpacityByDensityFill(properties.opacityByDensityFill);
          }
          if (properties.opacityInactiveMax !== void 0) {
            setOpacityInactiveMax(properties.opacityInactiveMax);
          }
          if (properties.opacityInactiveScale !== void 0) {
            setOpacityInactiveScale(properties.opacityInactiveScale);
          }
          if (properties.gamma !== void 0) {
            setGamma(properties.gamma);
          }
          if (properties.annotationLineColor !== void 0) {
            setAnnotationLineColor(properties.annotationLineColor);
          }
          if (properties.annotationLineWidth !== void 0) {
            setAnnotationLineWidth(properties.annotationLineWidth);
          }
          if (properties.annotationHVLineLimit !== void 0) {
            setAnnotationHVLineLimit(properties.annotationHVLineLimit);
          }
          if (properties.antiAliasing !== void 0) {
            setAntiAliasing(properties.antiAliasing);
          }
          if (properties.pixelAligned !== void 0) {
            setPixelAligned(properties.pixelAligned);
          }
          return new Promise((resolve) => {
            window.requestAnimationFrame(() => {
              if (isDestroyed || !canvas) {
                return;
              }
              updateViewAspectRatio();
              camera.refresh();
              renderer.refresh();
              redraw();
              resolve();
            });
          });
        };
        const view = (cameraView, { preventEvent = false } = {}) => {
          setCameraView(cameraView);
          draw = true;
          preventEventView = preventEvent;
        };
        const initCamera = () => {
          if (!camera) {
            camera = dom2dCamera(canvas, {
              isFixed: cameraIsFixed,
              isPanInverted: [false, true],
              defaultMouseDownMoveAction: mouseMode === MOUSE_MODE_ROTATE ? "rotate" : "pan"
            });
          }
          if (initialProperties.cameraView) {
            camera.setView(clone(initialProperties.cameraView));
          } else if (initialProperties.cameraTarget || initialProperties.cameraDistance || initialProperties.cameraRotation) {
            camera.lookAt(
              [...initialProperties.cameraTarget || DEFAULT_TARGET],
              initialProperties.cameraDistance || DEFAULT_DISTANCE,
              initialProperties.cameraRotation || DEFAULT_ROTATION
            );
          } else {
            camera.setView(clone(DEFAULT_VIEW));
          }
          topRightNdc = getScatterGlPos(1, 1);
          bottomLeftNdc = getScatterGlPos(-1, -1);
        };
        const reset = ({ preventEvent = false } = {}) => {
          initCamera();
          updateScales();
          if (preventEvent) {
            return;
          }
          pubSub.publish("view", {
            view: camera.view,
            camera,
            xScale,
            yScale
          });
        };
        const keyUpHandler = ({ key }) => {
          switch (key) {
            case "Escape": {
              if (deselectOnEscape) {
                deselect();
              }
              break;
            }
          }
        };
        const mouseEnterCanvasHandler = () => {
          isMouseInCanvas = true;
          isMouseOverCanvasChecked = true;
        };
        const mouseLeaveCanvasHandler = () => {
          hover();
          isMouseInCanvas = false;
          isMouseOverCanvasChecked = true;
          draw = true;
        };
        const wheelHandler = () => {
          draw = true;
        };
        const clearPoints = () => {
          setPoints([]);
          pointConnections.clear();
        };
        const clearPointConnections = () => {
          pointConnections.clear();
        };
        const clearAnnotations2 = () => {
          drawAnnotations([]);
        };
        const clear = () => {
          clearPoints();
          clearAnnotations2();
        };
        const resizeHandler = () => {
          const autoWidth = width === AUTO;
          const autoHeight = height === AUTO;
          if (autoWidth || autoHeight) {
            const { width: newWidth, height: newHeight } = canvas.getBoundingClientRect();
            if (autoWidth) {
              setCurrentWidth(newWidth, true);
            }
            if (autoHeight) {
              setCurrentHeight(newHeight, true);
            }
            updateViewAspectRatio();
            updateScales();
            draw = true;
          }
          camera.refresh();
        };
        const exportFnAdvanced = async (options) => {
          canvas.style.userSelect = "none";
          const dpr = window.devicePixelRatio;
          const currPointSize = pointSize;
          const currWidth = width;
          const currHeight = height;
          const currRendererWidth = renderer.canvas.width / dpr;
          const currRendererHeight = renderer.canvas.height / dpr;
          const currPixelAligned = pixelAligned;
          const currAntiAliasing = antiAliasing;
          const scale = options?.scale || 1;
          const newPointSize = Array.isArray(pointSize) ? pointSize.map((s) => s * scale) : pointSize * scale;
          const newWidth = currentWidth * scale;
          const newHeight = currentHeight * scale;
          setPointSize(newPointSize);
          setWidth(newWidth);
          setHeight(newHeight);
          setPixelAligned(options?.pixelAligned || pixelAligned);
          setAntiAliasing(options?.antiAliasing || antiAliasing);
          renderer.resize(width, height);
          renderer.refresh();
          await new Promise((resolve) => {
            pubSub.subscribe("draw", resolve, 1);
            redraw();
          });
          const imageData = canvas.getContext("2d").getImageData(0, 0, canvas.width, canvas.height);
          renderer.resize(currRendererWidth, currRendererHeight);
          renderer.refresh();
          setPointSize(currPointSize);
          setWidth(currWidth);
          setHeight(currHeight);
          setPixelAligned(currPixelAligned);
          setAntiAliasing(currAntiAliasing);
          await new Promise((resolve) => {
            pubSub.subscribe("draw", resolve, 1);
            redraw();
          });
          canvas.style.userSelect = null;
          return imageData;
        };
        const exportFn = (options) => {
          if (options === void 0) {
            return canvas.getContext("2d").getImageData(0, 0, canvas.width, canvas.height);
          }
          return exportFnAdvanced(options);
        };
        const init = () => {
          updateViewAspectRatio();
          initCamera();
          updateScales();
          lasso = createLine(renderer.regl, {
            color: lassoColor,
            width: lassoLineWidth,
            is2d: true
          });
          pointConnections = createLine(renderer.regl, {
            color: getColors(
              pointConnectionColor,
              pointConnectionColorActive,
              pointConnectionColorHover
            ),
            opacity: pointConnectionOpacity === null ? null : pointConnectionOpacity[0],
            width: pointConnectionSize[0],
            is2d: true
          });
          reticleHLine = createLine(renderer.regl, {
            color: reticleColor,
            width: 1,
            is2d: true
          });
          reticleVLine = createLine(renderer.regl, {
            color: reticleColor,
            width: 1,
            is2d: true
          });
          annotations = createLine(renderer.regl, {
            color: annotationLineColor,
            width: annotationLineWidth,
            is2d: true
          });
          computePointSizeMouseDetection();
          canvas.addEventListener("wheel", wheelHandler);
          normalPointsIndexBuffer = renderer.regl.buffer();
          selectedPointsIndexBuffer = renderer.regl.buffer();
          hoveredPointIndexBuffer = renderer.regl.buffer({
            usage: "dynamic",
            type: "float",
            length: FLOAT_BYTES * 2
            // This buffer is fixed to exactly 1 point consisting of 2 coordinates
          });
          colorTex = createColorTexture();
          encodingTex = createEncodingTexture();
          const whenSet = set({
            backgroundImage,
            width,
            height,
            actionKeyMap
          });
          updateLassoInitiatorStyle();
          updateLassoLongPressIndicatorStyle();
          window.addEventListener("keyup", keyUpHandler, false);
          window.addEventListener("blur", blurHandler, false);
          window.addEventListener("mouseup", mouseUpHandler, false);
          window.addEventListener("mousemove", mouseMoveHandler, false);
          canvas.addEventListener("mousedown", mouseDownHandler, false);
          canvas.addEventListener("mouseenter", mouseEnterCanvasHandler, false);
          canvas.addEventListener("mouseleave", mouseLeaveCanvasHandler, false);
          canvas.addEventListener("click", mouseClickHandler, false);
          canvas.addEventListener("dblclick", mouseDblClickHandler, false);
          if ("ResizeObserver" in window) {
            canvasObserver = new ResizeObserver(resizeHandler);
            canvasObserver.observe(canvas);
          } else {
            window.addEventListener("resize", resizeHandler);
            window.addEventListener("orientationchange", resizeHandler);
          }
          whenSet.then(() => {
            pubSub.publish("init");
          });
        };
        const cancelFrameListener = renderer.onFrame(() => {
          isViewChanged = camera.tick();
          if (!((isPointsDrawn || isAnnotationsDrawn) && (draw || isTransitioning))) {
            return;
          }
          if (isTransitioning && !tween(transitionDuration, transitionEasing)) {
            endTransition();
          }
          if (isViewChanged) {
            topRightNdc = getScatterGlPos(1, 1);
            bottomLeftNdc = getScatterGlPos(-1, -1);
            if (opacityBy === "density") {
              getNumPointsInViewDb();
            }
          }
          renderer.render(() => {
            const widthRatio = canvas.width / renderer.canvas.width;
            const heightRatio = canvas.height / renderer.canvas.height;
            updateProjectionMatrix(widthRatio, heightRatio);
            if (backgroundImage?._reglType) {
              drawBackgroundImage();
            }
            if (lassoPointsCurr.length > 2) {
              drawLassoPolygon();
            }
            if (!isTransitioning) {
              pointConnections.draw({
                projection: getProjection(),
                model: getModel(),
                view: getView()
              });
            }
            const numPoints2 = getNormalNumPoints();
            if (isPointsDrawn && numPoints2 > 0) {
              drawPointBodies();
            }
            if (!mouseDown && (showReticle || drawReticleOnce)) {
              drawReticle();
            }
            if (hoveredPoint >= 0) {
              drawHoveredPoint();
            }
            if (selectedPoints.length > 0) {
              drawSelectedPoints();
            }
            annotations.draw({
              projection: getProjection(),
              model: getModel(),
              view: getView()
            });
            lasso.draw({
              projection: getProjection(),
              model: getModel(),
              view: getView()
            });
          }, canvas);
          const renderView = {
            view: camera.view,
            isViewChanged,
            camera,
            xScale,
            yScale
          };
          if (isViewChanged) {
            updateScales();
            if (preventEventView) {
              preventEventView = false;
            } else {
              pubSub.publish("view", renderView);
            }
          }
          draw = false;
          drawReticleOnce = false;
          pubSub.publish("drawing", renderView, { async: false });
          pubSub.publish("draw", renderView);
        });
        const redraw = () => {
          draw = true;
        };
        const destroy = () => {
          isPointsDrawn = false;
          isAnnotationsDrawn = false;
          isDestroyed = true;
          cancelFrameListener();
          window.removeEventListener("keyup", keyUpHandler, false);
          window.removeEventListener("blur", blurHandler, false);
          window.removeEventListener("mouseup", mouseUpHandler, false);
          window.removeEventListener("mousemove", mouseMoveHandler, false);
          canvas.removeEventListener("mousedown", mouseDownHandler, false);
          canvas.removeEventListener("mouseenter", mouseEnterCanvasHandler, false);
          canvas.removeEventListener("mouseleave", mouseLeaveCanvasHandler, false);
          canvas.removeEventListener("click", mouseClickHandler, false);
          canvas.removeEventListener("dblclick", mouseDblClickHandler, false);
          canvas.removeEventListener("wheel", wheelHandler, false);
          if (canvasObserver) {
            canvasObserver.disconnect();
          } else {
            window.removeEventListener("resize", resizeHandler);
            window.removeEventListener("orientationchange", resizeHandler);
          }
          canvas = void 0;
          camera.dispose();
          camera = void 0;
          lasso.destroy();
          lassoManager.destroy();
          pointConnections.destroy();
          reticleHLine.destroy();
          reticleVLine.destroy();
          if (colorTex) {
            colorTex.destroy();
          }
          if (encodingTex) {
            encodingTex.destroy();
          }
          if (!(initialProperties.renderer || renderer.isDestroyed)) {
            renderer.destroy();
          }
          pubSub.publish("destroy");
          pubSub.clear();
        };
        init();
        return {
          /**
           * Get whether the browser supports all necessary WebGL features
           * @return {boolean} If `true` the browser supports all necessary WebGL features
           */
          get isSupported() {
            return renderer.isSupported;
          },
          clear: withDraw(clear),
          clearPoints: withDraw(clearPoints),
          clearPointConnections: withDraw(clearPointConnections),
          clearAnnotations: withDraw(clearAnnotations2),
          createTextureFromUrl: (url, timeout = DEFAULT_IMAGE_LOAD_TIMEOUT) => createTextureFromUrl(renderer.regl, url, timeout),
          deselect,
          destroy,
          draw: publicDraw,
          drawAnnotations,
          filter,
          get,
          getScreenPosition,
          hover,
          lassoSelect,
          redraw,
          refresh: renderer.refresh,
          reset: withDraw(reset),
          select,
          set,
          export: exportFn,
          subscribe: pubSub.subscribe,
          unfilter,
          unsubscribe: pubSub.unsubscribe,
          view,
          zoomToLocation,
          zoomToArea,
          zoomToPoints,
          zoomToOrigin
        };
      };
      createSpatialIndex = (points, useWorker) => toArrayOrientedPoints(points).then((arrayPoints) => createKdbush(arrayPoints, { useWorker })).then((index) => index.data);
    }
  });

  // inst/htmlwidgets/myIO/src/utils/responsive.js
  var MOBILE_BREAKPOINT = 600;
  function isMobile(chart) {
    return chart.runtime.totalWidth <= MOBILE_BREAKPOINT;
  }
  function responsiveValue(chart, desktop, mobile) {
    return isMobile(chart) ? mobile : desktop;
  }
  function pointRadius(chart) {
    return responsiveValue(chart, 5, 3);
  }
  function strokeWidth(chart) {
    return responsiveValue(chart, 3, 1);
  }
  function tagName(type, elementId, label) {
    return "tag-" + type + "-" + elementId + "-" + String(label).replace(/[^a-zA-Z0-9_-]/g, "");
  }
  function isColorSchemeActive(chart) {
    return chart.config.scales.colorScheme.enabled === true;
  }
  function resolveColor(chart, colorKeyValue, fallback) {
    return isColorSchemeActive(chart) ? chart.derived.colorDiscrete(colorKeyValue) : fallback;
  }

  // inst/htmlwidgets/myIO/src/renderers/LineRenderer.js
  var LineRenderer = class {
    static type = "line";
    static traits = { hasAxes: true, referenceLines: true, legendType: "layer", binning: false, rolloverStyle: "overlay", scaleCapabilities: { invertX: true } };
    static scaleHints = { xScaleType: "linear", yScaleType: "linear", yExtentFields: ["y_var"], domainMerge: "union" };
    static dataContract = { x_var: { required: true, numeric: true, sorted: true }, y_var: { required: true, numeric: true } };
    render(chart, layer) {
      var data = layer.data;
      var key = layer.label;
      var currentY = chart.newY ? chart.newY : layer.mapping.y_var;
      var transitionSpeed = chart.options.transition.speed;
      var valueLine = d3.line().curve(d3.curveMonotoneX).x(function(d) {
        return chart.xScale(d[layer.mapping.x_var]);
      }).y(function(d) {
        return chart.yScale(d[currentY]);
      });
      var linePath = chart.chart.selectAll("." + tagName("line", chart.element.id, key)).data([data]);
      linePath.exit().transition().duration(transitionSpeed).style("opacity", 0).remove();
      var newLinePath = linePath.enter().append("path").attr("fill", "none").attr("clip-path", "url(#" + chart.element.id + "clip)").style("stroke", function(d) {
        return resolveColor(chart, d[layer.mapping.group], layer.color);
      }).style("stroke-width", strokeWidth(chart)).style("opacity", 0).attr("class", tagName("line", chart.element.id, key));
      linePath.merge(newLinePath).transition().ease(d3.easeQuad).duration(transitionSpeed).style("opacity", 1).style("stroke-width", strokeWidth(chart)).style("stroke", function(d) {
        return resolveColor(chart, d[0][layer.mapping.group], layer.color);
      }).attr("d", valueLine);
      var fittingTransforms = ["lm", "loess", "polynomial", "smooth"];
      if (fittingTransforms.indexOf(layer.transform) === -1) {
        this.renderPoints(chart, layer);
      }
    }
    renderPoints(chart, layer) {
      var transitionSpeed = chart.options.transition.speed;
      var points = chart.chart.selectAll("." + tagName("point", chart.element.id, layer.label)).data(layer.data);
      points.exit().transition().remove();
      points.transition().ease(d3.easeQuad).duration(transitionSpeed).attr("r", pointRadius(chart)).style("fill", function(d) {
        return resolveColor(chart, d[layer.mapping.group], layer.color);
      }).attr("cx", function(d) {
        return chart.xScale(d[layer.mapping.x_var]);
      }).attr("cy", function(d) {
        return chart.yScale(d[chart.newY ? chart.newY : layer.mapping.y_var]);
      });
      points.enter().append("circle").attr("r", pointRadius(chart)).style("fill", function(d) {
        return resolveColor(chart, d[layer.mapping.group], layer.color);
      }).style("opacity", 0).attr("clip-path", "url(#" + chart.element.id + "clip)").attr("cx", function(d) {
        return chart.xScale(d[layer.mapping.x_var]);
      }).attr("cy", function(d) {
        return chart.yScale(d[chart.newY ? chart.newY : layer.mapping.y_var]);
      }).attr("class", tagName("point", chart.element.id, layer.label)).transition().ease(d3.easeQuad).duration(transitionSpeed).style("opacity", 1);
    }
    formatTooltip(chart, d, layer) {
      return { title: layer.mapping.x_var + ": " + d[layer.mapping.x_var], body: layer.label + ": " + d[chart.runtime.activeY || layer.mapping.y_var], color: layer.color, label: layer.label, value: d[chart.runtime.activeY || layer.mapping.y_var], raw: d };
    }
    remove(chart, layer) {
      chart.dom.chartArea.selectAll("." + tagName("line", chart.dom.element.id, layer.label)).transition().duration(500).style("opacity", 0).remove();
      chart.dom.chartArea.selectAll("." + tagName("point", chart.dom.element.id, layer.label)).transition().duration(500).style("opacity", 0).remove();
    }
  };

  // inst/htmlwidgets/myIO/src/renderers/PointRenderer.js
  var PointRenderer = class {
    static type = "point";
    static traits = { hasAxes: true, referenceLines: true, legendType: "layer", binning: false, rolloverStyle: "element", scaleCapabilities: { invertX: false } };
    static scaleHints = { xScaleType: "linear", yScaleType: "linear", yExtentFields: ["y_var"], domainMerge: "union" };
    static dataContract = { x_var: { required: true, numeric: true }, y_var: { required: true, numeric: true } };
    render(chart, layer) {
      var transitionSpeed = chart.options.transition.speed;
      var isWhisker = layer._compositeRole === "whisker_low" || layer._compositeRole === "whisker_high";
      var isMedian = layer._compositeRole === "median";
      if (layer.mapping.low_y) {
        if (isMedian) {
          renderMedianLine(chart, layer);
        } else if (isWhisker) {
          renderWhiskerLine(chart, layer);
          renderWhiskerCaps(chart, layer);
        } else {
          renderCrosshairsY(chart, layer);
        }
      }
      if (layer.mapping.low_x) {
        renderCrosshairsX(chart, layer);
      }
      if (isWhisker || isMedian) return;
      var points = chart.chart.selectAll("." + tagName("point", chart.element.id, layer.label)).data(layer.data);
      points.exit().transition().duration(transitionSpeed).style("opacity", 0).remove();
      points.transition().ease(d3.easeQuad).duration(transitionSpeed).attr("r", pointRadius(chart)).style("fill", function(d) {
        return resolveColor(chart, d[layer.mapping.group], layer.color);
      }).attr("cx", function(d) {
        return chart.xScale(d[layer.mapping.x_var]);
      }).attr("cy", function(d) {
        return chart.yScale(d[chart.newY ? chart.newY : layer.mapping.y_var]);
      });
      points.enter().append("circle").attr("r", pointRadius(chart)).style("fill", function(d) {
        return resolveColor(chart, d[layer.mapping.group], layer.color);
      }).style("opacity", 0).attr("clip-path", "url(#" + chart.element.id + "clip)").attr("cx", function(d) {
        return chart.xScale(d[layer.mapping.x_var]);
      }).attr("cy", function(d) {
        return chart.yScale(d[chart.newY ? chart.newY : layer.mapping.y_var]);
      }).attr("class", tagName("point", chart.element.id, layer.label)).transition().ease(d3.easeQuad).duration(transitionSpeed).style("opacity", 1);
      if (chart.options.dragPoints == true) {
        chart.dragPoints(layer);
        var color = resolveColor(chart, layer.data[layer.mapping.group], layer.color);
        setTimeout(function() {
          chart.updateRegression(color, layer.label);
        }, transitionSpeed);
      }
    }
    getHoverSelector(chart, layer) {
      return "." + tagName("point", chart.dom.element.id, layer.label);
    }
    formatTooltip(chart, d, layer) {
      return { title: layer.mapping.x_var + ": " + d[layer.mapping.x_var], body: layer.mapping.y_var + ": " + d[chart.runtime.activeY || layer.mapping.y_var], color: layer.color, label: layer.label, value: d[chart.runtime.activeY || layer.mapping.y_var], raw: d };
    }
    remove(chart, layer) {
      chart.dom.chartArea.selectAll("." + tagName("point", chart.dom.element.id, layer.label)).transition().duration(500).style("opacity", 0).remove();
      chart.dom.chartArea.selectAll("." + tagName("crosshairX", chart.dom.element.id, layer.label)).transition().duration(500).style("opacity", 0).remove();
      chart.dom.chartArea.selectAll("." + tagName("crosshairY", chart.dom.element.id, layer.label)).transition().duration(500).style("opacity", 0).remove();
      chart.dom.chartArea.selectAll("." + tagName("whiskerCap", chart.dom.element.id, layer.label)).transition().duration(500).style("opacity", 0).remove();
      chart.dom.chartArea.selectAll("." + tagName("medianLine", chart.dom.element.id, layer.label)).transition().duration(500).style("opacity", 0).remove();
    }
  };
  function renderCrosshairsX(chart, layer) {
    var transitionSpeed = chart.options.transition.speed;
    var crosshairsX = chart.chart.selectAll("." + tagName("crosshairX", chart.element.id, layer.label)).data(layer.data);
    crosshairsX.exit().transition().duration(transitionSpeed).style("opacity", 0).remove();
    crosshairsX.transition().duration(transitionSpeed).ease(d3.easeQuad).attr("x1", function(d) {
      return chart.xScale(d[layer.mapping.low_x]);
    }).attr("x2", function(d) {
      return chart.xScale(d[layer.mapping.high_x]);
    }).attr("y1", function(d) {
      return chart.yScale(d[layer.mapping.y_var]);
    }).attr("y2", function(d) {
      return chart.yScale(d[layer.mapping.y_var]);
    });
    crosshairsX.enter().append("line").style("fill", "none").style("stroke", "black").attr("clip-path", "url(#" + chart.element.id + "clip)").style("opacity", 0.5).attr("x1", function(d) {
      return chart.xScale(d[layer.mapping.x_var]);
    }).attr("x2", function(d) {
      return chart.xScale(d[layer.mapping.x_var]);
    }).attr("y1", function(d) {
      return chart.yScale(d[layer.mapping.y_var]);
    }).attr("y2", function(d) {
      return chart.yScale(d[layer.mapping.y_var]);
    }).attr("class", tagName("crosshairX", chart.element.id, layer.label)).transition().delay(transitionSpeed).duration(transitionSpeed).ease(d3.easeQuad).attr("x1", function(d) {
      return chart.xScale(d[layer.mapping.low_x]);
    }).attr("x2", function(d) {
      return chart.xScale(d[layer.mapping.high_x]);
    });
  }
  function renderMedianLine(chart, layer) {
    var transitionSpeed = chart.options.transition.speed;
    var barHalfWidth = (layer.options && layer.options.rangeBarWidth ? layer.options.rangeBarWidth : Math.max(6, Math.min(60, (chart.width - (chart.margin.left + chart.margin.right)) / Math.max(layer.data.length * 3, 1)))) / 2;
    var lines = chart.chart.selectAll("." + tagName("medianLine", chart.element.id, layer.label)).data(layer.data);
    lines.exit().transition().duration(transitionSpeed).style("opacity", 0).remove();
    lines.transition().duration(transitionSpeed).ease(d3.easeQuad).attr("x1", function(d) {
      return chart.xScale(d[layer.mapping.x_var]) - barHalfWidth;
    }).attr("x2", function(d) {
      return chart.xScale(d[layer.mapping.x_var]) + barHalfWidth;
    }).attr("y1", function(d) {
      return chart.yScale(d[layer.mapping.y_var]);
    }).attr("y2", function(d) {
      return chart.yScale(d[layer.mapping.y_var]);
    });
    lines.enter().append("line").style("fill", "none").style("stroke", "white").style("stroke-width", "2px").attr("clip-path", "url(#" + chart.element.id + "clip)").attr("x1", function(d) {
      return chart.xScale(d[layer.mapping.x_var]);
    }).attr("x2", function(d) {
      return chart.xScale(d[layer.mapping.x_var]);
    }).attr("y1", function(d) {
      return chart.yScale(d[layer.mapping.y_var]);
    }).attr("y2", function(d) {
      return chart.yScale(d[layer.mapping.y_var]);
    }).attr("class", tagName("medianLine", chart.element.id, layer.label)).transition().delay(transitionSpeed).duration(transitionSpeed).ease(d3.easeQuad).style("opacity", 1).attr("x1", function(d) {
      return chart.xScale(d[layer.mapping.x_var]) - barHalfWidth;
    }).attr("x2", function(d) {
      return chart.xScale(d[layer.mapping.x_var]) + barHalfWidth;
    });
  }
  function renderWhiskerCaps(chart, layer) {
    var transitionSpeed = chart.options.transition.speed;
    var capHalfWidth = 8;
    var isLow = layer._compositeRole === "whisker_low";
    var capYField = isLow ? layer.mapping.low_y : layer.mapping.high_y;
    var caps = chart.chart.selectAll("." + tagName("whiskerCap", chart.element.id, layer.label)).data(layer.data);
    caps.exit().transition().duration(transitionSpeed).style("opacity", 0).remove();
    caps.transition().duration(transitionSpeed).ease(d3.easeQuad).attr("x1", function(d) {
      return chart.xScale(d[layer.mapping.x_var]) - capHalfWidth;
    }).attr("x2", function(d) {
      return chart.xScale(d[layer.mapping.x_var]) + capHalfWidth;
    }).attr("y1", function(d) {
      return chart.yScale(d[capYField]);
    }).attr("y2", function(d) {
      return chart.yScale(d[capYField]);
    });
    caps.enter().append("line").style("fill", "none").style("stroke", "black").attr("clip-path", "url(#" + chart.element.id + "clip)").style("opacity", 0.5).attr("x1", function(d) {
      return chart.xScale(d[layer.mapping.x_var]);
    }).attr("x2", function(d) {
      return chart.xScale(d[layer.mapping.x_var]);
    }).attr("y1", function(d) {
      return chart.yScale(d[capYField]);
    }).attr("y2", function(d) {
      return chart.yScale(d[capYField]);
    }).attr("class", tagName("whiskerCap", chart.element.id, layer.label)).transition().delay(transitionSpeed * 2).duration(transitionSpeed).ease(d3.easeQuad).attr("x1", function(d) {
      return chart.xScale(d[layer.mapping.x_var]) - capHalfWidth;
    }).attr("x2", function(d) {
      return chart.xScale(d[layer.mapping.x_var]) + capHalfWidth;
    });
  }
  function renderWhiskerLine(chart, layer) {
    var transitionSpeed = chart.options.transition.speed;
    var isLow = layer._compositeRole === "whisker_low";
    var boxEdgeField = isLow ? layer.mapping.high_y : layer.mapping.low_y;
    var whiskerEndField = isLow ? layer.mapping.low_y : layer.mapping.high_y;
    var lines = chart.chart.selectAll("." + tagName("crosshairY", chart.element.id, layer.label)).data(layer.data);
    lines.exit().transition().duration(transitionSpeed).style("opacity", 0).remove();
    lines.transition().ease(d3.easeQuad).duration(transitionSpeed).attr("x1", function(d) {
      return chart.xScale(d[layer.mapping.x_var]);
    }).attr("x2", function(d) {
      return chart.xScale(d[layer.mapping.x_var]);
    }).attr("y1", function(d) {
      return chart.yScale(d[boxEdgeField]);
    }).attr("y2", function(d) {
      return chart.yScale(d[whiskerEndField]);
    });
    lines.enter().append("line").style("fill", "none").style("stroke", "black").attr("clip-path", "url(#" + chart.element.id + "clip)").style("opacity", 0.5).attr("x1", function(d) {
      return chart.xScale(d[layer.mapping.x_var]);
    }).attr("x2", function(d) {
      return chart.xScale(d[layer.mapping.x_var]);
    }).attr("y1", function(d) {
      return chart.yScale(d[boxEdgeField]);
    }).attr("y2", function(d) {
      return chart.yScale(d[boxEdgeField]);
    }).attr("class", tagName("crosshairY", chart.element.id, layer.label)).transition().delay(transitionSpeed).ease(d3.easeQuad).duration(transitionSpeed).attr("y2", function(d) {
      return chart.yScale(d[whiskerEndField]);
    });
  }
  function renderCrosshairsY(chart, layer) {
    var transitionSpeed = chart.options.transition.speed;
    var crosshairsY = chart.chart.selectAll("." + tagName("crosshairY", chart.element.id, layer.label)).data(layer.data);
    crosshairsY.exit().transition().duration(transitionSpeed).style("opacity", 0).remove();
    crosshairsY.transition().ease(d3.easeQuad).duration(transitionSpeed).attr("x1", function(d) {
      return chart.xScale(d[layer.mapping.x_var]);
    }).attr("x2", function(d) {
      return chart.xScale(d[layer.mapping.x_var]);
    }).attr("y1", function(d) {
      return chart.yScale(d[layer.mapping.low_y]);
    }).attr("y2", function(d) {
      return chart.yScale(d[layer.mapping.high_y]);
    });
    crosshairsY.enter().append("line").style("fill", "none").style("stroke", "black").attr("clip-path", "url(#" + chart.element.id + "clip)").style("opacity", 0.5).attr("x1", function(d) {
      return chart.xScale(d[layer.mapping.x_var]);
    }).attr("x2", function(d) {
      return chart.xScale(d[layer.mapping.x_var]);
    }).attr("y1", function(d) {
      return chart.yScale(d[layer.mapping.y_var]);
    }).attr("y2", function(d) {
      return chart.yScale(d[layer.mapping.y_var]);
    }).attr("class", tagName("crosshairY", chart.element.id, layer.label)).transition().delay(transitionSpeed).ease(d3.easeQuad).duration(transitionSpeed).attr("y1", function(d) {
      return chart.yScale(d[layer.mapping.low_y]);
    }).attr("y2", function(d) {
      return chart.yScale(d[layer.mapping.high_y]);
    });
  }

  // inst/htmlwidgets/myIO/src/renderers/AreaRenderer.js
  var AreaRenderer = class {
    static type = "area";
    static traits = { hasAxes: true, referenceLines: true, legendType: "layer", binning: false, rolloverStyle: "overlay", scaleCapabilities: { invertX: true } };
    static scaleHints = { xScaleType: "linear", yScaleType: "linear", yExtentFields: ["low_y", "high_y"], domainMerge: "union" };
    static dataContract = { x_var: { required: true, numeric: true } };
    render(chart, layer) {
      var data = layer.data;
      var key = layer.label;
      var transitionSpeed = chart.options.transition.speed;
      var isVertical = layer.options && layer.options.orientation === "vertical";
      var fillOpacity = layer.options && typeof layer.options.areaOpacity === "number" ? layer.options.areaOpacity : 0.4;
      var boundaryStroke = !!(layer.options && layer.options.boundaryStroke === true);
      var valueArea;
      if (isVertical) {
        valueArea = d3.area().curve(d3.curveMonotoneY).y(function(d) {
          return chart.yScale(d[layer.mapping.y_var]);
        }).x0(function(d) {
          return chart.xScale(d[layer.mapping.low_x]);
        }).x1(function(d) {
          return chart.xScale(d[layer.mapping.high_x]);
        });
      } else {
        valueArea = d3.area().curve(d3.curveMonotoneX).x(function(d) {
          return chart.xScale(d[layer.mapping.x_var]);
        }).y0(function(d) {
          return chart.yScale(d[layer.mapping.low_y]);
        }).y1(function(d) {
          return chart.yScale(d[layer.mapping.high_y]);
        });
      }
      var linePath = chart.chart.selectAll("." + tagName("area", chart.element.id, key)).data([data]);
      linePath.exit().transition().duration(transitionSpeed).style("opacity", 0).remove();
      var newLinePath = linePath.enter().append("path").attr("clip-path", "url(#" + chart.element.id + "clip)").style("fill", function(d) {
        return resolveColor(chart, d[0][layer.mapping.group], layer.color);
      }).style("stroke", boundaryStroke ? layer.color : "none").style("stroke-width", boundaryStroke ? "1px" : "0").style("stroke-opacity", boundaryStroke ? 0.85 : 0).style("opacity", 0).attr("class", tagName("area", chart.element.id, key));
      linePath.merge(newLinePath).attr("clip-path", "url(#" + chart.element.id + "clip)").transition().ease(d3.easeQuad).duration(transitionSpeed).attr("d", valueArea).style("stroke", boundaryStroke ? layer.color : "none").style("stroke-width", boundaryStroke ? "1px" : "0").style("stroke-opacity", boundaryStroke ? 0.85 : 0).style("opacity", fillOpacity);
    }
    formatTooltip(chart, d, layer) {
      var displayValue = d.density != null ? d.density : d[layer.mapping.high_y];
      var titleField = layer.options && layer.options.orientation === "vertical" ? layer.mapping.y_var : layer.mapping.x_var;
      var titleValue = d[titleField];
      return { title: titleField + ": " + titleValue, body: layer.label + ": " + displayValue, color: layer.color, label: layer.label, value: displayValue, raw: d };
    }
    remove(chart, layer) {
      chart.dom.chartArea.selectAll("." + tagName("area", chart.dom.element.id, layer.label)).transition().duration(500).style("opacity", 0).remove();
    }
  };

  // inst/htmlwidgets/myIO/src/renderers/BarRenderer.js
  var BarRenderer = class {
    static type = "bar";
    static traits = { hasAxes: true, referenceLines: true, legendType: "layer", binning: false, rolloverStyle: "element", scaleCapabilities: { invertX: false } };
    static scaleHints = { xScaleType: "band", yScaleType: "linear", yExtentFields: ["y_var"], domainMerge: "union" };
    static dataContract = { x_var: { required: true }, y_var: { required: true, numeric: true } };
    render(chart, layer) {
      if (chart.options.flipAxis === true) {
        renderHorizontalBars(chart, layer);
        return;
      }
      renderVerticalBars(chart, layer);
    }
    getHoverSelector(chart, layer) {
      return "." + tagName("bar", chart.dom.element.id, layer.label);
    }
    formatTooltip(chart, d, layer) {
      return { title: layer.mapping.x_var + ": " + d[layer.mapping.x_var], body: layer.mapping.y_var + ": " + d[layer.mapping.y_var], color: layer.color, label: layer.label, value: d[layer.mapping.y_var], raw: d };
    }
    remove(chart, layer) {
      chart.dom.chartArea.selectAll("." + tagName("bar", chart.dom.element.id, layer.label)).transition().duration(500).style("opacity", 0).remove();
    }
  };
  function renderVerticalBars(chart, layer) {
    var m = chart.margin;
    var data = layer.data;
    var key = layer.label;
    var barSize = layer.options.barSize == "small" ? 0.5 : 1;
    var bandwidth = chart.options.categoricalScale.xAxis == true ? (chart.width - (m.left + m.right)) / chart.x_banded.length : Math.min(100, (chart.width - (chart.margin.right + chart.margin.left)) / layer.data.length);
    var transitionSpeed = chart.options.transition.speed;
    var bars = chart.chart.selectAll("." + tagName("bar", chart.element.id, key)).data(data);
    bars.exit().transition().ease(d3.easeQuadIn).duration(transitionSpeed).attr("y", chart.yScale(0)).remove();
    var newBars = bars.enter().append("rect").attr("class", tagName("bar", chart.element.id, key)).attr("clip-path", "url(#" + chart.element.id + "clip)").style("fill", function(d) {
      return resolveColor(chart, d[layer.mapping.x_var], layer.color);
    }).attr("x", function(d) {
      return defineVerticalScale(chart, d, layer, bandwidth, barSize, chart.options.categoricalScale.xAxis);
    }).attr("y", chart.yScale(0)).attr("width", barSize * bandwidth - 2).attr("height", chart.yScale(0));
    bars.merge(newBars).transition().ease(d3.easeQuadOut).duration(transitionSpeed).delay(function(d, i) {
      return i * 20;
    }).attr("x", function(d) {
      return defineVerticalScale(chart, d, layer, bandwidth, barSize, chart.options.categoricalScale.xAxis);
    }).attr("y", function(d) {
      return chart.yScale(d[layer.mapping.y_var]);
    }).attr("width", barSize * bandwidth - 2).attr("height", function(d) {
      return chart.height - (m.top + m.bottom) - chart.yScale(d[layer.mapping.y_var]);
    });
  }
  function defineVerticalScale(chart, d, layer, bandwidth, barSize, scale) {
    switch (scale) {
      case true:
        return barSize == 1 ? chart.xScale(d[layer.mapping.x_var]) : chart.xScale(d[layer.mapping.x_var]) + bandwidth / 4;
      default:
        return barSize == 1 ? chart.xScale(d[layer.mapping.x_var]) - bandwidth / 2 : chart.xScale(d[layer.mapping.x_var]) - bandwidth / 4;
    }
  }
  function renderHorizontalBars(chart, layer) {
    var m = chart.margin;
    var data = layer.data;
    var key = layer.label;
    var barSize = layer.options.barSize == "small" ? 0.5 : 1;
    var bandwidth = chart.options.categoricalScale.yAxis == true ? (chart.height - (m.top + m.bottom)) / layer.data.length : Math.min(100, (chart.height - (chart.margin.top + chart.margin.bottom)) / layer.data.length);
    var transitionSpeed = chart.options.transition.speed;
    var bars = chart.chart.selectAll("." + tagName("bar", chart.element.id, key)).data(data);
    bars.exit().transition().ease(d3.easeQuadIn).duration(transitionSpeed).attr("width", 0).remove();
    var newBars = bars.enter().append("rect").attr("class", tagName("bar", chart.element.id, key)).attr("clip-path", "url(#" + chart.element.id + "clip)").style("fill", function(d) {
      return resolveColor(chart, d[layer.mapping.x_var], layer.color);
    }).attr("y", function(d) {
      return barSize == 1 ? chart.yScale(d[layer.mapping.x_var]) : chart.yScale(d[layer.mapping.x_var]) + bandwidth / 4;
    }).attr("x", function(d) {
      return chart.xScale(Math.min(0, d[layer.mapping.y_var]));
    }).attr("height", barSize * bandwidth - 2).attr("width", 0);
    bars.merge(newBars).transition().ease(d3.easeQuadOut).duration(transitionSpeed).delay(function(d, i) {
      return i * 20;
    }).attr("y", function(d) {
      return barSize == 1 ? chart.yScale(d[layer.mapping.x_var]) : chart.yScale(d[layer.mapping.x_var]) + bandwidth / 4;
    }).attr("x", function(d) {
      return chart.xScale(Math.min(0, d[layer.mapping.y_var]));
    }).attr("height", barSize * bandwidth - 2).attr("width", function(d) {
      return Math.abs(chart.xScale(d[layer.mapping.y_var]) - chart.xScale(0));
    });
  }

  // inst/htmlwidgets/myIO/src/layout/scaffold.js
  function getChartHeight(chart) {
    return chart.height;
  }
  function initializeScaffold(chart) {
    d3.select(chart.element).selectAll(".myIO-svg, .toolTip, .myIO-fab, .myIO-panel, .myIO-sheet-backdrop").remove();
    d3.select(chart.element).classed("myIO-container", true).style("position", "relative");
    chart.svg = d3.select(chart.element).append("svg").attr("class", "myIO-svg").attr("id", "myIO-svg" + chart.element.id).attr("width", chart.totalWidth).attr("height", chart.height).attr("viewBox", "0 0 " + chart.totalWidth + " " + chart.height).attr("role", "img").attr("aria-label", buildAriaLabel(chart));
    chart.svg.append("rect").attr("class", "myIO-bg").attr("width", chart.totalWidth).attr("height", chart.height).attr("fill", "var(--chart-bg, #ffffff)");
    renderChartTitle(chart);
    applyPlotTransform(chart);
    chart.chart = chart.plot.append("g").attr("class", "myIO-chart-area");
  }
  function buildAriaLabel(chart) {
    var firstLayer = chart.plotLayers[0];
    if (!firstLayer) {
      return "Data visualization chart";
    }
    var chartType = firstLayer.type ? firstLayer.type.replace(/([A-Z])/g, " $1").toLowerCase() : "data visualization";
    var xLabel = chart.options.xAxisLabel || chart.options.xAxisFormat || "x-axis";
    var yLabel = chart.options.yAxisLabel || chart.options.yAxisFormat || "y-axis";
    return chartType.charAt(0).toUpperCase() + chartType.slice(1) + " chart showing " + yLabel + " by " + xLabel;
  }
  function updateScaffoldLayout(chart) {
    chart.svg.attr("width", chart.totalWidth).attr("height", chart.height).attr("viewBox", "0 0 " + chart.totalWidth + " " + chart.height);
    applyPlotTransform(chart);
    if (chart.plotLayers[0] && chart.plotLayers[0].type !== "gauge" && chart.plotLayers[0].type !== "donut" && chart.clipPath) {
      chart.clipPath.attr("x", 0).attr("y", 0).attr("width", chart.width - (chart.margin.left + chart.margin.right)).attr("height", getChartHeight(chart) - (chart.margin.top + chart.margin.bottom));
    }
    renderChartTitle(chart);
  }
  function renderChartTitle(chart) {
    if (!chart || !chart.svg) {
      return;
    }
    var title = chart.config && chart.config.title;
    var titleData = title ? [title] : [];
    chart.svg.selectAll(".myIO-chart-title").data(titleData).join(
      function(enter) {
        return enter.append("text").attr("class", "myIO-chart-title").attr("x", chart.margin.left).attr("y", 19).text(function(d) {
          return d;
        });
      },
      function(update) {
        return update.attr("x", chart.margin.left).attr("y", 19).text(function(d) {
          return d;
        });
      },
      function(exit) {
        return exit.remove();
      }
    );
  }
  function applyPlotTransform(chart) {
    var primaryType = chart.plotLayers[0] ? chart.plotLayers[0].type : null;
    switch (primaryType) {
      case "gauge":
        chart.plot = chart.plot || chart.svg.append("g");
        chart.plot.attr("transform", "translate(" + chart.width / 2 + "," + responsiveValue(chart, chart.height * 0.8, chart.height * 0.6) + ")").attr("class", "myIO-chart-offset");
        break;
      case "donut":
        chart.plot = chart.plot || chart.svg.append("g");
        chart.plot.attr("transform", "translate(" + chart.width / 2 + "," + responsiveValue(chart, chart.height, chart.height * 0.8) / 2 + ")").attr("class", "myIO-chart-offset");
        break;
      default:
        chart.plot = chart.plot || chart.svg.append("g");
        chart.plot.attr("transform", "translate(" + chart.margin.left + "," + chart.margin.top + ")").attr("class", "myIO-chart-offset");
    }
  }

  // inst/htmlwidgets/myIO/src/layout/axes.js
  function syncAxes(chart, state, options) {
    if (!state.axesChart) {
      return;
    }
    renderAxes(chart, { isInitialRender: options && options.isInitialRender });
  }
  function renderAxes(chart, options) {
    var m = chart.margin;
    var chartHeight = getChartHeight(chart);
    var transitionSpeed = chart.options.transition.speed;
    var xFormat = chart.options.xAxisFormat === "yearMon" ? function(x) {
      var n = +x;
      var ms = Number.isFinite(n) && n > 0 && n < 1e6 ? n * 864e5 : n;
      var date = new Date(ms);
      return Number.isFinite(date.getTime()) ? d3.utcFormat("%b %d")(date) : x;
    } : chart.options.xAxisFormat ? d3.format(chart.options.xAxisFormat) : null;
    var yFormat = chart.options.yAxisFormat ? d3.format(chart.options.yAxisFormat) : null;
    var xAxis = chart.plot.selectAll(".x-axis").data([null]).join("g").attr("class", "x-axis");
    var yAxis = chart.plot.selectAll(".y-axis").data([null]).join("g").attr("class", "y-axis");
    var xAxisSelection = options && options.isInitialRender ? xAxis : xAxis.transition().ease(d3.easeQuad).duration(transitionSpeed);
    if (chart.options.suppressAxis && chart.options.suppressAxis.xAxis === true) {
      xAxis.selectAll("*").remove();
    } else {
      switch (chart.options.categoricalScale.xAxis) {
        case true:
          xAxisSelection.attr("transform", "translate(0," + (chartHeight - (m.top + m.bottom)) + ")").call(d3.axisBottom(chart.xScale)).selectAll("text").attr("dx", "-.25em").attr("text-anchor", chart.width < 550 ? "end" : "center").attr("transform", chart.width < 550 ? "rotate(-65)" : "rotate(-0)");
          break;
        case false:
          var xAxisGenerator = d3.axisBottom(chart.xScale).tickSize(-(chartHeight - (m.top + m.bottom)));
          var xTickLabels = normalizeTickLabels(chart.options.xTickLabels);
          if (xTickLabels) {
            xAxisGenerator.tickValues(Object.keys(xTickLabels).map(function(value) {
              return +value;
            })).tickFormat(function(value) {
              var label = xTickLabels[String(value)];
              return label == null ? value : label;
            });
          } else {
            xAxisGenerator.ticks(chart.width < 550 ? 5 : 10);
            if (xFormat) {
              xAxisGenerator.tickFormat(xFormat);
            }
          }
          xAxisSelection.attr("transform", "translate(0," + (chartHeight - (m.top + m.bottom)) + ")").call(xAxisGenerator).selectAll("text").attr("dy", "1.25em").attr("text-anchor", chart.width < 550 ? "end" : "center").attr("transform", chart.width < 550 ? "rotate(-65)" : "rotate(-0)");
      }
    }
    applyAxisStyles(xAxis, "x");
    updateYAxis(chart, chart.yScale, yAxis, options);
    renderAxisTitles(chart);
  }
  function updateYAxis(chart, yScale, yAxisSelection, options) {
    var yFormat = chart.options.yAxisFormat ? d3.format(chart.options.yAxisFormat) : null;
    var chartHeight = getChartHeight(chart);
    var transitionSpeed = chart.options.transition.speed;
    var currentFormatY = chart.newScaleY ? d3.format(chart.newScaleY) : yFormat;
    var yAxis = yAxisSelection || chart.plot.selectAll(".y-axis");
    var axisCall = options && options.isInitialRender ? yAxis : yAxis.transition().ease(d3.easeQuad).duration(transitionSpeed);
    if (chart.options.suppressAxis && chart.options.suppressAxis.yAxis === true) {
      yAxis.selectAll("*").remove();
      return;
    }
    var yAxisGenerator = d3.axisLeft(yScale).tickSize(-(chart.width - (chart.margin.right + chart.margin.left)));
    if (typeof yScale.ticks === "function") {
      yAxisGenerator.ticks(chartHeight < 450 ? 5 : 10);
      if (currentFormatY) {
        yAxisGenerator.tickFormat(currentFormatY);
      }
    }
    axisCall.call(yAxisGenerator).selectAll("text").attr("dx", "-.25em");
    applyAxisStyles(chart.plot.selectAll(".y-axis"), "y");
  }
  function normalizeTickLabels(labels) {
    if (!labels) {
      return null;
    }
    if (Array.isArray(labels)) {
      return labels.length > 0 ? labels.reduce(function(acc, entry) {
        if (entry && entry.position != null) {
          acc[normalizeTickKey(entry.position)] = entry.label;
        }
        return acc;
      }, {}) : null;
    }
    var normalized = {};
    Object.keys(labels).forEach(function(key) {
      normalized[normalizeTickKey(key)] = labels[key];
    });
    return Object.keys(normalized).length > 0 ? normalized : null;
  }
  function normalizeTickKey(value) {
    var numeric = +value;
    return Number.isFinite(numeric) ? String(numeric) : String(value);
  }
  function renderAxisTitles(chart) {
    if (!chart || !chart.plot) {
      return;
    }
    var plotWidth = chart.width - (chart.margin.left + chart.margin.right);
    var plotHeight = getChartHeight(chart) - (chart.margin.top + chart.margin.bottom);
    var xTitleData = chart.options.xAxisLabel && !(chart.options.suppressAxis && chart.options.suppressAxis.xAxis === true) ? [chart.options.xAxisLabel] : [];
    var yTitleData = chart.options.yAxisLabel && !(chart.options.suppressAxis && chart.options.suppressAxis.yAxis === true) ? [chart.options.yAxisLabel] : [];
    chart.plot.selectAll(".myIO-axis-title-x").data(xTitleData).join(
      function(enter) {
        return enter.append("text").attr("class", "myIO-axis-title myIO-axis-title-x").attr("text-anchor", "middle").attr("x", plotWidth / 2).attr("y", plotHeight + chart.margin.bottom - 16).text(function(d) {
          return d;
        });
      },
      function(update) {
        return update.attr("x", plotWidth / 2).attr("y", plotHeight + chart.margin.bottom - 16).text(function(d) {
          return d;
        });
      },
      function(exit) {
        return exit.remove();
      }
    );
    chart.plot.selectAll(".myIO-axis-title-y").data(yTitleData).join(
      function(enter) {
        return enter.append("text").attr("class", "myIO-axis-title myIO-axis-title-y").attr("text-anchor", "middle").attr("transform", "translate(" + (-chart.margin.left + 6) + "," + plotHeight / 2 + ") rotate(-90)").text(function(d) {
          return d;
        });
      },
      function(update) {
        return update.attr("transform", "translate(" + (-chart.margin.left + 6) + "," + plotHeight / 2 + ") rotate(-90)").text(function(d) {
          return d;
        });
      },
      function(exit) {
        return exit.remove();
      }
    );
  }
  function applyAxisStyles(axis, axisType) {
    axis.selectAll(".domain").attr("class", axisType + "-axis-line");
    axis.selectAll(".tick line").attr("class", axisType + "-grid");
    axis.selectAll("text").attr("class", axisType + "-label");
  }

  // inst/htmlwidgets/myIO/src/renderers/groupedBarHelpers.js
  function transitionGrouped(chart, data, colors, bandwidth) {
    var transitionSpeed = chart.options.transition.speed;
    updateYAxis(chart, chart.yScale);
    var bars = d3.select(chart.element).selectAll(".tag-grouped-bar-g").selectAll("rect").data(function(d) {
      return d;
    });
    bars.exit().transition().ease(d3.easeQuadIn).duration(transitionSpeed).attr("y", chart.yScale(0)).attr("height", 0).style("opacity", 0).remove();
    var barsEnter = bars.enter().append("rect").attr("clip-path", "url(#" + chart.element.id + "clip)").attr("x", function(d) {
      return chart.xScale(+d.data[0]) + bandwidth * d.idx;
    }).attr("y", chart.yScale(0)).attr("height", 0).attr("width", bandwidth);
    barsEnter.merge(bars).transition().ease(d3.easeQuad).duration(transitionSpeed).delay(function(d) {
      return d.idx * 20;
    }).attr("x", function(d) {
      return chart.xScale(+d.data[0]) + bandwidth * d.idx;
    }).attr("width", bandwidth).attr("y", function(d) {
      return chart.yScale(d[1] - d[0]);
    }).attr("height", function(d) {
      return chart.yScale(0) - chart.yScale(d[1] - d[0]);
    });
  }
  function transitionStacked(chart, data, colors, bandwidth) {
    var transitionSpeed = chart.options.transition.speed;
    var yScale = d3.scaleLinear().range(chart.yScale.range());
    var yMax = getStackedMax(data);
    yScale.domain([0, yMax * 1.1]);
    updateYAxis(chart, yScale);
    var bars = d3.select(chart.element).selectAll(".tag-grouped-bar-g").selectAll("rect").data(function(d) {
      return d;
    });
    bars.exit().transition().ease(d3.easeQuadIn).duration(transitionSpeed).attr("y", yScale(0)).attr("height", 0).style("opacity", 0).remove();
    var barsEnter = bars.enter().append("rect").attr("clip-path", "url(#" + chart.element.id + "clip)").attr("x", function(d) {
      return chart.xScale(+d.data[0]);
    }).attr("y", yScale(0)).attr("height", 0).attr("width", bandwidth * data.length);
    barsEnter.merge(bars).transition().ease(d3.easeQuad).duration(transitionSpeed).delay(function(d) {
      return d.idx * 20;
    }).attr("x", function(d) {
      return chart.xScale(+d.data[0]);
    }).attr("width", bandwidth * data.length).attr("y", function(d) {
      return yScale(d[1]);
    }).attr("height", function(d) {
      return yScale(d[0]) - yScale(d[1]);
    });
  }
  function getGroupedDataObject(lys, chart) {
    var data = [];
    var keys2 = [];
    var x_var = [];
    var y_var = [];
    lys.forEach(function(d) {
      data.push(d.data);
      keys2.push(d.label);
      x_var.push(d.mapping.x_var);
      y_var.push(d.mapping.y_var);
    });
    var flattenedData = [].concat.apply([], data);
    var nestedData = d3.group(flattenedData, function(d) {
      return d[x_var[0]];
    });
    var groupedKeys = [...Array(keys2.length).keys()];
    var currentY = chart.newY ? chart.newY : y_var[0];
    var groupedData = d3.stack().keys(groupedKeys).value(function(d, key) {
      return d[1][key] == void 0 ? 0 : d[1][key][currentY];
    })(nestedData);
    groupedData.forEach(function(d, i) {
      d.forEach(function(e) {
        e.idx = i;
      });
    });
    return groupedData;
  }
  function getStackedMax(data) {
    return d3.max(data[data.length - 1], function(d) {
      return d[1];
    });
  }

  // inst/htmlwidgets/myIO/src/renderers/GroupedBarRenderer.js
  var GroupedBarRenderer = class {
    static type = "groupedBar";
    static traits = { hasAxes: true, referenceLines: true, legendType: "layer", binning: false, rolloverStyle: "element", scaleCapabilities: { invertX: false } };
    static scaleHints = { xScaleType: "band", yScaleType: "linear", yExtentFields: ["y_var"], domainMerge: "union" };
    static dataContract = { x_var: { required: true }, y_var: { required: true, numeric: true }, group: { required: true } };
    render(chart, layer, layers) {
      var lys = layers || [layer];
      var data = getGroupedDataObject(lys, chart);
      var colors = lys.map(function(d) {
        return d.color;
      });
      var bandwidth = (chart.width - (chart.margin.right + chart.margin.left)) / data[0].length / colors.length;
      if (typeof chart.layout == "undefined") {
        chart.layout = "grouped";
      }
      const bars = chart.chart.selectAll("g").data(data);
      bars.exit().remove();
      bars.enter().append("g").style("fill", function(d, i) {
        return resolveColor(chart, d[layer.mapping.group], colors[i]);
      }).attr("class", "tag-grouped-bar-g");
      bars.merge(bars).style("fill", function(d, i) {
        return resolveColor(chart, d[layer.mapping.group], colors[i]);
      }).call(function() {
        if (chart.layout === "grouped") {
          transitionGrouped(chart, data, colors, bandwidth);
        } else {
          transitionStacked(chart, data, colors, bandwidth);
        }
      });
    }
    getHoverSelector() {
      return ".tag-grouped-bar-g rect";
    }
    formatTooltip(chart, d, layer) {
      return { title: layer.mapping.x_var + ": " + d.data[0], body: layer.mapping.y_var + ": " + (d[1] - d[0]), color: layer.color, label: layer.label, value: d[1] - d[0], raw: d };
    }
    remove(chart) {
      chart.dom.chartArea.selectAll(".tag-grouped-bar-g").transition().duration(500).style("opacity", 0).remove();
    }
  };

  // inst/htmlwidgets/myIO/src/renderers/HistogramRenderer.js
  var HistogramRenderer = class {
    static type = "histogram";
    static traits = { hasAxes: true, referenceLines: false, legendType: "layer", binning: true, rolloverStyle: "element", scaleCapabilities: { invertX: false } };
    static scaleHints = { xScaleType: "linear", yScaleType: "linear", yExtentFields: ["value"], domainMerge: "union" };
    static dataContract = { value: { required: true, numeric: true } };
    render(chart, layer) {
      var data = layer.bins;
      var key = layer.label;
      var transitionSpeed = chart.options.transition.speed;
      var bars = chart.chart.selectAll("." + tagName("bar", chart.element.id, key)).data(data);
      bars.exit().transition().duration(transitionSpeed).attr("y", chart.yScale(0)).remove();
      var newBars = bars.enter().append("rect").attr("class", tagName("bar", chart.element.id, key)).attr("clip-path", "url(#" + chart.element.id + "clip)").style("fill", function() {
        return resolveColor(chart, layer.label, layer.color);
      }).attr("x", function(d) {
        return chart.xScale(d.x0) + 1;
      }).attr("y", chart.yScale(0)).attr("width", function(d) {
        return Math.max(0, chart.xScale(d.x1) - chart.xScale(d.x0) - 1);
      }).attr("height", chart.yScale(0));
      bars.merge(newBars).transition().ease(d3.easeQuad).duration(transitionSpeed).attr("x", function(d) {
        return chart.xScale(d.x0) + 1;
      }).attr("width", function(d) {
        return Math.max(0, chart.xScale(d.x1) - chart.xScale(d.x0) - 1);
      }).attr("y", function(d) {
        return chart.yScale(d.length);
      }).attr("height", function(d) {
        return chart.yScale(0) - chart.yScale(d.length);
      });
    }
    getHoverSelector(chart, layer) {
      return "." + tagName("bar", chart.dom.element.id, layer.label);
    }
    formatTooltip(chart, d, layer) {
      return { title: "Bin: " + d.x0 + " to " + d.x1, body: "Count: " + d.length, color: layer.color, label: "count", value: d.length, raw: d };
    }
    remove(chart, layer) {
      chart.dom.chartArea.selectAll("." + tagName("bar", chart.dom.element.id, layer.label)).transition().duration(500).style("opacity", 0).remove();
    }
  };

  // inst/htmlwidgets/myIO/src/renderers/HexbinRenderer.js
  var HexbinRenderer = class {
    static type = "hexbin";
    static traits = { hasAxes: true, referenceLines: false, legendType: "continuous", binning: false, rolloverStyle: "hex", scaleCapabilities: { invertX: false } };
    static scaleHints = { xScaleType: "linear", yScaleType: "linear", yExtentFields: ["y_var"], domainMerge: "union" };
    static dataContract = { x_var: { required: true, numeric: true }, y_var: { required: true, numeric: true }, radius: { required: true, numeric: true, positive: true } };
    render(chart, layer) {
      var transitionSpeed = chart.options.transition.speed;
      var points = layer.data.map(function(d) {
        return { 0: chart.xScale(+d[layer.mapping.x_var]), 1: chart.yScale(+d[layer.mapping.y_var]) };
      }).sort(function(d) {
        return d3.ascending(d.index);
      });
      var x_extent = d3.extent(layer.data, function(d) {
        return +d[layer.mapping.x_var];
      });
      var y_extent = d3.extent(layer.data, function(d) {
        return +d[layer.mapping.y_var];
      });
      var radius = typeof layer.mapping.radius === "number" ? layer.mapping.radius : +layer.mapping.radius;
      var hexbin = d3.hexbin().radius(radius * (Math.min(chart.width, chart.height) / 1e3)).extent([[x_extent[0], y_extent[0]], [x_extent[1], y_extent[1]]]);
      var binnedData = hexbin(points);
      chart.colorContinuous = d3.scaleSequential(d3.interpolateBuPu).domain([0, d3.max(binnedData, function(d) {
        return d.length;
      })]);
      var bins = chart.chart.attr("clip-path", "url(#" + chart.element.id + "clip)").selectAll("." + tagName("hexbin", chart.element.id, layer.label)).data(binnedData);
      bins.exit().transition().duration(transitionSpeed).style("opacity", 0).remove();
      var newbins = bins.enter().append("path").attr("class", tagName("hexbin", chart.element.id, layer.label)).attr("d", hexbin.hexagon()).attr("transform", function(d) {
        return "translate(" + d.x + "," + d.y + ")";
      }).attr("fill", "white");
      bins.merge(newbins).transition().ease(d3.easeQuad).duration(transitionSpeed).attr("d", hexbin.hexagon()).attr("transform", function(d) {
        return "translate(" + d.x + "," + d.y + ")";
      }).attr("fill", function(d) {
        return chart.colorContinuous(d.length);
      });
    }
    getHoverSelector(chart, layer) {
      return "." + tagName("hexbin", chart.dom.element.id, layer.label);
    }
    formatTooltip(chart, d) {
      return { title: "x: " + chart.derived.xScale.invert(d.x) + ", y: " + chart.derived.yScale.invert(d.y), body: "Count: " + d.length, color: chart.derived.colorContinuous(d.length), label: "count", value: d.length, raw: d };
    }
    remove(chart, layer) {
      chart.dom.chartArea.selectAll("." + tagName("hexbin", chart.dom.element.id, layer.label)).transition().duration(500).style("opacity", 0).remove();
    }
  };

  // inst/htmlwidgets/myIO/src/utils/export-csv.js
  function exportToCsv(filename, rows) {
    var jsonObject = JSON.stringify(rows);
    function convertToCSV(objArray) {
      var array = typeof objArray !== "object" ? JSON.parse(objArray) : objArray;
      var names = Object.keys(array[0]).toString();
      var str = names + "\r\n";
      for (var i = 0; i < array.length; i++) {
        var line = "";
        for (var index in array[i]) {
          if (line !== "") line += ",";
          line += array[i][index];
        }
        str += line + "\r\n";
      }
      return str;
    }
    var csvFile = convertToCSV(jsonObject);
    var blob = new Blob([csvFile], { type: "text/csv;charset=utf-8;" });
    var link = document.createElement("a");
    if (link.download !== void 0) {
      var url = URL.createObjectURL(blob);
      link.setAttribute("href", url);
      link.setAttribute("download", filename);
      link.style.visibility = "hidden";
      document.body.appendChild(link);
      link.click();
      document.body.removeChild(link);
    }
  }

  // inst/htmlwidgets/myIO/src/utils/resolve-css-vars.js
  var CHART_CSS_VARS = [
    // Text & font
    "--chart-text-color",
    "--chart-font",
    "--chart-annotation-font-size",
    // Grid
    "--chart-grid-color",
    "--chart-grid-opacity",
    // Backgrounds
    "--chart-bg",
    // Reference lines
    "--chart-ref-line-color",
    "--chart-ref-line-width",
    // Linked cursor crosshair
    "--chart-cursor-rule-color",
    "--chart-cursor-rule-width",
    // Annotations & accents
    "--chart-annotation-ring",
    "--chart-primary-color",
    // Brush
    "--chart-brush-fill",
    "--chart-brush-stroke",
    "--chart-brush-dim-opacity",
    // Legend
    "--chart-legend-inactive-opacity",
    // Status bar
    "--chart-status-bar-color"
  ];
  function resolveCSSVariables(svgClone, container) {
    var computed = getComputedStyle(container);
    var resolved = {};
    for (var i = 0; i < CHART_CSS_VARS.length; i++) {
      var prop = CHART_CSS_VARS[i];
      var val = computed.getPropertyValue(prop).trim();
      if (val) resolved[prop] = val;
    }
    var rootStyle = svgClone.getAttribute("style") || "";
    for (var p in resolved) {
      if (rootStyle.indexOf(p + ":") === -1) {
        rootStyle += (rootStyle && !/;\s*$/.test(rootStyle) ? ";" : "") + p + ":" + resolved[p];
      }
    }
    if (rootStyle) svgClone.setAttribute("style", rootStyle);
    function escapeRegex(s) {
      return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
    }
    var replacers = [];
    for (var key in resolved) {
      replacers.push({
        re: new RegExp("var\\(\\s*" + escapeRegex(key) + "\\s*(?:,\\s*[^)]*)?\\)", "g"),
        value: resolved[key]
      });
    }
    function applyReplacers(str) {
      for (var k = 0; k < replacers.length; k++) {
        str = str.replace(replacers[k].re, replacers[k].value);
      }
      return str;
    }
    var elements = svgClone.querySelectorAll("*");
    var allEls = [svgClone].concat(Array.prototype.slice.call(elements));
    for (var j = 0; j < allEls.length; j++) {
      var el = allEls[j];
      var style = el.getAttribute("style");
      if (style && style.indexOf("var(") !== -1) {
        el.setAttribute("style", applyReplacers(style));
      }
      var attrs = ["fill", "stroke", "color", "stop-color"];
      for (var a = 0; a < attrs.length; a++) {
        var attrVal = el.getAttribute(attrs[a]);
        if (attrVal && attrVal.indexOf("var(") !== -1) {
          el.setAttribute(attrs[a], applyReplacers(attrVal));
        }
      }
    }
  }

  // inst/htmlwidgets/myIO/src/utils/export-svg.js
  function getSVGString(svgNode) {
    var svgClone = svgNode.cloneNode(true);
    var container = svgNode.parentNode || document.body;
    svgClone.setAttribute("xlink", "http://www.w3.org/1999/xlink");
    if (container && typeof getComputedStyle === "function") {
      resolveCSSVariables(svgClone, container);
    }
    var cssStyleText = getCSSStyles(svgClone);
    appendCSS(cssStyleText, svgClone);
    var serializer = new XMLSerializer();
    var svgString = serializer.serializeToString(svgClone);
    svgString = svgString.replace(/(\w+)?:?xlink=/g, "xmlns:xlink=");
    svgString = svgString.replace(/NS\d+:href/g, "xlink:href");
    return svgString;
    function getCSSStyles(parentElement) {
      var selectorTextArr = collectSelectors(parentElement);
      var nodes = parentElement.getElementsByTagName("*");
      for (var i = 0; i < nodes.length; i++) {
        selectorTextArr = selectorTextArr.concat(collectSelectors(nodes[i]));
      }
      var extractedCSSText = "";
      for (var k = 0; k < document.styleSheets.length; k++) {
        var s = document.styleSheets[k];
        try {
          if (!s.cssRules) continue;
        } catch (e) {
          if (e.name !== "SecurityError") throw e;
          continue;
        }
        var cssRules = s.cssRules;
        for (var r = 0; r < cssRules.length; r++) {
          var rule = cssRules[r];
          if (rule.type === CSSRule.FONT_FACE_RULE || rule.selectorText === ":root") {
            extractedCSSText += rule.cssText;
            continue;
          }
          if (matchesRule(rule, parentElement, selectorTextArr)) {
            extractedCSSText += rule.cssText;
          }
        }
      }
      return extractedCSSText;
      function collectSelectors(node) {
        var selectors = [];
        if (node.id) {
          selectors.push("#" + node.id);
        }
        if (node.classList) {
          for (var c = 0; c < node.classList.length; c++) {
            selectors.push("." + node.classList[c]);
          }
        }
        return selectors;
      }
      function matchesRule(rule2, rootNode, selectorList) {
        if (!rule2.selectorText) {
          return false;
        }
        return rule2.selectorText.split(",").some(function(selector) {
          var trimmed = selector.trim();
          if (selectorList.indexOf(trimmed) !== -1) {
            return true;
          }
          try {
            return !!rootNode.querySelector(trimmed);
          } catch (e) {
            return false;
          }
        });
      }
    }
    function appendCSS(cssText, element) {
      var styleElement = document.createElement("style");
      styleElement.setAttribute("type", "text/css");
      styleElement.innerHTML = cssText;
      var refNode = element.hasChildNodes() ? element.children[0] : null;
      element.insertBefore(styleElement, refNode);
    }
  }
  function svgString2Image(svgString, width, height, format, callback) {
    var imageFormat = format || "png";
    var imgsrc = "data:image/svg+xml;base64," + btoa(unescape(encodeURIComponent(svgString)));
    var canvas = document.createElement("canvas");
    var context = canvas.getContext("2d");
    canvas.width = width;
    canvas.height = height;
    var image = new Image();
    image.onload = function() {
      context.clearRect(0, 0, width, height);
      context.drawImage(image, 0, 0, width, height);
      canvas.toBlob(function(blob) {
        var filesize = Math.round(blob.length / 1024) + " KB";
        if (callback) callback(blob, filesize, imageFormat);
      });
    };
    image.src = imgsrc;
  }

  // inst/htmlwidgets/myIO/src/layout/legend-data.js
  function buildLegendData(chart, state) {
    if (!chart || !chart.plotLayers || chart.plotLayers.length === 0) {
      return null;
    }
    if (chart.options && chart.options.suppressLegend === true) {
      return null;
    }
    var renderState = state || {};
    if (renderState.continuousLegend) {
      return buildContinuousLegendData(chart);
    }
    if (renderState.ordinalLegend) {
      var ordinalLayer = (chart.currentLayers || chart.derived && chart.derived.currentLayers || chart.plotLayers)[0] || chart.plotLayers[0];
      return buildOrdinalLegendData(chart, ordinalLayer);
    }
    return buildLayerLegendData(chart);
  }
  function buildOrdinalLegendData(chart, layer) {
    if (!layer) {
      return null;
    }
    if (!chart.runtime) {
      chart.runtime = {};
    }
    if (!Array.isArray(chart.runtime._hiddenOrdinalSegments)) {
      chart.runtime._hiddenOrdinalSegments = [];
    }
    var hidden = chart.runtime._hiddenOrdinalSegments;
    var keys2 = [];
    if (layer.type === "treemap" && layer.data && layer.data.children) {
      keys2 = layer.data.children.map(function(d) {
        return d.name;
      });
    } else if (layer.type === "donut" && Array.isArray(layer.data)) {
      keys2 = layer.data.map(function(d) {
        return d[layer.mapping.x_var];
      });
    } else if (layer.type === "funnel" && Array.isArray(layer.data)) {
      keys2 = layer.data.map(function(d) {
        return d[layer.mapping.stage];
      });
    } else if (layer.type === "radar" && Array.isArray(layer.data)) {
      keys2 = layer.mapping.group ? Array.from(new Set(layer.data.map(function(d) {
        return d[layer.mapping.group];
      }))) : [layer.label];
    } else if (layer.type === "parallel" && Array.isArray(layer.data)) {
      keys2 = layer.mapping.group ? Array.from(new Set(layer.data.map(function(d) {
        return d[layer.mapping.group];
      }))) : [layer.label];
    }
    return {
      type: "ordinal",
      items: keys2.map(function(key) {
        var swatchColor = "#6b7280";
        if (typeof chart.colorDiscrete === "function") {
          swatchColor = layer.type === "treemap" ? chart.colorDiscrete("treemap." + key) : chart.colorDiscrete(key);
        }
        if (!swatchColor) {
          swatchColor = "#6b7280";
        }
        return {
          key,
          label: key,
          color: swatchColor,
          visible: hidden.indexOf(key) === -1,
          kind: "segment"
        };
      })
    };
  }
  function buildLayerLegendData(chart) {
    var currentLayers = chart.currentLayers || chart.derived && chart.derived.currentLayers || [];
    var visibleKeys = currentLayers.map(function(layer) {
      return layer._composite || layer.label;
    });
    var hiddenKeys = Array.isArray(chart.runtime && chart.runtime._hiddenLayerKeys) ? chart.runtime._hiddenLayerKeys : [];
    return {
      type: "layer",
      items: (chart.plotLayers || []).map(function(layer) {
        var key = layer._composite || layer.label;
        return {
          key,
          label: layer.type === "quantile_dots" && layer.options && layer.options.source ? layer.label + " (" + layer.options.source + ")" : layer.label,
          color: layer.color || "#6b7280",
          visible: visibleKeys.indexOf(key) > -1 && hiddenKeys.indexOf(key) === -1,
          kind: layer.type
        };
      })
    };
  }
  function buildContinuousLegendData(chart) {
    var scale = chart.colorContinuous || chart.derived && chart.derived.colorContinuous;
    return {
      type: "continuous",
      items: [],
      colorScale: scale || null,
      domain: scale && typeof scale.domain === "function" ? scale.domain() : null
    };
  }

  // inst/htmlwidgets/myIO/src/utils/export-legend.js
  var LEGEND_PADDING = 16;
  var SWATCH_SIZE = 12;
  var SWATCH_GAP = 6;
  var ITEM_GAP = 18;
  var ROW_GAP = 6;
  var FONT_SIZE = 12;
  var GRADIENT_HEIGHT = 14;
  var GRADIENT_WIDTH = 180;
  function injectExportLegend(chart) {
    var legendData = buildLegendData(chart, chart.runtime && chart.runtime._legendState);
    if (!legendData || !legendData.type) {
      return { extraHeight: 0, cleanup: function() {
      } };
    }
    var visibleItems = legendData.items ? legendData.items.filter(function(d) {
      return d.visible !== false;
    }) : [];
    if (legendData.type !== "continuous" && visibleItems.length === 0) {
      return { extraHeight: 0, cleanup: function() {
      } };
    }
    var svgNode = chart.svg.node();
    var svgWidth = parseFloat(svgNode.getAttribute("width")) || chart.totalWidth || chart.width;
    var origHeight = parseFloat(svgNode.getAttribute("height")) || chart.height;
    var origViewBox = svgNode.getAttribute("viewBox");
    var textColor = getTextColor(chart);
    var g = document.createElementNS("http://www.w3.org/2000/svg", "g");
    g.setAttribute("class", "myIO-export-legend");
    var extraHeight;
    if (legendData.type === "continuous") {
      extraHeight = buildContinuousLegendSVG(g, legendData, svgWidth, textColor);
    } else {
      extraHeight = buildDiscreteLegendSVG(g, visibleItems, svgWidth, textColor);
    }
    g.setAttribute("transform", "translate(0," + origHeight + ")");
    var newHeight = origHeight + extraHeight;
    svgNode.appendChild(g);
    svgNode.setAttribute("height", newHeight);
    svgNode.setAttribute("viewBox", "0 0 " + svgWidth + " " + newHeight);
    return {
      extraHeight,
      cleanup: function() {
        svgNode.removeChild(g);
        svgNode.setAttribute("height", origHeight);
        svgNode.setAttribute("viewBox", origViewBox);
      }
    };
  }
  function buildDiscreteLegendSVG(g, items, svgWidth, textColor) {
    var usableWidth = svgWidth - LEGEND_PADDING * 2;
    var x = LEGEND_PADDING;
    var y = LEGEND_PADDING;
    var rowHeight = Math.max(SWATCH_SIZE, FONT_SIZE);
    items.forEach(function(item) {
      var labelWidth = estimateTextWidth(item.label, FONT_SIZE);
      var itemWidth = SWATCH_SIZE + SWATCH_GAP + labelWidth;
      if (x + itemWidth > LEGEND_PADDING + usableWidth && x > LEGEND_PADDING) {
        x = LEGEND_PADDING;
        y += rowHeight + ROW_GAP;
      }
      var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect");
      rect.setAttribute("x", x);
      rect.setAttribute("y", y);
      rect.setAttribute("width", SWATCH_SIZE);
      rect.setAttribute("height", SWATCH_SIZE);
      rect.setAttribute("rx", 2);
      rect.setAttribute("fill", item.color || "#6b7280");
      g.appendChild(rect);
      var text = document.createElementNS("http://www.w3.org/2000/svg", "text");
      text.setAttribute("x", x + SWATCH_SIZE + SWATCH_GAP);
      text.setAttribute("y", y + SWATCH_SIZE - 1);
      text.setAttribute("font-family", "Roboto, Arial, sans-serif");
      text.setAttribute("font-size", FONT_SIZE);
      text.setAttribute("fill", textColor);
      text.textContent = item.label;
      g.appendChild(text);
      x += itemWidth + ITEM_GAP;
    });
    return y + rowHeight + LEGEND_PADDING;
  }
  function buildContinuousLegendSVG(g, legendData, svgWidth, textColor) {
    var scale = legendData.colorScale;
    if (!scale) {
      return 0;
    }
    var domain = legendData.domain || scale.domain();
    var y = LEGEND_PADDING;
    var gradientX = (svgWidth - GRADIENT_WIDTH) / 2;
    var defs = document.createElementNS("http://www.w3.org/2000/svg", "defs");
    var linearGrad = document.createElementNS("http://www.w3.org/2000/svg", "linearGradient");
    var gradId = "export-legend-grad-" + Date.now();
    linearGrad.setAttribute("id", gradId);
    var steps = 8;
    var min2 = domain[0];
    var max2 = domain[domain.length - 1];
    for (var i = 0; i < steps; i++) {
      var t = steps === 1 ? 0 : i / (steps - 1);
      var value = min2 + (max2 - min2) * t;
      var stop = document.createElementNS("http://www.w3.org/2000/svg", "stop");
      stop.setAttribute("offset", Math.round(t * 100) + "%");
      stop.setAttribute("stop-color", scale(value));
      linearGrad.appendChild(stop);
    }
    defs.appendChild(linearGrad);
    g.appendChild(defs);
    var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect");
    rect.setAttribute("x", gradientX);
    rect.setAttribute("y", y);
    rect.setAttribute("width", GRADIENT_WIDTH);
    rect.setAttribute("height", GRADIENT_HEIGHT);
    rect.setAttribute("rx", 3);
    rect.setAttribute("fill", "url(#" + gradId + ")");
    g.appendChild(rect);
    var ticks = [];
    if (typeof scale.ticks === "function") {
      ticks = scale.ticks(5).map(String);
    } else {
      ticks = [String(min2), String(max2)];
    }
    var tickY = y + GRADIENT_HEIGHT + FONT_SIZE + 4;
    ticks.forEach(function(tick, idx) {
      var tickT = ticks.length === 1 ? 0.5 : idx / (ticks.length - 1);
      var text = document.createElementNS("http://www.w3.org/2000/svg", "text");
      text.setAttribute("x", gradientX + tickT * GRADIENT_WIDTH);
      text.setAttribute("y", tickY);
      text.setAttribute("text-anchor", "middle");
      text.setAttribute("font-family", "Roboto, Arial, sans-serif");
      text.setAttribute("font-size", FONT_SIZE);
      text.setAttribute("fill", textColor);
      text.textContent = tick;
      g.appendChild(text);
    });
    return tickY + LEGEND_PADDING;
  }
  function estimateTextWidth(str, fontSize) {
    return (str || "").length * fontSize * 0.6;
  }
  function getTextColor(chart) {
    var el = chart.element || chart.svg && chart.svg.node && chart.svg.node().parentNode;
    if (el && typeof getComputedStyle === "function") {
      var val = getComputedStyle(el).getPropertyValue("--chart-text-color");
      if (val && val.trim()) {
        return val.trim();
      }
    }
    return "#6b7280";
  }

  // inst/htmlwidgets/myIO/src/utils/file-saver.js
  var saveAs = saveAs || (function(e) {
    "use strict";
    if ("undefined" == typeof navigator || !/MSIE [1-9]\./.test(navigator.userAgent)) {
      var t = e.document, n = function() {
        return e.URL || e.webkitURL || e;
      }, o = t.createElementNS("http://www.w3.org/1999/xhtml", "a"), r = "download" in o, i = function(e2) {
        var t2 = new MouseEvent("click");
        e2.dispatchEvent(t2);
      }, a = /Version\/[\d\.]+.*Safari/.test(navigator.userAgent), c = e.webkitRequestFileSystem, d = e.requestFileSystem || c || e.mozRequestFileSystem, u = function(t2) {
        (e.setImmediate || e.setTimeout)(function() {
          throw t2;
        }, 0);
      }, s = "application/octet-stream", f = 0, l = 4e4, v = function(e2) {
        var t2 = function() {
          "string" == typeof e2 ? n().revokeObjectURL(e2) : e2.remove();
        };
        setTimeout(t2, l);
      }, p = function(e2, t2, n2) {
        t2 = [].concat(t2);
        for (var o2 = t2.length; o2--; ) {
          var r2 = e2["on" + t2[o2]];
          if ("function" == typeof r2) try {
            r2.call(e2, n2 || e2);
          } catch (i2) {
            u(i2);
          }
        }
      }, w = function(e2) {
        return /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e2.type) ? new Blob(["\uFEFF", e2], { type: e2.type }) : e2;
      }, y = function(t2, u2, l2) {
        l2 || (t2 = w(t2));
        var y2, m2, S2, h = this, R = t2.type, O = false, g = function() {
          p(h, "writestart progress write writeend".split(" "));
        }, b = function() {
          if (m2 && a && "undefined" != typeof FileReader) {
            var o2 = new FileReader();
            return o2.onloadend = function() {
              var e2 = o2.result;
              m2.location.href = "data:attachment/file" + e2.slice(e2.search(/[,;]/)), h.readyState = h.DONE, g();
            }, o2.readAsDataURL(t2), void (h.readyState = h.INIT);
          }
          if ((O || !y2) && (y2 = n().createObjectURL(t2)), m2) m2.location.href = y2;
          else {
            var r2 = e.open(y2, "_blank");
            void 0 === r2 && a && (e.location.href = y2);
          }
          h.readyState = h.DONE, g(), v(y2);
        }, E = function(e2) {
          return function() {
            return h.readyState !== h.DONE ? e2.apply(this, arguments) : void 0;
          };
        }, N = { create: true, exclusive: false };
        return h.readyState = h.INIT, u2 || (u2 = "download"), r ? (y2 = n().createObjectURL(t2), void setTimeout(function() {
          o.href = y2, o.download = u2, i(o), g(), v(y2), h.readyState = h.DONE;
        })) : (e.chrome && R && R !== s && (S2 = t2.slice || t2.webkitSlice, t2 = S2.call(t2, 0, t2.size, s), O = true), c && "download" !== u2 && (u2 += ".download"), (R === s || c) && (m2 = e), d ? (f += t2.size, void d(e.TEMPORARY, f, E(function(e2) {
          e2.root.getDirectory("saved", N, E(function(e3) {
            var n2 = function() {
              e3.getFile(u2, N, E(function(e4) {
                e4.createWriter(E(function(n3) {
                  n3.onwriteend = function(t3) {
                    m2.location.href = e4.toURL(), h.readyState = h.DONE, p(h, "writeend", t3), v(e4);
                  }, n3.onerror = function() {
                    var e5 = n3.error;
                    e5.code !== e5.ABORT_ERR && b();
                  }, "writestart progress write abort".split(" ").forEach(function(e5) {
                    n3["on" + e5] = h["on" + e5];
                  }), n3.write(t2), h.abort = function() {
                    n3.abort(), h.readyState = h.DONE;
                  }, h.readyState = h.WRITING;
                }), b);
              }), b);
            };
            e3.getFile(u2, { create: false }, E(function(e4) {
              e4.remove(), n2();
            }), E(function(e4) {
              e4.code === e4.NOT_FOUND_ERR ? n2() : b();
            }));
          }), b);
        }), b)) : void b());
      }, m = y.prototype, S = function(e2, t2, n2) {
        return new y(e2, t2, n2);
      };
      return "undefined" != typeof navigator && navigator.msSaveOrOpenBlob ? function(e2, t2, n2) {
        return n2 || (e2 = w(e2)), navigator.msSaveOrOpenBlob(e2, t2 || "download");
      } : (m.abort = function() {
        var e2 = this;
        e2.readyState = e2.DONE, p(e2, "abort");
      }, m.readyState = m.INIT = 0, m.WRITING = 1, m.DONE = 2, m.error = m.onwritestart = m.onprogress = m.onwrite = m.onabort = m.onerror = m.onwriteend = null, S);
    }
  })("undefined" != typeof self && self || "undefined" != typeof window && window || (void 0).content);

  // inst/htmlwidgets/myIO/src/utils/load-jspdf.js
  var _jspdfPromise = null;
  function loadJsPDF() {
    if (window.jspdf && window.jspdf.jsPDF) {
      return Promise.resolve(window.jspdf.jsPDF);
    }
    if (_jspdfPromise) return _jspdfPromise;
    _jspdfPromise = new Promise(function(resolve, reject) {
      var scripts = document.querySelectorAll("script[src]");
      var scriptUrl = null;
      for (var i = 0; i < scripts.length; i++) {
        var src = scripts[i].getAttribute("src");
        if (src && src.indexOf("myIOapi") !== -1) {
          scriptUrl = new URL(scripts[i].src, document.baseURI);
          break;
        }
      }
      var jspdfSrc = scriptUrl ? new URL("lib/jspdf/jspdf.umd.min.js", scriptUrl).href : "lib/jspdf/jspdf.umd.min.js";
      var script = document.createElement("script");
      script.src = jspdfSrc;
      script.onload = function() {
        if (window.jspdf && window.jspdf.jsPDF) {
          resolve(window.jspdf.jsPDF);
        } else {
          _jspdfPromise = null;
          reject(new Error("[myIO] jsPDF loaded but constructor not found"));
        }
      };
      script.onerror = function() {
        _jspdfPromise = null;
        reject(new Error("[myIO] Failed to load jsPDF from " + jspdfSrc));
      };
      document.head.appendChild(script);
    });
    return _jspdfPromise;
  }

  // inst/htmlwidgets/myIO/src/utils/export-pdf.js
  function exportToPDF(chart) {
    return loadJsPDF().then(function(JsPDF) {
      var legend = injectExportLegend(chart);
      var exportHeight = chart.height + legend.extraHeight;
      var svgString = getSVGString(chart.svg.node());
      legend.cleanup();
      var w = chart.totalWidth || chart.width;
      var h = exportHeight;
      var scale = 3;
      return new Promise(function(resolve) {
        svgString2Image(svgString, w * scale, h * scale, "png", function(blob) {
          var reader = new FileReader();
          reader.onload = function() {
            var dataUrl = reader.result;
            var orientation = w > h ? "landscape" : "portrait";
            var pageW = orientation === "landscape" ? 842 : 595;
            var pageH = orientation === "landscape" ? 595 : 842;
            var margin = 36;
            var availW = pageW - 2 * margin;
            var availH = pageH - 2 * margin;
            var fitScale = Math.min(availW / w, availH / h);
            var imgW = w * fitScale;
            var imgH = h * fitScale;
            var doc = new JsPDF({
              orientation,
              unit: "pt",
              format: [pageW, pageH]
            });
            var title = chart.config.export && chart.config.export.title || chart.config.axes && chart.config.axes.xAxisLabel || "myIO Chart";
            doc.setProperties({ title, creator: "myIO" });
            var x = (pageW - imgW) / 2;
            var y = (pageH - imgH) / 2;
            doc.addImage(dataUrl, "PNG", x, y, imgW, imgH);
            doc.save(chart.element.id + ".pdf");
            resolve(true);
          };
          reader.readAsDataURL(blob);
        });
      });
    });
  }

  // inst/htmlwidgets/myIO/src/utils/export-clipboard.js
  async function copyAsSVG(chart) {
    var legend = injectExportLegend(chart);
    var svgString = getSVGString(chart.svg.node());
    legend.cleanup();
    try {
      if (navigator.clipboard && navigator.clipboard.write && typeof ClipboardItem !== "undefined") {
        var blob = new Blob([svgString], { type: "image/svg+xml" });
        var htmlBlob = new Blob([svgString], { type: "text/html" });
        await navigator.clipboard.write([
          new ClipboardItem({ "text/html": htmlBlob, "image/svg+xml": blob })
        ]);
      } else {
        await navigator.clipboard.writeText(svgString);
      }
      return true;
    } catch (err) {
      console.warn("[myIO] Clipboard copy failed", err);
      return false;
    }
  }
  async function copyAsPNG(chart) {
    var legend = injectExportLegend(chart);
    var exportHeight = chart.height + legend.extraHeight;
    var svgString = getSVGString(chart.svg.node());
    legend.cleanup();
    var width = (chart.totalWidth || chart.width) * 2;
    var height = exportHeight * 2;
    return new Promise(function(resolve) {
      svgString2Image(svgString, width, height, "png", function(blob) {
        if (navigator.clipboard && navigator.clipboard.write && typeof ClipboardItem !== "undefined") {
          navigator.clipboard.write([
            new ClipboardItem({ "image/png": blob })
          ]).then(function() {
            resolve(true);
          }).catch(function() {
            resolve(false);
          });
        } else {
          resolve(false);
        }
      });
    });
  }

  // inst/htmlwidgets/myIO/src/interactions/buttons.js
  var BUTTON_LABELS = {
    chart: "Download data",
    image: "Save image",
    svg: "Save as SVG",
    pdf: "Export as PDF",
    clipboard: "Copy to clipboard",
    "clipboard-png": "Copy as PNG",
    "clipboard-svg": "Copy as SVG",
    percent: "Toggle percent",
    group2stack: "Toggle layout"
  };
  function handleAction(chart, layers, name) {
    if (name === "image") {
      var legend = injectExportLegend(chart);
      var exportHeight = chart.height + legend.extraHeight;
      var svgString = getSVGString(chart.svg.node());
      legend.cleanup();
      svgString2Image(svgString, 2 * chart.width, 2 * exportHeight, "png", function(dataBlob) {
        saveAs(dataBlob, chart.element.id + ".png");
      });
      return;
    }
    if (name === "svg") {
      var svgLegend = injectExportLegend(chart);
      var svgOut = getSVGString(chart.svg.node());
      svgLegend.cleanup();
      var svgBlob = new Blob([svgOut], { type: "image/svg+xml;charset=utf-8" });
      saveAs(svgBlob, chart.element.id + ".svg");
      return;
    }
    if (name === "chart") {
      var csvData = [];
      var brushed = chart.runtime._brushed;
      if (brushed && brushed.data.length > 0 && chart.config.interactions.brush && chart.config.interactions.brush.onSelect === "export") {
        csvData.push(brushed.data);
      } else {
        chart.plotLayers.forEach(function(layer) {
          csvData.push(layer.data);
        });
      }
      exportToCsv(chart.element.id + "_data.csv", [].concat.apply([], csvData));
      return;
    }
    if (name === "pdf") {
      exportToPDF(chart);
      return;
    }
    if (name === "clipboard" || name === "clipboard-png") {
      copyAsPNG(chart);
      return;
    }
    if (name === "clipboard-svg") {
      copyAsSVG(chart);
      return;
    }
    if (name === "percent") {
      var nextToggle = chart.runtime.activeY === chart.options.toggleY[0] ? [chart.plotLayers[0].mapping.y_var, chart.options.yAxisFormat] : chart.options.toggleY;
      chart.toggleVarY(nextToggle);
      return;
    }
    if (name === "group2stack") {
      chart.toggleGroupedLayout(layers);
    }
  }
  function iconWrapper(paths) {
    return '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none" aria-hidden="true">' + paths + "</svg>";
  }
  function iconImage() {
    return iconWrapper(
      '<rect x="3" y="3" width="18" height="18" rx="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><path d="m21 15-5-5L5 21"></path>'
    );
  }
  function iconPercent() {
    return iconWrapper('<line x1="19" y1="5" x2="5" y2="19"></line><circle cx="7" cy="7" r="2"></circle><circle cx="17" cy="17" r="2"></circle>');
  }
  function iconLayers() {
    return iconWrapper('<rect x="4" y="5" width="14" height="4" rx="1"></rect><rect x="6" y="10" width="14" height="4" rx="1"></rect><rect x="8" y="15" width="14" height="4" rx="1"></rect>');
  }
  function iconLegend() {
    return iconWrapper(
      '<circle cx="5" cy="7" r="1.5"></circle><line x1="9" y1="7" x2="19" y2="7"></line><circle cx="5" cy="12" r="1.5"></circle><line x1="9" y1="12" x2="19" y2="12"></line><circle cx="5" cy="17" r="1.5"></circle><line x1="9" y1="17" x2="19" y2="17"></line>'
    );
  }
  function iconPDF() {
    return iconWrapper(
      '<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><path d="M14 2v6h6"></path><text x="12" y="17" text-anchor="middle" font-size="7" fill="currentColor" stroke="none" font-weight="bold">PDF</text>'
    );
  }
  function iconClipboard() {
    return iconWrapper(
      '<rect x="8" y="2" width="8" height="4" rx="1"></rect><path d="M16 4h1a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h1"></path>'
    );
  }
  function iconDownload() {
    return iconWrapper(
      '<path d="M12 4v12"></path><path d="m8 12 4 4 4-4"></path><path d="M4 17v2a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-2"></path>'
    );
  }

  // inst/htmlwidgets/myIO/src/interactions/bottom-sheet.js
  var PANEL_OPEN_CLASS = "myIO-panel--open";
  var BACKDROP_OPEN_CLASS = "myIO-sheet-backdrop--open";
  var PANEL_LAYOUT_BOTTOM_CLASS = "myIO-panel--bottom";
  var PANEL_LAYOUT_SIDE_CLASS = "myIO-panel--side";
  function addFAB(chart) {
    if (!chart || !chart.element) {
      return null;
    }
    d3.select(chart.element).select(".myIO-fab").remove();
    if (isEmptyChart(chart)) {
      return null;
    }
    chart.dom = chart.dom || {};
    var fab = d3.select(chart.element).append("button").attr("type", "button").attr("class", "myIO-fab").attr("aria-label", "Legend and actions").attr("aria-expanded", "false").html(iconLegend());
    fab.on("click", function() {
      openPanel(chart);
    });
    fab.on("keydown", function(event) {
      if (event.key === "Enter" || event.key === " ") {
        event.preventDefault();
        openPanel(chart);
      }
    });
    chart.dom.fab = fab;
    syncFABState(chart);
    return fab;
  }
  function openPanel(chart) {
    if (!chart || !chart.element) {
      return null;
    }
    chart.dom = chart.dom || {};
    chart.runtime = chart.runtime || {};
    if (chart.runtime._sheetCloseTimer) {
      clearTimeout(chart.runtime._sheetCloseTimer);
      chart.runtime._sheetCloseTimer = null;
    }
    if (chart.runtime._sheetOpen) {
      return chart.dom.panel || null;
    }
    cleanupPanelNodes(chart);
    var backdrop = d3.select(chart.element).append("div").attr("class", "myIO-sheet-backdrop").attr("aria-hidden", "true").on("click", function() {
      closePanel(chart);
    });
    var panel = d3.select(chart.element).append("div").attr("class", "myIO-panel " + (isMobile(chart) ? PANEL_LAYOUT_BOTTOM_CLASS : PANEL_LAYOUT_SIDE_CLASS)).attr("role", "dialog").attr("aria-modal", "true").attr("aria-label", getDialogLabel(chart)).attr("tabindex", "-1");
    var header = panel.append("div").attr("class", "myIO-sheet-header");
    header.append("div").attr("class", "myIO-sheet-handle");
    header.append("button").attr("type", "button").attr("class", "myIO-sheet-close").attr("aria-label", "Close").html(iconClose()).on("click", function() {
      closePanel(chart);
    }).on("keydown", function(event) {
      if (event.key === "Enter" || event.key === " ") {
        event.preventDefault();
        closePanel(chart);
      }
    });
    chart.dom.backdrop = backdrop;
    chart.dom.panel = panel;
    chart.dom.sheetLegendSection = null;
    chart.dom.sheetLegendBody = null;
    chart.dom.sheetActionsBody = null;
    if (!chart.options || chart.options.suppressLegend !== true) {
      var legendSection = panel.append("div").attr("class", "myIO-sheet-legend-section").attr("data-sheet-section", "legend");
      chart.dom.sheetLegendSection = legendSection;
      chart.dom.sheetLegendBody = legendSection.append("div").attr("class", "myIO-sheet-legend");
      legendSection.append("hr").attr("class", "myIO-sheet-divider");
    }
    chart.dom.sheetActionsBody = panel.append("div").attr("class", "myIO-sheet-actions").attr("data-sheet-section", "actions");
    renderSheetLegend(chart);
    renderSheetActions(chart);
    chart.runtime._sheetOpen = true;
    attachSheetKeydown(chart);
    syncFABState(chart);
    window.requestAnimationFrame(function() {
      backdrop.classed(BACKDROP_OPEN_CLASS, true);
      panel.classed(PANEL_OPEN_CLASS, true);
      focusFirstInteractive(panel.node());
    });
    attachSwipeDismiss(chart);
    return panel;
  }
  function closePanel(chart, opts) {
    if (!chart || !chart.dom) {
      return;
    }
    var options = opts || {};
    if (!chart.runtime) {
      chart.runtime = {};
    }
    if (chart.runtime._sheetCloseTimer) {
      clearTimeout(chart.runtime._sheetCloseTimer);
      chart.runtime._sheetCloseTimer = null;
    }
    if (chart.dom.backdrop) {
      chart.dom.backdrop.classed(BACKDROP_OPEN_CLASS, false);
    }
    if (chart.dom.panel) {
      chart.dom.panel.classed(PANEL_OPEN_CLASS, false);
    }
    detachSheetKeydown(chart);
    chart.runtime._sheetOpen = false;
    syncFABState(chart);
    var finalize = function() {
      cleanupPanelNodes(chart);
      chart.runtime._sheetCloseTimer = null;
      syncFABState(chart);
      if (options.returnFocus !== false && chart.dom.fab && typeof chart.dom.fab.node === "function" && chart.dom.fab.node()) {
        chart.dom.fab.node().focus();
      }
    };
    if (window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
      finalize();
      return;
    }
    var panelNode = chart.dom.panel && chart.dom.panel.node ? chart.dom.panel.node() : null;
    var backdropNode = chart.dom.backdrop && chart.dom.backdrop.node ? chart.dom.backdrop.node() : null;
    if (!panelNode || !backdropNode) {
      finalize();
      return;
    }
    var finalized = false;
    var cleanup = function() {
      if (finalized) {
        return;
      }
      finalized = true;
      finalize();
    };
    panelNode.addEventListener("transitionend", cleanup, { once: true });
    backdropNode.addEventListener("transitionend", cleanup, { once: true });
    chart.runtime._sheetCloseTimer = window.setTimeout(cleanup, 350);
  }
  function renderSheetLegend(chart) {
    if (!chart || !chart.dom || !chart.dom.panel) {
      return;
    }
    var legendBody = chart.dom.sheetLegendBody;
    var legendSection = chart.dom.sheetLegendSection;
    if (!legendBody) {
      return;
    }
    var panelNode = chart.dom.panel.node();
    var scrollTop = panelNode ? panelNode.scrollTop : 0;
    var legendData = getLegendData(chart);
    legendBody.selectAll("*").remove();
    if (legendSection) {
      legendSection.selectAll(".myIO-sheet-legend-reset").remove();
    }
    if (!legendData || !legendData.type) {
      if (legendSection) {
        legendSection.style("display", "none");
      }
      if (panelNode) {
        panelNode.scrollTop = scrollTop;
      }
      return;
    }
    if (legendSection) {
      legendSection.style("display", null);
    }
    if (legendData.type === "continuous") {
      renderContinuousLegend(chart, legendBody, legendData);
    } else if (legendData.type === "ordinal") {
      renderOrdinalLegend(chart, legendBody, legendData);
    } else {
      renderLayerLegend(chart, legendBody, legendData);
    }
    if (panelNode) {
      panelNode.scrollTop = scrollTop;
    }
  }
  function renderSheetActions(chart) {
    if (!chart.dom || !chart.dom.sheetActionsBody) {
      return;
    }
    var actions = buildActionData(chart);
    var body = chart.dom.sheetActionsBody;
    body.selectAll("*").remove();
    actions.forEach(function(action) {
      var button = body.append("button").attr("type", "button").attr("class", "myIO-sheet-action").attr("data-action", action.name).on("click", function() {
        handleAction(chart, chart.currentLayers || chart.derived && chart.derived.currentLayers || chart.plotLayers || [], action.name);
      }).on("keydown", function(event) {
        if (event.key === "Enter" || event.key === " ") {
          event.preventDefault();
          handleAction(chart, chart.currentLayers || chart.derived && chart.derived.currentLayers || chart.plotLayers || [], action.name);
        }
      });
      button.append("span").attr("class", "myIO-sheet-action-icon").attr("aria-hidden", "true").html(action.icon);
      button.append("span").attr("class", "myIO-sheet-action-label").text(action.label);
    });
  }
  function renderLayerLegend(chart, container, legendData) {
    var useGrid = isMobile(chart) && legendData.items.length > 4;
    container.classed("myIO-sheet-legend--grid", useGrid);
    legendData.items.forEach(function(item) {
      var button = container.append("button").attr("type", "button").attr("class", "myIO-sheet-legend-item").attr("role", "switch").attr("aria-checked", item.visible ? "true" : "false").attr("data-key", item.key).on("click", function() {
        toggleLayerVisibility(chart, item);
      }).on("keydown", function(event) {
        if (event.key === "Enter" || event.key === " ") {
          event.preventDefault();
          toggleLayerVisibility(chart, item);
        }
      });
      button.append("span").attr("class", "myIO-sheet-swatch").style("background-color", item.color);
      button.append("span").attr("class", "myIO-sheet-legend-label").text(item.label);
    });
    appendShowAllButton(chart, legendData);
  }
  function renderOrdinalLegend(chart, container, legendData) {
    var useGrid = isMobile(chart) && legendData.items.length > 4;
    container.classed("myIO-sheet-legend--grid", useGrid);
    legendData.items.forEach(function(item) {
      var button = container.append("button").attr("type", "button").attr("class", "myIO-sheet-legend-item").attr("role", "switch").attr("aria-checked", item.visible ? "true" : "false").attr("data-key", item.key).on("click", function() {
        toggleOrdinalSegment(chart, item);
      }).on("keydown", function(event) {
        if (event.key === "Enter" || event.key === " ") {
          event.preventDefault();
          toggleOrdinalSegment(chart, item);
        }
      });
      button.append("span").attr("class", "myIO-sheet-swatch").style("background-color", item.color);
      button.append("span").attr("class", "myIO-sheet-legend-label").text(item.label);
    });
    appendShowAllButton(chart, legendData);
  }
  function renderContinuousLegend(chart, container, legendData) {
    var scale = legendData.colorScale || chart.colorContinuous;
    if (!scale) {
      return;
    }
    var domain = legendData.domain || scale.domain();
    var stops = buildGradientStops(scale, domain);
    var ticks = buildContinuousTicks(scale, domain);
    container.append("div").attr("class", "myIO-sheet-gradient").style("background", "linear-gradient(90deg, " + stops + ")");
    var tickRow = container.append("div").attr("class", "myIO-sheet-gradient-ticks");
    ticks.forEach(function(tick) {
      tickRow.append("span").text(tick);
    });
  }
  function buildActionData(chart) {
    var layers = chart.currentLayers || chart.derived && chart.derived.currentLayers || chart.plotLayers || [];
    var primaryType = layers[0] ? layers[0].type : null;
    var exportConfig = chart.config && chart.config.export;
    var data = [];
    if (!exportConfig || exportConfig.csv !== false) {
      data.push({ name: "chart", label: BUTTON_LABELS.chart, icon: iconDownload() });
    }
    if (!exportConfig || exportConfig.png !== false) {
      data.push({ name: "image", label: BUTTON_LABELS.image, icon: iconImage() });
    }
    if (!exportConfig || exportConfig.svg !== false) {
      data.push({ name: "svg", label: BUTTON_LABELS.svg, icon: iconDownload() });
    }
    if (!exportConfig || exportConfig.pdf !== false) {
      data.push({ name: "pdf", label: BUTTON_LABELS.pdf, icon: iconPDF() });
    }
    if (!exportConfig || exportConfig.clipboard !== false) {
      data.push({ name: "clipboard-png", label: BUTTON_LABELS["clipboard-png"], icon: iconClipboard() });
      data.push({ name: "clipboard-svg", label: BUTTON_LABELS["clipboard-svg"], icon: iconClipboard() });
    }
    if (chart.options && chart.options.toggleY) {
      data.push({ name: "percent", label: BUTTON_LABELS.percent, icon: iconPercent() });
    }
    if (chart.options && chart.options.toggleY && primaryType === "groupedBar") {
      data.push({ name: "group2stack", label: BUTTON_LABELS.group2stack, icon: iconLayers() });
    }
    return data;
  }
  function toggleLayerVisibility(chart, item) {
    if (!chart.runtime) {
      chart.runtime = {};
    }
    var hiddenKeys = Array.isArray(chart.runtime._hiddenLayerKeys) ? chart.runtime._hiddenLayerKeys.slice() : [];
    var index = hiddenKeys.indexOf(item.key);
    if (index === -1) {
      hiddenKeys.push(item.key);
    } else {
      hiddenKeys.splice(index, 1);
    }
    chart.runtime._hiddenLayerKeys = hiddenKeys;
    chart.derived = chart.derived || {};
    chart.derived.currentLayers = (chart.plotLayers || []).filter(function(layer) {
      return hiddenKeys.indexOf(layer._composite || layer.label) === -1;
    });
    chart.syncLegacyAliases();
    chart.renderCurrentLayers();
  }
  function toggleOrdinalSegment(chart, item) {
    if (!chart.runtime) {
      chart.runtime = {};
    }
    if (!Array.isArray(chart.runtime._hiddenOrdinalSegments)) {
      chart.runtime._hiddenOrdinalSegments = [];
    }
    var hidden = chart.runtime._hiddenOrdinalSegments;
    var index = hidden.indexOf(item.key);
    if (index === -1) {
      hidden.push(item.key);
    } else {
      hidden.splice(index, 1);
    }
    chart.runtime._suppressOrdinalLegendRebuild = true;
    try {
      chart.routeLayers(chart.currentLayers || chart.derived && chart.derived.currentLayers || []);
    } finally {
      chart.runtime._suppressOrdinalLegendRebuild = false;
    }
    renderSheetLegend(chart);
  }
  function appendShowAllButton(chart, legendData) {
    var hasHidden = legendData.items.some(function(item) {
      return !item.visible;
    });
    if (hasHidden && chart.dom.sheetLegendSection) {
      chart.dom.sheetLegendSection.selectAll(".myIO-sheet-legend-reset").remove();
      chart.dom.sheetLegendSection.append("button").attr("type", "button").attr("class", "myIO-sheet-legend-reset").text("Show All").on("click", function() {
        resetLegendVisibility(chart, legendData.type);
      });
    }
  }
  function resetLegendVisibility(chart, type) {
    chart.runtime = chart.runtime || {};
    if (type === "ordinal") {
      chart.runtime._hiddenOrdinalSegments = [];
      chart.runtime._suppressOrdinalLegendRebuild = true;
      try {
        chart.routeLayers(chart.currentLayers || chart.derived && chart.derived.currentLayers || []);
      } finally {
        chart.runtime._suppressOrdinalLegendRebuild = false;
      }
      renderSheetLegend(chart);
    } else {
      chart.runtime._hiddenLayerKeys = [];
      chart.derived = chart.derived || {};
      chart.derived.currentLayers = (chart.plotLayers || []).slice();
      chart.syncLegacyAliases();
      chart.renderCurrentLayers();
    }
  }
  function attachSwipeDismiss(chart) {
    var panel = chart.dom.panel;
    if (!panel || !isMobile(chart)) return;
    var node = panel.node();
    var startY = 0;
    var currentY = 0;
    var dragging = false;
    node.addEventListener("touchstart", function(e) {
      var rect = node.getBoundingClientRect();
      var touch = e.touches[0];
      if (touch.clientY - rect.top > 40) return;
      startY = touch.clientY;
      currentY = touch.clientY;
      dragging = true;
      node.style.transition = "none";
    }, { passive: true });
    node.addEventListener("touchmove", function(e) {
      if (!dragging) return;
      currentY = e.touches[0].clientY;
      var dy = Math.max(0, currentY - startY);
      node.style.transform = "translateY(" + dy + "px)";
    }, { passive: true });
    node.addEventListener("touchend", function() {
      if (!dragging) return;
      dragging = false;
      node.style.transition = "";
      var dy = currentY - startY;
      if (dy > 80) {
        closePanel(chart);
      } else {
        node.style.transform = "";
      }
    });
  }
  function getLegendData(chart) {
    if (chart.runtime && chart.runtime._legendData) {
      return chart.runtime._legendData;
    }
    return buildLegendData(chart, chart.runtime && chart.runtime._legendState);
  }
  function syncFABState(chart) {
    if (!chart || !chart.dom || !chart.dom.fab) {
      return;
    }
    var isOpen = chart.runtime && chart.runtime._sheetOpen === true;
    chart.dom.fab.attr("aria-expanded", isOpen ? "true" : "false").attr("aria-label", isOpen ? "Close legend and actions" : "Legend and actions").html(isOpen ? iconClose() : iconLegend());
  }
  function attachSheetKeydown(chart) {
    detachSheetKeydown(chart);
    var handler = function(event) {
      if (!chart.runtime || !chart.runtime._sheetOpen || !chart.dom || !chart.dom.panel) {
        return;
      }
      if (event.key === "Escape") {
        event.preventDefault();
        closePanel(chart);
        return;
      }
      if (event.key !== "Tab") {
        return;
      }
      var focusables = getFocusableElements(chart.dom.panel.node());
      if (focusables.length === 0) {
        event.preventDefault();
        chart.dom.panel.node().focus();
        return;
      }
      var first = focusables[0];
      var last = focusables[focusables.length - 1];
      var active = document.activeElement;
      if (event.shiftKey && active === first) {
        event.preventDefault();
        last.focus();
      } else if (!event.shiftKey && active === last) {
        event.preventDefault();
        first.focus();
      }
    };
    chart.runtime._sheetEscHandler = handler;
    document.addEventListener("keydown", handler);
  }
  function detachSheetKeydown(chart) {
    if (!chart || !chart.runtime || !chart.runtime._sheetEscHandler) {
      return;
    }
    document.removeEventListener("keydown", chart.runtime._sheetEscHandler);
    chart.runtime._sheetEscHandler = null;
  }
  function cleanupPanelNodes(chart) {
    if (chart.dom && chart.dom.panel && typeof chart.dom.panel.remove === "function") {
      chart.dom.panel.remove();
    }
    if (chart.dom && chart.dom.backdrop && typeof chart.dom.backdrop.remove === "function") {
      chart.dom.backdrop.remove();
    }
    if (chart.dom) {
      chart.dom.panel = null;
      chart.dom.backdrop = null;
      chart.dom.sheetLegendSection = null;
      chart.dom.sheetLegendBody = null;
      chart.dom.sheetActionsBody = null;
    }
  }
  function isEmptyChart(chart) {
    var layers = chart && (chart.currentLayers || chart.derived && chart.derived.currentLayers || chart.plotLayers || []);
    return !layers || layers.length === 0;
  }
  function getDialogLabel(chart) {
    if (chart && chart.svg && typeof chart.svg.attr === "function") {
      var baseLabel = chart.svg.attr("aria-label");
      if (baseLabel) {
        return baseLabel + " controls";
      }
    }
    return "Chart controls";
  }
  function focusFirstInteractive(rootNode) {
    if (!rootNode) {
      return;
    }
    var focusables = getFocusableElements(rootNode);
    if (focusables.length > 0) {
      focusables[0].focus();
      return;
    }
    rootNode.focus();
  }
  function getFocusableElements(rootNode) {
    if (!rootNode) {
      return [];
    }
    return Array.from(rootNode.querySelectorAll([
      "button:not([disabled])",
      "[href]",
      "input:not([disabled])",
      "select:not([disabled])",
      "textarea:not([disabled])",
      "[tabindex]:not([tabindex='-1'])"
    ].join(",")));
  }
  function buildGradientStops(scale, domain) {
    var min2 = domain[0];
    var max2 = domain[domain.length - 1];
    var steps = 8;
    return Array.from({ length: steps }, function(_, index) {
      var t = steps === 1 ? 0 : index / (steps - 1);
      var value = min2 + (max2 - min2) * t;
      return scale(value) + " " + Math.round(t * 100) + "%";
    }).join(", ");
  }
  function buildContinuousTicks(scale, domain) {
    if (typeof scale.ticks === "function") {
      return scale.ticks(5).map(function(tick) {
        return String(tick);
      });
    }
    return [String(domain[0]), String(domain[domain.length - 1])];
  }
  function iconWrapper2(paths) {
    return '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" fill="none" aria-hidden="true">' + paths + "</svg>";
  }
  function iconClose() {
    return iconWrapper2('<path d="M6 6 18 18"></path><path d="M18 6 6 18"></path>');
  }

  // inst/htmlwidgets/myIO/src/layout/legend.js
  function syncLegend(chart, state) {
    if (!chart || !chart.runtime) {
      return;
    }
    if (chart.options && chart.options.suppressLegend === true) {
      return;
    }
    chart.runtime._legendState = state || null;
    chart.runtime._legendData = buildLegendData(chart, state);
    renderInlineLegend(chart, chart.runtime._legendData);
    if (chart.runtime._sheetOpen) {
      renderSheetLegend(chart);
    }
  }
  function syncOrdinalLegendData(chart, layer) {
    if (!chart || !chart.runtime || chart.runtime._suppressOrdinalLegendRebuild) {
      return;
    }
    chart.runtime._legendState = { ordinalLegend: true };
    chart.runtime._legendData = buildOrdinalLegendData(chart, layer);
    renderInlineLegend(chart, chart.runtime._legendData);
    if (chart.runtime._sheetOpen) {
      renderSheetLegend(chart);
    }
  }
  function renderInlineLegend(chart, legendData) {
    if (!chart || !chart.svg) {
      return;
    }
    chart.svg.selectAll(".myIO-inline-legend").remove();
    if (!legendData || !Array.isArray(legendData.items) || legendData.items.length < 2 || legendData.type === "continuous") {
      return;
    }
    var items = uniqueLegendItems(legendData.items).slice(0, 10);
    if (items.length < 2) {
      return;
    }
    var rowCount = items.length > 5 ? 2 : 1;
    var legendBaselineY = Math.max(34, chart.height - 8 - (rowCount - 1) * 16);
    var g = chart.svg.append("g").attr("class", "myIO-inline-legend").attr("transform", "translate(" + chart.margin.left + "," + legendBaselineY + ")");
    var cursors = [0, 0];
    items.forEach(function(item, index) {
      var label = String(item.label || item.key || "");
      var row = index < 5 ? 0 : 1;
      var itemGroup = g.append("g").attr("class", "myIO-inline-legend-item").attr("transform", "translate(" + cursors[row] + "," + row * 16 + ")");
      itemGroup.append("rect").attr("width", 10).attr("height", 10).attr("rx", 2).attr("y", -9).attr("fill", Array.isArray(item.color) ? item.color[0] : item.color || "#6b7280").style("opacity", item.visible === false ? 0.35 : 1);
      itemGroup.append("text").attr("class", "myIO-inline-legend-label").attr("x", 15).attr("y", 0).text(label.length > 24 ? label.substring(0, 21) + "..." : label);
      cursors[row] += Math.min(190, 46 + label.length * 7);
    });
  }
  function uniqueLegendItems(items) {
    var seen = {};
    return items.filter(function(item) {
      var key = item.key || item.label;
      if (seen[key]) {
        return false;
      }
      seen[key] = true;
      return true;
    });
  }

  // inst/htmlwidgets/myIO/src/renderers/TreemapRenderer.js
  var TreemapRenderer = class {
    static type = "treemap";
    static traits = { hasAxes: false, referenceLines: false, legendType: "ordinal", binning: false, rolloverStyle: "none", scaleCapabilities: { invertX: false } };
    static scaleHints = null;
    static dataContract = { level_1: { required: true }, level_2: { required: true }, y_var: { required: false, numeric: true } };
    render(chart, layer) {
      var m = chart.margin;
      var format = d3.format(",d");
      var key = layer.label;
      if (isColorSchemeActive(chart)) {
        chart.colorDiscrete = d3.scaleOrdinal().range(chart.options.colorScheme[0]).domain(chart.options.colorScheme[1]);
        chart.colorContinuous = d3.scaleLinear().range(chart.options.colorScheme[0]).domain(chart.options.colorScheme[1]);
      } else {
        var colorKey = layer.data.children.map(function(d) {
          return d.name;
        });
        chart.colorDiscrete = d3.scaleOrdinal().range(layer.color).domain(colorKey);
      }
      var root = d3.hierarchy(layer.data).eachBefore(function(d) {
        d.data.id = (d.parent ? d.parent.data.id + "." : "") + d.data.name;
      }).sum(function(d) {
        return d[layer.mapping.y_var];
      }).sort(function(a, b) {
        return b.height - a.height || b.value - a.value;
      });
      d3.treemap().tile(d3.treemapResquarify).size([chart.width - (m.left + m.right), getChartHeight(chart) - (m.top + m.bottom)]).round(true).paddingInner(1)(root);
      var transitionSpeed = chart.options && chart.options.transition && typeof chart.options.transition.speed === "number" ? chart.options.transition.speed : 0;
      var cell = chart.chart.selectAll(".root").data(root.leaves(), function(d) {
        return d.data.id;
      });
      cell.exit().transition().duration(transitionSpeed).style("opacity", 0).remove();
      var newCell = cell.enter().append("g").attr("class", "root").attr("transform", function(d) {
        return "translate(" + d.x0 + "," + d.y0 + ")";
      }).style("opacity", 0);
      newCell.append("rect").attr("class", tagName("tree", chart.element.id, key)).attr("id", function(d) {
        return d.data.id;
      }).attr("width", function(d) {
        return d.x1 - d.x0;
      }).attr("height", function(d) {
        return d.y1 - d.y0;
      }).attr("fill", function(d) {
        while (d.depth > 1) d = d.parent;
        return chart.colorDiscrete(d.data.id);
      });
      newCell.append("text").attr("class", "inner-text").attr("fill", "black");
      newCell.append("title");
      var merged = newCell.merge(cell);
      merged.transition().duration(transitionSpeed).ease(d3.easeQuad).style("opacity", 1).attr("transform", function(d) {
        return "translate(" + d.x0 + "," + d.y0 + ")";
      });
      merged.select("rect").transition().duration(transitionSpeed).ease(d3.easeQuad).attr("width", function(d) {
        return d.x1 - d.x0;
      }).attr("height", function(d) {
        return d.y1 - d.y0;
      }).attr("fill", function(d) {
        while (d.depth > 1) d = d.parent;
        return chart.colorDiscrete(d.data.id);
      });
      var labelSelection = merged.select("text.inner-text").selectAll("tspan").data(function(d) {
        return treemapLabelLines(d, layer, format);
      });
      labelSelection.exit().remove();
      labelSelection.enter().append("tspan").attr("fill", "black").merge(labelSelection).attr("x", 3).attr("y", function(d, i, nodes) {
        return (i === nodes.length - 1) * 3 + 16 + (i - 0.5) * 9;
      }).attr("fill-opacity", function() {
        return hasReadableCellWidth(this.parentNode.parentNode) ? 1 : 0;
      }).text(function(d) {
        return d;
      });
      merged.select("title").text(function(d) {
        return d.data[layer.mapping.level_1] + "  \n" + d.data[layer.mapping.level_2] + "  \n" + d.data[layer.mapping.x_var] + "  \n" + format(d.value);
      });
      syncOrdinalLegendData(chart, layer);
    }
    remove(chart) {
      chart.dom.chartArea.selectAll(".root").transition().duration(500).style("opacity", 0).remove();
    }
  };
  function treemapLabelLines(d, layer, format) {
    var rawLabel = String(d.data[layer.mapping.x_var] || d.data[layer.mapping.level_2] || d.data.name || "");
    var width = Math.max(0, d.x1 - d.x0);
    var label = width < 70 && rawLabel.length > 10 ? rawLabel.substring(0, 9) + "..." : rawLabel;
    return label.split(/\s+/).concat(format(d.value));
  }
  function hasReadableCellWidth(node) {
    if (!node || typeof node.getBBox !== "function") {
      return true;
    }
    return node.getBBox().width > 40;
  }

  // inst/htmlwidgets/myIO/src/renderers/DonutRenderer.js
  var DonutRenderer = class {
    static type = "donut";
    static traits = { hasAxes: false, referenceLines: false, legendType: "ordinal", binning: false, rolloverStyle: "none", scaleCapabilities: { invertX: false } };
    static scaleHints = null;
    static dataContract = { x_var: { required: true }, y_var: { required: true, numeric: true } };
    render(chart, layer) {
      var m = chart.margin;
      var transitionSpeed = chart.options.transition.speed;
      var radius = Math.min(chart.width - (m.right + m.left), chart.height - (m.top + m.bottom)) / 2;
      var xVar = layer.mapping.x_var;
      var yVar = layer.mapping.y_var;
      if (isColorSchemeActive(chart)) {
        chart.colorDiscrete = d3.scaleOrdinal().range(chart.options.colorScheme[0]).domain(chart.options.colorScheme[1]);
        chart.colorContinuous = d3.scaleLinear().range(chart.options.colorScheme[0]).domain(chart.options.colorScheme[1]);
      } else {
        chart.colorDiscrete = d3.scaleOrdinal().range(layer.color).domain(layer.data.map(function(d) {
          return d[xVar];
        }));
      }
      var hidden = chart.runtime._hiddenOrdinalSegments || [];
      var data = layer.data.filter(function(d) {
        return hidden.indexOf(d[xVar]) === -1;
      });
      var pie = d3.pie().sort(null).value(function(d) {
        return d[yVar];
      });
      var arc = d3.arc().innerRadius(radius * 0.8).outerRadius(radius * 0.4);
      var outerArc = d3.arc().innerRadius(radius * 0.9).outerRadius(radius * 0.9);
      var path = chart.chart.selectAll(".donut").data(pie(data), function(d) {
        return d.data[xVar];
      });
      path.exit().transition().duration(transitionSpeed).ease(d3.easeQuad).attrTween("d", function(a) {
        var end = { startAngle: a.endAngle, endAngle: a.endAngle };
        var i = d3.interpolate(a, end);
        return function(t) {
          return arc(i(t));
        };
      }).remove();
      var newPath = path.enter().append("path").attr("class", "donut").attr("fill", function(d) {
        return chart.colorDiscrete(d.data[xVar]);
      }).attr("d", arc).each(function(d) {
        this._current = d;
      });
      path.merge(newPath).transition().duration(transitionSpeed).ease(d3.easeQuad).attr("fill", function(d) {
        return chart.colorDiscrete(d.data[xVar]);
      }).attrTween("d", function(a) {
        this._current = this._current || a;
        var i = d3.interpolate(this._current, a);
        this._current = i(1);
        return function(t) {
          return arc(i(t));
        };
      });
      function midAngle(d) {
        return d.startAngle + (d.endAngle - d.startAngle) / 2;
      }
      var textLabel = chart.chart.selectAll(".inner-text").data(pie(data), function(d) {
        return d.data[xVar];
      });
      textLabel.exit().transition().duration(transitionSpeed).style("opacity", 0).remove();
      var newText = textLabel.enter().append("text").attr("class", "inner-text").style("font-size", "12px").style("opacity", 0).attr("dy", ".35em").text(function(d) {
        return d.data[xVar];
      });
      textLabel.merge(newText).transition().duration(transitionSpeed).ease(d3.easeQuad).text(function(d) {
        return d.data[xVar];
      }).style("opacity", function(d) {
        return Math.abs(d.endAngle - d.startAngle) > 0.3 ? 1 : 0;
      }).attrTween("transform", function(d) {
        this._current = this._current || d;
        var interpolate = d3.interpolate(this._current, d);
        this._current = interpolate(1);
        return function(t) {
          var d2 = interpolate(t);
          var pos = outerArc.centroid(d2);
          pos[0] = radius * (midAngle(d2) < Math.PI ? 1 : -1);
          return "translate(" + pos + ")";
        };
      }).styleTween("text-anchor", function(d) {
        this._current = this._current || d;
        var interpolate = d3.interpolate(this._current, d);
        this._current = interpolate(1);
        return function(t) {
          var d2 = interpolate(t);
          return midAngle(d2) < Math.PI ? "start" : "end";
        };
      });
      var polyline = chart.chart.selectAll("polyline").data(pie(data), function(d) {
        return d.data[xVar];
      });
      polyline.exit().transition().duration(transitionSpeed).style("opacity", 0).remove();
      var newPolyline = polyline.enter().append("polyline").style("fill", "none").style("stroke-width", "1px").style("opacity", 0).style("stroke", "gray");
      polyline.merge(newPolyline).transition().duration(transitionSpeed).ease(d3.easeQuad).style("opacity", function(d) {
        return Math.abs(d.endAngle - d.startAngle) > 0.3 ? 1 : 0;
      }).attrTween("points", function(d) {
        this._current = this._current || d;
        var interpolate = d3.interpolate(this._current, d);
        this._current = interpolate(1);
        return function(t) {
          var d2 = interpolate(t);
          var pos = outerArc.centroid(d2);
          pos[0] = radius * 0.95 * (midAngle(d2) < Math.PI ? 1 : -1);
          return [arc.centroid(d2), outerArc.centroid(d2), pos];
        };
      });
      syncOrdinalLegendData(chart, layer);
    }
    remove(chart) {
      chart.dom.chartArea.selectAll(".donut, .inner-text, polyline").transition().duration(500).style("opacity", 0).remove();
    }
  };

  // inst/htmlwidgets/myIO/src/renderers/GaugeRenderer.js
  var GaugeRenderer = class {
    static type = "gauge";
    static traits = { hasAxes: false, referenceLines: false, legendType: "none", binning: false, rolloverStyle: "none", scaleCapabilities: { invertX: false } };
    static scaleHints = null;
    static dataContract = { value: { required: true, numeric: true } };
    render(chart, layer) {
      var transitionSpeed = chart.options.transition.speed;
      var tau = Math.PI;
      var radius = Math.max(Math.min(chart.width, getChartHeight(chart)) / 2, 30);
      var barWidth = 30;
      var firstDatum = Array.isArray(layer.data) && layer.data.length > 0 ? layer.data[0] : {};
      var valueKey = layer.mapping.value;
      var value = typeof valueKey === "string" ? +firstDatum[valueKey] : +valueKey;
      if (!Number.isFinite(value)) {
        value = 0;
      }
      value = Math.max(0, Math.min(1, value));
      var data = [value, 1 - value];
      var arc = d3.arc().innerRadius(radius - barWidth).outerRadius(radius).cornerRadius(10);
      var bandArc = d3.arc().innerRadius(radius - barWidth).outerRadius(radius);
      var pie = d3.pie().sort(null).value(function(d) {
        return d;
      }).startAngle(tau * -0.5).endAngle(tau * 0.5);
      var percentFormat = d3.format(".1%");
      var thresholds = layer.options && Array.isArray(layer.options.thresholds) ? layer.options.thresholds : [
        { min: 0, max: 0.6, color: "#3CA951" },
        { min: 0.6, max: 0.85, color: "#FFB000" },
        { min: 0.85, max: 1, color: "#EF603B" }
      ];
      function bandArcFor(d) {
        return bandArc({
          startAngle: tau * -0.5 + tau * Math.max(0, Math.min(1, +d.min || 0)),
          endAngle: tau * -0.5 + tau * Math.max(0, Math.min(1, +d.max || 0))
        });
      }
      var bands = chart.chart.selectAll(".myIO-gauge-threshold").data(thresholds);
      bands.exit().transition().duration(transitionSpeed).style("opacity", 0).remove();
      var bandsEnter = bands.enter().append("path").attr("class", "myIO-gauge-threshold").attr("fill", function(d) {
        return d.color;
      }).attr("opacity", 0).attr("d", bandArcFor);
      bandsEnter.merge(bands).transition().duration(transitionSpeed).ease(d3.easeQuad).attr("fill", function(d) {
        return d.color;
      }).attr("opacity", 0.24).attr("d", bandArcFor);
      var pathBackground = chart.chart.selectAll(".myIO-gauge-background").data(pie([1]));
      pathBackground.exit().transition().duration(transitionSpeed).style("opacity", 0).remove();
      var newPathBackground = pathBackground.enter().append("path").attr("class", "myIO-gauge-background").attr("fill", "rgba(107, 114, 128, 0.22)").attr("d", arc).each(function(d) {
        this._current = d;
      });
      newPathBackground.merge(pathBackground).transition().duration(transitionSpeed).ease(d3.easeBack).attr("fill", "rgba(107, 114, 128, 0.22)").attrTween("d", function(a) {
        this._current = this._current || a;
        var i = d3.interpolate(this._current, a);
        this._current = i(1);
        return function(t) {
          return arc(i(t));
        };
      });
      var path = chart.chart.selectAll(".myIO-gauge-value").data(pie(data));
      path.exit().transition().duration(transitionSpeed).style("opacity", 0).remove();
      var newPath = path.enter().append("path").attr("class", "myIO-gauge-value").attr("fill", function(d, i) {
        return [layer.color || colorForValue(value, thresholds), "transparent"][i];
      }).attr("d", arc).each(function(d) {
        this._current = d;
      });
      newPath.merge(path).transition().duration(transitionSpeed).ease(d3.easeBack).attr("fill", function(d, i) {
        return [layer.color || colorForValue(value, thresholds), "transparent"][i];
      }).attrTween("d", function(a) {
        this._current = this._current || a;
        var i = d3.interpolate(this._current, a);
        this._current = i(1);
        return function(t) {
          return arc(i(t));
        };
      });
      chart.chart.selectAll(".gauge-text").data([data[0]]).join("text").attr("class", "gauge-text").text(function(d) {
        return percentFormat(d);
      }).attr("text-anchor", "middle").attr("font-size", 20).attr("dy", "-0.45em");
      chart.chart.selectAll(".gauge-label").data([layer.options && layer.options.metric ? layer.options.metric : layer.label]).join("text").attr("class", "gauge-label").text(function(d) {
        return d;
      }).attr("text-anchor", "middle").attr("font-size", 12).attr("dy", "1.1em");
      chart.chart.selectAll(".gauge-min-label").data(["0%"]).join("text").attr("class", "gauge-min-label").text(function(d) {
        return d;
      }).attr("text-anchor", "middle").attr("font-size", 11).attr("x", -radius + barWidth / 2).attr("y", 12);
      chart.chart.selectAll(".gauge-max-label").data(["100%"]).join("text").attr("class", "gauge-max-label").text(function(d) {
        return d;
      }).attr("text-anchor", "middle").attr("font-size", 11).attr("x", radius - barWidth / 2).attr("y", 12);
    }
    remove(chart) {
      chart.dom.chartArea.selectAll(".myIO-gauge-threshold, .myIO-gauge-background, .myIO-gauge-value, .gauge-text, .gauge-label, .gauge-min-label, .gauge-max-label").transition().duration(500).style("opacity", 0).remove();
    }
  };
  function colorForValue(value, thresholds) {
    var match = thresholds.find(function(threshold) {
      return value >= +threshold.min && value <= +threshold.max;
    });
    return match && match.color ? match.color : "#4269D0";
  }

  // inst/htmlwidgets/myIO/src/renderers/HeatmapRenderer.js
  var HeatmapRenderer = class {
    static type = "heatmap";
    static traits = { hasAxes: true, referenceLines: false, legendType: "continuous", binning: false, rolloverStyle: "element", scaleCapabilities: { invertX: false } };
    static scaleHints = { xScaleType: "band", yScaleType: "band", yExtentFields: ["value"], domainMerge: "union" };
    static dataContract = { x_var: { required: true }, y_var: { required: true }, value: { required: true, numeric: true } };
    render(chart, layer) {
      var transitionSpeed = chart.options.transition.speed;
      var xVar = layer.mapping.x_var;
      var yVar = layer.mapping.y_var;
      var valueVar = layer.mapping.value;
      var values = layer.data.map(function(d) {
        return +d[valueVar];
      });
      var extent = d3.extent(values.filter(function(v) {
        return Number.isFinite(v);
      }));
      if (!extent || extent[0] === void 0 || extent[1] === void 0) {
        extent = [0, 1];
      }
      chart.derived.colorContinuous = d3.scaleSequential(d3.interpolateBlues).domain(extent);
      chart.colorContinuous = chart.derived.colorContinuous;
      var cells = chart.chart.selectAll("." + tagName("heatmap", chart.element.id, layer.label)).data(layer.data);
      cells.exit().transition().duration(transitionSpeed).style("opacity", 0).remove();
      var cellWidth = chart.xScale.bandwidth ? chart.xScale.bandwidth() : 0;
      var cellHeight = chart.yScale.bandwidth ? chart.yScale.bandwidth() : 0;
      var newCells = cells.enter().append("rect").attr("class", tagName("heatmap", chart.element.id, layer.label)).attr("clip-path", "url(#" + chart.element.id + "clip)").attr("x", function(d) {
        return chart.xScale(d[xVar]);
      }).attr("y", function(d) {
        return chart.yScale(d[yVar]);
      }).attr("width", cellWidth).attr("height", cellHeight).attr("fill", function(d) {
        return chart.colorContinuous(+d[valueVar]);
      }).style("opacity", 0);
      cells.merge(newCells).transition().ease(d3.easeQuad).duration(transitionSpeed).attr("x", function(d) {
        return chart.xScale(d[xVar]);
      }).attr("y", function(d) {
        return chart.yScale(d[yVar]);
      }).attr("width", cellWidth).attr("height", cellHeight).attr("fill", function(d) {
        return chart.colorContinuous(+d[valueVar]);
      }).style("opacity", 1);
    }
    getHoverSelector(chart, layer) {
      return "." + tagName("heatmap", chart.dom.element.id, layer.label);
    }
    formatTooltip(chart, d, layer) {
      return {
        title: layer.mapping.x_var + ": " + d[layer.mapping.x_var] + ", " + layer.mapping.y_var + ": " + d[layer.mapping.y_var],
        body: layer.mapping.value + ": " + d[layer.mapping.value],
        color: chart.colorContinuous ? chart.colorContinuous(+d[layer.mapping.value]) : layer.color,
        label: layer.label,
        value: d[layer.mapping.value],
        raw: d
      };
    }
    remove(chart, layer) {
      chart.dom.chartArea.selectAll("." + tagName("heatmap", chart.dom.element.id, layer.label)).transition().duration(500).style("opacity", 0).remove();
    }
  };

  // inst/htmlwidgets/myIO/src/renderers/CalendarHeatmapRenderer.js
  var CalendarHeatmapRenderer = class {
    static type = "calendarHeatmap";
    static traits = {
      hasAxes: false,
      referenceLines: false,
      legendType: "continuous",
      binning: false,
      rolloverStyle: "element"
    };
    static dataContract = {
      date: { required: true },
      value: { required: true, numeric: true }
    };
    static scaleHints = null;
    getHoverSelector() {
      return ".myIO-calendar-cell";
    }
    formatTooltip(chart, d, layer) {
      var fmt = d3.utcFormat("%b %-d, %Y");
      var date = d.date instanceof Date ? d.date : /* @__PURE__ */ new Date((d[layer.mapping.date] || "") + "T00:00:00Z");
      var value = d.value != null ? d.value : +d[layer.mapping.value];
      return {
        title: fmt(date),
        body: layer.label + ": " + value,
        color: d.color || layer.color,
        label: layer.label,
        value,
        raw: d
      };
    }
    render(chart, layer) {
      var opts = layer.options || {};
      var weekStart = opts.weekStart === "monday" ? 1 : 0;
      var showDow = opts.showWeekdayLabels !== false;
      var dateKey = layer.mapping.date;
      var valueKey = layer.mapping.value;
      var datums = (layer.data || []).map(function(row) {
        return {
          date: /* @__PURE__ */ new Date(row[dateKey] + "T00:00:00Z"),
          value: +row[valueKey],
          raw: row
        };
      }).filter(function(d) {
        return !isNaN(d.date.getTime());
      }).sort(function(a, b) {
        return a.date - b.date;
      });
      if (datums.length === 0) return;
      var year = datums[0].date.getUTCFullYear();
      var jan1 = new Date(Date.UTC(year, 0, 1));
      var dec31 = new Date(Date.UTC(year, 11, 31));
      var weekdayIdx = function(d) {
        var js = d.getUTCDay();
        return (js - weekStart + 7) % 7;
      };
      var jan1Offset = weekdayIdx(jan1);
      var weekCol = function(d) {
        var daysFromJan1 = Math.floor((d - jan1) / 864e5);
        return Math.floor((daysFromJan1 + jan1Offset) / 7);
      };
      var totalWeeks = weekCol(dec31) + 1;
      var margin = chart.margin || { top: 0, right: 0, bottom: 0, left: 0 };
      var innerW = (chart.width || 0) - (margin.left || 0) - (margin.right || 0);
      var innerH = (chart.height || 0) - (margin.top || 0) - (margin.bottom || 0);
      var leftPad = showDow ? 24 : 0;
      var topPad = 18;
      var gridW = Math.max(1, innerW - leftPad);
      var gridH = Math.max(1, innerH - topPad);
      var cellSize = Math.max(
        4,
        Math.min(Math.floor(gridW / totalWeeks), Math.floor(gridH / 7))
      );
      var cs = chart.element && typeof getComputedStyle === "function" ? getComputedStyle(chart.element) : null;
      var gapRaw = cs ? cs.getPropertyValue("--chart-calendar-cell-gap") : "";
      var gap = parseFloat(gapRaw);
      if (!isFinite(gap)) gap = 2;
      var vlim = chart.config && chart.config.axis && chart.config.axis.vlim;
      var vmax = d3.max(datums, function(d) {
        return d.value;
      });
      if (!(vmax > 0)) vmax = 1;
      var domain = vlim && vlim.max !== void 0 && vlim.max !== null ? [vlim.min || 0, vlim.max] : [0, vmax];
      var interp = d3.interpolateRgb("#ffffff", layer.color || "#4E79A7");
      var scale = d3.scaleSequential(interp).domain(domain);
      chart.colorContinuous = scale;
      if (chart.derived) chart.derived.colorContinuous = scale;
      var xScale = function(d) {
        var dd = d instanceof Date ? d : new Date(d);
        return leftPad + weekCol(dd) * (cellSize + gap);
      };
      xScale.domain = function() {
        return [jan1, dec31];
      };
      xScale.range = function() {
        return [leftPad, leftPad + (totalWeeks - 1) * (cellSize + gap)];
      };
      xScale.invert = function(px) {
        var col = Math.round((px - leftPad) / (cellSize + gap));
        var offset = col * 7 - jan1Offset;
        return new Date(jan1.getTime() + offset * 864e5);
      };
      chart.xScale = xScale;
      var transitionSpeed = chart.options && chart.options.transition && typeof chart.options.transition.speed === "number" ? chart.options.transition.speed : 0;
      var root = chart.chart.selectAll(".myIO-calendar-root").data([null]).join("g").attr("class", "myIO-calendar-root");
      if (showDow) {
        var dowLabels = weekStart === 0 ? ["", "Mon", "", "Wed", "", "Fri", ""] : ["", "Tue", "", "Thu", "", "Sat", ""];
        var dowData = dowLabels.map(function(t, i) {
          return { t, i };
        }).filter(function(d) {
          return d.t;
        });
        var dowSelection = root.selectAll("text.myIO-calendar-dow").data(dowData, function(d) {
          return d.i;
        });
        dowSelection.exit().remove();
        dowSelection.enter().append("text").attr("class", "myIO-calendar-dow").attr("x", 0).merge(dowSelection).attr("y", function(d) {
          return topPad + d.i * (cellSize + gap) + cellSize * 0.75;
        }).text(function(d) {
          return d.t;
        });
      } else {
        root.selectAll("text.myIO-calendar-dow").remove();
      }
      var monthFmt = d3.utcFormat("%b");
      var monthLabels = d3.range(12).map(function(m) {
        var first = new Date(Date.UTC(year, m, 1));
        return { m, text: monthFmt(first), col: weekCol(first) };
      });
      var monthSelection = root.selectAll("text.myIO-calendar-month").data(monthLabels, function(d) {
        return d.m;
      });
      monthSelection.exit().remove();
      monthSelection.enter().append("text").attr("class", "myIO-calendar-month").attr("y", topPad - 4).merge(monthSelection).attr("x", function(d) {
        return leftPad + d.col * (cellSize + gap);
      }).text(function(d) {
        return d.text;
      });
      var toIso = function(d) {
        return d.date.toISOString().slice(0, 10);
      };
      var cellSelection = root.selectAll("rect.myIO-calendar-cell").data(datums, function(d) {
        return toIso(d);
      });
      cellSelection.exit().transition().duration(transitionSpeed).style("opacity", 0).remove();
      var cellEnter = cellSelection.enter().append("rect").attr("class", "myIO-calendar-cell").attr("data-date", toIso).attr("data-row", function(d) {
        return String(weekdayIdx(d.date));
      }).attr("data-col", function(d) {
        return String(weekCol(d.date));
      }).attr("x", function(d) {
        return leftPad + weekCol(d.date) * (cellSize + gap);
      }).attr("y", function(d) {
        return topPad + weekdayIdx(d.date) * (cellSize + gap);
      }).attr("width", cellSize).attr("height", cellSize).attr("fill", function(d) {
        if (d.value == null || isNaN(d.value) || d.value === 0) {
          return "var(--chart-calendar-empty-fill, #ebedf0)";
        }
        return scale(d.value);
      }).style("opacity", 0);
      cellEnter.merge(cellSelection).each(function(d) {
        d.label = layer.label;
        d.color = d.value == null || isNaN(d.value) || d.value === 0 ? "var(--chart-calendar-empty-fill, #ebedf0)" : scale(d.value);
        d[dateKey] = toIso({ date: d.date });
        d[valueKey] = d.value;
      }).transition().duration(transitionSpeed).style("opacity", 1).attr("x", function(d) {
        return leftPad + weekCol(d.date) * (cellSize + gap);
      }).attr("y", function(d) {
        return topPad + weekdayIdx(d.date) * (cellSize + gap);
      }).attr("width", cellSize).attr("height", cellSize).attr("fill", function(d) {
        if (d.value == null || isNaN(d.value) || d.value === 0) {
          return "var(--chart-calendar-empty-fill, #ebedf0)";
        }
        return scale(d.value);
      });
    }
    remove(chart) {
      if (chart && chart.chart && typeof chart.chart.selectAll === "function") {
        chart.chart.selectAll(".myIO-calendar-root").remove();
      }
    }
  };

  // inst/htmlwidgets/myIO/src/renderers/CandlestickRenderer.js
  var CandlestickRenderer = class {
    static type = "candlestick";
    static traits = { hasAxes: true, referenceLines: true, legendType: "layer", binning: false, rolloverStyle: "element", scaleCapabilities: { invertX: false } };
    static scaleHints = { xScaleType: "linear", yScaleType: "linear", yExtentFields: ["open", "high", "low", "close"], domainMerge: "union" };
    static dataContract = {
      x_var: { required: true, numeric: true },
      open: { required: true, numeric: true },
      high: { required: true, numeric: true },
      low: { required: true, numeric: true },
      close: { required: true, numeric: true }
    };
    render(chart, layer) {
      var transitionSpeed = chart.options.transition.speed;
      var xVar = layer.mapping.x_var;
      var openVar = layer.mapping.open;
      var highVar = layer.mapping.high;
      var lowVar = layer.mapping.low;
      var closeVar = layer.mapping.close;
      var chartWidth = chart.width - (chart.margin.left + chart.margin.right);
      var width = Math.max(6, Math.min(40, chartWidth / Math.max(layer.data.length * 2.5, 1)));
      var self2 = this;
      function candleX(d) {
        return chart.xScale(d[xVar]);
      }
      function candleFill(d) {
        return +d[closeVar] >= +d[openVar] ? "#4CAF50" : "#F44336";
      }
      function bodyTop(d) {
        return chart.yScale(Math.max(+d[openVar], +d[closeVar]));
      }
      function bodyHeight(d) {
        return Math.max(Math.abs(chart.yScale(+d[openVar]) - chart.yScale(+d[closeVar])), 1);
      }
      function midOC(d) {
        return chart.yScale((+d[openVar] + +d[closeVar]) / 2);
      }
      var candle = chart.chart.selectAll("." + tagName("candlestick", chart.element.id, layer.label)).data(layer.data);
      candle.exit().transition().duration(transitionSpeed).style("opacity", 0).remove();
      var enter = candle.enter().append("g").attr("class", tagName("candlestick", chart.element.id, layer.label)).style("opacity", 0);
      enter.append("line").attr("class", "wick").attr("stroke", "#666").attr("stroke-width", 1.5).attr("x1", candleX).attr("x2", candleX).attr("y1", midOC).attr("y2", midOC);
      enter.append("rect").attr("class", "body").attr("stroke-width", 0.5).attr("x", function(d) {
        return candleX(d) - width / 2;
      }).attr("y", midOC).attr("width", width).attr("height", 0).attr("fill", candleFill).attr("stroke", candleFill);
      var merged = candle.merge(enter);
      merged.transition().ease(d3.easeQuad).duration(transitionSpeed).style("opacity", 1);
      merged.select("line.wick").transition().ease(d3.easeQuad).duration(transitionSpeed).attr("x1", candleX).attr("x2", candleX).attr("y1", function(d) {
        return chart.yScale(+d[lowVar]);
      }).attr("y2", function(d) {
        return chart.yScale(+d[highVar]);
      });
      merged.select("rect.body").transition().ease(d3.easeQuad).duration(transitionSpeed).attr("x", function(d) {
        return candleX(d) - width / 2;
      }).attr("y", bodyTop).attr("width", width).attr("height", bodyHeight).attr("fill", candleFill).attr("stroke", candleFill);
    }
    getHoverSelector(chart, layer) {
      return "." + tagName("candlestick", chart.dom.element.id, layer.label);
    }
    formatTooltip(chart, d, layer) {
      return {
        title: layer.mapping.x_var + ": " + d[layer.mapping.x_var],
        body: "O: " + d[layer.mapping.open] + ", H: " + d[layer.mapping.high] + ", L: " + d[layer.mapping.low] + ", C: " + d[layer.mapping.close],
        color: d[layer.mapping.close] >= d[layer.mapping.open] ? "#4CAF50" : "#F44336",
        label: layer.label,
        value: d[layer.mapping.close],
        raw: d
      };
    }
    remove(chart, layer) {
      chart.dom.chartArea.selectAll("." + tagName("candlestick", chart.dom.element.id, layer.label)).transition().duration(500).style("opacity", 0).remove();
    }
  };

  // inst/htmlwidgets/myIO/src/renderers/WaterfallRenderer.js
  var WaterfallRenderer = class {
    static type = "waterfall";
    static traits = { hasAxes: true, referenceLines: true, legendType: "none", binning: false, rolloverStyle: "element", scaleCapabilities: { invertX: false } };
    static scaleHints = { xScaleType: "band", yScaleType: "linear", yExtentFields: ["_base_y", "_cumulative_y"], domainMerge: "union" };
    static dataContract = { x_var: { required: true }, y_var: { required: true, numeric: true } };
    render(chart, layer) {
      var transitionSpeed = chart.options.transition.speed;
      var xVar = layer.mapping.x_var;
      var deltaVar = layer.mapping.y_var;
      var bandwidth = chart.xScale.bandwidth ? chart.xScale.bandwidth() : 0;
      var barWidth = bandwidth * 0.82;
      var barOffset = (bandwidth - barWidth) / 2;
      var hasColorArray = Array.isArray(layer.color);
      var bars = chart.chart.selectAll("." + tagName("waterfall", chart.element.id, layer.label)).data(layer.data);
      bars.exit().transition().duration(transitionSpeed).style("opacity", 0).remove();
      var newBars = bars.enter().append("rect").attr("class", tagName("waterfall", chart.element.id, layer.label)).attr("clip-path", "url(#" + chart.element.id + "clip)").attr("x", function(d) {
        return chart.xScale(d[xVar]) + barOffset;
      }).attr("width", barWidth).attr("y", function(d) {
        return chart.yScale(+d._base_y);
      }).attr("height", 0).attr("fill", function(d, i) {
        if (hasColorArray) {
          return layer.color[i % layer.color.length];
        }
        if (d._is_total) {
          return "#888";
        }
        return +d._cumulative_y >= +d._base_y ? "#4CAF50" : "#F44336";
      });
      bars.merge(newBars).transition().ease(d3.easeQuad).duration(transitionSpeed).attr("x", function(d) {
        return chart.xScale(d[xVar]) + barOffset;
      }).attr("width", barWidth).attr("y", function(d) {
        return chart.yScale(Math.max(+d._base_y, +d._cumulative_y));
      }).attr("height", function(d) {
        return Math.abs(chart.yScale(+d._base_y) - chart.yScale(+d._cumulative_y));
      }).attr("fill", function(d, i) {
        if (hasColorArray) {
          return layer.color[i % layer.color.length];
        }
        if (d._is_total) {
          return "#888";
        }
        return +d._cumulative_y >= +d._base_y ? "#4CAF50" : "#F44336";
      });
      var connectors = layer.data.slice(0, Math.max(layer.data.length - 1, 0));
      var connectorLines = chart.chart.selectAll("." + tagName("waterfall-connector", chart.element.id, layer.label)).data(connectors);
      connectorLines.exit().transition().duration(transitionSpeed).style("opacity", 0).remove();
      var newConnectors = connectorLines.enter().append("line").attr("class", tagName("waterfall-connector", chart.element.id, layer.label)).attr("clip-path", "url(#" + chart.element.id + "clip)").style("stroke", "#374151").style("stroke-width", 1.5).style("stroke-dasharray", "4 2").attr("x1", function(d, i) {
        return chart.xScale(layer.data[i][xVar]) + barOffset + barWidth;
      }).attr("x2", function(d, i) {
        return chart.xScale(layer.data[i + 1][xVar]) + barOffset;
      }).attr("y1", function(d) {
        return chart.yScale(+d._cumulative_y);
      }).attr("y2", function(d) {
        return chart.yScale(+d._cumulative_y);
      }).style("opacity", 0);
      connectorLines.merge(newConnectors).transition().ease(d3.easeQuad).duration(transitionSpeed).style("opacity", 1).attr("x1", function(d, i) {
        return chart.xScale(layer.data[i][xVar]) + barOffset + barWidth;
      }).attr("x2", function(d, i) {
        return chart.xScale(layer.data[i + 1][xVar]) + barOffset;
      }).attr("y1", function(d) {
        return chart.yScale(+d._cumulative_y);
      }).attr("y2", function(d) {
        return chart.yScale(+d._cumulative_y);
      });
    }
    formatTooltip(chart, d, layer) {
      return {
        title: layer.mapping.x_var + ": " + d[layer.mapping.x_var],
        body: "Delta: " + d[layer.mapping.y_var] + ", Total: " + d._cumulative_y,
        color: d._is_total ? "#888" : +d._cumulative_y >= +d._base_y ? "#4CAF50" : "#F44336",
        label: layer.label,
        value: d._cumulative_y,
        raw: d
      };
    }
    remove(chart, layer) {
      chart.dom.chartArea.selectAll("." + tagName("waterfall", chart.dom.element.id, layer.label)).transition().duration(500).style("opacity", 0).remove();
      chart.dom.chartArea.selectAll("." + tagName("waterfall-connector", chart.dom.element.id, layer.label)).transition().duration(500).style("opacity", 0).remove();
    }
  };

  // inst/htmlwidgets/myIO/src/renderers/SankeyRenderer.js
  var SankeyRenderer = class {
    static type = "sankey";
    static traits = { hasAxes: false, referenceLines: false, legendType: "ordinal", binning: false, rolloverStyle: "element", scaleCapabilities: { invertX: false } };
    static scaleHints = null;
    static dataContract = { source: { required: true }, target: { required: true }, value: { required: true, numeric: true } };
    render(chart, layer) {
      var m = chart.margin;
      var width = chart.width - (m.left + m.right);
      var height = getChartHeight(chart) - (m.top + m.bottom);
      var nodeWidth = 18;
      var sankey = d3.sankey().nodeId(function(d) {
        return d.name;
      }).nodeWidth(nodeWidth).nodePadding(12).extent([[0, 0], [width, height]]);
      var nodesByName = /* @__PURE__ */ new Map();
      var links = layer.data.map(function(d) {
        var source = d[layer.mapping.source];
        var target = d[layer.mapping.target];
        if (!nodesByName.has(source)) {
          nodesByName.set(source, { name: source });
        }
        if (!nodesByName.has(target)) {
          nodesByName.set(target, { name: target });
        }
        return {
          source,
          target,
          value: +d[layer.mapping.value]
        };
      });
      var graph = sankey({
        nodes: Array.from(nodesByName.values()),
        links
      });
      chart.derived.colorDiscrete = d3.scaleOrdinal().domain(graph.nodes.map(function(d) {
        return d.name;
      })).range(layer.color || d3.schemeTableau10);
      chart.colorDiscrete = chart.derived.colorDiscrete;
      var link = chart.chart.selectAll("." + tagName("sankey", chart.element.id, layer.label)).data(graph.links);
      link.exit().transition().duration(chart.options.transition.speed).style("opacity", 0).remove();
      var newLink = link.enter().append("path").attr("class", tagName("sankey", chart.element.id, layer.label)).attr("fill", "none").attr("stroke-opacity", 0.4).attr("clip-path", "url(#" + chart.element.id + "clip)").attr("d", d3.sankeyLinkHorizontal()).attr("stroke-width", function(d) {
        return Math.max(1, d.width);
      }).attr("stroke", function(d) {
        return chart.colorDiscrete(d.source.name);
      }).style("opacity", 0);
      link.merge(newLink).transition().ease(d3.easeQuad).duration(chart.options.transition.speed).style("opacity", 1).attr("d", d3.sankeyLinkHorizontal()).attr("stroke-width", function(d) {
        return Math.max(1, d.width);
      }).attr("stroke", function(d) {
        return chart.colorDiscrete(d.source.name);
      });
      var node = chart.chart.selectAll("." + tagName("sankey-node", chart.element.id, layer.label)).data(graph.nodes);
      node.exit().transition().duration(chart.options.transition.speed).style("opacity", 0).remove();
      var newNode = node.enter().append("rect").attr("class", tagName("sankey-node", chart.element.id, layer.label)).attr("clip-path", "url(#" + chart.element.id + "clip)").attr("x", function(d) {
        return d.x0;
      }).attr("y", function(d) {
        return d.y0;
      }).attr("width", function(d) {
        return d.x1 - d.x0;
      }).attr("height", function(d) {
        return Math.max(1, d.y1 - d.y0);
      }).attr("fill", function(d) {
        return chart.colorDiscrete(d.name);
      }).style("opacity", 0);
      node.merge(newNode).transition().ease(d3.easeQuad).duration(chart.options.transition.speed).style("opacity", 1).attr("x", function(d) {
        return d.x0;
      }).attr("y", function(d) {
        return d.y0;
      }).attr("width", function(d) {
        return d.x1 - d.x0;
      }).attr("height", function(d) {
        return Math.max(1, d.y1 - d.y0);
      }).attr("fill", function(d) {
        return chart.colorDiscrete(d.name);
      });
      var labelClass = tagName("sankey-label", chart.element.id, layer.label);
      var labelSelection = chart.chart.selectAll("." + labelClass).data(graph.nodes, function(d) {
        return d.name;
      });
      labelSelection.exit().transition().duration(chart.options.transition.speed).style("opacity", 0).remove();
      var labelEnter = labelSelection.enter().append("text").attr("class", labelClass).attr("x", function(d) {
        return d.x0 < width / 2 ? d.x1 + 6 : d.x0 - 6;
      }).attr("y", function(d) {
        return (d.y0 + d.y1) / 2;
      }).attr("dy", "0.35em").attr("text-anchor", function(d) {
        return d.x0 < width / 2 ? "start" : "end";
      }).style("font-size", "12px").style("fill", "var(--chart-text-color, #333)").style("opacity", 0).text(function(d) {
        return d.name;
      });
      labelEnter.merge(labelSelection).text(function(d) {
        return d.name;
      }).transition().duration(chart.options.transition.speed).style("opacity", 1).attr("x", function(d) {
        return d.x0 < width / 2 ? d.x1 + 6 : d.x0 - 6;
      }).attr("y", function(d) {
        return (d.y0 + d.y1) / 2;
      }).attr("text-anchor", function(d) {
        return d.x0 < width / 2 ? "start" : "end";
      });
    }
    formatTooltip(chart, d, layer) {
      if (d && Object.prototype.hasOwnProperty.call(d, "source")) {
        return {
          title: d.source.name + " -> " + d.target.name,
          body: "Value: " + d.value,
          color: chart.colorDiscrete ? chart.colorDiscrete(d.source.name) : layer.color,
          label: layer.label,
          value: d.value,
          raw: d
        };
      }
      return {
        title: d.name,
        body: "Value: " + d.value,
        color: chart.colorDiscrete ? chart.colorDiscrete(d.name) : layer.color,
        label: layer.label,
        value: d.value,
        raw: d
      };
    }
    remove(chart, layer) {
      chart.dom.chartArea.selectAll("." + tagName("sankey", chart.dom.element.id, layer.label)).transition().duration(500).style("opacity", 0).remove();
      chart.dom.chartArea.selectAll("." + tagName("sankey-node", chart.dom.element.id, layer.label)).transition().duration(500).style("opacity", 0).remove();
      chart.dom.chartArea.selectAll("." + tagName("sankey-label", chart.dom.element.id, layer.label)).transition().duration(500).style("opacity", 0).remove();
    }
  };

  // inst/htmlwidgets/myIO/src/renderers/RangeBarRenderer.js
  var RangeBarRenderer = class {
    static type = "rangeBar";
    static traits = { hasAxes: true, referenceLines: false, legendType: "layer", binning: false, rolloverStyle: "element", scaleCapabilities: { invertX: false } };
    static scaleHints = { xScaleType: "linear", yScaleType: "linear", yExtentFields: ["low_y", "high_y"], domainMerge: "union" };
    static dataContract = { x_var: { required: true }, low_y: { required: true, numeric: true }, high_y: { required: true, numeric: true } };
    render(chart, layer) {
      if (layer.options && layer.options.style === "errorbar") {
        renderErrorBars(chart, layer);
        return;
      }
      var transitionSpeed = chart.options.transition.speed;
      var xVar = layer.mapping.x_var;
      var lowVar = layer.mapping.low_y;
      var highVar = layer.mapping.high_y;
      var barWidth = layer.options && layer.options.rangeBarWidth ? layer.options.rangeBarWidth : Math.max(6, Math.min(60, (chart.width - (chart.margin.left + chart.margin.right)) / Math.max(layer.data.length * 3, 1)));
      var bars = chart.chart.selectAll("." + tagName("rangeBar", chart.element.id, layer.label)).data(layer.data);
      bars.exit().transition().duration(transitionSpeed).style("opacity", 0).remove();
      function midpointY(d) {
        return chart.yScale((+d[lowVar] + +d[highVar]) / 2);
      }
      function topY(d) {
        return chart.yScale(Math.max(+d[lowVar], +d[highVar]));
      }
      function rangeHeight(d) {
        return Math.abs(chart.yScale(+d[lowVar]) - chart.yScale(+d[highVar]));
      }
      function rangeFill(d) {
        if (typeof chart.colorDiscrete === "function" && d[layer.mapping.group]) {
          return chart.colorDiscrete(d[layer.mapping.group]);
        }
        return layer.color || "#6b7280";
      }
      var newBars = bars.enter().append("rect").attr("class", tagName("rangeBar", chart.element.id, layer.label)).attr("clip-path", "url(#" + chart.element.id + "clip)").attr("x", function(d) {
        return chart.xScale(d[xVar]) - barWidth / 2;
      }).attr("y", midpointY).attr("width", barWidth).attr("height", 0).attr("fill", rangeFill);
      bars.merge(newBars).transition().ease(d3.easeQuad).duration(transitionSpeed).attr("x", function(d) {
        return chart.xScale(d[xVar]) - barWidth / 2;
      }).attr("y", topY).attr("width", barWidth).attr("height", rangeHeight).attr("fill", rangeFill);
    }
    getHoverSelector(chart, layer) {
      return "." + tagName("rangeBar", chart.dom.element.id, layer.label);
    }
    formatTooltip(chart, d, layer) {
      return {
        title: layer.mapping.x_var + ": " + d[layer.mapping.x_var],
        body: layer.mapping.low_y + ": " + d[layer.mapping.low_y] + ", " + layer.mapping.high_y + ": " + d[layer.mapping.high_y],
        color: layer.color,
        label: layer.label,
        value: d[layer.mapping.high_y],
        raw: d
      };
    }
    remove(chart, layer) {
      chart.dom.chartArea.selectAll("." + tagName("rangeBar", chart.dom.element.id, layer.label)).transition().duration(500).style("opacity", 0).remove();
      chart.dom.chartArea.selectAll("." + tagName("rangeBar-error", chart.dom.element.id, layer.label)).transition().duration(500).style("opacity", 0).remove();
    }
  };
  function renderErrorBars(chart, layer) {
    var transitionSpeed = chart.options.transition.speed;
    var xVar = layer.mapping.x_var;
    var lowVar = layer.mapping.low_y;
    var highVar = layer.mapping.high_y;
    var meanVar = layer.mapping.y_var;
    if (!meanVar) {
      if (typeof console !== "undefined" && console.warn) {
        console.warn("myIO RangeBarRenderer: style='errorbar' requires a y_var mapping for the mean point. Skipping render for layer '" + (layer.label || "(unnamed)") + "'.");
      }
      return;
    }
    var color = layer.color || "#4269D0";
    var capWidth = layer.options && layer.options.capWidth ? layer.options.capWidth : 18;
    var radius = layer.options && layer.options.pointRadius ? layer.options.pointRadius : 4;
    function centerX(d) {
      var x = chart.xScale(d[xVar]);
      if (chart.xScale.bandwidth) {
        x += chart.xScale.bandwidth() / 2;
      }
      return x;
    }
    function lowY(d) {
      return chart.yScale(+d[lowVar]);
    }
    function highY(d) {
      return chart.yScale(+d[highVar]);
    }
    function meanY(d) {
      return chart.yScale(+d[meanVar]);
    }
    var groups = chart.chart.selectAll("." + tagName("rangeBar-error", chart.element.id, layer.label)).data(layer.data);
    groups.exit().transition().duration(transitionSpeed).style("opacity", 0).remove();
    var enter = groups.enter().append("g").attr("class", tagName("rangeBar-error", chart.element.id, layer.label)).attr("clip-path", "url(#" + chart.element.id + "clip)").style("opacity", 0);
    enter.append("line").attr("class", "mean-ci-whisker").attr("x1", centerX).attr("x2", centerX).attr("y1", meanY).attr("y2", meanY).attr("stroke", color).attr("stroke-width", 2);
    enter.append("line").attr("class", "mean-ci-cap mean-ci-cap-low").attr("x1", centerX).attr("x2", centerX).attr("y1", meanY).attr("y2", meanY).attr("stroke", color).attr("stroke-width", 2);
    enter.append("line").attr("class", "mean-ci-cap mean-ci-cap-high").attr("x1", centerX).attr("x2", centerX).attr("y1", meanY).attr("y2", meanY).attr("stroke", color).attr("stroke-width", 2);
    enter.append("circle").attr("class", "mean-ci-point").attr("cx", centerX).attr("cy", meanY).attr("r", 0).attr("fill", color).attr("stroke", "var(--chart-bg, #ffffff)").attr("stroke-width", 1.5);
    var merged = groups.merge(enter);
    merged.transition().ease(d3.easeQuad).duration(transitionSpeed).style("opacity", 1);
    merged.select(".mean-ci-whisker").transition().ease(d3.easeQuad).duration(transitionSpeed).attr("x1", centerX).attr("x2", centerX).attr("y1", lowY).attr("y2", highY).attr("stroke", color);
    merged.select(".mean-ci-cap-low").transition().ease(d3.easeQuad).duration(transitionSpeed).attr("x1", function(d) {
      return centerX(d) - capWidth / 2;
    }).attr("x2", function(d) {
      return centerX(d) + capWidth / 2;
    }).attr("y1", lowY).attr("y2", lowY).attr("stroke", color);
    merged.select(".mean-ci-cap-high").transition().ease(d3.easeQuad).duration(transitionSpeed).attr("x1", function(d) {
      return centerX(d) - capWidth / 2;
    }).attr("x2", function(d) {
      return centerX(d) + capWidth / 2;
    }).attr("y1", highY).attr("y2", highY).attr("stroke", color);
    merged.select(".mean-ci-point").transition().ease(d3.easeQuad).duration(transitionSpeed).attr("cx", centerX).attr("cy", meanY).attr("r", radius).attr("fill", color);
  }

  // inst/htmlwidgets/myIO/src/renderers/TextRenderer.js
  var TextRenderer = class {
    static type = "text";
    static traits = {
      hasAxes: false,
      referenceLines: false,
      legendType: "none",
      binning: false,
      rolloverStyle: "none",
      scaleCapabilities: { invertX: false }
    };
    static scaleHints = {
      xScaleType: "linear",
      yScaleType: "linear",
      xExtentFields: [],
      yExtentFields: [],
      domainMerge: "union"
    };
    static dataContract = {};
    render(chart, layer) {
      var position = layer.options && layer.options.position || "top-right";
      var key = layer.label;
      var className = tagName("text-annotation", chart.element.id, key);
      chart.chart.selectAll("." + className).remove();
      var lines = layer.data.map(function(d) {
        return d.text;
      });
      var isTop = position.indexOf("top") !== -1;
      var isRight = position.indexOf("right") !== -1;
      var plotWidth = chart.width - (chart.margin.left + chart.margin.right);
      var plotHeight = chart.height - (chart.margin.top + chart.margin.bottom);
      var x = isRight ? plotWidth - 58 : 10;
      var y = isTop ? 20 : plotHeight - 10;
      var anchor = isRight ? "end" : "start";
      var g = chart.chart.append("g").attr("class", className).attr("transform", "translate(" + x + "," + y + ")");
      lines.forEach(function(line, i) {
        g.append("text").attr("y", (isTop ? 1 : -1) * i * 16).attr("text-anchor", anchor).style("font-size", "12px").style("font-family", "var(--font-family, sans-serif)").style("fill", "var(--text-color, #333)").style("opacity", 0.8).text(line);
      });
    }
    formatTooltip() {
      return null;
    }
    remove(chart, layer) {
      var className = tagName("text-annotation", chart.dom.element.id, layer.label);
      chart.dom.chartArea.selectAll("." + className).remove();
    }
  };

  // inst/htmlwidgets/myIO/src/renderers/BracketRenderer.js
  var BracketRenderer = class {
    static type = "bracket";
    static traits = {
      hasAxes: true,
      referenceLines: false,
      legendType: "none",
      binning: false,
      rolloverStyle: "none",
      scaleCapabilities: { invertX: false }
    };
    static scaleHints = {
      xScaleType: "linear",
      yScaleType: "linear",
      xExtentFields: [],
      yExtentFields: ["y"],
      domainMerge: "union"
    };
    static dataContract = {
      x1: { required: true, numeric: true },
      x2: { required: true, numeric: true },
      y: { required: true, numeric: true }
    };
    render(chart, layer) {
      var className = tagName("bracket", chart.element.id, layer.label);
      var tickHeight = 6;
      var labelOffset = 4;
      var transitionSpeed = chart.options.transition.speed;
      var color = layer.color || "var(--text-color, #333)";
      var g = chart.chart.selectAll("g." + className + "-root").data([null]).join("g").attr("class", className + "-root").attr("clip-path", "url(#" + chart.element.id + "clip)");
      var bracketKey = function(d, i) {
        return d.label != null ? String(d.label) + "_" + i : String(i);
      };
      var bracketSelection = g.selectAll("g." + className).data(layer.data, bracketKey);
      bracketSelection.exit().transition().duration(transitionSpeed).style("opacity", 0).remove();
      var bracketEnter = bracketSelection.enter().append("g").attr("class", className).style("opacity", 0);
      bracketEnter.append("line").attr("class", "bracket-bar").attr("stroke", color).attr("stroke-width", 1.5);
      bracketEnter.append("line").attr("class", "bracket-tick-left").attr("stroke", color).attr("stroke-width", 1.5);
      bracketEnter.append("line").attr("class", "bracket-tick-right").attr("stroke", color).attr("stroke-width", 1.5);
      bracketEnter.append("text").attr("class", "bracket-label").attr("text-anchor", "middle").style("font-size", "11px").style("font-family", "var(--font-family, sans-serif)").style("fill", color);
      var merged = bracketEnter.merge(bracketSelection);
      merged.transition().duration(transitionSpeed).style("opacity", 1);
      merged.select(".bracket-bar").transition().duration(transitionSpeed).attr("x1", function(d) {
        return chart.xScale(+d.x1);
      }).attr("y1", function(d) {
        return chart.yScale(+d.y);
      }).attr("x2", function(d) {
        return chart.xScale(+d.x2);
      }).attr("y2", function(d) {
        return chart.yScale(+d.y);
      });
      merged.select(".bracket-tick-left").transition().duration(transitionSpeed).attr("x1", function(d) {
        return chart.xScale(+d.x1);
      }).attr("y1", function(d) {
        return chart.yScale(+d.y);
      }).attr("x2", function(d) {
        return chart.xScale(+d.x1);
      }).attr("y2", function(d) {
        return chart.yScale(+d.y) + tickHeight;
      });
      merged.select(".bracket-tick-right").transition().duration(transitionSpeed).attr("x1", function(d) {
        return chart.xScale(+d.x2);
      }).attr("y1", function(d) {
        return chart.yScale(+d.y);
      }).attr("x2", function(d) {
        return chart.xScale(+d.x2);
      }).attr("y2", function(d) {
        return chart.yScale(+d.y) + tickHeight;
      });
      merged.select(".bracket-label").text(function(d) {
        return d.label;
      }).transition().duration(transitionSpeed).attr("x", function(d) {
        return (chart.xScale(+d.x1) + chart.xScale(+d.x2)) / 2;
      }).attr("y", function(d) {
        return chart.yScale(+d.y) - labelOffset;
      });
    }
    formatTooltip() {
      return null;
    }
    remove(chart, layer) {
      var className = tagName("bracket", chart.element.id, layer.label);
      chart.chart.selectAll("." + className).remove();
    }
  };

  // inst/htmlwidgets/myIO/src/renderers/LollipopRenderer.js
  var LollipopRenderer = class {
    static type = "lollipop";
    static traits = {
      hasAxes: true,
      referenceLines: true,
      legendType: "layer",
      binning: false,
      rolloverStyle: "element",
      scaleCapabilities: { invertX: false }
    };
    static scaleHints = {
      xScaleType: "band",
      yScaleType: "linear",
      xExtentFields: [],
      yExtentFields: ["y_var"],
      domainMerge: "union"
    };
    static dataContract = {
      x_var: { required: true, numeric: false },
      y_var: { required: true, numeric: true }
    };
    render(chart, layer, layers) {
      var xScale = chart.derived.xScale;
      var yScale = chart.derived.yScale;
      var flipAxis = chart.config.scales.flipAxis;
      var speed = chart.options.transition.speed;
      var group = chart.dom.chartArea.selectAll(".tag-lollipop-" + layer.id).data([null]).join("g").attr("class", "tag-lollipop-" + layer.id);
      var headRadius = layer.options && layer.options.headRadius || 5;
      var stemWidth = layer.options && layer.options.stemWidth || 2;
      var xVar = layer.mapping.x_var;
      var yVar = layer.mapping.y_var;
      var bandOffset = xScale.bandwidth ? xScale.bandwidth() / 2 : 0;
      var yBaseline = typeof yScale(0) === "number" ? yScale(0) : yScale.range()[0];
      var xBaseline = typeof xScale(0) === "number" ? xScale(0) : xScale.range()[0];
      function stemPos(d) {
        if (flipAxis) {
          var stemY = yScale(d[xVar]);
          if (yScale.bandwidth) {
            stemY += bandOffset;
          }
          return {
            x1: xBaseline,
            x2: xScale(d[yVar]),
            y1: stemY,
            y2: stemY
          };
        }
        var stemX = xScale(d[xVar]) + bandOffset;
        return {
          x1: stemX,
          x2: stemX,
          y1: yBaseline,
          y2: yScale(d[yVar])
        };
      }
      function headPos(d) {
        var p = stemPos(d);
        return { cx: p.x2, cy: p.y2 };
      }
      var stems = group.selectAll(".lollipop-stem").data(layer.data, function(d) {
        return d._source_key;
      });
      stems.exit().transition().duration(speed).style("opacity", 0).attr("x2", flipAxis ? xBaseline : function(d) {
        return xScale(d[xVar]) + bandOffset;
      }).attr("y2", flipAxis ? function(d) {
        var y = yScale(d[xVar]);
        return yScale.bandwidth ? y + bandOffset : y;
      } : yBaseline).remove();
      var stemEnter = stems.enter().append("line").attr("class", "lollipop-stem").attr("x1", function(d) {
        return stemPos(d).x1;
      }).attr("x2", function(d) {
        return flipAxis ? stemPos(d).x1 : stemPos(d).x2;
      }).attr("y1", function(d) {
        return stemPos(d).y1;
      }).attr("y2", function(d) {
        return flipAxis ? stemPos(d).y1 : stemPos(d).y1;
      }).attr("stroke", layer.color).attr("stroke-width", stemWidth).style("opacity", 0);
      stemEnter.merge(stems).transition().duration(speed).style("opacity", 1).attr("x1", function(d) {
        return stemPos(d).x1;
      }).attr("x2", function(d) {
        return stemPos(d).x2;
      }).attr("y1", function(d) {
        return stemPos(d).y1;
      }).attr("y2", function(d) {
        return stemPos(d).y2;
      }).attr("stroke", layer.color).attr("stroke-width", stemWidth);
      var heads = group.selectAll(".lollipop-head").data(layer.data, function(d) {
        return d._source_key;
      });
      heads.exit().transition().duration(speed).style("opacity", 0).attr("cx", function(d) {
        return stemPos(d).x1;
      }).attr("cy", function(d) {
        return stemPos(d).y1;
      }).remove();
      var headEnter = heads.enter().append("circle").attr("class", "lollipop-head").attr("cx", function(d) {
        return stemPos(d).x1;
      }).attr("cy", function(d) {
        return stemPos(d).y1;
      }).attr("r", headRadius).attr("fill", layer.color).style("opacity", 0);
      headEnter.merge(heads).transition().duration(speed).style("opacity", 1).attr("cx", function(d) {
        return headPos(d).cx;
      }).attr("cy", function(d) {
        return headPos(d).cy;
      }).attr("r", headRadius).attr("fill", layer.color);
    }
    getHoverSelector(chart, layer) {
      return ".tag-lollipop-" + layer.id + " .lollipop-head";
    }
    formatTooltip(chart, d, layer) {
      var yFormat = chart.runtime.activeYFormat || d3.format("s");
      return {
        title: { text: String(d[layer.mapping.x_var]) },
        items: [{
          color: layer.color,
          label: layer.label,
          value: yFormat(d[layer.mapping.y_var])
        }]
      };
    }
    remove(chart, layer) {
      chart.dom.chartArea.selectAll(".tag-lollipop-" + layer.id).remove();
    }
  };

  // inst/htmlwidgets/myIO/src/renderers/DumbbellRenderer.js
  var DumbbellRenderer = class {
    static type = "dumbbell";
    static traits = {
      hasAxes: true,
      referenceLines: true,
      legendType: "layer",
      binning: false,
      rolloverStyle: "element",
      scaleCapabilities: { invertX: false }
    };
    static scaleHints = {
      xScaleType: "band",
      yScaleType: "linear",
      xExtentFields: [],
      yExtentFields: ["low_y", "high_y"],
      domainMerge: "union"
    };
    static dataContract = {
      x_var: { required: true, numeric: false },
      low_y: { required: true, numeric: true },
      high_y: { required: true, numeric: true }
    };
    render(chart, layer, layers) {
      var xScale = chart.derived.xScale;
      var yScale = chart.derived.yScale;
      var flipAxis = chart.config.scales.flipAxis;
      var speed = chart.options.transition.speed;
      var group = chart.dom.chartArea.selectAll(".tag-dumbbell-" + layer.id).data([null]).join("g").attr("class", "tag-dumbbell-" + layer.id);
      var dotRadius = layer.options && layer.options.dotRadius || 5;
      var lineWidth = layer.options && layer.options.lineWidth || 2;
      var xVar = layer.mapping.x_var;
      var lowVar = layer.mapping.low_y;
      var highVar = layer.mapping.high_y;
      var bandOffset = xScale.bandwidth ? xScale.bandwidth() / 2 : 0;
      var bandOffsetY = yScale.bandwidth ? yScale.bandwidth() / 2 : 0;
      function endpoints(d) {
        if (flipAxis) {
          var yPos = yScale(d[xVar]) + bandOffsetY;
          var lowX = xScale(d[lowVar]);
          var highX = xScale(d[highVar]);
          return {
            lowX,
            lowY: yPos,
            highX,
            highY: yPos,
            midX: (lowX + highX) / 2,
            midY: yPos
          };
        }
        var xPos = xScale(d[xVar]) + bandOffset;
        var lowY = yScale(d[lowVar]);
        var highY = yScale(d[highVar]);
        return {
          lowX: xPos,
          lowY,
          highX: xPos,
          highY,
          midX: xPos,
          midY: (lowY + highY) / 2
        };
      }
      var lines = group.selectAll(".dumbbell-line").data(layer.data, function(d) {
        return d._source_key;
      });
      lines.exit().transition().duration(speed).style("opacity", 0).attr("x1", function(d) {
        return endpoints(d).midX;
      }).attr("x2", function(d) {
        return endpoints(d).midX;
      }).attr("y1", function(d) {
        return endpoints(d).midY;
      }).attr("y2", function(d) {
        return endpoints(d).midY;
      }).remove();
      var linesEnter = lines.enter().append("line").attr("class", "dumbbell-line").attr("x1", function(d) {
        return endpoints(d).midX;
      }).attr("x2", function(d) {
        return endpoints(d).midX;
      }).attr("y1", function(d) {
        return endpoints(d).midY;
      }).attr("y2", function(d) {
        return endpoints(d).midY;
      }).attr("stroke", "var(--chart-grid-color, #ccc)").attr("stroke-width", lineWidth).style("opacity", 0);
      linesEnter.merge(lines).transition().duration(speed).style("opacity", 1).attr("x1", function(d) {
        return endpoints(d).lowX;
      }).attr("x2", function(d) {
        return endpoints(d).highX;
      }).attr("y1", function(d) {
        return endpoints(d).lowY;
      }).attr("y2", function(d) {
        return endpoints(d).highY;
      }).attr("stroke", "var(--chart-grid-color, #ccc)").attr("stroke-width", lineWidth);
      var lowDots = group.selectAll(".dumbbell-low").data(layer.data, function(d) {
        return d._source_key;
      });
      lowDots.exit().transition().duration(speed).style("opacity", 0).attr("cx", function(d) {
        return endpoints(d).midX;
      }).attr("cy", function(d) {
        return endpoints(d).midY;
      }).remove();
      var lowEnter = lowDots.enter().append("circle").attr("class", "dumbbell-low").attr("cx", function(d) {
        return endpoints(d).midX;
      }).attr("cy", function(d) {
        return endpoints(d).midY;
      }).attr("r", dotRadius).attr("fill", layer.color).attr("opacity", 0);
      lowEnter.merge(lowDots).transition().duration(speed).attr("cx", function(d) {
        return endpoints(d).lowX;
      }).attr("cy", function(d) {
        return endpoints(d).lowY;
      }).attr("r", dotRadius).attr("fill", layer.color).attr("opacity", 0.6);
      var highDots = group.selectAll(".dumbbell-high").data(layer.data, function(d) {
        return d._source_key;
      });
      highDots.exit().transition().duration(speed).style("opacity", 0).attr("cx", function(d) {
        return endpoints(d).midX;
      }).attr("cy", function(d) {
        return endpoints(d).midY;
      }).remove();
      var highEnter = highDots.enter().append("circle").attr("class", "dumbbell-high").attr("cx", function(d) {
        return endpoints(d).midX;
      }).attr("cy", function(d) {
        return endpoints(d).midY;
      }).attr("r", dotRadius).attr("fill", layer.color).attr("opacity", 0);
      highEnter.merge(highDots).transition().duration(speed).attr("cx", function(d) {
        return endpoints(d).highX;
      }).attr("cy", function(d) {
        return endpoints(d).highY;
      }).attr("r", dotRadius).attr("fill", layer.color).attr("opacity", 1);
    }
    getHoverSelector(chart, layer) {
      return ".tag-dumbbell-" + layer.id + " .dumbbell-high, .tag-dumbbell-" + layer.id + " .dumbbell-low";
    }
    formatTooltip(chart, d, layer) {
      var yFormat = chart.runtime.activeYFormat || d3.format("s");
      return {
        title: { text: String(d[layer.mapping.x_var]) },
        items: [
          { color: layer.color, label: "Low", value: yFormat(d[layer.mapping.low_y]) },
          { color: layer.color, label: "High", value: yFormat(d[layer.mapping.high_y]) }
        ]
      };
    }
    remove(chart, layer) {
      chart.dom.chartArea.selectAll(".tag-dumbbell-" + layer.id).remove();
    }
  };

  // inst/htmlwidgets/myIO/src/renderers/WaffleRenderer.js
  var WaffleRenderer = class {
    static type = "waffle";
    static traits = {
      hasAxes: false,
      referenceLines: false,
      legendType: "ordinal",
      binning: false,
      rolloverStyle: "element",
      scaleCapabilities: {}
    };
    static scaleHints = null;
    static dataContract = {
      category: { required: true },
      value: { required: true, numeric: true }
    };
    render(chart, layer) {
      var rows = layer.options && layer.options.rows || 10;
      var cols = layer.options && layer.options.cols || 10;
      var totalCells = rows * cols;
      var cellGap = layer.options && layer.options.cellGap || 2;
      var cellRadius = layer.options && layer.options.cellRadius || 2;
      var m = chart.config.layout.margin;
      var chartWidth = chart.runtime.width - m.left - m.right;
      var chartHeight = chart.runtime.height - m.top - m.bottom;
      var cellSize = Math.min(
        (chartWidth - (cols - 1) * cellGap) / cols,
        (chartHeight - (rows - 1) * cellGap) / rows
      );
      var total = 0;
      for (var i = 0; i < layer.data.length; i++) {
        total += layer.data[i][layer.mapping.value];
      }
      var cells = [];
      var cellIndex = 0;
      var colorScale = chart.derived.colorDiscrete || d3.scaleOrdinal(d3.schemeCategory10);
      for (var i = 0; i < layer.data.length; i++) {
        var d = layer.data[i];
        var count = Math.round(d[layer.mapping.value] / total * totalCells);
        for (var j = 0; j < count && cellIndex < totalCells; j++) {
          cells.push({
            category: d[layer.mapping.category],
            row: Math.floor(cellIndex / cols),
            col: cellIndex % cols,
            color: colorScale(d[layer.mapping.category]),
            datum: d,
            _source_key: d._source_key
          });
          cellIndex++;
        }
      }
      var gridWidth = cols * cellSize + (cols - 1) * cellGap;
      var gridHeight = rows * cellSize + (rows - 1) * cellGap;
      var offsetX = (chartWidth - gridWidth) / 2;
      var offsetY = (chartHeight - gridHeight) / 2;
      var group = chart.dom.chartArea.selectAll(".tag-waffle-" + layer.id).data([null]).join("g").attr("class", "tag-waffle-" + layer.id).attr("transform", "translate(" + offsetX + "," + offsetY + ")");
      var transitionSpeed = chart.options && chart.options.transition && typeof chart.options.transition.speed === "number" ? chart.options.transition.speed : 0;
      var cellSelection = group.selectAll(".waffle-cell").data(cells, function(d2) {
        return d2.row + "_" + d2.col;
      });
      cellSelection.exit().transition().duration(transitionSpeed).style("opacity", 0).remove();
      var cellEnter = cellSelection.enter().append("rect").attr("class", "waffle-cell").attr("x", function(d2) {
        return d2.col * (cellSize + cellGap);
      }).attr("y", function(d2) {
        return d2.row * (cellSize + cellGap);
      }).attr("width", cellSize).attr("height", cellSize).attr("rx", cellRadius).attr("fill", function(d2) {
        return d2.color;
      }).style("opacity", 0);
      cellEnter.merge(cellSelection).transition().duration(transitionSpeed).attr("x", function(d2) {
        return d2.col * (cellSize + cellGap);
      }).attr("y", function(d2) {
        return d2.row * (cellSize + cellGap);
      }).attr("width", cellSize).attr("height", cellSize).attr("fill", function(d2) {
        return d2.color;
      }).style("opacity", 1);
    }
    getHoverSelector(chart, layer) {
      return ".tag-waffle-" + layer.id + " .waffle-cell";
    }
    formatTooltip(chart, d, layer) {
      return {
        title: { text: d.category },
        items: [{ color: d.color, label: d.category, value: String(d.datum[layer.mapping.value]) }]
      };
    }
    remove(chart, layer) {
      chart.dom.chartArea.selectAll(".tag-waffle-" + layer.id).remove();
    }
  };

  // inst/htmlwidgets/myIO/src/renderers/BeeswarmRenderer.js
  var BeeswarmRenderer = class {
    static type = "beeswarm";
    static traits = {
      hasAxes: true,
      referenceLines: true,
      legendType: "layer",
      binning: false,
      rolloverStyle: "element",
      scaleCapabilities: { invertX: false }
    };
    static scaleHints = {
      xScaleType: "linear",
      yScaleType: "linear",
      xExtentFields: ["x_var"],
      yExtentFields: ["y_var"],
      domainMerge: "union"
    };
    static dataContract = {
      x_var: { required: true, numeric: true },
      y_var: { required: true }
    };
    render(chart, layer) {
      var xScale = chart.derived.xScale;
      var yScale = chart.derived.yScale;
      var radius = layer.options && layer.options.radius || 3;
      var padding = layer.options && layer.options.padding || 1;
      var xVar = layer.mapping.x_var;
      var yVar = layer.mapping.y_var;
      var data = layer.data.slice().sort(function(a, b) {
        return xScale(a[xVar]) - xScale(b[xVar]);
      });
      var placed = [];
      var diameter = 2 * radius + padding;
      for (var i = 0; i < data.length; i++) {
        var cx = xScale(data[i][xVar]);
        var baseY = yScale(data[i][yVar]);
        var dy = 0;
        var found = false;
        for (var attempt = 0; attempt < 500 && !found; attempt++) {
          var candidateY = attempt === 0 ? baseY : attempt % 2 === 1 ? baseY + Math.ceil(attempt / 2) * diameter : baseY - Math.ceil(attempt / 2) * diameter;
          var collision = false;
          for (var j = 0; j < placed.length; j++) {
            var dx2 = cx - placed[j].cx;
            var dy2 = candidateY - placed[j].cy;
            if (dx2 * dx2 + dy2 * dy2 < diameter * diameter) {
              collision = true;
              break;
            }
          }
          if (!collision) {
            dy = candidateY;
            found = true;
          }
        }
        data[i]._beeswarm_cx = cx;
        data[i]._beeswarm_cy = dy;
        placed.push({ cx, cy: dy });
      }
      var group = chart.dom.chartArea.selectAll(".tag-beeswarm-" + layer.id).data([null]).join("g").attr("class", "tag-beeswarm-" + layer.id);
      var transitionSpeed = chart.options && chart.options.transition && typeof chart.options.transition.speed === "number" ? chart.options.transition.speed : 0;
      var points = group.selectAll(".beeswarm-point").data(data, function(d) {
        return d._source_key;
      });
      points.exit().transition().duration(transitionSpeed).attr("fill-opacity", 0).remove();
      var pointsEnter = points.enter().append("circle").attr("class", "beeswarm-point").attr("cx", function(d) {
        return d._beeswarm_cx;
      }).attr("cy", function(d) {
        return d._beeswarm_cy;
      }).attr("r", radius).attr("fill", layer.color).attr("fill-opacity", 0);
      pointsEnter.merge(points).transition().duration(transitionSpeed).attr("cx", function(d) {
        return d._beeswarm_cx;
      }).attr("cy", function(d) {
        return d._beeswarm_cy;
      }).attr("r", radius).attr("fill", layer.color).attr("fill-opacity", 0.7);
    }
    getHoverSelector(chart, layer) {
      return ".tag-beeswarm-" + layer.id + " .beeswarm-point";
    }
    formatTooltip(chart, d, layer) {
      var yFormat = chart.runtime.activeYFormat || d3.format("s");
      return {
        title: { text: String(d[layer.mapping.x_var]) },
        items: [{ color: layer.color, label: layer.label, value: yFormat(d[layer.mapping.y_var]) }]
      };
    }
    remove(chart, layer) {
      chart.dom.chartArea.selectAll(".tag-beeswarm-" + layer.id).remove();
    }
  };

  // inst/htmlwidgets/myIO/src/renderers/QuantileDotsRenderer.js
  var QuantileDotsRenderer = class {
    static type = "quantile_dots";
    static traits = {
      hasAxes: true,
      referenceLines: true,
      legendType: "layer",
      binning: false,
      rolloverStyle: "element",
      scaleCapabilities: { invertX: false }
    };
    static scaleHints = {
      xScaleType: "band",
      yScaleType: "linear",
      xExtentFields: ["x_var"],
      yExtentFields: ["y_var"],
      domainMerge: "union"
    };
    static dataContract = {
      x_var: { required: true },
      y_var: { required: true, numeric: true },
      quantile_rank: { required: true, numeric: true }
    };
    render(chart, layer) {
      var xScale = chart.derived.xScale;
      var yScale = chart.derived.yScale;
      var radius = layer.options && layer.options.radius || 4;
      var padding = layer.options && layer.options.padding || 1;
      var diameter = 2 * radius + padding;
      var xVar = layer.mapping.x_var;
      var yVar = layer.mapping.y_var;
      var bandWidth = typeof xScale.bandwidth === "function" ? xScale.bandwidth() : diameter * 4;
      var byGroup = /* @__PURE__ */ new Map();
      layer.data.forEach(function(d) {
        var key = String(d[xVar]);
        if (!byGroup.has(key)) {
          byGroup.set(key, []);
        }
        byGroup.get(key).push(d);
      });
      byGroup.forEach(function(groupData) {
        var placed = [];
        groupData.sort(function(a, b) {
          return +a[layer.mapping.quantile_rank] - +b[layer.mapping.quantile_rank];
        });
        groupData.forEach(function(d) {
          var baseX = xScale(d[xVar]);
          var centerX = baseX + (typeof xScale.bandwidth === "function" ? xScale.bandwidth() / 2 : 0);
          var cy = yScale(d[yVar]);
          var cx = centerX;
          var found = false;
          var maxOffset = Math.max(0, bandWidth / 2 - radius);
          for (var attempt = 0; attempt < 500 && !found; attempt++) {
            var offset = attempt === 0 ? 0 : attempt % 2 === 1 ? Math.ceil(attempt / 2) * diameter : -Math.ceil(attempt / 2) * diameter;
            var candidateX = centerX + Math.max(-maxOffset, Math.min(maxOffset, offset));
            var collision = false;
            for (var i = 0; i < placed.length; i++) {
              var dx = candidateX - placed[i].cx;
              var dy = cy - placed[i].cy;
              if (dx * dx + dy * dy < diameter * diameter) {
                collision = true;
                break;
              }
            }
            if (!collision || Math.abs(offset) >= maxOffset) {
              cx = candidateX;
              found = true;
            }
          }
          d._quantile_dot_cx = cx;
          d._quantile_dot_cy = cy;
          placed.push({ cx, cy });
        });
      });
      var transitionSpeed = chart.options && chart.options.transition && typeof chart.options.transition.speed === "number" ? chart.options.transition.speed : 0;
      var group = chart.dom.chartArea.selectAll(".tag-quantile_dots-" + layer.id).data([null]).join("g").attr("class", "tag-quantile_dots-" + layer.id);
      var points = group.selectAll(".quantile-dots-point").data(layer.data, function(d) {
        return d._source_key;
      });
      points.exit().transition().duration(transitionSpeed).attr("fill-opacity", 0).remove();
      var entered = points.enter().append("circle").attr("class", "quantile-dots-point").attr("clip-path", "url(#" + chart.element.id + "clip)").attr("cx", function(d) {
        return d._quantile_dot_cx;
      }).attr("cy", function(d) {
        return d._quantile_dot_cy;
      }).attr("r", radius).attr("fill", layer.color).attr("fill-opacity", 0).attr("role", "graphics-symbol");
      entered.merge(points).transition().duration(transitionSpeed).attr("cx", function(d) {
        return d._quantile_dot_cx;
      }).attr("cy", function(d) {
        return d._quantile_dot_cy;
      }).attr("r", radius).attr("fill", layer.color).attr("fill-opacity", 0.75);
    }
    getHoverSelector(chart, layer) {
      return ".tag-quantile_dots-" + layer.id + " .quantile-dots-point";
    }
    formatTooltip(chart, d, layer) {
      var yFormat = chart.runtime.activeYFormat || d3.format("s");
      var source = layer.options && layer.options.source ? " (" + layer.options.source + ")" : "";
      return {
        title: String(d[layer.mapping.x_var]),
        items: [{
          color: layer.color,
          label: layer.label + source,
          value: "Q" + d[layer.mapping.quantile_rank] + ": " + yFormat(d[layer.mapping.y_var])
        }],
        value: d[layer.mapping.y_var],
        raw: d
      };
    }
    remove(chart, layer) {
      chart.dom.chartArea.selectAll(".tag-quantile_dots-" + layer.id).remove();
    }
  };

  // inst/htmlwidgets/myIO/src/renderers/BumpRenderer.js
  var BumpRenderer = class {
    static type = "bump";
    static traits = {
      hasAxes: true,
      referenceLines: false,
      legendType: "layer",
      binning: false,
      rolloverStyle: "element",
      scaleCapabilities: {}
    };
    static scaleHints = {
      xScaleType: "point",
      yScaleType: "linear",
      xExtentFields: [],
      yExtentFields: ["y_var"],
      domainMerge: "union"
    };
    static dataContract = {
      x_var: { required: true },
      y_var: { required: true, numeric: true },
      group: { required: true }
    };
    render(chart, layer) {
      var xScale = chart.derived.xScale;
      var yScale = chart.derived.yScale;
      var xVar = layer.mapping.x_var;
      var yVar = layer.mapping.y_var;
      var groupVar = layer.mapping.group;
      var dotRadius = layer.options && layer.options.dotRadius || 5;
      var colorScale = chart.derived.colorDiscrete || d3.scaleOrdinal(d3.schemeCategory10);
      var groups = d3.group(layer.data, function(d) {
        return d[groupVar];
      });
      var group = chart.dom.chartArea.selectAll(".tag-bump-" + layer.id).data([null]).join("g").attr("class", "tag-bump-" + layer.id);
      var line = d3.line().x(function(d) {
        return xScale(d[xVar]);
      }).y(function(d) {
        return yScale(d[yVar]);
      }).curve(d3.curveBumpX);
      var transitionSpeed = chart.options && chart.options.transition && typeof chart.options.transition.speed === "number" ? chart.options.transition.speed : 0;
      var groupIndex = 0;
      groups.forEach(function(data, name) {
        var color = colorScale(name);
        var sorted = data.slice().sort(function(a, b) {
          return String(a[xVar]).localeCompare(String(b[xVar]));
        });
        var lines = group.selectAll(".bump-line-" + groupIndex).data([sorted]);
        var linesEnter = lines.enter().append("path").attr("class", "bump-line bump-line-" + groupIndex).attr("fill", "none").attr("stroke", color).attr("stroke-width", 2.5).attr("stroke-opacity", 0).attr("d", line);
        linesEnter.merge(lines).transition().duration(transitionSpeed).attr("stroke", color).attr("stroke-opacity", 0.8).attr("d", line);
        var dots = group.selectAll(".bump-dot-" + groupIndex).data(sorted, function(d) {
          return d._source_key || d[xVar];
        });
        dots.exit().transition().duration(transitionSpeed).style("opacity", 0).remove();
        var dotsEnter = dots.enter().append("circle").attr("class", "bump-dot bump-dot-" + groupIndex).attr("cx", function(d) {
          return xScale(d[xVar]);
        }).attr("cy", function(d) {
          return yScale(d[yVar]);
        }).attr("r", dotRadius).attr("fill", color).attr("stroke", "#fff").attr("stroke-width", 1.5).style("opacity", 0);
        dotsEnter.merge(dots).transition().duration(transitionSpeed).style("opacity", 1).attr("cx", function(d) {
          return xScale(d[xVar]);
        }).attr("cy", function(d) {
          return yScale(d[yVar]);
        }).attr("r", dotRadius).attr("fill", color);
        groupIndex++;
      });
    }
    getHoverSelector(chart, layer) {
      return ".tag-bump-" + layer.id + " .bump-dot";
    }
    formatTooltip(chart, d, layer) {
      return {
        title: { text: String(d[layer.mapping.group]) },
        items: [
          { color: layer.color, label: String(d[layer.mapping.x_var]), value: String(d[layer.mapping.y_var]) }
        ]
      };
    }
    remove(chart, layer) {
      chart.dom.chartArea.selectAll(".tag-bump-" + layer.id).remove();
    }
  };

  // inst/htmlwidgets/myIO/src/renderers/RadarRenderer.js
  var RadarRenderer = class {
    static type = "radar";
    static traits = {
      hasAxes: false,
      referenceLines: false,
      legendType: "ordinal",
      binning: false,
      rolloverStyle: "element",
      scaleCapabilities: {}
    };
    static scaleHints = null;
    static dataContract = {
      axis: { required: true },
      value: { required: true, numeric: true }
    };
    render(chart, layer) {
      var margin = chart.margin || (chart.config && chart.config.layout ? chart.config.layout.margin : { top: 0, right: 0, bottom: 0, left: 0 });
      var width = (chart.width || chart.runtime && chart.runtime.width || 0) - margin.left - margin.right;
      var height = (chart.height || chart.runtime && chart.runtime.height || 0) - margin.top - margin.bottom;
      var axisVar = layer.mapping.axis;
      var valueVar = layer.mapping.value;
      var groupVar = layer.mapping.group;
      var labelOffset = layer.options && layer.options.labelOffset || 16;
      var centerX = width / 2;
      var centerY = height / 2;
      var maxRadius = Math.max(0, Math.min(width, height) / 2 - labelOffset - 8);
      var axisOrder = [];
      var axisSeen = /* @__PURE__ */ new Set();
      var maxValue = d3.max(layer.data, function(d) {
        return +d[valueVar];
      }) || 0;
      var radiusScale = d3.scaleLinear().domain([0, maxValue > 0 ? maxValue : 1]).range([0, maxRadius]);
      var groups = [];
      var groupMap = groupVar ? d3.group(layer.data, function(d) {
        return d[groupVar];
      }) : /* @__PURE__ */ new Map([[layer.label || "Series", layer.data]]);
      var colorScale = chart.derived.colorDiscrete || d3.scaleOrdinal(d3.schemeCategory10);
      var axisCount;
      var root;
      var axisLayer;
      var polygonLayer;
      var lineGenerator;
      layer.data.forEach(function(d) {
        var axisName = d[axisVar];
        if (!axisSeen.has(axisName)) {
          axisSeen.add(axisName);
          axisOrder.push(axisName);
        }
      });
      axisCount = axisOrder.length;
      if (axisCount === 0) {
        return;
      }
      root = chart.dom.chartArea.selectAll(".tag-radar-" + layer.id).data([null]).join("g").attr("class", "tag-radar-" + layer.id);
      axisLayer = root.selectAll(".radar-axis-layer").data([null]).join("g").attr("class", "radar-axis-layer");
      polygonLayer = root.selectAll(".radar-polygon-layer").data([null]).join("g").attr("class", "radar-polygon-layer");
      var transitionSpeed = chart.options && chart.options.transition && typeof chart.options.transition.speed === "number" ? chart.options.transition.speed : 0;
      function axisGeometry(index) {
        var angle2 = 2 * Math.PI * index / axisCount;
        var sinA = Math.sin(angle2);
        var cosA = Math.cos(angle2);
        var textAnchor = "middle";
        if (sinA > 0.25) {
          textAnchor = "start";
        } else if (sinA < -0.25) {
          textAnchor = "end";
        }
        return {
          lineX: centerX + maxRadius * sinA,
          lineY: centerY - maxRadius * cosA,
          labelX: centerX + (maxRadius + labelOffset) * sinA,
          labelY: centerY - (maxRadius + labelOffset) * cosA,
          textAnchor
        };
      }
      var axisSelection = axisLayer.selectAll(".radar-axis").data(axisOrder, function(d) {
        return d;
      });
      axisSelection.exit().transition().duration(transitionSpeed).style("opacity", 0).remove();
      var axisEnter = axisSelection.enter().append("g").attr("class", "radar-axis").style("opacity", 0);
      axisEnter.append("line").attr("class", "radar-axis-line").attr("stroke", "var(--chart-grid, #cbd5e1)").attr("stroke-width", 1).attr("x1", centerX).attr("y1", centerY).attr("x2", centerX).attr("y2", centerY);
      axisEnter.append("text").attr("class", "radar-axis-label").attr("fill", "var(--chart-fg, #1f2937)").attr("x", centerX).attr("y", centerY).attr("dy", "0.35em").attr("text-anchor", "middle");
      var axisMerged = axisEnter.merge(axisSelection);
      axisMerged.transition().duration(transitionSpeed).style("opacity", 1);
      axisMerged.each(function(axisName, index) {
        var geom = axisGeometry(index);
        var group = d3.select(this);
        group.select(".radar-axis-line").attr("stroke", "var(--chart-grid, #cbd5e1)").attr("stroke-width", 1).transition().duration(transitionSpeed).attr("x1", centerX).attr("y1", centerY).attr("x2", geom.lineX).attr("y2", geom.lineY);
        group.select(".radar-axis-label").text(axisName).transition().duration(transitionSpeed).attr("x", geom.labelX).attr("y", geom.labelY).attr("text-anchor", geom.textAnchor);
      });
      groupMap.forEach(function(rows, key) {
        var rowByAxis = /* @__PURE__ */ new Map();
        var polygonPoints = [];
        rows.forEach(function(d) {
          rowByAxis.set(d[axisVar], d);
        });
        axisOrder.forEach(function(axisName, index) {
          var angle2 = 2 * Math.PI * index / axisCount;
          var datum = rowByAxis.get(axisName);
          var rawValue = datum ? +datum[valueVar] : 0;
          var scaledRadius = radiusScale(Number.isFinite(rawValue) ? rawValue : 0);
          polygonPoints.push({
            axis: axisName,
            angle: angle2,
            value: Number.isFinite(rawValue) ? rawValue : 0,
            x: centerX + scaledRadius * Math.sin(angle2),
            y: centerY - scaledRadius * Math.cos(angle2),
            datum: datum || null
          });
        });
        groups.push({
          key,
          color: colorScale(key),
          points: polygonPoints,
          rows
        });
      });
      chart.derived.colorDiscrete = colorScale.domain(groups.map(function(group) {
        return group.key;
      }));
      chart.colorDiscrete = chart.derived.colorDiscrete;
      lineGenerator = d3.line().x(function(d) {
        return d.x;
      }).y(function(d) {
        return d.y;
      }).curve(d3.curveLinearClosed);
      function centerPolygonPath(points) {
        return lineGenerator(points.map(function(p) {
          return { x: centerX, y: centerY };
        }));
      }
      var polygons = polygonLayer.selectAll(".radar-polygon").data(groups, function(d) {
        return d.key;
      });
      polygons.exit().transition().duration(transitionSpeed).style("opacity", 0).remove();
      var polygonEnter = polygons.enter().append("path").attr("class", "radar-polygon").attr("d", function(d) {
        return centerPolygonPath(d.points);
      }).attr("fill", function(d) {
        return d.color;
      }).attr("fill-opacity", 0).attr("stroke", function(d) {
        return d.color;
      }).attr("stroke-width", 2).attr("stroke-opacity", 0);
      polygonEnter.merge(polygons).transition().duration(transitionSpeed).attrTween("d", function(d) {
        var self2 = this;
        var previous = self2._radarPoints || d.points.map(function() {
          return { x: centerX, y: centerY };
        });
        var target = d.points;
        var interp = previous.map(function(prev, i) {
          var next = target[i] || prev;
          return {
            x: d3.interpolateNumber(prev.x, next.x),
            y: d3.interpolateNumber(prev.y, next.y)
          };
        });
        return function(t) {
          var pts = interp.map(function(p) {
            return { x: p.x(t), y: p.y(t) };
          });
          self2._radarPoints = target;
          return lineGenerator(pts);
        };
      }).attr("fill", function(d) {
        return d.color;
      }).attr("fill-opacity", 0.2).attr("stroke", function(d) {
        return d.color;
      }).attr("stroke-opacity", 1);
    }
    getHoverSelector(chart, layer) {
      return ".tag-radar-" + layer.id + " .radar-polygon";
    }
    formatTooltip(chart, d) {
      return {
        title: { text: String(d.key) },
        items: d.points.map(function(point) {
          return {
            color: d.color,
            label: point.axis,
            value: String(point.value)
          };
        })
      };
    }
    remove(chart, layer) {
      chart.dom.chartArea.selectAll(".tag-radar-" + layer.id).remove();
    }
  };

  // inst/htmlwidgets/myIO/src/renderers/FunnelRenderer.js
  var FunnelRenderer = class {
    static type = "funnel";
    static traits = {
      hasAxes: false,
      referenceLines: false,
      legendType: "ordinal",
      binning: false,
      rolloverStyle: "element",
      scaleCapabilities: {}
    };
    static scaleHints = null;
    static dataContract = {
      stage: { required: true },
      value: { required: true, numeric: true }
    };
    render(chart, layer) {
      var margin = chart.margin || (chart.config && chart.config.layout ? chart.config.layout.margin : { top: 0, right: 0, bottom: 0, left: 0 });
      var width = (chart.width || chart.runtime && chart.runtime.width || 0) - margin.left - margin.right;
      var height = (chart.height || chart.runtime && chart.runtime.height || 0) - margin.top - margin.bottom;
      var stageVar = layer.mapping.stage;
      var valueVar = layer.mapping.value;
      var stageGap = layer.options && layer.options.stageGap || 6;
      var maxValue = d3.max(layer.data, function(d) {
        return +d[valueVar];
      }) || 0;
      var widthScale = d3.scaleLinear().domain([0, maxValue > 0 ? maxValue : 1]).range([0, width * 0.95]);
      var colorScale = chart.derived.colorDiscrete || d3.scaleOrdinal(d3.schemeTableau10);
      var stageHeight = layer.data.length > 0 ? height / layer.data.length : 0;
      var stages;
      var root;
      var stageGroups;
      stages = layer.data.map(function(d, index) {
        var nextDatum = layer.data[index + 1] || null;
        var topWidth = widthScale(+d[valueVar] || 0);
        var bottomWidth = nextDatum ? widthScale(+nextDatum[valueVar] || 0) : topWidth * 0.55;
        var y0 = index * stageHeight;
        var y1 = Math.max(y0, y0 + stageHeight - stageGap);
        var centerX = width / 2;
        var topLeft = centerX - topWidth / 2;
        var topRight = centerX + topWidth / 2;
        var bottomLeft = centerX - bottomWidth / 2;
        var bottomRight = centerX + bottomWidth / 2;
        return {
          stage: d[stageVar],
          value: +d[valueVar],
          color: colorScale(d[stageVar]),
          datum: d,
          points: [
            [topLeft, y0],
            [topRight, y0],
            [bottomRight, y1],
            [bottomLeft, y1]
          ],
          labelX: centerX,
          labelY: (y0 + y1) / 2
        };
      });
      chart.derived.colorDiscrete = colorScale.domain(stages.map(function(stage) {
        return stage.stage;
      }));
      chart.colorDiscrete = chart.derived.colorDiscrete;
      var transitionSpeed = chart.options && chart.options.transition && typeof chart.options.transition.speed === "number" ? chart.options.transition.speed : 0;
      function pathFor(points) {
        return "M" + points[0][0] + "," + points[0][1] + "L" + points[1][0] + "," + points[1][1] + "L" + points[2][0] + "," + points[2][1] + "L" + points[3][0] + "," + points[3][1] + "Z";
      }
      function collapsedPoints(s) {
        var midX = (s.points[0][0] + s.points[1][0]) / 2;
        var midY = (s.points[0][1] + s.points[3][1]) / 2;
        return [[midX, midY], [midX, midY], [midX, midY], [midX, midY]];
      }
      root = chart.dom.chartArea.selectAll(".tag-funnel-" + layer.id).data([null]).join("g").attr("class", "tag-funnel-" + layer.id);
      stageGroups = root.selectAll(".funnel-stage-group").data(stages, function(d) {
        return d.stage;
      });
      stageGroups.exit().transition().duration(transitionSpeed).style("opacity", 0).remove();
      var stageEnter = stageGroups.enter().append("g").attr("class", "funnel-stage-group").style("opacity", 0);
      stageEnter.append("path").attr("class", "funnel-stage").attr("d", function(d) {
        return pathFor(collapsedPoints(d));
      }).attr("fill", function(d) {
        return d.color;
      });
      stageEnter.append("text").attr("class", "funnel-label").attr("x", function(d) {
        return d.labelX;
      }).attr("y", function(d) {
        return d.labelY;
      }).attr("dy", "0.35em").attr("text-anchor", "middle").text(function(d) {
        return d.stage;
      });
      var stagesMerged = stageEnter.merge(stageGroups);
      stagesMerged.transition().duration(transitionSpeed).style("opacity", 1);
      stagesMerged.select(".funnel-stage").transition().duration(transitionSpeed).attr("d", function(d) {
        return pathFor(d.points);
      }).attr("fill", function(d) {
        return d.color;
      });
      stagesMerged.select(".funnel-label").text(function(d) {
        return d.stage;
      }).transition().duration(transitionSpeed).attr("x", function(d) {
        return d.labelX;
      }).attr("y", function(d) {
        return d.labelY;
      });
    }
    getHoverSelector(chart, layer) {
      return ".tag-funnel-" + layer.id + " .funnel-stage";
    }
    formatTooltip(chart, d) {
      return {
        title: { text: String(d.stage) },
        items: [{ color: d.color, label: String(d.stage), value: String(d.value) }]
      };
    }
    remove(chart, layer) {
      chart.dom.chartArea.selectAll(".tag-funnel-" + layer.id).remove();
    }
  };

  // inst/htmlwidgets/myIO/src/renderers/ParallelRenderer.js
  var ParallelRenderer = class {
    static type = "parallel";
    static traits = {
      hasAxes: false,
      referenceLines: false,
      legendType: "ordinal",
      binning: false,
      rolloverStyle: "element",
      scaleCapabilities: {}
    };
    static scaleHints = null;
    static dataContract = {
      dimensions: { required: true }
    };
    render(chart, layer) {
      var margin = chart.margin || (chart.config && chart.config.layout ? chart.config.layout.margin : { top: 0, right: 0, bottom: 0, left: 0 });
      var width = (chart.width || chart.runtime && chart.runtime.width || 0) - margin.left - margin.right;
      var height = (chart.height || chart.runtime && chart.runtime.height || 0) - margin.top - margin.bottom;
      var rawDimensions = layer.mapping.dimensions;
      var dimensions = Array.isArray(rawDimensions) ? rawDimensions.slice() : [rawDimensions];
      var groupVar = layer.mapping.group;
      var xScale = d3.scalePoint().domain(dimensions).range([0, width]).padding(0.5);
      var yScales = {};
      var colorScale = chart.derived.colorDiscrete || d3.scaleOrdinal(d3.schemeCategory10);
      var root;
      var axisGroups;
      var lineGenerator;
      dimensions.forEach(function(dimension) {
        var extent = d3.extent(layer.data, function(row) {
          var value = +row[dimension];
          return Number.isFinite(value) ? value : null;
        });
        if (!extent || extent[0] === void 0 || extent[1] === void 0) {
          extent = [0, 1];
        }
        if (extent[0] === extent[1]) {
          extent = [extent[0] - 1, extent[1] + 1];
        }
        yScales[dimension] = d3.scaleLinear().domain(extent).range([height, 0]);
      });
      chart.derived.colorDiscrete = colorScale.domain(Array.from(new Set(layer.data.map(function(row) {
        return groupVar ? row[groupVar] : layer.label;
      }))));
      chart.colorDiscrete = chart.derived.colorDiscrete;
      root = chart.dom.chartArea.selectAll(".tag-parallel-" + layer.id).data([null]).join("g").attr("class", "tag-parallel-" + layer.id);
      axisGroups = root.selectAll(".parallel-axis").data(dimensions).join(function(enter) {
        var group = enter.append("g").attr("class", "parallel-axis");
        group.append("text").attr("class", "parallel-axis-label");
        return group;
      }).attr("transform", function(dimension) {
        return "translate(" + xScale(dimension) + ",0)";
      }).each(function(dimension) {
        d3.select(this).call(d3.axisLeft(yScales[dimension]).ticks(5));
      });
      axisGroups.select(".parallel-axis-label").attr("x", 0).attr("y", -10).attr("text-anchor", "middle").text(function(dimension) {
        return dimension;
      });
      lineGenerator = d3.line().defined(function(point) {
        return point && point[1] !== null;
      }).x(function(point) {
        return point[0];
      }).y(function(point) {
        return point[1];
      });
      var transitionSpeed = chart.options && chart.options.transition && typeof chart.options.transition.speed === "number" ? chart.options.transition.speed : 0;
      function rowPath(row) {
        var points = dimensions.map(function(dimension) {
          var value = +row[dimension];
          if (!Number.isFinite(value)) {
            return [xScale(dimension), null];
          }
          return [xScale(dimension), yScales[dimension](value)];
        });
        return lineGenerator(points);
      }
      function rowStroke(row) {
        var colorKey = groupVar ? row[groupVar] : layer.label;
        return colorScale(colorKey);
      }
      var lineSelection = root.selectAll(".parallel-line").data(layer.data, function(d, i) {
        return d._source_key != null ? d._source_key : i;
      });
      lineSelection.exit().transition().duration(transitionSpeed).attr("stroke-opacity", 0).remove();
      var lineEnter = lineSelection.enter().append("path").attr("class", "parallel-line").attr("fill", "none").attr("d", rowPath).attr("stroke", rowStroke).attr("stroke-opacity", 0);
      lineEnter.merge(lineSelection).transition().duration(transitionSpeed).attr("d", rowPath).attr("stroke", rowStroke).attr("stroke-opacity", 0.6);
    }
    getHoverSelector(chart, layer) {
      return ".tag-parallel-" + layer.id + " .parallel-line";
    }
    formatTooltip(chart, d, layer) {
      var dimensions = Array.isArray(layer.mapping.dimensions) ? layer.mapping.dimensions : [layer.mapping.dimensions];
      var title = layer.mapping.group ? String(d[layer.mapping.group]) : String(layer.label || "Series");
      return {
        title: { text: title },
        items: dimensions.map(function(dimension) {
          return {
            color: chart.colorDiscrete ? chart.colorDiscrete(layer.mapping.group ? d[layer.mapping.group] : layer.label) : layer.color,
            label: dimension,
            value: String(d[dimension])
          };
        })
      };
    }
    remove(chart, layer) {
      chart.dom.chartArea.selectAll(".tag-parallel-" + layer.id).remove();
    }
  };

  // inst/htmlwidgets/myIO/src/registry.js
  var rendererRegistry = /* @__PURE__ */ new Map();
  function registerRenderer(type, RendererClass) {
    if (rendererRegistry.has(type)) {
      throw new Error("Renderer already registered for type: " + type);
    }
    var traits = RendererClass && RendererClass.constructor ? RendererClass.constructor.traits : null;
    var requiredTraitKeys = ["hasAxes", "referenceLines", "legendType", "binning", "rolloverStyle"];
    if (!traits) {
      throw new Error("Renderer missing static traits: " + type);
    }
    requiredTraitKeys.forEach(function(key) {
      if (!(key in traits)) {
        throw new Error("Renderer trait missing '" + key + "': " + type);
      }
    });
    rendererRegistry.set(type, RendererClass);
  }
  function getRenderer(type) {
    if (!rendererRegistry.has(type)) {
      throw new Error("Unknown renderer type: " + type);
    }
    return rendererRegistry.get(type);
  }
  function getRendererForLayer(layer) {
    return getRenderer(layer.type);
  }
  function registerBuiltInRenderers() {
    if (!rendererRegistry.has(LineRenderer.type)) {
      registerRenderer(LineRenderer.type, new LineRenderer());
    }
    if (!rendererRegistry.has(PointRenderer.type)) {
      registerRenderer(PointRenderer.type, new PointRenderer());
    }
    if (!rendererRegistry.has(AreaRenderer.type)) {
      registerRenderer(AreaRenderer.type, new AreaRenderer());
    }
    if (!rendererRegistry.has(BarRenderer.type)) {
      registerRenderer(BarRenderer.type, new BarRenderer());
    }
    if (!rendererRegistry.has(GroupedBarRenderer.type)) {
      registerRenderer(GroupedBarRenderer.type, new GroupedBarRenderer());
    }
    if (!rendererRegistry.has(HistogramRenderer.type)) {
      registerRenderer(HistogramRenderer.type, new HistogramRenderer());
    }
    if (!rendererRegistry.has(HexbinRenderer.type)) {
      registerRenderer(HexbinRenderer.type, new HexbinRenderer());
    }
    if (!rendererRegistry.has(TreemapRenderer.type)) {
      registerRenderer(TreemapRenderer.type, new TreemapRenderer());
    }
    if (!rendererRegistry.has(DonutRenderer.type)) {
      registerRenderer(DonutRenderer.type, new DonutRenderer());
    }
    if (!rendererRegistry.has(GaugeRenderer.type)) {
      registerRenderer(GaugeRenderer.type, new GaugeRenderer());
    }
    if (!rendererRegistry.has(HeatmapRenderer.type)) {
      registerRenderer(HeatmapRenderer.type, new HeatmapRenderer());
    }
    if (!rendererRegistry.has(CalendarHeatmapRenderer.type)) {
      registerRenderer(CalendarHeatmapRenderer.type, new CalendarHeatmapRenderer());
    }
    if (!rendererRegistry.has(CandlestickRenderer.type)) {
      registerRenderer(CandlestickRenderer.type, new CandlestickRenderer());
    }
    if (!rendererRegistry.has(WaterfallRenderer.type)) {
      registerRenderer(WaterfallRenderer.type, new WaterfallRenderer());
    }
    if (!rendererRegistry.has(SankeyRenderer.type)) {
      registerRenderer(SankeyRenderer.type, new SankeyRenderer());
    }
    if (!rendererRegistry.has(RangeBarRenderer.type)) {
      registerRenderer(RangeBarRenderer.type, new RangeBarRenderer());
    }
    if (!rendererRegistry.has(LollipopRenderer.type)) {
      registerRenderer(LollipopRenderer.type, new LollipopRenderer());
    }
    if (!rendererRegistry.has(DumbbellRenderer.type)) {
      registerRenderer(DumbbellRenderer.type, new DumbbellRenderer());
    }
    if (!rendererRegistry.has(WaffleRenderer.type)) {
      registerRenderer(WaffleRenderer.type, new WaffleRenderer());
    }
    if (!rendererRegistry.has(BeeswarmRenderer.type)) {
      registerRenderer(BeeswarmRenderer.type, new BeeswarmRenderer());
    }
    if (!rendererRegistry.has(QuantileDotsRenderer.type)) {
      registerRenderer(QuantileDotsRenderer.type, new QuantileDotsRenderer());
    }
    if (!rendererRegistry.has(BumpRenderer.type)) {
      registerRenderer(BumpRenderer.type, new BumpRenderer());
    }
    if (!rendererRegistry.has(RadarRenderer.type)) {
      registerRenderer(RadarRenderer.type, new RadarRenderer());
    }
    if (!rendererRegistry.has(FunnelRenderer.type)) {
      registerRenderer(FunnelRenderer.type, new FunnelRenderer());
    }
    if (!rendererRegistry.has(ParallelRenderer.type)) {
      registerRenderer(ParallelRenderer.type, new ParallelRenderer());
    }
    if (!rendererRegistry.has(TextRenderer.type)) {
      registerRenderer(TextRenderer.type, new TextRenderer());
    }
    if (!rendererRegistry.has(BracketRenderer.type)) {
      registerRenderer(BracketRenderer.type, new BracketRenderer());
    }
    return rendererRegistry;
  }
  function listRenderers() {
    return Array.from(rendererRegistry.values());
  }

  // inst/htmlwidgets/myIO/src/interactions/drag.js
  function bindPointDrag(chart, layer) {
    var color = resolveColor(chart, layer.label, layer.color);
    var drag = d3.drag().on("start", function() {
      d3.select(this).raise().classed("active", true).style("cursor", "grabbing");
    }).on("drag", function(event, d) {
      d[layer.mapping.x_var] = chart.xScale.invert(event.x);
      d[layer.mapping.y_var] = chart.yScale.invert(event.y);
      d3.select(this).attr("cx", chart.xScale(d[layer.mapping.x_var])).attr("cy", chart.yScale(d[layer.mapping.y_var]));
    }).on("end", function(event, d) {
      d3.select(this).classed("active", false).style("cursor", "grab");
      chart.updateRegression(color, layer.label);
      chart.emit("dragEnd", { point: d, layerLabel: layer.label });
    });
    chart.chart.selectAll("." + tagName("point", chart.element.id, layer.label)).style("cursor", "grab").call(drag);
  }

  // inst/htmlwidgets/myIO/src/interactions/status-bar.js
  function showStatusBar(chart, message, actions) {
    removeStatusBar(chart);
    var container = d3.select(chart.dom.element);
    var bar = container.append("div").attr("class", "myIO-status-bar").attr("role", "status").attr("aria-live", "polite");
    bar.append("span").attr("class", "myIO-status-bar-text").text(message);
    var btnGroup = bar.append("span").attr("class", "myIO-status-bar-actions");
    (actions || []).forEach(function(action) {
      btnGroup.append("button").attr("class", "myIO-status-bar-btn").attr("type", "button").text(action.label).on("click", action.handler);
    });
  }
  function removeStatusBar(chart) {
    d3.select(chart.dom.element).selectAll(".myIO-status-bar").remove();
  }

  // inst/htmlwidgets/myIO/src/interactions/brush.js
  var BRUSHABLE_TYPES = ["point", "bar", "histogram", "hexbin", "groupedBar"];
  function bindBrush(chart) {
    var cfg = chart.config.interactions.brush;
    if (!cfg || !cfg.enabled) return;
    var brushableLayers = (chart.derived.currentLayers || []).filter(function(l) {
      return BRUSHABLE_TYPES.indexOf(l.type) > -1;
    });
    if (brushableLayers.length === 0) return;
    removeBrush(chart);
    var brushFn = cfg.direction === "x" ? d3.brushX() : cfg.direction === "y" ? d3.brushY() : d3.brush();
    var margin = chart.config.layout.margin;
    var chartWidth = chart.runtime.width - (margin.left + margin.right);
    var chartHeight = chart.runtime.height - (margin.top + margin.bottom);
    brushFn.extent([[0, 0], [chartWidth, chartHeight]]);
    brushFn.on("brush", function(event) {
      onBrush(chart, event, brushableLayers, cfg);
    }).on("end", function(event) {
      onBrushEnd(chart, event, brushableLayers, cfg);
    });
    chart.dom.chartArea.insert("g", ":first-child").attr("class", "myIO-brush").call(brushFn);
    chart.dom.chartArea.select(".myIO-brush .overlay").style("cursor", "crosshair");
    chart.runtime._brushFn = brushFn;
    d3.select(chart.dom.element).on("keydown.brush", function(event) {
      if (event.key === "Escape" && chart.runtime._brushed) {
        clearBrush(chart);
      }
    });
  }
  function onBrush(chart, event, layers, cfg) {
    if (!event.selection) return;
    var sel = event.selection;
    var dir = cfg.direction;
    layers.forEach(function(layer) {
      var selector = getLayerSelector(chart, layer);
      chart.dom.chartArea.selectAll(selector).each(function(d) {
        var inside = isInsideBrush(chart, d, layer, sel, dir);
        d3.select(this).style("opacity", inside ? 1 : "var(--chart-brush-dim-opacity)");
      });
    });
  }
  function onBrushEnd(chart, event, layers, cfg) {
    if (!event.selection) {
      clearBrush(chart);
      return;
    }
    var sel = event.selection;
    var dir = cfg.direction;
    var extent = invertExtent(chart, sel, dir);
    var selected = [];
    var keys2 = [];
    layers.forEach(function(layer) {
      layer.data.forEach(function(d) {
        if (isInsideBrush(chart, d, layer, sel, dir)) {
          selected.push(d);
          if (d._source_key) keys2.push(d._source_key);
        }
      });
    });
    chart.runtime._brushed = { data: selected, extent, keys: keys2 };
    var totalPoints = layers.reduce(function(sum, l) {
      return sum + l.data.length;
    }, 0);
    showStatusBar(
      chart,
      selected.length + " of " + totalPoints + " points selected",
      [{ label: "Clear", handler: function() {
        clearBrush(chart);
      } }]
    );
    chart.emit("brushed", {
      data: selected,
      extent,
      keys: keys2,
      layerLabel: layers.length === 1 ? layers[0].label : null
    });
  }
  function clearBrush(chart) {
    (chart.derived.currentLayers || []).forEach(function(layer) {
      if (BRUSHABLE_TYPES.indexOf(layer.type) > -1) {
        var selector = getLayerSelector(chart, layer);
        chart.dom.chartArea.selectAll(selector).style("opacity", 1);
      }
    });
    if (chart.runtime._brushFn) {
      chart.dom.chartArea.select(".myIO-brush").call(chart.runtime._brushFn.move, null);
    }
    chart.runtime._brushed = null;
    removeStatusBar(chart);
    chart.emit("brushed", { data: [], extent: null, keys: [], layerLabel: null });
  }
  function isInsideBrush(chart, d, layer, sel, dir) {
    var xVar = layer.mapping.x_var;
    var yVar = layer.mapping.y_var;
    var px = chart.xScale(d[xVar]);
    var py = chart.yScale(d[yVar]);
    if (isNaN(px) || isNaN(py)) return false;
    if (dir === "x") return px >= sel[0] && px <= sel[1];
    if (dir === "y") return py >= sel[0] && py <= sel[1];
    return px >= sel[0][0] && px <= sel[1][0] && py >= sel[0][1] && py <= sel[1][1];
  }
  function safeInvert(scale, v0, v1) {
    if (typeof scale.invert === "function") {
      return [scale.invert(v0), scale.invert(v1)];
    }
    return null;
  }
  function invertExtent(chart, sel, dir) {
    if (dir === "x") {
      return {
        x: safeInvert(chart.xScale, sel[0], sel[1]),
        y: null
      };
    }
    if (dir === "y") {
      return {
        x: null,
        y: safeInvert(chart.yScale, sel[1], sel[0])
      };
    }
    return {
      x: safeInvert(chart.xScale, sel[0][0], sel[1][0]),
      y: safeInvert(chart.yScale, sel[1][1], sel[0][1])
    };
  }
  function getLayerSelector(chart, layer) {
    if (layer.type === "groupedBar") return ".tag-grouped-bar-g rect";
    return "." + tagName(layer.type, chart.dom.element.id, layer.label);
  }
  function removeBrush(chart) {
    if (chart.dom && chart.dom.chartArea) {
      chart.dom.chartArea.selectAll(".myIO-brush").remove();
    }
    if (chart.dom && chart.dom.element) {
      d3.select(chart.dom.element).on("keydown.brush", null);
    }
    chart.runtime._brushed = null;
  }

  // inst/htmlwidgets/myIO/src/interactions/popover.js
  var MAX_LABEL_LENGTH = 30;
  function showPopover(chart, anchorPoint, options) {
    removePopover(chart);
    var container = d3.select(chart.dom.element);
    var popover = container.append("div").attr("class", "myIO-popover").attr("role", "dialog").attr("aria-label", "Annotate data point");
    var labelSection = popover.append("div").attr("class", "myIO-popover-field");
    labelSection.append("label").text("Label:");
    var inputEl;
    if (options.presetLabels && options.presetLabels.length > 0) {
      inputEl = labelSection.append("select").attr("class", "myIO-popover-input");
      options.presetLabels.forEach(function(label) {
        inputEl.append("option").attr("value", label).text(label);
      });
      if (options.existingLabel) inputEl.property("value", options.existingLabel);
    } else {
      inputEl = labelSection.append("input").attr("class", "myIO-popover-input").attr("type", "text").attr("maxlength", MAX_LABEL_LENGTH).attr("placeholder", "Enter label...");
      if (options.existingLabel) inputEl.property("value", options.existingLabel);
    }
    var selectedColor = null;
    if (options.categoryColors) {
      var colorSection = popover.append("div").attr("class", "myIO-popover-field");
      colorSection.append("label").text("Category:");
      var colorPicker = colorSection.append("div").attr("class", "myIO-popover-colors");
      Object.keys(options.categoryColors).forEach(function(name) {
        var color = options.categoryColors[name];
        colorPicker.append("button").attr("class", "myIO-popover-color-btn").attr("type", "button").attr("title", name).attr("aria-label", name).style("background-color", color).on("click", function() {
          colorPicker.selectAll(".myIO-popover-color-btn").classed("selected", false);
          d3.select(this).classed("selected", true);
          selectedColor = color;
        });
      });
    }
    var btnRow = popover.append("div").attr("class", "myIO-popover-buttons");
    if (options.existingLabel && options.onRemove) {
      btnRow.append("button").attr("class", "myIO-popover-btn myIO-popover-btn--danger").attr("type", "button").text("Remove").on("click", function() {
        removePopover(chart);
        options.onRemove();
      });
    }
    btnRow.append("button").attr("class", "myIO-popover-btn").attr("type", "button").text("Cancel").on("click", function() {
      removePopover(chart);
      if (options.onCancel) options.onCancel();
    });
    btnRow.append("button").attr("class", "myIO-popover-btn myIO-popover-btn--primary").attr("type", "button").text("Apply").on("click", function() {
      var val = inputEl.property("value").trim().substring(0, MAX_LABEL_LENGTH);
      if (val) {
        removePopover(chart);
        options.onApply(val, selectedColor);
      }
    });
    positionPopover(chart, popover, anchorPoint);
    inputEl.node().focus();
    popover.on("keydown", function(event) {
      if (event.key === "Enter") {
        var val = inputEl.property("value").trim().substring(0, MAX_LABEL_LENGTH);
        if (val) {
          removePopover(chart);
          options.onApply(val, selectedColor);
        }
      }
      if (event.key === "Escape") {
        removePopover(chart);
        if (options.onCancel) options.onCancel();
      }
    });
  }
  function positionPopover(chart, popover, point) {
    var margin = chart.config.layout.margin;
    var x = point.px + margin.left;
    var y = point.py + margin.top - 10;
    popover.style("left", Math.max(4, Math.min(x - 80, chart.runtime.totalWidth - 180)) + "px").style("bottom", chart.runtime.height - y + 8 + "px");
  }
  function removePopover(chart) {
    d3.select(chart.dom.element).selectAll(".myIO-popover").remove();
  }

  // inst/htmlwidgets/myIO/src/interactions/annotate.js
  var ANNOTATABLE_TYPES = ["point", "bar", "histogram", "hexbin", "groupedBar"];
  function bindAnnotation(chart) {
    var cfg = chart.config.interactions.annotation;
    if (!cfg || !cfg.enabled) return;
    if (!chart.runtime._annotations) chart.runtime._annotations = [];
    var layers = (chart.derived.currentLayers || []).filter(function(l) {
      return ANNOTATABLE_TYPES.indexOf(l.type) > -1;
    });
    layers.forEach(function(layer) {
      var selector = "." + tagName(layer.type, chart.dom.element.id, layer.label);
      chart.dom.chartArea.selectAll(selector).on("click.annotate", function(event, d) {
        event.stopPropagation();
        var existing = findAnnotation(chart, d._source_key);
        showPopover(chart, {
          px: chart.xScale(d[layer.mapping.x_var]),
          py: chart.yScale(d[layer.mapping.y_var])
        }, {
          presetLabels: cfg.presetLabels,
          categoryColors: cfg.categoryColors,
          existingLabel: existing ? existing.label : null,
          onApply: function(label, color) {
            addAnnotation(chart, d, layer, label, color);
          },
          onRemove: function() {
            removeAnnotation(chart, d._source_key);
          },
          onCancel: function() {
          }
        });
      });
    });
    renderAnnotationMarks(chart);
    updateAnnotationStatus(chart);
  }
  function addAnnotation(chart, datum, layer, label, color) {
    chart.runtime._annotations = chart.runtime._annotations.filter(function(a) {
      return a._source_key !== datum._source_key;
    });
    var annotation = {
      _source_key: datum._source_key,
      x: datum[layer.mapping.x_var],
      y: datum[layer.mapping.y_var],
      x_var: layer.mapping.x_var,
      y_var: layer.mapping.y_var,
      label,
      category: color || null,
      layerLabel: layer.label,
      timestamp: (/* @__PURE__ */ new Date()).toISOString()
    };
    chart.runtime._annotations.push(annotation);
    renderAnnotationMarks(chart);
    updateAnnotationStatus(chart);
    chart.emit("annotated", {
      annotations: chart.runtime._annotations,
      action: "add",
      latest: annotation
    });
  }
  function removeAnnotation(chart, sourceKey) {
    var removed = chart.runtime._annotations.find(function(a) {
      return a._source_key === sourceKey;
    });
    chart.runtime._annotations = chart.runtime._annotations.filter(function(a) {
      return a._source_key !== sourceKey;
    });
    renderAnnotationMarks(chart);
    updateAnnotationStatus(chart);
    chart.emit("annotated", {
      annotations: chart.runtime._annotations,
      action: "remove",
      latest: removed || null
    });
  }
  function clearAnnotations(chart) {
    chart.runtime._annotations = [];
    renderAnnotationMarks(chart);
    removeStatusBar(chart);
    chart.emit("annotated", { annotations: [], action: "clear", latest: null });
  }
  function renderAnnotationMarks(chart) {
    var group = chart.dom.chartArea.selectAll(".myIO-annotations").data([0]);
    group = group.enter().append("g").attr("class", "myIO-annotations").merge(group);
    var marks = group.selectAll(".myIO-annotation-mark").data(chart.runtime._annotations || [], function(d) {
      return d._source_key;
    });
    marks.exit().remove();
    var enter = marks.enter().append("g").attr("class", "myIO-annotation-mark");
    enter.append("circle").attr("r", 8).attr("fill", "none").attr("stroke-width", 2);
    enter.append("text").attr("dy", -12).attr("text-anchor", "middle").attr("class", "myIO-annotation-label");
    var merged = enter.merge(marks);
    merged.attr("transform", function(d) {
      return "translate(" + chart.xScale(d.x) + "," + chart.yScale(d.y) + ")";
    });
    merged.select("circle").style("stroke", function(d) {
      return d.category || "var(--chart-annotation-ring)";
    });
    merged.select("text").text(function(d) {
      return d.label.length > 30 ? d.label.substring(0, 27) + "\u2026" : d.label;
    }).style("font-size", "var(--chart-annotation-font-size)").style("fill", "var(--chart-text-color)");
  }
  function updateAnnotationStatus(chart) {
    var count = (chart.runtime._annotations || []).length;
    if (count === 0) {
      removeStatusBar(chart);
      return;
    }
    showStatusBar(chart, count + " annotation" + (count === 1 ? "" : "s"), [
      {
        label: "Export",
        handler: function() {
          var data = chart.runtime._annotations || [];
          if (data.length > 0) {
            exportToCsv(chart.dom.element.id + "_annotations.csv", data);
          }
        }
      },
      { label: "Clear", handler: function() {
        clearAnnotations(chart);
      } }
    ]);
  }
  function findAnnotation(chart, sourceKey) {
    return (chart.runtime._annotations || []).find(function(a) {
      return a._source_key === sourceKey;
    });
  }
  function removeAnnotationBindings(chart) {
    removePopover(chart);
  }

  // inst/htmlwidgets/myIO/src/interactions/linked-cursor.js
  var _registry = /* @__PURE__ */ new Map();
  function linkedConfig(chart) {
    return chart && chart.config && chart.config.interactions && chart.config.interactions.linked;
  }
  function groupOf(chart) {
    var linked = linkedConfig(chart);
    return linked && linked.cursor === true && linked.group ? linked.group : null;
  }
  function registerLinkedCursor(chart) {
    var g = groupOf(chart);
    if (!g) return;
    var set = _registry.get(g);
    if (!set) {
      set = /* @__PURE__ */ new Set();
      _registry.set(g, set);
    }
    set.add(chart);
    chart.runtime = chart.runtime || {};
    if (!chart.runtime._linkedCursor) {
      chart.runtime._linkedCursor = { lastTs: 0 };
    }
  }
  function unregisterLinkedCursor(chart) {
    _registry.forEach(function(set, key) {
      if (set.delete(chart) && set.size === 0) {
        _registry.delete(key);
      }
    });
  }
  function emitCursor(chart, payload) {
    var g = groupOf(chart);
    if (!g) return;
    var set = _registry.get(g);
    if (!set) return;
    set.forEach(function(sibling) {
      if (sibling === chart) return;
      _receive(sibling, payload);
    });
  }
  function clearCursor(chart) {
    var g = groupOf(chart);
    if (!g) return;
    emitCursor(chart, {
      sourceId: chart.element && chart.element.id,
      group: g,
      ts: typeof performance !== "undefined" ? performance.now() : Date.now(),
      clear: true
    });
  }
  function maybeEmitCursor(chart, row, xValue, tooltipPayload) {
    var linked = linkedConfig(chart);
    if (!linked || linked.cursor !== true) return;
    var keyColumn = linked.keyColumn;
    var keyValue = row && keyColumn && row[keyColumn] !== void 0 ? row[keyColumn] : null;
    emitCursor(chart, {
      sourceId: chart.element && chart.element.id,
      group: linked.group,
      keyValue,
      xValue,
      tooltip: tooltipPayload || null,
      ts: typeof performance !== "undefined" ? performance.now() : Date.now()
    });
  }
  function maybeClearCursor(chart) {
    var linked = linkedConfig(chart);
    if (!linked || linked.cursor !== true) return;
    clearCursor(chart);
  }
  function _receive(chart, payload) {
    var rt = chart.runtime && chart.runtime._linkedCursor;
    if (!rt) return;
    if (typeof payload.ts === "number" && payload.ts < rt.lastTs) return;
    rt.lastTs = typeof payload.ts === "number" ? payload.ts : rt.lastTs;
    rt.lastPayload = payload;
    if (payload.clear) {
      removeCrosshair(chart);
      return;
    }
    var xPx = coerceXToPixel(chart, payload.xValue);
    if (xPx == null) {
      removeCrosshair(chart);
      return;
    }
    drawCrosshair(chart, xPx);
  }
  function coerceXToPixel(chart, xValue) {
    var xScale = chart.xScale;
    if (!xScale || typeof xScale !== "function") return null;
    if (typeof xScale.domain === "function" && typeof xScale.invert === "function") {
      var domain = xScale.domain();
      var lo = domain[0];
      var hi = domain[domain.length - 1];
      var coerced = xValue;
      if (lo instanceof Date && !(xValue instanceof Date)) {
        coerced = new Date(xValue);
      }
      var numeric = +coerced;
      if (!Number.isFinite(numeric)) return null;
      if (numeric < +lo || numeric > +hi) return null;
      var px = xScale(coerced);
      return Number.isFinite(px) ? px : null;
    }
    var ordDomain = typeof xScale.domain === "function" ? xScale.domain() : [];
    if (ordDomain.indexOf(xValue) === -1) return null;
    var opx = xScale(xValue);
    return Number.isFinite(opx) ? opx : null;
  }
  function drawCrosshair(chart, xPx) {
    var host = chart.plot || chart.svg;
    if (!host || typeof host.select !== "function") return;
    var line = host.select("line.myIO-hover-rule");
    if (line.empty()) {
      line = host.append("line").attr("class", "myIO-hover-rule");
    }
    var m = chart.margin || {};
    var innerH = (chart.height || 0) - ((+m.top || 0) + (+m.bottom || 0));
    line.attr("x1", xPx).attr("x2", xPx).attr("y1", 0).attr("y2", innerH).style("display", null);
  }
  function removeCrosshair(chart) {
    var host = chart.plot || chart.svg;
    if (!host || typeof host.select !== "function") return;
    host.select("line.myIO-hover-rule").remove();
  }

  // inst/htmlwidgets/myIO/src/interactions/linked.js
  var LINKABLE_TYPES = [
    "point",
    "bar",
    "histogram",
    "hexbin",
    "groupedBar",
    "waffle",
    "beeswarm",
    "lollipop",
    "dumbbell"
  ];
  function bindLinked(chart) {
    var cfg = chart.config.interactions.linked;
    if (!cfg || !cfg.enabled) return;
    if (typeof crosstalk === "undefined") return;
    cleanupLinked(chart);
    var sel = new crosstalk.SelectionHandle(cfg.group);
    var fil = cfg.filter ? new crosstalk.FilterHandle(cfg.group) : null;
    chart.runtime._crosstalkSel = sel;
    chart.runtime._crosstalkFil = fil;
    if (cfg.mode === "source" || cfg.mode === "both") {
      chart.runtime._linkedBrushHandler = function(e) {
        if (e.keys && e.keys.length > 0) {
          sel.set(e.keys);
        } else {
          sel.clear();
        }
      };
      chart.on("brushed", chart.runtime._linkedBrushHandler);
    }
    if (cfg.mode === "target" || cfg.mode === "both") {
      sel.on("change.myIO", function(e) {
        applySelection(chart, e.value);
      });
      if (fil) {
        fil.on("change.myIO", function(e) {
          applyFilter(chart, e.value);
        });
      }
    }
  }
  function applySelection(chart, selectedKeys) {
    var layers = (chart.derived.currentLayers || []).filter(function(l) {
      return LINKABLE_TYPES.indexOf(l.type) > -1;
    });
    layers.forEach(function(layer) {
      var selector = "." + tagName(layer.type, chart.dom.element.id, layer.label);
      chart.dom.chartArea.selectAll(selector).each(function(d) {
        if (!selectedKeys) {
          d3.select(this).style("opacity", 1);
        } else {
          var inside = selectedKeys.indexOf(d._source_key) > -1;
          d3.select(this).style("opacity", inside ? 1 : "var(--chart-brush-dim-opacity)");
        }
      });
    });
  }
  function applyFilter(chart, filteredKeys) {
    var layers = (chart.derived.currentLayers || []).filter(function(l) {
      return LINKABLE_TYPES.indexOf(l.type) > -1;
    });
    layers.forEach(function(layer) {
      var selector = "." + tagName(layer.type, chart.dom.element.id, layer.label);
      chart.dom.chartArea.selectAll(selector).each(function(d) {
        if (!filteredKeys) {
          d3.select(this).style("display", null);
        } else {
          var visible = filteredKeys.indexOf(d._source_key) > -1;
          d3.select(this).style("display", visible ? null : "none");
        }
      });
    });
  }
  function cleanupLinked(chart) {
    if (chart.runtime._linkedBrushHandler) {
      chart.off("brushed", chart.runtime._linkedBrushHandler);
      chart.runtime._linkedBrushHandler = null;
    }
    if (chart.runtime._crosstalkSel) {
      chart.runtime._crosstalkSel.close();
      chart.runtime._crosstalkSel = null;
    }
    if (chart.runtime._crosstalkFil) {
      chart.runtime._crosstalkFil.close();
      chart.runtime._crosstalkFil = null;
    }
    unregisterLinkedCursor(chart);
  }

  // inst/htmlwidgets/myIO/src/interactions/slider.js
  function bindSliders(chart) {
    var sliders = chart.config.interactions.sliders;
    if (!sliders || sliders.length === 0) return;
    removeSliders(chart);
    chart.runtime._sliderTimers = [];
    var container = d3.select(chart.dom.element);
    var wrapper = container.append("div").attr("class", "myIO-slider-wrapper");
    sliders.forEach(function(cfg) {
      var row = wrapper.append("div").attr("class", "myIO-slider-row");
      row.append("label").attr("class", "myIO-slider-label").attr("for", chart.dom.element.id + "-slider-" + cfg.param).text(cfg.label);
      var input = row.append("input").attr("type", "range").attr("class", "myIO-slider-input").attr("id", chart.dom.element.id + "-slider-" + cfg.param).attr("min", cfg.min).attr("max", cfg.max).attr("step", cfg.step || "any").attr("aria-label", cfg.label).attr("aria-valuemin", cfg.min).attr("aria-valuemax", cfg.max).attr("aria-valuenow", cfg.value).property("value", cfg.value);
      var valueSpan = row.append("span").attr("class", "myIO-slider-value").text(formatSliderValue(cfg.value, cfg.step));
      if (!HTMLWidgets.shinyMode) {
        input.attr("disabled", true).attr("title", "Parameter sliders require Shiny");
        row.style("opacity", "0.5");
        return;
      }
      var timerIdx = chart.runtime._sliderTimers.length;
      chart.runtime._sliderTimers.push(null);
      var debounceMs = cfg.debounce || 200;
      input.on("input", function() {
        var val = +this.value;
        valueSpan.text(formatSliderValue(val, cfg.step));
        d3.select(this).attr("aria-valuenow", val);
        clearTimeout(chart.runtime._sliderTimers[timerIdx]);
        chart.runtime._sliderTimers[timerIdx] = setTimeout(function() {
          Shiny.onInputChange(
            "myIO-" + chart.dom.element.id + "-slider-" + cfg.param,
            val
          );
          chart.emit("sliderChanged", { param: cfg.param, value: val });
        }, debounceMs);
      });
    });
  }
  function formatSliderValue(value, step) {
    if (step && step < 1) {
      var decimals = String(step).split(".")[1];
      return value.toFixed(decimals ? decimals.length : 2);
    }
    return String(value);
  }
  function removeSliders(chart) {
    if (chart.runtime._sliderTimers) {
      chart.runtime._sliderTimers.forEach(clearTimeout);
      chart.runtime._sliderTimers = null;
    }
    d3.select(chart.dom.element).selectAll(".myIO-slider-wrapper").remove();
  }

  // inst/htmlwidgets/myIO/src/tooltip.js
  function sanitize(str) {
    const div = document.createElement("div");
    div.textContent = String(str);
    return div.innerHTML;
  }
  function initializeTooltip(chart) {
    chart.dom.tooltip = d3.select(chart.dom.element).append("div").attr("class", "toolTip").attr("role", "status").attr("aria-live", "polite").attr("aria-hidden", "true");
    chart.dom.tooltipTitle = chart.dom.tooltip.append("div").attr("class", "toolTipTitle");
    chart.dom.tooltipBody = chart.dom.tooltip.append("div").attr("class", "toolTipBody");
    chart.runtime.tooltipHideTimer = null;
    chart.captureLegacyAliases();
  }
  function removeHoverOverlay(chart) {
    d3.select(chart.dom.element).select(".toolTipBox").remove();
    d3.select(chart.dom.element).select(".toolLine").remove();
    d3.select(chart.dom.element).select(".toolPointLayer").remove();
    chart.runtime.toolTipBox = null;
    chart.runtime.toolLine = null;
    chart.runtime.toolPointLayer = null;
    chart.syncLegacyAliases();
  }
  function createHoverOverlay(chart, onMove, onEnd) {
    removeHoverOverlay(chart);
    chart.runtime.toolLine = chart.dom.chartArea.append("line").attr("class", "toolLine");
    chart.runtime.toolPointLayer = chart.dom.chartArea.append("g").attr("class", "toolPointLayer");
    chart.runtime.toolTipBox = chart.dom.svg.append("rect").attr("class", "toolTipBox").attr("opacity", 0).attr("width", chart.width - (chart.margin.left + chart.margin.right)).attr("height", chart.height - (chart.margin.top + chart.margin.bottom)).attr("transform", "translate(" + chart.margin.left + "," + chart.margin.top + ")").on("mouseover", function(event) {
      onMove(event);
    }).on("mousemove", function(event) {
      onMove(event);
    }).on("mouseout", function() {
      if (typeof onEnd === "function") {
        onEnd();
      }
    }).on("touchstart", function(event) {
      event.preventDefault();
      onMove(event);
    }).on("touchmove", function(event) {
      event.preventDefault();
      onMove(event);
    }).on("touchend", function() {
      if (typeof onEnd === "function") {
        onEnd();
      }
    });
    chart.syncLegacyAliases();
  }
  function showChartTooltip(chart, config) {
    if (!chart.dom.tooltip) {
      return;
    }
    clearTimeout(chart.runtime.tooltipHideTimer);
    const pointer = config.pointer || [0, 0];
    const title = config.title || {};
    const items = config.items || [];
    const accentColor = items.length === 1 && items[0].color ? items[0].color : null;
    chart.dom.tooltipTitle.style("border-left-color", accentColor || null).html("<span>" + sanitize(formatTooltipText(title)) + "</span>");
    const rows = chart.dom.tooltipBody.selectAll(".toolTipItem").data(items);
    rows.exit().remove();
    const rowsEnter = rows.enter().append("div").attr("class", "toolTipItem");
    rowsEnter.append("span").attr("class", "dot");
    rowsEnter.append("span").attr("class", "toolTipLabel");
    rowsEnter.append("span").attr("class", "toolTipValue");
    rowsEnter.merge(rows).select(".dot").style("background-color", function(d) {
      return d.color || "transparent";
    });
    rowsEnter.merge(rows).select(".toolTipLabel").text(function(d) {
      return d.label || "";
    });
    rowsEnter.merge(rows).select(".toolTipValue").text(function(d) {
      return formatTooltipText(d);
    });
    chart.dom.tooltip.style("display", "inline-block").style("opacity", 1).attr("aria-hidden", "false");
    positionTooltip(chart, pointer);
  }
  function hideChartTooltip(chart) {
    if (!chart.dom.tooltip) {
      return;
    }
    clearTimeout(chart.runtime.tooltipHideTimer);
    chart.runtime.tooltipHideTimer = window.setTimeout(function() {
      chart.dom.tooltip.style("display", "none").style("opacity", 0).attr("aria-hidden", "true");
    }, 300);
  }
  function formatTooltipText(config) {
    if (config == null) {
      return "";
    }
    if (typeof config === "string") {
      return config;
    }
    const format = typeof config.format === "function" ? config.format : function(value) {
      return value;
    };
    const text = config.text != null ? config.text : config.value;
    return text == null ? "" : format(text);
  }
  function positionTooltip(chart, pointer) {
    const containerRect = chart.dom.element.getBoundingClientRect();
    const tooltipNode = chart.dom.tooltip.node();
    chart.dom.tooltip.style("left", pointer[0] + 12 + "px").style("top", pointer[1] + 12 + "px");
    const tooltipRect = tooltipNode.getBoundingClientRect();
    let left = pointer[0] + 12;
    let top = pointer[1] + 12;
    if (left + tooltipRect.width > containerRect.width) {
      left = Math.max(8, pointer[0] - tooltipRect.width - 12);
    }
    if (top + tooltipRect.height > containerRect.height) {
      top = Math.max(8, pointer[1] - tooltipRect.height - 12);
    }
    chart.dom.tooltip.style("left", left + "px").style("top", top + "px");
  }

  // inst/htmlwidgets/myIO/src/interactions/rollover.js
  var HOVER_TRANSITION_MS = 300;
  function bindRollover(chart, layers) {
    var lys = layers || chart.currentLayers || [];
    var that = chart;
    var exclusions = ["text", "yearMon"];
    var xFormat = exclusions.indexOf(chart.options.xAxisFormat) > -1 ? function(x) {
      return x;
    } : d3.format(chart.options.xAxisFormat || "");
    var yFormat = d3.format(chart.options.yAxisFormat || "");
    var currentFormatY = chart.newScaleY ? d3.format(chart.newScaleY) : yFormat;
    removeHoverOverlay(chart);
    lys.forEach(function(layer) {
      if (["bar", "point", "hexbin", "histogram", "calendarHeatmap"].indexOf(layer.type) > -1) {
        bindElementLayer(layer);
      }
    });
    if (lys.some(function(layer) {
      return layer.type === "groupedBar";
    })) {
      chart.chart.selectAll(".tag-grouped-bar-g rect").on("mouseout", clearGroupedBar).on("mouseover", showGroupedBar).on("mousemove", showGroupedBar).on("touchstart", function(event) {
        event.preventDefault();
        showGroupedBar.call(this, event);
      }).on("touchmove", function(event) {
        event.preventDefault();
        showGroupedBar.call(this, event);
      }).on("touchend", clearGroupedBar);
    }
    if (lys.length > 0 && lys.every(function(layer) {
      return ["line", "area"].indexOf(layer.type) > -1;
    })) {
      createHoverOverlay(chart, showOverlayTooltip, clearOverlayTooltip);
    }
    if (lys.some(function(layer) {
      return layer.type === "donut";
    })) {
      bindOrdinalHover(".donut", "donut", function(d, layer) {
        return {
          title: { text: layer.mapping.x_var + ": " + d.data[layer.mapping.x_var] },
          items: [{
            color: chart.colorDiscrete(d.index),
            label: layer.mapping.y_var,
            value: d.data[layer.mapping.y_var]
          }]
        };
      });
    }
    if (lys.some(function(layer) {
      return layer.type === "treemap";
    })) {
      chart.chart.selectAll(".root").on("mouseout", clearTreemap).on("mouseover", showTreemap).on("mousemove", showTreemap).on("touchstart", function(event) {
        event.preventDefault();
        showTreemap.call(this, event);
      }).on("touchmove", function(event) {
        event.preventDefault();
        showTreemap.call(this, event);
      }).on("touchend", clearTreemap);
    }
    function bindElementLayer(layer) {
      var renderer = getRendererForLayer(layer);
      var selector = renderer.getHoverSelector ? renderer.getHoverSelector(chart, layer) : "." + tagName(layer.type, chart.element.id, layer.label);
      chart.chart.selectAll(selector).on("mouseout", function() {
        clearElementHover.call(this, layer);
      }).on("mouseover", function(event) {
        showElementHover.call(this, event, layer);
      }).on("mousemove", function(event) {
        showElementHover.call(this, event, layer);
      }).on("touchstart", function(event) {
        event.preventDefault();
        showElementHover.call(this, event, layer);
      }).on("touchmove", function(event) {
        event.preventDefault();
        showElementHover.call(this, event, layer);
      }).on("touchend", function() {
        clearElementHover.call(this, layer);
      });
    }
    function showElementHover(event, layer) {
      var data = d3.select(this).data()[0];
      var renderer = getRendererForLayer(layer);
      var tooltip = buildTooltip(layer, renderer, data, this);
      if (HTMLWidgets.shinyMode) {
        Shiny.onInputChange("myIO-" + that.element.id + "-rollover", JSON.stringify(data));
      }
      applyElementHighlight(this, layer, data);
      showChartTooltip(that, {
        pointer: getContainerPointer(event),
        title: tooltip.title,
        items: tooltip.items
      });
      var xValue = layer.type === "hexbin" ? that.xScale ? that.xScale.invert(data.x) : null : layer.type === "histogram" ? data.x0 : layer.type === "calendarHeatmap" ? data.date instanceof Date ? data.date : /* @__PURE__ */ new Date(data[layer.mapping.date] + "T00:00:00Z") : data[layer.mapping.x_var];
      maybeEmitCursor(that, data, xValue, tooltip);
    }
    function clearElementHover(layer) {
      removeElementHighlight(this, layer);
      hideChartTooltip(that);
      maybeClearCursor(that);
    }
    function buildTooltip(layer, renderer, data, node) {
      if (layer.type === "hexbin") {
        var pointFormat = d3.format(",.2f");
        return {
          title: { text: "x: " + pointFormat(that.xScale.invert(data.x)) + ", y: " + pointFormat(that.yScale.invert(data.y)) },
          items: [{ color: d3.select(node).attr("fill"), label: "Count", value: data.length }]
        };
      }
      if (layer.type === "histogram") {
        return {
          title: { text: "Bin: " + data.x0 + " to " + data.x1 },
          items: [{ color: d3.select(node).attr("fill"), label: "Count", value: data.length }]
        };
      }
      if (layer.type === "calendarHeatmap") {
        var calFormatted = renderer.formatTooltip(that, data, layer);
        return {
          title: { text: typeof calFormatted.title === "string" ? calFormatted.title : calFormatted.title.text },
          items: [{
            color: calFormatted.color || d3.select(node).attr("fill"),
            label: calFormatted.label || layer.label,
            value: calFormatted.value
          }]
        };
      }
      var titleText = layer.mapping.x_var + ": " + xFormat(data[layer.mapping.x_var]);
      var yKey = that.newY ? that.newY : layer.mapping.y_var;
      var label = layer.type === "point" || layer.type === "bar" ? layer.mapping.y_var : layer.label;
      var color = resolveColor(that, layer.label, layer.color);
      if (renderer && typeof renderer.formatTooltip === "function") {
        var formatted = renderer.formatTooltip(that, data, layer);
        titleText = formatted.title || titleText;
        label = formatted.label || label;
        color = formatted.color || color;
      }
      return {
        title: { text: titleText },
        items: [{ color, label, value: currentFormatY(data[yKey]) }]
      };
    }
    function applyElementHighlight(node, layer) {
      var selection = d3.select(node);
      var color = layer.type === "hexbin" ? "#333" : selection.attr("fill") || selection.style("fill") || resolveColor(that, layer.label, layer.color);
      if (layer.type === "hexbin") {
        selection.style("stroke", color).style("stroke-width", "2px");
        return;
      }
      selection.interrupt().style("stroke", color).style("stroke-width", "2px").style("stroke-opacity", 0.8);
      if (layer.type === "point") {
        selection.attr("r", Math.max(+selection.attr("r") || 0, 6));
      }
    }
    function removeElementHighlight(node, layer) {
      var selection = d3.select(node);
      selection.interrupt().transition().duration(HOVER_TRANSITION_MS).style("stroke-width", "0px").style("stroke", "transparent").style("stroke-opacity", null);
      if (layer.type === "point") {
        selection.transition().duration(HOVER_TRANSITION_MS).attr("r", pointRadius(that));
      }
    }
    function showGroupedBar(event) {
      var data = d3.select(this).data()[0];
      var thisLayer = lys[data.idx];
      var color = resolveColor(that, thisLayer.label, thisLayer.color);
      if (HTMLWidgets.shinyMode) {
        Shiny.onInputChange("myIO-" + that.element.id + "-rollover", JSON.stringify(data.data.values));
      }
      d3.select(this).interrupt().style("stroke", color).style("stroke-width", "2px").style("stroke-opacity", 0.8);
      var groupedTooltip = {
        title: { text: thisLayer.mapping.x_var + ": " + xFormat(data.data[0]) },
        items: [{ color, label: thisLayer.mapping.y_var, value: currentFormatY(data[1] - data[0]) }]
      };
      showChartTooltip(that, {
        pointer: getContainerPointer(event),
        title: groupedTooltip.title,
        items: groupedTooltip.items
      });
      maybeEmitCursor(that, data.data, data.data[0], groupedTooltip);
    }
    function clearGroupedBar() {
      d3.select(this).interrupt().transition().duration(HOVER_TRANSITION_MS).style("stroke-width", "0px").style("stroke", "transparent").style("stroke-opacity", null);
      hideChartTooltip(that);
      maybeClearCursor(that);
    }
    function showOverlayTooltip(event) {
      var mouse = d3.pointer(event, this);
      var xPos = that.xScale.invert(mouse[0]);
      var tipText = [];
      var bisect = d3.bisector(function(d) {
        return +d[0];
      }).left;
      lys.forEach(function(layer) {
        var values = layer.data;
        var xVar = layer.mapping.x_var;
        var yVar = that.newY ? that.newY : layer.mapping.y_var || layer.mapping.high_y;
        var layerIndex = values.map(function(value) {
          return value[xVar];
        });
        var idx = bisect(layerIndex, xPos);
        var d0 = values[idx - 1];
        var d1 = values[idx];
        var v = !d0 ? d1 : !d1 ? d0 : xPos - d0[xVar] > d1[xVar] - xPos ? d1 : d0;
        if (!v) {
          return;
        }
        tipText.push({
          color: layer.color,
          label: layer.label,
          xVar,
          yVar,
          displayValue: v.density != null ? v.density : v[yVar],
          value: v
        });
      });
      if (tipText.length === 0) {
        clearOverlayTooltip();
        return;
      }
      if (HTMLWidgets.shinyMode) {
        Shiny.onInputChange("myIO-" + that.element.id + "-rollover", JSON.stringify(tipText.map(function(d) {
          return d.value;
        })));
      }
      var xValue = tipText[0].value[tipText[0].xVar];
      that.toolLine.style("stroke", "var(--chart-ref-line-color)").style("stroke-width", "1px").style("stroke-dasharray", "4,4").attr("x1", that.xScale(xValue)).attr("x2", that.xScale(xValue)).attr("y1", 0).attr("y2", that.height - (that.margin.top + that.margin.bottom));
      var points = that.toolPointLayer.selectAll("circle").data(tipText);
      points.exit().remove();
      points.enter().append("circle").attr("r", 4).merge(points).attr("cx", function(d) {
        return that.xScale(d.value[d.xVar]);
      }).attr("cy", function(d) {
        return that.yScale(d.value[d.yVar]);
      }).attr("fill", "#ffffff").attr("stroke", function(d) {
        return d.color;
      }).attr("stroke-width", 2);
      var overlayTooltip = {
        title: { text: tipText[0].xVar + ": " + xFormat(xValue) },
        items: tipText.map(function(d) {
          return { color: d.color, label: d.label, value: currentFormatY(d.displayValue) };
        })
      };
      showChartTooltip(that, {
        pointer: getContainerPointer(event),
        title: overlayTooltip.title,
        items: overlayTooltip.items
      });
      maybeEmitCursor(that, tipText[0].value, xValue, overlayTooltip);
    }
    function clearOverlayTooltip() {
      if (that.toolLine) {
        that.toolLine.style("stroke", "none");
      }
      if (that.toolPointLayer) {
        that.toolPointLayer.selectAll("*").remove();
      }
      hideChartTooltip(that);
      maybeClearCursor(that);
    }
    function bindOrdinalHover(selector, layerType, tooltipBuilder) {
      var layer = lys.filter(function(candidate) {
        return candidate.type === layerType;
      })[0];
      chart.chart.selectAll(selector).on("mouseout", function() {
        chart.chart.selectAll(selector).transition().duration(HOVER_TRANSITION_MS).style("opacity", 1);
        hideChartTooltip(that);
      }).on("mouseover", function(event, d) {
        chart.chart.selectAll(selector).style("opacity", 0.4);
        d3.select(this).style("opacity", 0.85);
        var tooltip = tooltipBuilder(d, layer);
        showChartTooltip(that, { pointer: getContainerPointer(event), title: tooltip.title, items: tooltip.items });
      }).on("mousemove", function(event, d) {
        var tooltip = tooltipBuilder(d, layer);
        showChartTooltip(that, { pointer: getContainerPointer(event), title: tooltip.title, items: tooltip.items });
      }).on("touchstart", function(event, d) {
        event.preventDefault();
        chart.chart.selectAll(selector).style("opacity", 0.4);
        d3.select(this).style("opacity", 0.85);
        var tooltip = tooltipBuilder(d, layer);
        showChartTooltip(that, { pointer: getContainerPointer(event), title: tooltip.title, items: tooltip.items });
      }).on("touchend", function() {
        chart.chart.selectAll(selector).transition().duration(HOVER_TRANSITION_MS).style("opacity", 1);
        hideChartTooltip(that);
      });
    }
    function showTreemap(event, d) {
      var layer = lys.filter(function(candidate) {
        return candidate.type === "treemap";
      })[0];
      var colorNode = d;
      while (colorNode.depth > 1) {
        colorNode = colorNode.parent;
      }
      chart.chart.selectAll(".root").style("opacity", 0.4);
      d3.select(this).style("opacity", 0.85);
      showChartTooltip(that, {
        pointer: getContainerPointer(event),
        title: { text: layer.mapping.level_1 + ": " + d.data[layer.mapping.level_1] },
        items: [{
          color: chart.colorDiscrete(colorNode.data.id),
          label: d.data[layer.mapping.level_2],
          value: d.value
        }]
      });
    }
    function clearTreemap() {
      chart.chart.selectAll(".root").transition().duration(HOVER_TRANSITION_MS).style("opacity", 1);
      hideChartTooltip(that);
    }
    function getContainerPointer(event) {
      return d3.pointer(event, that.dom.element);
    }
  }

  // inst/htmlwidgets/myIO/src/derive/scales.js
  var X_DOMAIN_BUFFER = 0.05;
  var Y_DOMAIN_BUFFER = 0.15;
  function createBins(chart, lys) {
    var m = chart.margin;
    var chartHeight = getChartHeight(chart);
    var x_extents = [];
    lys.forEach(function(d) {
      var x2 = d3.extent(d.data, function(e) {
        return +e[d.mapping.value];
      });
      x_extents.push(x2);
    });
    var x_min = d3.min(x_extents, function(d) {
      return d[0];
    });
    var x_max = d3.max(x_extents, function(d) {
      return d[1];
    });
    var x = d3.scaleLinear().domain([x_min, x_max]).nice().range([0, chart.width - (m.left + m.right)]);
    lys.forEach(function(d) {
      var values = d.data.map(function(e) {
        return e[d.mapping.value];
      });
      d.bins = d3.bin().domain(x.domain()).thresholds(x.ticks(d.mapping.bins))(values);
      d.max_value = d3.max(d.bins, function(bin) {
        return bin.length;
      });
    });
    chart.derived.xScale = x;
    chart.derived.yScale = d3.scaleLinear().domain([0, d3.max(lys, function(d) {
      return d.max_value;
    })]).nice().range([chartHeight - (m.top + m.bottom), 0]);
  }
  function processScales(chart, lys, semantics) {
    var m = chart.margin;
    var x_extents = [];
    var y_extents = [];
    var x_bands = [];
    var y_bands = [];
    var scaleSemantics = semantics || {};
    var globalXExtentFields = scaleSemantics.xExtentFields || ["x_var"];
    var yExtentFields = scaleSemantics.yExtentFields || ["y_var"];
    var scaleLayers = lys.filter(function(layer) {
      var hints = layer.scaleHints;
      if (hints && Array.isArray(hints.xExtentFields) && hints.xExtentFields.length === 0 && Array.isArray(hints.yExtentFields) && hints.yExtentFields.length === 0) {
        return false;
      }
      return true;
    });
    scaleLayers.forEach(function(d) {
      var layerXFields = d.scaleHints && Array.isArray(d.scaleHints.xExtentFields) ? d.scaleHints.xExtentFields : globalXExtentFields;
      var xValues = [];
      layerXFields.forEach(function(field) {
        var dataField = d.mapping[field] || field;
        var values = d.data.map(function(e) {
          return +e[dataField];
        });
        xValues = xValues.concat(values);
      });
      var xLayerExtent = d3.extent(xValues.length > 0 ? xValues : [0]);
      var layerYFields = d.scaleHints && Array.isArray(d.scaleHints.yExtentFields) ? d.scaleHints.yExtentFields : yExtentFields;
      var yValues = [];
      layerYFields.forEach(function(field) {
        var dataField = d.mapping[field] || field;
        var values = d.data.map(function(e) {
          return +e[dataField];
        });
        yValues = yValues.concat(values);
      });
      var yExtent2 = d3.extent(yValues.length > 0 ? yValues : [0], function(e) {
        return e;
      });
      x_extents.push(xLayerExtent);
      y_extents.push([
        yExtent2[0],
        yExtent2[1]
      ]);
      var x_var = d.mapping.x_var;
      x_bands.push(d.data.map(function(e) {
        return e[x_var];
      }));
      y_bands.push(d.data.map(function(e) {
        var dataField = d.mapping.y_var || "y_var";
        return e[dataField];
      }));
    });
    var x_min = d3.min(x_extents, function(d) {
      return d[0];
    });
    var x_max = d3.max(x_extents, function(d) {
      return d[1];
    });
    var x_check1 = d3.min(x_extents, function(d) {
      return d[0];
    });
    var x_check2 = d3.max(x_extents, function(d) {
      return d[1];
    });
    chart.derived.xCheck = x_check1 === 0 && x_check2 === 0;
    if (x_min == x_max) {
      x_min = x_min - 1;
      x_max = x_max + 1;
    }
    var x_buffer = Math.max(Math.abs(x_max - x_min) * X_DOMAIN_BUFFER, 0.5);
    var xExtent = [
      chart.config.scales.xlim.min ? +chart.config.scales.xlim.min : x_min - x_buffer,
      chart.config.scales.xlim.max ? +chart.config.scales.xlim.max : x_max + x_buffer
    ];
    chart.derived.xBanded = [].concat.apply([], x_bands).map(function(d) {
      try {
        return Array.isArray(d) ? d[0] : d;
      } catch (err) {
        return void 0;
      }
    }).filter(onlyUnique);
    var y_min = d3.min(y_extents, function(d) {
      return d[0];
    });
    var y_max = d3.max(y_extents, function(d) {
      return d[1];
    });
    if (y_min == y_max) {
      y_min = y_min - 1;
      y_max = y_max + 1;
    }
    var y_buffer = Math.abs(y_max - y_min) * Y_DOMAIN_BUFFER;
    var yExtent = [
      chart.config.scales.ylim.min ? +chart.config.scales.ylim.min : y_min - y_buffer,
      chart.config.scales.ylim.max ? +chart.config.scales.ylim.max : y_max + y_buffer
    ];
    chart.derived.yBanded = [].concat.apply([], y_bands).map(function(d) {
      try {
        return Array.isArray(d) ? d[0] : d;
      } catch (err) {
        return void 0;
      }
    }).filter(onlyUnique);
    var chartHeight = getChartHeight(chart);
    switch (scaleSemantics.xScaleType) {
      case "band":
        chart.derived.xScale = d3.scaleBand().range([0, chart.width - (m.left + m.right)]).domain(chart.config.scales.flipAxis === true ? chart.derived.yBanded : chart.derived.xBanded);
        break;
      default:
        chart.derived.xScale = d3.scaleLinear().range([0, chart.width - (m.right + m.left)]).domain(chart.config.scales.flipAxis === true ? yExtent : xExtent);
    }
    switch (scaleSemantics.yScaleType) {
      case "band":
        chart.derived.yScale = d3.scaleBand().range([chartHeight - (m.top + m.bottom), 0]).domain(chart.config.scales.flipAxis === true ? chart.derived.xBanded : chart.derived.yBanded);
        break;
      default:
        chart.derived.yScale = d3.scaleLinear().range([chartHeight - (m.top + m.bottom), 0]).domain(chart.config.scales.flipAxis === true ? xExtent : yExtent);
    }
    if (chart.config.scales.colorScheme && chart.config.scales.colorScheme.enabled) {
      chart.derived.colorDiscrete = d3.scaleOrdinal().range(chart.config.scales.colorScheme.colors).domain(chart.config.scales.colorScheme.domain);
      chart.derived.colorContinuous = d3.scaleLinear().range(chart.config.scales.colorScheme.colors).domain(chart.config.scales.colorScheme.domain);
    }
    chart.syncLegacyAliases();
  }
  function onlyUnique(value, index, self2) {
    return self2.indexOf(value) === index;
  }

  // inst/htmlwidgets/myIO/src/derive/scale-semantics.js
  var DEFAULT_SCALE_HINTS = {
    xScaleType: "linear",
    yScaleType: "linear",
    xExtentFields: ["x_var"],
    yExtentFields: ["y_var"],
    domainMerge: "union"
  };
  function normalizeHints(hints) {
    if (!hints) {
      return null;
    }
    return Object.assign({}, DEFAULT_SCALE_HINTS, hints);
  }
  function getScaleHintsForLayer(layer) {
    if (layer && layer.scaleHints) {
      return normalizeHints(layer.scaleHints);
    }
    try {
      var renderer = getRendererForLayer(layer);
      return normalizeHints(renderer.constructor.scaleHints);
    } catch (err) {
      return null;
    }
  }
  function resolveFallbackScaleType(chart, axis) {
    var categoricalScale = chart && chart.config && chart.config.scales && chart.config.scales.categoricalScale;
    if (categoricalScale && categoricalScale[axis + "Axis"] === true) {
      return "band";
    }
    return "linear";
  }
  function resolveScaleSemantics(chart, layers) {
    var flipAxis = !!(chart && chart.config && chart.config.scales && chart.config.scales.flipAxis);
    var xTypes = /* @__PURE__ */ new Set();
    var yTypes = /* @__PURE__ */ new Set();
    var xExtentFields = /* @__PURE__ */ new Set();
    var yExtentFields = /* @__PURE__ */ new Set();
    var domainMerge = "union";
    (layers || []).forEach(function(layer) {
      var hints = getScaleHintsForLayer(layer);
      var fallbackX = resolveFallbackScaleType(chart, "x");
      var fallbackY = resolveFallbackScaleType(chart, "y");
      var xType = hints ? hints.xScaleType : fallbackX;
      var yType = hints ? hints.yScaleType : fallbackY;
      var resolvedX = flipAxis ? yType : xType;
      var resolvedY = flipAxis ? xType : yType;
      if (!flipAxis) {
        if (fallbackX === "band") {
          resolvedX = "band";
        }
        if (fallbackY === "band") {
          resolvedY = "band";
        }
      }
      xTypes.add(resolvedX);
      yTypes.add(resolvedY);
      var xFields = hints && Array.isArray(hints.xExtentFields) ? hints.xExtentFields : DEFAULT_SCALE_HINTS.xExtentFields;
      xFields.forEach(function(field) {
        xExtentFields.add(field);
      });
      var fields = hints && Array.isArray(hints.yExtentFields) ? hints.yExtentFields : DEFAULT_SCALE_HINTS.yExtentFields;
      fields.forEach(function(field) {
        yExtentFields.add(field);
      });
      if (hints && hints.domainMerge === "independent") {
        domainMerge = "independent";
      }
    });
    if (xTypes.size > 1 || yTypes.size > 1) {
      throw new Error(
        "Mismatched scaleTypes across layers: x=" + Array.from(xTypes).join(", ") + ", y=" + Array.from(yTypes).join(", ") + "."
      );
    }
    return {
      xScaleType: xTypes.size > 0 ? Array.from(xTypes)[0] : resolveFallbackScaleType(chart, "x"),
      yScaleType: yTypes.size > 0 ? Array.from(yTypes)[0] : resolveFallbackScaleType(chart, "y"),
      xExtentFields: Array.from(xExtentFields).length > 0 ? Array.from(xExtentFields) : DEFAULT_SCALE_HINTS.xExtentFields,
      yExtentFields: Array.from(yExtentFields).length > 0 ? Array.from(yExtentFields) : DEFAULT_SCALE_HINTS.yExtentFields,
      domainMerge
    };
  }

  // inst/htmlwidgets/myIO/src/derive/chart-render.js
  function deriveChartRender(chart) {
    var layers = chart.derived.currentLayers || [];
    var traits = layers.map(function(layer) {
      return getRendererForLayer(layer).constructor.traits;
    });
    var primaryType = layers[0] ? layers[0].type : null;
    var legendTypes = Array.from(new Set(traits.map(function(trait) {
      return trait.legendType;
    })));
    return {
      type: primaryType,
      axesChart: traits.some(function(trait) {
        return trait.hasAxes;
      }),
      histogram: traits.length > 0 && traits.every(function(trait) {
        return trait.binning;
      }),
      continuousLegend: legendTypes.length === 1 && legendTypes[0] === "continuous",
      ordinalLegend: legendTypes.length === 1 && legendTypes[0] === "ordinal",
      referenceLines: traits.some(function(trait) {
        return trait.referenceLines;
      })
    };
  }
  function applyDerivedScales(chart, renderState) {
    if (!renderState.axesChart) {
      return;
    }
    if (renderState.histogram) {
      createBins(chart, chart.derived.currentLayers);
    } else {
      var semantics = resolveScaleSemantics(chart, chart.derived.currentLayers);
      processScales(chart, chart.derived.currentLayers, semantics);
    }
  }

  // inst/htmlwidgets/myIO/src/derive/validate.js
  var COMPAT_GROUP = {
    line: "axes-continuous",
    point: "axes-continuous",
    area: "axes-continuous",
    bar: "axes-categorical",
    groupedBar: "axes-categorical",
    boxplot: "axes-categorical",
    violin: "axes-categorical",
    histogram: "axes-binned",
    heatmap: "axes-matrix",
    candlestick: "axes-continuous",
    waterfall: "axes-categorical",
    ridgeline: "axes-binned",
    rangeBar: "axes-continuous",
    sankey: "standalone-flow",
    hexbin: "axes-hex",
    treemap: "standalone-treemap",
    donut: "standalone-donut",
    gauge: "standalone-gauge",
    text: "axes-continuous",
    regression: "axes-continuous",
    bracket: "axes-continuous",
    comparison: "axes-categorical",
    qq: "axes-continuous",
    lollipop: "axes-categorical",
    dumbbell: "axes-categorical",
    waffle: "standalone-waffle",
    beeswarm: "axes-continuous",
    bump: "axes-continuous",
    survfit: "axes-continuous",
    histogram_fit: "axes-binned",
    quantile_dots: "axes-categorical",
    radar: "standalone-radar",
    funnel: "standalone-funnel",
    parallel: "standalone-parallel",
    calendarHeatmap: "standalone-calendar",
    fan: "axes-continuous"
  };
  var CROSS_GROUP_ALLOWED = /* @__PURE__ */ new Set([
    "axes-continuous:axes-categorical",
    "axes-categorical:axes-continuous",
    "axes-binned:axes-continuous",
    "axes-continuous:axes-binned"
  ]);
  function validateComposition(layers) {
    if (layers.length <= 1) return { valid: true, errors: [] };
    const errors = [];
    const groups = layers.map(function(layer) {
      return COMPAT_GROUP[layer.type] || "unknown";
    });
    const standalone = groups.filter(function(group) {
      return group.startsWith("standalone");
    });
    if (standalone.length > 0 && layers.length > 1) {
      errors.push("Cannot mix standalone chart types with other layers.");
    }
    if (standalone.length > 1) {
      errors.push("Standalone chart types must be used alone.");
    }
    const uniqueGroups = Array.from(new Set(groups));
    if (uniqueGroups.length > 1) {
      uniqueGroups.forEach(function(group, index) {
        uniqueGroups.slice(index + 1).forEach(function(other) {
          if (!CROSS_GROUP_ALLOWED.has(group + ":" + other)) {
            errors.push("Cannot mix layer groups '" + group + "' and '" + other + "'.");
          }
        });
      });
    }
    return { valid: errors.length === 0, errors };
  }
  function validateAgainstContract(layer, contract) {
    const errors = [];
    const warnings = [];
    if (!contract) {
      return { errors, warnings };
    }
    Object.entries(contract).forEach(function(entry) {
      const field = entry[0];
      const rules = entry[1];
      const mapped = layer.mapping ? layer.mapping[field] : null;
      if (rules.required && !mapped) {
        errors.push("Layer '" + layer.label + "' is missing required mapping '" + field + "'.");
        return;
      }
      if (!mapped) {
        return;
      }
      const values = Array.isArray(layer.data) ? typeof mapped === "string" ? layer.data.map(function(row) {
        return row[mapped];
      }) : layer.data.map(function() {
        return mapped;
      }) : [];
      if (rules.numeric) {
        const invalid = values.find(function(value) {
          return Number.isNaN(+value);
        });
        if (invalid !== void 0) {
          errors.push("Layer '" + layer.label + "' field '" + mapped + "' must be numeric.");
        }
      }
      if (rules.positive) {
        const invalid = values.find(function(value) {
          return +value <= 0;
        });
        if (invalid !== void 0) {
          errors.push("Layer '" + layer.label + "' field '" + mapped + "' must be positive.");
        }
      }
      if (rules.sorted) {
        for (let i = 1; i < values.length; i += 1) {
          if (+values[i] < +values[i - 1]) {
            warnings.push("Layer '" + layer.label + "' field '" + mapped + "' is not sorted.");
            break;
          }
        }
      }
      if (rules.unique && new Set(values).size !== values.length) {
        warnings.push("Layer '" + layer.label + "' field '" + mapped + "' contains duplicate values.");
      }
      const nullCount = values.filter(function(value) {
        return value === null || value === void 0 || Number.isNaN(value);
      }).length;
      if (nullCount > 0) {
        warnings.push("Layer '" + layer.label + "' field '" + mapped + "' contains " + nullCount + " null/NaN values.");
      }
    });
    return { errors, warnings };
  }
  function validateLayers(chart) {
    const layers = chart.derived.currentLayers || chart.config.layers || [];
    const composition = validateComposition(layers);
    if (!composition.valid) {
      composition.errors.forEach(function(message) {
        console.warn("[myIO] Composition error:", message);
        chart.emit("error", { message });
      });
      return [];
    }
    return layers.filter(function(layer) {
      const renderer = getRendererForLayer(layer);
      const contract = renderer.constructor.dataContract;
      const result = validateAgainstContract(layer, contract);
      result.warnings.forEach(function(message) {
        console.warn("[myIO]", message);
      });
      if (result.errors.length > 0) {
        result.errors.forEach(function(message) {
          console.warn("[myIO] Layer '" + layer.label + "' removed:", message);
          chart.emit("error", { message, layer });
        });
        return false;
      }
      return true;
    });
  }

  // inst/htmlwidgets/myIO/src/layout/reference-lines.js
  function syncReferenceLines(chart, state) {
    if (!state.referenceLines) {
      return;
    }
    updateReferenceLines(chart);
  }
  function updateReferenceLines(chart) {
    var m = chart.margin;
    var transitionSpeed = chart.options.transition.speed;
    var xRef = [chart.options.referenceLine.x];
    var yRef = [chart.options.referenceLine.y];
    if (chart.options.referenceLine.x) {
      var xRefLine = chart.plot.selectAll(".ref-x-line").data(xRef);
      xRefLine.exit().transition().duration(100).style("opacity", 0).attr("y2", chart.height - (m.top + m.bottom)).remove();
      var newxRef = xRefLine.enter().append("line").attr("class", "ref-x-line").attr("fill", "none").style("stroke", "gray").style("stroke-width", 3).attr("x1", function(d) {
        return chart.xScale(d);
      }).attr("x2", function(d) {
        return chart.xScale(d);
      }).attr("y1", chart.height - (m.top + m.bottom)).attr("y2", chart.height - (m.top + m.bottom)).transition().ease(d3.easeQuad).duration(transitionSpeed).attr("y2", 0);
      xRefLine.merge(newxRef).transition().ease(d3.easeQuad).duration(transitionSpeed).attr("x1", function(d) {
        return chart.xScale(d);
      }).attr("x2", function(d) {
        return chart.xScale(d);
      }).attr("y1", chart.height - (m.top + m.bottom)).attr("y2", 0);
    } else {
      chart.plot.selectAll(".ref-x-line").remove();
    }
    if (chart.options.referenceLine.y) {
      var yRefLine = chart.plot.selectAll(".ref-y-line").data(yRef);
      yRefLine.exit().transition().duration(100).attr("y2", chart.width - (m.left + m.right)).style("opacity", 0).remove();
      var newyRef = yRefLine.enter().append("line").attr("class", "ref-y-line").attr("fill", "none").style("stroke", "gray").style("stroke-width", 3).attr("x1", 0).attr("x2", 0).attr("y1", function(d) {
        return chart.yScale(d);
      }).attr("y2", function(d) {
        return chart.yScale(d);
      }).transition().ease(d3.easeQuad).duration(transitionSpeed).attr("x2", chart.width - (m.left + m.right));
      yRefLine.merge(newyRef).transition().ease(d3.easeQuad).duration(transitionSpeed).attr("x1", 0).attr("x2", chart.width - (m.left + m.right)).attr("y1", function(d) {
        return chart.yScale(d);
      }).attr("y2", function(d) {
        return chart.yScale(d);
      });
    } else {
      chart.plot.selectAll(".ref-y-line").remove();
    }
  }

  // inst/htmlwidgets/myIO/src/utils/math.js
  function linearRegression(data, yVar, xVar) {
    const x = data.map(function(d) {
      return d[xVar];
    });
    const y = data.map(function(d) {
      return d[yVar];
    });
    const lr = {};
    const n = y.length;
    let sum_x = 0;
    let sum_y = 0;
    let sum_xy = 0;
    let sum_xx = 0;
    let sum_yy = 0;
    for (let i = 0; i < y.length; i++) {
      sum_x += x[i];
      sum_y += y[i];
      sum_xy += x[i] * y[i];
      sum_xx += x[i] * x[i];
      sum_yy += y[i] * y[i];
    }
    lr.slope = (n * sum_xy - sum_x * sum_y) / (n * sum_xx - sum_x * sum_x);
    lr.intercept = (sum_y - lr.slope * sum_x) / n;
    lr.r2 = Math.pow(
      (n * sum_xy - sum_x * sum_y) / Math.sqrt((n * sum_xx - sum_x * sum_x) * (n * sum_yy - sum_y * sum_y)),
      2
    );
    lr.fn = function(xValue) {
      return this.slope * xValue + this.intercept;
    };
    return lr;
  }

  // inst/htmlwidgets/myIO/src/theme/palettes.js
  var LIGHT = {
    "--chart-text-color": "#6b7280",
    "--chart-grid-color": "#9ca3af",
    "--chart-grid-opacity": "0.4",
    "--chart-bg": "#ffffff",
    "--chart-tooltip-bg": "#ffffff",
    "--chart-tooltip-border": "#e5e7eb",
    "--chart-tooltip-shadow": "0 4px 12px rgba(0, 0, 0, 0.12)",
    "--chart-button-color": "#6b7280",
    "--chart-button-hover-bg": "rgba(107, 114, 128, 0.1)",
    "--chart-sheet-bg": "#ffffff",
    "--chart-sheet-border": "rgba(17, 24, 39, 0.1)",
    "--chart-sheet-shadow": "0 20px 45px rgba(15, 23, 42, 0.18)",
    "--chart-sheet-backdrop": "rgba(15, 23, 42, 0.32)",
    "--chart-sheet-surface": "rgba(243, 244, 246, 0.9)",
    "--chart-sheet-accent": "#111827",
    "--chart-brush-fill": "rgba(0, 0, 0, 0.08)",
    "--chart-brush-stroke": "#6b7280",
    "--chart-status-bar-bg": "#f9fafb",
    "--chart-slider-track": "#e5e7eb",
    "--chart-ref-line-color": "#9ca3af",
    "--chart-annotation-ring": "#E63946"
  };
  var DARK = {
    "--chart-text-color": "#d1d5db",
    "--chart-grid-color": "#4b5563",
    "--chart-grid-opacity": "0.5",
    "--chart-bg": "#1e1e2e",
    "--chart-tooltip-bg": "#2d2d44",
    "--chart-tooltip-border": "#3f3f5c",
    "--chart-tooltip-shadow": "0 4px 12px rgba(0, 0, 0, 0.4)",
    "--chart-button-color": "#9ca3af",
    "--chart-button-hover-bg": "rgba(156, 163, 175, 0.15)",
    "--chart-sheet-bg": "#2d2d44",
    "--chart-sheet-border": "rgba(255, 255, 255, 0.1)",
    "--chart-sheet-shadow": "0 20px 45px rgba(0, 0, 0, 0.5)",
    "--chart-sheet-backdrop": "rgba(0, 0, 0, 0.6)",
    "--chart-sheet-surface": "rgba(45, 45, 68, 0.95)",
    "--chart-sheet-accent": "#f3f4f6",
    "--chart-brush-fill": "rgba(255, 255, 255, 0.08)",
    "--chart-brush-stroke": "#9ca3af",
    "--chart-status-bar-bg": "#252540",
    "--chart-slider-track": "#3f3f5c",
    "--chart-ref-line-color": "#4b5563",
    "--chart-annotation-ring": "#ff6b6b"
  };
  var PRESETS = {
    light: LIGHT,
    dark: DARK,
    midnight: { "--chart-bg": "#0f172a", "--chart-text-color": "#e2e8f0", "--chart-grid-color": "#334155", "--chart-grid-opacity": "0.5", "--chart-tooltip-bg": "#1e293b", "--chart-tooltip-border": "#475569", "--chart-button-color": "#94a3b8", "--chart-sheet-bg": "#1e293b", "--chart-annotation-ring": "#f472b6", "--chart-ref-line-color": "#475569", "--chart-status-bar-bg": "#1e293b", "--chart-slider-track": "#334155", "--chart-brush-fill": "rgba(255,255,255,0.06)", "--chart-brush-stroke": "#64748b" },
    ocean: { "--chart-bg": "#0c4a6e", "--chart-text-color": "#e0f2fe", "--chart-grid-color": "#0369a1", "--chart-grid-opacity": "0.4", "--chart-tooltip-bg": "#075985", "--chart-tooltip-border": "#0284c7", "--chart-button-color": "#7dd3fc", "--chart-sheet-bg": "#075985", "--chart-annotation-ring": "#fbbf24", "--chart-ref-line-color": "#0284c7", "--chart-status-bar-bg": "#0c4a6e", "--chart-slider-track": "#0369a1", "--chart-brush-fill": "rgba(255,255,255,0.08)", "--chart-brush-stroke": "#38bdf8" },
    forest: { "--chart-bg": "#14532d", "--chart-text-color": "#dcfce7", "--chart-grid-color": "#166534", "--chart-grid-opacity": "0.4", "--chart-tooltip-bg": "#15803d", "--chart-tooltip-border": "#22c55e", "--chart-button-color": "#86efac", "--chart-sheet-bg": "#15803d", "--chart-annotation-ring": "#fbbf24", "--chart-ref-line-color": "#22c55e", "--chart-status-bar-bg": "#14532d", "--chart-slider-track": "#166534", "--chart-brush-fill": "rgba(255,255,255,0.08)", "--chart-brush-stroke": "#4ade80" },
    sunset: { "--chart-bg": "#fef3c7", "--chart-text-color": "#78350f", "--chart-grid-color": "#d97706", "--chart-grid-opacity": "0.3", "--chart-tooltip-bg": "#fffbeb", "--chart-tooltip-border": "#f59e0b", "--chart-button-color": "#92400e", "--chart-sheet-bg": "#fffbeb", "--chart-annotation-ring": "#dc2626", "--chart-ref-line-color": "#d97706", "--chart-status-bar-bg": "#fef3c7", "--chart-slider-track": "#fde68a", "--chart-brush-fill": "rgba(0,0,0,0.06)", "--chart-brush-stroke": "#b45309" },
    monochrome: { "--chart-bg": "#fafafa", "--chart-text-color": "#404040", "--chart-grid-color": "#a3a3a3", "--chart-grid-opacity": "0.3", "--chart-tooltip-bg": "#ffffff", "--chart-tooltip-border": "#d4d4d4", "--chart-button-color": "#737373", "--chart-sheet-bg": "#ffffff", "--chart-annotation-ring": "#404040", "--chart-ref-line-color": "#a3a3a3", "--chart-status-bar-bg": "#f5f5f5", "--chart-slider-track": "#d4d4d4", "--chart-brush-fill": "rgba(0,0,0,0.06)", "--chart-brush-stroke": "#737373" },
    neon: { "--chart-bg": "#09090b", "--chart-text-color": "#a1a1aa", "--chart-grid-color": "#27272a", "--chart-grid-opacity": "0.5", "--chart-tooltip-bg": "#18181b", "--chart-tooltip-border": "#3f3f46", "--chart-button-color": "#a1a1aa", "--chart-sheet-bg": "#18181b", "--chart-annotation-ring": "#22d3ee", "--chart-ref-line-color": "#3f3f46", "--chart-status-bar-bg": "#09090b", "--chart-slider-track": "#27272a", "--chart-brush-fill": "rgba(34,211,238,0.08)", "--chart-brush-stroke": "#22d3ee" },
    corporate: { "--chart-bg": "#ffffff", "--chart-text-color": "#1e3a5f", "--chart-grid-color": "#bfdbfe", "--chart-grid-opacity": "0.5", "--chart-tooltip-bg": "#f0f9ff", "--chart-tooltip-border": "#93c5fd", "--chart-button-color": "#1e40af", "--chart-sheet-bg": "#f0f9ff", "--chart-annotation-ring": "#dc2626", "--chart-ref-line-color": "#93c5fd", "--chart-status-bar-bg": "#f0f9ff", "--chart-slider-track": "#bfdbfe", "--chart-brush-fill": "rgba(30,64,175,0.06)", "--chart-brush-stroke": "#3b82f6" },
    academic: { "--chart-bg": "#fffbf0", "--chart-text-color": "#1c1917", "--chart-grid-color": "#d6d3d1", "--chart-grid-opacity": "0.4", "--chart-tooltip-bg": "#fafaf9", "--chart-tooltip-border": "#a8a29e", "--chart-button-color": "#57534e", "--chart-sheet-bg": "#fafaf9", "--chart-annotation-ring": "#b91c1c", "--chart-ref-line-color": "#a8a29e", "--chart-status-bar-bg": "#fffbf0", "--chart-slider-track": "#d6d3d1", "--chart-brush-fill": "rgba(0,0,0,0.04)", "--chart-brush-stroke": "#78716c" },
    nature: { "--chart-bg": "#fefce8", "--chart-text-color": "#365314", "--chart-grid-color": "#a3e635", "--chart-grid-opacity": "0.3", "--chart-tooltip-bg": "#f7fee7", "--chart-tooltip-border": "#84cc16", "--chart-button-color": "#4d7c0f", "--chart-sheet-bg": "#f7fee7", "--chart-annotation-ring": "#ea580c", "--chart-ref-line-color": "#84cc16", "--chart-status-bar-bg": "#fefce8", "--chart-slider-track": "#d9f99d", "--chart-brush-fill": "rgba(0,0,0,0.04)", "--chart-brush-stroke": "#65a30d" },
    minimal: { "--chart-bg": "#ffffff", "--chart-text-color": "#71717a", "--chart-grid-color": "#e4e4e7", "--chart-grid-opacity": "0.5", "--chart-tooltip-bg": "#ffffff", "--chart-tooltip-border": "#f4f4f5", "--chart-button-color": "#a1a1aa", "--chart-sheet-bg": "#ffffff", "--chart-annotation-ring": "#ef4444", "--chart-ref-line-color": "#e4e4e7", "--chart-status-bar-bg": "#fafafa", "--chart-slider-track": "#e4e4e7", "--chart-brush-fill": "rgba(0,0,0,0.03)", "--chart-brush-stroke": "#d4d4d8" },
    retro: { "--chart-bg": "#fdf6e3", "--chart-text-color": "#586e75", "--chart-grid-color": "#93a1a1", "--chart-grid-opacity": "0.3", "--chart-tooltip-bg": "#eee8d5", "--chart-tooltip-border": "#93a1a1", "--chart-button-color": "#657b83", "--chart-sheet-bg": "#eee8d5", "--chart-annotation-ring": "#dc322f", "--chart-ref-line-color": "#93a1a1", "--chart-status-bar-bg": "#fdf6e3", "--chart-slider-track": "#eee8d5", "--chart-brush-fill": "rgba(0,0,0,0.04)", "--chart-brush-stroke": "#839496" },
    warm: { "--chart-bg": "#fff7ed", "--chart-text-color": "#7c2d12", "--chart-grid-color": "#fed7aa", "--chart-grid-opacity": "0.4", "--chart-tooltip-bg": "#fffbeb", "--chart-tooltip-border": "#fdba74", "--chart-button-color": "#c2410c", "--chart-sheet-bg": "#fffbeb", "--chart-annotation-ring": "#b91c1c", "--chart-ref-line-color": "#fdba74", "--chart-status-bar-bg": "#fff7ed", "--chart-slider-track": "#fed7aa", "--chart-brush-fill": "rgba(194,65,12,0.06)", "--chart-brush-stroke": "#ea580c" }
  };

  // inst/htmlwidgets/myIO/src/theme/theme-manager.js
  function normalizeThemeValues(values) {
    if (!values || typeof values !== "object") {
      return {};
    }
    var normalized = {};
    for (var key of Object.keys(values)) {
      var cssKey = key.startsWith("--") ? key : "--" + key;
      normalized[cssKey] = values[key];
    }
    return normalized;
  }
  function normalizeThemeConfig(raw) {
    if (!raw || typeof raw !== "object") {
      return { mode: null, preset: null, values: {} };
    }
    if (!("mode" in raw) && !("preset" in raw) && !("values" in raw)) {
      return { mode: null, preset: null, values: normalizeThemeValues(raw) };
    }
    return {
      mode: raw.mode || null,
      preset: raw.preset || null,
      values: normalizeThemeValues(raw.values || {})
    };
  }
  var ThemeManager = class {
    constructor(element, config) {
      this.element = element;
      this.config = normalizeThemeConfig(config ? config.theme : null);
      this.currentMode = null;
      this.mutationObserver = null;
      this.mediaQuery = null;
      this._mediaHandler = null;
      this.listeners = [];
    }
    initialize() {
      var resolved = this.resolveMode();
      this.apply(resolved);
      if (this.config.mode === "auto") {
        this.startListening();
      }
    }
    resolveMode() {
      var mode = this.config.mode;
      if (mode === "light" || mode === "dark") {
        return mode;
      }
      if (mode === "auto") {
        return this.detectEnvironment();
      }
      return "light";
    }
    detectEnvironment() {
      var bsTheme = this.element.closest && this.element.closest("[data-bs-theme]");
      if (bsTheme) {
        return bsTheme.getAttribute("data-bs-theme") === "dark" ? "dark" : "light";
      }
      if (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches) {
        return "dark";
      }
      return "light";
    }
    apply(mode) {
      this.currentMode = mode;
      var palette = mode === "dark" ? DARK : LIGHT;
      if (this.config.preset && PRESETS[this.config.preset]) {
        palette = PRESETS[this.config.preset];
      }
      for (var prop of Object.keys(palette)) {
        this.element.style.setProperty(prop, palette[prop]);
      }
      if (this.config.values) {
        for (var key of Object.keys(this.config.values)) {
          this.element.style.setProperty(key, this.config.values[key]);
        }
      }
      this.element.dataset.theme = mode;
      for (var fn of this.listeners) {
        fn(mode);
      }
    }
    startListening() {
      var self2 = this;
      this.mutationObserver = new MutationObserver(function() {
        var newMode = self2.detectEnvironment();
        if (newMode !== self2.currentMode) {
          self2.apply(newMode);
        }
      });
      var body = document.body;
      if (body) {
        this.mutationObserver.observe(body, {
          attributes: true,
          attributeFilter: ["data-bs-theme"]
        });
      }
      if (window.matchMedia) {
        this.mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
        this._mediaHandler = function() {
          var newMode = self2.detectEnvironment();
          if (newMode !== self2.currentMode) {
            self2.apply(newMode);
          }
        };
        if (typeof this.mediaQuery.addEventListener === "function") {
          this.mediaQuery.addEventListener("change", this._mediaHandler);
        } else if (typeof this.mediaQuery.addListener === "function") {
          this.mediaQuery.addListener(this._mediaHandler);
        }
      }
    }
    onChange(fn) {
      this.listeners.push(fn);
    }
    destroy() {
      if (this.mutationObserver) {
        this.mutationObserver.disconnect();
      }
      if (this.mediaQuery && this._mediaHandler) {
        if (typeof this.mediaQuery.removeEventListener === "function") {
          this.mediaQuery.removeEventListener("change", this._mediaHandler);
        } else if (typeof this.mediaQuery.removeListener === "function") {
          this.mediaQuery.removeListener(this._mediaHandler);
        }
      }
      this.listeners = [];
    }
  };

  // inst/htmlwidgets/myIO/src/layout/facet-panel.js
  var FACET_PANEL_HEIGHT = 200;
  var FacetPanel = class {
    constructor(controller, facetValue, element, index, total) {
      this.controller = controller;
      this.facetValue = facetValue;
      this.element = element;
      this.index = index;
      this.total = total;
      this.layers = [];
      this.panelChart = null;
      this.suppressX = false;
      this.suppressY = false;
      if (!this.element.id) {
        this.element.id = controller.chart.dom.element.id + "-facet-panel-" + index;
      }
    }
    initialize(layers) {
      this.layers = layers || [];
      this.destroy();
      this.updateGridPosition();
      var labelPos = this.controller.config.labelPosition || "top";
      if (labelPos === "top") {
        this.addLabel();
      }
      if (this.hasPanelData()) {
        this.renderPanel();
      } else {
        this.renderEmptyPanel();
      }
      if (labelPos === "bottom") {
        this.addLabel();
      }
    }
    updateGridPosition() {
      var ncol = this.getColumnCount();
      var lastRow = Math.floor((this.total - 1) / ncol);
      var gridRow = Math.floor(this.index / ncol);
      var gridCol = this.index % ncol;
      this.suppressX = this.controller.config.scales === "fixed" && gridRow !== lastRow;
      this.suppressY = this.controller.config.scales === "fixed" && gridCol !== 0;
    }
    getColumnCount() {
      var configured = this.controller.config.ncol;
      if (configured) {
        return Math.max(configured, 1);
      }
      var container = this.controller.container && this.controller.container.node ? this.controller.container.node() : null;
      if (container && window.getComputedStyle) {
        var template = window.getComputedStyle(container).gridTemplateColumns || "";
        var parts = template.split(" ").filter(function(part) {
          return !!part && part !== "none";
        });
        if (parts.length > 0) {
          return parts.length;
        }
      }
      var containerWidth = container ? container.clientWidth : this.controller.chart.runtime.totalWidth;
      return Math.max(Math.floor(containerWidth / (this.controller.config.minWidth || 200)), 1);
    }
    hasPanelData() {
      for (var i = 0; i < this.layers.length; i += 1) {
        if (this.layers[i].data && this.layers[i].data.length > 0) {
          return true;
        }
      }
      return false;
    }
    addLabel() {
      d3.select(this.element).append("div").attr("class", "myIO-facet-label").text(this.facetValue);
    }
    renderPanel() {
      var panelChart = this.buildPanelChart();
      var renderState = deriveChartRender(panelChart);
      if (renderState.axesChart) {
        applyDerivedScales(panelChart, renderState);
        this.applySharedDomains(panelChart);
      }
      initializeScaffold(panelChart);
      panelChart.dom.svg = panelChart.svg;
      panelChart.dom.plot = panelChart.plot;
      panelChart.dom.chartArea = panelChart.chart;
      if (renderState.axesChart && this.requiresClipPath(renderState.type)) {
        this.setClipPath(panelChart);
        syncAxes(panelChart, renderState, { isInitialRender: true });
        this.applyAxisSuppression(panelChart);
        syncReferenceLines(panelChart, renderState, { isInitialRender: true });
      }
      this.renderLayers(panelChart, this.layers);
      this.panelChart = panelChart;
    }
    buildPanelChart() {
      var parentChart = this.controller.chart;
      var width = Math.max(this.element.clientWidth || this.controller.config.minWidth || 200, 1);
      var margin = this.buildMargin();
      var panelConfig = Object.assign({}, parentChart.config, {
        layers: this.layers
      });
      var options = {
        margin,
        suppressLegend: true,
        suppressAxis: { xAxis: this.suppressX, yAxis: this.suppressY },
        xlim: panelConfig.scales.xlim,
        ylim: panelConfig.scales.ylim,
        categoricalScale: panelConfig.scales.categoricalScale,
        flipAxis: panelConfig.scales.flipAxis,
        colorScheme: panelConfig.scales.colorScheme ? panelConfig.scales.colorScheme.enabled ? [panelConfig.scales.colorScheme.colors, panelConfig.scales.colorScheme.domain, "on"] : [panelConfig.scales.colorScheme.colors, panelConfig.scales.colorScheme.domain, "off"] : null,
        xAxisFormat: panelConfig.axes.xAxisFormat,
        yAxisFormat: panelConfig.axes.yAxisFormat,
        toolTipFormat: panelConfig.axes.toolTipFormat,
        xTickLabels: panelConfig.axes.xTickLabels,
        xAxisLabel: panelConfig.axes.xAxisLabel,
        yAxisLabel: panelConfig.axes.yAxisLabel,
        dragPoints: false,
        toggleY: null,
        toolTipOptions: panelConfig.interactions.toolTipOptions,
        transition: { speed: 0 },
        referenceLine: panelConfig.referenceLines
      };
      return {
        element: this.element,
        dom: { element: this.element },
        config: panelConfig,
        derived: { currentLayers: this.layers.slice() },
        runtime: {
          totalWidth: width,
          width,
          height: FACET_PANEL_HEIGHT,
          layout: parentChart.runtime.layout,
          activeY: parentChart.runtime.activeY,
          activeYFormat: parentChart.runtime.activeYFormat
        },
        options,
        margin,
        width,
        height: FACET_PANEL_HEIGHT,
        totalWidth: width,
        layout: parentChart.runtime.layout,
        newY: parentChart.runtime.activeY,
        newScaleY: parentChart.runtime.activeYFormat,
        plotLayers: this.layers,
        emit: function() {
        },
        dragPoints: function() {
        },
        updateRegression: function() {
        },
        syncLegacyAliases: function() {
          this.xScale = this.derived ? this.derived.xScale : null;
          this.yScale = this.derived ? this.derived.yScale : null;
          this.colorDiscrete = this.derived ? this.derived.colorDiscrete : null;
          this.colorContinuous = this.derived ? this.derived.colorContinuous : null;
          this.x_banded = this.derived ? this.derived.xBanded : null;
          this.y_banded = this.derived ? this.derived.yBanded : null;
          this.x_check = this.derived ? this.derived.xCheck : null;
          this.currentLayers = this.derived ? this.derived.currentLayers : null;
        },
        captureLegacyAliases: function() {
        }
      };
    }
    buildMargin() {
      var baseMargin = this.controller.chart.config.layout.margin || {};
      var margin = {
        top: baseMargin.top != null ? baseMargin.top : 30,
        right: baseMargin.right != null ? baseMargin.right : 5,
        bottom: baseMargin.bottom != null ? baseMargin.bottom : 60,
        left: baseMargin.left != null ? baseMargin.left : 50
      };
      if (this.suppressX) {
        margin.bottom = Math.min(margin.bottom, 12);
      }
      if (this.suppressY) {
        margin.left = Math.min(margin.left, 12);
      }
      return margin;
    }
    applySharedDomains(panelChart) {
      var snapshot = this.controller.globalScaleSnapshot;
      if (!snapshot || !panelChart.derived || !panelChart.derived.xScale || !panelChart.derived.yScale) {
        return;
      }
      if (snapshot.xDomain) {
        panelChart.derived.xScale.domain(snapshot.xDomain.slice());
      }
      if (snapshot.yDomain) {
        panelChart.derived.yScale.domain(snapshot.yDomain.slice());
      }
      if (snapshot.xBanded) {
        panelChart.derived.xBanded = snapshot.xBanded.slice();
      }
      if (snapshot.yBanded) {
        panelChart.derived.yBanded = snapshot.yBanded.slice();
      }
      if (typeof snapshot.xCheck !== "undefined") {
        panelChart.derived.xCheck = snapshot.xCheck;
      }
      if (snapshot.colorDiscrete) {
        panelChart.derived.colorDiscrete = snapshot.colorDiscrete;
      }
      if (snapshot.colorContinuous) {
        panelChart.derived.colorContinuous = snapshot.colorContinuous;
      }
      panelChart.syncLegacyAliases();
    }
    requiresClipPath(type) {
      return type !== "donut" && type !== "gauge";
    }
    setClipPath(panelChart) {
      var chartHeight = panelChart.height - (panelChart.margin.top + panelChart.margin.bottom);
      panelChart.dom.clipPath = panelChart.dom.chartArea.append("defs").append("svg:clipPath").attr("id", panelChart.dom.element.id + "clip").append("svg:rect").attr("x", 0).attr("y", 0).attr("width", panelChart.width - (panelChart.margin.left + panelChart.margin.right)).attr("height", chartHeight);
      panelChart.dom.chartArea.attr("clip-path", "url(#" + panelChart.dom.element.id + "clip)");
      panelChart.clipPath = panelChart.dom.clipPath;
    }
    applyAxisSuppression(panelChart) {
      if (this.suppressX) {
        panelChart.plot.selectAll(".x-axis").remove();
      }
      if (this.suppressY) {
        panelChart.plot.selectAll(".y-axis").remove();
      }
    }
    renderLayers(panelChart, layers) {
      for (var i = 0; i < layers.length; i += 1) {
        var renderer = getRendererForLayer(layers[i]);
        if (renderer && typeof renderer.render === "function") {
          renderer.render(panelChart, layers[i], layers);
        }
      }
    }
    renderEmptyPanel() {
      d3.select(this.element).classed("myIO-facet-empty", true);
      var width = Math.max(this.element.clientWidth || this.controller.config.minWidth || 200, 1);
      this.panelChart = {
        svg: d3.select(this.element).append("svg").attr("class", "myIO-svg").attr("width", "100%").attr("height", FACET_PANEL_HEIGHT).attr("viewBox", "0 0 " + width + " " + FACET_PANEL_HEIGHT)
      };
      this.panelChart.svg.append("text").attr("x", width / 2).attr("y", FACET_PANEL_HEIGHT / 2).attr("text-anchor", "middle").attr("fill", "var(--chart-grid-color)").style("font-size", "11px").style("font-style", "italic").text("No data");
    }
    resize() {
      if (!this.element || !this.element.isConnected) {
        return;
      }
      this.initialize(this.layers);
    }
    destroy() {
      d3.select(this.element).classed("myIO-facet-empty", false);
      d3.select(this.element).selectAll("*").remove();
      this.panelChart = null;
    }
  };

  // inst/htmlwidgets/myIO/src/layout/facet-controller.js
  var FACET_PANEL_HEIGHT2 = 200;
  var FacetController = class {
    constructor(chart) {
      this.chart = chart;
      this.config = chart.config.facet || {};
      this.panels = /* @__PURE__ */ new Map();
      this.container = null;
      this.resizeObserver = null;
      this.validatedLayers = [];
      this.globalScaleSnapshot = null;
    }
    initialize() {
      this.destroy();
      this.config = this.chart.config.facet || {};
      this.validatedLayers = this.getValidatedLayers();
      if (this.chart.dom && this.chart.dom.svg) {
        this.chart.dom.svg.style("display", "none");
      }
      d3.select(this.chart.dom.element).selectAll(".myIO-fab, .myIO-panel, .myIO-sheet-backdrop").remove();
      if (this.validatedLayers.length === 0) {
        this.createGrid([]);
        return;
      }
      var facetValues = this.groupData();
      this.globalScaleSnapshot = this.config.scales === "fixed" ? this.captureGlobalScaleSnapshot(this.validatedLayers) : null;
      this.createGrid(facetValues);
      for (var i = 0; i < facetValues.length; i += 1) {
        var value = facetValues[i];
        var panelDiv = this.container.append("div").attr("class", "myIO-facet-panel").attr("data-facet-value", value);
        var panel = new FacetPanel(this, value, panelDiv.node(), i, facetValues.length);
        panel.initialize(this.filterLayersForValue(value));
        this.panels.set(value, panel);
      }
    }
    getValidatedLayers() {
      var previousLayers = this.chart.derived.currentLayers;
      this.chart.derived.currentLayers = this.chart.config.layers || [];
      var layers = validateLayers(this.chart);
      this.chart.derived.currentLayers = previousLayers;
      return layers;
    }
    groupData() {
      var facetVar = this.config.var;
      var valueSet = {};
      for (var i = 0; i < this.validatedLayers.length; i += 1) {
        var data = this.validatedLayers[i].data || [];
        for (var j = 0; j < data.length; j += 1) {
          var val = String(data[j][facetVar]);
          valueSet[val] = true;
        }
      }
      return Object.keys(valueSet).sort();
    }
    filterLayersForValue(value) {
      var facetVar = this.config.var;
      return this.validatedLayers.map(function(layer) {
        return Object.assign({}, layer, {
          data: (layer.data || []).filter(function(d) {
            return String(d[facetVar]) === value;
          })
        });
      });
    }
    createGrid(facetValues) {
      d3.select(this.chart.dom.element).select(".myIO-facet-grid").remove();
      this.container = d3.select(this.chart.dom.element).append("div").attr("class", "myIO-facet-grid").attr("role", "group").attr("aria-label", "Small multiples chart faceted by " + this.config.var);
      if (this.config.ncol) {
        this.container.style("grid-template-columns", "repeat(" + this.config.ncol + ", 1fr)");
      } else {
        this.container.style(
          "grid-template-columns",
          "repeat(auto-fill, minmax(" + (this.config.minWidth || 200) + "px, 1fr))"
        );
      }
      if (!facetValues.length) {
        this.container.append("div").attr("class", "myIO-facet-panel myIO-facet-empty").text("No data");
      }
    }
    captureGlobalScaleSnapshot(layers) {
      if (!layers || !layers.length) {
        return null;
      }
      var scaleChart = {
        config: this.chart.config,
        derived: { currentLayers: layers.slice() },
        margin: Object.assign({}, this.chart.config.layout.margin),
        width: Math.max(this.config.minWidth || 200, 1),
        height: FACET_PANEL_HEIGHT2,
        runtime: {
          totalWidth: Math.max(this.config.minWidth || 200, 1)
        },
        syncLegacyAliases: function() {
        }
      };
      var renderState = deriveChartRender(scaleChart);
      if (!renderState.axesChart) {
        return {
          renderState
        };
      }
      applyDerivedScales(scaleChart, renderState);
      return {
        renderState,
        xDomain: scaleChart.derived.xScale ? scaleChart.derived.xScale.domain().slice() : null,
        yDomain: scaleChart.derived.yScale ? scaleChart.derived.yScale.domain().slice() : null,
        xBanded: scaleChart.derived.xBanded ? scaleChart.derived.xBanded.slice() : null,
        yBanded: scaleChart.derived.yBanded ? scaleChart.derived.yBanded.slice() : null,
        xCheck: scaleChart.derived.xCheck,
        colorDiscrete: scaleChart.derived.colorDiscrete || null,
        colorContinuous: scaleChart.derived.colorContinuous || null
      };
    }
    resize() {
      var width = this.chart.dom && this.chart.dom.element ? this.chart.dom.element.clientWidth : 0;
      if (this.chart.runtime) {
        this.chart.runtime.totalWidth = Math.max(width || this.chart.runtime.totalWidth || 0, 1);
        this.chart.runtime.width = this.chart.runtime.totalWidth;
      }
      if (this.config.scales === "fixed") {
        this.globalScaleSnapshot = this.captureGlobalScaleSnapshot(this.validatedLayers);
      }
      for (var panel of this.panels.values()) {
        panel.resize();
      }
    }
    destroy() {
      for (var panel of this.panels.values()) {
        panel.destroy();
      }
      this.panels.clear();
      d3.select(this.chart.dom.element).select(".myIO-facet-grid").remove();
      this.container = null;
      this.globalScaleSnapshot = null;
      if (this.chart.dom && this.chart.dom.svg) {
        this.chart.dom.svg.style("display", null);
      }
    }
  };

  // inst/htmlwidgets/myIO/src/a11y/descriptions.js
  function generateChartLabel(config) {
    var types = [];
    var layers = config && config.layers || [];
    for (var i = 0; i < layers.length; i++) {
      var type = layers[i].type;
      if (type && types.indexOf(type) === -1) {
        types.push(type);
      }
    }
    var xLabel = config && config.axes && config.axes.xAxisLabel || "x";
    var yLabel = config && config.axes && config.axes.yAxisLabel || "y";
    var prefix = types.length ? types.join(" and ") + " chart" : "chart";
    var label = prefix + ": " + xLabel + " vs " + yLabel;
    var summaries = generateQuantileDotSummaries(layers);
    return summaries.length ? label + ". " + summaries.join(" ") : label;
  }
  function generateLayerLabel(layer) {
    var label = layer && (layer.label || layer.type) || "series";
    var dataLength = layer && Array.isArray(layer.data) ? layer.data.length : 0;
    return label + ": " + dataLength + " data points";
  }
  function generatePointLabel(d, layer) {
    var mapping = layer && layer.mapping || {};
    if (mapping.quantile_rank && d) {
      var rank = d[mapping.quantile_rank];
      var n = layer && layer.options && layer.options.n ? layer.options.n : inferDotCount(layer, d);
      var value = mapping.y_var ? d[mapping.y_var] : d.value;
      var text = "Q" + String(rank) + " of " + String(n) + ": " + String(value != null ? value : "");
      var relationship = mapping.threshold_relationship ? d[mapping.threshold_relationship] : d.threshold_relationship;
      var threshold = layer && layer.options ? layer.options.threshold : null;
      if (relationship) {
        text += ", " + String(relationship) + (threshold != null ? " threshold of " + String(threshold) : " threshold");
      }
      return text;
    }
    if (mapping.low_y && mapping.high_y && d) {
      var densityLabel = d.density_label || layer && layer.options && layer.options.density_label || "interval";
      return String(densityLabel) + ": " + String(d[mapping.low_y] != null ? d[mapping.low_y] : "") + " to " + String(d[mapping.high_y] != null ? d[mapping.high_y] : "");
    }
    if (mapping.x_var && mapping.y_var && d) {
      return String(d[mapping.x_var] != null ? d[mapping.x_var] : "") + ": " + String(d[mapping.y_var] != null ? d[mapping.y_var] : "");
    }
    if (mapping.category && mapping.value && d) {
      return String(d[mapping.category] || "") + ": " + String(d[mapping.value] || "");
    }
    return "Data point";
  }
  function inferDotCount(layer, d) {
    if (!layer || !Array.isArray(layer.data) || !layer.mapping || !layer.mapping.x_var || !d) {
      return layer && Array.isArray(layer.data) ? layer.data.length : 0;
    }
    var xValue = d[layer.mapping.x_var];
    return layer.data.filter(function(row) {
      return row[layer.mapping.x_var] === xValue;
    }).length;
  }
  function generateQuantileDotSummaries(layers) {
    var summaries = [];
    (layers || []).forEach(function(layer) {
      if (!layer || layer.type !== "quantile_dots" || !Array.isArray(layer.data)) {
        return;
      }
      var threshold = layer.options && layer.options.threshold;
      if (threshold == null) {
        return;
      }
      var mapping = layer.mapping || {};
      var xVar = mapping.x_var;
      var relVar = mapping.threshold_relationship || "threshold_relationship";
      var n = layer.options && layer.options.n ? layer.options.n : null;
      var groups = /* @__PURE__ */ new Map();
      layer.data.forEach(function(row) {
        var key = xVar ? String(row[xVar]) : "all";
        if (!groups.has(key)) {
          groups.set(key, { total: 0, below: 0 });
        }
        var summary = groups.get(key);
        summary.total += 1;
        if (row[relVar] === "below") {
          summary.below += 1;
        }
      });
      groups.forEach(function(summary, key) {
        var denominator = n || summary.total;
        var prefix = groups.size > 1 ? key + ": " : "";
        summaries.push(prefix + summary.below + " of " + denominator + " dots below threshold of " + threshold + ".");
      });
    });
    return summaries;
  }

  // inst/htmlwidgets/myIO/src/a11y/aria.js
  function sanitizeLabel(label) {
    return String(label).replace(/[^a-zA-Z0-9_-]/g, "");
  }
  function getLayerGroup(chart, layer) {
    if (!chart.dom || !chart.dom.chartArea || !layer) {
      return null;
    }
    var chartArea = chart.dom.chartArea;
    var selectors = [
      ".tag-" + layer.type + "-" + layer.id,
      ".tag-" + layer.type + "-" + chart.dom.element.id + "-" + sanitizeLabel(layer.label)
    ];
    for (var i = 0; i < selectors.length; i++) {
      var selection = chartArea.select(selectors[i]);
      if (!selection.empty()) {
        return selection;
      }
    }
    return null;
  }
  function getLayerElements(chart, layer) {
    if (!chart.dom || !chart.dom.chartArea || !layer) {
      return null;
    }
    var chartArea = chart.dom.chartArea;
    var label = sanitizeLabel(layer.label);
    var elementId = chart.dom.element.id;
    var selectors = [];
    if (layer.type === "line") {
      selectors.push(".tag-point-" + elementId + "-" + label);
    }
    if (layer.type === "groupedBar") {
      selectors.push(".tag-grouped-bar-g rect");
    }
    selectors.push(".tag-" + layer.type + "-" + elementId + "-" + label);
    selectors.push(".tag-" + layer.type + "-" + layer.id + " circle");
    selectors.push(".tag-" + layer.type + "-" + layer.id + " rect");
    selectors.push(".tag-" + layer.type + "-" + layer.id + " path");
    selectors.push(".tag-" + layer.type + "-" + layer.id + " line");
    for (var i = 0; i < selectors.length; i++) {
      var selection = chartArea.selectAll(selectors[i]);
      if (!selection.empty()) {
        return selection;
      }
    }
    return null;
  }
  function applyARIA(chart) {
    if (!chart || !chart.dom || !chart.dom.svg) {
      return;
    }
    var svg = chart.dom.svg;
    var layers = chart.config && chart.config.layers ? chart.config.layers : [];
    svg.attr("role", "graphics-document").attr("aria-roledescription", "chart").attr("aria-label", generateChartLabel(chart.config)).attr("tabindex", "0");
    if (chart.dom.chartArea) {
      chart.dom.chartArea.attr("role", "graphics-object").attr("aria-roledescription", "plot area").attr("aria-label", "Plot area with " + layers.length + " data series");
    }
    for (var i = 0; i < layers.length; i++) {
      var layer = layers[i];
      var layerGroup = getLayerGroup(chart, layer);
      var layerElements = getLayerElements(chart, layer);
      if (layerGroup && !layerGroup.empty()) {
        layerGroup.attr("role", "graphics-object").attr("aria-roledescription", layer.type + " series").attr("aria-label", generateLayerLabel(layer));
      }
      if (layerElements && !layerElements.empty()) {
        layerElements.each(function(d) {
          d3.select(this).attr("role", "graphics-symbol").attr("aria-roledescription", "data point").attr("aria-label", generatePointLabel(d, layer));
        });
      }
    }
  }

  // inst/htmlwidgets/myIO/src/a11y/keyboard-nav.js
  function sanitizeLabel2(label) {
    return String(label).replace(/[^a-zA-Z0-9_-]/g, "");
  }
  function getLayerSymbols(chart, layer) {
    if (!chart || !chart.dom || !chart.dom.chartArea || !layer) {
      return d3.select(null);
    }
    var chartArea = chart.dom.chartArea;
    var label = sanitizeLabel2(layer.label);
    var elementId = chart.dom.element.id;
    var selectors = [
      ".tag-" + layer.type + "-" + layer.id + ' [role="graphics-symbol"]'
    ];
    if (layer.type === "line") {
      selectors.push(".tag-point-" + elementId + "-" + label + '[role="graphics-symbol"]');
    }
    if (layer.type === "groupedBar") {
      selectors.push('.tag-grouped-bar-g rect[role="graphics-symbol"]');
    }
    selectors.push(".tag-" + layer.type + "-" + elementId + "-" + label + '[role="graphics-symbol"]');
    selectors.push(".tag-" + layer.type + "-" + layer.id + ' circle[role="graphics-symbol"]');
    selectors.push(".tag-" + layer.type + "-" + layer.id + ' rect[role="graphics-symbol"]');
    selectors.push(".tag-" + layer.type + "-" + layer.id + ' path[role="graphics-symbol"]');
    selectors.push(".tag-" + layer.type + "-" + layer.id + ' line[role="graphics-symbol"]');
    for (var i = 0; i < selectors.length; i++) {
      var selection = chartArea.selectAll(selectors[i]);
      if (!selection.empty()) {
        return selection;
      }
    }
    return d3.select(null);
  }
  var KeyboardNavigator = class {
    constructor(chart) {
      this.chart = chart;
      this.state = "IDLE";
      this.layerIndex = 0;
      this.pointIndex = 0;
      this.debounceTimer = null;
      this.liveRegion = null;
      this._keyHandler = null;
    }
    initialize() {
      var self2 = this;
      this.liveRegion = d3.select(this.chart.dom.element).append("div").attr("role", "status").attr("aria-live", "polite").attr("aria-atomic", "true").attr("class", "myIO-sr-only");
      this._keyHandler = function(event) {
        self2.handleKey(event);
      };
      this.chart.dom.svg.on("keydown.a11y", this._keyHandler);
    }
    handleKey(event) {
      var key = event.key;
      switch (key) {
        case "ArrowRight":
          event.preventDefault();
          this.movePoint(1);
          break;
        case "ArrowLeft":
          event.preventDefault();
          this.movePoint(-1);
          break;
        case "ArrowDown":
          event.preventDefault();
          this.moveLayer(1);
          break;
        case "ArrowUp":
          event.preventDefault();
          this.moveLayer(-1);
          break;
        case "Escape":
          event.preventDefault();
          this.reset();
          break;
      }
    }
    movePoint(delta) {
      var layers = this.getNavigableLayers();
      if (!layers.length) {
        return;
      }
      if (this.state === "IDLE") {
        this.state = "POINT";
        this.layerIndex = 0;
        this.pointIndex = 0;
      } else {
        var maxIndex = layers[this.layerIndex].data.length - 1;
        this.pointIndex = Math.max(0, Math.min(maxIndex, this.pointIndex + delta));
      }
      this.focusCurrent();
    }
    moveLayer(delta) {
      var layers = this.getNavigableLayers();
      if (!layers.length) {
        return;
      }
      var maxIndex = layers.length - 1;
      this.layerIndex = Math.max(0, Math.min(maxIndex, this.layerIndex + delta));
      this.pointIndex = 0;
      this.state = "POINT";
      this.focusCurrent({ includeLayerLabel: true });
    }
    focusCurrent(options) {
      var opts = options || {};
      var layers = this.getNavigableLayers();
      var layer = layers[this.layerIndex];
      if (!layer || !layer.data || !layer.data.length) {
        return;
      }
      var d = layer.data[this.pointIndex];
      if (!d) {
        return;
      }
      this.chart.dom.chartArea.selectAll(".myIO-kb-focus").classed("myIO-kb-focus", false);
      var elements = getLayerSymbols(this.chart, layer);
      var pointIndex = this.pointIndex;
      var target = elements.filter(function(dd, i) {
        if (dd && d && dd._source_key != null && d._source_key != null) {
          return dd._source_key === d._source_key;
        }
        return dd === d || i === pointIndex;
      });
      if (!target.empty()) {
        target.classed("myIO-kb-focus", true);
      }
      var pointText = generatePointLabel(d, layer);
      var text = opts.includeLayerLabel ? generateLayerLabel(layer) + ": " + pointText : pointText;
      this.announce(text);
    }
    announce(text) {
      var self2 = this;
      clearTimeout(this.debounceTimer);
      this.debounceTimer = setTimeout(function() {
        if (self2.liveRegion) {
          self2.liveRegion.text(text);
        }
      }, 150);
    }
    reset() {
      this.state = "IDLE";
      this.chart.dom.chartArea.selectAll(".myIO-kb-focus").classed("myIO-kb-focus", false);
      if (this.liveRegion) {
        this.liveRegion.text("");
      }
    }
    getNavigableLayers() {
      return this.chart.config.layers.filter(function(layer) {
        return layer.data && layer.data.length > 0 && layer.visibility !== false;
      });
    }
    destroy() {
      this.chart.dom.svg.on("keydown.a11y", null);
      if (this.liveRegion) {
        this.liveRegion.remove();
      }
      clearTimeout(this.debounceTimer);
    }
  };

  // inst/htmlwidgets/myIO/src/a11y/data-table.js
  var DataTableFallback = class {
    constructor(chart) {
      this.chart = chart;
      this.tableContainer = null;
      this.visible = false;
    }
    initialize() {
      this.tableContainer = d3.select(this.chart.dom.element).append("div").attr("class", "myIO-data-table myIO-sr-only").attr("role", "region").attr("aria-label", "Chart data table");
    }
    generate() {
      if (!this.tableContainer) {
        return;
      }
      this.tableContainer.selectAll("*").remove();
      var layers = this.chart.config.layers;
      var maxRows = 500;
      var fanGroups = /* @__PURE__ */ new Map();
      var regularLayers = [];
      for (var groupIndex = 0; groupIndex < layers.length; groupIndex++) {
        var candidate = layers[groupIndex];
        if (candidate && candidate._composite === "fan") {
          var key = String(candidate.id || "").replace(/_sub_\d+$/, "") || candidate.label || "fan";
          if (!fanGroups.has(key)) {
            fanGroups.set(key, []);
          }
          fanGroups.get(key).push(candidate);
        } else {
          regularLayers.push(candidate);
        }
      }
      var self2 = this;
      fanGroups.forEach(function(groupLayers) {
        self2.renderFanTable(groupLayers, maxRows);
      });
      for (var i = 0; i < regularLayers.length; i++) {
        var layer = regularLayers[i];
        var data = Array.isArray(layer.data) ? layer.data : [];
        var display = data.slice(0, maxRows);
        var columns = Object.values(layer.mapping || {}).filter(Boolean);
        var table = this.tableContainer.append("table").attr("aria-label", "Data for " + (layer.label || layer.type));
        var thead = table.append("thead");
        var headerRow = thead.append("tr");
        for (var c = 0; c < columns.length; c++) {
          headerRow.append("th").attr("scope", "col").text(columns[c]);
        }
        var tbody = table.append("tbody");
        for (var r = 0; r < display.length; r++) {
          var row = tbody.append("tr");
          for (var c2 = 0; c2 < columns.length; c2++) {
            var value = display[r][columns[c2]];
            row.append("td").text(value != null ? String(value) : "");
          }
        }
        if (data.length > maxRows) {
          this.tableContainer.append("p").text("Showing first " + maxRows + " of " + data.length + " rows");
        }
      }
    }
    renderFanTable(layers, maxRows) {
      if (!layers || layers.length === 0) {
        return;
      }
      var first = layers[0];
      var xField = first.mapping && first.mapping.x_var ? first.mapping.x_var : "x_var";
      var rowMap = /* @__PURE__ */ new Map();
      var levels = [];
      layers.forEach(function(layer) {
        var pct = layer.options && layer.options.interval_pct;
        if (pct == null) {
          return;
        }
        var suffix = formatLevel(pct);
        levels.push(+pct);
        (Array.isArray(layer.data) ? layer.data : []).forEach(function(d) {
          var key = String(d[xField]);
          if (!rowMap.has(key)) {
            rowMap.set(key, { x_var: d[xField] });
          }
          var row = rowMap.get(key);
          row["low_" + suffix] = d[layer.mapping.low_y];
          row["high_" + suffix] = d[layer.mapping.high_y];
        });
      });
      levels = Array.from(new Set(levels)).sort(function(a, b) {
        return a - b;
      });
      var columns = ["x_var"];
      levels.forEach(function(level) {
        var suffix = formatLevel(level);
        columns.push("low_" + suffix);
        columns.push("high_" + suffix);
      });
      var rows = Array.from(rowMap.values());
      var display = rows.slice(0, maxRows);
      var table = this.tableContainer.append("table").attr("aria-label", "Data for " + (first._composite || "fan"));
      var headerRow = table.append("thead").append("tr");
      columns.forEach(function(column) {
        headerRow.append("th").attr("scope", "col").text(column);
      });
      var tbody = table.append("tbody");
      display.forEach(function(d) {
        var row = tbody.append("tr");
        columns.forEach(function(column) {
          var value = d[column];
          row.append("td").text(value != null ? String(value) : "");
        });
      });
      if (rows.length > maxRows) {
        this.tableContainer.append("p").text("Showing first " + maxRows + " of " + rows.length + " rows");
      }
    }
    toggle() {
      this.visible = !this.visible;
      if (this.visible) {
        this.generate();
        this.tableContainer.classed("myIO-sr-only", false);
        this.chart.dom.svg.attr("aria-hidden", "true");
      } else {
        this.tableContainer.classed("myIO-sr-only", true);
        this.chart.dom.svg.attr("aria-hidden", null);
      }
    }
    destroy() {
      if (this.tableContainer) {
        this.tableContainer.remove();
      }
    }
  };
  function formatLevel(level) {
    return String(level).replace(/\.0+$/, "").replace(/(\.\d*?)0+$/, "$1");
  }

  // inst/htmlwidgets/myIO/src/Chart.js
  var MIN_CHART_WIDTH = 280;
  var RESIZE_DEBOUNCE_MS = 100;
  var EventEmitter = {
    on(event, handler) {
      this._listeners = this._listeners || {};
      this._listeners[event] = this._listeners[event] || [];
      this._listeners[event].push(handler);
      return this;
    },
    off(event, handler) {
      if (!this._listeners || !this._listeners[event]) {
        return this;
      }
      this._listeners[event] = handler ? this._listeners[event].filter(function(candidate) {
        return candidate !== handler;
      }) : [];
      return this;
    },
    emit(event, payload) {
      if (!this._listeners || !this._listeners[event]) {
        return this;
      }
      this._listeners[event].forEach(function(handler) {
        handler(payload);
      });
      return this;
    }
  };
  var myIOchart = class {
    constructor(opts) {
      Object.assign(this, EventEmitter);
      this._listeners = {};
      this.config = opts.config;
      this.dom = { element: opts.element };
      this.derived = {};
      this.runtime = {
        renderGen: 0,
        resizeTimer: null,
        width: Math.max(opts.width, MIN_CHART_WIDTH),
        height: opts.height,
        totalWidth: Math.max(opts.width, MIN_CHART_WIDTH),
        layout: "grouped",
        activeY: null,
        activeYFormat: null,
        tooltipHideTimer: null
      };
      if (this.config.sparkline) {
        this.applySparklineOverrides();
      }
      if (window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
        this.config.transitions.speed = 0;
      }
      this.runtime.width = this.runtime.totalWidth;
      this.syncLegacyAliases();
      this.draw();
    }
    syncLegacyAliases() {
      this.element = this.dom ? this.dom.element : null;
      this.svg = this.dom ? this.dom.svg : null;
      this.plot = this.dom ? this.dom.plot : null;
      this.chart = this.dom ? this.dom.chartArea : null;
      this.legendArea = this.dom ? this.dom.legendArea : null;
      this.clipPath = this.dom ? this.dom.clipPath : null;
      this.tooltip = this.dom ? this.dom.tooltip : null;
      this.toolTipTitle = this.dom ? this.dom.tooltipTitle : null;
      this.toolTipBody = this.dom ? this.dom.tooltipBody : null;
      this.plotLayers = this.config ? this.config.layers : null;
      this.options = this.config ? {
        margin: this.config.layout.margin,
        suppressLegend: this.config.layout.suppressLegend,
        suppressAxis: this.config.layout.suppressAxis,
        xlim: this.config.scales.xlim,
        ylim: this.config.scales.ylim,
        categoricalScale: this.config.scales.categoricalScale,
        flipAxis: this.config.scales.flipAxis,
        colorScheme: this.config.scales.colorScheme ? this.config.scales.colorScheme.enabled ? [this.config.scales.colorScheme.colors, this.config.scales.colorScheme.domain, "on"] : [this.config.scales.colorScheme.colors, this.config.scales.colorScheme.domain, "off"] : null,
        xAxisFormat: this.config.axes.xAxisFormat,
        yAxisFormat: this.config.axes.yAxisFormat,
        toolTipFormat: this.config.axes.toolTipFormat,
        xTickLabels: this.config.axes.xTickLabels,
        xAxisLabel: this.config.axes.xAxisLabel,
        yAxisLabel: this.config.axes.yAxisLabel,
        dragPoints: this.config.interactions.dragPoints,
        toggleY: this.config.interactions.toggleY && this.config.interactions.toggleY.variable ? [this.config.interactions.toggleY.variable, this.config.interactions.toggleY.format] : null,
        toolTipOptions: this.config.interactions.toolTipOptions,
        transition: this.config.transitions,
        referenceLine: this.config.referenceLines
      } : null;
      this.margin = this.config ? this.config.layout.margin : null;
      this.width = this.runtime ? this.runtime.width : null;
      this.height = this.runtime ? this.runtime.height : null;
      this.totalWidth = this.runtime ? this.runtime.totalWidth : null;
      this.layout = this.runtime ? this.runtime.layout : null;
      this.newY = this.runtime ? this.runtime.activeY : null;
      this.newScaleY = this.runtime ? this.runtime.activeYFormat : null;
      this.toolLine = this.runtime ? this.runtime.toolLine : null;
      this.toolTipBox = this.runtime ? this.runtime.toolTipBox : null;
      this.toolPointLayer = this.runtime ? this.runtime.toolPointLayer : null;
      this.xScale = this.derived ? this.derived.xScale : null;
      this.yScale = this.derived ? this.derived.yScale : null;
      this.colorDiscrete = this.derived ? this.derived.colorDiscrete : null;
      this.colorContinuous = this.derived ? this.derived.colorContinuous : null;
      this.x_banded = this.derived ? this.derived.xBanded : null;
      this.y_banded = this.derived ? this.derived.yBanded : null;
      this.x_check = this.derived ? this.derived.xCheck : null;
      this.currentLayers = this.derived ? this.derived.currentLayers : null;
      this.layerIndex = this.derived ? this.derived.layerIndex : null;
    }
    captureLegacyAliases() {
      if (!this.dom || !this.runtime || !this.derived) {
        return;
      }
      this.dom.svg = this.svg || this.dom.svg;
      this.dom.plot = this.plot || this.dom.plot;
      this.dom.chartArea = this.chart || this.dom.chartArea;
      this.dom.legendArea = this.legendArea || this.dom.legendArea;
      this.dom.clipPath = this.clipPath || this.dom.clipPath;
      this.dom.tooltip = this.tooltip || this.dom.tooltip;
      this.dom.tooltipTitle = this.toolTipTitle || this.dom.tooltipTitle;
      this.dom.tooltipBody = this.toolTipBody || this.dom.tooltipBody;
      this.runtime.layout = this.layout || this.runtime.layout;
      this.runtime.activeY = this.newY || this.runtime.activeY;
      this.runtime.activeYFormat = this.newScaleY || this.runtime.activeYFormat;
      this.runtime.toolLine = this.toolLine || this.runtime.toolLine;
      this.runtime.toolTipBox = this.toolTipBox || this.runtime.toolTipBox;
      this.runtime.toolPointLayer = this.toolPointLayer || this.runtime.toolPointLayer;
      this.derived.xScale = this.xScale || this.derived.xScale;
      this.derived.yScale = this.yScale || this.derived.yScale;
      this.derived.colorDiscrete = this.colorDiscrete || this.derived.colorDiscrete;
      this.derived.colorContinuous = this.colorContinuous || this.derived.colorContinuous;
      this.derived.xBanded = this.x_banded || this.derived.xBanded;
      this.derived.yBanded = this.y_banded || this.derived.yBanded;
      this.derived.xCheck = this.x_check || this.derived.xCheck;
      this.derived.currentLayers = this.currentLayers || this.derived.currentLayers;
      this.derived.layerIndex = this.layerIndex || this.derived.layerIndex;
      this.syncLegacyAliases();
    }
    draw() {
      initializeScaffold(this);
      this.captureLegacyAliases();
      this.initialize();
    }
    initialize() {
      this.derived.currentLayers = this.config.layers;
      this.syncLegacyAliases();
      this.themeManager = new ThemeManager(this.dom.element, this.config);
      this.themeManager.initialize();
      initializeTooltip(this);
      if (!this.config.sparkline) {
        this.keyboardNav = new KeyboardNavigator(this);
        this.keyboardNav.initialize();
        this.dataTable = new DataTableFallback(this);
        this.dataTable.initialize();
        applyARIA(this);
      }
      this.captureLegacyAliases();
      if (this.derived.currentLayers.length > 0) {
        this.setClipPath(this.derived.currentLayers[0].type);
      }
      this.renderCurrentLayers({ isInitialRender: true });
    }
    applySparklineOverrides() {
      this.config.layout.margin = { top: 1, right: 1, bottom: 1, left: 1 };
      this.config.layout.suppressLegend = true;
      this.config.layout.suppressAxis = { xAxis: true, yAxis: true };
      if (this.config.interactions.brush) this.config.interactions.brush.enabled = false;
      if (this.config.interactions.annotation) this.config.interactions.annotation.enabled = false;
      if (this.config.interactions.linked) this.config.interactions.linked.enabled = false;
      this.config.interactions.sliders = [];
      this.config.interactions.dragPoints = false;
      this.config.referenceLines = { x: null, y: null };
      this.dom.element.dataset.sparkline = "true";
    }
    renderCurrentLayers(opts) {
      const options = opts || {};
      const generation = ++this.runtime.renderGen;
      const isCurrent = () => this.runtime && this.runtime.renderGen === generation;
      if (this.config.facet && this.config.facet.enabled) {
        if (!this.facetController) {
          this.facetController = new FacetController(this);
        }
        this.facetController.initialize();
        return;
      } else if (this.facetController) {
        this.facetController.destroy();
        this.facetController = null;
      }
      try {
        if (this.dom.chartArea) {
          this.dom.chartArea.selectAll("*").interrupt();
          var activeLabels = this.derived.currentLayers.map(function(l) {
            return l.label;
          });
          var allLabels = this.config.layers.map(function(l) {
            return l.label;
          });
          var chartArea = this.dom.chartArea;
          allLabels.forEach(function(label) {
            if (activeLabels.indexOf(label) === -1) {
              var safeName = String(label).replace(/\s+/g, "");
              chartArea.selectAll("[class*='tag-'][class*='-" + safeName + "']").remove();
            }
          });
        }
        this.emit("beforeRender", { options });
        renderChartTitle(this);
        this.derived.currentLayers = validateLayers(this);
        this.syncLegacyAliases();
        this.clearEmptyState();
        if (!isCurrent()) {
          return;
        }
        if (this.derived.currentLayers.length === 0) {
          this.renderEmptyState();
          if (!this.config.sparkline) {
            applyARIA(this);
          }
          return;
        }
        const state = deriveChartRender(this);
        applyDerivedScales(this, state);
        this.syncLegacyAliases();
        if (!isCurrent()) {
          return;
        }
        addFAB(this);
        this.emit("afterScales", { state });
        syncAxes(this, state, options);
        this.routeLayers(this.derived.currentLayers);
        syncReferenceLines(this, state, options);
        syncLegend(this, state);
        bindRollover(this);
        removeBrush(this);
        if (this.config.interactions.brush && this.config.interactions.brush.enabled) {
          bindBrush(this);
        }
        if (this.config.interactions.annotation && this.config.interactions.annotation.enabled) {
          bindAnnotation(this);
        }
        if (this.config.interactions.linked && this.config.interactions.linked.enabled) {
          bindLinked(this);
        }
        if (this.config.interactions.linked && this.config.interactions.linked.cursor === true) {
          registerLinkedCursor(this);
        }
        if (this.config.interactions.sliders && this.config.interactions.sliders.length > 0) {
          bindSliders(this);
        }
        this.emit("afterRender", { state });
        if (!this.config.sparkline) {
          applyARIA(this);
        }
      } catch (error) {
        console.warn("[myIO] Render error:", error.message);
        this.emit("error", { message: error.message, error });
        throw error;
      }
    }
    clearEmptyState() {
      if (this.dom && this.dom.svg) {
        this.dom.svg.selectAll(".myIO-empty-state").remove();
      }
      if (this.dom && this.dom.element) {
        d3.select(this.dom.element).select(".myIO-fab").style("display", null);
      }
    }
    renderEmptyState() {
      if (this.dom.chartArea) {
        this.dom.chartArea.selectAll("*").interrupt().remove();
      }
      if (this.dom.plot) {
        this.dom.plot.selectAll(".x-axis, .y-axis").interrupt().remove();
        this.dom.plot.selectAll(".ref-x-line, .ref-y-line").remove();
      }
      removeHoverOverlay(this);
      hideChartTooltip(this);
      if (this.runtime && this.runtime._sheetOpen) {
        closePanel(this, { returnFocus: false });
      }
      if (this.dom.element) {
        d3.select(this.dom.element).select(".myIO-fab").style("display", "none");
      }
      if (this.dom.svg) {
        this.dom.svg.selectAll(".myIO-empty-state").remove();
        this.dom.svg.append("text").attr("class", "myIO-empty-state").attr("x", this.runtime.totalWidth / 2).attr("y", this.runtime.height / 2).text("No data to display");
      }
    }
    addButtons() {
      addFAB(this);
    }
    toggleVarY(newY) {
      this.runtime.activeY = newY[0];
      this.runtime.activeYFormat = newY[1];
      this.syncLegacyAliases();
      this.renderCurrentLayers();
    }
    toggleGroupedLayout(layers) {
      var data = getGroupedDataObject(layers, this);
      var colors = layers.map(function(layer) {
        return layer.color;
      });
      var bandwidth = (this.runtime.width - (this.config.layout.margin.right + this.config.layout.margin.left)) / (data[0].length + 1) / colors.length;
      if (this.runtime.layout === "stacked") {
        transitionGrouped(this, data, colors, bandwidth);
        this.runtime.layout = "grouped";
      } else {
        transitionStacked(this, data, colors, bandwidth);
        this.runtime.layout = "stacked";
      }
      this.syncLegacyAliases();
    }
    setClipPath(type) {
      switch (type) {
        case "donut":
        case "gauge":
          break;
        default:
          var chartHeight = getChartHeight(this);
          this.dom.clipPath = this.dom.chartArea.append("defs").append("svg:clipPath").attr("id", this.dom.element.id + "clip").append("svg:rect").attr("x", 0).attr("y", 0).attr("width", this.runtime.width - (this.config.layout.margin.left + this.config.layout.margin.right)).attr("height", chartHeight - (this.config.layout.margin.top + this.config.layout.margin.bottom));
          this.dom.chartArea.attr("clip-path", "url(#" + this.dom.element.id + "clip)");
          this.syncLegacyAliases();
      }
    }
    routeLayers(layers) {
      var that = this;
      this.derived.layerIndex = this.config.layers.map(function(d) {
        return d.label;
      });
      this.syncLegacyAliases();
      layers.forEach(function(layer) {
        var renderer = getRendererForLayer(layer);
        if (renderer && typeof renderer.render === "function") {
          renderer.render(that, layer, layers);
          that.captureLegacyAliases();
          var opacity = layer.options && layer.options.opacity != null ? layer.options.opacity : 1;
          if (opacity < 1) {
            var safeName = String(layer.label).replace(/\s+/g, "");
            that.dom.chartArea.selectAll("[class*='tag-'][class*='-" + safeName + "']").style("opacity", opacity);
          }
        }
      });
    }
    removeLayers(labels) {
      labels.forEach((label) => {
        listRenderers().forEach(function(renderer) {
          if (typeof renderer.remove === "function") {
            renderer.remove(this, { label });
          } else {
            ["line", "bar", "point", "regression-line", "hexbin", "area", "crosshairY", "crosshairX"].forEach(function(prefix) {
              d3.selectAll("." + tagName(prefix, this.dom.element.id, label)).transition().duration(500).style("opacity", 0).remove();
            }, this);
          }
        }, this);
      });
    }
    dragPoints(layer) {
      bindPointDrag(this, layer);
    }
    updateOrdinalColorLegend(ly) {
      syncOrdinalLegendData(this, ly);
    }
    updateRegression(color, label) {
      const pointLayer = (this.config.layers || []).find(function(layer) {
        return layer.label === label && layer.type === "point";
      });
      if (!pointLayer) {
        return;
      }
      (this.config.layers || []).forEach(function(layer) {
        if (layer.type !== "line" || layer.transform !== "lm") {
          return;
        }
        if (!layer.mapping || !pointLayer.mapping) {
          return;
        }
        if (layer.mapping.x_var !== pointLayer.mapping.x_var || layer.mapping.y_var !== pointLayer.mapping.y_var) {
          return;
        }
        const regression = linearRegression(pointLayer.data, pointLayer.mapping.y_var, pointLayer.mapping.x_var);
        const derivedData = pointLayer.data.map(function(row) {
          return {
            ...row,
            [layer.mapping.y_var]: regression.fn(row[layer.mapping.x_var])
          };
        }).sort(function(a, b) {
          return a[layer.mapping.x_var] - b[layer.mapping.x_var];
        });
        layer.data = derivedData;
        getRenderer("line").render(this, { ...layer, color: color || layer.color }, this.config.layers);
      }, this);
    }
    updateChart(newConfig) {
      const oldLabels = this.derived.layerIndex || [];
      this.config = newConfig;
      this.derived.currentLayers = this.config.layers;
      this.syncLegacyAliases();
      const newLabels = this.config.layers.map(function(layer) {
        return layer.label;
      });
      const removed = oldLabels.filter(function(label) {
        return !newLabels.includes(label);
      });
      this.removeLayers(removed);
      this.renderCurrentLayers();
    }
    resize(width, height) {
      if (!width || !height || width < 2 || height < 2) return;
      const wasSheetOpen = this.runtime && this.runtime._sheetOpen === true;
      if (wasSheetOpen) {
        closePanel(this, { returnFocus: false });
      }
      this.runtime.totalWidth = Math.max(width, MIN_CHART_WIDTH);
      this.runtime.width = this.runtime.totalWidth;
      this.runtime.height = height;
      this.syncLegacyAliases();
      clearTimeout(this.runtime.resizeTimer);
      this.runtime.resizeTimer = setTimeout(() => {
        updateScaffoldLayout(this);
        this.captureLegacyAliases();
        this.renderCurrentLayers();
        if (wasSheetOpen && this.derived && this.derived.currentLayers && this.derived.currentLayers.length > 0) {
          openPanel(this);
        }
        this.emit("resize", { width: this.runtime.width, height: this.runtime.height });
      }, RESIZE_DEBOUNCE_MS);
    }
    destroy() {
      this.emit("destroy", {});
      clearTimeout(this.runtime && this.runtime.resizeTimer);
      clearTimeout(this.runtime && this.runtime.tooltipHideTimer);
      if (this.facetController) {
        this.facetController.destroy();
        this.facetController = null;
      }
      if (this.keyboardNav) this.keyboardNav.destroy();
      if (this.dataTable) this.dataTable.destroy();
      if (this.themeManager) {
        this.themeManager.destroy();
      }
      if (this.runtime && this.runtime._sheetOpen) {
        closePanel(this, { returnFocus: false });
      }
      clearTimeout(this.runtime && this.runtime._sheetCloseTimer);
      removeBrush(this);
      removeAnnotationBindings(this);
      cleanupLinked(this);
      removeSliders(this);
      if (this.dom && this.dom.element) {
        d3.select(this.dom.element).on("keydown.brush", null);
      }
      if (this.dom && this.dom.chartArea) {
        this.dom.chartArea.selectAll("*").interrupt();
      }
      if (this.dom && this.dom.svg) {
        this.dom.svg.remove();
      }
      if (this.dom && this.dom.tooltip) {
        this.dom.tooltip.remove();
      }
      if (this.dom && this.dom.element) {
        d3.select(this.dom.element).selectAll(".myIO-fab, .myIO-panel, .myIO-sheet-backdrop").remove();
      }
      removeHoverOverlay(this);
      this._listeners = {};
      this.config = null;
      this.derived = null;
      this.dom = null;
      this.runtime = null;
    }
  };

  // inst/htmlwidgets/myIO/src/coordinator/query-cache.js
  var QueryCache = class {
    constructor({ max: max2 = 128 } = {}) {
      this.max = max2;
      this.lru = /* @__PURE__ */ new Map();
      this.inflight = /* @__PURE__ */ new Map();
    }
    /** @returns {unknown | undefined} */
    get(key) {
      if (!this.lru.has(key)) return void 0;
      const value = this.lru.get(key);
      this.lru.delete(key);
      this.lru.set(key, value);
      return value;
    }
    set(key, value) {
      if (this.lru.has(key)) this.lru.delete(key);
      this.lru.set(key, value);
      while (this.lru.size > this.max) {
        const oldest = this.lru.keys().next().value;
        this.lru.delete(oldest);
      }
    }
    delete(key) {
      this.lru.delete(key);
    }
    clear() {
      this.lru.clear();
      this.inflight.clear();
    }
    size() {
      return this.lru.size;
    }
    /**
     * Dedup helper. If a promise is already in flight for this key, returns it.
     * Otherwise stores the provided promise under the key and returns it. The
     * coordinator must call resolveInflight / rejectInflight when the promise
     * settles so the key is freed.
     */
    inflightOrStore(key, promiseFactory) {
      if (this.inflight.has(key)) return this.inflight.get(key);
      const p = promiseFactory();
      this.inflight.set(key, p);
      return p;
    }
    resolveInflight(key, value) {
      this.set(key, value);
      this.inflight.delete(key);
    }
    rejectInflight(key) {
      this.inflight.delete(key);
    }
  };

  // inst/htmlwidgets/myIO/src/coordinator/source-registry.js
  var SourceRegistry = class {
    constructor() {
      this.sources = /* @__PURE__ */ new Map();
    }
    register(entry) {
      if (!entry || typeof entry.sourceId !== "string") {
        throw new Error("SourceRegistry.register: entry must have sourceId");
      }
      if (entry.mode === "none") {
        return;
      }
      this.sources.set(entry.sourceId, entry);
    }
    unregister(sourceId) {
      this.sources.delete(sourceId);
    }
    get(sourceId) {
      return this.sources.get(sourceId);
    }
    has(sourceId) {
      return this.sources.has(sourceId);
    }
    all() {
      return Array.from(this.sources.values());
    }
    clear() {
      this.sources.clear();
    }
  };

  // inst/htmlwidgets/myIO/src/engines/svg-null.js
  var SvgNullAdapter = class {
    constructor(_config = {}) {
    }
    async init(_opts = {}) {
    }
    async cancel(_queryId) {
    }
    async close() {
    }
    async applyPredicateCache(_hash, _predicateSQL) {
    }
    /**
     * Returns an async iterable that yields nothing but a trailer.
     * The contract specifies: AsyncIterable<ArrowBatch> plus trailing
     * {queryId, rowCount, elapsedMs}. Because this adapter is a no-op,
     * we yield only the trailer.
     */
    async *query({ queryId }) {
      yield { __trailer: true, queryId, rowCount: 0, elapsedMs: 0 };
    }
  };

  // inst/htmlwidgets/myIO/src/engines/memory.js
  var MemoryEngine = class {
    constructor(config = {}) {
      this.sources = /* @__PURE__ */ new Map();
      this.config = config;
      this._closed = false;
    }
    async init({ sourceRegistry } = {}) {
      if (!sourceRegistry) return;
      const [arrow, alasqlMod] = await Promise.all([
        Promise.resolve().then(() => (init_Arrow_dom(), Arrow_dom_exports)),
        Promise.resolve().then(() => __toESM(require_alasql_min()))
      ]);
      const alasql = alasqlMod.default || alasqlMod;
      for (const src of sourceRegistry.all()) {
        if (src.mode !== "inline_ipc" || !src.ipcB64) {
          continue;
        }
        const bytes = Uint8Array.from(atob(src.ipcB64), (c) => c.charCodeAt(0));
        const table = arrow.tableFromIPC(bytes);
        const rows = table.toArray().map((r) => Object.assign({}, r));
        alasql.tables[src.sourceId] = { data: rows };
        this.sources.set(src.sourceId, { table, rows });
      }
      this._alasql = alasql;
    }
    async *query({ sql, params = [], queryId, signal }) {
      if (this._closed) {
        throw Object.assign(new Error("engine-gone"), { queryId, code: "engine-gone" });
      }
      if (signal && signal.aborted) {
        throw Object.assign(new Error("cancelled"), { queryId, code: "cancelled" });
      }
      const started = Date.now();
      let rows;
      try {
        rows = this._alasql.exec(sql, params);
      } catch (e) {
        throw Object.assign(new Error(e.message || String(e)), {
          queryId,
          code: "syntax"
        });
      }
      yield { rows, queryId };
      yield {
        __trailer: true,
        queryId,
        rowCount: Array.isArray(rows) ? rows.length : 0,
        elapsedMs: Date.now() - started
      };
    }
    async cancel(_queryId) {
    }
    async applyPredicateCache(_hash, _predicateSQL) {
    }
    async close() {
      if (this._alasql) {
        for (const srcId of this.sources.keys()) {
          delete this._alasql.tables[srcId];
        }
      }
      this.sources.clear();
      this._closed = true;
    }
  };

  // inst/htmlwidgets/myIO/src/engines/shiny.js
  var ShinyEngineAdapter = class {
    constructor(config = {}) {
      this.config = config;
      this.pending = /* @__PURE__ */ new Map();
      this.batchWindow = config && config.shiny_batch_window || 4;
      this._handlersRegistered = false;
    }
    async init({ sourceRegistry } = {}) {
      if (typeof Shiny === "undefined") {
        throw Object.assign(new Error("Shiny is not available in this context"), {
          code: "engine-gone"
        });
      }
      if (this._handlersRegistered) return;
      const onBatch = (msg) => this._route("batch", msg);
      const onEnd = (msg) => this._route("end", msg);
      const onError = (msg) => this._route("error", msg);
      Shiny.addCustomMessageHandler("myio:batch", onBatch);
      Shiny.addCustomMessageHandler("myio:end", onEnd);
      Shiny.addCustomMessageHandler("myio:error", onError);
      this._handlersRegistered = true;
    }
    _route(kind, msg) {
      const slot = this.pending.get(msg.queryId);
      if (!slot) return;
      if (kind === "batch") {
        slot.push(msg);
        Shiny.setInputValue(
          "myio_ack",
          { v: 1, queryId: msg.queryId, seq: msg.seq },
          { priority: "event" }
        );
      } else if (kind === "end") {
        slot.push({
          __trailer: true,
          queryId: msg.queryId,
          rowCount: msg.rowCount,
          elapsedMs: msg.elapsedMs
        });
        slot.end();
      } else if (kind === "error") {
        slot.error(Object.assign(new Error(msg.message || "engine error"), {
          queryId: msg.queryId,
          code: msg.code || "engine-gone"
        }));
      }
    }
    /**
     * Async iterator for query results. Expects `sql` to already be a validated,
     * parameterized template string on the R side. In this adapter contract
     * layer, the "sql" field carries debug context only; the coordinator passes
     * templateId + bindings, which R validates and composes into SQL.
     */
    query({
      sql,
      params = [],
      queryId,
      signal,
      templateId,
      sourceId,
      bindings,
      predicateHash,
      limit: limit2
    }) {
      void params;
      if (typeof Shiny === "undefined") {
        throw Object.assign(new Error("Shiny not available"), {
          queryId,
          code: "engine-gone"
        });
      }
      const queue = [];
      let resolvers = [];
      let doneFlag = false;
      let errorFlag = null;
      const push2 = (item) => {
        if (resolvers.length) resolvers.shift()({ value: item, done: false });
        else queue.push(item);
      };
      const end = () => {
        doneFlag = true;
        while (resolvers.length) {
          resolvers.shift()({ value: void 0, done: true });
        }
      };
      const error = (err) => {
        errorFlag = err;
        while (resolvers.length) {
          resolvers.shift()({ value: void 0, done: true });
        }
      };
      this.pending.set(queryId, {
        push: push2,
        end,
        error,
        seqBudget: this.batchWindow
      });
      let abortListener = null;
      if (signal) {
        abortListener = () => {
          Shiny.setInputValue(
            "myio_cancel",
            { v: 1, queryId },
            { priority: "event" }
          );
          error(Object.assign(new Error("cancelled"), {
            queryId,
            code: "cancelled"
          }));
        };
        if (signal.aborted) abortListener();
        else signal.addEventListener("abort", abortListener);
      }
      if (!errorFlag) {
        Shiny.setInputValue(
          "myio_query",
          {
            v: 1,
            queryId,
            templateId: templateId || null,
            sourceId: sourceId || null,
            predicateHash: predicateHash || null,
            bindings: bindings || {},
            limit: limit2 || null,
            // Also forward raw `sql` for debugging; R-side validation ignores it.
            _debugSql: sql
          },
          { priority: "event" }
        );
      }
      const pending = this.pending;
      return (async function* () {
        try {
          while (true) {
            if (errorFlag) throw errorFlag;
            if (queue.length) {
              yield queue.shift();
              continue;
            }
            if (doneFlag) return;
            const next = await new Promise((res) => resolvers.push(res));
            if (next.done) {
              if (errorFlag) throw errorFlag;
              return;
            }
            yield next.value;
          }
        } finally {
          if (signal && abortListener) {
            signal.removeEventListener("abort", abortListener);
          }
          pending.delete(queryId);
        }
      })();
    }
    async cancel(queryId) {
      if (typeof Shiny !== "undefined") {
        Shiny.setInputValue(
          "myio_cancel",
          { v: 1, queryId },
          { priority: "event" }
        );
      }
      const slot = this.pending.get(queryId);
      if (slot) {
        slot.error(Object.assign(new Error("cancelled"), {
          queryId,
          code: "cancelled"
        }));
      }
    }
    async applyPredicateCache(_hash, _predicateSQL) {
    }
    async close() {
      for (const [, slot] of this.pending) {
        slot.error(Object.assign(new Error("engine closed"), {
          code: "engine-gone"
        }));
      }
      this.pending.clear();
    }
  };

  // inst/htmlwidgets/myIO/src/engines/wasm.js
  var WasmEngineAdapter = class {
    constructor(config = {}) {
      this.config = config;
      this.cacheUrl = config.duckdb_wasm && config.duckdb_wasm.cache_url || null;
      this.workerUrl = config.duckdb_wasm && config.duckdb_wasm.worker_url || null;
      this.db = null;
      this.conn = null;
      this._duckdb = null;
      this._closed = false;
    }
    async init({ sourceRegistry } = {}) {
      if (this._closed) {
        throw Object.assign(new Error("engine-gone"), { code: "engine-gone" });
      }
      if (!this.cacheUrl || !this.workerUrl) {
        throw Object.assign(
          new Error("WasmEngineAdapter: duckdb_wasm cache_url / worker_url not set. Ensure myIO::install_duckdb_wasm() has run."),
          { code: "engine-gone" }
        );
      }
      const loaderUrl = this.cacheUrl.replace(/\/?$/, "/") + "duckdb-browser.mjs";
      let duckdb;
      try {
        duckdb = await import(
          /* @vite-ignore */
          loaderUrl
        );
      } catch (err) {
        throw Object.assign(
          new Error("WasmEngineAdapter: failed to import duckdb-wasm loader from " + loaderUrl + ": " + (err?.message || err)),
          { code: "engine-gone" }
        );
      }
      this._duckdb = duckdb;
      const worker3 = new Worker(this.workerUrl);
      const wasmModuleUrl = this.cacheUrl.replace(/\/?$/, "/") + "duckdb-mvp.wasm";
      const logger = new duckdb.ConsoleLogger();
      this.db = new duckdb.AsyncDuckDB(logger, worker3);
      await this.db.instantiate(wasmModuleUrl);
      this.conn = await this.db.connect();
      if (sourceRegistry) {
        for (const src of sourceRegistry.all()) {
          await this._registerSource(src);
        }
      }
    }
    async _registerSource(src) {
      if (!this._duckdb) return;
      const DataProtocol = this._duckdb.DuckDBDataProtocol;
      if (src.mode === "inline_ipc" && src.ipcB64) {
        const bytes = Uint8Array.from(atob(src.ipcB64), (c) => c.charCodeAt(0));
        const virtualName = src.sourceId + ".arrow";
        await this.db.registerFileBuffer(virtualName, bytes);
        await this.conn.query(
          'CREATE OR REPLACE VIEW "' + src.sourceId.replace(/"/g, '""') + `" AS SELECT * FROM read_arrow('` + virtualName + "');"
        );
      } else if (src.mode === "url" && src.url) {
        const virtualName = src.sourceId + (/\.parquet$/i.test(src.url) ? ".parquet" : /\.arrow$/i.test(src.url) ? ".arrow" : /\.feather$/i.test(src.url) ? ".feather" : ".csv");
        await this.db.registerFileURL(virtualName, src.url, DataProtocol.HTTP, false);
        const reader = /\.parquet$/i.test(src.url) ? "read_parquet" : /\.arrow$/i.test(src.url) ? "read_arrow" : /\.feather$/i.test(src.url) ? "read_arrow" : "read_csv_auto";
        await this.conn.query(
          'CREATE OR REPLACE VIEW "' + src.sourceId.replace(/"/g, '""') + '" AS SELECT * FROM ' + reader + "('" + virtualName + "');"
        );
      }
    }
    async *query({ sql, params = [], queryId, signal }) {
      void params;
      if (this._closed) {
        throw Object.assign(new Error("engine-gone"), { queryId, code: "engine-gone" });
      }
      if (signal && signal.aborted) {
        throw Object.assign(new Error("cancelled"), { queryId, code: "cancelled" });
      }
      const started = Date.now();
      let reader;
      let abortListener = null;
      try {
        reader = await this.conn.send(sql);
      } catch (err) {
        throw Object.assign(new Error(err?.message || String(err)), {
          queryId,
          code: "syntax"
        });
      }
      if (signal) {
        abortListener = () => {
          if (this.conn) {
            this.conn.cancelSent().catch(() => {
            });
          }
        };
        signal.addEventListener("abort", abortListener);
      }
      let rowCount = 0;
      try {
        while (true) {
          if (signal && signal.aborted) {
            try {
              await this.conn.cancelSent();
            } catch (_) {
            }
            throw Object.assign(new Error("cancelled"), {
              queryId,
              code: "cancelled"
            });
          }
          const { done, value } = await reader.next();
          if (done) break;
          if (value) {
            rowCount += value.numRows || 0;
            yield { batch: value, queryId };
          }
        }
      } finally {
        if (signal && abortListener) {
          signal.removeEventListener("abort", abortListener);
        }
        try {
          await reader.return();
        } catch (_) {
        }
      }
      yield {
        __trailer: true,
        queryId,
        rowCount,
        elapsedMs: Date.now() - started
      };
    }
    async cancel(_queryId) {
      if (this.conn) {
        try {
          await this.conn.cancelSent();
        } catch (_) {
        }
      }
    }
    async applyPredicateCache(_hash, _predicateSQL) {
    }
    async close() {
      this._closed = true;
      if (this.conn) {
        try {
          await this.conn.close();
        } catch (_) {
        }
        this.conn = null;
      }
      if (this.db) {
        try {
          await this.db.terminate();
        } catch (_) {
        }
        this.db = null;
      }
    }
  };

  // inst/htmlwidgets/myIO/src/engines/index.js
  function createEngine(name, config = {}) {
    switch (name) {
      case "svg":
        return new SvgNullAdapter(config);
      case "memory":
        return new MemoryEngine(config);
      case "wasm":
        return new WasmEngineAdapter(config);
      case "server":
        return new ShinyEngineAdapter(config);
      default:
        throw new Error("createEngine: unknown engine '" + name + "'");
    }
  }

  // inst/htmlwidgets/myIO/src/coordinator/index.js
  var Coordinator = class {
    constructor({ config }) {
      this.config = config || {};
      this.cache = new QueryCache({ max: 128 });
      this.sourceRegistry = new SourceRegistry();
      this.charts = /* @__PURE__ */ new Map();
      this.selectionStore = /* @__PURE__ */ new Map();
      this.adapters = /* @__PURE__ */ new Map();
      this._adapterInits = /* @__PURE__ */ new Map();
      this._inflightControllers = /* @__PURE__ */ new Map();
      this._debouncers = /* @__PURE__ */ new Map();
    }
    /** Ensure an engine adapter exists for `sourceId`. Lazy per Multi-widget lifecycle contract. */
    ensureAdapterFor(sourceId, engineName, config) {
      if (this.adapters.has(sourceId)) return Promise.resolve(this.adapters.get(sourceId));
      if (this._adapterInits.has(sourceId)) return this._adapterInits.get(sourceId);
      const adapter = createEngine(engineName, config);
      const promise = adapter.init({ sourceRegistry: this.sourceRegistry }).then(() => {
        this.adapters.set(sourceId, adapter);
        this._adapterInits.delete(sourceId);
        return adapter;
      }).catch((err) => {
        this._adapterInits.delete(sourceId);
        throw err;
      });
      this._adapterInits.set(sourceId, promise);
      return promise;
    }
    /** Register a source entry - wraps SourceRegistry.register and returns void. */
    registerSource(entry) {
      this.sourceRegistry.register(entry);
    }
    /** Register a chart. Expected payload shape in contract Chart registration. */
    register({ chartId, queryTemplate, markSpec, sourceHandle, predicateFn, onResult }) {
      this.charts.set(chartId, {
        chartId,
        queryTemplate,
        markSpec,
        sourceHandle,
        predicateFn,
        currentPredicate: null,
        onResult
      });
      if (!this.selectionStore.has(sourceHandle.sourceId)) {
        this.selectionStore.set(sourceHandle.sourceId, /* @__PURE__ */ new Map());
      }
      if (queryTemplate && String(queryTemplate).trim() && onResult) {
        setTimeout(() => this._dispatch(chartId, { preview: false }), 0);
      }
    }
    unregister(chartId) {
      const reg = this.charts.get(chartId);
      if (!reg) return;
      this.charts.delete(chartId);
      const inflight = this._inflightControllers.get(chartId);
      if (inflight) {
        inflight.abort();
        this._inflightControllers.delete(chartId);
      }
      const sourceId = reg.sourceHandle.sourceId;
      const selMap = this.selectionStore.get(sourceId);
      if (selMap) selMap.delete(chartId);
      const db = this._debouncers.get(chartId);
      if (db) {
        if (db.preview) clearTimeout(db.preview);
        if (db.final) clearTimeout(db.final);
        this._debouncers.delete(chartId);
      }
      const remaining = [...this.charts.values()].filter((r) => r.sourceHandle.sourceId === sourceId);
      if (remaining.length === 0) {
        const adapter = this.adapters.get(sourceId);
        if (adapter) {
          adapter.close().catch(() => {
          });
          this.adapters.delete(sourceId);
        }
        this._adapterInits.delete(sourceId);
        this.selectionStore.delete(sourceId);
      }
    }
    /** Called by charts when their local selection changes. */
    setSelection({ chartId, predicate }) {
      const reg = this.charts.get(chartId);
      if (!reg) return;
      const sourceId = reg.sourceHandle.sourceId;
      let selMap = this.selectionStore.get(sourceId);
      if (!selMap) {
        selMap = /* @__PURE__ */ new Map();
        this.selectionStore.set(sourceId, selMap);
      }
      if (predicate == null) {
        selMap.delete(chartId);
      } else {
        selMap.set(chartId, predicate);
      }
      reg.currentPredicate = predicate;
      for (const other of this.charts.values()) {
        if (other.chartId === chartId) continue;
        if (other.sourceHandle.sourceId !== sourceId) continue;
        this._scheduleDispatch(other.chartId);
      }
      if (this._subscribers) {
        const subs = this._subscribers.get(reg.sourceHandle.sourceId);
        if (subs) {
          for (const cb of subs) {
            try {
              cb({ chartId, predicate });
            } catch (e) {
              console.error("[myIO coordinator] subscriber error:", e);
            }
          }
        }
      }
    }
    /**
     * Subscribe a callback to selection changes on a source. Called after
     * the internal selection store updates but before dispatch fires for
     * other charts. Useful for the crosstalk adapter which broadcasts
     * row-key selections to sibling htmlwidgets.
     *
     * @param {string} sourceId
     * @param {(evt: {chartId:string, predicate:string|null}) => void} callback
     * @returns {() => void} unsubscribe function
     */
    subscribe(sourceId, callback) {
      if (!this._subscribers) this._subscribers = /* @__PURE__ */ new Map();
      if (!this._subscribers.has(sourceId)) {
        this._subscribers.set(sourceId, /* @__PURE__ */ new Set());
      }
      this._subscribers.get(sourceId).add(callback);
      return () => {
        const set = this._subscribers.get(sourceId);
        if (set) set.delete(callback);
      };
    }
    /** Schedule preview (50ms trailing) + final (200ms trailing) dispatch. */
    _scheduleDispatch(chartId) {
      let db = this._debouncers.get(chartId);
      if (!db) {
        db = { preview: null, final: null };
        this._debouncers.set(chartId, db);
      }
      if (db.preview) clearTimeout(db.preview);
      if (db.final) clearTimeout(db.final);
      db.preview = setTimeout(() => this._dispatch(chartId, { preview: true }), 50);
      db.final = setTimeout(() => this._dispatch(chartId, { preview: false }), 200);
    }
    async _dispatch(chartId, { preview = false } = {}) {
      const reg = this.charts.get(chartId);
      if (!reg) return;
      if (!reg.onResult || !reg.queryTemplate || !String(reg.queryTemplate).trim()) return;
      const sourceId = reg.sourceHandle.sourceId;
      const predicate = this._composeOthersPredicate(chartId, sourceId);
      const sqlForCoords = this._substituteTemplate(reg.queryTemplate, {
        where: predicate,
        limit: preview ? 1e3 : 1e5
      });
      const predicateHash = await this._hash(predicate);
      const engineName = reg.sourceHandle.engine || this.config.engine;
      const cacheKey = await this._hash(
        sqlForCoords + "" + predicateHash + "" + engineName
      );
      const hit = this.cache.get(cacheKey);
      if (hit) {
        this._deliverToRenderer(chartId, hit);
        return;
      }
      let adapter = this.adapters.get(sourceId);
      try {
        if (!adapter && engineName) {
          adapter = await this.ensureAdapterFor(sourceId, engineName, this.config);
        }
        if (!this.charts.has(chartId)) return;
        if (!adapter) return;
        if (typeof adapter.applyPredicateCache === "function") {
          await adapter.applyPredicateCache(predicateHash, predicate);
        }
      } catch (err) {
        if (!this.charts.has(chartId)) return;
        console.error("[myIO coordinator]", chartId, err?.code, err?.message || err);
        this._deliverToRenderer(chartId, {
          batches: [],
          trailer: { error: err?.message || String(err), code: err?.code || "engine_error" }
        });
        return;
      }
      const queryId = "q_" + Math.random().toString(36).slice(2, 10);
      let abortCtrl = null;
      if (!this.cache.inflight.has(cacheKey)) {
        const previous = this._inflightControllers.get(chartId);
        if (previous) previous.abort();
        abortCtrl = new AbortController();
        this._inflightControllers.set(chartId, abortCtrl);
      }
      const promise = this.cache.inflightOrStore(cacheKey, () => {
        return (async () => {
          const batches = [];
          let trailer = null;
          for await (const item of adapter.query({
            sql: sqlForCoords,
            params: [],
            queryId,
            sourceId,
            limit: preview ? 1e3 : 1e5,
            signal: abortCtrl.signal
          })) {
            if (item.__trailer) {
              trailer = item;
            } else {
              batches.push(item);
            }
          }
          return { batches, trailer };
        })();
      });
      try {
        const result = await promise;
        const currentCtrl = this._inflightControllers.get(chartId);
        if (abortCtrl && currentCtrl === abortCtrl) {
          this._inflightControllers.delete(chartId);
        }
        if (abortCtrl && abortCtrl.signal.aborted) {
          this.cache.rejectInflight(cacheKey);
          return;
        }
        this.cache.resolveInflight(cacheKey, result);
        if (!this.charts.has(chartId)) return;
        this._deliverToRenderer(chartId, result);
      } catch (err) {
        this.cache.rejectInflight(cacheKey);
        const currentCtrl = this._inflightControllers.get(chartId);
        if (abortCtrl && currentCtrl === abortCtrl) {
          this._inflightControllers.delete(chartId);
        }
        if (abortCtrl && abortCtrl.signal.aborted) return;
        console.error("[myIO coordinator]", chartId, err?.code, err?.message || err);
        this._deliverToRenderer(chartId, {
          batches: [],
          trailer: { error: err?.message || String(err), code: err?.code || "query_error" }
        });
      }
    }
    _composeOthersPredicate(chartId, sourceId) {
      const selMap = this.selectionStore.get(sourceId) || /* @__PURE__ */ new Map();
      const others = [...selMap.entries()].filter(([id]) => id !== chartId).map(([, p]) => p).filter(Boolean);
      return others.length ? "(" + others.join(") AND (") + ")" : "TRUE";
    }
    _substituteTemplate(template, { where, limit: limit2 }) {
      return template.replace(/\{\{\s*where\s*\}\}/g, where).replace(/\{\{\s*limit\s*\}\}/g, String(limit2)).replace(/\$where\b/g, where).replace(/\$limit\b/g, String(limit2));
    }
    async _hash(str) {
      if (typeof crypto !== "undefined" && crypto.subtle) {
        const buf = new TextEncoder().encode(str);
        const h2 = await crypto.subtle.digest("SHA-1", buf);
        return Array.from(new Uint8Array(h2, 0, 8)).map((b) => b.toString(16).padStart(2, "0")).join("");
      }
      let h = 2166136261;
      for (let i = 0; i < str.length; i++) {
        h ^= str.charCodeAt(i);
        h = Math.imul(h, 16777619);
      }
      return (h >>> 0).toString(16).padStart(8, "0");
    }
    _deliverToRenderer(chartId, { batches, trailer }) {
      const reg = this.charts.get(chartId);
      if (!reg || !reg.onResult) return;
      try {
        reg.onResult({ batches, trailer, markSpec: reg.markSpec });
      } catch (e) {
        console.error("[myIO coordinator] renderer error for", chartId, e);
      }
    }
    /** Public hook: attach a result callback to a registered chart. */
    onChartResult(chartId, callback) {
      const reg = this.charts.get(chartId);
      if (reg) reg.onResult = callback;
    }
    async close() {
      for (const db of this._debouncers.values()) {
        if (db.preview) clearTimeout(db.preview);
        if (db.final) clearTimeout(db.final);
      }
      for (const [, adapter] of this.adapters) {
        await adapter.close().catch(() => {
        });
      }
      this.adapters.clear();
      for (const ctrl of this._inflightControllers.values()) {
        ctrl.abort();
      }
      this._adapterInits.clear();
      this._inflightControllers.clear();
      this.charts.clear();
      this.selectionStore.clear();
      this.sourceRegistry.clear();
      this.cache.clear();
      this._debouncers.clear();
    }
  };
  function bootCoordinator(config) {
    if (!globalThis.__myioCoordinator) {
      globalThis.__myioCoordinator = new Coordinator({ config });
    }
    return globalThis.__myioCoordinator;
  }

  // inst/htmlwidgets/myIO/src/coordinator/webgl-bridge.js
  var WEBGL_KINDS = /* @__PURE__ */ new Set(["scatter", "line", "area"]);
  var RESIZE_DEBOUNCE_MS2 = 150;
  function toFiniteNumber(value) {
    const n = Number(value);
    return Number.isFinite(n) ? n : null;
  }
  function normalizeWebGLThreshold(value) {
    if (value === "Inf" || value === "Infinity" || value === Infinity) {
      return Infinity;
    }
    const n = Number(value);
    return Number.isFinite(n) && n > 0 ? n : 5e4;
  }
  function isWebGLEligible({ markSpec, rowCount, threshold }) {
    const kind = markSpec && markSpec.kind;
    if (!WEBGL_KINDS.has(kind)) return false;
    const cutoff = normalizeWebGLThreshold(threshold);
    if (!Number.isFinite(cutoff)) return false;
    const count = Number(rowCount);
    return Number.isFinite(count) && count >= cutoff;
  }
  function rowFromArrowLike(table, i) {
    const row = {};
    ["x", "y", "category", "color", "value", "baseline"].forEach((name) => {
      const col = table.getChild ? table.getChild(name) : null;
      if (col) row[name] = col.get(i);
    });
    return row;
  }
  function rowsFromArrowLike(table) {
    if (!table) return [];
    if (typeof table.toArray === "function") {
      return table.toArray().map((row) => Object.assign({}, row));
    }
    if (typeof table.getChild === "function") {
      const xCol = table.getChild("x");
      const len = table.numRows || table.length || (xCol ? xCol.length : 0);
      const rows = new Array(len);
      for (let i = 0; i < len; i++) rows[i] = rowFromArrowLike(table, i);
      return rows;
    }
    return [];
  }
  function normalizeCoordinatorBatches(batches) {
    const rows = [];
    (batches || []).forEach((item) => {
      if (!item) return;
      if (Array.isArray(item)) {
        rows.push(...item);
      } else if (Array.isArray(item.rows)) {
        rows.push(...item.rows);
      } else if (item.batch) {
        rows.push(...rowsFromArrowLike(item.batch));
      } else if (typeof item.getChild === "function" || typeof item.toArray === "function") {
        rows.push(...rowsFromArrowLike(item));
      }
    });
    return rows.map((row) => ({
      ...row,
      x: toFiniteNumber(row.x),
      y: toFiniteNumber(row.y),
      category: row.category == null ? void 0 : toFiniteNumber(row.category),
      color: row.color == null ? void 0 : row.color,
      value: row.value == null ? void 0 : toFiniteNumber(row.value),
      baseline: row.baseline == null ? void 0 : toFiniteNumber(row.baseline)
    })).filter((row) => row.x != null && row.y != null);
  }
  function plotRect(chart) {
    const margin = chart.margin || chart.config && chart.config.layout && chart.config.layout.margin || { top: 0, right: 0, bottom: 0, left: 0 };
    const width = Math.max(0, (chart.width || chart.runtime?.width || 0) - margin.left - margin.right);
    const height = Math.max(0, (chart.height || chart.runtime?.height || 0) - margin.top - margin.bottom);
    return { left: margin.left, top: margin.top, width, height };
  }
  function createOverlay(chart) {
    const element = chart.dom?.element || chart.element;
    const svgNode = chart.dom?.svg?.node ? chart.dom.svg.node() : element.querySelector("svg");
    const overlay = document.createElement("div");
    overlay.className = "myIO-webgl-overlay";
    overlay.style.position = "absolute";
    overlay.style.pointerEvents = "none";
    overlay.style.overflow = "hidden";
    overlay.style.zIndex = "0";
    const loading = document.createElement("div");
    loading.className = "myIO-webgl-loading";
    loading.textContent = "Loading data...";
    loading.style.position = "absolute";
    loading.style.left = "50%";
    loading.style.top = "50%";
    loading.style.transform = "translate(-50%, -50%)";
    loading.style.font = "12px sans-serif";
    loading.style.color = "#666";
    loading.style.background = "rgba(255,255,255,0.85)";
    loading.style.padding = "6px 8px";
    loading.style.border = "1px solid rgba(0,0,0,0.12)";
    overlay.appendChild(loading);
    if (svgNode && svgNode.parentNode === element) {
      element.insertBefore(overlay, svgNode);
    } else {
      element.appendChild(overlay);
    }
    syncOverlayGeometry(chart, overlay);
    return overlay;
  }
  function syncOverlayGeometry(chart, overlay) {
    const rect = plotRect(chart);
    overlay.style.left = rect.left + "px";
    overlay.style.top = rect.top + "px";
    overlay.style.width = rect.width + "px";
    overlay.style.height = rect.height + "px";
    return rect;
  }
  function emitChartEvent(chart, event, payload) {
    if (chart && typeof chart.emit === "function") {
      chart.emit(event, payload);
    }
  }
  function setMessage(overlay, className, text) {
    const current = overlay.querySelector(".myIO-webgl-loading,.myIO-webgl-empty");
    if (!text) {
      if (current) current.remove();
      return;
    }
    const node = current || document.createElement("div");
    node.className = className;
    node.textContent = text;
    node.style.position = "absolute";
    node.style.left = "50%";
    node.style.top = "50%";
    node.style.transform = "translate(-50%, -50%)";
    node.style.font = "12px sans-serif";
    node.style.color = "#666";
    node.style.background = "rgba(255,255,255,0.85)";
    node.style.padding = "6px 8px";
    node.style.border = "1px solid rgba(0,0,0,0.12)";
    if (!node.parentNode) overlay.appendChild(node);
  }
  function mapColorCategories(rows, colorLookup) {
    return rows.map((row) => {
      if (row.category != null || row.color == null) return row;
      const key = String(row.color);
      if (!colorLookup.has(key)) colorLookup.set(key, colorLookup.size);
      return { ...row, category: colorLookup.get(key) };
    });
  }
  function makeNearestIndex(chart, rows) {
    const xScale = chart.xScale;
    const yScale = chart.yScale;
    if (typeof xScale !== "function" || typeof yScale !== "function") {
      return null;
    }
    const d32 = globalThis.window && window.d3;
    if (d32 && typeof d32.quadtree === "function") {
      return d32.quadtree().x((d) => d.__px).y((d) => d.__py).addAll(rows.map((row) => ({ row, __px: xScale(row.x), __py: yScale(row.y) })));
    }
    return rows.map((row) => ({ row, __px: xScale(row.x), __py: yScale(row.y) }));
  }
  function findNearest(index, x, y) {
    if (!index) return null;
    if (typeof index.find === "function") return index.find(x, y, 16)?.row || null;
    let best = null;
    let bestDist = Infinity;
    index.forEach((entry) => {
      const dist2 = Math.hypot(entry.__px - x, entry.__py - y);
      if (dist2 < bestDist) {
        bestDist = dist2;
        best = entry.row;
      }
    });
    return bestDist <= 16 ? best : null;
  }
  function installHoverBridge(chart, getRows) {
    const svg = chart.dom?.svg?.node ? chart.dom.svg.node() : chart.element?.querySelector("svg");
    if (!svg) {
      return {
        rebuild() {
        },
        destroy() {
        }
      };
    }
    let index = null;
    let scheduled = false;
    let lastEvent = null;
    function rebuild() {
      index = makeNearestIndex(chart, getRows());
    }
    function onMove(event) {
      lastEvent = event;
      if (scheduled) return;
      scheduled = true;
      requestAnimationFrame(() => {
        scheduled = false;
        if (!index) rebuild();
        const rect = svg.getBoundingClientRect();
        const nearest = findNearest(index, lastEvent.clientX - rect.left, lastEvent.clientY - rect.top);
        if (nearest) emitChartEvent(chart, "rollover", { data: nearest, source: "webgl-bridge" });
      });
    }
    svg.addEventListener("mousemove", onMove);
    return {
      rebuild,
      destroy() {
        svg.removeEventListener("mousemove", onMove);
      }
    };
  }
  function installWebGLBridge({
    chart,
    coordinator,
    chartId,
    markSpec,
    createRenderer: createRenderer2,
    layerIndex = 0
  }) {
    const overlay = createOverlay(chart);
    const fallback = installSVGCoordinatorPath({ chart, layerIndex });
    const rendererFactory = createRenderer2 || globalThis.window && window.myIO && window.myIO.webglRenderers && window.myIO.webglRenderers.createWebGLRenderer;
    const colorLookup = /* @__PURE__ */ new Map();
    let renderer = null;
    let lastRows = [];
    let lastPayload = null;
    let destroyed = false;
    let fallbackActive = false;
    let resizeTimer = null;
    const hover = installHoverBridge(chart, () => lastRows);
    function activateFallback(reason, err) {
      if (fallbackActive || destroyed) return;
      fallbackActive = true;
      console.warn("[myIO webgl bridge] falling back to SVG:", reason, err || "");
      if (renderer && typeof renderer.destroy === "function") {
        try {
          renderer.destroy();
        } catch (_) {
        }
      }
      renderer = null;
      overlay.remove();
      if (lastPayload) fallback.onResult(lastPayload);
    }
    function ensureRenderer() {
      if (renderer || destroyed || fallbackActive) return renderer;
      if (typeof rendererFactory !== "function") {
        activateFallback("renderer unavailable");
        return null;
      }
      const rect = syncOverlayGeometry(chart, overlay);
      try {
        renderer = rendererFactory({
          kind: markSpec.kind,
          el: overlay,
          width: rect.width,
          height: rect.height,
          xScale: chart.xScale,
          yScale: chart.yScale
        });
      } catch (err) {
        activateFallback("renderer creation failed", err);
        return null;
      }
      const canvas = overlay.querySelector("canvas");
      if (!renderer) {
        activateFallback("renderer unavailable");
        return null;
      }
      if (canvas) {
        let context = null;
        try {
          context = canvas.getContext("webgl2") || canvas.getContext("webgl");
        } catch (_) {
          context = null;
        }
        if (!context) {
          activateFallback("WebGL context unavailable");
          return null;
        }
        canvas.addEventListener("webglcontextlost", (event) => {
          event.preventDefault();
          activateFallback("WebGL context lost");
        }, { once: true });
      }
      return renderer;
    }
    function handleTrailerError(payload) {
      const trailer = payload && payload.trailer;
      const error = trailer && (trailer.error || trailer.message);
      if (!error) return false;
      if (renderer && typeof renderer.update === "function") {
        Promise.resolve(renderer.update([])).catch(() => {
        });
      }
      emitChartEvent(chart, "error", {
        message: String(error),
        trailer,
        chartId
      });
      return true;
    }
    function onResult(payload) {
      if (destroyed) return;
      lastPayload = payload;
      if (fallbackActive) {
        fallback.onResult(payload);
        return;
      }
      if (handleTrailerError(payload)) return;
      lastRows = mapColorCategories(
        normalizeCoordinatorBatches(payload && payload.batches),
        colorLookup
      );
      hover.rebuild();
      const active = ensureRenderer();
      if (!active || typeof active.update !== "function") return;
      setMessage(overlay, lastRows.length ? null : "myIO-webgl-empty", lastRows.length ? "" : "No data in selection");
      if (!lastRows.length) emitChartEvent(chart, "emptySelection", { chartId });
      Promise.resolve(active.update(lastRows)).catch((err) => {
        activateFallback("render failed", err);
      });
    }
    function applyResize() {
      if (destroyed || fallbackActive) return;
      const rect = syncOverlayGeometry(chart, overlay);
      if (renderer && typeof renderer.resize === "function") {
        renderer.resize(rect.width, rect.height);
      }
      if (renderer && typeof renderer.update === "function") {
        Promise.resolve(renderer.update(lastRows)).catch((err) => {
          activateFallback("resize render failed", err);
        });
      }
    }
    function resize() {
      if (destroyed) return;
      if (resizeTimer) clearTimeout(resizeTimer);
      resizeTimer = setTimeout(applyResize, RESIZE_DEBOUNCE_MS2);
    }
    function destroy() {
      if (destroyed) return;
      destroyed = true;
      if (resizeTimer) clearTimeout(resizeTimer);
      if (coordinator && typeof coordinator.onChartResult === "function") {
        coordinator.onChartResult(chartId, null);
      }
      hover.destroy();
      fallback.destroy();
      if (renderer && typeof renderer.destroy === "function") {
        renderer.destroy();
      }
      overlay.remove();
    }
    if (chart && typeof chart.on === "function") {
      chart.on("resize", resize);
      chart.on("destroy", destroy);
    }
    return {
      onResult,
      resize,
      destroy,
      get pointCount() {
        return lastRows.length;
      },
      get overlay() {
        return fallbackActive ? void 0 : overlay;
      },
      get fallbackActive() {
        return fallbackActive;
      }
    };
  }
  function installSVGCoordinatorPath({ chart, layerIndex = 0 }) {
    let lastRows = [];
    let destroyed = false;
    function onResult(payload) {
      if (destroyed) return;
      const trailer = payload && payload.trailer;
      const error = trailer && (trailer.error || trailer.message);
      if (error) {
        emitChartEvent(chart, "error", { message: String(error), trailer });
        return;
      }
      lastRows = normalizeCoordinatorBatches(payload && payload.batches);
      if (chart.config && chart.config.layers && chart.config.layers[layerIndex]) {
        chart.config.layers[layerIndex].data = lastRows;
      }
      if (!lastRows.length) emitChartEvent(chart, "emptySelection", {});
      if (typeof chart.renderCurrentLayers === "function") {
        chart.renderCurrentLayers();
      }
    }
    function destroy() {
      destroyed = true;
    }
    if (chart && typeof chart.on === "function") {
      chart.on("destroy", destroy);
    }
    return {
      onResult,
      destroy,
      get pointCount() {
        return lastRows.length;
      }
    };
  }
  function createCoordinatorResultHandler(opts) {
    if (isWebGLEligible(opts)) {
      return installWebGLBridge(opts);
    }
    if (opts && opts.unifyDataPath) {
      return installSVGCoordinatorPath(opts);
    }
    return null;
  }

  // inst/htmlwidgets/myIO/src/crosstalk-adapter/index.js
  var CrosstalkAdapter = class {
    constructor({ coordinator, sourceId, group, rowkeyCol, threshold = 1e5 }) {
      if (!coordinator) throw new Error("CrosstalkAdapter: coordinator is required");
      if (!sourceId) throw new Error("CrosstalkAdapter: sourceId is required");
      this.coordinator = coordinator;
      this.sourceId = sourceId;
      this.group = group || null;
      this.rowkeyCol = rowkeyCol || "__myio_rowkey__";
      this.threshold = Number(threshold) || 1e5;
      this._selectionHandle = null;
      this._filterHandle = null;
      this._suppressedOnce = false;
      this._badgeEl = null;
      this._mode = "row-level";
    }
    /**
     * Attach to a crosstalk group. Expects window.crosstalk to be present
     * (htmlwidgets' crosstalk loader adds it when the widget ships with a
     * crosstalk shared dataset).
     */
    attach(group) {
      this.group = group || this.group;
      if (!this.group) return;
      if (typeof window === "undefined" || !window.crosstalk) return;
      const SelectionHandle = window.crosstalk.SelectionHandle;
      const FilterHandle = window.crosstalk.FilterHandle;
      if (!SelectionHandle) return;
      this._selectionHandle = new SelectionHandle(this.group);
      this._selectionHandle.on("change", (e) => this._onIncoming(e));
      if (FilterHandle) {
        this._filterHandle = new FilterHandle(this.group);
        this._filterHandle.on("change", (e) => this._onIncoming(e));
      }
    }
    /** Set the footer badge element (chart-provided). */
    setBadge(el) {
      this._badgeEl = el;
      this._renderBadge();
    }
    _renderBadge() {
      if (!this._badgeEl) return;
      this._badgeEl.textContent = "linked: " + this._mode;
    }
    /**
     * Incoming selection from a sibling widget. Convert row-keys to a
     * predicate and feed the coordinator.
     */
    _onIncoming(evt) {
      const keys2 = evt && (evt.value || evt.keys) || null;
      if (!keys2 || !Array.isArray(keys2) || keys2.length === 0) {
        this.coordinator.setSelection({
          chartId: "__crosstalk__:" + this.sourceId,
          predicate: null
        });
        return;
      }
      const quoted = keys2.map((k) => {
        if (k == null) return "NULL";
        const s = String(k).replace(/'/g, "''");
        return "'" + s + "'";
      });
      const col = '"' + this.rowkeyCol.replace(/"/g, '""') + '"';
      const predicate = col + " IN (" + quoted.join(",") + ")";
      this.coordinator.setSelection({
        chartId: "__crosstalk__:" + this.sourceId,
        predicate
      });
    }
    /**
     * Outgoing selection triggered by a local myIO chart. Called by the
     * chart-type glue when the user brushes locally. Size-gates the row-key
     * broadcast per the contract: issue count(*) first, broadcast only if
     * <= threshold, else suppress + one-shot info.
     */
    async broadcast({ predicate }) {
      if (!this._selectionHandle) {
        return;
      }
      if (predicate == null) {
        try {
          this._selectionHandle.set(null);
        } catch (_) {
        }
        return;
      }
      const countSql = this._countSql(predicate);
      const adapter = this.coordinator.adapters && this.coordinator.adapters.get(this.sourceId);
      if (!adapter) return;
      let count = 0;
      try {
        for await (const item of adapter.query({
          sql: countSql,
          params: [],
          queryId: "__xcount__" + Date.now()
        })) {
          if (!item || item.__trailer) continue;
          const rows = item.rows || item.batch && item.batch.toArray && item.batch.toArray() || [];
          if (rows[0]) {
            count = Number(rows[0].n ?? rows[0][0] ?? rows[0]["count(*)"] ?? 0);
          }
        }
      } catch (err) {
        console.warn("[myIO crosstalk] count query failed:", err?.message || err);
        return;
      }
      if (count > this.threshold) {
        if (!this._suppressedOnce) {
          console.info(
            "myIO: selection above crosstalk_threshold (" + count + " > " + this.threshold + "); downstream row-indexed widgets will not react to this selection. myIO-to-myIO linking still works."
          );
          this._suppressedOnce = true;
        }
        this._mode = "predicate-only";
        this._renderBadge();
        return;
      }
      const keys2 = await this._fetchKeys(predicate);
      if (keys2 && keys2.length > 0) {
        try {
          this._selectionHandle.set(keys2);
        } catch (_) {
        }
      }
      this._mode = "row-level";
      this._renderBadge();
    }
    _countSql(predicate) {
      const src = '"' + this.sourceId.replace(/"/g, '""') + '"';
      return "SELECT count(*) AS n FROM " + src + " WHERE " + predicate;
    }
    async _fetchKeys(predicate) {
      const adapter = this.coordinator.adapters && this.coordinator.adapters.get(this.sourceId);
      if (!adapter) return [];
      const src = '"' + this.sourceId.replace(/"/g, '""') + '"';
      const col = '"' + this.rowkeyCol.replace(/"/g, '""') + '"';
      const sql = "SELECT " + col + " AS rowkey FROM " + src + " WHERE " + predicate;
      const keys2 = [];
      try {
        for await (const item of adapter.query({
          sql,
          params: [],
          queryId: "__xkeys__" + Date.now()
        })) {
          if (!item || item.__trailer) continue;
          const rows = item.rows || item.batch && item.batch.toArray && item.batch.toArray() || [];
          for (const r of rows) {
            const k = r && (r.rowkey ?? r[0]);
            if (k != null) keys2.push(String(k));
          }
        }
      } catch (err) {
        console.warn("[myIO crosstalk] key fetch failed:", err?.message || err);
      }
      return keys2;
    }
    destroy() {
      try {
        if (this._selectionHandle) this._selectionHandle.close();
      } catch (_) {
      }
      try {
        if (this._filterHandle) this._filterHandle.close();
      } catch (_) {
      }
      this._selectionHandle = null;
      this._filterHandle = null;
    }
  };

  // inst/htmlwidgets/myIO/src/renderers/webgl/scatter.js
  var WebGLScatter = class {
    /**
     * @param {object} opts
     * @param {HTMLElement} opts.el        container element
     * @param {number} opts.width
     * @param {number} opts.height
     * @param {{ domain:()=>[number,number], range:()=>[number,number] }} opts.xScale  d3 scale
     * @param {{ domain:()=>[number,number], range:()=>[number,number] }} opts.yScale  d3 scale
     * @param {Array<string>=} opts.palette  color palette (hex strings), default viridis-like
     */
    constructor({ el, width, height, xScale, yScale, palette, captureHoverEvents = false }) {
      this.el = el;
      this.width = width;
      this.height = height;
      this.xScale = xScale;
      this.yScale = yScale;
      this.captureHoverEvents = captureHoverEvents !== false;
      this.palette = palette || ["#440154", "#414487", "#2a788e", "#22a884", "#7ad151", "#fde725"];
      this._scatterplot = null;
      this._destroyed = false;
    }
    _scaleCopy(scale) {
      return scale && typeof scale.copy === "function" ? scale.copy() : scale;
    }
    async _ensure() {
      if (this._scatterplot) return this._scatterplot;
      const mod = await Promise.resolve().then(() => (init_regl_scatterplot_esm(), regl_scatterplot_esm_exports));
      const createScatterplot2 = mod.default || mod.createScatterplot;
      const canvas = document.createElement("canvas");
      canvas.width = this.width;
      canvas.height = this.height;
      canvas.style.position = "absolute";
      canvas.style.top = "0";
      canvas.style.left = "0";
      canvas.style.pointerEvents = this.captureHoverEvents ? "auto" : "none";
      this.el.appendChild(canvas);
      this._scatterplot = createScatterplot2({
        canvas,
        width: this.width,
        height: this.height,
        pointSize: 3,
        backgroundColor: [1, 1, 1, 0],
        colorBy: "category",
        pointColor: this.palette,
        xScale: this._scaleCopy(this.xScale),
        yScale: this._scaleCopy(this.yScale)
      });
      this._applyScales();
      return this._scatterplot;
    }
    _applyScales() {
      if (!this._scatterplot || !this.xScale || !this.yScale) return;
      if (typeof this._scatterplot.setXScale === "function") {
        this._scatterplot.setXScale(this._scaleCopy(this.xScale));
      }
      if (typeof this._scatterplot.setYScale === "function") {
        this._scatterplot.setYScale(this._scaleCopy(this.yScale));
      }
      if (typeof this._scatterplot.set === "function" && (typeof this._scatterplot.setXScale !== "function" || typeof this._scatterplot.setYScale !== "function")) {
        this._scatterplot.set({
          xScale: this._scaleCopy(this.xScale),
          yScale: this._scaleCopy(this.yScale)
        });
      }
    }
    /**
     * Accept aggregated rows (from coordinator) and render them.
     * @param {Array<{x:number,y:number,category?:number}>} rows
     */
    async update(rows) {
      if (this._destroyed) return;
      const sp = await this._ensure();
      if (!rows || rows.length === 0) {
        sp.clear();
        return;
      }
      const pts = {
        x: new Float32Array(rows.length),
        y: new Float32Array(rows.length),
        category: new Float32Array(rows.length),
        value: new Float32Array(rows.length)
      };
      for (let i = 0; i < rows.length; i++) {
        const r = rows[i];
        pts.x[i] = r.x;
        pts.y[i] = r.y;
        pts.category[i] = r.category == null ? 0 : r.category;
        pts.value[i] = r.value == null ? 1 : r.value;
      }
      await sp.draw(pts);
    }
    /**
     * Accept an arrow Table and render (convenience for coordinator integration).
     * Expects columns named "x" and "y", optional "category".
     */
    async updateArrow(table) {
      if (!table) return;
      const xCol = table.getChild ? table.getChild("x") : null;
      const yCol = table.getChild ? table.getChild("y") : null;
      if (!xCol || !yCol) {
        console.warn("[WebGLScatter] update: Arrow Table must have 'x' and 'y' columns");
        return;
      }
      const len = table.numRows || table.length || xCol.length;
      const rows = new Array(len);
      const catCol = table.getChild("category");
      for (let i = 0; i < len; i++) {
        rows[i] = {
          x: Number(xCol.get(i)),
          y: Number(yCol.get(i)),
          category: catCol ? Number(catCol.get(i)) : 0
        };
      }
      return this.update(rows);
    }
    /**
     * Picker: (screen x, screen y) -> index into last rendered rows, or -1.
     * Uses regl-scatterplot's built-in hover/pick.
     */
    hitTest(x, y) {
      if (!this._scatterplot) return -1;
      return this._scatterplot.pickPointInScreen ? this._scatterplot.pickPointInScreen(x, y) : -1;
    }
    resize(width, height) {
      if (this._destroyed) return;
      this.width = width;
      this.height = height;
      if (this._scatterplot) {
        this._scatterplot.set({ width, height });
      }
    }
    setTransform(t) {
      if (!this._scatterplot || !t) return;
      if (typeof this._scatterplot.set === "function") {
        this._scatterplot.set({
          cameraView: [t.k || 1, t.x || 0, t.y || 0]
        });
      }
    }
    destroy() {
      this._destroyed = true;
      if (this._scatterplot) {
        try {
          this._scatterplot.destroy();
        } catch (_) {
        }
        this._scatterplot = null;
      }
    }
  };

  // inst/htmlwidgets/myIO/src/renderers/webgl/line.js
  var WebGLLine = class {
    constructor({ el, width, height, xScale, yScale, color }) {
      this.el = el;
      this.width = width;
      this.height = height;
      this.xScale = xScale;
      this.yScale = yScale;
      this.color = color || [0.13, 0.45, 0.7, 1];
      this._regl = null;
      this._drawLine = null;
      this._destroyed = false;
      this._vertexCount = 0;
    }
    async _ensure() {
      if (this._regl) return;
      const reglMod = await Promise.resolve().then(() => __toESM(require_regl()));
      const regl = reglMod.default || reglMod;
      const canvas = document.createElement("canvas");
      canvas.width = this.width;
      canvas.height = this.height;
      canvas.style.position = "absolute";
      canvas.style.top = "0";
      canvas.style.left = "0";
      canvas.style.pointerEvents = "none";
      this.el.appendChild(canvas);
      this._regl = regl({
        canvas,
        attributes: { antialias: true, preserveDrawingBuffer: false }
      });
      this._drawLine = this._regl({
        vert: `
        precision mediump float;
        attribute vec2 position;
        uniform vec2 xDomain;
        uniform vec2 yDomain;
        void main() {
          // Normalize to [-1, 1] clip space.
          float nx = (position.x - xDomain.x) / (xDomain.y - xDomain.x) * 2.0 - 1.0;
          float ny = (position.y - yDomain.x) / (yDomain.y - yDomain.x) * 2.0 - 1.0;
          gl_Position = vec4(nx, ny, 0.0, 1.0);
        }
      `,
        frag: `
        precision mediump float;
        uniform vec4 color;
        void main() { gl_FragColor = color; }
      `,
        attributes: {
          position: this._regl.prop("position")
        },
        uniforms: {
          xDomain: this._regl.prop("xDomain"),
          yDomain: this._regl.prop("yDomain"),
          color: this._regl.prop("color")
        },
        count: this._regl.prop("count"),
        primitive: "line strip"
      });
      this._buffer = this._regl.buffer({
        type: "float32",
        usage: "dynamic",
        length: 0
      });
    }
    async update(points) {
      if (this._destroyed) return;
      await this._ensure();
      if (!points || points.length === 0) {
        this._regl.clear({ color: [0, 0, 0, 0] });
        this._vertexCount = 0;
        return;
      }
      const flat = new Float32Array(points.length * 2);
      for (let i = 0; i < points.length; i++) {
        flat[i * 2] = points[i].x;
        flat[i * 2 + 1] = points[i].y;
      }
      this._buffer({ data: flat });
      this._vertexCount = points.length;
      const xDom = this.xScale.domain();
      const yDom = this.yScale.domain();
      this._regl.clear({ color: [0, 0, 0, 0] });
      this._drawLine({
        position: this._buffer,
        xDomain: [xDom[0], xDom[1]],
        yDomain: [yDom[0], yDom[1]],
        color: this.color,
        count: this._vertexCount
      });
    }
    async updateArrow(table) {
      if (!table || !table.getChild) return;
      const xCol = table.getChild("x");
      const yCol = table.getChild("y");
      if (!xCol || !yCol) return;
      const len = table.numRows || xCol.length;
      const pts = new Array(len);
      for (let i = 0; i < len; i++) {
        pts[i] = { x: Number(xCol.get(i)), y: Number(yCol.get(i)) };
      }
      return this.update(pts);
    }
    resize(width, height) {
      this.width = width;
      this.height = height;
      if (this._regl) this._regl.poll();
    }
    destroy() {
      this._destroyed = true;
      if (this._regl) {
        try {
          this._regl.destroy();
        } catch (_) {
        }
        this._regl = null;
      }
    }
  };

  // inst/htmlwidgets/myIO/src/renderers/webgl/area.js
  var WebGLArea = class {
    constructor({ el, width, height, xScale, yScale, color, baseline }) {
      this.el = el;
      this.width = width;
      this.height = height;
      this.xScale = xScale;
      this.yScale = yScale;
      this.color = color || [0.13, 0.45, 0.7, 0.35];
      this.baseline = baseline != null ? baseline : null;
      this._regl = null;
      this._draw = null;
      this._destroyed = false;
    }
    async _ensure() {
      if (this._regl) return;
      const reglMod = await Promise.resolve().then(() => __toESM(require_regl()));
      const regl = reglMod.default || reglMod;
      const canvas = document.createElement("canvas");
      canvas.width = this.width;
      canvas.height = this.height;
      canvas.style.position = "absolute";
      canvas.style.top = "0";
      canvas.style.left = "0";
      canvas.style.pointerEvents = "none";
      this.el.appendChild(canvas);
      this._regl = regl({
        canvas,
        attributes: { antialias: true, preserveDrawingBuffer: false }
      });
      this._draw = this._regl({
        vert: `
        precision mediump float;
        attribute vec2 position;
        uniform vec2 xDomain;
        uniform vec2 yDomain;
        void main() {
          float nx = (position.x - xDomain.x) / (xDomain.y - xDomain.x) * 2.0 - 1.0;
          float ny = (position.y - yDomain.x) / (yDomain.y - yDomain.x) * 2.0 - 1.0;
          gl_Position = vec4(nx, ny, 0.0, 1.0);
        }
      `,
        frag: `
        precision mediump float;
        uniform vec4 color;
        void main() { gl_FragColor = color; }
      `,
        attributes: { position: this._regl.prop("position") },
        uniforms: {
          xDomain: this._regl.prop("xDomain"),
          yDomain: this._regl.prop("yDomain"),
          color: this._regl.prop("color")
        },
        count: this._regl.prop("count"),
        primitive: "triangle strip"
      });
      this._buffer = this._regl.buffer({
        type: "float32",
        usage: "dynamic",
        length: 0
      });
    }
    async update(points) {
      if (this._destroyed) return;
      await this._ensure();
      if (!points || points.length === 0) {
        this._regl.clear({ color: [0, 0, 0, 0] });
        return;
      }
      const flat = new Float32Array(points.length * 4);
      for (let i = 0; i < points.length; i++) {
        const base = points[i].baseline != null ? points[i].baseline : this.baseline != null ? this.baseline : this.yScale.domain()[0];
        flat[i * 4] = points[i].x;
        flat[i * 4 + 1] = points[i].y;
        flat[i * 4 + 2] = points[i].x;
        flat[i * 4 + 3] = base;
      }
      this._buffer({ data: flat });
      const xDom = this.xScale.domain();
      const yDom = this.yScale.domain();
      this._regl.clear({ color: [0, 0, 0, 0] });
      this._draw({
        position: this._buffer,
        xDomain: [xDom[0], xDom[1]],
        yDomain: [yDom[0], yDom[1]],
        color: this.color,
        count: points.length * 2
      });
    }
    async updateArrow(table) {
      if (!table || !table.getChild) return;
      const xCol = table.getChild("x");
      const yCol = table.getChild("y");
      if (!xCol || !yCol) return;
      const len = table.numRows || xCol.length;
      const pts = new Array(len);
      const baseCol = table.getChild("baseline");
      for (let i = 0; i < len; i++) {
        pts[i] = {
          x: Number(xCol.get(i)),
          y: Number(yCol.get(i)),
          baseline: baseCol ? Number(baseCol.get(i)) : void 0
        };
      }
      return this.update(pts);
    }
    resize(width, height) {
      this.width = width;
      this.height = height;
      if (this._regl) this._regl.poll();
    }
    destroy() {
      this._destroyed = true;
      if (this._regl) {
        try {
          this._regl.destroy();
        } catch (_) {
        }
        this._regl = null;
      }
    }
  };

  // inst/htmlwidgets/myIO/src/renderers/webgl/index.js
  var RENDERERS = {
    scatter: WebGLScatter,
    line: WebGLLine,
    area: WebGLArea
    // beeswarm: intentionally absent; see createBeeswarmPipeline below.
  };
  function createWebGLRenderer(opts) {
    const Cls = RENDERERS[opts.kind];
    if (!Cls) return null;
    return new Cls(opts);
  }
  function createBeeswarmPipeline({
    el,
    width,
    height,
    xScale,
    yScale,
    palette,
    workerUrl
  }) {
    const scatter = new WebGLScatter({ el, width, height, xScale, yScale, palette });
    let worker3 = null;
    let lastPositions = null;
    async function layout(points, { collideRadius = 3, iterations = 120 } = {}) {
      return new Promise((resolve, reject) => {
        if (!workerUrl) {
          return reject(new Error(
            "createBeeswarmPipeline: workerUrl is required. Typically '<htmlwidgets-asset-root>/workers/beeswarm-layout.js' built by `npm run build:worker`."
          ));
        }
        if (!worker3) {
          worker3 = new Worker(workerUrl, { type: "module" });
        }
        const onMsg = async (evt) => {
          worker3.removeEventListener("message", onMsg);
          if (evt.data?.error) return reject(new Error(evt.data.error));
          lastPositions = evt.data.positions;
          const rows = new Array(points.length);
          for (let i = 0; i < points.length; i++) {
            rows[i] = {
              x: lastPositions[i * 2],
              y: lastPositions[i * 2 + 1],
              category: points[i].category || 0
            };
          }
          await scatter.update(rows);
          resolve(rows);
        };
        worker3.addEventListener("message", onMsg);
        const xDesc = {
          domain: xScale.domain ? xScale.domain() : [0, 1],
          range: xScale.range ? xScale.range() : [0, width]
        };
        const yDesc = {
          domain: yScale.domain ? yScale.domain() : [0, 1],
          range: yScale.range ? yScale.range() : [0, height]
        };
        worker3.postMessage({
          points,
          xScale: xDesc,
          yScale: yDesc,
          collideRadius,
          iterations
        });
      });
    }
    function destroy() {
      if (worker3) {
        try {
          worker3.terminate();
        } catch (_) {
        }
        worker3 = null;
      }
      if (scatter) scatter.destroy();
    }
    return {
      layout,
      destroy,
      scatter,
      get positions() {
        return lastPositions;
      }
    };
  }

  // inst/htmlwidgets/myIO/src/index.js
  if (typeof window !== "undefined") {
    window.myIO = window.myIO || {};
    window.myIO.Coordinator = Coordinator;
    window.myIO.bootCoordinator = bootCoordinator;
    window.myIO.CrosstalkAdapter = CrosstalkAdapter;
    window.myIO.createEngine = createEngine;
    window.myIO.createCoordinatorResultHandler = createCoordinatorResultHandler;
    window.myIO.installWebGLBridge = installWebGLBridge;
    window.myIO.installSVGCoordinatorPath = installSVGCoordinatorPath;
    window.myIO.normalizeCoordinatorBatches = normalizeCoordinatorBatches;
    window.myIO.isWebGLEligible = isWebGLEligible;
    window.myIO.getCoordinator = function() {
      return globalThis.__myioCoordinator || null;
    };
    window.myIO.webglRenderers = {
      createWebGLRenderer,
      createBeeswarmPipeline,
      WebGLScatter,
      WebGLLine,
      WebGLArea
    };
  }
  registerBuiltInRenderers();
  window.myIOchart = myIOchart;
})();
/*!
 * Vendored FileSaver.js for phase-1 modularization.
 * Source: http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js
 */
/*! Bundled license information:

alasql/dist/alasql.min.js:
  (*! AlaSQL v4.17.1 build: develop-a8ee499a | © 2014-2025 Andrey Gershun & Mathias Wulff | License: MIT *)
  (*
  @module alasql
  @version 4.17.1
  
  AlaSQL - JavaScript SQL database
  © 2014-2025	Andrey Gershun & Mathias Wulff
  
  @license
  The MIT License (MIT)
  
  Copyright 2014-2025 Andrey Gershun (agershun@gmail.com) & Mathias Wulff (m@rawu.dk)
  
  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to deal
  in the Software without restriction, including without limitation the rights
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  copies of the Software, and to permit persons to whom the Software is
  furnished to do so, subject to the following conditions:
  
  The above copyright notice and this permission notice shall be included in all
  copies or substantial portions of the Software.
  
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  SOFTWARE.
  *)
  (*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js *)

regl-scatterplot/dist/regl-scatterplot.esm.js:
  (**
   * KDBush - A fast static index for 2D points
   * @license ISC License
   * @copyright Vladimir Agafonkin 2018
   * @version 4.0.2
   * @see https://github.com/mourner/kdbush/
   *)
  (**
   * Douglas Peucker square segment distance
   * Implementation from https://github.com/mourner/simplify-js
   * @author Vladimir Agafonkin
   * @copyright Vladimir Agafonkin 2013
   * @license BSD
   * @param {array} p - Point
   * @param {array} p1 - First boundary point
   * @param {array} p2 - Second boundary point
   * @return {number} Distance
   *)
  (**
   * Douglas Peucker step function
   * Implementation from https://github.com/mourner/simplify-js
   * @author Vladimir Agafonkin
   * @copyright Vladimir Agafonkin 2013
   * @license BSD
   * @param   {[type]}  points  [description]
   * @param   {[type]}  first  [description]
   * @param   {[type]}  last  [description]
   * @param   {[type]}  tolerance  [description]
   * @param   {[type]}  simplified  [description]
   * @return  {[type]}  [description]
   *)
  (**
   * Douglas Peucker. Implementation from https://github.com/mourner/simplify-js
   * @author Vladimir Agafonkin
   * @copyright Vladimir Agafonkin 2013
   * @license BSD
   * @param {array} points - List of points to be simplified
   * @param {number} tolerance - Tolerance level. Points below this distance level will be ignored
   * @return {array} Simplified point list
   *)
*/
