import * as Ze from "path";
import be, { join as gm, dirname as $u } from "path";
import * as Ae from "fs";
import de, { existsSync as Vc, readFileSync as XU, openSync as ZU, readSync as eL, closeSync as tL, mkdirSync as nL, statSync as $2, writeFileSync as rL, promises as $s, createWriteStream as sO } from "fs";
import Ot, { stat as iL, readdir as G2, unlink as q2 } from "fs/promises";
import { ReadableStream as oL } from "node:stream/web";
import * as sL from "node:stream";
import aL, { Readable as aO, PassThrough as cL, pipeline as H2 } from "node:stream";
import Un, { open as uL, stat as cO, writeFile as lL, constants as Ia, unlink as q_, readFile as pL, readdir as dL } from "node:fs/promises";
import { createRequire as uO } from "module";
import W2 from "node:https";
import Gp from "node:http";
import * as Ng from "crypto";
import Si, { randomUUID as Do, createHmac as fL, createHash as hL } from "crypto";
import * as Tw from "node:path";
import xe, { basename as lO, resolve as kn, join as yn, normalize as z2, dirname as H_ } from "node:path";
import mL from "node:tls";
import dt, { platform as pO, arch as gL, constants as dO } from "node:os";
import * as W_ from "https";
import Gu, { createServer as yL } from "https";
import fc, { createServer as vL } from "http";
import * as Af from "node:fs";
import Ge, { readFileSync as Fo, statSync as bL, createReadStream as xL, openSync as wL, readSync as SL, closeSync as _L, existsSync as sr, readdirSync as fO, writeFileSync as z_, promises as lu, mkdirSync as hO, unlink as EL } from "node:fs";
import * as mO from "node:crypto";
import bs, { createHash as _d, pbkdf2Sync as K2, createDecipheriv as AL, randomBytes as IL, randomUUID as CL } from "node:crypto";
import * as Vs from "os";
import Pn from "os";
import * as gO from "node:net";
import TL, { isIP as yO } from "node:net";
import kL from "node:assert";
import * as vO from "node:zlib";
import bO from "node:zlib";
import { dlopen as NL } from "node:process";
import { execFile as PL, fork as DL } from "child_process";
import _n, { promisify as FL } from "util";
import ir, { PassThrough as OL, Writable as ML } from "stream";
import qu, { gunzipSync as V2 } from "zlib";
import xs, { EventEmitter as RL } from "events";
import pa from "buffer";
import BL from "constants";
import K_ from "string_decoder";
import UL from "assert";
import { pipeline as V_ } from "stream/promises";
import { fileURLToPath as hc, URL as xO } from "url";
import wO, { EventEmitter as LL } from "node:events";
import ru, { Router as yr } from "express";
import { fileURLToPath as Pg } from "node:url";
import { WebSocketServer as qp, WebSocket as fr } from "ws";
import * as jL from "net";
import { Socket as Y2 } from "net";
import { Worker as QL } from "worker_threads";
import { C as $L, g as GL } from "./conout-wiJ7YKRd.js";
import * as Ty from "tty";
import { Buffer as qL } from "node:buffer";
import * as wo from "process";
function SO(t) {
  let e = typeof t;
  if (e == "object") {
    if (Array.isArray(t))
      return "array";
    if (t === null)
      return "null";
  }
  return e;
}
function HL(t) {
  return t !== null && typeof t == "object" && !Array.isArray(t);
}
let Zo = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), Dg = [];
for (let t = 0; t < Zo.length; t++)
  Dg[Zo[t].charCodeAt(0)] = t;
Dg[45] = Zo.indexOf("+");
Dg[95] = Zo.indexOf("/");
function WL(t) {
  let e = t.length * 3 / 4;
  t[t.length - 2] == "=" ? e -= 2 : t[t.length - 1] == "=" && (e -= 1);
  let n = new Uint8Array(e), r = 0, i = 0, o, s = 0;
  for (let a = 0; a < t.length; a++) {
    if (o = Dg[t.charCodeAt(a)], o === void 0)
      switch (t[a]) {
        case "=":
          i = 0;
        // reset state when padding found
        case `
`:
        case "\r":
        case "	":
        case " ":
          continue;
        // skip white-space, and padding
        default:
          throw Error("invalid base64 string.");
      }
    switch (i) {
      case 0:
        s = o, i = 1;
        break;
      case 1:
        n[r++] = s << 2 | (o & 48) >> 4, s = o, i = 2;
        break;
      case 2:
        n[r++] = (s & 15) << 4 | (o & 60) >> 2, s = o, i = 3;
        break;
      case 3:
        n[r++] = (s & 3) << 6 | o, i = 0;
        break;
    }
  }
  if (i == 1)
    throw Error("invalid base64 string.");
  return n.subarray(0, r);
}
function zL(t) {
  let e = "", n = 0, r, i = 0;
  for (let o = 0; o < t.length; o++)
    switch (r = t[o], n) {
      case 0:
        e += Zo[r >> 2], i = (r & 3) << 4, n = 1;
        break;
      case 1:
        e += Zo[i | r >> 4], i = (r & 15) << 2, n = 2;
        break;
      case 2:
        e += Zo[i | r >> 6], e += Zo[r & 63], n = 0;
        break;
    }
  return n && (e += Zo[i], e += "=", n == 1 && (e += "=")), e;
}
var ym;
(function(t) {
  t.symbol = Symbol.for("protobuf-ts/unknown"), t.onRead = (n, r, i, o, s) => {
    (e(r) ? r[t.symbol] : r[t.symbol] = []).push({ no: i, wireType: o, data: s });
  }, t.onWrite = (n, r, i) => {
    for (let { no: o, wireType: s, data: a } of t.list(r))
      i.tag(o, s).raw(a);
  }, t.list = (n, r) => {
    if (e(n)) {
      let i = n[t.symbol];
      return r ? i.filter((o) => o.no == r) : i;
    }
    return [];
  }, t.last = (n, r) => t.list(n, r).slice(-1)[0];
  const e = (n) => n && Array.isArray(n[t.symbol]);
})(ym || (ym = {}));
var un;
(function(t) {
  t[t.Varint = 0] = "Varint", t[t.Bit64 = 1] = "Bit64", t[t.LengthDelimited = 2] = "LengthDelimited", t[t.StartGroup = 3] = "StartGroup", t[t.EndGroup = 4] = "EndGroup", t[t.Bit32 = 5] = "Bit32";
})(un || (un = {}));
function KL() {
  let t = 0, e = 0;
  for (let r = 0; r < 28; r += 7) {
    let i = this.buf[this.pos++];
    if (t |= (i & 127) << r, (i & 128) == 0)
      return this.assertBounds(), [t, e];
  }
  let n = this.buf[this.pos++];
  if (t |= (n & 15) << 28, e = (n & 112) >> 4, (n & 128) == 0)
    return this.assertBounds(), [t, e];
  for (let r = 3; r <= 31; r += 7) {
    let i = this.buf[this.pos++];
    if (e |= (i & 127) << r, (i & 128) == 0)
      return this.assertBounds(), [t, e];
  }
  throw new Error("invalid varint");
}
function ky(t, e, n) {
  for (let o = 0; o < 28; o = o + 7) {
    const s = t >>> o, a = !(!(s >>> 7) && e == 0), c = (a ? s | 128 : s) & 255;
    if (n.push(c), !a)
      return;
  }
  const r = t >>> 28 & 15 | (e & 7) << 4, i = e >> 3 != 0;
  if (n.push((i ? r | 128 : r) & 255), !!i) {
    for (let o = 3; o < 31; o = o + 7) {
      const s = e >>> o, a = !!(s >>> 7), c = (a ? s | 128 : s) & 255;
      if (n.push(c), !a)
        return;
    }
    n.push(e >>> 31 & 1);
  }
}
const zh = 65536 * 65536;
function _O(t) {
  let e = t[0] == "-";
  e && (t = t.slice(1));
  const n = 1e6;
  let r = 0, i = 0;
  function o(s, a) {
    const c = Number(t.slice(s, a));
    i *= n, r = r * n + c, r >= zh && (i = i + (r / zh | 0), r = r % zh);
  }
  return o(-24, -18), o(-18, -12), o(-12, -6), o(-6), [e, r, i];
}
function kw(t, e) {
  if (e >>> 0 <= 2097151)
    return "" + (zh * e + (t >>> 0));
  let n = t & 16777215, r = (t >>> 24 | e << 8) >>> 0 & 16777215, i = e >> 16 & 65535, o = n + r * 6777216 + i * 6710656, s = r + i * 8147497, a = i * 2, c = 1e7;
  o >= c && (s += Math.floor(o / c), o %= c), s >= c && (a += Math.floor(s / c), s %= c);
  function u(l, d) {
    let f = l ? String(l) : "";
    return d ? "0000000".slice(f.length) + f : f;
  }
  return u(
    a,
    /*needLeadingZeros=*/
    0
  ) + u(
    s,
    /*needLeadingZeros=*/
    a
  ) + // If the final 1e7 digit didn't need leading zeros, we would have
  // returned via the trivial code path at the top.
  u(
    o,
    /*needLeadingZeros=*/
    1
  );
}
function J2(t, e) {
  if (t >= 0) {
    for (; t > 127; )
      e.push(t & 127 | 128), t = t >>> 7;
    e.push(t);
  } else {
    for (let n = 0; n < 9; n++)
      e.push(t & 127 | 128), t = t >> 7;
    e.push(1);
  }
}
function VL() {
  let t = this.buf[this.pos++], e = t & 127;
  if ((t & 128) == 0)
    return this.assertBounds(), e;
  if (t = this.buf[this.pos++], e |= (t & 127) << 7, (t & 128) == 0)
    return this.assertBounds(), e;
  if (t = this.buf[this.pos++], e |= (t & 127) << 14, (t & 128) == 0)
    return this.assertBounds(), e;
  if (t = this.buf[this.pos++], e |= (t & 127) << 21, (t & 128) == 0)
    return this.assertBounds(), e;
  t = this.buf[this.pos++], e |= (t & 15) << 28;
  for (let n = 5; (t & 128) !== 0 && n < 10; n++)
    t = this.buf[this.pos++];
  if ((t & 128) != 0)
    throw new Error("invalid varint");
  return this.assertBounds(), e >>> 0;
}
let Mt;
function YL() {
  const t = new DataView(new ArrayBuffer(8));
  Mt = globalThis.BigInt !== void 0 && typeof t.getBigInt64 == "function" && typeof t.getBigUint64 == "function" && typeof t.setBigInt64 == "function" && typeof t.setBigUint64 == "function" ? {
    MIN: BigInt("-9223372036854775808"),
    MAX: BigInt("9223372036854775807"),
    UMIN: BigInt("0"),
    UMAX: BigInt("18446744073709551615"),
    C: BigInt,
    V: t
  } : void 0;
}
YL();
function EO(t) {
  if (!t)
    throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support");
}
const AO = /^-?[0-9]+$/, vm = 4294967296, If = 2147483648;
class IO {
  /**
   * Create a new instance with the given bits.
   */
  constructor(e, n) {
    this.lo = e | 0, this.hi = n | 0;
  }
  /**
   * Is this instance equal to 0?
   */
  isZero() {
    return this.lo == 0 && this.hi == 0;
  }
  /**
   * Convert to a native number.
   */
  toNumber() {
    let e = this.hi * vm + (this.lo >>> 0);
    if (!Number.isSafeInteger(e))
      throw new Error("cannot convert to safe number");
    return e;
  }
}
class mr extends IO {
  /**
   * Create instance from a `string`, `number` or `bigint`.
   */
  static from(e) {
    if (Mt)
      switch (typeof e) {
        case "string":
          if (e == "0")
            return this.ZERO;
          if (e == "")
            throw new Error("string is no integer");
          e = Mt.C(e);
        case "number":
          if (e === 0)
            return this.ZERO;
          e = Mt.C(e);
        case "bigint":
          if (!e)
            return this.ZERO;
          if (e < Mt.UMIN)
            throw new Error("signed value for ulong");
          if (e > Mt.UMAX)
            throw new Error("ulong too large");
          return Mt.V.setBigUint64(0, e, !0), new mr(Mt.V.getInt32(0, !0), Mt.V.getInt32(4, !0));
      }
    else
      switch (typeof e) {
        case "string":
          if (e == "0")
            return this.ZERO;
          if (e = e.trim(), !AO.test(e))
            throw new Error("string is no integer");
          let [n, r, i] = _O(e);
          if (n)
            throw new Error("signed value for ulong");
          return new mr(r, i);
        case "number":
          if (e == 0)
            return this.ZERO;
          if (!Number.isSafeInteger(e))
            throw new Error("number is no integer");
          if (e < 0)
            throw new Error("signed value for ulong");
          return new mr(e, e / vm);
      }
    throw new Error("unknown value " + typeof e);
  }
  /**
   * Convert to decimal string.
   */
  toString() {
    return Mt ? this.toBigInt().toString() : kw(this.lo, this.hi);
  }
  /**
   * Convert to native bigint.
   */
  toBigInt() {
    return EO(Mt), Mt.V.setInt32(0, this.lo, !0), Mt.V.setInt32(4, this.hi, !0), Mt.V.getBigUint64(0, !0);
  }
}
mr.ZERO = new mr(0, 0);
class dn extends IO {
  /**
   * Create instance from a `string`, `number` or `bigint`.
   */
  static from(e) {
    if (Mt)
      switch (typeof e) {
        case "string":
          if (e == "0")
            return this.ZERO;
          if (e == "")
            throw new Error("string is no integer");
          e = Mt.C(e);
        case "number":
          if (e === 0)
            return this.ZERO;
          e = Mt.C(e);
        case "bigint":
          if (!e)
            return this.ZERO;
          if (e < Mt.MIN)
            throw new Error("signed long too small");
          if (e > Mt.MAX)
            throw new Error("signed long too large");
          return Mt.V.setBigInt64(0, e, !0), new dn(Mt.V.getInt32(0, !0), Mt.V.getInt32(4, !0));
      }
    else
      switch (typeof e) {
        case "string":
          if (e == "0")
            return this.ZERO;
          if (e = e.trim(), !AO.test(e))
            throw new Error("string is no integer");
          let [n, r, i] = _O(e);
          if (n) {
            if (i > If || i == If && r != 0)
              throw new Error("signed long too small");
          } else if (i >= If)
            throw new Error("signed long too large");
          let o = new dn(r, i);
          return n ? o.negate() : o;
        case "number":
          if (e == 0)
            return this.ZERO;
          if (!Number.isSafeInteger(e))
            throw new Error("number is no integer");
          return e > 0 ? new dn(e, e / vm) : new dn(-e, -e / vm).negate();
      }
    throw new Error("unknown value " + typeof e);
  }
  /**
   * Do we have a minus sign?
   */
  isNegative() {
    return (this.hi & If) !== 0;
  }
  /**
   * Negate two's complement.
   * Invert all the bits and add one to the result.
   */
  negate() {
    let e = ~this.hi, n = this.lo;
    return n ? n = ~n + 1 : e += 1, new dn(n, e);
  }
  /**
   * Convert to decimal string.
   */
  toString() {
    if (Mt)
      return this.toBigInt().toString();
    if (this.isNegative()) {
      let e = this.negate();
      return "-" + kw(e.lo, e.hi);
    }
    return kw(this.lo, this.hi);
  }
  /**
   * Convert to native bigint.
   */
  toBigInt() {
    return EO(Mt), Mt.V.setInt32(0, this.lo, !0), Mt.V.setInt32(4, this.hi, !0), Mt.V.getBigInt64(0, !0);
  }
}
dn.ZERO = new dn(0, 0);
const X2 = {
  readUnknownField: !0,
  readerFactory: (t) => new XL(t)
};
function JL(t) {
  return t ? Object.assign(Object.assign({}, X2), t) : X2;
}
class XL {
  constructor(e, n) {
    this.varint64 = KL, this.uint32 = VL, this.buf = e, this.len = e.length, this.pos = 0, this.view = new DataView(e.buffer, e.byteOffset, e.byteLength), this.textDecoder = n ?? new TextDecoder("utf-8", {
      fatal: !0,
      ignoreBOM: !0
    });
  }
  /**
   * Reads a tag - field number and wire type.
   */
  tag() {
    let e = this.uint32(), n = e >>> 3, r = e & 7;
    if (n <= 0 || r < 0 || r > 5)
      throw new Error("illegal tag: field no " + n + " wire type " + r);
    return [n, r];
  }
  /**
   * Skip one element on the wire and return the skipped data.
   * Supports WireType.StartGroup since v2.0.0-alpha.23.
   */
  skip(e) {
    let n = this.pos;
    switch (e) {
      case un.Varint:
        for (; this.buf[this.pos++] & 128; )
          ;
        break;
      case un.Bit64:
        this.pos += 4;
      case un.Bit32:
        this.pos += 4;
        break;
      case un.LengthDelimited:
        let r = this.uint32();
        this.pos += r;
        break;
      case un.StartGroup:
        let i;
        for (; (i = this.tag()[1]) !== un.EndGroup; )
          this.skip(i);
        break;
      default:
        throw new Error("cant skip wire type " + e);
    }
    return this.assertBounds(), this.buf.subarray(n, this.pos);
  }
  /**
   * Throws error if position in byte array is out of range.
   */
  assertBounds() {
    if (this.pos > this.len)
      throw new RangeError("premature EOF");
  }
  /**
   * Read a `int32` field, a signed 32 bit varint.
   */
  int32() {
    return this.uint32() | 0;
  }
  /**
   * Read a `sint32` field, a signed, zigzag-encoded 32-bit varint.
   */
  sint32() {
    let e = this.uint32();
    return e >>> 1 ^ -(e & 1);
  }
  /**
   * Read a `int64` field, a signed 64-bit varint.
   */
  int64() {
    return new dn(...this.varint64());
  }
  /**
   * Read a `uint64` field, an unsigned 64-bit varint.
   */
  uint64() {
    return new mr(...this.varint64());
  }
  /**
   * Read a `sint64` field, a signed, zig-zag-encoded 64-bit varint.
   */
  sint64() {
    let [e, n] = this.varint64(), r = -(e & 1);
    return e = (e >>> 1 | (n & 1) << 31) ^ r, n = n >>> 1 ^ r, new dn(e, n);
  }
  /**
   * Read a `bool` field, a variant.
   */
  bool() {
    let [e, n] = this.varint64();
    return e !== 0 || n !== 0;
  }
  /**
   * Read a `fixed32` field, an unsigned, fixed-length 32-bit integer.
   */
  fixed32() {
    return this.view.getUint32((this.pos += 4) - 4, !0);
  }
  /**
   * Read a `sfixed32` field, a signed, fixed-length 32-bit integer.
   */
  sfixed32() {
    return this.view.getInt32((this.pos += 4) - 4, !0);
  }
  /**
   * Read a `fixed64` field, an unsigned, fixed-length 64 bit integer.
   */
  fixed64() {
    return new mr(this.sfixed32(), this.sfixed32());
  }
  /**
   * Read a `fixed64` field, a signed, fixed-length 64-bit integer.
   */
  sfixed64() {
    return new dn(this.sfixed32(), this.sfixed32());
  }
  /**
   * Read a `float` field, 32-bit floating point number.
   */
  float() {
    return this.view.getFloat32((this.pos += 4) - 4, !0);
  }
  /**
   * Read a `double` field, a 64-bit floating point number.
   */
  double() {
    return this.view.getFloat64((this.pos += 8) - 8, !0);
  }
  /**
   * Read a `bytes` field, length-delimited arbitrary data.
   */
  bytes() {
    let e = this.uint32(), n = this.pos;
    return this.pos += e, this.assertBounds(), this.buf.subarray(n, n + e);
  }
  /**
   * Read a `string` field, length-delimited data converted to UTF-8 text.
   */
  string() {
    return this.textDecoder.decode(this.bytes());
  }
}
function Tt(t, e) {
  if (!t)
    throw new Error(e);
}
const ZL = 34028234663852886e22, e9 = -34028234663852886e22, t9 = 4294967295, n9 = 2147483647, r9 = -2147483648;
function Cp(t) {
  if (typeof t != "number")
    throw new Error("invalid int 32: " + typeof t);
  if (!Number.isInteger(t) || t > n9 || t < r9)
    throw new Error("invalid int 32: " + t);
}
function bm(t) {
  if (typeof t != "number")
    throw new Error("invalid uint 32: " + typeof t);
  if (!Number.isInteger(t) || t > t9 || t < 0)
    throw new Error("invalid uint 32: " + t);
}
function Y_(t) {
  if (typeof t != "number")
    throw new Error("invalid float 32: " + typeof t);
  if (Number.isFinite(t) && (t > ZL || t < e9))
    throw new Error("invalid float 32: " + t);
}
const Z2 = {
  writeUnknownFields: !0,
  writerFactory: () => new o9()
};
function i9(t) {
  return t ? Object.assign(Object.assign({}, Z2), t) : Z2;
}
class o9 {
  constructor(e) {
    this.stack = [], this.textEncoder = e ?? new TextEncoder(), this.chunks = [], this.buf = [];
  }
  /**
   * Return all bytes written and reset this writer.
   */
  finish() {
    this.chunks.push(new Uint8Array(this.buf));
    let e = 0;
    for (let i = 0; i < this.chunks.length; i++)
      e += this.chunks[i].length;
    let n = new Uint8Array(e), r = 0;
    for (let i = 0; i < this.chunks.length; i++)
      n.set(this.chunks[i], r), r += this.chunks[i].length;
    return this.chunks = [], n;
  }
  /**
   * Start a new fork for length-delimited data like a message
   * or a packed repeated field.
   *
   * Must be joined later with `join()`.
   */
  fork() {
    return this.stack.push({ chunks: this.chunks, buf: this.buf }), this.chunks = [], this.buf = [], this;
  }
  /**
   * Join the last fork. Write its length and bytes, then
   * return to the previous state.
   */
  join() {
    let e = this.finish(), n = this.stack.pop();
    if (!n)
      throw new Error("invalid state, fork stack empty");
    return this.chunks = n.chunks, this.buf = n.buf, this.uint32(e.byteLength), this.raw(e);
  }
  /**
   * Writes a tag (field number and wire type).
   *
   * Equivalent to `uint32( (fieldNo << 3 | type) >>> 0 )`.
   *
   * Generated code should compute the tag ahead of time and call `uint32()`.
   */
  tag(e, n) {
    return this.uint32((e << 3 | n) >>> 0);
  }
  /**
   * Write a chunk of raw bytes.
   */
  raw(e) {
    return this.buf.length && (this.chunks.push(new Uint8Array(this.buf)), this.buf = []), this.chunks.push(e), this;
  }
  /**
   * Write a `uint32` value, an unsigned 32 bit varint.
   */
  uint32(e) {
    for (bm(e); e > 127; )
      this.buf.push(e & 127 | 128), e = e >>> 7;
    return this.buf.push(e), this;
  }
  /**
   * Write a `int32` value, a signed 32 bit varint.
   */
  int32(e) {
    return Cp(e), J2(e, this.buf), this;
  }
  /**
   * Write a `bool` value, a variant.
   */
  bool(e) {
    return this.buf.push(e ? 1 : 0), this;
  }
  /**
   * Write a `bytes` value, length-delimited arbitrary data.
   */
  bytes(e) {
    return this.uint32(e.byteLength), this.raw(e);
  }
  /**
   * Write a `string` value, length-delimited data converted to UTF-8 text.
   */
  string(e) {
    let n = this.textEncoder.encode(e);
    return this.uint32(n.byteLength), this.raw(n);
  }
  /**
   * Write a `float` value, 32-bit floating point number.
   */
  float(e) {
    Y_(e);
    let n = new Uint8Array(4);
    return new DataView(n.buffer).setFloat32(0, e, !0), this.raw(n);
  }
  /**
   * Write a `double` value, a 64-bit floating point number.
   */
  double(e) {
    let n = new Uint8Array(8);
    return new DataView(n.buffer).setFloat64(0, e, !0), this.raw(n);
  }
  /**
   * Write a `fixed32` value, an unsigned, fixed-length 32-bit integer.
   */
  fixed32(e) {
    bm(e);
    let n = new Uint8Array(4);
    return new DataView(n.buffer).setUint32(0, e, !0), this.raw(n);
  }
  /**
   * Write a `sfixed32` value, a signed, fixed-length 32-bit integer.
   */
  sfixed32(e) {
    Cp(e);
    let n = new Uint8Array(4);
    return new DataView(n.buffer).setInt32(0, e, !0), this.raw(n);
  }
  /**
   * Write a `sint32` value, a signed, zigzag-encoded 32-bit varint.
   */
  sint32(e) {
    return Cp(e), e = (e << 1 ^ e >> 31) >>> 0, J2(e, this.buf), this;
  }
  /**
   * Write a `fixed64` value, a signed, fixed-length 64-bit integer.
   */
  sfixed64(e) {
    let n = new Uint8Array(8), r = new DataView(n.buffer), i = dn.from(e);
    return r.setInt32(0, i.lo, !0), r.setInt32(4, i.hi, !0), this.raw(n);
  }
  /**
   * Write a `fixed64` value, an unsigned, fixed-length 64 bit integer.
   */
  fixed64(e) {
    let n = new Uint8Array(8), r = new DataView(n.buffer), i = mr.from(e);
    return r.setInt32(0, i.lo, !0), r.setInt32(4, i.hi, !0), this.raw(n);
  }
  /**
   * Write a `int64` value, a signed 64-bit varint.
   */
  int64(e) {
    let n = dn.from(e);
    return ky(n.lo, n.hi, this.buf), this;
  }
  /**
   * Write a `sint64` value, a signed, zig-zag-encoded 64-bit varint.
   */
  sint64(e) {
    let n = dn.from(e), r = n.hi >> 31, i = n.lo << 1 ^ r, o = (n.hi << 1 | n.lo >>> 31) ^ r;
    return ky(i, o, this.buf), this;
  }
  /**
   * Write a `uint64` value, an unsigned 64-bit varint.
   */
  uint64(e) {
    let n = mr.from(e);
    return ky(n.lo, n.hi, this.buf), this;
  }
}
const eI = {
  emitDefaultValues: !1,
  enumAsInteger: !1,
  useProtoFieldName: !1,
  prettySpaces: 0
}, tI = {
  ignoreUnknownFields: !1
};
function s9(t) {
  return t ? Object.assign(Object.assign({}, tI), t) : tI;
}
function a9(t) {
  return t ? Object.assign(Object.assign({}, eI), t) : eI;
}
const CO = Symbol.for("protobuf-ts/message-type");
function nI(t) {
  let e = !1;
  const n = [];
  for (let r = 0; r < t.length; r++) {
    let i = t.charAt(r);
    i == "_" ? e = !0 : /\d/.test(i) ? (n.push(i), e = !0) : e ? (n.push(i.toUpperCase()), e = !1) : r == 0 ? n.push(i.toLowerCase()) : n.push(i);
  }
  return n.join("");
}
var w;
(function(t) {
  t[t.DOUBLE = 1] = "DOUBLE", t[t.FLOAT = 2] = "FLOAT", t[t.INT64 = 3] = "INT64", t[t.UINT64 = 4] = "UINT64", t[t.INT32 = 5] = "INT32", t[t.FIXED64 = 6] = "FIXED64", t[t.FIXED32 = 7] = "FIXED32", t[t.BOOL = 8] = "BOOL", t[t.STRING = 9] = "STRING", t[t.BYTES = 12] = "BYTES", t[t.UINT32 = 13] = "UINT32", t[t.SFIXED32 = 15] = "SFIXED32", t[t.SFIXED64 = 16] = "SFIXED64", t[t.SINT32 = 17] = "SINT32", t[t.SINT64 = 18] = "SINT64";
})(w || (w = {}));
var To;
(function(t) {
  t[t.BIGINT = 0] = "BIGINT", t[t.STRING = 1] = "STRING", t[t.NUMBER = 2] = "NUMBER";
})(To || (To = {}));
var Rr;
(function(t) {
  t[t.NO = 0] = "NO", t[t.PACKED = 1] = "PACKED", t[t.UNPACKED = 2] = "UNPACKED";
})(Rr || (Rr = {}));
function c9(t) {
  var e, n, r, i;
  return t.localName = (e = t.localName) !== null && e !== void 0 ? e : nI(t.name), t.jsonName = (n = t.jsonName) !== null && n !== void 0 ? n : nI(t.name), t.repeat = (r = t.repeat) !== null && r !== void 0 ? r : Rr.NO, t.opt = (i = t.opt) !== null && i !== void 0 ? i : t.repeat || t.oneof ? !1 : t.kind == "message", t;
}
function u9(t) {
  if (typeof t != "object" || t === null || !t.hasOwnProperty("oneofKind"))
    return !1;
  switch (typeof t.oneofKind) {
    case "string":
      return t[t.oneofKind] === void 0 ? !1 : Object.keys(t).length == 2;
    case "undefined":
      return Object.keys(t).length == 1;
    default:
      return !1;
  }
}
class l9 {
  constructor(e) {
    var n;
    this.fields = (n = e.fields) !== null && n !== void 0 ? n : [];
  }
  prepare() {
    if (this.data)
      return;
    const e = [], n = [], r = [];
    for (let i of this.fields)
      if (i.oneof)
        r.includes(i.oneof) || (r.push(i.oneof), e.push(i.oneof), n.push(i.oneof));
      else
        switch (n.push(i.localName), i.kind) {
          case "scalar":
          case "enum":
            (!i.opt || i.repeat) && e.push(i.localName);
            break;
          case "message":
            i.repeat && e.push(i.localName);
            break;
          case "map":
            e.push(i.localName);
            break;
        }
    this.data = { req: e, known: n, oneofs: Object.values(r) };
  }
  /**
   * Is the argument a valid message as specified by the
   * reflection information?
   *
   * Checks all field types recursively. The `depth`
   * specifies how deep into the structure the check will be.
   *
   * With a depth of 0, only the presence of fields
   * is checked.
   *
   * With a depth of 1 or more, the field types are checked.
   *
   * With a depth of 2 or more, the members of map, repeated
   * and message fields are checked.
   *
   * Message fields will be checked recursively with depth - 1.
   *
   * The number of map entries / repeated values being checked
   * is < depth.
   */
  is(e, n, r = !1) {
    if (n < 0)
      return !0;
    if (e == null || typeof e != "object")
      return !1;
    this.prepare();
    let i = Object.keys(e), o = this.data;
    if (i.length < o.req.length || o.req.some((s) => !i.includes(s)) || !r && i.some((s) => !o.known.includes(s)))
      return !1;
    if (n < 1)
      return !0;
    for (const s of o.oneofs) {
      const a = e[s];
      if (!u9(a))
        return !1;
      if (a.oneofKind === void 0)
        continue;
      const c = this.fields.find((u) => u.localName === a.oneofKind);
      if (!c || !this.field(a[a.oneofKind], c, r, n))
        return !1;
    }
    for (const s of this.fields)
      if (s.oneof === void 0 && !this.field(e[s.localName], s, r, n))
        return !1;
    return !0;
  }
  field(e, n, r, i) {
    let o = n.repeat;
    switch (n.kind) {
      case "scalar":
        return e === void 0 ? n.opt : o ? this.scalars(e, n.T, i, n.L) : this.scalar(e, n.T, n.L);
      case "enum":
        return e === void 0 ? n.opt : o ? this.scalars(e, w.INT32, i) : this.scalar(e, w.INT32);
      case "message":
        return e === void 0 ? !0 : o ? this.messages(e, n.T(), r, i) : this.message(e, n.T(), r, i);
      case "map":
        if (typeof e != "object" || e === null)
          return !1;
        if (i < 2)
          return !0;
        if (!this.mapKeys(e, n.K, i))
          return !1;
        switch (n.V.kind) {
          case "scalar":
            return this.scalars(Object.values(e), n.V.T, i, n.V.L);
          case "enum":
            return this.scalars(Object.values(e), w.INT32, i);
          case "message":
            return this.messages(Object.values(e), n.V.T(), r, i);
        }
        break;
    }
    return !0;
  }
  message(e, n, r, i) {
    return r ? n.isAssignable(e, i) : n.is(e, i);
  }
  messages(e, n, r, i) {
    if (!Array.isArray(e))
      return !1;
    if (i < 2)
      return !0;
    if (r) {
      for (let o = 0; o < e.length && o < i; o++)
        if (!n.isAssignable(e[o], i - 1))
          return !1;
    } else
      for (let o = 0; o < e.length && o < i; o++)
        if (!n.is(e[o], i - 1))
          return !1;
    return !0;
  }
  scalar(e, n, r) {
    let i = typeof e;
    switch (n) {
      case w.UINT64:
      case w.FIXED64:
      case w.INT64:
      case w.SFIXED64:
      case w.SINT64:
        switch (r) {
          case To.BIGINT:
            return i == "bigint";
          case To.NUMBER:
            return i == "number" && !isNaN(e);
          default:
            return i == "string";
        }
      case w.BOOL:
        return i == "boolean";
      case w.STRING:
        return i == "string";
      case w.BYTES:
        return e instanceof Uint8Array;
      case w.DOUBLE:
      case w.FLOAT:
        return i == "number" && !isNaN(e);
      default:
        return i == "number" && Number.isInteger(e);
    }
  }
  scalars(e, n, r, i) {
    if (!Array.isArray(e))
      return !1;
    if (r < 2)
      return !0;
    if (Array.isArray(e)) {
      for (let o = 0; o < e.length && o < r; o++)
        if (!this.scalar(e[o], n, i))
          return !1;
    }
    return !0;
  }
  mapKeys(e, n, r) {
    let i = Object.keys(e);
    switch (n) {
      case w.INT32:
      case w.FIXED32:
      case w.SFIXED32:
      case w.SINT32:
      case w.UINT32:
        return this.scalars(i.slice(0, r).map((o) => parseInt(o)), n, r);
      case w.BOOL:
        return this.scalars(i.slice(0, r).map((o) => o == "true" ? !0 : o == "false" ? !1 : o), n, r);
      default:
        return this.scalars(i, n, r, To.STRING);
    }
  }
}
function $i(t, e) {
  switch (e) {
    case To.BIGINT:
      return t.toBigInt();
    case To.NUMBER:
      return t.toNumber();
    default:
      return t.toString();
  }
}
class p9 {
  constructor(e) {
    this.info = e;
  }
  prepare() {
    var e;
    if (this.fMap === void 0) {
      this.fMap = {};
      const n = (e = this.info.fields) !== null && e !== void 0 ? e : [];
      for (const r of n)
        this.fMap[r.name] = r, this.fMap[r.jsonName] = r, this.fMap[r.localName] = r;
    }
  }
  // Cannot parse JSON <type of jsonValue> for <type name>#<fieldName>.
  assert(e, n, r) {
    if (!e) {
      let i = SO(r);
      throw (i == "number" || i == "boolean") && (i = r.toString()), new Error(`Cannot parse JSON ${i} for ${this.info.typeName}#${n}`);
    }
  }
  /**
   * Reads a message from canonical JSON format into the target message.
   *
   * Repeated fields are appended. Map entries are added, overwriting
   * existing keys.
   *
   * If a message field is already present, it will be merged with the
   * new data.
   */
  read(e, n, r) {
    this.prepare();
    const i = [];
    for (const [o, s] of Object.entries(e)) {
      const a = this.fMap[o];
      if (!a) {
        if (!r.ignoreUnknownFields)
          throw new Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${o}`);
        continue;
      }
      const c = a.localName;
      let u;
      if (a.oneof) {
        if (s === null && (a.kind !== "enum" || a.T()[0] !== "google.protobuf.NullValue"))
          continue;
        if (i.includes(a.oneof))
          throw new Error(`Multiple members of the oneof group "${a.oneof}" of ${this.info.typeName} are present in JSON.`);
        i.push(a.oneof), u = n[a.oneof] = {
          oneofKind: c
        };
      } else
        u = n;
      if (a.kind == "map") {
        if (s === null)
          continue;
        this.assert(HL(s), a.name, s);
        const l = u[c];
        for (const [d, f] of Object.entries(s)) {
          this.assert(f !== null, a.name + " map value", null);
          let m;
          switch (a.V.kind) {
            case "message":
              m = a.V.T().internalJsonRead(f, r);
              break;
            case "enum":
              if (m = this.enum(a.V.T(), f, a.name, r.ignoreUnknownFields), m === !1)
                continue;
              break;
            case "scalar":
              m = this.scalar(f, a.V.T, a.V.L, a.name);
              break;
          }
          this.assert(m !== void 0, a.name + " map value", f);
          let h = d;
          a.K == w.BOOL && (h = h == "true" ? !0 : h == "false" ? !1 : h), h = this.scalar(h, a.K, To.STRING, a.name).toString(), l[h] = m;
        }
      } else if (a.repeat) {
        if (s === null)
          continue;
        this.assert(Array.isArray(s), a.name, s);
        const l = u[c];
        for (const d of s) {
          this.assert(d !== null, a.name, null);
          let f;
          switch (a.kind) {
            case "message":
              f = a.T().internalJsonRead(d, r);
              break;
            case "enum":
              if (f = this.enum(a.T(), d, a.name, r.ignoreUnknownFields), f === !1)
                continue;
              break;
            case "scalar":
              f = this.scalar(d, a.T, a.L, a.name);
              break;
          }
          this.assert(f !== void 0, a.name, s), l.push(f);
        }
      } else
        switch (a.kind) {
          case "message":
            if (s === null && a.T().typeName != "google.protobuf.Value") {
              this.assert(a.oneof === void 0, a.name + " (oneof member)", null);
              continue;
            }
            u[c] = a.T().internalJsonRead(s, r, u[c]);
            break;
          case "enum":
            if (s === null)
              continue;
            let l = this.enum(a.T(), s, a.name, r.ignoreUnknownFields);
            if (l === !1)
              continue;
            u[c] = l;
            break;
          case "scalar":
            if (s === null)
              continue;
            u[c] = this.scalar(s, a.T, a.L, a.name);
            break;
        }
    }
  }
  /**
   * Returns `false` for unrecognized string representations.
   *
   * google.protobuf.NullValue accepts only JSON `null` (or the old `"NULL_VALUE"`).
   */
  enum(e, n, r, i) {
    if (e[0] == "google.protobuf.NullValue" && Tt(n === null || n === "NULL_VALUE", `Unable to parse field ${this.info.typeName}#${r}, enum ${e[0]} only accepts null.`), n === null)
      return 0;
    switch (typeof n) {
      case "number":
        return Tt(Number.isInteger(n), `Unable to parse field ${this.info.typeName}#${r}, enum can only be integral number, got ${n}.`), n;
      case "string":
        let o = n;
        e[2] && n.substring(0, e[2].length) === e[2] && (o = n.substring(e[2].length));
        let s = e[1][o];
        return typeof s > "u" && i ? !1 : (Tt(typeof s == "number", `Unable to parse field ${this.info.typeName}#${r}, enum ${e[0]} has no value for "${n}".`), s);
    }
    Tt(!1, `Unable to parse field ${this.info.typeName}#${r}, cannot parse enum value from ${typeof n}".`);
  }
  scalar(e, n, r, i) {
    let o;
    try {
      switch (n) {
        // float, double: JSON value will be a number or one of the special string values "NaN", "Infinity", and "-Infinity".
        // Either numbers or strings are accepted. Exponent notation is also accepted.
        case w.DOUBLE:
        case w.FLOAT:
          if (e === null)
            return 0;
          if (e === "NaN")
            return Number.NaN;
          if (e === "Infinity")
            return Number.POSITIVE_INFINITY;
          if (e === "-Infinity")
            return Number.NEGATIVE_INFINITY;
          if (e === "") {
            o = "empty string";
            break;
          }
          if (typeof e == "string" && e.trim().length !== e.length) {
            o = "extra whitespace";
            break;
          }
          if (typeof e != "string" && typeof e != "number")
            break;
          let s = Number(e);
          if (Number.isNaN(s)) {
            o = "not a number";
            break;
          }
          if (!Number.isFinite(s)) {
            o = "too large or small";
            break;
          }
          return n == w.FLOAT && Y_(s), s;
        // int32, fixed32, uint32: JSON value will be a decimal number. Either numbers or strings are accepted.
        case w.INT32:
        case w.FIXED32:
        case w.SFIXED32:
        case w.SINT32:
        case w.UINT32:
          if (e === null)
            return 0;
          let a;
          if (typeof e == "number" ? a = e : e === "" ? o = "empty string" : typeof e == "string" && (e.trim().length !== e.length ? o = "extra whitespace" : a = Number(e)), a === void 0)
            break;
          return n == w.UINT32 ? bm(a) : Cp(a), a;
        // int64, fixed64, uint64: JSON value will be a decimal string. Either numbers or strings are accepted.
        case w.INT64:
        case w.SFIXED64:
        case w.SINT64:
          if (e === null)
            return $i(dn.ZERO, r);
          if (typeof e != "number" && typeof e != "string")
            break;
          return $i(dn.from(e), r);
        case w.FIXED64:
        case w.UINT64:
          if (e === null)
            return $i(mr.ZERO, r);
          if (typeof e != "number" && typeof e != "string")
            break;
          return $i(mr.from(e), r);
        // bool:
        case w.BOOL:
          if (e === null)
            return !1;
          if (typeof e != "boolean")
            break;
          return e;
        // string:
        case w.STRING:
          if (e === null)
            return "";
          if (typeof e != "string") {
            o = "extra whitespace";
            break;
          }
          try {
            encodeURIComponent(e);
          } catch (c) {
            c = "invalid UTF8";
            break;
          }
          return e;
        // bytes: JSON value will be the data encoded as a string using standard base64 encoding with paddings.
        // Either standard or URL-safe base64 encoding with/without paddings are accepted.
        case w.BYTES:
          if (e === null || e === "")
            return new Uint8Array(0);
          if (typeof e != "string")
            break;
          return WL(e);
      }
    } catch (s) {
      o = s.message;
    }
    this.assert(!1, i + (o ? " - " + o : ""), e);
  }
}
class d9 {
  constructor(e) {
    var n;
    this.fields = (n = e.fields) !== null && n !== void 0 ? n : [];
  }
  /**
   * Converts the message to a JSON object, based on the field descriptors.
   */
  write(e, n) {
    const r = {}, i = e;
    for (const o of this.fields) {
      if (!o.oneof) {
        let u = this.field(o, i[o.localName], n);
        u !== void 0 && (r[n.useProtoFieldName ? o.name : o.jsonName] = u);
        continue;
      }
      const s = i[o.oneof];
      if (s.oneofKind !== o.localName)
        continue;
      const a = o.kind == "scalar" || o.kind == "enum" ? Object.assign(Object.assign({}, n), { emitDefaultValues: !0 }) : n;
      let c = this.field(o, s[o.localName], a);
      Tt(c !== void 0), r[n.useProtoFieldName ? o.name : o.jsonName] = c;
    }
    return r;
  }
  field(e, n, r) {
    let i;
    if (e.kind == "map") {
      Tt(typeof n == "object" && n !== null);
      const o = {};
      switch (e.V.kind) {
        case "scalar":
          for (const [c, u] of Object.entries(n)) {
            const l = this.scalar(e.V.T, u, e.name, !1, !0);
            Tt(l !== void 0), o[c.toString()] = l;
          }
          break;
        case "message":
          const s = e.V.T();
          for (const [c, u] of Object.entries(n)) {
            const l = this.message(s, u, e.name, r);
            Tt(l !== void 0), o[c.toString()] = l;
          }
          break;
        case "enum":
          const a = e.V.T();
          for (const [c, u] of Object.entries(n)) {
            Tt(u === void 0 || typeof u == "number");
            const l = this.enum(a, u, e.name, !1, !0, r.enumAsInteger);
            Tt(l !== void 0), o[c.toString()] = l;
          }
          break;
      }
      (r.emitDefaultValues || Object.keys(o).length > 0) && (i = o);
    } else if (e.repeat) {
      Tt(Array.isArray(n));
      const o = [];
      switch (e.kind) {
        case "scalar":
          for (let c = 0; c < n.length; c++) {
            const u = this.scalar(e.T, n[c], e.name, e.opt, !0);
            Tt(u !== void 0), o.push(u);
          }
          break;
        case "enum":
          const s = e.T();
          for (let c = 0; c < n.length; c++) {
            Tt(n[c] === void 0 || typeof n[c] == "number");
            const u = this.enum(s, n[c], e.name, e.opt, !0, r.enumAsInteger);
            Tt(u !== void 0), o.push(u);
          }
          break;
        case "message":
          const a = e.T();
          for (let c = 0; c < n.length; c++) {
            const u = this.message(a, n[c], e.name, r);
            Tt(u !== void 0), o.push(u);
          }
          break;
      }
      (r.emitDefaultValues || o.length > 0 || r.emitDefaultValues) && (i = o);
    } else
      switch (e.kind) {
        case "scalar":
          i = this.scalar(e.T, n, e.name, e.opt, r.emitDefaultValues);
          break;
        case "enum":
          i = this.enum(e.T(), n, e.name, e.opt, r.emitDefaultValues, r.enumAsInteger);
          break;
        case "message":
          i = this.message(e.T(), n, e.name, r);
          break;
      }
    return i;
  }
  /**
   * Returns `null` as the default for google.protobuf.NullValue.
   */
  enum(e, n, r, i, o, s) {
    if (e[0] == "google.protobuf.NullValue")
      return !o && !i ? void 0 : null;
    if (n === void 0) {
      Tt(i);
      return;
    }
    if (!(n === 0 && !o && !i))
      return Tt(typeof n == "number"), Tt(Number.isInteger(n)), s || !e[1].hasOwnProperty(n) ? n : e[2] ? e[2] + e[1][n] : e[1][n];
  }
  message(e, n, r, i) {
    return n === void 0 ? i.emitDefaultValues ? null : void 0 : e.internalJsonWrite(n, i);
  }
  scalar(e, n, r, i, o) {
    if (n === void 0) {
      Tt(i);
      return;
    }
    const s = o || i;
    switch (e) {
      // int32, fixed32, uint32: JSON value will be a decimal number. Either numbers or strings are accepted.
      case w.INT32:
      case w.SFIXED32:
      case w.SINT32:
        return n === 0 ? s ? 0 : void 0 : (Cp(n), n);
      case w.FIXED32:
      case w.UINT32:
        return n === 0 ? s ? 0 : void 0 : (bm(n), n);
      // float, double: JSON value will be a number or one of the special string values "NaN", "Infinity", and "-Infinity".
      // Either numbers or strings are accepted. Exponent notation is also accepted.
      case w.FLOAT:
        Y_(n);
      case w.DOUBLE:
        return n === 0 ? s ? 0 : void 0 : (Tt(typeof n == "number"), Number.isNaN(n) ? "NaN" : n === Number.POSITIVE_INFINITY ? "Infinity" : n === Number.NEGATIVE_INFINITY ? "-Infinity" : n);
      // string:
      case w.STRING:
        return n === "" ? s ? "" : void 0 : (Tt(typeof n == "string"), n);
      // bool:
      case w.BOOL:
        return n === !1 ? s ? !1 : void 0 : (Tt(typeof n == "boolean"), n);
      // JSON value will be a decimal string. Either numbers or strings are accepted.
      case w.UINT64:
      case w.FIXED64:
        Tt(typeof n == "number" || typeof n == "string" || typeof n == "bigint");
        let a = mr.from(n);
        return a.isZero() && !s ? void 0 : a.toString();
      // JSON value will be a decimal string. Either numbers or strings are accepted.
      case w.INT64:
      case w.SFIXED64:
      case w.SINT64:
        Tt(typeof n == "number" || typeof n == "string" || typeof n == "bigint");
        let c = dn.from(n);
        return c.isZero() && !s ? void 0 : c.toString();
      // bytes: JSON value will be the data encoded as a string using standard base64 encoding with paddings.
      // Either standard or URL-safe base64 encoding with/without paddings are accepted.
      case w.BYTES:
        return Tt(n instanceof Uint8Array), n.byteLength ? zL(n) : s ? "" : void 0;
    }
  }
}
function Nw(t, e = To.STRING) {
  switch (t) {
    case w.BOOL:
      return !1;
    case w.UINT64:
    case w.FIXED64:
      return $i(mr.ZERO, e);
    case w.INT64:
    case w.SFIXED64:
    case w.SINT64:
      return $i(dn.ZERO, e);
    case w.DOUBLE:
    case w.FLOAT:
      return 0;
    case w.BYTES:
      return new Uint8Array(0);
    case w.STRING:
      return "";
    default:
      return 0;
  }
}
class f9 {
  constructor(e) {
    this.info = e;
  }
  prepare() {
    var e;
    if (!this.fieldNoToField) {
      const n = (e = this.info.fields) !== null && e !== void 0 ? e : [];
      this.fieldNoToField = new Map(n.map((r) => [r.no, r]));
    }
  }
  /**
   * Reads a message from binary format into the target message.
   *
   * Repeated fields are appended. Map entries are added, overwriting
   * existing keys.
   *
   * If a message field is already present, it will be merged with the
   * new data.
   */
  read(e, n, r, i) {
    this.prepare();
    const o = i === void 0 ? e.len : e.pos + i;
    for (; e.pos < o; ) {
      const [s, a] = e.tag(), c = this.fieldNoToField.get(s);
      if (!c) {
        let f = r.readUnknownField;
        if (f == "throw")
          throw new Error(`Unknown field ${s} (wire type ${a}) for ${this.info.typeName}`);
        let m = e.skip(a);
        f !== !1 && (f === !0 ? ym.onRead : f)(this.info.typeName, n, s, a, m);
        continue;
      }
      let u = n, l = c.repeat, d = c.localName;
      switch (c.oneof && (u = u[c.oneof], u.oneofKind !== d && (u = n[c.oneof] = {
        oneofKind: d
      })), c.kind) {
        case "scalar":
        case "enum":
          let f = c.kind == "enum" ? w.INT32 : c.T, m = c.kind == "scalar" ? c.L : void 0;
          if (l) {
            let x = u[d];
            if (a == un.LengthDelimited && f != w.STRING && f != w.BYTES) {
              let g = e.uint32() + e.pos;
              for (; e.pos < g; )
                x.push(this.scalar(e, f, m));
            } else
              x.push(this.scalar(e, f, m));
          } else
            u[d] = this.scalar(e, f, m);
          break;
        case "message":
          if (l) {
            let x = u[d], g = c.T().internalBinaryRead(e, e.uint32(), r);
            x.push(g);
          } else
            u[d] = c.T().internalBinaryRead(e, e.uint32(), r, u[d]);
          break;
        case "map":
          let [h, y] = this.mapEntry(c, e, r);
          u[d][h] = y;
          break;
      }
    }
  }
  /**
   * Read a map field, expecting key field = 1, value field = 2
   */
  mapEntry(e, n, r) {
    let i = n.uint32(), o = n.pos + i, s, a;
    for (; n.pos < o; ) {
      let [c, u] = n.tag();
      switch (c) {
        case 1:
          e.K == w.BOOL ? s = n.bool().toString() : s = this.scalar(n, e.K, To.STRING);
          break;
        case 2:
          switch (e.V.kind) {
            case "scalar":
              a = this.scalar(n, e.V.T, e.V.L);
              break;
            case "enum":
              a = n.int32();
              break;
            case "message":
              a = e.V.T().internalBinaryRead(n, n.uint32(), r);
              break;
          }
          break;
        default:
          throw new Error(`Unknown field ${c} (wire type ${u}) in map entry for ${this.info.typeName}#${e.name}`);
      }
    }
    if (s === void 0) {
      let c = Nw(e.K);
      s = e.K == w.BOOL ? c.toString() : c;
    }
    if (a === void 0)
      switch (e.V.kind) {
        case "scalar":
          a = Nw(e.V.T, e.V.L);
          break;
        case "enum":
          a = 0;
          break;
        case "message":
          a = e.V.T().create();
          break;
      }
    return [s, a];
  }
  scalar(e, n, r) {
    switch (n) {
      case w.INT32:
        return e.int32();
      case w.STRING:
        return e.string();
      case w.BOOL:
        return e.bool();
      case w.DOUBLE:
        return e.double();
      case w.FLOAT:
        return e.float();
      case w.INT64:
        return $i(e.int64(), r);
      case w.UINT64:
        return $i(e.uint64(), r);
      case w.FIXED64:
        return $i(e.fixed64(), r);
      case w.FIXED32:
        return e.fixed32();
      case w.BYTES:
        return e.bytes();
      case w.UINT32:
        return e.uint32();
      case w.SFIXED32:
        return e.sfixed32();
      case w.SFIXED64:
        return $i(e.sfixed64(), r);
      case w.SINT32:
        return e.sint32();
      case w.SINT64:
        return $i(e.sint64(), r);
    }
  }
}
class h9 {
  constructor(e) {
    this.info = e;
  }
  prepare() {
    if (!this.fields) {
      const e = this.info.fields ? this.info.fields.concat() : [];
      this.fields = e.sort((n, r) => n.no - r.no);
    }
  }
  /**
   * Writes the message to binary format.
   */
  write(e, n, r) {
    this.prepare();
    for (const o of this.fields) {
      let s, a, c = o.repeat, u = o.localName;
      if (o.oneof) {
        const l = e[o.oneof];
        if (l.oneofKind !== u)
          continue;
        s = l[u], a = !0;
      } else
        s = e[u], a = !1;
      switch (o.kind) {
        case "scalar":
        case "enum":
          let l = o.kind == "enum" ? w.INT32 : o.T;
          if (c)
            if (Tt(Array.isArray(s)), c == Rr.PACKED)
              this.packed(n, l, o.no, s);
            else
              for (const d of s)
                this.scalar(n, l, o.no, d, !0);
          else s === void 0 ? Tt(o.opt) : this.scalar(n, l, o.no, s, a || o.opt);
          break;
        case "message":
          if (c) {
            Tt(Array.isArray(s));
            for (const d of s)
              this.message(n, r, o.T(), o.no, d);
          } else
            this.message(n, r, o.T(), o.no, s);
          break;
        case "map":
          Tt(typeof s == "object" && s !== null);
          for (const [d, f] of Object.entries(s))
            this.mapEntry(n, r, o, d, f);
          break;
      }
    }
    let i = r.writeUnknownFields;
    i !== !1 && (i === !0 ? ym.onWrite : i)(this.info.typeName, e, n);
  }
  mapEntry(e, n, r, i, o) {
    e.tag(r.no, un.LengthDelimited), e.fork();
    let s = i;
    switch (r.K) {
      case w.INT32:
      case w.FIXED32:
      case w.UINT32:
      case w.SFIXED32:
      case w.SINT32:
        s = Number.parseInt(i);
        break;
      case w.BOOL:
        Tt(i == "true" || i == "false"), s = i == "true";
        break;
    }
    switch (this.scalar(e, r.K, 1, s, !0), r.V.kind) {
      case "scalar":
        this.scalar(e, r.V.T, 2, o, !0);
        break;
      case "enum":
        this.scalar(e, w.INT32, 2, o, !0);
        break;
      case "message":
        this.message(e, n, r.V.T(), 2, o);
        break;
    }
    e.join();
  }
  message(e, n, r, i, o) {
    o !== void 0 && (r.internalBinaryWrite(o, e.tag(i, un.LengthDelimited).fork(), n), e.join());
  }
  /**
   * Write a single scalar value.
   */
  scalar(e, n, r, i, o) {
    let [s, a, c] = this.scalarInfo(n, i);
    (!c || o) && (e.tag(r, s), e[a](i));
  }
  /**
   * Write an array of scalar values in packed format.
   */
  packed(e, n, r, i) {
    if (!i.length)
      return;
    Tt(n !== w.BYTES && n !== w.STRING), e.tag(r, un.LengthDelimited), e.fork();
    let [, o] = this.scalarInfo(n);
    for (let s = 0; s < i.length; s++)
      e[o](i[s]);
    e.join();
  }
  /**
   * Get information for writing a scalar value.
   *
   * Returns tuple:
   * [0]: appropriate WireType
   * [1]: name of the appropriate method of IBinaryWriter
   * [2]: whether the given value is a default value
   *
   * If argument `value` is omitted, [2] is always false.
   */
  scalarInfo(e, n) {
    let r = un.Varint, i, o = n === void 0, s = n === 0;
    switch (e) {
      case w.INT32:
        i = "int32";
        break;
      case w.STRING:
        s = o || !n.length, r = un.LengthDelimited, i = "string";
        break;
      case w.BOOL:
        s = n === !1, i = "bool";
        break;
      case w.UINT32:
        i = "uint32";
        break;
      case w.DOUBLE:
        r = un.Bit64, i = "double";
        break;
      case w.FLOAT:
        r = un.Bit32, i = "float";
        break;
      case w.INT64:
        s = o || dn.from(n).isZero(), i = "int64";
        break;
      case w.UINT64:
        s = o || mr.from(n).isZero(), i = "uint64";
        break;
      case w.FIXED64:
        s = o || mr.from(n).isZero(), r = un.Bit64, i = "fixed64";
        break;
      case w.BYTES:
        s = o || !n.byteLength, r = un.LengthDelimited, i = "bytes";
        break;
      case w.FIXED32:
        r = un.Bit32, i = "fixed32";
        break;
      case w.SFIXED32:
        r = un.Bit32, i = "sfixed32";
        break;
      case w.SFIXED64:
        s = o || dn.from(n).isZero(), r = un.Bit64, i = "sfixed64";
        break;
      case w.SINT32:
        i = "sint32";
        break;
      case w.SINT64:
        s = o || dn.from(n).isZero(), i = "sint64";
        break;
    }
    return [r, i, o || s];
  }
}
function m9(t) {
  const e = t.messagePrototype ? Object.create(t.messagePrototype) : Object.defineProperty({}, CO, { value: t });
  for (let n of t.fields) {
    let r = n.localName;
    if (!n.opt)
      if (n.oneof)
        e[n.oneof] = { oneofKind: void 0 };
      else if (n.repeat)
        e[r] = [];
      else
        switch (n.kind) {
          case "scalar":
            e[r] = Nw(n.T, n.L);
            break;
          case "enum":
            e[r] = 0;
            break;
          case "map":
            e[r] = {};
            break;
        }
  }
  return e;
}
function Ny(t, e, n) {
  let r, i = n, o;
  for (let s of t.fields) {
    let a = s.localName;
    if (s.oneof) {
      const c = i[s.oneof];
      if (c?.oneofKind == null)
        continue;
      if (r = c[a], o = e[s.oneof], o.oneofKind = c.oneofKind, r == null) {
        delete o[a];
        continue;
      }
    } else if (r = i[a], o = e, r == null)
      continue;
    switch (s.repeat && (o[a].length = r.length), s.kind) {
      case "scalar":
      case "enum":
        if (s.repeat)
          for (let u = 0; u < r.length; u++)
            o[a][u] = r[u];
        else
          o[a] = r;
        break;
      case "message":
        let c = s.T();
        if (s.repeat)
          for (let u = 0; u < r.length; u++)
            o[a][u] = c.create(r[u]);
        else o[a] === void 0 ? o[a] = c.create(r) : c.mergePartial(o[a], r);
        break;
      case "map":
        switch (s.V.kind) {
          case "scalar":
          case "enum":
            Object.assign(o[a], r);
            break;
          case "message":
            let u = s.V.T();
            for (let l of Object.keys(r))
              o[a][l] = u.create(r[l]);
            break;
        }
        break;
    }
  }
}
function g9(t, e, n) {
  if (e === n)
    return !0;
  if (!e || !n)
    return !1;
  for (let r of t.fields) {
    let i = r.localName, o = r.oneof ? e[r.oneof][i] : e[i], s = r.oneof ? n[r.oneof][i] : n[i];
    switch (r.kind) {
      case "enum":
      case "scalar":
        let a = r.kind == "enum" ? w.INT32 : r.T;
        if (!(r.repeat ? rI(a, o, s) : TO(a, o, s)))
          return !1;
        break;
      case "map":
        if (!(r.V.kind == "message" ? iI(r.V.T(), Cf(o), Cf(s)) : rI(r.V.kind == "enum" ? w.INT32 : r.V.T, Cf(o), Cf(s))))
          return !1;
        break;
      case "message":
        let c = r.T();
        if (!(r.repeat ? iI(c, o, s) : c.equals(o, s)))
          return !1;
        break;
    }
  }
  return !0;
}
const Cf = Object.values;
function TO(t, e, n) {
  if (e === n)
    return !0;
  if (t !== w.BYTES)
    return !1;
  let r = e, i = n;
  if (r.length !== i.length)
    return !1;
  for (let o = 0; o < r.length; o++)
    if (r[o] != i[o])
      return !1;
  return !0;
}
function rI(t, e, n) {
  if (e.length !== n.length)
    return !1;
  for (let r = 0; r < e.length; r++)
    if (!TO(t, e[r], n[r]))
      return !1;
  return !0;
}
function iI(t, e, n) {
  if (e.length !== n.length)
    return !1;
  for (let r = 0; r < e.length; r++)
    if (!t.equals(e[r], n[r]))
      return !1;
  return !0;
}
const kO = Object.getOwnPropertyDescriptors(Object.getPrototypeOf({})), y9 = kO[CO] = {};
class Tp {
  constructor(e, n, r) {
    this.defaultCheckDepth = 16, this.typeName = e, this.fields = n.map(c9), this.options = r ?? {}, y9.value = this, this.messagePrototype = Object.create(null, kO), this.refTypeCheck = new l9(this), this.refJsonReader = new p9(this), this.refJsonWriter = new d9(this), this.refBinReader = new f9(this), this.refBinWriter = new h9(this);
  }
  create(e) {
    let n = m9(this);
    return e !== void 0 && Ny(this, n, e), n;
  }
  /**
   * Clone the message.
   *
   * Unknown fields are discarded.
   */
  clone(e) {
    let n = this.create();
    return Ny(this, n, e), n;
  }
  /**
   * Determines whether two message of the same type have the same field values.
   * Checks for deep equality, traversing repeated fields, oneof groups, maps
   * and messages recursively.
   * Will also return true if both messages are `undefined`.
   */
  equals(e, n) {
    return g9(this, e, n);
  }
  /**
   * Is the given value assignable to our message type
   * and contains no [excess properties](https://www.typescriptlang.org/docs/handbook/interfaces.html#excess-property-checks)?
   */
  is(e, n = this.defaultCheckDepth) {
    return this.refTypeCheck.is(e, n, !1);
  }
  /**
   * Is the given value assignable to our message type,
   * regardless of [excess properties](https://www.typescriptlang.org/docs/handbook/interfaces.html#excess-property-checks)?
   */
  isAssignable(e, n = this.defaultCheckDepth) {
    return this.refTypeCheck.is(e, n, !0);
  }
  /**
   * Copy partial data into the target message.
   */
  mergePartial(e, n) {
    Ny(this, e, n);
  }
  /**
   * Create a new message from binary format.
   */
  fromBinary(e, n) {
    let r = JL(n);
    return this.internalBinaryRead(r.readerFactory(e), e.byteLength, r);
  }
  /**
   * Read a new message from a JSON value.
   */
  fromJson(e, n) {
    return this.internalJsonRead(e, s9(n));
  }
  /**
   * Read a new message from a JSON string.
   * This is equivalent to `T.fromJson(JSON.parse(json))`.
   */
  fromJsonString(e, n) {
    let r = JSON.parse(e);
    return this.fromJson(r, n);
  }
  /**
   * Write the message to canonical JSON value.
   */
  toJson(e, n) {
    return this.internalJsonWrite(e, a9(n));
  }
  /**
   * Convert the message to canonical JSON string.
   * This is equivalent to `JSON.stringify(T.toJson(t))`
   */
  toJsonString(e, n) {
    var r;
    let i = this.toJson(e, n);
    return JSON.stringify(i, null, (r = n?.prettySpaces) !== null && r !== void 0 ? r : 0);
  }
  /**
   * Write the message to binary format.
   */
  toBinary(e, n) {
    let r = i9(n);
    return this.internalBinaryWrite(e, r.writerFactory(), r).finish();
  }
  /**
   * This is an internal method. If you just want to read a message from
   * JSON, use `fromJson()` or `fromJsonString()`.
   *
   * Reads JSON value and merges the fields into the target
   * according to protobuf rules. If the target is omitted,
   * a new instance is created first.
   */
  internalJsonRead(e, n, r) {
    if (e !== null && typeof e == "object" && !Array.isArray(e)) {
      let i = r ?? this.create();
      return this.refJsonReader.read(e, i, n), i;
    }
    throw new Error(`Unable to parse message ${this.typeName} from JSON ${SO(e)}.`);
  }
  /**
   * This is an internal method. If you just want to write a message
   * to JSON, use `toJson()` or `toJsonString().
   *
   * Writes JSON value and returns it.
   */
  internalJsonWrite(e, n) {
    return this.refJsonWriter.write(e, n);
  }
  /**
   * This is an internal method. If you just want to write a message
   * in binary format, use `toBinary()`.
   *
   * Serializes the message in binary format and appends it to the given
   * writer. Returns passed writer.
   */
  internalBinaryWrite(e, n, r) {
    return this.refBinWriter.write(e, n, r), n;
  }
  /**
   * This is an internal method. If you just want to read a message from
   * binary data, use `fromBinary()`.
   *
   * Reads data from binary format and merges the fields into
   * the target according to protobuf rules. If the target is
   * omitted, a new instance is created first.
   */
  internalBinaryRead(e, n, r, i) {
    let o = i ?? this.create();
    return this.refBinReader.read(e, o, r, n), o;
  }
}
function b(t, e, n, r) {
  return typeof e == "function" ? { kind: "message", no: t, type: e, optional: n ?? !1, repeat: r ?? !1 } : { kind: "scalar", no: t, type: e, optional: n ?? !1, repeat: r ?? !1 };
}
class xm {
  _field;
  _proto_msg;
  static cache = /* @__PURE__ */ new WeakMap();
  constructor(e) {
    this._field = Object.keys(e).map((n) => {
      const r = e[n];
      if (r.kind === "scalar") {
        const i = r.repeat ? [w.STRING, w.BYTES].includes(r.type) ? Rr.UNPACKED : Rr.PACKED : Rr.NO;
        return {
          no: r.no,
          name: n,
          kind: "scalar",
          T: r.type,
          opt: r.optional,
          repeat: i
        };
      } else {
        if (r.kind === "message")
          return {
            no: r.no,
            name: n,
            kind: "message",
            repeat: r.repeat ? Rr.PACKED : Rr.NO,
            T: () => xm.getInstance(r.type())._proto_msg
          };
        throw new Error(`Unknown field kind: ${r.kind}`);
      }
    }), this._proto_msg = new Tp("nya", this._field);
  }
  static getInstance(e) {
    let n = this.cache.get(e);
    return n || (n = new xm(e), this.cache.set(e, n)), n;
  }
  encode(e) {
    return this._proto_msg.toBinary(this._proto_msg.create(e));
  }
  decode(e) {
    return this._proto_msg.fromBinary(e);
  }
}
class fe {
  realMsg;
  constructor(e) {
    this.realMsg = xm.getInstance(e);
  }
  encode(e) {
    return this.realMsg.encode(e);
  }
  decode(e) {
    return this.realMsg.decode(e);
  }
}
var On = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function Bo(t) {
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
}
function NO(t) {
  if (Object.prototype.hasOwnProperty.call(t, "__esModule")) return t;
  var e = t.default;
  if (typeof e == "function") {
    var n = function r() {
      return this instanceof r ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments);
    };
    n.prototype = e.prototype;
  } else n = {};
  return Object.defineProperty(n, "__esModule", { value: !0 }), Object.keys(t).forEach(function(r) {
    var i = Object.getOwnPropertyDescriptor(t, r);
    Object.defineProperty(n, r, i.get ? i : {
      enumerable: !0,
      get: function() {
        return t[r];
      }
    });
  }), n;
}
var oI = {};
/*! *****************************************************************************
Copyright (C) Microsoft. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0

THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.

See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
var sI;
function v9() {
  if (sI) return oI;
  sI = 1;
  var t;
  return (function(e) {
    (function(n) {
      var r = typeof globalThis == "object" ? globalThis : typeof On == "object" ? On : typeof self == "object" ? self : typeof this == "object" ? this : c(), i = o(e);
      typeof r.Reflect < "u" && (i = o(r.Reflect, i)), n(i, r), typeof r.Reflect > "u" && (r.Reflect = e);
      function o(u, l) {
        return function(d, f) {
          Object.defineProperty(u, d, { configurable: !0, writable: !0, value: f }), l && l(d, f);
        };
      }
      function s() {
        try {
          return Function("return this;")();
        } catch {
        }
      }
      function a() {
        try {
          return (0, eval)("(function() { return this; })()");
        } catch {
        }
      }
      function c() {
        return s() || a();
      }
    })(function(n, r) {
      var i = Object.prototype.hasOwnProperty, o = typeof Symbol == "function", s = o && typeof Symbol.toPrimitive < "u" ? Symbol.toPrimitive : "@@toPrimitive", a = o && typeof Symbol.iterator < "u" ? Symbol.iterator : "@@iterator", c = typeof Object.create == "function", u = { __proto__: [] } instanceof Array, l = !c && !u, d = {
        // create an object in dictionary mode (a.k.a. "slow" mode in v8)
        create: c ? function() {
          return Cy(/* @__PURE__ */ Object.create(null));
        } : u ? function() {
          return Cy({ __proto__: null });
        } : function() {
          return Cy({});
        },
        has: l ? function(oe, ce) {
          return i.call(oe, ce);
        } : function(oe, ce) {
          return ce in oe;
        },
        get: l ? function(oe, ce) {
          return i.call(oe, ce) ? oe[ce] : void 0;
        } : function(oe, ce) {
          return oe[ce];
        }
      }, f = Object.getPrototypeOf(Function), m = typeof Map == "function" && typeof Map.prototype.entries == "function" ? Map : Zn(), h = typeof Set == "function" && typeof Set.prototype.entries == "function" ? Set : KU(), y = typeof WeakMap == "function" ? WeakMap : VU(), x = o ? Symbol.for("@reflect-metadata:registry") : void 0, g = qe(), v = Nt(g);
      function S(oe, ce, he, Te) {
        if (L(he)) {
          if (!Q(oe))
            throw new TypeError();
          if (!se(ce))
            throw new TypeError();
          return D(oe, ce);
        } else {
          if (!Q(oe))
            throw new TypeError();
          if (!F(ce))
            throw new TypeError();
          if (!F(Te) && !L(Te) && !k(Te))
            throw new TypeError();
          return k(Te) && (Te = void 0), he = P(he), X(oe, ce, he, Te);
        }
      }
      n("decorate", S);
      function E(oe, ce) {
        function he(Te, Xe) {
          if (!F(Te))
            throw new TypeError();
          if (!L(Xe) && !ae(Xe))
            throw new TypeError();
          I(oe, ce, Te, Xe);
        }
        return he;
      }
      n("metadata", E);
      function T(oe, ce, he, Te) {
        if (!F(he))
          throw new TypeError();
        return L(Te) || (Te = P(Te)), I(oe, ce, he, Te);
      }
      n("defineMetadata", T);
      function j(oe, ce, he) {
        if (!F(ce))
          throw new TypeError();
        return L(he) || (he = P(he)), V(oe, ce, he);
      }
      n("hasMetadata", j);
      function q(oe, ce, he) {
        if (!F(ce))
          throw new TypeError();
        return L(he) || (he = P(he)), K(oe, ce, he);
      }
      n("hasOwnMetadata", q);
      function Y(oe, ce, he) {
        if (!F(ce))
          throw new TypeError();
        return L(he) || (he = P(he)), $(oe, ce, he);
      }
      n("getMetadata", Y);
      function W(oe, ce, he) {
        if (!F(ce))
          throw new TypeError();
        return L(he) || (he = P(he)), _(oe, ce, he);
      }
      n("getOwnMetadata", W);
      function G(oe, ce) {
        if (!F(oe))
          throw new TypeError();
        return L(ce) || (ce = P(ce)), N(oe, ce);
      }
      n("getMetadataKeys", G);
      function J(oe, ce) {
        if (!F(oe))
          throw new TypeError();
        return L(ce) || (ce = P(ce)), U(oe, ce);
      }
      n("getOwnMetadataKeys", J);
      function B(oe, ce, he) {
        if (!F(ce))
          throw new TypeError();
        if (L(he) || (he = P(he)), !F(ce))
          throw new TypeError();
        L(he) || (he = P(he));
        var Te = st(
          ce,
          he,
          /*Create*/
          !1
        );
        return L(Te) ? !1 : Te.OrdinaryDeleteMetadata(oe, ce, he);
      }
      n("deleteMetadata", B);
      function D(oe, ce) {
        for (var he = oe.length - 1; he >= 0; --he) {
          var Te = oe[he], Xe = Te(ce);
          if (!L(Xe) && !k(Xe)) {
            if (!se(Xe))
              throw new TypeError();
            ce = Xe;
          }
        }
        return ce;
      }
      function X(oe, ce, he, Te) {
        for (var Xe = oe.length - 1; Xe >= 0; --Xe) {
          var sn = oe[Xe], In = sn(ce, he, Te);
          if (!L(In) && !k(In)) {
            if (!F(In))
              throw new TypeError();
            Te = In;
          }
        }
        return Te;
      }
      function V(oe, ce, he) {
        var Te = K(oe, ce, he);
        if (Te)
          return !0;
        var Xe = Ke(ce);
        return k(Xe) ? !1 : V(oe, Xe, he);
      }
      function K(oe, ce, he) {
        var Te = st(
          ce,
          he,
          /*Create*/
          !1
        );
        return L(Te) ? !1 : Z(Te.OrdinaryHasOwnMetadata(oe, ce, he));
      }
      function $(oe, ce, he) {
        var Te = K(oe, ce, he);
        if (Te)
          return _(oe, ce, he);
        var Xe = Ke(ce);
        if (!k(Xe))
          return $(oe, Xe, he);
      }
      function _(oe, ce, he) {
        var Te = st(
          ce,
          he,
          /*Create*/
          !1
        );
        if (!L(Te))
          return Te.OrdinaryGetOwnMetadata(oe, ce, he);
      }
      function I(oe, ce, he, Te) {
        var Xe = st(
          he,
          Te,
          /*Create*/
          !0
        );
        Xe.OrdinaryDefineOwnMetadata(oe, ce, he, Te);
      }
      function N(oe, ce) {
        var he = U(oe, ce), Te = Ke(oe);
        if (Te === null)
          return he;
        var Xe = N(Te, ce);
        if (Xe.length <= 0)
          return he;
        if (he.length <= 0)
          return Xe;
        for (var sn = new h(), In = [], gt = 0, De = he; gt < De.length; gt++) {
          var Be = De[gt], Le = sn.has(Be);
          Le || (sn.add(Be), In.push(Be));
        }
        for (var Qe = 0, bt = Xe; Qe < bt.length; Qe++) {
          var Be = bt[Qe], Le = sn.has(Be);
          Le || (sn.add(Be), In.push(Be));
        }
        return In;
      }
      function U(oe, ce) {
        var he = st(
          oe,
          ce,
          /*create*/
          !1
        );
        return he ? he.OrdinaryOwnMetadataKeys(oe, ce) : [];
      }
      function C(oe) {
        if (oe === null)
          return 1;
        switch (typeof oe) {
          case "undefined":
            return 0;
          case "boolean":
            return 2;
          case "string":
            return 3;
          case "symbol":
            return 4;
          case "number":
            return 5;
          case "object":
            return oe === null ? 1 : 6;
          default:
            return 6;
        }
      }
      function L(oe) {
        return oe === void 0;
      }
      function k(oe) {
        return oe === null;
      }
      function M(oe) {
        return typeof oe == "symbol";
      }
      function F(oe) {
        return typeof oe == "object" ? oe !== null : typeof oe == "function";
      }
      function A(oe, ce) {
        switch (C(oe)) {
          case 0:
            return oe;
          case 1:
            return oe;
          case 2:
            return oe;
          case 3:
            return oe;
          case 4:
            return oe;
          case 5:
            return oe;
        }
        var he = "string", Te = we(oe, s);
        if (Te !== void 0) {
          var Xe = Te.call(oe, he);
          if (F(Xe))
            throw new TypeError();
          return Xe;
        }
        return O(oe);
      }
      function O(oe, ce) {
        var he, Te, Xe;
        {
          var sn = oe.toString;
          if (z(sn)) {
            var Te = sn.call(oe);
            if (!F(Te))
              return Te;
          }
          var he = oe.valueOf;
          if (z(he)) {
            var Te = he.call(oe);
            if (!F(Te))
              return Te;
          }
        }
        throw new TypeError();
      }
      function Z(oe) {
        return !!oe;
      }
      function ee(oe) {
        return "" + oe;
      }
      function P(oe) {
        var ce = A(oe);
        return M(ce) ? ce : ee(ce);
      }
      function Q(oe) {
        return Array.isArray ? Array.isArray(oe) : oe instanceof Object ? oe instanceof Array : Object.prototype.toString.call(oe) === "[object Array]";
      }
      function z(oe) {
        return typeof oe == "function";
      }
      function se(oe) {
        return typeof oe == "function";
      }
      function ae(oe) {
        switch (C(oe)) {
          case 3:
            return !0;
          case 4:
            return !0;
          default:
            return !1;
        }
      }
      function ie(oe, ce) {
        return oe === ce || oe !== oe && ce !== ce;
      }
      function we(oe, ce) {
        var he = oe[ce];
        if (he != null) {
          if (!z(he))
            throw new TypeError();
          return he;
        }
      }
      function Oe(oe) {
        var ce = we(oe, a);
        if (!z(ce))
          throw new TypeError();
        var he = ce.call(oe);
        if (!F(he))
          throw new TypeError();
        return he;
      }
      function He(oe) {
        return oe.value;
      }
      function We(oe) {
        var ce = oe.next();
        return ce.done ? !1 : ce;
      }
      function Ye(oe) {
        var ce = oe.return;
        ce && ce.call(oe);
      }
      function Ke(oe) {
        var ce = Object.getPrototypeOf(oe);
        if (typeof oe != "function" || oe === f || ce !== f)
          return ce;
        var he = oe.prototype, Te = he && Object.getPrototypeOf(he);
        if (Te == null || Te === Object.prototype)
          return ce;
        var Xe = Te.constructor;
        return typeof Xe != "function" || Xe === oe ? ce : Xe;
      }
      function nt() {
        var oe;
        !L(x) && typeof r.Reflect < "u" && !(x in r.Reflect) && typeof r.Reflect.defineMetadata == "function" && (oe = Er(r.Reflect));
        var ce, he, Te, Xe = new y(), sn = {
          registerProvider: In,
          getProvider: De,
          setProvider: Le
        };
        return sn;
        function In(Qe) {
          if (!Object.isExtensible(sn))
            throw new Error("Cannot add provider to a frozen registry.");
          switch (!0) {
            case oe === Qe:
              break;
            case L(ce):
              ce = Qe;
              break;
            case ce === Qe:
              break;
            case L(he):
              he = Qe;
              break;
            case he === Qe:
              break;
            default:
              Te === void 0 && (Te = new h()), Te.add(Qe);
              break;
          }
        }
        function gt(Qe, bt) {
          if (!L(ce)) {
            if (ce.isProviderFor(Qe, bt))
              return ce;
            if (!L(he)) {
              if (he.isProviderFor(Qe, bt))
                return ce;
              if (!L(Te))
                for (var Gt = Oe(Te); ; ) {
                  var an = We(Gt);
                  if (!an)
                    return;
                  var Bi = He(an);
                  if (Bi.isProviderFor(Qe, bt))
                    return Ye(Gt), Bi;
                }
            }
          }
          if (!L(oe) && oe.isProviderFor(Qe, bt))
            return oe;
        }
        function De(Qe, bt) {
          var Gt = Xe.get(Qe), an;
          return L(Gt) || (an = Gt.get(bt)), L(an) && (an = gt(Qe, bt), L(an) || (L(Gt) && (Gt = new m(), Xe.set(Qe, Gt)), Gt.set(bt, an))), an;
        }
        function Be(Qe) {
          if (L(Qe))
            throw new TypeError();
          return ce === Qe || he === Qe || !L(Te) && Te.has(Qe);
        }
        function Le(Qe, bt, Gt) {
          if (!Be(Gt))
            throw new Error("Metadata provider not registered.");
          var an = De(Qe, bt);
          if (an !== Gt) {
            if (!L(an))
              return !1;
            var Bi = Xe.get(Qe);
            L(Bi) && (Bi = new m(), Xe.set(Qe, Bi)), Bi.set(bt, Gt);
          }
          return !0;
        }
      }
      function qe() {
        var oe;
        return !L(x) && F(r.Reflect) && Object.isExtensible(r.Reflect) && (oe = r.Reflect[x]), L(oe) && (oe = nt()), !L(x) && F(r.Reflect) && Object.isExtensible(r.Reflect) && Object.defineProperty(r.Reflect, x, {
          enumerable: !1,
          configurable: !1,
          writable: !1,
          value: oe
        }), oe;
      }
      function Nt(oe) {
        var ce = new y(), he = {
          isProviderFor: function(Be, Le) {
            var Qe = ce.get(Be);
            return L(Qe) ? !1 : Qe.has(Le);
          },
          OrdinaryDefineOwnMetadata: In,
          OrdinaryHasOwnMetadata: Xe,
          OrdinaryGetOwnMetadata: sn,
          OrdinaryOwnMetadataKeys: gt,
          OrdinaryDeleteMetadata: De
        };
        return g.registerProvider(he), he;
        function Te(Be, Le, Qe) {
          var bt = ce.get(Be), Gt = !1;
          if (L(bt)) {
            if (!Qe)
              return;
            bt = new m(), ce.set(Be, bt), Gt = !0;
          }
          var an = bt.get(Le);
          if (L(an)) {
            if (!Qe)
              return;
            if (an = new m(), bt.set(Le, an), !oe.setProvider(Be, Le, he))
              throw bt.delete(Le), Gt && ce.delete(Be), new Error("Wrong provider for target.");
          }
          return an;
        }
        function Xe(Be, Le, Qe) {
          var bt = Te(
            Le,
            Qe,
            /*Create*/
            !1
          );
          return L(bt) ? !1 : Z(bt.has(Be));
        }
        function sn(Be, Le, Qe) {
          var bt = Te(
            Le,
            Qe,
            /*Create*/
            !1
          );
          if (!L(bt))
            return bt.get(Be);
        }
        function In(Be, Le, Qe, bt) {
          var Gt = Te(
            Qe,
            bt,
            /*Create*/
            !0
          );
          Gt.set(Be, Le);
        }
        function gt(Be, Le) {
          var Qe = [], bt = Te(
            Be,
            Le,
            /*Create*/
            !1
          );
          if (L(bt))
            return Qe;
          for (var Gt = bt.keys(), an = Oe(Gt), Bi = 0; ; ) {
            var Q2 = We(an);
            if (!Q2)
              return Qe.length = Bi, Qe;
            var YU = He(Q2);
            try {
              Qe[Bi] = YU;
            } catch (JU) {
              try {
                Ye(an);
              } finally {
                throw JU;
              }
            }
            Bi++;
          }
        }
        function De(Be, Le, Qe) {
          var bt = Te(
            Le,
            Qe,
            /*Create*/
            !1
          );
          if (L(bt) || !bt.delete(Be))
            return !1;
          if (bt.size === 0) {
            var Gt = ce.get(Le);
            L(Gt) || (Gt.delete(Qe), Gt.size === 0 && ce.delete(Gt));
          }
          return !0;
        }
      }
      function Er(oe) {
        var ce = oe.defineMetadata, he = oe.hasOwnMetadata, Te = oe.getOwnMetadata, Xe = oe.getOwnMetadataKeys, sn = oe.deleteMetadata, In = new y(), gt = {
          isProviderFor: function(De, Be) {
            var Le = In.get(De);
            return !L(Le) && Le.has(Be) ? !0 : Xe(De, Be).length ? (L(Le) && (Le = new h(), In.set(De, Le)), Le.add(Be), !0) : !1;
          },
          OrdinaryDefineOwnMetadata: ce,
          OrdinaryHasOwnMetadata: he,
          OrdinaryGetOwnMetadata: Te,
          OrdinaryOwnMetadataKeys: Xe,
          OrdinaryDeleteMetadata: sn
        };
        return gt;
      }
      function st(oe, ce, he) {
        var Te = g.getProvider(oe, ce);
        if (!L(Te))
          return Te;
        if (he) {
          if (g.setProvider(oe, ce, v))
            return v;
          throw new Error("Illegal state.");
        }
      }
      function Zn() {
        var oe = {}, ce = [], he = (
          /** @class */
          (function() {
            function gt(De, Be, Le) {
              this._index = 0, this._keys = De, this._values = Be, this._selector = Le;
            }
            return gt.prototype["@@iterator"] = function() {
              return this;
            }, gt.prototype[a] = function() {
              return this;
            }, gt.prototype.next = function() {
              var De = this._index;
              if (De >= 0 && De < this._keys.length) {
                var Be = this._selector(this._keys[De], this._values[De]);
                return De + 1 >= this._keys.length ? (this._index = -1, this._keys = ce, this._values = ce) : this._index++, { value: Be, done: !1 };
              }
              return { value: void 0, done: !0 };
            }, gt.prototype.throw = function(De) {
              throw this._index >= 0 && (this._index = -1, this._keys = ce, this._values = ce), De;
            }, gt.prototype.return = function(De) {
              return this._index >= 0 && (this._index = -1, this._keys = ce, this._values = ce), { value: De, done: !0 };
            }, gt;
          })()
        ), Te = (
          /** @class */
          (function() {
            function gt() {
              this._keys = [], this._values = [], this._cacheKey = oe, this._cacheIndex = -2;
            }
            return Object.defineProperty(gt.prototype, "size", {
              get: function() {
                return this._keys.length;
              },
              enumerable: !0,
              configurable: !0
            }), gt.prototype.has = function(De) {
              return this._find(
                De,
                /*insert*/
                !1
              ) >= 0;
            }, gt.prototype.get = function(De) {
              var Be = this._find(
                De,
                /*insert*/
                !1
              );
              return Be >= 0 ? this._values[Be] : void 0;
            }, gt.prototype.set = function(De, Be) {
              var Le = this._find(
                De,
                /*insert*/
                !0
              );
              return this._values[Le] = Be, this;
            }, gt.prototype.delete = function(De) {
              var Be = this._find(
                De,
                /*insert*/
                !1
              );
              if (Be >= 0) {
                for (var Le = this._keys.length, Qe = Be + 1; Qe < Le; Qe++)
                  this._keys[Qe - 1] = this._keys[Qe], this._values[Qe - 1] = this._values[Qe];
                return this._keys.length--, this._values.length--, ie(De, this._cacheKey) && (this._cacheKey = oe, this._cacheIndex = -2), !0;
              }
              return !1;
            }, gt.prototype.clear = function() {
              this._keys.length = 0, this._values.length = 0, this._cacheKey = oe, this._cacheIndex = -2;
            }, gt.prototype.keys = function() {
              return new he(this._keys, this._values, Xe);
            }, gt.prototype.values = function() {
              return new he(this._keys, this._values, sn);
            }, gt.prototype.entries = function() {
              return new he(this._keys, this._values, In);
            }, gt.prototype["@@iterator"] = function() {
              return this.entries();
            }, gt.prototype[a] = function() {
              return this.entries();
            }, gt.prototype._find = function(De, Be) {
              if (!ie(this._cacheKey, De)) {
                this._cacheIndex = -1;
                for (var Le = 0; Le < this._keys.length; Le++)
                  if (ie(this._keys[Le], De)) {
                    this._cacheIndex = Le;
                    break;
                  }
              }
              return this._cacheIndex < 0 && Be && (this._cacheIndex = this._keys.length, this._keys.push(De), this._values.push(void 0)), this._cacheIndex;
            }, gt;
          })()
        );
        return Te;
        function Xe(gt, De) {
          return gt;
        }
        function sn(gt, De) {
          return De;
        }
        function In(gt, De) {
          return [gt, De];
        }
      }
      function KU() {
        var oe = (
          /** @class */
          (function() {
            function ce() {
              this._map = new m();
            }
            return Object.defineProperty(ce.prototype, "size", {
              get: function() {
                return this._map.size;
              },
              enumerable: !0,
              configurable: !0
            }), ce.prototype.has = function(he) {
              return this._map.has(he);
            }, ce.prototype.add = function(he) {
              return this._map.set(he, he), this;
            }, ce.prototype.delete = function(he) {
              return this._map.delete(he);
            }, ce.prototype.clear = function() {
              this._map.clear();
            }, ce.prototype.keys = function() {
              return this._map.keys();
            }, ce.prototype.values = function() {
              return this._map.keys();
            }, ce.prototype.entries = function() {
              return this._map.entries();
            }, ce.prototype["@@iterator"] = function() {
              return this.keys();
            }, ce.prototype[a] = function() {
              return this.keys();
            }, ce;
          })()
        );
        return oe;
      }
      function VU() {
        var oe = 16, ce = d.create(), he = Te();
        return (
          /** @class */
          (function() {
            function De() {
              this._key = Te();
            }
            return De.prototype.has = function(Be) {
              var Le = Xe(
                Be,
                /*create*/
                !1
              );
              return Le !== void 0 ? d.has(Le, this._key) : !1;
            }, De.prototype.get = function(Be) {
              var Le = Xe(
                Be,
                /*create*/
                !1
              );
              return Le !== void 0 ? d.get(Le, this._key) : void 0;
            }, De.prototype.set = function(Be, Le) {
              var Qe = Xe(
                Be,
                /*create*/
                !0
              );
              return Qe[this._key] = Le, this;
            }, De.prototype.delete = function(Be) {
              var Le = Xe(
                Be,
                /*create*/
                !1
              );
              return Le !== void 0 ? delete Le[this._key] : !1;
            }, De.prototype.clear = function() {
              this._key = Te();
            }, De;
          })()
        );
        function Te() {
          var De;
          do
            De = "@@WeakMap@@" + gt();
          while (d.has(ce, De));
          return ce[De] = !0, De;
        }
        function Xe(De, Be) {
          if (!i.call(De, he)) {
            if (!Be)
              return;
            Object.defineProperty(De, he, { value: d.create() });
          }
          return De[he];
        }
        function sn(De, Be) {
          for (var Le = 0; Le < Be; ++Le)
            De[Le] = Math.random() * 255 | 0;
          return De;
        }
        function In(De) {
          if (typeof Uint8Array == "function") {
            var Be = new Uint8Array(De);
            return typeof crypto < "u" ? crypto.getRandomValues(Be) : typeof msCrypto < "u" ? msCrypto.getRandomValues(Be) : sn(Be, De), Be;
          }
          return sn(new Array(De), De);
        }
        function gt() {
          var De = In(oe);
          De[6] = De[6] & 79 | 64, De[8] = De[8] & 191 | 128;
          for (var Be = "", Le = 0; Le < oe; ++Le) {
            var Qe = De[Le];
            (Le === 4 || Le === 6 || Le === 8) && (Be += "-"), Qe < 16 && (Be += "0"), Be += Qe.toString(16).toLowerCase();
          }
          return Be;
        }
      }
      function Cy(oe) {
        return oe.__ = void 0, delete oe.__, oe;
      }
    });
  })(t || (t = {})), oI;
}
v9();
function wn(t) {
  return (typeof t == "object" && t !== null || typeof t == "function") && typeof t.then == "function";
}
function nr(t) {
  switch (typeof t) {
    case "string":
    case "symbol":
      return t.toString();
    case "function":
      return t.name;
    default:
      throw new Error(`Unexpected ${typeof t} service id type`);
  }
}
const Py = Symbol.for("@inversifyjs/common/islazyServiceIdentifier");
class wm {
  [Py];
  #e;
  constructor(e) {
    this.#e = e, this[Py] = !0;
  }
  static is(e) {
    return typeof e == "object" && e !== null && e[Py] === !0;
  }
  unwrap() {
    return this.#e();
  }
}
function pu(t, e, n) {
  return Reflect.getOwnMetadata(e, t, n);
}
function PO(t, e, n, r) {
  Reflect.defineMetadata(e, n, t, r);
}
function DO(t, e, n, r, i) {
  const o = r(pu(t, e, i) ?? n());
  Reflect.defineMetadata(e, o, t, i);
}
const Dy = "@inversifyjs/container/bindingId";
function Bs() {
  const t = pu(Object, Dy) ?? 0;
  return t === Number.MAX_SAFE_INTEGER ? PO(Object, Dy, Number.MIN_SAFE_INTEGER) : DO(Object, Dy, () => t, (e) => e + 1), t;
}
const Ai = { Request: "Request", Singleton: "Singleton", Transient: "Transient" }, At = { ConstantValue: "ConstantValue", DynamicValue: "DynamicValue", Factory: "Factory", Instance: "Instance", Provider: "Provider", ResolvedValue: "ResolvedValue", ServiceRedirection: "ServiceRedirection" };
function* FO(...t) {
  for (const e of t) yield* e;
}
class Ed {
  #e;
  #t;
  #r;
  constructor(e) {
    this.#e = /* @__PURE__ */ new Map(), this.#t = {};
    for (const n of Reflect.ownKeys(e)) this.#t[n] = /* @__PURE__ */ new Map();
    this.#r = e;
  }
  add(e, n) {
    this.#o(e).push(n);
    for (const r of Reflect.ownKeys(n)) this.#s(r, n[r]).push(e);
  }
  clone() {
    const e = this.#n(), n = this.#i(), r = Reflect.ownKeys(this.#r), i = this._buildNewInstance(this.#r);
    this.#p(this.#e, i.#e, e, n);
    for (const o of r) this.#a(this.#t[o], i.#t[o], e);
    return i;
  }
  get(e, n) {
    return this.#t[e].get(n);
  }
  getAllKeys(e) {
    return this.#t[e].keys();
  }
  removeByRelation(e, n) {
    const r = this.get(e, n);
    if (r === void 0) return;
    const i = new Set(r);
    for (const o of i) {
      const s = this.#e.get(o);
      if (s === void 0) throw new Error("Expecting model relation, none found");
      for (const a of s) a[e] === n && this.#l(o, a);
      this.#e.delete(o);
    }
  }
  _buildNewInstance(e) {
    return new Ed(e);
  }
  _cloneModel(e) {
    return e;
  }
  _cloneRelation(e) {
    return e;
  }
  #n() {
    const e = /* @__PURE__ */ new Map();
    for (const n of this.#e.keys()) {
      const r = this._cloneModel(n);
      e.set(n, r);
    }
    return e;
  }
  #i() {
    const e = /* @__PURE__ */ new Map();
    for (const n of this.#e.values()) for (const r of n) {
      const i = this._cloneRelation(r);
      e.set(r, i);
    }
    return e;
  }
  #o(e) {
    let n = this.#e.get(e);
    return n === void 0 && (n = [], this.#e.set(e, n)), n;
  }
  #s(e, n) {
    let r = this.#t[e].get(n);
    return r === void 0 && (r = [], this.#t[e].set(n, r)), r;
  }
  #u(e, n) {
    const r = n.get(e);
    if (r === void 0) throw new Error("Expecting model to be cloned, none found");
    return r;
  }
  #c(e, n) {
    const r = n.get(e);
    if (r === void 0) throw new Error("Expecting relation to be cloned, none found");
    return r;
  }
  #a(e, n, r) {
    for (const [i, o] of e) {
      const s = new Array();
      for (const a of o) s.push(this.#u(a, r));
      n.set(i, s);
    }
  }
  #p(e, n, r, i) {
    for (const [o, s] of e) {
      const a = new Array();
      for (const c of s) a.push(this.#c(c, i));
      n.set(this.#u(o, r), a);
    }
  }
  #l(e, n) {
    for (const r of Reflect.ownKeys(n)) this.#f(e, r, n[r]);
  }
  #f(e, n, r) {
    const i = this.#t[n].get(r);
    if (i !== void 0) {
      const o = i.indexOf(e);
      o !== -1 && i.splice(o, 1), i.length === 0 && this.#t[n].delete(r);
    }
  }
}
var kp;
(function(t) {
  t.moduleId = "moduleId", t.serviceId = "serviceId";
})(kp || (kp = {}));
class Hp {
  #e;
  #t;
  constructor(e, n) {
    this.#e = n ?? new Ed({ moduleId: { isOptional: !0 }, serviceId: { isOptional: !1 } }), this.#t = e;
  }
  static build(e) {
    return new Hp(e);
  }
  add(e, n) {
    this.#e.add(e, n);
  }
  clone() {
    return new Hp(this.#t, this.#e.clone());
  }
  get(e) {
    const n = [], r = this.#e.get(kp.serviceId, e);
    r !== void 0 && n.push(r);
    const i = this.#t()?.get(e);
    if (i !== void 0 && n.push(i), n.length !== 0) return FO(...n);
  }
  removeAllByModuleId(e) {
    this.#e.removeByRelation(kp.moduleId, e);
  }
  removeAllByServiceId(e) {
    this.#e.removeByRelation(kp.serviceId, e);
  }
}
const OO = "@inversifyjs/core/classMetadataReflectKey";
function MO() {
  return { constructorArguments: [], lifecycle: { postConstructMethodNames: /* @__PURE__ */ new Set(), preDestroyMethodNames: /* @__PURE__ */ new Set() }, properties: /* @__PURE__ */ new Map(), scope: void 0 };
}
const b9 = "@inversifyjs/core/pendingClassMetadataCountReflectKey", Fy = Symbol.for("@inversifyjs/core/InversifyCoreError");
let Dn = class RO extends Error {
  [Fy];
  kind;
  constructor(e, n, r) {
    super(n, r), this[Fy] = !0, this.kind = e;
  }
  static is(e) {
    return typeof e == "object" && e !== null && e[Fy] === !0;
  }
  static isErrorOfKind(e, n) {
    return RO.is(e) && e.kind === n;
  }
};
var fn, Sm, Zr, Np, as;
function Fg(t) {
  const e = pu(t, OO) ?? MO();
  if (!(function(n) {
    const r = pu(n, b9);
    return r !== void 0 && r !== 0;
  })(t)) return (function(n, r) {
    const i = [];
    if (r.length < n.length) throw new Dn(fn.missingInjectionDecorator, `Found unexpected missing metadata on type "${n.name}". "${n.name}" constructor requires at least ${n.length.toString()} arguments, found ${r.length.toString()} instead.
Are you using @inject, @multiInject or @unmanaged decorators in every non optional constructor argument?

If you're using typescript and want to rely on auto injection, set "emitDecoratorMetadata" compiler option to true`);
    for (let o = 0; o < r.length; ++o) r[o] === void 0 && i.push(o);
    if (i.length > 0) throw new Dn(fn.missingInjectionDecorator, `Found unexpected missing metadata on type "${n.name}" at constructor indexes "${i.join('", "')}".

Are you using @inject, @multiInject or @unmanaged decorators at those indexes?

If you're using typescript and want to rely on auto injection, set "emitDecoratorMetadata" compiler option to true`);
  })(t, e.constructorArguments), e;
  (function(n, r) {
    const i = [];
    for (let o = 0; o < r.constructorArguments.length; ++o) {
      const s = r.constructorArguments[o];
      s !== void 0 && s.kind !== Sm.unknown || i.push(`  - Missing or incomplete metadata for type "${n.name}" at constructor argument with index ${o.toString()}.
Every constructor parameter must be decorated either with @inject, @multiInject or @unmanaged decorator.`);
    }
    for (const [o, s] of r.properties) s.kind === Sm.unknown && i.push(`  - Missing or incomplete metadata for type "${n.name}" at property "${o.toString()}".
This property must be decorated either with @inject or @multiInject decorator.`);
    throw i.length === 0 ? new Dn(fn.unknown, `Unexpected class metadata for type "${n.name}" with uncompletion traces.
This might be caused by one of the following reasons:

1. A third party library is targeting inversify reflection metadata.
2. A bug is causing the issue. Consider submiting an issue to fix it.`) : new Dn(fn.missingInjectionDecorator, `Invalid class metadata at type ${n.name}:

${i.join(`

`)}`);
  })(t, e);
}
function BO(t, e) {
  const n = Fg(e).scope ?? t.scope;
  return { cache: { isRight: !1, value: void 0 }, id: Bs(), implementationType: e, isSatisfiedBy: () => !0, moduleId: void 0, onActivation: void 0, onDeactivation: void 0, scope: n, serviceIdentifier: e, type: At.Instance };
}
function Il(t) {
  return t.isRight ? { isRight: !0, value: t.value } : t;
}
function x9(t) {
  switch (t.type) {
    case At.ConstantValue:
    case At.DynamicValue:
      return (function(e) {
        return { cache: Il(e.cache), id: e.id, isSatisfiedBy: e.isSatisfiedBy, moduleId: e.moduleId, onActivation: e.onActivation, onDeactivation: e.onDeactivation, scope: e.scope, serviceIdentifier: e.serviceIdentifier, type: e.type, value: e.value };
      })(t);
    case At.Factory:
      return (function(e) {
        return { cache: Il(e.cache), factory: e.factory, id: e.id, isSatisfiedBy: e.isSatisfiedBy, moduleId: e.moduleId, onActivation: e.onActivation, onDeactivation: e.onDeactivation, scope: e.scope, serviceIdentifier: e.serviceIdentifier, type: e.type };
      })(t);
    case At.Instance:
      return (function(e) {
        return { cache: Il(e.cache), id: e.id, implementationType: e.implementationType, isSatisfiedBy: e.isSatisfiedBy, moduleId: e.moduleId, onActivation: e.onActivation, onDeactivation: e.onDeactivation, scope: e.scope, serviceIdentifier: e.serviceIdentifier, type: e.type };
      })(t);
    case At.Provider:
      return (function(e) {
        return { cache: Il(e.cache), id: e.id, isSatisfiedBy: e.isSatisfiedBy, moduleId: e.moduleId, onActivation: e.onActivation, onDeactivation: e.onDeactivation, provider: e.provider, scope: e.scope, serviceIdentifier: e.serviceIdentifier, type: e.type };
      })(t);
    case At.ResolvedValue:
      return (function(e) {
        return { cache: Il(e.cache), factory: e.factory, id: e.id, isSatisfiedBy: e.isSatisfiedBy, metadata: e.metadata, moduleId: e.moduleId, onActivation: e.onActivation, onDeactivation: e.onDeactivation, scope: e.scope, serviceIdentifier: e.serviceIdentifier, type: e.type };
      })(t);
    case At.ServiceRedirection:
      return (function(e) {
        return { id: e.id, isSatisfiedBy: e.isSatisfiedBy, moduleId: e.moduleId, serviceIdentifier: e.serviceIdentifier, targetServiceIdentifier: e.targetServiceIdentifier, type: e.type };
      })(t);
  }
}
(function(t) {
  t[t.injectionDecoratorConflict = 0] = "injectionDecoratorConflict", t[t.missingInjectionDecorator = 1] = "missingInjectionDecorator", t[t.planning = 2] = "planning", t[t.resolution = 3] = "resolution", t[t.unknown = 4] = "unknown";
})(fn || (fn = {})), (function(t) {
  t[t.unknown = 32] = "unknown";
})(Sm || (Sm = {})), (function(t) {
  t.id = "id", t.moduleId = "moduleId", t.serviceId = "serviceId";
})(Zr || (Zr = {}));
let w9 = class UO extends Ed {
  _buildNewInstance(e) {
    return new UO(e);
  }
  _cloneModel(e) {
    return x9(e);
  }
}, aI = class Pw {
  #e;
  #t;
  #r;
  constructor(e, n, r) {
    this.#t = r ?? new w9({ id: { isOptional: !1 }, moduleId: { isOptional: !0 }, serviceId: { isOptional: !1 } }), this.#r = e, this.#e = n;
  }
  static build(e, n) {
    return new Pw(e, n);
  }
  clone() {
    return new Pw(this.#r, this.#e, this.#t.clone());
  }
  get(e) {
    const n = this.getNonParentBindings(e) ?? this.#r()?.get(e);
    if (n !== void 0) return n;
    const r = this.#n(e);
    return r === void 0 ? r : [r];
  }
  *getChained(e) {
    const n = this.getNonParentBindings(e);
    n !== void 0 && (yield* n);
    const r = this.#r();
    if (r === void 0) {
      if (n === void 0) {
        const i = this.#n(e);
        i !== void 0 && (yield i);
      }
    } else yield* r.getChained(e);
  }
  getBoundServices() {
    const e = new Set(this.#t.getAllKeys(Zr.serviceId)), n = this.#r();
    if (n !== void 0) for (const r of n.getBoundServices()) e.add(r);
    return e;
  }
  getById(e) {
    return this.#t.get(Zr.id, e) ?? this.#r()?.getById(e);
  }
  getByModuleId(e) {
    return this.#t.get(Zr.moduleId, e) ?? this.#r()?.getByModuleId(e);
  }
  getNonParentBindings(e) {
    return this.#t.get(Zr.serviceId, e);
  }
  getNonParentBoundServices() {
    return this.#t.getAllKeys(Zr.serviceId);
  }
  removeById(e) {
    this.#t.removeByRelation(Zr.id, e);
  }
  removeAllByModuleId(e) {
    this.#t.removeByRelation(Zr.moduleId, e);
  }
  removeAllByServiceId(e) {
    this.#t.removeByRelation(Zr.serviceId, e);
  }
  set(e) {
    const n = { [Zr.id]: e.id, [Zr.serviceId]: e.serviceIdentifier };
    e.moduleId !== void 0 && (n[Zr.moduleId] = e.moduleId), this.#t.add(e, n);
  }
  #n(e) {
    if (this.#e === void 0 || typeof e != "function") return;
    const n = BO(this.#e, e);
    return this.set(n), n;
  }
};
(function(t) {
  t.moduleId = "moduleId", t.serviceId = "serviceId";
})(Np || (Np = {}));
let cI = class Dw {
  #e;
  #t;
  constructor(e, n) {
    this.#e = n ?? new Ed({ moduleId: { isOptional: !0 }, serviceId: { isOptional: !1 } }), this.#t = e;
  }
  static build(e) {
    return new Dw(e);
  }
  add(e, n) {
    this.#e.add(e, n);
  }
  clone() {
    return new Dw(this.#t, this.#e.clone());
  }
  get(e) {
    const n = [], r = this.#e.get(Np.serviceId, e);
    r !== void 0 && n.push(r);
    const i = this.#t()?.get(e);
    if (i !== void 0 && n.push(i), n.length !== 0) return FO(...n);
  }
  removeAllByModuleId(e) {
    this.#e.removeByRelation(Np.moduleId, e);
  }
  removeAllByServiceId(e) {
    this.#e.removeByRelation(Np.serviceId, e);
  }
};
(function(t) {
  t[t.multipleInjection = 0] = "multipleInjection", t[t.singleInjection = 1] = "singleInjection", t[t.unmanaged = 2] = "unmanaged";
})(as || (as = {}));
var uI;
(function(t) {
  t[t.method = 0] = "method", t[t.parameter = 1] = "parameter", t[t.property = 2] = "property";
})(uI || (uI = {}));
const lI = "@inversifyjs/core/classIsInjectableFlagReflectKey", S9 = [Array, BigInt, Boolean, Function, Number, Object, String];
function _9(t) {
  const e = pu(t, "design:paramtypes");
  e !== void 0 && DO(t, OO, MO, /* @__PURE__ */ (function(n) {
    return (r) => (n.forEach((i, o) => {
      var s;
      r.constructorArguments[o] !== void 0 || (s = i, S9.includes(s)) || (r.constructorArguments[o] = (function(a) {
        return { isFromTypescriptParamType: !0, kind: as.singleInjection, name: void 0, optional: !1, tags: /* @__PURE__ */ new Map(), value: a };
      })(i));
    }), r);
  })(e));
}
function E9(t) {
  return (e) => {
    (function(n) {
      if (pu(n, lI) !== void 0) throw new Dn(fn.injectionDecoratorConflict, `Cannot apply @injectable decorator multiple times at class "${n.name}"`);
      PO(n, lI, !0);
    })(e), _9(e);
  };
}
var cs;
function J_(t) {
  return t instanceof Error ? t instanceof RangeError && /stack space|call stack|too much recursion/i.test(t.message) || t.name === "InternalError" && /too much recursion/.test(t.message) : !1;
}
function A9(t, e) {
  if (J_(e)) {
    const n = (function(r) {
      const i = [...r];
      return i.length === 0 ? "(No dependency trace)" : i.map(nr).join(" -> ");
    })((function(r) {
      const i = /* @__PURE__ */ new Set();
      for (const o of r.servicesBranch) {
        if (i.has(o)) return [...i, o];
        i.add(o);
      }
      return [...i];
    })(t));
    throw new Dn(fn.planning, `Circular dependency found: ${n}`, { cause: e });
  }
  throw e;
}
(function(t) {
  t[t.multipleInjection = 0] = "multipleInjection", t[t.singleInjection = 1] = "singleInjection";
})(cs || (cs = {}));
const Oy = Symbol.for("@inversifyjs/core/LazyPlanServiceNode");
class ri {
  [Oy];
  _serviceIdentifier;
  _serviceNode;
  constructor(e, n) {
    this[Oy] = !0, this._serviceNode = e, this._serviceIdentifier = n;
  }
  get bindings() {
    return this._getNode().bindings;
  }
  get isContextFree() {
    return this._getNode().isContextFree;
  }
  get serviceIdentifier() {
    return this._serviceIdentifier;
  }
  set bindings(e) {
    this._getNode().bindings = e;
  }
  set isContextFree(e) {
    this._getNode().isContextFree = e;
  }
  static is(e) {
    return typeof e == "object" && e !== null && e[Oy] === !0;
  }
  invalidate() {
    this._serviceNode = void 0;
  }
  isExpanded() {
    return this._serviceNode !== void 0;
  }
  _getNode() {
    return this._serviceNode === void 0 && (this._serviceNode = this._buildPlanServiceNode()), this._serviceNode;
  }
}
class da {
  #e;
  constructor(e) {
    this.#e = e;
  }
  get name() {
    return this.#e.elem.name;
  }
  get serviceIdentifier() {
    return this.#e.elem.serviceIdentifier;
  }
  get tags() {
    return this.#e.elem.tags;
  }
  getAncestor() {
    if (this.#e.elem.getAncestorsCalled = !0, this.#e.previous !== void 0) return new da(this.#e.previous);
  }
}
function Og(t, e, n) {
  const r = n?.customServiceIdentifier ?? e.serviceIdentifier, i = (n?.chained === !0 ? [...t.operations.getBindingsChained(r)] : [...t.operations.getBindings(r) ?? []]).filter((o) => o.isSatisfiedBy(e));
  if (i.length === 0 && t.autobindOptions !== void 0 && typeof r == "function") {
    const o = BO(t.autobindOptions, r);
    t.operations.setBinding(o), o.isSatisfiedBy(e) && i.push(o);
  }
  return i;
}
class X_ {
  last;
  constructor(e) {
    this.last = e;
  }
  concat(e) {
    return new X_({ elem: e, previous: this.last });
  }
  [Symbol.iterator]() {
    let e = this.last;
    return { next: () => {
      if (e === void 0) return { done: !0, value: void 0 };
      const n = e.elem;
      return e = e.previous, { done: !1, value: n };
    } };
  }
}
function Fw(t) {
  const e = /* @__PURE__ */ new Map();
  return t.rootConstraints.tag !== void 0 && e.set(t.rootConstraints.tag.key, t.rootConstraints.tag.value), new X_({ elem: { getAncestorsCalled: !1, name: t.rootConstraints.name, serviceIdentifier: t.rootConstraints.serviceIdentifier, tags: e }, previous: void 0 });
}
function Va(t) {
  return t.redirections !== void 0;
}
function LO(t, e, n, r) {
  const i = n.elem.serviceIdentifier, o = n.previous?.elem.serviceIdentifier;
  Array.isArray(t) ? (function(s, a, c, u, l, d) {
    if (s.length !== 0) {
      const f = d[d.length - 1] ?? c, m = `Ambiguous bindings found for service: "${nr(f)}".${$O(d)}

Registered bindings:

${s.map((h) => (function(y) {
        switch (y.type) {
          case At.Instance:
            return `[ type: "${y.type}", serviceIdentifier: "${nr(y.serviceIdentifier)}", scope: "${y.scope}", implementationType: "${y.implementationType.name}" ]`;
          case At.ServiceRedirection:
            return `[ type: "${y.type}", serviceIdentifier: "${nr(y.serviceIdentifier)}", redirection: "${nr(y.targetServiceIdentifier)}" ]`;
          default:
            return `[ type: "${y.type}", serviceIdentifier: "${nr(y.serviceIdentifier)}", scope: "${y.scope}" ]`;
        }
      })(h.binding)).join(`
`)}

Trying to resolve bindings for "${jO(c, u)}".${QO(l)}`;
      throw new Dn(fn.planning, m);
    }
    a || pI(c, u, l, d);
  })(t, e, i, o, n.elem, r) : (function(s, a, c, u, l, d) {
    s !== void 0 || a || pI(c, u, l, d);
  })(t, e, i, o, n.elem, r);
}
function pI(t, e, n, r) {
  const i = r[r.length - 1] ?? t, o = `No bindings found for service: "${nr(i)}".

Trying to resolve bindings for "${jO(t, e)}".${$O(r)}${QO(n)}`;
  throw new Dn(fn.planning, o);
}
function jO(t, e) {
  return e === void 0 ? `${nr(t)} (Root service)` : nr(e);
}
function QO(t) {
  const e = t.tags.size === 0 ? "" : `
- tags:
  - ${[...t.tags.keys()].map((n) => n.toString()).join(`
  - `)}`;
  return `

Binding constraints:
- service identifier: ${nr(t.serviceIdentifier)}
- name: ${t.name?.toString() ?? "-"}${e}`;
}
function $O(t) {
  return t.length === 0 ? "" : `

- service redirections:
  - ${t.map((e) => nr(e)).join(`
  - `)}`;
}
function GO(t, e, n, r) {
  if (t.redirections.length === 1) {
    const [i] = t.redirections;
    return void (Va(i) && GO(i, e, n, [...r, i.binding.targetServiceIdentifier]));
  }
  LO(t.redirections, e, n, r);
}
function Z_(t, e, n) {
  if (Array.isArray(t.bindings) && t.bindings.length === 1) {
    const [r] = t.bindings;
    return void (Va(r) && GO(r, e, n, [r.binding.targetServiceIdentifier]));
  }
  LO(t.bindings, e, n, []);
}
function Mg(t) {
  return wm.is(t) ? t.unwrap() : t;
}
function qO(t) {
  return (e, n, r) => {
    const i = Mg(r.value), o = n.concat({ getAncestorsCalled: !1, name: r.name, serviceIdentifier: i, tags: r.tags }), s = new da(o.last), a = r.kind === as.multipleInjection && r.chained, c = Og(e, s, { chained: a }), u = [], l = { bindings: u, isContextFree: !0, serviceIdentifier: i };
    if (u.push(...t(e, o, c, l, a)), l.isContextFree = !o.last.elem.getAncestorsCalled, r.kind === as.singleInjection) {
      Z_(l, r.optional, o.last);
      const [d] = u;
      l.bindings = d;
    }
    return l;
  };
}
function HO(t) {
  return (e, n, r) => {
    const i = Mg(r.value), o = n.concat({ getAncestorsCalled: !1, name: r.name, serviceIdentifier: i, tags: r.tags }), s = new da(o.last), a = r.kind === cs.multipleInjection && r.chained, c = Og(e, s, { chained: a }), u = [], l = { bindings: u, isContextFree: !0, serviceIdentifier: i };
    if (u.push(...t(e, o, c, l, a)), l.isContextFree = !o.last.elem.getAncestorsCalled, r.kind === cs.singleInjection) {
      Z_(l, r.optional, o.last);
      const [d] = u;
      l.bindings = d;
    }
    return l;
  };
}
function WO(t) {
  const e = /* @__PURE__ */ (function(o) {
    return (s, a, c) => {
      const u = { binding: a, classMetadata: s.operations.getClassMetadata(a.implementationType), constructorParams: [], propertyParams: /* @__PURE__ */ new Map() }, l = { autobindOptions: s.autobindOptions, node: u, operations: s.operations, servicesBranch: s.servicesBranch };
      return o(l, c);
    };
  })(t), n = /* @__PURE__ */ (function(o) {
    return (s, a, c) => {
      const u = { binding: a, params: [] }, l = { autobindOptions: s.autobindOptions, node: u, operations: s.operations, servicesBranch: s.servicesBranch };
      return o(l, c);
    };
  })(t), r = (o, s, a, c, u) => {
    const l = Va(c) ? c.binding.targetServiceIdentifier : c.serviceIdentifier;
    o.servicesBranch.push(l);
    const d = [];
    for (const f of a) switch (f.type) {
      case At.Instance:
        d.push(e(o, f, s));
        break;
      case At.ResolvedValue:
        d.push(n(o, f, s));
        break;
      case At.ServiceRedirection: {
        const m = i(o, s, f, u);
        d.push(m);
        break;
      }
      default:
        d.push({ binding: f });
    }
    return o.servicesBranch.pop(), d;
  }, i = /* @__PURE__ */ (function(o) {
    return (s, a, c, u) => {
      const l = { binding: c, redirections: [] }, d = Og(s, new da(a.last), { chained: u, customServiceIdentifier: c.targetServiceIdentifier });
      return l.redirections.push(...o(s, a, d, l, u)), l;
    };
  })(r);
  return r;
}
function dI(t, e, n, r) {
  if (t !== void 0 && (ri.is(n) && !n.isExpanded() || n.isContextFree)) {
    const i = { tree: { root: n } };
    e.setPlan(t, i);
  } else e.setNonCachedServiceNode(n, r);
}
class I9 extends ri {
  #e;
  #t;
  #r;
  #n;
  constructor(e, n, r, i, o) {
    super(o, Mg(i.value)), this.#t = n, this.#e = e, this.#r = r, this.#n = i;
  }
  _buildPlanServiceNode() {
    return this.#t(this.#e, this.#r, this.#n);
  }
}
class C9 extends ri {
  #e;
  #t;
  #r;
  #n;
  constructor(e, n, r, i, o) {
    super(o, Mg(i.value)), this.#e = e, this.#t = n, this.#r = r, this.#n = i;
  }
  _buildPlanServiceNode() {
    return this.#t(this.#e, this.#r, this.#n);
  }
}
function zO(t, e, n, r) {
  const i = /* @__PURE__ */ (function(s, a) {
    const c = /* @__PURE__ */ (function(u, l) {
      return (d, f, m) => {
        if (m.kind === as.unmanaged) return;
        const h = (function(g) {
          let v;
          if (g.tags.size === 0) v = void 0;
          else {
            if (g.tags.size !== 1) return;
            {
              const [E, T] = g.tags.entries().next().value;
              v = { key: E, value: T };
            }
          }
          const S = wm.is(g.value) ? g.value.unwrap() : g.value;
          return g.kind === as.multipleInjection ? { chained: g.chained, isMultiple: !0, name: g.name, optional: g.optional, serviceIdentifier: S, tag: v } : { isMultiple: !1, name: g.name, optional: g.optional, serviceIdentifier: S, tag: v };
        })(m);
        if (h !== void 0) {
          const g = d.operations.getPlan(h);
          if (g !== void 0 && g.tree.root.isContextFree) return g.tree.root;
        }
        const y = l(d, f, m), x = new I9(d, u, f, m, y);
        return dI(h, d.operations, x, { bindingConstraintsList: f, chainedBindings: m.kind === as.multipleInjection && m.chained, optionalBindings: m.optional }), x;
      };
    })(s, a);
    return (u, l, d) => {
      const f = l.classMetadata;
      for (const [m, h] of f.constructorArguments.entries()) l.constructorParams[m] = c(u, d, h);
      for (const [m, h] of f.properties) {
        const y = c(u, d, h);
        y !== void 0 && l.propertyParams.set(m, y);
      }
      return u.node;
    };
  })(t, n), o = /* @__PURE__ */ (function(s, a) {
    const c = /* @__PURE__ */ (function(u, l) {
      return (d, f, m) => {
        const h = (function(g) {
          let v;
          if (g.tags.size === 0) v = void 0;
          else {
            if (g.tags.size !== 1) return;
            {
              const [E, T] = g.tags.entries().next().value;
              v = { key: E, value: T };
            }
          }
          const S = wm.is(g.value) ? g.value.unwrap() : g.value;
          return g.kind === cs.multipleInjection ? { chained: g.chained, isMultiple: !0, name: g.name, optional: g.optional, serviceIdentifier: S, tag: v } : { isMultiple: !1, name: g.name, optional: g.optional, serviceIdentifier: S, tag: v };
        })(m);
        if (h !== void 0) {
          const g = d.operations.getPlan(h);
          if (g !== void 0 && g.tree.root.isContextFree) return g.tree.root;
        }
        const y = l(d, f, m), x = new C9(d, u, f, m, y);
        return dI(h, d.operations, x, { bindingConstraintsList: f, chainedBindings: m.kind === cs.multipleInjection && m.chained, optionalBindings: m.optional }), x;
      };
    })(s, a);
    return (u, l, d) => {
      const f = l.binding.metadata;
      for (const [m, h] of f.arguments.entries()) l.params[m] = c(u, d, h);
      return u.node;
    };
  })(e, r);
  return (s, a) => s.node.binding.type === At.Instance ? i(s, s.node, a) : o(s, s.node, a);
}
class T9 extends ri {
  #e;
  constructor(e, n) {
    super(n, n.serviceIdentifier), this.#e = e;
  }
  _buildPlanServiceNode() {
    return YO(this.#e);
  }
}
const Ow = qO(VO), Mw = HO(VO), KO = WO(zO(Ow, Mw, Ow, Mw));
function VO(t, e, n, r, i) {
  return KO(t, e, n, r, i);
}
const YO = /* @__PURE__ */ (function(t) {
  return (e) => {
    const n = Fw(e), r = new da(n.last), i = e.rootConstraints.isMultiple && e.rootConstraints.chained, o = Og(e, r, { chained: i }), s = [], a = { bindings: s, isContextFree: !0, serviceIdentifier: e.rootConstraints.serviceIdentifier };
    if (s.push(...t(e, n, o, a, i)), a.isContextFree = !n.last.elem.getAncestorsCalled, !e.rootConstraints.isMultiple) {
      Z_(a, e.rootConstraints.isOptional ?? !1, n.last);
      const [c] = s;
      a.bindings = c;
    }
    return a;
  };
})(KO);
function k9(t) {
  try {
    const e = (function(o) {
      return o.rootConstraints.isMultiple ? { chained: o.rootConstraints.chained, isMultiple: !0, name: o.rootConstraints.name, optional: o.rootConstraints.isOptional ?? !1, serviceIdentifier: o.rootConstraints.serviceIdentifier, tag: o.rootConstraints.tag } : { isMultiple: !1, name: o.rootConstraints.name, optional: o.rootConstraints.isOptional ?? !1, serviceIdentifier: o.rootConstraints.serviceIdentifier, tag: o.rootConstraints.tag };
    })(t), n = t.operations.getPlan(e);
    if (n !== void 0) return n;
    const r = YO(t), i = { tree: { root: new T9(t, r) } };
    return t.operations.setPlan(e, i), i;
  } catch (e) {
    A9(t, e);
  }
}
var Gi;
(function(t) {
  t.bindingAdded = "bindingAdded", t.bindingRemoved = "bindingRemoved";
})(Gi || (Gi = {}));
class N9 {
  #e;
  #t;
  #r;
  constructor() {
    this.#e = [], this.#t = 8, this.#r = 1024;
  }
  *[Symbol.iterator]() {
    let e = 0;
    for (const n of this.#e) {
      const r = n.deref();
      r === void 0 ? ++e : yield r;
    }
    this.#e.length >= this.#t && this.#i(e) && this.#n(e);
  }
  push(e) {
    const n = new WeakRef(e);
    if (this.#e.push(n), this.#e.length >= this.#t && this.#e.length % this.#r === 0) {
      let r = 0;
      for (const i of this.#e) i.deref() === void 0 && ++r;
      this.#i(r) && this.#n(r);
    }
  }
  #n(e) {
    const n = new Array(this.#e.length - e);
    let r = 0;
    for (const i of this.#e) i.deref() && (n[r++] = i);
    this.#e = n;
  }
  #i(e) {
    return e >= 0.5 * this.#e.length;
  }
}
const eE = WO(zO(Ow, Mw, function(t, e, n) {
  return P9(t, e, n);
}, function(t, e, n) {
  return D9(t, e, n);
})), P9 = (function(t) {
  const e = qO(t);
  return (n, r, i) => {
    try {
      return e(n, r, i);
    } catch (o) {
      if (Dn.isErrorOfKind(o, fn.planning)) return;
      throw o;
    }
  };
})(eE), D9 = (function(t) {
  const e = HO(t);
  return (n, r, i) => {
    try {
      return e(n, r, i);
    } catch (o) {
      if (Dn.isErrorOfKind(o, fn.planning)) return;
      throw o;
    }
  };
})(eE);
function fI(t, e, n, r, i) {
  if (ri.is(e) && !e.isExpanded()) return { isContextFreeBinding: !0, shouldInvalidateServiceNode: !1 };
  const o = new da(r.last);
  return !n.isSatisfiedBy(o) || r.last.elem.getAncestorsCalled ? { isContextFreeBinding: !r.last.elem.getAncestorsCalled, shouldInvalidateServiceNode: !1 } : (function(s, a, c, u, l) {
    let d;
    try {
      [d] = eE(s, u, [c], a, l);
    } catch (f) {
      if (J_(f)) return { isContextFreeBinding: !1, shouldInvalidateServiceNode: !0 };
      throw f;
    }
    return (function(f, m) {
      if (Array.isArray(f.bindings)) f.bindings.push(m);
      else {
        if (f.bindings !== void 0) {
          if (!ri.is(f)) throw new Dn(fn.planning, "Unexpected non-lazy plan service node. This is likely a bug in the planning logic. Please, report this issue");
          return { isContextFreeBinding: !0, shouldInvalidateServiceNode: !0 };
        }
        f.bindings = m;
      }
      return { isContextFreeBinding: !0, shouldInvalidateServiceNode: !1 };
    })(a, d);
  })(t, e, n, r, i);
}
function hI(t, e, n, r) {
  if (ri.is(t) && !t.isExpanded()) return { bindingNodeRemoved: void 0, isContextFreeBinding: !0 };
  const i = new da(n.last);
  if (!e.isSatisfiedBy(i) || n.last.elem.getAncestorsCalled) return { bindingNodeRemoved: void 0, isContextFreeBinding: !n.last.elem.getAncestorsCalled };
  let o;
  if (Array.isArray(t.bindings)) t.bindings = t.bindings.filter((s) => s.binding !== e || (o = s, !1));
  else if (t.bindings?.binding === e) if (o = t.bindings, r) t.bindings = void 0;
  else {
    if (!ri.is(t)) throw new Dn(fn.planning, "Unexpected non-lazy plan service node. This is likely a bug in the planning logic. Please, report this issue");
    t.invalidate();
  }
  return { bindingNodeRemoved: o, isContextFreeBinding: !0 };
}
class mI {
  #e;
  #t;
  #r;
  #n;
  #i;
  #o;
  constructor() {
    this.#e = /* @__PURE__ */ new Map(), this.#t = this.#s(), this.#r = this.#s(), this.#n = this.#s(), this.#i = this.#s(), this.#o = new N9();
  }
  clearCache() {
    for (const e of this.#p()) e.clear();
    for (const e of this.#o) e.clearCache();
  }
  get(e) {
    return e.name === void 0 ? e.tag === void 0 ? this.#a(this.#t, e).get(e.serviceIdentifier) : this.#a(this.#i, e).get(e.serviceIdentifier)?.get(e.tag.key)?.get(e.tag.value) : e.tag === void 0 ? this.#a(this.#r, e).get(e.serviceIdentifier)?.get(e.name) : this.#a(this.#n, e).get(e.serviceIdentifier)?.get(e.name)?.get(e.tag.key)?.get(e.tag.value);
  }
  invalidateServiceBinding(e) {
    this.#b(e), this.#f(e), this.#h(e), this.#x(e), this.#v(e);
    for (const n of this.#o) n.invalidateServiceBinding(e);
  }
  set(e, n) {
    e.name === void 0 ? e.tag === void 0 ? this.#a(this.#t, e).set(e.serviceIdentifier, n) : this.#c(this.#c(this.#a(this.#i, e), e.serviceIdentifier), e.tag.key).set(e.tag.value, n) : e.tag === void 0 ? this.#c(this.#a(this.#r, e), e.serviceIdentifier).set(e.name, n) : this.#c(this.#c(this.#c(this.#a(this.#n, e), e.serviceIdentifier), e.name), e.tag.key).set(e.tag.value, n);
  }
  setNonCachedServiceNode(e, n) {
    let r = this.#e.get(e.serviceIdentifier);
    r === void 0 && (r = /* @__PURE__ */ new Map(), this.#e.set(e.serviceIdentifier, r)), r.set(e, n);
  }
  subscribe(e) {
    this.#o.push(e);
  }
  #s() {
    const e = new Array(8);
    for (let n = 0; n < e.length; ++n) e[n] = /* @__PURE__ */ new Map();
    return e;
  }
  #u(e, n, r, i) {
    const o = !!(2 & n);
    let s;
    return o ? s = { chained: !!(0 & n), isMultiple: o, serviceIdentifier: e.binding.serviceIdentifier } : s = { isMultiple: o, serviceIdentifier: e.binding.serviceIdentifier }, 1 & n && (s.isOptional = !0), r !== void 0 && (s.name = r), i !== void 0 && (s.tag = i), { autobindOptions: void 0, operations: e.operations, rootConstraints: s, servicesBranch: [] };
  }
  #c(e, n) {
    let r = e.get(n);
    return r === void 0 && (r = /* @__PURE__ */ new Map(), e.set(n, r)), r;
  }
  #a(e, n) {
    return e[this.#l(n)];
  }
  #p() {
    return [this.#e, ...this.#t, ...this.#r, ...this.#n, ...this.#i];
  }
  #l(e) {
    return e.isMultiple ? (e.chained ? 4 : 0) | (e.optional ? 1 : 0) | 2 : e.optional ? 1 : 0;
  }
  #f(e) {
    for (const [n, r] of this.#r.entries()) {
      const i = r.get(e.binding.serviceIdentifier);
      if (i !== void 0) for (const [o, s] of i.entries()) this.#m(e, s, n, o, void 0);
    }
  }
  #h(e) {
    for (const [n, r] of this.#n.entries()) {
      const i = r.get(e.binding.serviceIdentifier);
      if (i !== void 0) for (const [o, s] of i.entries()) for (const [a, c] of s.entries()) for (const [u, l] of c.entries()) this.#m(e, l, n, o, { key: a, value: u });
    }
  }
  #d(e) {
    switch (e.binding.type) {
      case At.ServiceRedirection:
        for (const n of e.redirections) this.#d(n);
        break;
      case At.Instance:
        for (const n of e.constructorParams) n !== void 0 && this.#g(n);
        for (const n of e.propertyParams.values()) this.#g(n);
        break;
      case At.ResolvedValue:
        for (const n of e.params) this.#g(n);
    }
  }
  #g(e) {
    const n = this.#e.get(e.serviceIdentifier);
    n !== void 0 && n.has(e) && (n.delete(e), this.#y(e));
  }
  #y(e) {
    if ((!ri.is(e) || e.isExpanded()) && e.bindings !== void 0) if (Array.isArray(e.bindings)) for (const n of e.bindings) this.#d(n);
    else this.#d(e.bindings);
  }
  #v(e) {
    const n = this.#e.get(e.binding.serviceIdentifier);
    if (n !== void 0) switch (e.kind) {
      case Gi.bindingAdded:
        for (const [r, i] of n) {
          const o = fI({ autobindOptions: void 0, operations: e.operations, servicesBranch: [] }, r, e.binding, i.bindingConstraintsList, i.chainedBindings);
          o.isContextFreeBinding ? o.shouldInvalidateServiceNode && ri.is(r) && (this.#y(r), r.invalidate()) : this.clearCache();
        }
        break;
      case Gi.bindingRemoved:
        for (const [r, i] of n) {
          const o = hI(r, e.binding, i.bindingConstraintsList, i.optionalBindings);
          o.isContextFreeBinding ? o.bindingNodeRemoved !== void 0 && this.#d(o.bindingNodeRemoved) : this.clearCache();
        }
    }
  }
  #b(e) {
    for (const [n, r] of this.#t.entries()) {
      const i = r.get(e.binding.serviceIdentifier);
      this.#m(e, i, n, void 0, void 0);
    }
  }
  #x(e) {
    for (const [n, r] of this.#i.entries()) {
      const i = r.get(e.binding.serviceIdentifier);
      if (i !== void 0) for (const [o, s] of i.entries()) for (const [a, c] of s.entries()) this.#m(e, c, n, void 0, { key: o, value: a });
    }
  }
  #m(e, n, r, i, o) {
    if (n !== void 0 && ri.is(n.tree.root)) {
      const u = this.#u(e, r, i, o);
      switch (e.kind) {
        case Gi.bindingAdded:
          {
            const l = (s = u, a = n.tree.root, c = e.binding, ri.is(a) && !a.isExpanded() ? { isContextFreeBinding: !0, shouldInvalidateServiceNode: !1 } : fI(s, a, c, Fw(s), s.rootConstraints.isMultiple && s.rootConstraints.chained));
            l.isContextFreeBinding ? l.shouldInvalidateServiceNode && (this.#y(n.tree.root), n.tree.root.invalidate()) : this.clearCache();
          }
          break;
        case Gi.bindingRemoved: {
          const l = (function(d, f, m) {
            return ri.is(f) && !f.isExpanded() ? { bindingNodeRemoved: void 0, isContextFreeBinding: !0 } : hI(f, m, Fw(d), d.rootConstraints.isOptional ?? !1);
          })(u, n.tree.root, e.binding);
          l.isContextFreeBinding ? l.bindingNodeRemoved !== void 0 && this.#d(l.bindingNodeRemoved) : this.clearCache();
        }
      }
    }
    var s, a, c;
  }
}
function F9(t, e) {
  if (J_(e)) {
    const n = (function(r) {
      const i = [...r];
      return i.length === 0 ? "(No dependency trace)" : i.map(nr).join(" -> ");
    })((function(r) {
      const i = r.planResult.tree.root, o = [];
      function s(a) {
        const c = o.indexOf(a);
        if (c !== -1)
          return [...o.slice(c), a].map((u) => u.serviceIdentifier);
        o.push(a);
        try {
          for (const u of (function(l) {
            const d = [], f = l.bindings;
            if (f === void 0) return d;
            const m = (h) => {
              if (Va(h)) for (const y of h.redirections) m(y);
              else switch (h.binding.type) {
                case At.Instance: {
                  const y = h;
                  for (const x of y.constructorParams) x !== void 0 && d.push(x);
                  for (const x of y.propertyParams.values()) d.push(x);
                  break;
                }
                case At.ResolvedValue: {
                  const y = h;
                  for (const x of y.params) d.push(x);
                  break;
                }
              }
            };
            if (Array.isArray(f)) for (const h of f) m(h);
            else m(f);
            return d;
          })(a)) {
            const l = s(u);
            if (l !== void 0) return l;
          }
        } finally {
          o.pop();
        }
      }
      return s(i) ?? [];
    })(t));
    throw new Dn(fn.planning, `Circular dependency found: ${n}`, { cause: e });
  }
  throw e;
}
function JO(t, e) {
  return wn(e) ? (t.cache = { isRight: !0, value: e }, e.then((n) => gI(t, n))) : gI(t, e);
}
function gI(t, e) {
  return t.cache = { isRight: !0, value: e }, e;
}
function O9(t, e, n) {
  const r = t.getActivations(e);
  return r === void 0 ? n : wn(n) ? yI(t, n, r[Symbol.iterator]()) : (function(i, o, s) {
    let a = o, c = s.next();
    for (; c.done !== !0; ) {
      const u = c.value(i.context, a);
      if (wn(u)) return yI(i, u, s);
      a = u, c = s.next();
    }
    return a;
  })(t, n, r[Symbol.iterator]());
}
async function yI(t, e, n) {
  let r = await e, i = n.next();
  for (; i.done !== !0; ) r = await i.value(t.context, r), i = n.next();
  return r;
}
function Kh(t, e, n) {
  let r = n;
  if (e.onActivation !== void 0) {
    const i = e.onActivation;
    r = wn(r) ? r.then((o) => i(t.context, o)) : i(t.context, r);
  }
  return O9(t, e.serviceIdentifier, r);
}
function tE(t) {
  return (e, n) => n.cache.isRight ? n.cache.value : JO(n, Kh(e, n, t(e, n)));
}
const M9 = tE(function(t, e) {
  return e.value;
});
function R9(t) {
  return t;
}
function nE(t, e) {
  return (n, r) => {
    const i = t(r);
    switch (i.scope) {
      case Ai.Singleton:
        return i.cache.isRight ? i.cache.value : JO(i, Kh(n, i, e(n, r)));
      case Ai.Request: {
        if (n.requestScopeCache.has(i.id)) return n.requestScopeCache.get(i.id);
        const o = Kh(n, i, e(n, r));
        return n.requestScopeCache.set(i.id, o), o;
      }
      case Ai.Transient:
        return Kh(n, i, e(n, r));
    }
  };
}
const B9 = ((t) => nE(R9, t))(function(t, e) {
  return e.value(t.context);
}), U9 = tE(function(t, e) {
  return e.factory(t.context);
});
function vI(t, e, n) {
  const r = (function(i, o, s) {
    if (!(s in i)) throw new Dn(fn.resolution, `Expecting a "${s.toString()}" property when resolving "${o.implementationType.name}" class @postConstruct decorated method, none found.`);
    if (typeof i[s] != "function") throw new Dn(fn.resolution, `Expecting a "${s.toString()}" method when resolving "${o.implementationType.name}" class @postConstruct decorated method, a non function property was found instead.`);
    {
      let a;
      try {
        a = i[s]();
      } catch (c) {
        throw new Dn(fn.resolution, `Unexpected error found when calling "${s.toString()}" @postConstruct decorated method on class "${o.implementationType.name}"`, { cause: c });
      }
      if (wn(a)) return (async function(c, u, l) {
        try {
          await l;
        } catch (d) {
          throw new Dn(fn.resolution, `Unexpected error found when calling "${u.toString()}" @postConstruct decorated method on class "${c.implementationType.name}"`, { cause: d });
        }
      })(o, s, a);
    }
  })(t, e, n);
  return wn(r) ? r.then(() => t) : t;
}
function bI(t, e, n) {
  if (n.size === 0) return t;
  let r = t;
  for (const i of n) r = wn(r) ? r.then((o) => vI(o, e, i)) : vI(r, e, i);
  return r;
}
function xI(t) {
  return (e, n, r) => {
    const i = new r.binding.implementationType(...e), o = t(n, i, r);
    return wn(o) ? o.then(() => bI(i, r.binding, r.classMetadata.lifecycle.postConstructMethodNames)) : bI(i, r.binding, r.classMetadata.lifecycle.postConstructMethodNames);
  };
}
const L9 = tE(function(t, e) {
  return e.provider(t.context);
});
function j9(t) {
  return t.binding;
}
function Q9(t) {
  return t.binding;
}
const wI = /* @__PURE__ */ (function(t) {
  return (e, n, r) => {
    const i = [];
    for (const [o, s] of r.propertyParams) {
      const a = r.classMetadata.properties.get(o);
      if (a === void 0) throw new Dn(fn.resolution, `Expecting metadata at property "${o.toString()}", none found`);
      a.kind !== as.unmanaged && s.bindings !== void 0 && (n[o] = t(e, s), wn(n[o]) && i.push((async () => {
        n[o] = await n[o];
      })()));
    }
    if (i.length > 0) return Promise.all(i).then(() => {
    });
  };
})(Rg), SI = /* @__PURE__ */ (function(t) {
  return function e(n, r) {
    const i = [];
    for (const o of r.redirections) Va(o) ? i.push(...e(n, o)) : i.push(t(n, o));
    return i;
  };
})(Rw), $9 = /* @__PURE__ */ (function(t, e, n) {
  return (r, i) => {
    const o = t(r, i);
    return wn(o) ? e(o, r, i) : n(o, r, i);
  };
})(/* @__PURE__ */ (function(t) {
  return (e, n) => {
    const r = [];
    for (const i of n.constructorParams) i === void 0 ? r.push(void 0) : r.push(t(e, i));
    return r.some(wn) ? Promise.all(r) : r;
  };
})(Rg), /* @__PURE__ */ (function(t) {
  return async (e, n, r) => {
    const i = await e;
    return t(i, n, r);
  };
})(xI(wI)), xI(wI)), G9 = /* @__PURE__ */ (function(t) {
  return (e, n) => {
    const r = t(e, n);
    return wn(r) ? r.then((i) => n.binding.factory(...i)) : n.binding.factory(...r);
  };
})(/* @__PURE__ */ (function(t) {
  return (e, n) => {
    const r = [];
    for (const i of n.params) r.push(t(e, i));
    return r.some(wn) ? Promise.all(r) : r;
  };
})(Rg)), q9 = ((t) => nE(j9, t))($9), H9 = ((t) => nE(Q9, t))(G9);
function W9(t) {
  try {
    return Rg(t, t.planResult.tree.root);
  } catch (e) {
    F9(t, e);
  }
}
function Rw(t, e) {
  switch (e.binding.type) {
    case At.ConstantValue:
      return M9(t, e.binding);
    case At.DynamicValue:
      return B9(t, e.binding);
    case At.Factory:
      return U9(t, e.binding);
    case At.Instance:
      return q9(t, e);
    case At.Provider:
      return L9(t, e.binding);
    case At.ResolvedValue:
      return H9(t, e);
  }
}
function Rg(t, e) {
  if (e.bindings !== void 0) return Array.isArray(e.bindings) ? (function(n, r) {
    const i = [];
    for (const o of r) Va(o) ? i.push(...SI(n, o)) : i.push(Rw(n, o));
    return i.some(wn) ? Promise.all(i) : i;
  })(t, e.bindings) : (function(n, r) {
    if (Va(r)) {
      const i = SI(n, r);
      if (i.length === 1) return i[0];
      throw new Dn(fn.resolution, "Unexpected multiple resolved values on single injection");
    }
    return Rw(n, r);
  })(t, e.bindings);
}
function z9(t) {
  return t.scope !== void 0;
}
function _I(t, e) {
  if (typeof t[e] == "function")
    return t[e]();
}
function EI(t, e) {
  const n = t.lifecycle.preDestroyMethodNames;
  if (n.size === 0) return;
  let r;
  for (const i of n) r = r === void 0 ? _I(e, i) : r.then(() => _I(e, i));
  return r;
}
function AI(t, e, n) {
  const r = t.getDeactivations(e);
  if (r !== void 0) return wn(n) ? II(n, r[Symbol.iterator]()) : (function(i, o) {
    let s = o.next();
    for (; s.done !== !0; ) {
      const a = s.value(i);
      if (wn(a)) return II(i, o);
      s = o.next();
    }
  })(n, r[Symbol.iterator]());
}
async function II(t, e) {
  const n = await t;
  let r = e.next();
  for (; r.done !== !0; ) await r.value(n), r = e.next();
}
function K9(t, e) {
  const n = (function(r, i) {
    if (i.type === At.Instance) {
      const o = r.getClassMetadata(i.implementationType), s = i.cache.value;
      return wn(s) ? s.then((a) => EI(o, a)) : EI(o, s);
    }
  })(t, e);
  return n === void 0 ? CI(t, e) : n.then(() => CI(t, e));
}
function CI(t, e) {
  const n = e.cache;
  return wn(n.value) ? n.value.then((r) => TI(t, e, r)) : TI(t, e, n.value);
}
function TI(t, e, n) {
  let r;
  return e.onDeactivation !== void 0 && (r = (0, e.onDeactivation)(n)), r === void 0 ? AI(t, e.serviceIdentifier, n) : r.then(() => AI(t, e.serviceIdentifier, n));
}
function _m(t, e) {
  if (e === void 0) return;
  const n = (function(i) {
    const o = [];
    for (const s of i) z9(s) && s.scope === Ai.Singleton && s.cache.isRight && o.push(s);
    return o;
  })(e), r = [];
  for (const i of n) {
    const o = K9(t, i);
    o !== void 0 && r.push(o);
  }
  return r.length > 0 ? Promise.all(r).then(() => {
  }) : void 0;
}
function V9(t, e) {
  const n = t.getBindingsFromModule(e);
  return _m(t, n);
}
function Y9(t, e) {
  const n = t.getBindings(e);
  return _m(t, n);
}
const J9 = Symbol.for("@inversifyjs/plugin/isPlugin"), XO = Symbol.for("@inversifyjs/container/bindingIdentifier");
function kI(t) {
  return typeof t == "object" && t !== null && t[XO] === !0;
}
class Ca {
  static always = (e) => !0;
}
const My = Symbol.for("@inversifyjs/container/InversifyContainerError");
class Vi extends Error {
  [My];
  kind;
  constructor(e, n, r) {
    super(n, r), this[My] = !0, this.kind = e;
  }
  static is(e) {
    return typeof e == "object" && e !== null && e[My] === !0;
  }
  static isErrorOfKind(e, n) {
    return Vi.is(e) && e.kind === n;
  }
}
var Yi;
function rE(t) {
  return { [XO]: !0, id: t.id };
}
function Hl(t) {
  return (e) => {
    for (let n = e.getAncestor(); n !== void 0; n = n.getAncestor()) if (t(n)) return !0;
    return !1;
  };
}
function Cl(t) {
  return (e) => e.name === t;
}
function Tf(t) {
  return (e) => e.serviceIdentifier === t;
}
function Tl(t, e) {
  return (n) => n.tags.has(t) && n.tags.get(t) === e;
}
function X9(t) {
  return t.name === void 0 && t.tags.size === 0;
}
function kf(t) {
  const e = Hl(t);
  return (n) => !e(n);
}
function Nf(t) {
  return (e) => {
    const n = e.getAncestor();
    return n === void 0 || !t(n);
  };
}
function Pf(t) {
  return (e) => {
    const n = e.getAncestor();
    return n !== void 0 && t(n);
  };
}
(function(t) {
  t[t.invalidOperation = 0] = "invalidOperation";
})(Yi || (Yi = {}));
class Z9 {
  #e;
  constructor(e) {
    this.#e = e;
  }
  getIdentifier() {
    return rE(this.#e);
  }
  inRequestScope() {
    return this.#e.scope = Ai.Request, new $a(this.#e);
  }
  inSingletonScope() {
    return this.#e.scope = Ai.Singleton, new $a(this.#e);
  }
  inTransientScope() {
    return this.#e.scope = Ai.Transient, new $a(this.#e);
  }
}
let ZO = class {
  #e;
  #t;
  #r;
  #n;
  constructor(e, n, r, i) {
    this.#e = e, this.#t = n, this.#r = r, this.#n = i;
  }
  to(e) {
    const n = Fg(e), r = { cache: { isRight: !1, value: void 0 }, id: Bs(), implementationType: e, isSatisfiedBy: Ca.always, moduleId: this.#t, onActivation: void 0, onDeactivation: void 0, scope: n.scope ?? this.#r, serviceIdentifier: this.#n, type: At.Instance };
    return this.#e(r), new Ry(r);
  }
  toSelf() {
    if (typeof this.#n != "function") throw new Error('"toSelf" function can only be applied when a newable function is used as service identifier');
    return this.to(this.#n);
  }
  toConstantValue(e) {
    const n = { cache: { isRight: !1, value: void 0 }, id: Bs(), isSatisfiedBy: Ca.always, moduleId: this.#t, onActivation: void 0, onDeactivation: void 0, scope: Ai.Singleton, serviceIdentifier: this.#n, type: At.ConstantValue, value: e };
    return this.#e(n), new $a(n);
  }
  toDynamicValue(e) {
    const n = { cache: { isRight: !1, value: void 0 }, id: Bs(), isSatisfiedBy: Ca.always, moduleId: this.#t, onActivation: void 0, onDeactivation: void 0, scope: this.#r, serviceIdentifier: this.#n, type: At.DynamicValue, value: e };
    return this.#e(n), new Ry(n);
  }
  toResolvedValue(e, n) {
    const r = { cache: { isRight: !1, value: void 0 }, factory: e, id: Bs(), isSatisfiedBy: Ca.always, metadata: this.#i(n), moduleId: this.#t, onActivation: void 0, onDeactivation: void 0, scope: this.#r, serviceIdentifier: this.#n, type: At.ResolvedValue };
    return this.#e(r), new Ry(r);
  }
  toFactory(e) {
    const n = { cache: { isRight: !1, value: void 0 }, factory: e, id: Bs(), isSatisfiedBy: Ca.always, moduleId: this.#t, onActivation: void 0, onDeactivation: void 0, scope: Ai.Singleton, serviceIdentifier: this.#n, type: At.Factory };
    return this.#e(n), new $a(n);
  }
  toProvider(e) {
    const n = { cache: { isRight: !1, value: void 0 }, id: Bs(), isSatisfiedBy: Ca.always, moduleId: this.#t, onActivation: void 0, onDeactivation: void 0, provider: e, scope: Ai.Singleton, serviceIdentifier: this.#n, type: At.Provider };
    return this.#e(n), new $a(n);
  }
  toService(e) {
    const n = { id: Bs(), isSatisfiedBy: Ca.always, moduleId: this.#t, serviceIdentifier: this.#n, targetServiceIdentifier: e, type: At.ServiceRedirection };
    this.#e(n);
  }
  #i(e) {
    return { arguments: (e ?? []).map((n) => (function(r) {
      return typeof r == "object" && !wm.is(r);
    })(n) ? (function(r) {
      return r.isMultiple === !0;
    })(n) ? { chained: n.chained ?? !1, kind: cs.multipleInjection, name: n.name, optional: n.optional ?? !1, tags: new Map((n.tags ?? []).map((r) => [r.key, r.value])), value: n.serviceIdentifier } : { kind: cs.singleInjection, name: n.name, optional: n.optional ?? !1, tags: new Map((n.tags ?? []).map((r) => [r.key, r.value])), value: n.serviceIdentifier } : { kind: cs.singleInjection, name: void 0, optional: !1, tags: /* @__PURE__ */ new Map(), value: n }) };
  }
};
class e6 {
  #e;
  constructor(e) {
    this.#e = e;
  }
  getIdentifier() {
    return rE(this.#e);
  }
  onActivation(e) {
    return this.#e.onActivation = e, new Bw(this.#e);
  }
  onDeactivation(e) {
    if (this.#e.onDeactivation = e, this.#e.scope !== Ai.Singleton) throw new Vi(Yi.invalidOperation, `Binding for service "${nr(this.#e.serviceIdentifier)}" has a deactivation function, but its scope is not singleton. Deactivation functions can only be used with singleton bindings.`);
    return new Bw(this.#e);
  }
}
class Bw {
  #e;
  constructor(e) {
    this.#e = e;
  }
  getIdentifier() {
    return rE(this.#e);
  }
  when(e) {
    return this.#e.isSatisfiedBy = e, new e6(this.#e);
  }
  whenAnyAncestor(e) {
    return this.when(Hl(e));
  }
  whenAnyAncestorIs(e) {
    return this.when(Hl(Tf(e)));
  }
  whenAnyAncestorNamed(e) {
    return this.when((function(n) {
      return Hl(Cl(n));
    })(e));
  }
  whenAnyAncestorTagged(e, n) {
    return this.when((function(r, i) {
      return Hl(Tl(r, i));
    })(e, n));
  }
  whenDefault() {
    return this.when(X9);
  }
  whenNamed(e) {
    return this.when(Cl(e));
  }
  whenNoParent(e) {
    return this.when(Nf(e));
  }
  whenNoParentIs(e) {
    return this.when(Nf(Tf(e)));
  }
  whenNoParentNamed(e) {
    return this.when((function(n) {
      return Nf(Cl(n));
    })(e));
  }
  whenNoParentTagged(e, n) {
    return this.when((function(r, i) {
      return Nf(Tl(r, i));
    })(e, n));
  }
  whenParent(e) {
    return this.when(Pf(e));
  }
  whenParentIs(e) {
    return this.when(Pf(Tf(e)));
  }
  whenParentNamed(e) {
    return this.when((function(n) {
      return Pf(Cl(n));
    })(e));
  }
  whenParentTagged(e, n) {
    return this.when((function(r, i) {
      return Pf(Tl(r, i));
    })(e, n));
  }
  whenTagged(e, n) {
    return this.when(Tl(e, n));
  }
  whenNoAncestor(e) {
    return this.when(kf(e));
  }
  whenNoAncestorIs(e) {
    return this.when(kf(Tf(e)));
  }
  whenNoAncestorNamed(e) {
    return this.when((function(n) {
      return kf(Cl(n));
    })(e));
  }
  whenNoAncestorTagged(e, n) {
    return this.when((function(r, i) {
      return kf(Tl(r, i));
    })(e, n));
  }
}
class $a extends Bw {
  #e;
  constructor(e) {
    super(e), this.#e = new e6(e);
  }
  onActivation(e) {
    return this.#e.onActivation(e);
  }
  onDeactivation(e) {
    return this.#e.onDeactivation(e);
  }
}
class Ry extends $a {
  #e;
  constructor(e) {
    super(e), this.#e = new Z9(e);
  }
  inRequestScope() {
    return this.#e.inRequestScope();
  }
  inSingletonScope() {
    return this.#e.inSingletonScope();
  }
  inTransientScope() {
    return this.#e.inTransientScope();
  }
}
class ej {
  #e;
  #t;
  #r;
  #n;
  constructor(e, n, r, i) {
    this.#e = e, this.#t = n, this.#r = r, this.#n = i;
  }
  bind(e) {
    return new ZO((n) => {
      this.#i(n);
    }, void 0, this.#t, e);
  }
  isBound(e, n) {
    const r = this.#n.bindingService.get(e);
    return this.#l(e, r, n);
  }
  isCurrentBound(e, n) {
    const r = this.#n.bindingService.getNonParentBindings(e);
    return this.#l(e, r, n);
  }
  async rebind(e) {
    return await this.unbind(e), this.bind(e);
  }
  rebindSync(e) {
    return this.unbindSync(e), this.bind(e);
  }
  async unbind(e) {
    await this.#s(e);
  }
  async unbindAll() {
    const e = [...this.#n.bindingService.getNonParentBoundServices()];
    await Promise.all(e.map(async (n) => Y9(this.#e, n)));
    for (const n of e) this.#n.activationService.removeAllByServiceId(n), this.#n.bindingService.removeAllByServiceId(n), this.#n.deactivationService.removeAllByServiceId(n);
    this.#n.planResultCacheService.clearCache();
  }
  unbindSync(e) {
    this.#s(e) !== void 0 && this.#o(e);
  }
  #i(e) {
    this.#n.bindingService.set(e), this.#r.invalidateService({ binding: e, kind: Gi.bindingAdded });
  }
  #o(e) {
    let n;
    if (kI(e)) {
      const i = this.#n.bindingService.getById(e.id), o = (r = i, (function(s) {
        if (s === void 0) return;
        const a = s.next();
        return a.done !== !0 ? a.value : void 0;
      })(r?.[Symbol.iterator]()))?.serviceIdentifier;
      n = o === void 0 ? "Unexpected asynchronous deactivation when unbinding binding identifier. Consider using Container.unbind() instead." : `Unexpected asynchronous deactivation when unbinding "${nr(o)}" binding. Consider using Container.unbind() instead.`;
    } else n = `Unexpected asynchronous deactivation when unbinding "${nr(e)}" service. Consider using Container.unbind() instead.`;
    var r;
    throw new Vi(Yi.invalidOperation, n);
  }
  #s(e) {
    return kI(e) ? this.#u(e) : this.#a(e);
  }
  #u(e) {
    const n = this.#n.bindingService.getById(e.id), r = n === void 0 ? void 0 : [...n], i = _m(this.#e, n);
    if (i !== void 0) return i.then(() => {
      this.#c(r, e);
    });
    this.#c(r, e);
  }
  #c(e, n) {
    if (this.#n.bindingService.removeById(n.id), e !== void 0) for (const r of e) this.#r.invalidateService({ binding: r, kind: Gi.bindingRemoved });
  }
  #a(e) {
    const n = this.#n.bindingService.get(e), r = n === void 0 ? void 0 : [...n], i = _m(this.#e, n);
    if (i !== void 0) return i.then(() => {
      this.#p(e, r);
    });
    this.#p(e, r);
  }
  #p(e, n) {
    if (this.#n.activationService.removeAllByServiceId(e), this.#n.bindingService.removeAllByServiceId(e), this.#n.deactivationService.removeAllByServiceId(e), n !== void 0) for (const r of n) this.#r.invalidateService({ binding: r, kind: Gi.bindingRemoved });
  }
  #l(e, n, r) {
    if (n === void 0) return !1;
    const i = { getAncestor: () => {
    }, name: r?.name, serviceIdentifier: e, tags: /* @__PURE__ */ new Map() };
    r?.tag !== void 0 && i.tags.set(r.tag.key, r.tag.value);
    for (const o of n) if (o.isSatisfiedBy(i)) return !0;
    return !1;
  }
}
class tj {
  #e;
  #t;
  #r;
  #n;
  #i;
  constructor(e, n, r, i, o) {
    this.#e = e, this.#t = n, this.#r = r, this.#n = i, this.#i = o;
  }
  async load(...e) {
    await Promise.all(this.#u(...e));
  }
  loadSync(...e) {
    const n = this.#u(...e);
    for (const r of n) if (r !== void 0) throw new Vi(Yi.invalidOperation, "Unexpected asynchronous module load. Consider using Container.load() instead.");
  }
  async unload(...e) {
    await Promise.all(this.#a(...e)), this.#s(e);
  }
  unloadSync(...e) {
    const n = this.#a(...e);
    for (const r of n) if (r !== void 0) throw new Vi(Yi.invalidOperation, "Unexpected asynchronous module unload. Consider using Container.unload() instead.");
    this.#s(e);
  }
  #o(e) {
    return { bind: (n) => new ZO((r) => {
      this.#c(r);
    }, e, this.#r, n), isBound: this.#e.isBound.bind(this.#e), onActivation: (n, r) => {
      this.#i.activationService.add(r, { moduleId: e, serviceId: n });
    }, onDeactivation: (n, r) => {
      this.#i.deactivationService.add(r, { moduleId: e, serviceId: n });
    }, rebind: this.#e.rebind.bind(this.#e), rebindSync: this.#e.rebindSync.bind(this.#e), unbind: this.#e.unbind.bind(this.#e), unbindSync: this.#e.unbindSync.bind(this.#e) };
  }
  #s(e) {
    for (const n of e) this.#i.activationService.removeAllByModuleId(n.id), this.#i.bindingService.removeAllByModuleId(n.id), this.#i.deactivationService.removeAllByModuleId(n.id);
    this.#i.planResultCacheService.clearCache();
  }
  #u(...e) {
    return e.map((n) => n.load(this.#o(n.id)));
  }
  #c(e) {
    this.#i.bindingService.set(e), this.#n.invalidateService({ binding: e, kind: Gi.bindingAdded });
  }
  #a(...e) {
    return e.map((n) => V9(this.#t, n.id));
  }
}
class nj {
  deactivationParams;
  constructor(e) {
    this.deactivationParams = (function(n) {
      return { getBindings: n.bindingService.get.bind(n.bindingService), getBindingsFromModule: n.bindingService.getByModuleId.bind(n.bindingService), getClassMetadata: Fg, getDeactivations: n.deactivationService.get.bind(n.deactivationService) };
    })(e), e.onReset(() => {
      (function(n, r) {
        r.getBindings = n.bindingService.get.bind(n.bindingService), r.getBindingsFromModule = n.bindingService.getByModuleId.bind(n.bindingService), r.getDeactivations = n.deactivationService.get.bind(n.deactivationService);
      })(e, this.deactivationParams);
    });
  }
}
let rj = class {
  planParamsOperations;
  #e;
  constructor(e) {
    this.#e = e, this.planParamsOperations = { getBindings: this.#e.bindingService.get.bind(this.#e.bindingService), getBindingsChained: this.#e.bindingService.getChained.bind(this.#e.bindingService), getClassMetadata: Fg, getPlan: this.#e.planResultCacheService.get.bind(this.#e.planResultCacheService), setBinding: this.#r.bind(this), setNonCachedServiceNode: this.#e.planResultCacheService.setNonCachedServiceNode.bind(this.#e.planResultCacheService), setPlan: this.#e.planResultCacheService.set.bind(this.#e.planResultCacheService) }, this.#e.onReset(() => {
      this.#t();
    });
  }
  #t() {
    this.planParamsOperations.getBindings = this.#e.bindingService.get.bind(this.#e.bindingService), this.planParamsOperations.getBindingsChained = this.#e.bindingService.getChained.bind(this.#e.bindingService), this.planParamsOperations.setBinding = this.#r.bind(this);
  }
  #r(e) {
    this.#e.bindingService.set(e), this.#e.planResultCacheService.invalidateServiceBinding({ binding: e, kind: Gi.bindingAdded, operations: this.planParamsOperations });
  }
};
class ij {
  #e;
  #t;
  constructor(e, n) {
    this.#e = e, this.#t = n;
  }
  invalidateService(e) {
    this.#t.planResultCacheService.invalidateServiceBinding({ ...e, operations: this.#e.planParamsOperations });
  }
}
class oj {
  #e;
  #t;
  #r;
  #n;
  constructor(e, n, r) {
    this.#n = n, this.#r = r, this.#e = this.#i(e), this.#t = this.#o();
  }
  register(e, n) {
    const r = new n(e, this.#t);
    if (r[J9] !== !0) throw new Vi(Yi.invalidOperation, "Invalid plugin. The plugin must extend the Plugin class");
    r.load(this.#e);
  }
  #i(e) {
    return { define: (n, r) => {
      if (Object.prototype.hasOwnProperty.call(e, n)) throw new Vi(Yi.invalidOperation, `Container already has a method named "${String(n)}"`);
      e[n] = r;
    }, onPlan: this.#r.onPlan.bind(this.#r) };
  }
  #o() {
    const e = this.#n;
    return { get activationService() {
      return e.activationService;
    }, get bindingService() {
      return e.bindingService;
    }, get deactivationService() {
      return e.deactivationService;
    }, get planResultCacheService() {
      return e.planResultCacheService;
    } };
  }
}
let NI = class {
  activationService;
  bindingService;
  deactivationService;
  planResultCacheService;
  #e;
  constructor(e, n, r, i) {
    this.activationService = e, this.bindingService = n, this.deactivationService = r, this.planResultCacheService = i, this.#e = [];
  }
  reset(e, n, r) {
    this.activationService = e, this.bindingService = n, this.deactivationService = r, this.planResultCacheService.clearCache();
    for (const i of this.#e) i();
  }
  onReset(e) {
    this.#e.push(e);
  }
};
class sj {
  #e;
  #t;
  #r;
  #n;
  #i;
  #o;
  #s;
  constructor(e, n, r, i) {
    this.#o = e, this.#s = n, this.#n = this.#f(), this.#e = r, this.#t = i, this.#r = (o) => this.#s.activationService.get(o), this.#i = [], this.#s.onReset(() => {
      this.#u();
    });
  }
  get(e, n) {
    const r = this.#l(!1, e, n), i = this.#h(r);
    if (wn(i)) throw new Vi(Yi.invalidOperation, `Unexpected asynchronous service when resolving service "${nr(e)}"`);
    return i;
  }
  getAll(e, n) {
    const r = this.#l(!0, e, n), i = this.#h(r);
    if (wn(i)) throw new Vi(Yi.invalidOperation, `Unexpected asynchronous service when resolving service "${nr(e)}"`);
    return i;
  }
  async getAllAsync(e, n) {
    const r = this.#l(!0, e, n);
    return this.#h(r);
  }
  async getAsync(e, n) {
    const r = this.#l(!1, e, n);
    return this.#h(r);
  }
  onPlan(e) {
    this.#i.push(e);
  }
  #u() {
    this.#n = this.#f();
  }
  #c(e, n, r) {
    const i = r?.name, o = r?.optional ?? !1, s = r?.tag;
    return e ? { chained: r?.chained ?? !1, isMultiple: e, name: i, optional: o, serviceIdentifier: n, tag: s } : { isMultiple: e, name: i, optional: o, serviceIdentifier: n, tag: s };
  }
  #a(e, n, r) {
    const i = { autobindOptions: r?.autobind ?? this.#e ? { scope: this.#t } : void 0, operations: this.#o.planParamsOperations, rootConstraints: this.#p(e, n, r), servicesBranch: [] };
    return this.#d(i, r), i;
  }
  #p(e, n, r) {
    return n ? { chained: r?.chained ?? !1, isMultiple: n, serviceIdentifier: e } : { isMultiple: n, serviceIdentifier: e };
  }
  #l(e, n, r) {
    const i = this.#c(e, n, r), o = this.#s.planResultCacheService.get(i);
    if (o !== void 0) return o;
    const s = k9(this.#a(n, e, r));
    for (const a of this.#i) a(i, s);
    return s;
  }
  #f() {
    return { get: this.get.bind(this), getAll: this.getAll.bind(this), getAllAsync: this.getAllAsync.bind(this), getAsync: this.getAsync.bind(this) };
  }
  #h(e) {
    return W9({ context: this.#n, getActivations: this.#r, planResult: e, requestScopeCache: /* @__PURE__ */ new Map() });
  }
  #d(e, n) {
    n !== void 0 && (n.name !== void 0 && (e.rootConstraints.name = n.name), n.optional === !0 && (e.rootConstraints.isOptional = !0), n.tag !== void 0 && (e.rootConstraints.tag = { key: n.tag.key, value: n.tag.value }), e.rootConstraints.isMultiple && (e.rootConstraints.chained = n?.chained ?? !1));
  }
}
let aj = class {
  #e;
  #t;
  constructor(e) {
    this.#e = e, this.#t = [];
  }
  restore() {
    const e = this.#t.pop();
    if (e === void 0) throw new Vi(Yi.invalidOperation, "No snapshot available to restore");
    this.#e.reset(e.activationService, e.bindingService, e.deactivationService);
  }
  snapshot() {
    this.#t.push({ activationService: this.#e.activationService.clone(), bindingService: this.#e.bindingService.clone(), deactivationService: this.#e.deactivationService.clone() });
  }
};
const cj = Ai.Transient;
class uj {
  #e;
  #t;
  #r;
  #n;
  #i;
  #o;
  constructor(e) {
    const n = e?.autobind ?? !1, r = e?.defaultScope ?? cj;
    this.#n = this.#u(e, n, r);
    const i = new rj(this.#n), o = new ij(i, this.#n), s = new nj(this.#n);
    this.#e = new ej(s.deactivationParams, r, o, this.#n), this.#t = new tj(this.#e, s.deactivationParams, r, o, this.#n), this.#i = new sj(i, this.#n, n, r), this.#r = new oj(this, this.#n, this.#i), this.#o = new aj(this.#n);
  }
  bind(e) {
    return this.#e.bind(e);
  }
  get(e, n) {
    return this.#i.get(e, n);
  }
  getAll(e, n) {
    return this.#i.getAll(e, n);
  }
  async getAllAsync(e, n) {
    return this.#i.getAllAsync(e, n);
  }
  async getAsync(e, n) {
    return this.#i.getAsync(e, n);
  }
  isBound(e, n) {
    return this.#e.isBound(e, n);
  }
  isCurrentBound(e, n) {
    return this.#e.isCurrentBound(e, n);
  }
  async load(...e) {
    return this.#t.load(...e);
  }
  loadSync(...e) {
    this.#t.loadSync(...e);
  }
  onActivation(e, n) {
    this.#n.activationService.add(n, { serviceId: e });
  }
  onDeactivation(e, n) {
    this.#n.deactivationService.add(n, { serviceId: e });
  }
  register(e) {
    this.#r.register(this, e);
  }
  restore() {
    this.#o.restore();
  }
  async rebind(e) {
    return this.#e.rebind(e);
  }
  rebindSync(e) {
    return this.#e.rebindSync(e);
  }
  snapshot() {
    this.#o.snapshot();
  }
  async unbind(e) {
    await this.#e.unbind(e);
  }
  async unbindAll() {
    return this.#e.unbindAll();
  }
  unbindSync(e) {
    this.#e.unbindSync(e);
  }
  async unload(...e) {
    return this.#t.unload(...e);
  }
  unloadSync(...e) {
    this.#t.unloadSync(...e);
  }
  #s(e, n) {
    if (e) return { scope: n };
  }
  #u(e, n, r) {
    const i = this.#s(n, r);
    if (e?.parent === void 0) return new NI(Hp.build(() => {
    }), aI.build(() => {
    }, i), cI.build(() => {
    }), new mI());
    const o = new mI(), s = e.parent;
    return s.#n.planResultCacheService.subscribe(o), new NI(Hp.build(() => s.#n.activationService), aI.build(() => s.#n.bindingService, i), cI.build(() => s.#n.deactivationService), o);
  }
}
var Wl = /* @__PURE__ */ ((t) => (t[t.GENDER_UNKOWN = 0] = "GENDER_UNKOWN", t[t.GENDER_MALE = 1] = "GENDER_MALE", t[t.GENDER_FEMALE = 2] = "GENDER_FEMALE", t[t.GENDER_PRIVACY = 255] = "GENDER_PRIVACY", t))(Wl || {}), zl = /* @__PURE__ */ ((t) => (t[t.KNOMAL = 0] = "KNOMAL", t[t.KLETTER = 1] = "KLETTER", t))(zl || {}), Kl = /* @__PURE__ */ ((t) => (t[t.KDB = 0] = "KDB", t[t.KSERVER = 1] = "KSERVER", t))(Kl || {}), t6 = /* @__PURE__ */ ((t) => (t[t.KALL = 0] = "KALL", t[t.KBASEEXTEND = 1] = "KBASEEXTEND", t[t.KVAS = 2] = "KVAS", t[t.KQZONE = 3] = "KQZONE", t[t.KOTHER = 4] = "KOTHER", t))(t6 || {}), n6 = /* @__PURE__ */ ((t) => (t[t.KUNSPECIFIED = 0] = "KUNSPECIFIED", t[t.KBIGDATACARD = 1] = "KBIGDATACARD", t[t.KDATACARD = 2] = "KDATACARD", t[t.KNOTICE = 3] = "KNOTICE", t[t.KAIO = 4] = "KAIO", t[t.KRECENTCONTACT = 5] = "KRECENTCONTACT", t[t.KMOREPANEL = 6] = "KMOREPANEL", t))(n6 || {}), iu = /* @__PURE__ */ ((t) => (t[t.KUNSPECIFIED = 0] = "KUNSPECIFIED", t[t.KSTRANGER = 1] = "KSTRANGER", t[t.KMEMBER = 2] = "KMEMBER", t[t.KADMIN = 3] = "KADMIN", t[t.KOWNER = 4] = "KOWNER", t))(iu || {}), _e = /* @__PURE__ */ ((t) => (t[t.UNKNOWN = 0] = "UNKNOWN", t[t.TEXT = 1] = "TEXT", t[t.PIC = 2] = "PIC", t[t.FILE = 3] = "FILE", t[t.PTT = 4] = "PTT", t[t.VIDEO = 5] = "VIDEO", t[t.FACE = 6] = "FACE", t[t.REPLY = 7] = "REPLY", t[t.GreyTip = 8] = "GreyTip", t[t.WALLET = 9] = "WALLET", t[t.ARK = 10] = "ARK", t[t.MFACE = 11] = "MFACE", t[t.LIVEGIFT = 12] = "LIVEGIFT", t[t.STRUCTLONGMSG = 13] = "STRUCTLONGMSG", t[t.MARKDOWN = 14] = "MARKDOWN", t[t.GIPHY = 15] = "GIPHY", t[t.MULTIFORWARD = 16] = "MULTIFORWARD", t[t.INLINEKEYBOARD = 17] = "INLINEKEYBOARD", t[t.INTEXTGIFT = 18] = "INTEXTGIFT", t[t.CALENDAR = 19] = "CALENDAR", t[t.YOLOGAMERESULT = 20] = "YOLOGAMERESULT", t[t.AVRECORD = 21] = "AVRECORD", t[t.FEED = 22] = "FEED", t[t.TOFURECORD = 23] = "TOFURECORD", t[t.ACEBUBBLE = 24] = "ACEBUBBLE", t[t.ACTIVITY = 25] = "ACTIVITY", t[t.TOFU = 26] = "TOFU", t[t.FACEBUBBLE = 27] = "FACEBUBBLE", t[t.SHARELOCATION = 28] = "SHARELOCATION", t[t.TASKTOPMSG = 29] = "TASKTOPMSG", t[t.ONLINEFOLDER = 30] = "ONLINEFOLDER", t[t.RECOMMENDEDMSG = 43] = "RECOMMENDEDMSG", t[t.ACTIONBAR = 44] = "ACTIONBAR", t))(_e || {}), Gs = /* @__PURE__ */ ((t) => (t[t.KMSGTYPEARKSTRUCT = 11] = "KMSGTYPEARKSTRUCT", t[t.KMSGTYPEFACEBUBBLE = 24] = "KMSGTYPEFACEBUBBLE", t[t.KMSGTYPEFILE = 3] = "KMSGTYPEFILE", t[t.KMSGTYPEGIFT = 14] = "KMSGTYPEGIFT", t[t.KMSGTYPEGIPHY = 13] = "KMSGTYPEGIPHY", t[t.KMSGTYPEGRAYTIPS = 5] = "KMSGTYPEGRAYTIPS", t[t.KMSGTYPEMIX = 2] = "KMSGTYPEMIX", t[t.KMSGTYPEMULTIMSGFORWARD = 8] = "KMSGTYPEMULTIMSGFORWARD", t[t.KMSGTYPENULL = 1] = "KMSGTYPENULL", t[t.KMSGTYPEONLINEFILE = 21] = "KMSGTYPEONLINEFILE", t[t.KMSGTYPEONLINEFOLDER = 27] = "KMSGTYPEONLINEFOLDER", t[t.KMSGTYPEPROLOGUE = 29] = "KMSGTYPEPROLOGUE", t[t.KMSGTYPEPTT = 6] = "KMSGTYPEPTT", t[t.KMSGTYPEREPLY = 9] = "KMSGTYPEREPLY", t[t.KMSGTYPESHARELOCATION = 25] = "KMSGTYPESHARELOCATION", t[t.KMSGTYPESTRUCT = 4] = "KMSGTYPESTRUCT", t[t.KMSGTYPESTRUCTLONGMSG = 12] = "KMSGTYPESTRUCTLONGMSG", t[t.KMSGTYPETEXTGIFT = 15] = "KMSGTYPETEXTGIFT", t[t.KMSGTYPEUNKNOWN = 0] = "KMSGTYPEUNKNOWN", t[t.KMSGTYPEVIDEO = 7] = "KMSGTYPEVIDEO", t[t.KMSGTYPEWALLET = 10] = "KMSGTYPEWALLET", t))(Gs || {}), Wp = /* @__PURE__ */ ((t) => (t[t.NEWPIC_APNG = 2001] = "NEWPIC_APNG", t[t.NEWPIC_BMP = 1005] = "NEWPIC_BMP", t[t.NEWPIC_GIF = 2e3] = "NEWPIC_GIF", t[t.NEWPIC_JPEG = 1e3] = "NEWPIC_JPEG", t[t.NEWPIC_PNG = 1001] = "NEWPIC_PNG", t[t.NEWPIC_PROGERSSIV_JPEG = 1003] = "NEWPIC_PROGERSSIV_JPEG", t[t.NEWPIC_SHARPP = 1004] = "NEWPIC_SHARPP", t[t.NEWPIC_WEBP = 1002] = "NEWPIC_WEBP", t))(Wp || {}), Mr = /* @__PURE__ */ ((t) => (t[t.ATTYPEALL = 1] = "ATTYPEALL", t[t.ATTYPECATEGORY = 512] = "ATTYPECATEGORY", t[t.ATTYPECHANNEL = 16] = "ATTYPECHANNEL", t[t.ATTYPEME = 4] = "ATTYPEME", t[t.ATTYPEONE = 2] = "ATTYPEONE", t[t.ATTYPEONLINE = 64] = "ATTYPEONLINE", t[t.ATTYPEROLE = 8] = "ATTYPEROLE", t[t.ATTYPESUMMON = 32] = "ATTYPESUMMON", t[t.ATTYPESUMMONONLINE = 128] = "ATTYPESUMMONONLINE", t[t.ATTYPESUMMONROLE = 256] = "ATTYPESUMMONROLE", t[t.ATTYPEUNKNOWN = 0] = "ATTYPEUNKNOWN", t))(Mr || {}), iE = /* @__PURE__ */ ((t) => (t[t.K_DOWN_SOURCETYPE_AIOINNER = 1] = "K_DOWN_SOURCETYPE_AIOINNER", t[t.K_DOWN_SOURCETYPE_BIGSCREEN = 2] = "K_DOWN_SOURCETYPE_BIGSCREEN", t[t.K_DOWN_SOURCETYPE_HISTORY = 3] = "K_DOWN_SOURCETYPE_HISTORY", t[t.K_DOWN_SOURCETYPE_UNKNOWN = 0] = "K_DOWN_SOURCETYPE_UNKNOWN", t))(iE || {}), Ne = /* @__PURE__ */ ((t) => (t[t.KCHATTYPEADELIE = 42] = "KCHATTYPEADELIE", t[t.KCHATTYPEBUDDYNOTIFY = 5] = "KCHATTYPEBUDDYNOTIFY", t[t.KCHATTYPEC2C = 1] = "KCHATTYPEC2C", t[t.KCHATTYPECIRCLE = 113] = "KCHATTYPECIRCLE", t[t.KCHATTYPEDATALINE = 8] = "KCHATTYPEDATALINE", t[t.KCHATTYPEDATALINEMQQ = 134] = "KCHATTYPEDATALINEMQQ", t[t.KCHATTYPEDISC = 3] = "KCHATTYPEDISC", t[t.KCHATTYPEFAV = 41] = "KCHATTYPEFAV", t[t.KCHATTYPEGAMEMESSAGE = 105] = "KCHATTYPEGAMEMESSAGE", t[t.KCHATTYPEGAMEMESSAGEFOLDER = 116] = "KCHATTYPEGAMEMESSAGEFOLDER", t[t.KCHATTYPEGROUP = 2] = "KCHATTYPEGROUP", t[t.KCHATTYPEGROUPBLESS = 133] = "KCHATTYPEGROUPBLESS", t[t.KCHATTYPEGROUPGUILD = 9] = "KCHATTYPEGROUPGUILD", t[t.KCHATTYPEGROUPHELPER = 7] = "KCHATTYPEGROUPHELPER", t[t.KCHATTYPEGROUPNOTIFY = 6] = "KCHATTYPEGROUPNOTIFY", t[t.KCHATTYPEGUILD = 4] = "KCHATTYPEGUILD", t[t.KCHATTYPEGUILDMETA = 16] = "KCHATTYPEGUILDMETA", t[t.KCHATTYPEMATCHFRIEND = 104] = "KCHATTYPEMATCHFRIEND", t[t.KCHATTYPEMATCHFRIENDFOLDER = 109] = "KCHATTYPEMATCHFRIENDFOLDER", t[t.KCHATTYPENEARBY = 106] = "KCHATTYPENEARBY", t[t.KCHATTYPENEARBYASSISTANT = 107] = "KCHATTYPENEARBYASSISTANT", t[t.KCHATTYPENEARBYFOLDER = 110] = "KCHATTYPENEARBYFOLDER", t[t.KCHATTYPENEARBYHELLOFOLDER = 112] = "KCHATTYPENEARBYHELLOFOLDER", t[t.KCHATTYPENEARBYINTERACT = 108] = "KCHATTYPENEARBYINTERACT", t[t.KCHATTYPEQQNOTIFY = 132] = "KCHATTYPEQQNOTIFY", t[t.KCHATTYPERELATEACCOUNT = 131] = "KCHATTYPERELATEACCOUNT", t[t.KCHATTYPESERVICEASSISTANT = 118] = "KCHATTYPESERVICEASSISTANT", t[t.KCHATTYPESERVICEASSISTANTSUB = 201] = "KCHATTYPESERVICEASSISTANTSUB", t[t.KCHATTYPESQUAREPUBLIC = 115] = "KCHATTYPESQUAREPUBLIC", t[t.KCHATTYPESUBSCRIBEFOLDER = 30] = "KCHATTYPESUBSCRIBEFOLDER", t[t.KCHATTYPETEMPADDRESSBOOK = 111] = "KCHATTYPETEMPADDRESSBOOK", t[t.KCHATTYPETEMPBUSSINESSCRM = 102] = "KCHATTYPETEMPBUSSINESSCRM", t[t.KCHATTYPETEMPC2CFROMGROUP = 100] = "KCHATTYPETEMPC2CFROMGROUP", t[t.KCHATTYPETEMPC2CFROMUNKNOWN = 99] = "KCHATTYPETEMPC2CFROMUNKNOWN", t[t.KCHATTYPETEMPFRIENDVERIFY = 101] = "KCHATTYPETEMPFRIENDVERIFY", t[t.KCHATTYPETEMPNEARBYPRO = 119] = "KCHATTYPETEMPNEARBYPRO", t[t.KCHATTYPETEMPPUBLICACCOUNT = 103] = "KCHATTYPETEMPPUBLICACCOUNT", t[t.KCHATTYPETEMPWPA = 117] = "KCHATTYPETEMPWPA", t[t.KCHATTYPEUNKNOWN = 0] = "KCHATTYPEUNKNOWN", t[t.KCHATTYPEWEIYUN = 40] = "KCHATTYPEWEIYUN", t))(Ne || {}), Pp = /* @__PURE__ */ ((t) => (t[t.GRAYTIP_ELEMENT_SUBTYPE_AIOOP = 15] = "GRAYTIP_ELEMENT_SUBTYPE_AIOOP", t[t.GRAYTIP_ELEMENT_SUBTYPE_BLOCK = 14] = "GRAYTIP_ELEMENT_SUBTYPE_BLOCK", t[t.GRAYTIP_ELEMENT_SUBTYPE_BUDDY = 5] = "GRAYTIP_ELEMENT_SUBTYPE_BUDDY", t[t.GRAYTIP_ELEMENT_SUBTYPE_BUDDYNOTIFY = 9] = "GRAYTIP_ELEMENT_SUBTYPE_BUDDYNOTIFY", t[t.GRAYTIP_ELEMENT_SUBTYPE_EMOJIREPLY = 3] = "GRAYTIP_ELEMENT_SUBTYPE_EMOJIREPLY", t[t.GRAYTIP_ELEMENT_SUBTYPE_ESSENCE = 7] = "GRAYTIP_ELEMENT_SUBTYPE_ESSENCE", t[t.GRAYTIP_ELEMENT_SUBTYPE_FEED = 6] = "GRAYTIP_ELEMENT_SUBTYPE_FEED", t[t.GRAYTIP_ELEMENT_SUBTYPE_FEEDCHANNELMSG = 11] = "GRAYTIP_ELEMENT_SUBTYPE_FEEDCHANNELMSG", t[t.GRAYTIP_ELEMENT_SUBTYPE_FILE = 10] = "GRAYTIP_ELEMENT_SUBTYPE_FILE", t[t.GRAYTIP_ELEMENT_SUBTYPE_GROUP = 4] = "GRAYTIP_ELEMENT_SUBTYPE_GROUP", t[t.GRAYTIP_ELEMENT_SUBTYPE_GROUPNOTIFY = 8] = "GRAYTIP_ELEMENT_SUBTYPE_GROUPNOTIFY", t[t.GRAYTIP_ELEMENT_SUBTYPE_JSON = 17] = "GRAYTIP_ELEMENT_SUBTYPE_JSON", t[t.GRAYTIP_ELEMENT_SUBTYPE_LOCALMSG = 13] = "GRAYTIP_ELEMENT_SUBTYPE_LOCALMSG", t[t.GRAYTIP_ELEMENT_SUBTYPE_PROCLAMATION = 2] = "GRAYTIP_ELEMENT_SUBTYPE_PROCLAMATION", t[t.GRAYTIP_ELEMENT_SUBTYPE_REVOKE = 1] = "GRAYTIP_ELEMENT_SUBTYPE_REVOKE", t[t.GRAYTIP_ELEMENT_SUBTYPE_UNKNOWN = 0] = "GRAYTIP_ELEMENT_SUBTYPE_UNKNOWN", t[t.GRAYTIP_ELEMENT_SUBTYPE_WALLET = 16] = "GRAYTIP_ELEMENT_SUBTYPE_WALLET", t[t.GRAYTIP_ELEMENT_SUBTYPE_XMLMSG = 12] = "GRAYTIP_ELEMENT_SUBTYPE_XMLMSG", t))(Pp || {}), Vl = /* @__PURE__ */ ((t) => (t[t.DICE = 358] = "DICE", t[t.RPS = 359] = "RPS", t))(Vl || {}), Vh = /* @__PURE__ */ ((t) => (t[t.KUNKNOWN = 0] = "KUNKNOWN", t[t.KMEMBERADD = 1] = "KMEMBERADD", t[t.KDISBANDED = 2] = "KDISBANDED", t[t.KQUITTE = 3] = "KQUITTE", t[t.KCREATED = 4] = "KCREATED", t[t.KGROUPNAMEMODIFIED = 5] = "KGROUPNAMEMODIFIED", t[t.KBLOCK = 6] = "KBLOCK", t[t.KUNBLOCK = 7] = "KUNBLOCK", t[t.KSHUTUP = 8] = "KSHUTUP", t[t.KBERECYCLED = 9] = "KBERECYCLED", t[t.KDISBANDORBERECYCLED = 10] = "KDISBANDORBERECYCLED", t))(Vh || {}), Dp = /* @__PURE__ */ ((t) => (t[t.KSEND_STATUS_FAILED = 0] = "KSEND_STATUS_FAILED", t[t.KSEND_STATUS_SENDING = 1] = "KSEND_STATUS_SENDING", t[t.KSEND_STATUS_SUCCESS = 2] = "KSEND_STATUS_SUCCESS", t[t.KSEND_STATUS_SUCCESS_NOSEQ = 3] = "KSEND_STATUS_SUCCESS_NOSEQ", t))(Dp || {}), qs = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.OldFace = 1] = "OldFace", t[t.Normal = 2] = "Normal", t[t.AniSticke = 3] = "AniSticke", t[t.Lottie = 4] = "Lottie", t[t.Poke = 5] = "Poke", t))(qs || {}), Fa = /* @__PURE__ */ ((t) => (t[t.UN_SPECIFIED = 0] = "UN_SPECIFIED", t[t.INVITED_BY_MEMBER = 1] = "INVITED_BY_MEMBER", t[t.REFUSE_INVITED = 2] = "REFUSE_INVITED", t[t.REFUSED_BY_ADMINI_STRATOR = 3] = "REFUSED_BY_ADMINI_STRATOR", t[t.AGREED_TOJOIN_DIRECT = 4] = "AGREED_TOJOIN_DIRECT", t[t.INVITED_NEED_ADMINI_STRATOR_PASS = 5] = "INVITED_NEED_ADMINI_STRATOR_PASS", t[t.AGREED_TO_JOIN_BY_ADMINI_STRATOR = 6] = "AGREED_TO_JOIN_BY_ADMINI_STRATOR", t[t.REQUEST_JOIN_NEED_ADMINI_STRATOR_PASS = 7] = "REQUEST_JOIN_NEED_ADMINI_STRATOR_PASS", t[t.SET_ADMIN = 8] = "SET_ADMIN", t[t.KICK_MEMBER_NOTIFY_ADMIN = 9] = "KICK_MEMBER_NOTIFY_ADMIN", t[t.KICK_MEMBER_NOTIFY_KICKED = 10] = "KICK_MEMBER_NOTIFY_KICKED", t[t.MEMBER_LEAVE_NOTIFY_ADMIN = 11] = "MEMBER_LEAVE_NOTIFY_ADMIN", t[t.CANCEL_ADMIN_NOTIFY_CANCELED = 12] = "CANCEL_ADMIN_NOTIFY_CANCELED", t[t.CANCEL_ADMIN_NOTIFY_ADMIN = 13] = "CANCEL_ADMIN_NOTIFY_ADMIN", t[t.TRANSFER_GROUP_NOTIFY_OLDOWNER = 14] = "TRANSFER_GROUP_NOTIFY_OLDOWNER", t[t.TRANSFER_GROUP_NOTIFY_ADMIN = 15] = "TRANSFER_GROUP_NOTIFY_ADMIN", t))(Fa || {}), Ga = /* @__PURE__ */ ((t) => (t[t.KINIT = 0] = "KINIT", t[t.KUNHANDLE = 1] = "KUNHANDLE", t[t.KAGREED = 2] = "KAGREED", t[t.KREFUSED = 3] = "KREFUSED", t[t.KIGNORED = 4] = "KIGNORED", t))(Ga || {}), zp = /* @__PURE__ */ ((t) => (t[t.KUNSPECIFIED = 0] = "KUNSPECIFIED", t[t.KAGREE = 1] = "KAGREE", t[t.KREFUSE = 2] = "KREFUSE", t[t.KIGNORE = 3] = "KIGNORE", t[t.KDELETE = 4] = "KDELETE", t))(zp || {}), r6 = /* @__PURE__ */ ((t) => (t[t.KMEINITIATOR = 0] = "KMEINITIATOR", t[t.KPEERINITIATOR = 1] = "KPEERINITIATOR", t[t.KMEAGREED = 2] = "KMEAGREED", t[t.KMEAGREEDANDADDED = 3] = "KMEAGREEDANDADDED", t[t.KPEERAGREED = 4] = "KPEERAGREED", t[t.KPEERAGREEDANDADDED = 5] = "KPEERAGREEDANDADDED", t[t.KPEERREFUSED = 6] = "KPEERREFUSED", t[t.KMEREFUSED = 7] = "KMEREFUSED", t[t.KMEIGNORED = 8] = "KMEIGNORED", t[t.KMEAGREEANYONE = 9] = "KMEAGREEANYONE", t[t.KMESETQUESTION = 10] = "KMESETQUESTION", t[t.KMEAGREEANDADDFAILED = 11] = "KMEAGREEANDADDFAILED", t[t.KMSGINFO = 12] = "KMSGINFO", t[t.KMEINITIATORWAITPEERCONFIRM = 13] = "KMEINITIATORWAITPEERCONFIRM", t))(r6 || {}), i6 = /* @__PURE__ */ ((t) => (t[t.DEFAULTTYPE = 0] = "DEFAULTTYPE", t[t.TITLETYPE = 1] = "TITLETYPE", t[t.NEWGROUPTYPE = 2] = "NEWGROUPTYPE", t))(i6 || {}), ti = /* @__PURE__ */ ((t) => (t.ALL = "all", t.TALKATIVE = "talkative", t.PERFORMER = "performer", t.LEGEND = "legend", t.STRONG_NEWBIE = "strong_newbie", t.EMOTION = "emotion", t))(ti || {});
const By = "https://gchat.qpic.cn", lj = "https://multimedia.nt.qq.com.cn";
var o6 = /* @__PURE__ */ ((t) => (t[t.AIO_AV_C2C_NOTICE = 2021] = "AIO_AV_C2C_NOTICE", t[t.AIO_AV_GROUP_NOTICE = 2022] = "AIO_AV_GROUP_NOTICE", t[t.AIO_C2C_DONT_DISTURB = 2100] = "AIO_C2C_DONT_DISTURB", t[t.AIO_CRM_FLAGS_TIPS = 2050] = "AIO_CRM_FLAGS_TIPS", t[t.AIO_GROUP_ESSENCE_MSG_TIP = 2401] = "AIO_GROUP_ESSENCE_MSG_TIP", t[t.AIO_NUDGE_CUSTOM_GUIDE = 2041] = "AIO_NUDGE_CUSTOM_GUIDE", t[t.AIO_PUSH_GUIDE_GRAY_TIPS = 2701] = "AIO_PUSH_GUIDE_GRAY_TIPS", t[t.AIO_RECALL_MSGCUSTOM_WORDINGGUIDE = 2e3] = "AIO_RECALL_MSGCUSTOM_WORDINGGUIDE", t[t.AIO_ROBOT_SAFETY_TIP = 2201] = "AIO_ROBOT_SAFETY_TIP", t[t.AIO_ZPLAN_EMOTICON_GUIDE = 2301] = "AIO_ZPLAN_EMOTICON_GUIDE", t[t.AIO_ZPLAN_SCENE_LINKAGE = 2302] = "AIO_ZPLAN_SCENE_LINKAGE", t[t.AIO_ZPLAN_SEND_MEME = 2300] = "AIO_ZPLAN_SEND_MEME", t[t.DISBAND_DISCUSSION_GRAY_TIP_ID = 2603] = "DISBAND_DISCUSSION_GRAY_TIP_ID", t[t.FILE_SENDING_SIZE_4GB_LIMIT = 3003] = "FILE_SENDING_SIZE_4GB_LIMIT", t[t.GROUP_AIO_CONFIGURABLE_GRAY_TIPS = 2407] = "GROUP_AIO_CONFIGURABLE_GRAY_TIPS", t[t.GROUP_AIO_HOME_SCHOOL_WELCOME_GRAY_TIP_ID = 2404] = "GROUP_AIO_HOME_SCHOOL_WELCOME_GRAY_TIP_ID", t[t.GROUP_AIO_MSG_FREQUENCY_GRAY_TIP_ID = 2406] = "GROUP_AIO_MSG_FREQUENCY_GRAY_TIP_ID", t[t.GROUP_AIO_SHUTUP_GRAY_TIP_ID = 2402] = "GROUP_AIO_SHUTUP_GRAY_TIP_ID", t[t.GROUP_AIO_TEMPORARY_GRAY_TIP_ID = 2405] = "GROUP_AIO_TEMPORARY_GRAY_TIP_ID", t[t.GROUP_AIO_UNREAD_MSG_AI_SUMMARY = 2408] = "GROUP_AIO_UNREAD_MSG_AI_SUMMARY", t[t.GROUP_AIO_UPLOAD_PERMISSIONS_GRAY_TIP_ID = 2403] = "GROUP_AIO_UPLOAD_PERMISSIONS_GRAY_TIP_ID", t[t.LITE_ACTION = 86] = "LITE_ACTION", t[t.ONLINE_FILE_CANCEL_RECV_ON_RECVING = 4] = "ONLINE_FILE_CANCEL_RECV_ON_RECVING", t[t.ONLINE_FILE_GO_OFFLINE = 11] = "ONLINE_FILE_GO_OFFLINE", t[t.ONLINE_FILE_GO_OFFLINE_ALL = 12] = "ONLINE_FILE_GO_OFFLINE_ALL", t[t.ONLINE_FILE_RECV_BY_MOBILE = 13] = "ONLINE_FILE_RECV_BY_MOBILE", t[t.ONLINE_FILE_RECV_ERROR = 10] = "ONLINE_FILE_RECV_ERROR", t[t.ONLINE_FILE_REFUSE_ALL_RECV = 7] = "ONLINE_FILE_REFUSE_ALL_RECV", t[t.ONLINE_FILE_REFUSE_ALL_RECV_ON_RECVING = 8] = "ONLINE_FILE_REFUSE_ALL_RECV_ON_RECVING", t[t.ONLINE_FILE_REFUSE_RECV = 3] = "ONLINE_FILE_REFUSE_RECV", t[t.ONLINE_FILE_SEND_ERROR = 9] = "ONLINE_FILE_SEND_ERROR", t[t.ONLINE_FILE_STOP_ALL_SEND = 5] = "ONLINE_FILE_STOP_ALL_SEND", t[t.ONLINE_FILE_STOP_ALL_SEND_ON_SENDING = 6] = "ONLINE_FILE_STOP_ALL_SEND_ON_SENDING", t[t.ONLINE_FILE_STOP_SEND = 1] = "ONLINE_FILE_STOP_SEND", t[t.ONLINE_FILE_STOP_SEND_ON_SENDING = 2] = "ONLINE_FILE_STOP_SEND_ON_SENDING", t[t.ONLINE_GROUP_HOME_WORK = 51] = "ONLINE_GROUP_HOME_WORK", t[t.PTT_AUTO_CHANGE_GUIDE = 2060] = "PTT_AUTO_CHANGE_GUIDE", t[t.QCIRCLE_SHOW_FULE_TIPS = 2601] = "QCIRCLE_SHOW_FULE_TIPS", t[t.QWALLET_GRAY_TIP_ID = 2602] = "QWALLET_GRAY_TIP_ID", t[t.RED_BAG = 81] = "RED_BAG", t[t.RELATION_C2C_GROUP_AIO_SETUP_GROUP_AND_REMARK = 1005] = "RELATION_C2C_GROUP_AIO_SETUP_GROUP_AND_REMARK", t[t.RELATION_C2C_LOVER_BONUS = 1003] = "RELATION_C2C_LOVER_BONUS", t[t.RELATION_C2C_MEMBER_ADD = 1017] = "RELATION_C2C_MEMBER_ADD", t[t.RELATION_C2C_REACTIVE_DEGRADE_MSG = 1019] = "RELATION_C2C_REACTIVE_DEGRADE_MSG", t[t.RELATION_C2C_REACTIVE_UPGRADE_MSG = 1018] = "RELATION_C2C_REACTIVE_UPGRADE_MSG", t[t.RELATION_C2C_SAY_HELLO = 1004] = "RELATION_C2C_SAY_HELLO", t[t.RELATION_CHAIN_BLACKED = 1e3] = "RELATION_CHAIN_BLACKED", t[t.RELATION_CHAIN_MATCH_FRIEND = 1007] = "RELATION_CHAIN_MATCH_FRIEND", t[t.RELATION_CREATE_GROUP_GRAY_TIP_ID = 1009] = "RELATION_CREATE_GROUP_GRAY_TIP_ID", t[t.RELATION_EMOJIEGG_SHOW = 1001] = "RELATION_EMOJIEGG_SHOW", t[t.RELATION_EMOJIEGG_WILL_DEGRADE = 1002] = "RELATION_EMOJIEGG_WILL_DEGRADE", t[t.RELATION_FRIEND_CLONE_INFO = 1006] = "RELATION_FRIEND_CLONE_INFO", t[t.RELATION_GROUP_BATCH_ADD_FRIEND = 1020] = "RELATION_GROUP_BATCH_ADD_FRIEND", t[t.RELATION_GROUP_MEMBER_ADD = 1022] = "RELATION_GROUP_MEMBER_ADD", t[t.RELATION_GROUP_MEMBER_ADD_WITH_MODIFY_NAME = 1015] = "RELATION_GROUP_MEMBER_ADD_WITH_MODIFY_NAME", t[t.RELATION_GROUP_MEMBER_ADD_WITH_WELCOME = 1016] = "RELATION_GROUP_MEMBER_ADD_WITH_WELCOME", t[t.RELATION_GROUP_MEMBER_RECOMMEND = 1021] = "RELATION_GROUP_MEMBER_RECOMMEND", t[t.RELATION_GROUP_SHUT_UP = 1014] = "RELATION_GROUP_SHUT_UP", t[t.RELATION_LIMIT_TMP_CONVERSATION_SET = 1011] = "RELATION_LIMIT_TMP_CONVERSATION_SET", t[t.RELATION_NEARBY_GOTO_VERIFY = 1008] = "RELATION_NEARBY_GOTO_VERIFY", t[t.RELATION_ONEWAY_FRIEND_GRAY_TIP_ID = 1012] = "RELATION_ONEWAY_FRIEND_GRAY_TIP_ID", t[t.RELATION_ONEWAY_FRIEND_NEW_GRAY_TIP_ID = 1013] = "RELATION_ONEWAY_FRIEND_NEW_GRAY_TIP_ID", t[t.RELATION_YQT = 1010] = "RELATION_YQT", t[t.TROOP_ADD_FRIEND_ACTIVE = 19264] = "TROOP_ADD_FRIEND_ACTIVE", t[t.TROOP_ADD_FRIEND_HOT_CHAT = 19265] = "TROOP_ADD_FRIEND_HOT_CHAT", t[t.TROOP_ADD_FRIEND_NEW_MEMBER = 19267] = "TROOP_ADD_FRIEND_NEW_MEMBER", t[t.TROOP_ADD_FRIEND_REPLY_OR_AT = 19266] = "TROOP_ADD_FRIEND_REPLY_OR_AT", t[t.TROOP_BREAK_ICE = 10405] = "TROOP_BREAK_ICE", t[t.TROOP_FLAME_IGNITED = 19273] = "TROOP_FLAME_IGNITED", t[t.UI_RESERVE_100000_110000 = 1e5] = "UI_RESERVE_100000_110000", t[t.VAS_FILE_UPLOAD_OVER_1G = 3002] = "VAS_FILE_UPLOAD_OVER_1G", t[t.VAS_FILE_UPLOAD_OVER_LIMIT = 3001] = "VAS_FILE_UPLOAD_OVER_LIMIT", t))(o6 || {});
const pj = "End-Of-Stream";
class rr extends Error {
  constructor() {
    super(pj), this.name = "EndOfStreamError";
  }
}
class s6 extends Error {
  constructor(e = "The operation was aborted") {
    super(e), this.name = "AbortError";
  }
}
class dj {
  constructor() {
    this.resolve = () => null, this.reject = () => null, this.promise = new Promise((e, n) => {
      this.reject = n, this.resolve = e;
    });
  }
}
class oE {
  constructor() {
    this.endOfStream = !1, this.interrupted = !1, this.peekQueue = [];
  }
  async peek(e, n = !1) {
    const r = await this.read(e, n);
    return this.peekQueue.push(e.subarray(0, r)), r;
  }
  async read(e, n = !1) {
    if (e.length === 0)
      return 0;
    let r = this.readFromPeekBuffer(e);
    if (this.endOfStream || (r += await this.readRemainderFromStream(e.subarray(r), n)), r === 0 && !n)
      throw new rr();
    return r;
  }
  /**
   * Read chunk from stream
   * @param buffer - Target Uint8Array (or Buffer) to store data read from stream in
   * @returns Number of bytes read
   */
  readFromPeekBuffer(e) {
    let n = e.length, r = 0;
    for (; this.peekQueue.length > 0 && n > 0; ) {
      const i = this.peekQueue.pop();
      if (!i)
        throw new Error("peekData should be defined");
      const o = Math.min(i.length, n);
      e.set(i.subarray(0, o), r), r += o, n -= o, o < i.length && this.peekQueue.push(i.subarray(o));
    }
    return r;
  }
  async readRemainderFromStream(e, n) {
    let r = 0;
    for (; r < e.length && !this.endOfStream; ) {
      if (this.interrupted)
        throw new s6();
      const i = await this.readFromStream(e.subarray(r), n);
      if (i === 0)
        break;
      r += i;
    }
    if (!n && r < e.length)
      throw new rr();
    return r;
  }
}
class fj extends oE {
  constructor(e) {
    if (super(), this.s = e, this.deferred = null, !e.read || !e.once)
      throw new Error("Expected an instance of stream.Readable");
    this.s.once("end", () => {
      this.endOfStream = !0, this.deferred && this.deferred.resolve(0);
    }), this.s.once("error", (n) => this.reject(n)), this.s.once("close", () => this.abort());
  }
  /**
   * Read chunk from stream
   * @param buffer Target Uint8Array (or Buffer) to store data read from stream in
   * @param mayBeLess - If true, may fill the buffer partially
   * @returns Number of bytes read
   */
  async readFromStream(e, n) {
    if (e.length === 0)
      return 0;
    const r = this.s.read(e.length);
    if (r)
      return e.set(r), r.length;
    const i = {
      buffer: e,
      mayBeLess: n,
      deferred: new dj()
    };
    return this.deferred = i.deferred, this.s.once("readable", () => {
      this.readDeferred(i);
    }), i.deferred.promise;
  }
  /**
   * Process deferred read request
   * @param request Deferred read request
   */
  readDeferred(e) {
    const n = this.s.read(e.buffer.length);
    n ? (e.buffer.set(n), e.deferred.resolve(n.length), this.deferred = null) : this.s.once("readable", () => {
      this.readDeferred(e);
    });
  }
  reject(e) {
    this.interrupted = !0, this.deferred && (this.deferred.reject(e), this.deferred = null);
  }
  async abort() {
    this.reject(new s6());
  }
  async close() {
    return this.abort();
  }
}
class hj extends oE {
  constructor(e) {
    super(), this.reader = e;
  }
  async abort() {
    return this.close();
  }
  async close() {
    this.reader.releaseLock();
  }
}
class mj extends hj {
  /**
   * Read from stream
   * @param buffer - Target Uint8Array (or Buffer) to store data read from stream in
   * @param mayBeLess - If true, may fill the buffer partially
   * @protected Bytes read
   */
  async readFromStream(e, n) {
    if (e.length === 0)
      return 0;
    const r = await this.reader.read(new Uint8Array(e.length), { min: n ? void 0 : e.length });
    return r.done && (this.endOfStream = r.done), r.value ? (e.set(r.value), r.value.length) : 0;
  }
}
class PI extends oE {
  constructor(e) {
    super(), this.reader = e, this.buffer = null;
  }
  /**
   * Copy chunk to target, and store the remainder in this.buffer
   */
  writeChunk(e, n) {
    const r = Math.min(n.length, e.length);
    return e.set(n.subarray(0, r)), r < n.length ? this.buffer = n.subarray(r) : this.buffer = null, r;
  }
  /**
   * Read from stream
   * @param buffer - Target Uint8Array (or Buffer) to store data read from stream in
   * @param mayBeLess - If true, may fill the buffer partially
   * @protected Bytes read
   */
  async readFromStream(e, n) {
    if (e.length === 0)
      return 0;
    let r = 0;
    for (this.buffer && (r += this.writeChunk(e, this.buffer)); r < e.length && !this.endOfStream; ) {
      const i = await this.reader.read();
      if (i.done) {
        this.endOfStream = !0;
        break;
      }
      i.value && (r += this.writeChunk(e.subarray(r), i.value));
    }
    if (!n && r === 0 && this.endOfStream)
      throw new rr();
    return r;
  }
  abort() {
    return this.interrupted = !0, this.reader.cancel();
  }
  async close() {
    await this.abort(), this.reader.releaseLock();
  }
}
function gj(t) {
  try {
    const e = t.getReader({ mode: "byob" });
    return e instanceof ReadableStreamDefaultReader ? new PI(e) : new mj(e);
  } catch (e) {
    if (e instanceof TypeError)
      return new PI(t.getReader());
    throw e;
  }
}
class Bg {
  /**
   * Constructor
   * @param options Tokenizer options
   * @protected
   */
  constructor(e) {
    this.numBuffer = new Uint8Array(8), this.position = 0, this.onClose = e?.onClose, e?.abortSignal && e.abortSignal.addEventListener("abort", () => {
      this.abort();
    });
  }
  /**
   * Read a token from the tokenizer-stream
   * @param token - The token to read
   * @param position - If provided, the desired position in the tokenizer-stream
   * @returns Promise with token data
   */
  async readToken(e, n = this.position) {
    const r = new Uint8Array(e.len);
    if (await this.readBuffer(r, { position: n }) < e.len)
      throw new rr();
    return e.get(r, 0);
  }
  /**
   * Peek a token from the tokenizer-stream.
   * @param token - Token to peek from the tokenizer-stream.
   * @param position - Offset where to begin reading within the file. If position is null, data will be read from the current file position.
   * @returns Promise with token data
   */
  async peekToken(e, n = this.position) {
    const r = new Uint8Array(e.len);
    if (await this.peekBuffer(r, { position: n }) < e.len)
      throw new rr();
    return e.get(r, 0);
  }
  /**
   * Read a numeric token from the stream
   * @param token - Numeric token
   * @returns Promise with number
   */
  async readNumber(e) {
    if (await this.readBuffer(this.numBuffer, { length: e.len }) < e.len)
      throw new rr();
    return e.get(this.numBuffer, 0);
  }
  /**
   * Read a numeric token from the stream
   * @param token - Numeric token
   * @returns Promise with number
   */
  async peekNumber(e) {
    if (await this.peekBuffer(this.numBuffer, { length: e.len }) < e.len)
      throw new rr();
    return e.get(this.numBuffer, 0);
  }
  /**
   * Ignore number of bytes, advances the pointer in under tokenizer-stream.
   * @param length - Number of bytes to ignore
   * @return resolves the number of bytes ignored, equals length if this available, otherwise the number of bytes available
   */
  async ignore(e) {
    if (this.fileInfo.size !== void 0) {
      const n = this.fileInfo.size - this.position;
      if (e > n)
        return this.position += n, n;
    }
    return this.position += e, e;
  }
  async close() {
    await this.abort(), await this.onClose?.();
  }
  normalizeOptions(e, n) {
    if (!this.supportsRandomAccess() && n && n.position !== void 0 && n.position < this.position)
      throw new Error("`options.position` must be equal or greater than `tokenizer.position`");
    return {
      mayBeLess: !1,
      offset: 0,
      length: e.length,
      position: this.position,
      ...n
    };
  }
  abort() {
    return Promise.resolve();
  }
}
const yj = 256e3;
class a6 extends Bg {
  /**
   * Constructor
   * @param streamReader stream-reader to read from
   * @param options Tokenizer options
   */
  constructor(e, n) {
    super(n), this.streamReader = e, this.fileInfo = n?.fileInfo ?? {};
  }
  /**
   * Read buffer from tokenizer
   * @param uint8Array - Target Uint8Array to fill with data read from the tokenizer-stream
   * @param options - Read behaviour options
   * @returns Promise with number of bytes read
   */
  async readBuffer(e, n) {
    const r = this.normalizeOptions(e, n), i = r.position - this.position;
    if (i > 0)
      return await this.ignore(i), this.readBuffer(e, n);
    if (i < 0)
      throw new Error("`options.position` must be equal or greater than `tokenizer.position`");
    if (r.length === 0)
      return 0;
    const o = await this.streamReader.read(e.subarray(0, r.length), r.mayBeLess);
    if (this.position += o, (!n || !n.mayBeLess) && o < r.length)
      throw new rr();
    return o;
  }
  /**
   * Peek (read ahead) buffer from tokenizer
   * @param uint8Array - Uint8Array (or Buffer) to write data to
   * @param options - Read behaviour options
   * @returns Promise with number of bytes peeked
   */
  async peekBuffer(e, n) {
    const r = this.normalizeOptions(e, n);
    let i = 0;
    if (r.position) {
      const o = r.position - this.position;
      if (o > 0) {
        const s = new Uint8Array(r.length + o);
        return i = await this.peekBuffer(s, { mayBeLess: r.mayBeLess }), e.set(s.subarray(o)), i - o;
      }
      if (o < 0)
        throw new Error("Cannot peek from a negative offset in a stream");
    }
    if (r.length > 0) {
      try {
        i = await this.streamReader.peek(e.subarray(0, r.length), r.mayBeLess);
      } catch (o) {
        if (n?.mayBeLess && o instanceof rr)
          return 0;
        throw o;
      }
      if (!r.mayBeLess && i < r.length)
        throw new rr();
    }
    return i;
  }
  async ignore(e) {
    const n = Math.min(yj, e), r = new Uint8Array(n);
    let i = 0;
    for (; i < e; ) {
      const o = e - i, s = await this.readBuffer(r, { length: Math.min(n, o) });
      if (s < 0)
        return s;
      i += s;
    }
    return i;
  }
  abort() {
    return this.streamReader.abort();
  }
  async close() {
    return this.streamReader.close();
  }
  supportsRandomAccess() {
    return !1;
  }
}
class vj extends Bg {
  /**
   * Construct BufferTokenizer
   * @param uint8Array - Uint8Array to tokenize
   * @param options Tokenizer options
   */
  constructor(e, n) {
    super(n), this.uint8Array = e, this.fileInfo = { ...n?.fileInfo ?? {}, size: e.length };
  }
  /**
   * Read buffer from tokenizer
   * @param uint8Array - Uint8Array to tokenize
   * @param options - Read behaviour options
   * @returns {Promise<number>}
   */
  async readBuffer(e, n) {
    n?.position && (this.position = n.position);
    const r = await this.peekBuffer(e, n);
    return this.position += r, r;
  }
  /**
   * Peek (read ahead) buffer from tokenizer
   * @param uint8Array
   * @param options - Read behaviour options
   * @returns {Promise<number>}
   */
  async peekBuffer(e, n) {
    const r = this.normalizeOptions(e, n), i = Math.min(this.uint8Array.length - r.position, r.length);
    if (!r.mayBeLess && i < r.length)
      throw new rr();
    return e.set(this.uint8Array.subarray(r.position, r.position + i)), i;
  }
  close() {
    return super.close();
  }
  supportsRandomAccess() {
    return !0;
  }
  setPosition(e) {
    this.position = e;
  }
}
class bj extends Bg {
  /**
   * Construct BufferTokenizer
   * @param blob - Uint8Array to tokenize
   * @param options Tokenizer options
   */
  constructor(e, n) {
    super(n), this.blob = e, this.fileInfo = { ...n?.fileInfo ?? {}, size: e.size, mimeType: e.type };
  }
  /**
   * Read buffer from tokenizer
   * @param uint8Array - Uint8Array to tokenize
   * @param options - Read behaviour options
   * @returns {Promise<number>}
   */
  async readBuffer(e, n) {
    n?.position && (this.position = n.position);
    const r = await this.peekBuffer(e, n);
    return this.position += r, r;
  }
  /**
   * Peek (read ahead) buffer from tokenizer
   * @param buffer
   * @param options - Read behaviour options
   * @returns {Promise<number>}
   */
  async peekBuffer(e, n) {
    const r = this.normalizeOptions(e, n), i = Math.min(this.blob.size - r.position, r.length);
    if (!r.mayBeLess && i < r.length)
      throw new rr();
    const o = await this.blob.slice(r.position, r.position + i).arrayBuffer();
    return e.set(new Uint8Array(o)), i;
  }
  close() {
    return super.close();
  }
  supportsRandomAccess() {
    return !0;
  }
  setPosition(e) {
    this.position = e;
  }
}
function xj(t, e) {
  const n = new fj(t), r = e ?? {}, i = r.onClose;
  return r.onClose = async () => {
    if (await n.close(), i)
      return i();
  }, new a6(n, r);
}
function c6(t, e) {
  const n = gj(t), r = e ?? {}, i = r.onClose;
  return r.onClose = async () => {
    if (await n.close(), i)
      return i();
  }, new a6(n, r);
}
function wj(t, e) {
  return new vj(t, e);
}
function Sj(t, e) {
  return new bj(t, e);
}
class sE extends Bg {
  /**
   * Create tokenizer from provided file path
   * @param sourceFilePath File path
   */
  static async fromFile(e) {
    const n = await uL(e, "r"), r = await n.stat();
    return new sE(n, { fileInfo: { path: e, size: r.size } });
  }
  constructor(e, n) {
    super(n), this.fileHandle = e, this.fileInfo = n.fileInfo;
  }
  /**
   * Read buffer from file
   * @param uint8Array - Uint8Array to write result to
   * @param options - Read behaviour options
   * @returns Promise number of bytes read
   */
  async readBuffer(e, n) {
    const r = this.normalizeOptions(e, n);
    if (this.position = r.position, r.length === 0)
      return 0;
    const i = await this.fileHandle.read(e, 0, r.length, r.position);
    if (this.position += i.bytesRead, i.bytesRead < r.length && (!n || !n.mayBeLess))
      throw new rr();
    return i.bytesRead;
  }
  /**
   * Peek buffer from file
   * @param uint8Array - Uint8Array (or Buffer) to write data to
   * @param options - Read behaviour options
   * @returns Promise number of bytes read
   */
  async peekBuffer(e, n) {
    const r = this.normalizeOptions(e, n), i = await this.fileHandle.read(e, 0, r.length, r.position);
    if (!r.mayBeLess && i.bytesRead < r.length)
      throw new rr();
    return i.bytesRead;
  }
  async close() {
    return await this.fileHandle.close(), super.close();
  }
  setPosition(e) {
    this.position = e;
  }
  supportsRandomAccess() {
    return !0;
  }
}
async function _j(t, e) {
  const n = xj(t, e);
  if (t.path) {
    const r = await cO(t.path);
    n.fileInfo.path = t.path, n.fileInfo.size = r.size;
  }
  return n;
}
const Ej = sE.fromFile;
var Df = {};
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
var DI;
function Aj() {
  return DI || (DI = 1, Df.read = function(t, e, n, r, i) {
    var o, s, a = i * 8 - r - 1, c = (1 << a) - 1, u = c >> 1, l = -7, d = n ? i - 1 : 0, f = n ? -1 : 1, m = t[e + d];
    for (d += f, o = m & (1 << -l) - 1, m >>= -l, l += a; l > 0; o = o * 256 + t[e + d], d += f, l -= 8)
      ;
    for (s = o & (1 << -l) - 1, o >>= -l, l += r; l > 0; s = s * 256 + t[e + d], d += f, l -= 8)
      ;
    if (o === 0)
      o = 1 - u;
    else {
      if (o === c)
        return s ? NaN : (m ? -1 : 1) * (1 / 0);
      s = s + Math.pow(2, r), o = o - u;
    }
    return (m ? -1 : 1) * s * Math.pow(2, o - r);
  }, Df.write = function(t, e, n, r, i, o) {
    var s, a, c, u = o * 8 - i - 1, l = (1 << u) - 1, d = l >> 1, f = i === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, m = r ? 0 : o - 1, h = r ? 1 : -1, y = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
    for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (a = isNaN(e) ? 1 : 0, s = l) : (s = Math.floor(Math.log(e) / Math.LN2), e * (c = Math.pow(2, -s)) < 1 && (s--, c *= 2), s + d >= 1 ? e += f / c : e += f * Math.pow(2, 1 - d), e * c >= 2 && (s++, c /= 2), s + d >= l ? (a = 0, s = l) : s + d >= 1 ? (a = (e * c - 1) * Math.pow(2, i), s = s + d) : (a = e * Math.pow(2, d - 1) * Math.pow(2, i), s = 0)); i >= 8; t[n + m] = a & 255, m += h, a /= 256, i -= 8)
      ;
    for (s = s << i | a, u += i; u > 0; t[n + m] = s & 255, m += h, s /= 256, u -= 8)
      ;
    t[n + m - h] |= y * 128;
  }), Df;
}
Aj();
const Uw = {
  128: "€",
  130: "‚",
  131: "ƒ",
  132: "„",
  133: "…",
  134: "†",
  135: "‡",
  136: "ˆ",
  137: "‰",
  138: "Š",
  139: "‹",
  140: "Œ",
  142: "Ž",
  145: "‘",
  146: "’",
  147: "“",
  148: "”",
  149: "•",
  150: "–",
  151: "—",
  152: "˜",
  153: "™",
  154: "š",
  155: "›",
  156: "œ",
  158: "ž",
  159: "Ÿ"
};
for (const [t, e] of Object.entries(Uw))
  ;
function Ij(t, e = "utf-8") {
  switch (e.toLowerCase()) {
    case "utf-8":
    case "utf8":
      return typeof globalThis.TextDecoder < "u" ? new globalThis.TextDecoder("utf-8").decode(t) : Cj(t);
    case "utf-16le":
      return Tj(t);
    case "ascii":
      return kj(t);
    case "latin1":
    case "iso-8859-1":
      return Nj(t);
    case "windows-1252":
      return Pj(t);
    default:
      throw new RangeError(`Encoding '${e}' not supported`);
  }
}
function Cj(t) {
  let e = "", n = 0;
  for (; n < t.length; ) {
    const r = t[n++];
    if (r < 128)
      e += String.fromCharCode(r);
    else if (r < 224) {
      const i = t[n++] & 63;
      e += String.fromCharCode((r & 31) << 6 | i);
    } else if (r < 240) {
      const i = t[n++] & 63, o = t[n++] & 63;
      e += String.fromCharCode((r & 15) << 12 | i << 6 | o);
    } else {
      const i = t[n++] & 63, o = t[n++] & 63, s = t[n++] & 63;
      let a = (r & 7) << 18 | i << 12 | o << 6 | s;
      a -= 65536, e += String.fromCharCode(55296 + (a >> 10 & 1023), 56320 + (a & 1023));
    }
  }
  return e;
}
function Tj(t) {
  let e = "";
  for (let n = 0; n < t.length; n += 2)
    e += String.fromCharCode(t[n] | t[n + 1] << 8);
  return e;
}
function kj(t) {
  return String.fromCharCode(...t.map((e) => e & 127));
}
function Nj(t) {
  return String.fromCharCode(...t);
}
function Pj(t) {
  let e = "";
  for (const n of t)
    n >= 128 && n <= 159 && Uw[n] ? e += Uw[n] : e += String.fromCharCode(n);
  return e;
}
function $r(t) {
  return new DataView(t.buffer, t.byteOffset);
}
const Dj = {
  len: 1,
  get(t, e) {
    return $r(t).getUint8(e);
  },
  put(t, e, n) {
    return $r(t).setUint8(e, n), e + 1;
  }
}, pn = {
  len: 2,
  get(t, e) {
    return $r(t).getUint16(e, !0);
  },
  put(t, e, n) {
    return $r(t).setUint16(e, n, !0), e + 2;
  }
}, kl = {
  len: 2,
  get(t, e) {
    return $r(t).getUint16(e);
  },
  put(t, e, n) {
    return $r(t).setUint16(e, n), e + 2;
  }
}, Gn = {
  len: 4,
  get(t, e) {
    return $r(t).getUint32(e, !0);
  },
  put(t, e, n) {
    return $r(t).setUint32(e, n, !0), e + 4;
  }
}, Fj = {
  len: 4,
  get(t, e) {
    return $r(t).getUint32(e);
  },
  put(t, e, n) {
    return $r(t).setUint32(e, n), e + 4;
  }
}, Oj = {
  len: 4,
  get(t, e) {
    return $r(t).getInt32(e);
  },
  put(t, e, n) {
    return $r(t).setInt32(e, n), e + 4;
  }
}, Mj = {
  len: 8,
  get(t, e) {
    return $r(t).getBigUint64(e, !0);
  },
  put(t, e, n) {
    return $r(t).setBigUint64(e, n, !0), e + 8;
  }
};
let Yo = class {
  constructor(e, n) {
    this.len = e, this.encoding = n;
  }
  get(e, n = 0) {
    const r = e.subarray(n, n + this.len);
    return Ij(r, this.encoding);
  }
};
var Rj = uO("/"), Yh, Bj = ";var __w=require('worker_threads');__w.parentPort.on('message',function(m){onmessage({data:m})}),postMessage=function(m,t){__w.parentPort.postMessage(m,t)},close=process.exit;self=global";
try {
  Yh = Rj("worker_threads").Worker;
} catch {
}
var Uj = Yh ? function(t, e, n, r, i) {
  var o = !1, s = new Yh(t + Bj, { eval: !0 }).on("error", function(a) {
    return i(a, null);
  }).on("message", function(a) {
    return i(null, a);
  }).on("exit", function(a) {
    a && !o && i(new Error("exited with code " + a), null);
  });
  return s.postMessage(n, r), s.terminate = function() {
    return o = !0, Yh.prototype.terminate.call(s);
  }, s;
} : function(t, e, n, r, i) {
  setImmediate(function() {
    return i(new Error("async operations unsupported - update to Node 12+ (or Node 10-11 with the --experimental-worker CLI flag)"), null);
  });
  var o = function() {
  };
  return {
    terminate: o,
    postMessage: o
  };
}, vn = Uint8Array, La = Uint16Array, u6 = Int32Array, aE = new vn([
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  1,
  1,
  1,
  1,
  2,
  2,
  2,
  2,
  3,
  3,
  3,
  3,
  4,
  4,
  4,
  4,
  5,
  5,
  5,
  5,
  0,
  /* unused */
  0,
  0,
  /* impossible */
  0
]), cE = new vn([
  0,
  0,
  0,
  0,
  1,
  1,
  2,
  2,
  3,
  3,
  4,
  4,
  5,
  5,
  6,
  6,
  7,
  7,
  8,
  8,
  9,
  9,
  10,
  10,
  11,
  11,
  12,
  12,
  13,
  13,
  /* unused */
  0,
  0
]), l6 = new vn([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), p6 = function(t, e) {
  for (var n = new La(31), r = 0; r < 31; ++r)
    n[r] = e += 1 << t[r - 1];
  for (var i = new u6(n[30]), r = 1; r < 30; ++r)
    for (var o = n[r]; o < n[r + 1]; ++o)
      i[o] = o - n[r] << 5 | r;
  return { b: n, r: i };
}, d6 = p6(aE, 2), uE = d6.b, Lj = d6.r;
uE[28] = 258, Lj[258] = 28;
var jj = p6(cE, 0), f6 = jj.b, Em = new La(32768);
for (var Wt = 0; Wt < 32768; ++Wt) {
  var Ds = (Wt & 43690) >> 1 | (Wt & 21845) << 1;
  Ds = (Ds & 52428) >> 2 | (Ds & 13107) << 2, Ds = (Ds & 61680) >> 4 | (Ds & 3855) << 4, Em[Wt] = ((Ds & 65280) >> 8 | (Ds & 255) << 8) >> 1;
}
var ou = (function(t, e, n) {
  for (var r = t.length, i = 0, o = new La(e); i < r; ++i)
    t[i] && ++o[t[i] - 1];
  var s = new La(e);
  for (i = 1; i < e; ++i)
    s[i] = s[i - 1] + o[i - 1] << 1;
  var a;
  if (n) {
    a = new La(1 << e);
    var c = 15 - e;
    for (i = 0; i < r; ++i)
      if (t[i])
        for (var u = i << 4 | t[i], l = e - t[i], d = s[t[i] - 1]++ << l, f = d | (1 << l) - 1; d <= f; ++d)
          a[Em[d] >> c] = u;
  } else
    for (a = new La(r), i = 0; i < r; ++i)
      t[i] && (a[i] = Em[s[t[i] - 1]++] >> 15 - t[i]);
  return a;
}), Ad = new vn(288);
for (var Wt = 0; Wt < 144; ++Wt)
  Ad[Wt] = 8;
for (var Wt = 144; Wt < 256; ++Wt)
  Ad[Wt] = 9;
for (var Wt = 256; Wt < 280; ++Wt)
  Ad[Wt] = 7;
for (var Wt = 280; Wt < 288; ++Wt)
  Ad[Wt] = 8;
var h6 = new vn(32);
for (var Wt = 0; Wt < 32; ++Wt)
  h6[Wt] = 5;
var m6 = /* @__PURE__ */ ou(Ad, 9, 1), g6 = /* @__PURE__ */ ou(h6, 5, 1), Jh = function(t) {
  for (var e = t[0], n = 1; n < t.length; ++n)
    t[n] > e && (e = t[n]);
  return e;
}, bi = function(t, e, n) {
  var r = e / 8 | 0;
  return (t[r] | t[r + 1] << 8) >> (e & 7) & n;
}, Xh = function(t, e) {
  var n = e / 8 | 0;
  return (t[n] | t[n + 1] << 8 | t[n + 2] << 16) >> (e & 7);
}, lE = function(t) {
  return (t + 7) / 8 | 0;
}, Fp = function(t, e, n) {
  return (e == null || e < 0) && (e = 0), (n == null || n > t.length) && (n = t.length), new vn(t.subarray(e, n));
}, y6 = [
  "unexpected EOF",
  "invalid block type",
  "invalid length/literal",
  "invalid distance",
  "stream finished",
  "no stream handler",
  ,
  "no callback",
  "invalid UTF-8 data",
  "extra field too long",
  "date not in range 1980-2099",
  "filename too long",
  "stream finishing",
  "invalid zip data"
  // determined by unknown compression method
], jn = function(t, e, n) {
  var r = new Error(e || y6[t]);
  if (r.code = t, Error.captureStackTrace && Error.captureStackTrace(r, jn), !n)
    throw r;
  return r;
}, Id = function(t, e, n, r) {
  var i = t.length, o = r ? r.length : 0;
  if (!i || e.f && !e.l)
    return n || new vn(0);
  var s = !n, a = s || e.i != 2, c = e.i;
  s && (n = new vn(i * 3));
  var u = function(P) {
    var Q = n.length;
    if (P > Q) {
      var z = new vn(Math.max(Q * 2, P));
      z.set(n), n = z;
    }
  }, l = e.f || 0, d = e.p || 0, f = e.b || 0, m = e.l, h = e.d, y = e.m, x = e.n, g = i * 8;
  do {
    if (!m) {
      l = bi(t, d, 1);
      var v = bi(t, d + 1, 3);
      if (d += 3, v)
        if (v == 1)
          m = m6, h = g6, y = 9, x = 5;
        else if (v == 2) {
          var j = bi(t, d, 31) + 257, q = bi(t, d + 10, 15) + 4, Y = j + bi(t, d + 5, 31) + 1;
          d += 14;
          for (var W = new vn(Y), G = new vn(19), J = 0; J < q; ++J)
            G[l6[J]] = bi(t, d + J * 3, 7);
          d += q * 3;
          for (var B = Jh(G), D = (1 << B) - 1, X = ou(G, B, 1), J = 0; J < Y; ) {
            var V = X[bi(t, d, D)];
            d += V & 15;
            var S = V >> 4;
            if (S < 16)
              W[J++] = S;
            else {
              var K = 0, $ = 0;
              for (S == 16 ? ($ = 3 + bi(t, d, 3), d += 2, K = W[J - 1]) : S == 17 ? ($ = 3 + bi(t, d, 7), d += 3) : S == 18 && ($ = 11 + bi(t, d, 127), d += 7); $--; )
                W[J++] = K;
            }
          }
          var _ = W.subarray(0, j), I = W.subarray(j);
          y = Jh(_), x = Jh(I), m = ou(_, y, 1), h = ou(I, x, 1);
        } else
          jn(1);
      else {
        var S = lE(d) + 4, E = t[S - 4] | t[S - 3] << 8, T = S + E;
        if (T > i) {
          c && jn(0);
          break;
        }
        a && u(f + E), n.set(t.subarray(S, T), f), e.b = f += E, e.p = d = T * 8, e.f = l;
        continue;
      }
      if (d > g) {
        c && jn(0);
        break;
      }
    }
    a && u(f + 131072);
    for (var N = (1 << y) - 1, U = (1 << x) - 1, C = d; ; C = d) {
      var K = m[Xh(t, d) & N], L = K >> 4;
      if (d += K & 15, d > g) {
        c && jn(0);
        break;
      }
      if (K || jn(2), L < 256)
        n[f++] = L;
      else if (L == 256) {
        C = d, m = null;
        break;
      } else {
        var k = L - 254;
        if (L > 264) {
          var J = L - 257, M = aE[J];
          k = bi(t, d, (1 << M) - 1) + uE[J], d += M;
        }
        var F = h[Xh(t, d) & U], A = F >> 4;
        F || jn(3), d += F & 15;
        var I = f6[A];
        if (A > 3) {
          var M = cE[A];
          I += Xh(t, d) & (1 << M) - 1, d += M;
        }
        if (d > g) {
          c && jn(0);
          break;
        }
        a && u(f + 131072);
        var O = f + k;
        if (f < I) {
          var Z = o - I, ee = Math.min(I, O);
          for (Z + f < 0 && jn(3); f < ee; ++f)
            n[f] = r[Z + f];
        }
        for (; f < O; ++f)
          n[f] = n[f - I];
      }
    }
    e.l = m, e.p = C, e.b = f, e.f = l, m && (l = 1, e.m = y, e.d = h, e.n = x);
  } while (!l);
  return f != n.length && s ? Fp(n, 0, f) : n.subarray(0, f);
}, Qj = /* @__PURE__ */ new vn(0), $j = function(t, e) {
  var n = {};
  for (var r in t)
    n[r] = t[r];
  for (var r in e)
    n[r] = e[r];
  return n;
}, FI = function(t, e, n) {
  for (var r = t(), i = t.toString(), o = i.slice(i.indexOf("[") + 1, i.lastIndexOf("]")).replace(/\s+/g, "").split(","), s = 0; s < r.length; ++s) {
    var a = r[s], c = o[s];
    if (typeof a == "function") {
      e += ";" + c + "=";
      var u = a.toString();
      if (a.prototype)
        if (u.indexOf("[native code]") != -1) {
          var l = u.indexOf(" ", 8) + 1;
          e += u.slice(l, u.indexOf("(", l));
        } else {
          e += u;
          for (var d in a.prototype)
            e += ";" + c + ".prototype." + d + "=" + a.prototype[d].toString();
        }
      else
        e += u;
    } else
      n[c] = a;
  }
  return e;
}, Ff = [], Gj = function(t) {
  var e = [];
  for (var n in t)
    t[n].buffer && e.push((t[n] = new t[n].constructor(t[n])).buffer);
  return e;
}, qj = function(t, e, n, r) {
  if (!Ff[n]) {
    for (var i = "", o = {}, s = t.length - 1, a = 0; a < s; ++a)
      i = FI(t[a], i, o);
    Ff[n] = { c: FI(t[s], i, o), e: o };
  }
  var c = $j({}, Ff[n].e);
  return Uj(Ff[n].c + ";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=" + e.toString() + "}", n, c, Gj(c), r);
}, Hj = function() {
  return [vn, La, u6, aE, cE, l6, uE, f6, m6, g6, Em, y6, ou, Jh, bi, Xh, lE, Fp, jn, Id, b6, zj, Kj];
}, Wj = function() {
  return [pE, v6];
}, zj = function(t) {
  return postMessage(t, [t.buffer]);
}, Kj = function(t) {
  return t && {
    out: t.size && new vn(t.size),
    dictionary: t.dictionary
  };
}, OI = function(t) {
  return t.ondata = function(e, n) {
    return postMessage([e, n], [e.buffer]);
  }, function(e) {
    e.data.length ? (t.push(e.data[0], e.data[1]), postMessage([e.data[0].length])) : t.flush();
  };
}, Vj = function(t, e, n, r, i, o, s) {
  var a, c = qj(t, r, i, function(u, l) {
    u ? (c.terminate(), e.ondata.call(e, u)) : Array.isArray(l) ? l.length == 1 ? (e.queuedSize -= l[0], e.ondrain && e.ondrain(l[0])) : (l[1] && c.terminate(), e.ondata.call(e, u, l[0], l[1])) : s(l);
  });
  c.postMessage(n), e.queuedSize = 0, e.push = function(u, l) {
    e.ondata || jn(5), a && e.ondata(jn(4, 0, 1), null, !!l), e.queuedSize += u.length, c.postMessage([u, a = l], [u.buffer]);
  }, e.terminate = function() {
    c.terminate();
  };
}, pE = function(t) {
  (t[0] != 31 || t[1] != 139 || t[2] != 8) && jn(6, "invalid gzip data");
  var e = t[3], n = 10;
  e & 4 && (n += (t[10] | t[11] << 8) + 2);
  for (var r = (e >> 3 & 1) + (e >> 4 & 1); r > 0; r -= !t[n++])
    ;
  return n + (e & 2);
}, v6 = function(t) {
  var e = t.length;
  return (t[e - 4] | t[e - 3] << 8 | t[e - 2] << 16 | t[e - 1] << 24) >>> 0;
}, Yj = function(t, e) {
  return ((t[0] & 15) != 8 || t[0] >> 4 > 7 || (t[0] << 8 | t[1]) % 31) && jn(6, "invalid zlib data"), (t[1] >> 5 & 1) == 1 && jn(6, "invalid zlib data: " + (t[1] & 32 ? "need" : "unexpected") + " dictionary"), (t[1] >> 3 & 4) + 2;
};
function Jj(t, e) {
  return typeof t == "function" && (e = t, t = {}), this.ondata = e, t;
}
var Zh = /* @__PURE__ */ (function() {
  function t(e, n) {
    typeof e == "function" && (n = e, e = {}), this.ondata = n;
    var r = e && e.dictionary && e.dictionary.subarray(-32768);
    this.s = { i: 0, b: r ? r.length : 0 }, this.o = new vn(32768), this.p = new vn(0), r && this.o.set(r);
  }
  return t.prototype.e = function(e) {
    if (this.ondata || jn(5), this.d && jn(4), !this.p.length)
      this.p = e;
    else if (e.length) {
      var n = new vn(this.p.length + e.length);
      n.set(this.p), n.set(e, this.p.length), this.p = n;
    }
  }, t.prototype.c = function(e) {
    this.s.i = +(this.d = e || !1);
    var n = this.s.b, r = Id(this.p, this.s, this.o);
    this.ondata(Fp(r, n, this.s.b), this.d), this.o = Fp(r, this.s.b - 32768), this.s.b = this.o.length, this.p = Fp(this.p, this.s.p / 8 | 0), this.s.p &= 7;
  }, t.prototype.push = function(e, n) {
    this.e(e), this.c(n);
  }, t;
})();
function b6(t, e) {
  return Id(t, { i: 2 }, e && e.out, e && e.dictionary);
}
var MI = /* @__PURE__ */ (function() {
  function t(e, n) {
    this.v = 1, this.r = 0, Zh.call(this, e, n);
  }
  return t.prototype.push = function(e, n) {
    if (Zh.prototype.e.call(this, e), this.r += e.length, this.v) {
      var r = this.p.subarray(this.v - 1), i = r.length > 3 ? pE(r) : 4;
      if (i > r.length) {
        if (!n)
          return;
      } else this.v > 1 && this.onmember && this.onmember(this.r - r.length);
      this.p = r.subarray(i), this.v = 0;
    }
    Zh.prototype.c.call(this, n), this.s.f && !this.s.l && !n && (this.v = lE(this.s.p) + 9, this.s = { i: 0 }, this.o = new vn(0), this.push(new vn(0), n));
  }, t;
})(), Xj = /* @__PURE__ */ (function() {
  function t(e, n) {
    var r = this;
    Vj([
      Hj,
      Wj,
      function() {
        return [OI, Zh, MI];
      }
    ], this, Jj.call(this, e, n), function(i) {
      var o = new MI(i.data);
      o.onmember = function(s) {
        return postMessage(s);
      }, onmessage = OI(o);
    }, 9, 0, function(i) {
      return r.onmember && r.onmember(i);
    });
  }
  return t;
})();
function Zj(t, e) {
  var n = pE(t);
  return n + 8 > t.length && jn(6, "invalid gzip data"), Id(t.subarray(n, -8), { i: 2 }, new vn(v6(t)), e);
}
function e7(t, e) {
  return Id(t.subarray(Yj(t), -4), { i: 2 }, e, e);
}
function t7(t, e) {
  return t[0] == 31 && t[1] == 139 && t[2] == 8 ? Zj(t, e) : (t[0] & 15) != 8 || t[0] >> 4 > 7 || (t[0] << 8 | t[1]) % 31 ? b6(t, e) : e7(t, e);
}
var n7 = typeof TextDecoder < "u" && /* @__PURE__ */ new TextDecoder(), r7 = 0;
try {
  n7.decode(Qj, { stream: !0 }), r7 = 1;
} catch {
}
var Of = { exports: {} }, Uy, RI;
function x6() {
  if (RI) return Uy;
  RI = 1;
  var t = 1e3, e = t * 60, n = e * 60, r = n * 24, i = r * 7, o = r * 365.25;
  Uy = function(l, d) {
    d = d || {};
    var f = typeof l;
    if (f === "string" && l.length > 0)
      return s(l);
    if (f === "number" && isFinite(l))
      return d.long ? c(l) : a(l);
    throw new Error(
      "val is not a non-empty string or a valid number. val=" + JSON.stringify(l)
    );
  };
  function s(l) {
    if (l = String(l), !(l.length > 100)) {
      var d = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
        l
      );
      if (d) {
        var f = parseFloat(d[1]), m = (d[2] || "ms").toLowerCase();
        switch (m) {
          case "years":
          case "year":
          case "yrs":
          case "yr":
          case "y":
            return f * o;
          case "weeks":
          case "week":
          case "w":
            return f * i;
          case "days":
          case "day":
          case "d":
            return f * r;
          case "hours":
          case "hour":
          case "hrs":
          case "hr":
          case "h":
            return f * n;
          case "minutes":
          case "minute":
          case "mins":
          case "min":
          case "m":
            return f * e;
          case "seconds":
          case "second":
          case "secs":
          case "sec":
          case "s":
            return f * t;
          case "milliseconds":
          case "millisecond":
          case "msecs":
          case "msec":
          case "ms":
            return f;
          default:
            return;
        }
      }
    }
  }
  function a(l) {
    var d = Math.abs(l);
    return d >= r ? Math.round(l / r) + "d" : d >= n ? Math.round(l / n) + "h" : d >= e ? Math.round(l / e) + "m" : d >= t ? Math.round(l / t) + "s" : l + "ms";
  }
  function c(l) {
    var d = Math.abs(l);
    return d >= r ? u(l, d, r, "day") : d >= n ? u(l, d, n, "hour") : d >= e ? u(l, d, e, "minute") : d >= t ? u(l, d, t, "second") : l + " ms";
  }
  function u(l, d, f, m) {
    var h = d >= f * 1.5;
    return Math.round(l / f) + " " + m + (h ? "s" : "");
  }
  return Uy;
}
var Ly, BI;
function i7() {
  if (BI) return Ly;
  BI = 1;
  function t(e) {
    r.debug = r, r.default = r, r.coerce = u, r.disable = a, r.enable = o, r.enabled = c, r.humanize = x6(), r.destroy = l, Object.keys(e).forEach((d) => {
      r[d] = e[d];
    }), r.names = [], r.skips = [], r.formatters = {};
    function n(d) {
      let f = 0;
      for (let m = 0; m < d.length; m++)
        f = (f << 5) - f + d.charCodeAt(m), f |= 0;
      return r.colors[Math.abs(f) % r.colors.length];
    }
    r.selectColor = n;
    function r(d) {
      let f, m = null, h, y;
      function x(...g) {
        if (!x.enabled)
          return;
        const v = x, S = Number(/* @__PURE__ */ new Date()), E = S - (f || S);
        v.diff = E, v.prev = f, v.curr = S, f = S, g[0] = r.coerce(g[0]), typeof g[0] != "string" && g.unshift("%O");
        let T = 0;
        g[0] = g[0].replace(/%([a-zA-Z%])/g, (q, Y) => {
          if (q === "%%")
            return "%";
          T++;
          const W = r.formatters[Y];
          if (typeof W == "function") {
            const G = g[T];
            q = W.call(v, G), g.splice(T, 1), T--;
          }
          return q;
        }), r.formatArgs.call(v, g), (v.log || r.log).apply(v, g);
      }
      return x.namespace = d, x.useColors = r.useColors(), x.color = r.selectColor(d), x.extend = i, x.destroy = r.destroy, Object.defineProperty(x, "enabled", {
        enumerable: !0,
        configurable: !1,
        get: () => m !== null ? m : (h !== r.namespaces && (h = r.namespaces, y = r.enabled(d)), y),
        set: (g) => {
          m = g;
        }
      }), typeof r.init == "function" && r.init(x), x;
    }
    function i(d, f) {
      const m = r(this.namespace + (typeof f > "u" ? ":" : f) + d);
      return m.log = this.log, m;
    }
    function o(d) {
      r.save(d), r.namespaces = d, r.names = [], r.skips = [];
      const f = (typeof d == "string" ? d : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
      for (const m of f)
        m[0] === "-" ? r.skips.push(m.slice(1)) : r.names.push(m);
    }
    function s(d, f) {
      let m = 0, h = 0, y = -1, x = 0;
      for (; m < d.length; )
        if (h < f.length && (f[h] === d[m] || f[h] === "*"))
          f[h] === "*" ? (y = h, x = m, h++) : (m++, h++);
        else if (y !== -1)
          h = y + 1, x++, m = x;
        else
          return !1;
      for (; h < f.length && f[h] === "*"; )
        h++;
      return h === f.length;
    }
    function a() {
      const d = [
        ...r.names,
        ...r.skips.map((f) => "-" + f)
      ].join(",");
      return r.enable(""), d;
    }
    function c(d) {
      for (const f of r.skips)
        if (s(d, f))
          return !1;
      for (const f of r.names)
        if (s(d, f))
          return !0;
      return !1;
    }
    function u(d) {
      return d instanceof Error ? d.stack || d.message : d;
    }
    function l() {
      console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
    }
    return r.enable(r.load()), r;
  }
  return Ly = t, Ly;
}
var UI;
function o7() {
  return UI || (UI = 1, (function(t, e) {
    e.formatArgs = r, e.save = i, e.load = o, e.useColors = n, e.storage = s(), e.destroy = /* @__PURE__ */ (() => {
      let c = !1;
      return () => {
        c || (c = !0, console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."));
      };
    })(), e.colors = [
      "#0000CC",
      "#0000FF",
      "#0033CC",
      "#0033FF",
      "#0066CC",
      "#0066FF",
      "#0099CC",
      "#0099FF",
      "#00CC00",
      "#00CC33",
      "#00CC66",
      "#00CC99",
      "#00CCCC",
      "#00CCFF",
      "#3300CC",
      "#3300FF",
      "#3333CC",
      "#3333FF",
      "#3366CC",
      "#3366FF",
      "#3399CC",
      "#3399FF",
      "#33CC00",
      "#33CC33",
      "#33CC66",
      "#33CC99",
      "#33CCCC",
      "#33CCFF",
      "#6600CC",
      "#6600FF",
      "#6633CC",
      "#6633FF",
      "#66CC00",
      "#66CC33",
      "#9900CC",
      "#9900FF",
      "#9933CC",
      "#9933FF",
      "#99CC00",
      "#99CC33",
      "#CC0000",
      "#CC0033",
      "#CC0066",
      "#CC0099",
      "#CC00CC",
      "#CC00FF",
      "#CC3300",
      "#CC3333",
      "#CC3366",
      "#CC3399",
      "#CC33CC",
      "#CC33FF",
      "#CC6600",
      "#CC6633",
      "#CC9900",
      "#CC9933",
      "#CCCC00",
      "#CCCC33",
      "#FF0000",
      "#FF0033",
      "#FF0066",
      "#FF0099",
      "#FF00CC",
      "#FF00FF",
      "#FF3300",
      "#FF3333",
      "#FF3366",
      "#FF3399",
      "#FF33CC",
      "#FF33FF",
      "#FF6600",
      "#FF6633",
      "#FF9900",
      "#FF9933",
      "#FFCC00",
      "#FFCC33"
    ];
    function n() {
      if (typeof window < "u" && window.process && (window.process.type === "renderer" || window.process.__nwjs))
        return !0;
      if (typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))
        return !1;
      let c;
      return typeof document < "u" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
      typeof window < "u" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
      // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
      typeof navigator < "u" && navigator.userAgent && (c = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(c[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
      typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
    }
    function r(c) {
      if (c[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + c[0] + (this.useColors ? "%c " : " ") + "+" + t.exports.humanize(this.diff), !this.useColors)
        return;
      const u = "color: " + this.color;
      c.splice(1, 0, u, "color: inherit");
      let l = 0, d = 0;
      c[0].replace(/%[a-zA-Z%]/g, (f) => {
        f !== "%%" && (l++, f === "%c" && (d = l));
      }), c.splice(d, 0, u);
    }
    e.log = console.debug || console.log || (() => {
    });
    function i(c) {
      try {
        c ? e.storage.setItem("debug", c) : e.storage.removeItem("debug");
      } catch {
      }
    }
    function o() {
      let c;
      try {
        c = e.storage.getItem("debug") || e.storage.getItem("DEBUG");
      } catch {
      }
      return !c && typeof process < "u" && "env" in process && (c = process.env.DEBUG), c;
    }
    function s() {
      try {
        return localStorage;
      } catch {
      }
    }
    t.exports = i7()(e);
    const { formatters: a } = t.exports;
    a.j = function(c) {
      try {
        return JSON.stringify(c);
      } catch (u) {
        return "[UnexpectedJSONParseError]: " + u.message;
      }
    };
  })(Of, Of.exports)), Of.exports;
}
var s7 = o7();
const a7 = /* @__PURE__ */ Bo(s7), Yc = {
  LocalFileHeader: 67324752,
  DataDescriptor: 134695760,
  CentralFileHeader: 33639248,
  EndOfCentralDirectory: 101010256
}, LI = {
  get(t) {
    return {
      signature: Gn.get(t, 0),
      compressedSize: Gn.get(t, 8),
      uncompressedSize: Gn.get(t, 12)
    };
  },
  len: 16
}, c7 = {
  get(t) {
    const e = pn.get(t, 6);
    return {
      signature: Gn.get(t, 0),
      minVersion: pn.get(t, 4),
      dataDescriptor: !!(e & 8),
      compressedMethod: pn.get(t, 8),
      compressedSize: Gn.get(t, 18),
      uncompressedSize: Gn.get(t, 22),
      filenameLength: pn.get(t, 26),
      extraFieldLength: pn.get(t, 28),
      filename: null
    };
  },
  len: 30
}, u7 = {
  get(t) {
    return {
      signature: Gn.get(t, 0),
      nrOfThisDisk: pn.get(t, 4),
      nrOfThisDiskWithTheStart: pn.get(t, 6),
      nrOfEntriesOnThisDisk: pn.get(t, 8),
      nrOfEntriesOfSize: pn.get(t, 10),
      sizeOfCd: Gn.get(t, 12),
      offsetOfStartOfCd: Gn.get(t, 16),
      zipFileCommentLength: pn.get(t, 20)
    };
  },
  len: 22
}, l7 = {
  get(t) {
    const e = pn.get(t, 8);
    return {
      signature: Gn.get(t, 0),
      minVersion: pn.get(t, 6),
      dataDescriptor: !!(e & 8),
      compressedMethod: pn.get(t, 10),
      compressedSize: Gn.get(t, 20),
      uncompressedSize: Gn.get(t, 24),
      filenameLength: pn.get(t, 28),
      extraFieldLength: pn.get(t, 30),
      fileCommentLength: pn.get(t, 32),
      relativeOffsetOfLocalHeader: Gn.get(t, 42),
      filename: null
    };
  },
  len: 46
};
function w6(t) {
  const e = new Uint8Array(Gn.len);
  return Gn.put(e, 0, t), e;
}
const So = a7("tokenizer:inflate"), jy = 256 * 1024, p7 = w6(Yc.DataDescriptor), Mf = w6(Yc.EndOfCentralDirectory);
class d7 {
  constructor(e) {
    this.tokenizer = e, this.syncBuffer = new Uint8Array(jy);
  }
  async isZip() {
    return await this.peekSignature() === Yc.LocalFileHeader;
  }
  peekSignature() {
    return this.tokenizer.peekToken(Gn);
  }
  async findEndOfCentralDirectoryLocator() {
    const e = this.tokenizer, n = Math.min(16 * 1024, e.fileInfo.size), r = this.syncBuffer.subarray(0, n);
    await this.tokenizer.readBuffer(r, { position: e.fileInfo.size - n });
    for (let i = r.length - 4; i >= 0; i--)
      if (r[i] === Mf[0] && r[i + 1] === Mf[1] && r[i + 2] === Mf[2] && r[i + 3] === Mf[3])
        return e.fileInfo.size - n + i;
    return -1;
  }
  async readCentralDirectory() {
    if (!this.tokenizer.supportsRandomAccess()) {
      So("Cannot reading central-directory without random-read support");
      return;
    }
    So("Reading central-directory...");
    const e = this.tokenizer.position, n = await this.findEndOfCentralDirectoryLocator();
    if (n > 0) {
      So("Central-directory 32-bit signature found");
      const r = await this.tokenizer.readToken(u7, n), i = [];
      this.tokenizer.setPosition(r.offsetOfStartOfCd);
      for (let o = 0; o < r.nrOfEntriesOfSize; ++o) {
        const s = await this.tokenizer.readToken(l7);
        if (s.signature !== Yc.CentralFileHeader)
          throw new Error("Expected Central-File-Header signature");
        s.filename = await this.tokenizer.readToken(new Yo(s.filenameLength, "utf-8")), await this.tokenizer.ignore(s.extraFieldLength), await this.tokenizer.ignore(s.fileCommentLength), i.push(s), So(`Add central-directory file-entry: n=${o + 1}/${i.length}: filename=${i[o].filename}`);
      }
      return this.tokenizer.setPosition(e), i;
    }
    this.tokenizer.setPosition(e);
  }
  async unzip(e) {
    const n = await this.readCentralDirectory();
    if (n)
      return this.iterateOverCentralDirectory(n, e);
    let r = !1;
    do {
      const i = await this.readLocalFileHeader();
      if (!i)
        break;
      const o = e(i);
      r = !!o.stop;
      let s;
      if (await this.tokenizer.ignore(i.extraFieldLength), i.dataDescriptor && i.compressedSize === 0) {
        const a = [];
        let c = jy;
        So("Compressed-file-size unknown, scanning for next data-descriptor-signature....");
        let u = -1;
        for (; u < 0 && c === jy; ) {
          c = await this.tokenizer.peekBuffer(this.syncBuffer, { mayBeLess: !0 }), u = f7(this.syncBuffer.subarray(0, c), p7);
          const l = u >= 0 ? u : c;
          if (o.handler) {
            const d = new Uint8Array(l);
            await this.tokenizer.readBuffer(d), a.push(d);
          } else
            await this.tokenizer.ignore(l);
        }
        So(`Found data-descriptor-signature at pos=${this.tokenizer.position}`), o.handler && await this.inflate(i, h7(a), o.handler);
      } else
        o.handler ? (So(`Reading compressed-file-data: ${i.compressedSize} bytes`), s = new Uint8Array(i.compressedSize), await this.tokenizer.readBuffer(s), await this.inflate(i, s, o.handler)) : (So(`Ignoring compressed-file-data: ${i.compressedSize} bytes`), await this.tokenizer.ignore(i.compressedSize));
      if (So(`Reading data-descriptor at pos=${this.tokenizer.position}`), i.dataDescriptor && (await this.tokenizer.readToken(LI)).signature !== 134695760)
        throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position - LI.len}`);
    } while (!r);
  }
  async iterateOverCentralDirectory(e, n) {
    for (const r of e) {
      const i = n(r);
      if (i.handler) {
        this.tokenizer.setPosition(r.relativeOffsetOfLocalHeader);
        const o = await this.readLocalFileHeader();
        if (o) {
          await this.tokenizer.ignore(o.extraFieldLength);
          const s = new Uint8Array(r.compressedSize);
          await this.tokenizer.readBuffer(s), await this.inflate(o, s, i.handler);
        }
      }
      if (i.stop)
        break;
    }
  }
  inflate(e, n, r) {
    if (e.compressedMethod === 0)
      return r(n);
    So(`Decompress filename=${e.filename}, compressed-size=${n.length}`);
    const i = t7(n);
    return r(i);
  }
  async readLocalFileHeader() {
    const e = await this.tokenizer.peekToken(Gn);
    if (e === Yc.LocalFileHeader) {
      const n = await this.tokenizer.readToken(c7);
      return n.filename = await this.tokenizer.readToken(new Yo(n.filenameLength, "utf-8")), n;
    }
    if (e === Yc.CentralFileHeader)
      return !1;
    throw e === 3759263696 ? new Error("Encrypted ZIP") : new Error("Unexpected signature");
  }
}
function f7(t, e) {
  const n = t.length, r = e.length;
  if (r > n)
    return -1;
  for (let i = 0; i <= n - r; i++) {
    let o = !0;
    for (let s = 0; s < r; s++)
      if (t[i + s] !== e[s]) {
        o = !1;
        break;
      }
    if (o)
      return i;
  }
  return -1;
}
function h7(t) {
  const e = t.reduce((i, o) => i + o.length, 0), n = new Uint8Array(e);
  let r = 0;
  for (const i of t)
    n.set(i, r), r += i.length;
  return n;
}
class m7 {
  constructor(e) {
    this.gunzip = void 0, this.tokenizer = e;
  }
  inflate() {
    let e = !1, n = !1;
    const r = this;
    return new ReadableStream({
      start: (i) => {
        r.gunzip = new Xj((o, s, a) => {
          if (o) {
            i.error(o);
            return;
          }
          s && !n && i.enqueue(s), a && !n && (i.close(), r.gunzip.terminate());
        });
      },
      async pull(i) {
        try {
          const s = new Uint8Array(1024), a = await r.tokenizer.readBuffer(s, { mayBeLess: !0 });
          if (a === 0) {
            e || (e = !0, n || r.gunzip.push(new Uint8Array(0), !0));
            return;
          }
          r.gunzip.push(s.subarray(0, a), !1);
        } catch (s) {
          i.error(s);
        }
      },
      cancel: () => {
        r.gunzip.terminate(), n = !0;
      }
    });
  }
}
new globalThis.TextDecoder("utf8");
new globalThis.TextEncoder();
Array.from({ length: 256 }, (t, e) => e.toString(16).padStart(2, "0"));
function jI(t) {
  const { byteLength: e } = t;
  if (e === 6)
    return t.getUint16(0) * 2 ** 32 + t.getUint32(2);
  if (e === 5)
    return t.getUint8(0) * 2 ** 32 + t.getUint32(1);
  if (e === 4)
    return t.getUint32(0);
  if (e === 3)
    return t.getUint8(0) * 2 ** 16 + t.getUint16(1);
  if (e === 2)
    return t.getUint16(0);
  if (e === 1)
    return t.getUint8(0);
}
function g7(t, e) {
  if (e === "utf-16le") {
    const n = [];
    for (let r = 0; r < t.length; r++) {
      const i = t.charCodeAt(r);
      n.push(i & 255, i >> 8 & 255);
    }
    return n;
  }
  if (e === "utf-16be") {
    const n = [];
    for (let r = 0; r < t.length; r++) {
      const i = t.charCodeAt(r);
      n.push(i >> 8 & 255, i & 255);
    }
    return n;
  }
  return [...t].map((n) => n.charCodeAt(0));
}
function y7(t, e = 0) {
  const n = Number.parseInt(new Yo(6).get(t, 148).replace(/\0.*$/, "").trim(), 8);
  if (Number.isNaN(n))
    return !1;
  let r = 256;
  for (let i = e; i < e + 148; i++)
    r += t[i];
  for (let i = e + 156; i < e + 512; i++)
    r += t[i];
  return n === r;
}
const v7 = {
  get: (t, e) => t[e + 3] & 127 | t[e + 2] << 7 | t[e + 1] << 14 | t[e] << 21,
  len: 4
}, b7 = [
  "jpg",
  "png",
  "apng",
  "gif",
  "webp",
  "flif",
  "xcf",
  "cr2",
  "cr3",
  "orf",
  "arw",
  "dng",
  "nef",
  "rw2",
  "raf",
  "tif",
  "bmp",
  "icns",
  "jxr",
  "psd",
  "indd",
  "zip",
  "tar",
  "rar",
  "gz",
  "bz2",
  "7z",
  "dmg",
  "mp4",
  "mid",
  "mkv",
  "webm",
  "mov",
  "avi",
  "mpg",
  "mp2",
  "mp3",
  "m4a",
  "oga",
  "ogg",
  "ogv",
  "opus",
  "flac",
  "wav",
  "spx",
  "amr",
  "pdf",
  "epub",
  "elf",
  "macho",
  "exe",
  "swf",
  "rtf",
  "wasm",
  "woff",
  "woff2",
  "eot",
  "ttf",
  "otf",
  "ttc",
  "ico",
  "flv",
  "ps",
  "xz",
  "sqlite",
  "nes",
  "crx",
  "xpi",
  "cab",
  "deb",
  "ar",
  "rpm",
  "Z",
  "lz",
  "cfb",
  "mxf",
  "mts",
  "blend",
  "bpg",
  "docx",
  "pptx",
  "xlsx",
  "3gp",
  "3g2",
  "j2c",
  "jp2",
  "jpm",
  "jpx",
  "mj2",
  "aif",
  "qcp",
  "odt",
  "ods",
  "odp",
  "xml",
  "mobi",
  "heic",
  "cur",
  "ktx",
  "ape",
  "wv",
  "dcm",
  "ics",
  "glb",
  "pcap",
  "dsf",
  "lnk",
  "alias",
  "voc",
  "ac3",
  "m4v",
  "m4p",
  "m4b",
  "f4v",
  "f4p",
  "f4b",
  "f4a",
  "mie",
  "asf",
  "ogm",
  "ogx",
  "mpc",
  "arrow",
  "shp",
  "aac",
  "mp1",
  "it",
  "s3m",
  "xm",
  "skp",
  "avif",
  "eps",
  "lzh",
  "pgp",
  "asar",
  "stl",
  "chm",
  "3mf",
  "zst",
  "jxl",
  "vcf",
  "jls",
  "pst",
  "dwg",
  "parquet",
  "class",
  "arj",
  "cpio",
  "ace",
  "avro",
  "icc",
  "fbx",
  "vsdx",
  "vtt",
  "apk",
  "drc",
  "lz4",
  "potx",
  "xltx",
  "dotx",
  "xltm",
  "ott",
  "ots",
  "otp",
  "odg",
  "otg",
  "xlsm",
  "docm",
  "dotm",
  "potm",
  "pptm",
  "jar",
  "rm",
  "ppsm",
  "ppsx",
  "tar.gz",
  "reg",
  "dat"
], x7 = [
  "image/jpeg",
  "image/png",
  "image/gif",
  "image/webp",
  "image/flif",
  "image/x-xcf",
  "image/x-canon-cr2",
  "image/x-canon-cr3",
  "image/tiff",
  "image/bmp",
  "image/vnd.ms-photo",
  "image/vnd.adobe.photoshop",
  "application/x-indesign",
  "application/epub+zip",
  "application/x-xpinstall",
  "application/vnd.ms-powerpoint.slideshow.macroenabled.12",
  "application/vnd.oasis.opendocument.text",
  "application/vnd.oasis.opendocument.spreadsheet",
  "application/vnd.oasis.opendocument.presentation",
  "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
  "application/vnd.openxmlformats-officedocument.presentationml.presentation",
  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
  "application/vnd.openxmlformats-officedocument.presentationml.slideshow",
  "application/zip",
  "application/x-tar",
  "application/x-rar-compressed",
  "application/gzip",
  "application/x-bzip2",
  "application/x-7z-compressed",
  "application/x-apple-diskimage",
  "application/vnd.apache.arrow.file",
  "video/mp4",
  "audio/midi",
  "video/matroska",
  "video/webm",
  "video/quicktime",
  "video/vnd.avi",
  "audio/wav",
  "audio/qcelp",
  "audio/x-ms-asf",
  "video/x-ms-asf",
  "application/vnd.ms-asf",
  "video/mpeg",
  "video/3gpp",
  "audio/mpeg",
  "audio/mp4",
  // RFC 4337
  "video/ogg",
  "audio/ogg",
  "audio/ogg; codecs=opus",
  "application/ogg",
  "audio/flac",
  "audio/ape",
  "audio/wavpack",
  "audio/amr",
  "application/pdf",
  "application/x-elf",
  "application/x-mach-binary",
  "application/x-msdownload",
  "application/x-shockwave-flash",
  "application/rtf",
  "application/wasm",
  "font/woff",
  "font/woff2",
  "application/vnd.ms-fontobject",
  "font/ttf",
  "font/otf",
  "font/collection",
  "image/x-icon",
  "video/x-flv",
  "application/postscript",
  "application/eps",
  "application/x-xz",
  "application/x-sqlite3",
  "application/x-nintendo-nes-rom",
  "application/x-google-chrome-extension",
  "application/vnd.ms-cab-compressed",
  "application/x-deb",
  "application/x-unix-archive",
  "application/x-rpm",
  "application/x-compress",
  "application/x-lzip",
  "application/x-cfb",
  "application/x-mie",
  "application/mxf",
  "video/mp2t",
  "application/x-blender",
  "image/bpg",
  "image/j2c",
  "image/jp2",
  "image/jpx",
  "image/jpm",
  "image/mj2",
  "audio/aiff",
  "application/xml",
  "application/x-mobipocket-ebook",
  "image/heif",
  "image/heif-sequence",
  "image/heic",
  "image/heic-sequence",
  "image/icns",
  "image/ktx",
  "application/dicom",
  "audio/x-musepack",
  "text/calendar",
  "text/vcard",
  "text/vtt",
  "model/gltf-binary",
  "application/vnd.tcpdump.pcap",
  "audio/x-dsf",
  // Non-standard
  "application/x.ms.shortcut",
  // Invented by us
  "application/x.apple.alias",
  // Invented by us
  "audio/x-voc",
  "audio/vnd.dolby.dd-raw",
  "audio/x-m4a",
  "image/apng",
  "image/x-olympus-orf",
  "image/x-sony-arw",
  "image/x-adobe-dng",
  "image/x-nikon-nef",
  "image/x-panasonic-rw2",
  "image/x-fujifilm-raf",
  "video/x-m4v",
  "video/3gpp2",
  "application/x-esri-shape",
  "audio/aac",
  "audio/x-it",
  "audio/x-s3m",
  "audio/x-xm",
  "video/MP1S",
  "video/MP2P",
  "application/vnd.sketchup.skp",
  "image/avif",
  "application/x-lzh-compressed",
  "application/pgp-encrypted",
  "application/x-asar",
  "model/stl",
  "application/vnd.ms-htmlhelp",
  "model/3mf",
  "image/jxl",
  "application/zstd",
  "image/jls",
  "application/vnd.ms-outlook",
  "image/vnd.dwg",
  "application/vnd.apache.parquet",
  "application/java-vm",
  "application/x-arj",
  "application/x-cpio",
  "application/x-ace-compressed",
  "application/avro",
  "application/vnd.iccprofile",
  "application/x.autodesk.fbx",
  // Invented by us
  "application/vnd.visio",
  "application/vnd.android.package-archive",
  "application/vnd.google.draco",
  // Invented by us
  "application/x-lz4",
  // Invented by us
  "application/vnd.openxmlformats-officedocument.presentationml.template",
  "application/vnd.openxmlformats-officedocument.spreadsheetml.template",
  "application/vnd.openxmlformats-officedocument.wordprocessingml.template",
  "application/vnd.ms-excel.template.macroenabled.12",
  "application/vnd.oasis.opendocument.text-template",
  "application/vnd.oasis.opendocument.spreadsheet-template",
  "application/vnd.oasis.opendocument.presentation-template",
  "application/vnd.oasis.opendocument.graphics",
  "application/vnd.oasis.opendocument.graphics-template",
  "application/vnd.ms-excel.sheet.macroenabled.12",
  "application/vnd.ms-word.document.macroenabled.12",
  "application/vnd.ms-word.template.macroenabled.12",
  "application/vnd.ms-powerpoint.template.macroenabled.12",
  "application/vnd.ms-powerpoint.presentation.macroenabled.12",
  "application/java-archive",
  "application/vnd.rn-realmedia",
  "application/x-ms-regedit",
  "application/x-ft-windows-registry-hive"
], em = 4100;
function Qy(t) {
  switch (t = t.toLowerCase(), t) {
    case "application/epub+zip":
      return {
        ext: "epub",
        mime: t
      };
    case "application/vnd.oasis.opendocument.text":
      return {
        ext: "odt",
        mime: t
      };
    case "application/vnd.oasis.opendocument.text-template":
      return {
        ext: "ott",
        mime: t
      };
    case "application/vnd.oasis.opendocument.spreadsheet":
      return {
        ext: "ods",
        mime: t
      };
    case "application/vnd.oasis.opendocument.spreadsheet-template":
      return {
        ext: "ots",
        mime: t
      };
    case "application/vnd.oasis.opendocument.presentation":
      return {
        ext: "odp",
        mime: t
      };
    case "application/vnd.oasis.opendocument.presentation-template":
      return {
        ext: "otp",
        mime: t
      };
    case "application/vnd.oasis.opendocument.graphics":
      return {
        ext: "odg",
        mime: t
      };
    case "application/vnd.oasis.opendocument.graphics-template":
      return {
        ext: "otg",
        mime: t
      };
    case "application/vnd.openxmlformats-officedocument.presentationml.slideshow":
      return {
        ext: "ppsx",
        mime: t
      };
    case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
      return {
        ext: "xlsx",
        mime: t
      };
    case "application/vnd.ms-excel.sheet.macroenabled":
      return {
        ext: "xlsm",
        mime: "application/vnd.ms-excel.sheet.macroenabled.12"
      };
    case "application/vnd.openxmlformats-officedocument.spreadsheetml.template":
      return {
        ext: "xltx",
        mime: t
      };
    case "application/vnd.ms-excel.template.macroenabled":
      return {
        ext: "xltm",
        mime: "application/vnd.ms-excel.template.macroenabled.12"
      };
    case "application/vnd.ms-powerpoint.slideshow.macroenabled":
      return {
        ext: "ppsm",
        mime: "application/vnd.ms-powerpoint.slideshow.macroenabled.12"
      };
    case "application/vnd.openxmlformats-officedocument.wordprocessingml.document":
      return {
        ext: "docx",
        mime: t
      };
    case "application/vnd.ms-word.document.macroenabled":
      return {
        ext: "docm",
        mime: "application/vnd.ms-word.document.macroenabled.12"
      };
    case "application/vnd.openxmlformats-officedocument.wordprocessingml.template":
      return {
        ext: "dotx",
        mime: t
      };
    case "application/vnd.ms-word.template.macroenabledtemplate":
      return {
        ext: "dotm",
        mime: "application/vnd.ms-word.template.macroenabled.12"
      };
    case "application/vnd.openxmlformats-officedocument.presentationml.template":
      return {
        ext: "potx",
        mime: t
      };
    case "application/vnd.ms-powerpoint.template.macroenabled":
      return {
        ext: "potm",
        mime: "application/vnd.ms-powerpoint.template.macroenabled.12"
      };
    case "application/vnd.openxmlformats-officedocument.presentationml.presentation":
      return {
        ext: "pptx",
        mime: t
      };
    case "application/vnd.ms-powerpoint.presentation.macroenabled":
      return {
        ext: "pptm",
        mime: "application/vnd.ms-powerpoint.presentation.macroenabled.12"
      };
    case "application/vnd.ms-visio.drawing":
      return {
        ext: "vsdx",
        mime: "application/vnd.visio"
      };
    case "application/vnd.ms-package.3dmanufacturing-3dmodel+xml":
      return {
        ext: "3mf",
        mime: "model/3mf"
      };
  }
}
function _o(t, e, n) {
  n = {
    offset: 0,
    ...n
  };
  for (const [r, i] of e.entries())
    if (n.mask) {
      if (i !== (n.mask[r] & t[r + n.offset]))
        return !1;
    } else if (i !== t[r + n.offset])
      return !1;
  return !0;
}
let w7 = class {
  constructor(e) {
    this.options = {
      mpegOffsetTolerance: 0,
      ...e
    }, this.detectors = [
      ...e?.customDetectors ?? [],
      { id: "core", detect: this.detectConfident },
      { id: "core.imprecise", detect: this.detectImprecise }
    ], this.tokenizerOptions = {
      abortSignal: e?.signal
    };
  }
  async fromTokenizer(e) {
    const n = e.position;
    for (const r of this.detectors) {
      const i = await r.detect(e);
      if (i)
        return i;
      if (n !== e.position)
        return;
    }
  }
  async fromBuffer(e) {
    if (!(e instanceof Uint8Array || e instanceof ArrayBuffer))
      throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``);
    const n = e instanceof Uint8Array ? e : new Uint8Array(e);
    if (n?.length > 1)
      return this.fromTokenizer(wj(n, this.tokenizerOptions));
  }
  async fromBlob(e) {
    const n = Sj(e, this.tokenizerOptions);
    try {
      return await this.fromTokenizer(n);
    } finally {
      await n.close();
    }
  }
  async fromStream(e) {
    const n = c6(e, this.tokenizerOptions);
    try {
      return await this.fromTokenizer(n);
    } finally {
      await n.close();
    }
  }
  async toDetectionStream(e, n) {
    const { sampleSize: r = em } = n;
    let i, o;
    const s = e.getReader({ mode: "byob" });
    try {
      const { value: u, done: l } = await s.read(new Uint8Array(r));
      if (o = u, !l && u)
        try {
          i = await this.fromBuffer(u.subarray(0, r));
        } catch (d) {
          if (!(d instanceof rr))
            throw d;
          i = void 0;
        }
      o = u;
    } finally {
      s.releaseLock();
    }
    const a = new TransformStream({
      async start(u) {
        u.enqueue(o);
      },
      transform(u, l) {
        l.enqueue(u);
      }
    }), c = e.pipeThrough(a);
    return c.fileType = i, c;
  }
  check(e, n) {
    return _o(this.buffer, e, n);
  }
  checkString(e, n) {
    return this.check(g7(e, n?.encoding), n);
  }
  // Detections with a high degree of certainty in identifying the correct file type
  detectConfident = async (e) => {
    if (this.buffer = new Uint8Array(em), e.fileInfo.size === void 0 && (e.fileInfo.size = Number.MAX_SAFE_INTEGER), this.tokenizer = e, await e.peekBuffer(this.buffer, { length: 32, mayBeLess: !0 }), this.check([66, 77]))
      return {
        ext: "bmp",
        mime: "image/bmp"
      };
    if (this.check([11, 119]))
      return {
        ext: "ac3",
        mime: "audio/vnd.dolby.dd-raw"
      };
    if (this.check([120, 1]))
      return {
        ext: "dmg",
        mime: "application/x-apple-diskimage"
      };
    if (this.check([77, 90]))
      return {
        ext: "exe",
        mime: "application/x-msdownload"
      };
    if (this.check([37, 33]))
      return await e.peekBuffer(this.buffer, { length: 24, mayBeLess: !0 }), this.checkString("PS-Adobe-", { offset: 2 }) && this.checkString(" EPSF-", { offset: 14 }) ? {
        ext: "eps",
        mime: "application/eps"
      } : {
        ext: "ps",
        mime: "application/postscript"
      };
    if (this.check([31, 160]) || this.check([31, 157]))
      return {
        ext: "Z",
        mime: "application/x-compress"
      };
    if (this.check([199, 113]))
      return {
        ext: "cpio",
        mime: "application/x-cpio"
      };
    if (this.check([96, 234]))
      return {
        ext: "arj",
        mime: "application/x-arj"
      };
    if (this.check([239, 187, 191]))
      return this.tokenizer.ignore(3), this.detectConfident(e);
    if (this.check([71, 73, 70]))
      return {
        ext: "gif",
        mime: "image/gif"
      };
    if (this.check([73, 73, 188]))
      return {
        ext: "jxr",
        mime: "image/vnd.ms-photo"
      };
    if (this.check([31, 139, 8])) {
      const r = new m7(e).inflate();
      try {
        const i = await this.fromStream(r);
        if (i && i.ext === "tar")
          return {
            ext: "tar.gz",
            mime: "application/gzip"
          };
      } finally {
        await r.cancel();
      }
      return {
        ext: "gz",
        mime: "application/gzip"
      };
    }
    if (this.check([66, 90, 104]))
      return {
        ext: "bz2",
        mime: "application/x-bzip2"
      };
    if (this.checkString("ID3")) {
      await e.ignore(6);
      const n = await e.readToken(v7);
      return e.position + n > e.fileInfo.size ? {
        ext: "mp3",
        mime: "audio/mpeg"
      } : (await e.ignore(n), this.fromTokenizer(e));
    }
    if (this.checkString("MP+"))
      return {
        ext: "mpc",
        mime: "audio/x-musepack"
      };
    if ((this.buffer[0] === 67 || this.buffer[0] === 70) && this.check([87, 83], { offset: 1 }))
      return {
        ext: "swf",
        mime: "application/x-shockwave-flash"
      };
    if (this.check([255, 216, 255]))
      return this.check([247], { offset: 3 }) ? {
        ext: "jls",
        mime: "image/jls"
      } : {
        ext: "jpg",
        mime: "image/jpeg"
      };
    if (this.check([79, 98, 106, 1]))
      return {
        ext: "avro",
        mime: "application/avro"
      };
    if (this.checkString("FLIF"))
      return {
        ext: "flif",
        mime: "image/flif"
      };
    if (this.checkString("8BPS"))
      return {
        ext: "psd",
        mime: "image/vnd.adobe.photoshop"
      };
    if (this.checkString("MPCK"))
      return {
        ext: "mpc",
        mime: "audio/x-musepack"
      };
    if (this.checkString("FORM"))
      return {
        ext: "aif",
        mime: "audio/aiff"
      };
    if (this.checkString("icns", { offset: 0 }))
      return {
        ext: "icns",
        mime: "image/icns"
      };
    if (this.check([80, 75, 3, 4])) {
      let n;
      return await new d7(e).unzip((r) => {
        switch (r.filename) {
          case "META-INF/mozilla.rsa":
            return n = {
              ext: "xpi",
              mime: "application/x-xpinstall"
            }, {
              stop: !0
            };
          case "META-INF/MANIFEST.MF":
            return n = {
              ext: "jar",
              mime: "application/java-archive"
            }, {
              stop: !0
            };
          case "mimetype":
            return {
              async handler(i) {
                const o = new TextDecoder("utf-8").decode(i).trim();
                n = Qy(o);
              },
              stop: !0
            };
          case "[Content_Types].xml":
            return {
              async handler(i) {
                let o = new TextDecoder("utf-8").decode(i);
                const s = o.indexOf('.main+xml"');
                if (s === -1) {
                  const a = "application/vnd.ms-package.3dmanufacturing-3dmodel+xml";
                  o.includes(`ContentType="${a}"`) && (n = Qy(a));
                } else {
                  o = o.slice(0, Math.max(0, s));
                  const a = o.lastIndexOf('"'), c = o.slice(Math.max(0, a + 1));
                  n = Qy(c);
                }
              },
              stop: !0
            };
          default:
            return /classes\d*\.dex/.test(r.filename) ? (n = {
              ext: "apk",
              mime: "application/vnd.android.package-archive"
            }, { stop: !0 }) : {};
        }
      }).catch((r) => {
        if (!(r instanceof rr))
          throw r;
      }), n ?? {
        ext: "zip",
        mime: "application/zip"
      };
    }
    if (this.checkString("OggS")) {
      await e.ignore(28);
      const n = new Uint8Array(8);
      return await e.readBuffer(n), _o(n, [79, 112, 117, 115, 72, 101, 97, 100]) ? {
        ext: "opus",
        mime: "audio/ogg; codecs=opus"
      } : _o(n, [128, 116, 104, 101, 111, 114, 97]) ? {
        ext: "ogv",
        mime: "video/ogg"
      } : _o(n, [1, 118, 105, 100, 101, 111, 0]) ? {
        ext: "ogm",
        mime: "video/ogg"
      } : _o(n, [127, 70, 76, 65, 67]) ? {
        ext: "oga",
        mime: "audio/ogg"
      } : _o(n, [83, 112, 101, 101, 120, 32, 32]) ? {
        ext: "spx",
        mime: "audio/ogg"
      } : _o(n, [1, 118, 111, 114, 98, 105, 115]) ? {
        ext: "ogg",
        mime: "audio/ogg"
      } : {
        ext: "ogx",
        mime: "application/ogg"
      };
    }
    if (this.check([80, 75]) && (this.buffer[2] === 3 || this.buffer[2] === 5 || this.buffer[2] === 7) && (this.buffer[3] === 4 || this.buffer[3] === 6 || this.buffer[3] === 8))
      return {
        ext: "zip",
        mime: "application/zip"
      };
    if (this.checkString("MThd"))
      return {
        ext: "mid",
        mime: "audio/midi"
      };
    if (this.checkString("wOFF") && (this.check([0, 1, 0, 0], { offset: 4 }) || this.checkString("OTTO", { offset: 4 })))
      return {
        ext: "woff",
        mime: "font/woff"
      };
    if (this.checkString("wOF2") && (this.check([0, 1, 0, 0], { offset: 4 }) || this.checkString("OTTO", { offset: 4 })))
      return {
        ext: "woff2",
        mime: "font/woff2"
      };
    if (this.check([212, 195, 178, 161]) || this.check([161, 178, 195, 212]))
      return {
        ext: "pcap",
        mime: "application/vnd.tcpdump.pcap"
      };
    if (this.checkString("DSD "))
      return {
        ext: "dsf",
        mime: "audio/x-dsf"
        // Non-standard
      };
    if (this.checkString("LZIP"))
      return {
        ext: "lz",
        mime: "application/x-lzip"
      };
    if (this.checkString("fLaC"))
      return {
        ext: "flac",
        mime: "audio/flac"
      };
    if (this.check([66, 80, 71, 251]))
      return {
        ext: "bpg",
        mime: "image/bpg"
      };
    if (this.checkString("wvpk"))
      return {
        ext: "wv",
        mime: "audio/wavpack"
      };
    if (this.checkString("%PDF"))
      return {
        ext: "pdf",
        mime: "application/pdf"
      };
    if (this.check([0, 97, 115, 109]))
      return {
        ext: "wasm",
        mime: "application/wasm"
      };
    if (this.check([73, 73])) {
      const n = await this.readTiffHeader(!1);
      if (n)
        return n;
    }
    if (this.check([77, 77])) {
      const n = await this.readTiffHeader(!0);
      if (n)
        return n;
    }
    if (this.checkString("MAC "))
      return {
        ext: "ape",
        mime: "audio/ape"
      };
    if (this.check([26, 69, 223, 163])) {
      async function n() {
        const a = await e.peekNumber(Dj);
        let c = 128, u = 0;
        for (; (a & c) === 0 && c !== 0; )
          ++u, c >>= 1;
        const l = new Uint8Array(u + 1);
        return await e.readBuffer(l), l;
      }
      async function r() {
        const a = await n(), c = await n();
        c[0] ^= 128 >> c.length - 1;
        const u = Math.min(6, c.length), l = new DataView(a.buffer), d = new DataView(c.buffer, c.length - u, u);
        return {
          id: jI(l),
          len: jI(d)
        };
      }
      async function i(a) {
        for (; a > 0; ) {
          const c = await r();
          if (c.id === 17026)
            return (await e.readToken(new Yo(c.len))).replaceAll(/\00.*$/g, "");
          await e.ignore(c.len), --a;
        }
      }
      const o = await r();
      switch (await i(o.len)) {
        case "webm":
          return {
            ext: "webm",
            mime: "video/webm"
          };
        case "matroska":
          return {
            ext: "mkv",
            mime: "video/matroska"
          };
        default:
          return;
      }
    }
    if (this.checkString("SQLi"))
      return {
        ext: "sqlite",
        mime: "application/x-sqlite3"
      };
    if (this.check([78, 69, 83, 26]))
      return {
        ext: "nes",
        mime: "application/x-nintendo-nes-rom"
      };
    if (this.checkString("Cr24"))
      return {
        ext: "crx",
        mime: "application/x-google-chrome-extension"
      };
    if (this.checkString("MSCF") || this.checkString("ISc("))
      return {
        ext: "cab",
        mime: "application/vnd.ms-cab-compressed"
      };
    if (this.check([237, 171, 238, 219]))
      return {
        ext: "rpm",
        mime: "application/x-rpm"
      };
    if (this.check([197, 208, 211, 198]))
      return {
        ext: "eps",
        mime: "application/eps"
      };
    if (this.check([40, 181, 47, 253]))
      return {
        ext: "zst",
        mime: "application/zstd"
      };
    if (this.check([127, 69, 76, 70]))
      return {
        ext: "elf",
        mime: "application/x-elf"
      };
    if (this.check([33, 66, 68, 78]))
      return {
        ext: "pst",
        mime: "application/vnd.ms-outlook"
      };
    if (this.checkString("PAR1") || this.checkString("PARE"))
      return {
        ext: "parquet",
        mime: "application/vnd.apache.parquet"
      };
    if (this.checkString("ttcf"))
      return {
        ext: "ttc",
        mime: "font/collection"
      };
    if (this.check([207, 250, 237, 254]))
      return {
        ext: "macho",
        mime: "application/x-mach-binary"
      };
    if (this.check([4, 34, 77, 24]))
      return {
        ext: "lz4",
        mime: "application/x-lz4"
        // Invented by us
      };
    if (this.checkString("regf"))
      return {
        ext: "dat",
        mime: "application/x-ft-windows-registry-hive"
      };
    if (this.check([79, 84, 84, 79, 0]))
      return {
        ext: "otf",
        mime: "font/otf"
      };
    if (this.checkString("#!AMR"))
      return {
        ext: "amr",
        mime: "audio/amr"
      };
    if (this.checkString("{\\rtf"))
      return {
        ext: "rtf",
        mime: "application/rtf"
      };
    if (this.check([70, 76, 86, 1]))
      return {
        ext: "flv",
        mime: "video/x-flv"
      };
    if (this.checkString("IMPM"))
      return {
        ext: "it",
        mime: "audio/x-it"
      };
    if (this.checkString("-lh0-", { offset: 2 }) || this.checkString("-lh1-", { offset: 2 }) || this.checkString("-lh2-", { offset: 2 }) || this.checkString("-lh3-", { offset: 2 }) || this.checkString("-lh4-", { offset: 2 }) || this.checkString("-lh5-", { offset: 2 }) || this.checkString("-lh6-", { offset: 2 }) || this.checkString("-lh7-", { offset: 2 }) || this.checkString("-lzs-", { offset: 2 }) || this.checkString("-lz4-", { offset: 2 }) || this.checkString("-lz5-", { offset: 2 }) || this.checkString("-lhd-", { offset: 2 }))
      return {
        ext: "lzh",
        mime: "application/x-lzh-compressed"
      };
    if (this.check([0, 0, 1, 186])) {
      if (this.check([33], { offset: 4, mask: [241] }))
        return {
          ext: "mpg",
          // May also be .ps, .mpeg
          mime: "video/MP1S"
        };
      if (this.check([68], { offset: 4, mask: [196] }))
        return {
          ext: "mpg",
          // May also be .mpg, .m2p, .vob or .sub
          mime: "video/MP2P"
        };
    }
    if (this.checkString("ITSF"))
      return {
        ext: "chm",
        mime: "application/vnd.ms-htmlhelp"
      };
    if (this.check([202, 254, 186, 190]))
      return {
        ext: "class",
        mime: "application/java-vm"
      };
    if (this.checkString(".RMF"))
      return {
        ext: "rm",
        mime: "application/vnd.rn-realmedia"
      };
    if (this.checkString("DRACO"))
      return {
        ext: "drc",
        mime: "application/vnd.google.draco"
        // Invented by us
      };
    if (this.check([253, 55, 122, 88, 90, 0]))
      return {
        ext: "xz",
        mime: "application/x-xz"
      };
    if (this.checkString("<?xml "))
      return {
        ext: "xml",
        mime: "application/xml"
      };
    if (this.check([55, 122, 188, 175, 39, 28]))
      return {
        ext: "7z",
        mime: "application/x-7z-compressed"
      };
    if (this.check([82, 97, 114, 33, 26, 7]) && (this.buffer[6] === 0 || this.buffer[6] === 1))
      return {
        ext: "rar",
        mime: "application/x-rar-compressed"
      };
    if (this.checkString("solid "))
      return {
        ext: "stl",
        mime: "model/stl"
      };
    if (this.checkString("AC")) {
      const n = new Yo(4, "latin1").get(this.buffer, 2);
      if (n.match("^d*") && n >= 1e3 && n <= 1050)
        return {
          ext: "dwg",
          mime: "image/vnd.dwg"
        };
    }
    if (this.checkString("070707"))
      return {
        ext: "cpio",
        mime: "application/x-cpio"
      };
    if (this.checkString("BLENDER"))
      return {
        ext: "blend",
        mime: "application/x-blender"
      };
    if (this.checkString("!<arch>"))
      return await e.ignore(8), await e.readToken(new Yo(13, "ascii")) === "debian-binary" ? {
        ext: "deb",
        mime: "application/x-deb"
      } : {
        ext: "ar",
        mime: "application/x-unix-archive"
      };
    if (this.checkString("WEBVTT") && // One of LF, CR, tab, space, or end of file must follow "WEBVTT" per the spec (see `fixture/fixture-vtt-*.vtt` for examples). Note that `\0` is technically the null character (there is no such thing as an EOF character). However, checking for `\0` gives us the same result as checking for the end of the stream.
    [`
`, "\r", "	", " ", "\0"].some((n) => this.checkString(n, { offset: 6 })))
      return {
        ext: "vtt",
        mime: "text/vtt"
      };
    if (this.check([137, 80, 78, 71, 13, 10, 26, 10])) {
      await e.ignore(8);
      async function n() {
        return {
          length: await e.readToken(Oj),
          type: await e.readToken(new Yo(4, "latin1"))
        };
      }
      do {
        const r = await n();
        if (r.length < 0)
          return;
        switch (r.type) {
          case "IDAT":
            return {
              ext: "png",
              mime: "image/png"
            };
          case "acTL":
            return {
              ext: "apng",
              mime: "image/apng"
            };
          default:
            await e.ignore(r.length + 4);
        }
      } while (e.position + 8 < e.fileInfo.size);
      return {
        ext: "png",
        mime: "image/png"
      };
    }
    if (this.check([65, 82, 82, 79, 87, 49, 0, 0]))
      return {
        ext: "arrow",
        mime: "application/vnd.apache.arrow.file"
      };
    if (this.check([103, 108, 84, 70, 2, 0, 0, 0]))
      return {
        ext: "glb",
        mime: "model/gltf-binary"
      };
    if (this.check([102, 114, 101, 101], { offset: 4 }) || this.check([109, 100, 97, 116], { offset: 4 }) || this.check([109, 111, 111, 118], { offset: 4 }) || this.check([119, 105, 100, 101], { offset: 4 }))
      return {
        ext: "mov",
        mime: "video/quicktime"
      };
    if (this.check([73, 73, 82, 79, 8, 0, 0, 0, 24]))
      return {
        ext: "orf",
        mime: "image/x-olympus-orf"
      };
    if (this.checkString("gimp xcf "))
      return {
        ext: "xcf",
        mime: "image/x-xcf"
      };
    if (this.checkString("ftyp", { offset: 4 }) && (this.buffer[8] & 96) !== 0) {
      const n = new Yo(4, "latin1").get(this.buffer, 8).replace("\0", " ").trim();
      switch (n) {
        case "avif":
        case "avis":
          return { ext: "avif", mime: "image/avif" };
        case "mif1":
          return { ext: "heic", mime: "image/heif" };
        case "msf1":
          return { ext: "heic", mime: "image/heif-sequence" };
        case "heic":
        case "heix":
          return { ext: "heic", mime: "image/heic" };
        case "hevc":
        case "hevx":
          return { ext: "heic", mime: "image/heic-sequence" };
        case "qt":
          return { ext: "mov", mime: "video/quicktime" };
        case "M4V":
        case "M4VH":
        case "M4VP":
          return { ext: "m4v", mime: "video/x-m4v" };
        case "M4P":
          return { ext: "m4p", mime: "video/mp4" };
        case "M4B":
          return { ext: "m4b", mime: "audio/mp4" };
        case "M4A":
          return { ext: "m4a", mime: "audio/x-m4a" };
        case "F4V":
          return { ext: "f4v", mime: "video/mp4" };
        case "F4P":
          return { ext: "f4p", mime: "video/mp4" };
        case "F4A":
          return { ext: "f4a", mime: "audio/mp4" };
        case "F4B":
          return { ext: "f4b", mime: "audio/mp4" };
        case "crx":
          return { ext: "cr3", mime: "image/x-canon-cr3" };
        default:
          return n.startsWith("3g") ? n.startsWith("3g2") ? { ext: "3g2", mime: "video/3gpp2" } : { ext: "3gp", mime: "video/3gpp" } : { ext: "mp4", mime: "video/mp4" };
      }
    }
    if (this.checkString(`REGEDIT4\r
`))
      return {
        ext: "reg",
        mime: "application/x-ms-regedit"
      };
    if (this.check([82, 73, 70, 70])) {
      if (this.checkString("WEBP", { offset: 8 }))
        return {
          ext: "webp",
          mime: "image/webp"
        };
      if (this.check([65, 86, 73], { offset: 8 }))
        return {
          ext: "avi",
          mime: "video/vnd.avi"
        };
      if (this.check([87, 65, 86, 69], { offset: 8 }))
        return {
          ext: "wav",
          mime: "audio/wav"
        };
      if (this.check([81, 76, 67, 77], { offset: 8 }))
        return {
          ext: "qcp",
          mime: "audio/qcelp"
        };
    }
    if (this.check([73, 73, 85, 0, 24, 0, 0, 0, 136, 231, 116, 216]))
      return {
        ext: "rw2",
        mime: "image/x-panasonic-rw2"
      };
    if (this.check([48, 38, 178, 117, 142, 102, 207, 17, 166, 217])) {
      async function n() {
        const r = new Uint8Array(16);
        return await e.readBuffer(r), {
          id: r,
          size: Number(await e.readToken(Mj))
        };
      }
      for (await e.ignore(30); e.position + 24 < e.fileInfo.size; ) {
        const r = await n();
        let i = r.size - 24;
        if (_o(r.id, [145, 7, 220, 183, 183, 169, 207, 17, 142, 230, 0, 192, 12, 32, 83, 101])) {
          const o = new Uint8Array(16);
          if (i -= await e.readBuffer(o), _o(o, [64, 158, 105, 248, 77, 91, 207, 17, 168, 253, 0, 128, 95, 92, 68, 43]))
            return {
              ext: "asf",
              mime: "audio/x-ms-asf"
            };
          if (_o(o, [192, 239, 25, 188, 77, 91, 207, 17, 168, 253, 0, 128, 95, 92, 68, 43]))
            return {
              ext: "asf",
              mime: "video/x-ms-asf"
            };
          break;
        }
        await e.ignore(i);
      }
      return {
        ext: "asf",
        mime: "application/vnd.ms-asf"
      };
    }
    if (this.check([171, 75, 84, 88, 32, 49, 49, 187, 13, 10, 26, 10]))
      return {
        ext: "ktx",
        mime: "image/ktx"
      };
    if ((this.check([126, 16, 4]) || this.check([126, 24, 4])) && this.check([48, 77, 73, 69], { offset: 4 }))
      return {
        ext: "mie",
        mime: "application/x-mie"
      };
    if (this.check([39, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], { offset: 2 }))
      return {
        ext: "shp",
        mime: "application/x-esri-shape"
      };
    if (this.check([255, 79, 255, 81]))
      return {
        ext: "j2c",
        mime: "image/j2c"
      };
    if (this.check([0, 0, 0, 12, 106, 80, 32, 32, 13, 10, 135, 10]))
      switch (await e.ignore(20), await e.readToken(new Yo(4, "ascii"))) {
        case "jp2 ":
          return {
            ext: "jp2",
            mime: "image/jp2"
          };
        case "jpx ":
          return {
            ext: "jpx",
            mime: "image/jpx"
          };
        case "jpm ":
          return {
            ext: "jpm",
            mime: "image/jpm"
          };
        case "mjp2":
          return {
            ext: "mj2",
            mime: "image/mj2"
          };
        default:
          return;
      }
    if (this.check([255, 10]) || this.check([0, 0, 0, 12, 74, 88, 76, 32, 13, 10, 135, 10]))
      return {
        ext: "jxl",
        mime: "image/jxl"
      };
    if (this.check([254, 255]))
      return this.checkString("<?xml ", { offset: 2, encoding: "utf-16be" }) ? {
        ext: "xml",
        mime: "application/xml"
      } : void 0;
    if (this.check([208, 207, 17, 224, 161, 177, 26, 225]))
      return {
        ext: "cfb",
        mime: "application/x-cfb"
      };
    if (await e.peekBuffer(this.buffer, { length: Math.min(256, e.fileInfo.size), mayBeLess: !0 }), this.check([97, 99, 115, 112], { offset: 36 }))
      return {
        ext: "icc",
        mime: "application/vnd.iccprofile"
      };
    if (this.checkString("**ACE", { offset: 7 }) && this.checkString("**", { offset: 12 }))
      return {
        ext: "ace",
        mime: "application/x-ace-compressed"
      };
    if (this.checkString("BEGIN:")) {
      if (this.checkString("VCARD", { offset: 6 }))
        return {
          ext: "vcf",
          mime: "text/vcard"
        };
      if (this.checkString("VCALENDAR", { offset: 6 }))
        return {
          ext: "ics",
          mime: "text/calendar"
        };
    }
    if (this.checkString("FUJIFILMCCD-RAW"))
      return {
        ext: "raf",
        mime: "image/x-fujifilm-raf"
      };
    if (this.checkString("Extended Module:"))
      return {
        ext: "xm",
        mime: "audio/x-xm"
      };
    if (this.checkString("Creative Voice File"))
      return {
        ext: "voc",
        mime: "audio/x-voc"
      };
    if (this.check([4, 0, 0, 0]) && this.buffer.length >= 16) {
      const n = new DataView(this.buffer.buffer).getUint32(12, !0);
      if (n > 12 && this.buffer.length >= n + 16)
        try {
          const r = new TextDecoder().decode(this.buffer.subarray(16, n + 16));
          if (JSON.parse(r).files)
            return {
              ext: "asar",
              mime: "application/x-asar"
            };
        } catch {
        }
    }
    if (this.check([6, 14, 43, 52, 2, 5, 1, 1, 13, 1, 2, 1, 1, 2]))
      return {
        ext: "mxf",
        mime: "application/mxf"
      };
    if (this.checkString("SCRM", { offset: 44 }))
      return {
        ext: "s3m",
        mime: "audio/x-s3m"
      };
    if (this.check([71]) && this.check([71], { offset: 188 }))
      return {
        ext: "mts",
        mime: "video/mp2t"
      };
    if (this.check([71], { offset: 4 }) && this.check([71], { offset: 196 }))
      return {
        ext: "mts",
        mime: "video/mp2t"
      };
    if (this.check([66, 79, 79, 75, 77, 79, 66, 73], { offset: 60 }))
      return {
        ext: "mobi",
        mime: "application/x-mobipocket-ebook"
      };
    if (this.check([68, 73, 67, 77], { offset: 128 }))
      return {
        ext: "dcm",
        mime: "application/dicom"
      };
    if (this.check([76, 0, 0, 0, 1, 20, 2, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 70]))
      return {
        ext: "lnk",
        mime: "application/x.ms.shortcut"
        // Invented by us
      };
    if (this.check([98, 111, 111, 107, 0, 0, 0, 0, 109, 97, 114, 107, 0, 0, 0, 0]))
      return {
        ext: "alias",
        mime: "application/x.apple.alias"
        // Invented by us
      };
    if (this.checkString("Kaydara FBX Binary  \0"))
      return {
        ext: "fbx",
        mime: "application/x.autodesk.fbx"
        // Invented by us
      };
    if (this.check([76, 80], { offset: 34 }) && (this.check([0, 0, 1], { offset: 8 }) || this.check([1, 0, 2], { offset: 8 }) || this.check([2, 0, 2], { offset: 8 })))
      return {
        ext: "eot",
        mime: "application/vnd.ms-fontobject"
      };
    if (this.check([6, 6, 237, 245, 216, 29, 70, 229, 189, 49, 239, 231, 254, 116, 183, 29]))
      return {
        ext: "indd",
        mime: "application/x-indesign"
      };
    if (await e.peekBuffer(this.buffer, { length: Math.min(512, e.fileInfo.size), mayBeLess: !0 }), this.checkString("ustar", { offset: 257 }) && (this.checkString("\0", { offset: 262 }) || this.checkString(" ", { offset: 262 })) || this.check([0, 0, 0, 0, 0, 0], { offset: 257 }) && y7(this.buffer))
      return {
        ext: "tar",
        mime: "application/x-tar"
      };
    if (this.check([255, 254])) {
      const n = "utf-16le";
      return this.checkString("<?xml ", { offset: 2, encoding: n }) ? {
        ext: "xml",
        mime: "application/xml"
      } : this.check([255, 14], { offset: 2 }) && this.checkString("SketchUp Model", { offset: 4, encoding: n }) ? {
        ext: "skp",
        mime: "application/vnd.sketchup.skp"
      } : this.checkString(`Windows Registry Editor Version 5.00\r
`, { offset: 2, encoding: n }) ? {
        ext: "reg",
        mime: "application/x-ms-regedit"
      } : void 0;
    }
    if (this.checkString("-----BEGIN PGP MESSAGE-----"))
      return {
        ext: "pgp",
        mime: "application/pgp-encrypted"
      };
  };
  // Detections with limited supporting data, resulting in a higher likelihood of false positives
  detectImprecise = async (e) => {
    if (this.buffer = new Uint8Array(em), await e.peekBuffer(this.buffer, { length: Math.min(8, e.fileInfo.size), mayBeLess: !0 }), this.check([0, 0, 1, 186]) || this.check([0, 0, 1, 179]))
      return {
        ext: "mpg",
        mime: "video/mpeg"
      };
    if (this.check([0, 1, 0, 0, 0]))
      return {
        ext: "ttf",
        mime: "font/ttf"
      };
    if (this.check([0, 0, 1, 0]))
      return {
        ext: "ico",
        mime: "image/x-icon"
      };
    if (this.check([0, 0, 2, 0]))
      return {
        ext: "cur",
        mime: "image/x-icon"
      };
    if (await e.peekBuffer(this.buffer, { length: Math.min(2 + this.options.mpegOffsetTolerance, e.fileInfo.size), mayBeLess: !0 }), this.buffer.length >= 2 + this.options.mpegOffsetTolerance)
      for (let n = 0; n <= this.options.mpegOffsetTolerance; ++n) {
        const r = this.scanMpeg(n);
        if (r)
          return r;
      }
  };
  async readTiffTag(e) {
    const n = await this.tokenizer.readToken(e ? kl : pn);
    switch (this.tokenizer.ignore(10), n) {
      case 50341:
        return {
          ext: "arw",
          mime: "image/x-sony-arw"
        };
      case 50706:
        return {
          ext: "dng",
          mime: "image/x-adobe-dng"
        };
    }
  }
  async readTiffIFD(e) {
    const n = await this.tokenizer.readToken(e ? kl : pn);
    for (let r = 0; r < n; ++r) {
      const i = await this.readTiffTag(e);
      if (i)
        return i;
    }
  }
  async readTiffHeader(e) {
    const n = (e ? kl : pn).get(this.buffer, 2), r = (e ? Fj : Gn).get(this.buffer, 4);
    if (n === 42) {
      if (r >= 6) {
        if (this.checkString("CR", { offset: 8 }))
          return {
            ext: "cr2",
            mime: "image/x-canon-cr2"
          };
        if (r >= 8) {
          const o = (e ? kl : pn).get(this.buffer, 8), s = (e ? kl : pn).get(this.buffer, 10);
          if (o === 28 && s === 254 || o === 31 && s === 11)
            return {
              ext: "nef",
              mime: "image/x-nikon-nef"
            };
        }
      }
      return await this.tokenizer.ignore(r), await this.readTiffIFD(e) ?? {
        ext: "tif",
        mime: "image/tiff"
      };
    }
    if (n === 43)
      return {
        ext: "tif",
        mime: "image/tiff"
      };
  }
  /**
  	Scan check MPEG 1 or 2 Layer 3 header, or 'layer 0' for ADTS (MPEG sync-word 0xFFE).
  
  	@param offset - Offset to scan for sync-preamble.
  	@returns {{ext: string, mime: string}}
  	*/
  scanMpeg(e) {
    if (this.check([255, 224], { offset: e, mask: [255, 224] })) {
      if (this.check([16], { offset: e + 1, mask: [22] }))
        return this.check([8], { offset: e + 1, mask: [8] }) ? {
          ext: "aac",
          mime: "audio/aac"
        } : {
          ext: "aac",
          mime: "audio/aac"
        };
      if (this.check([2], { offset: e + 1, mask: [6] }))
        return {
          ext: "mp3",
          mime: "audio/mpeg"
        };
      if (this.check([4], { offset: e + 1, mask: [6] }))
        return {
          ext: "mp2",
          mime: "audio/mpeg"
        };
      if (this.check([6], { offset: e + 1, mask: [6] }))
        return {
          ext: "mp1",
          mime: "audio/mpeg"
        };
    }
  }
};
new Set(b7);
new Set(x7);
class S7 extends w7 {
  async fromStream(e) {
    const n = await (e instanceof oL ? c6(e, this.tokenizerOptions) : _j(e, this.tokenizerOptions));
    try {
      return await super.fromTokenizer(n);
    } finally {
      await n.close();
    }
  }
  async fromFile(e) {
    const n = await Ej(e);
    try {
      return await super.fromTokenizer(n);
    } finally {
      await n.close();
    }
  }
  async toDetectionStream(e, n = {}) {
    if (!(e instanceof aO))
      return super.toDetectionStream(e, n);
    const { sampleSize: r = em } = n;
    return new Promise((i, o) => {
      e.on("error", o), e.once("readable", () => {
        (async () => {
          try {
            const s = new cL(), a = H2 ? H2(e, s, () => {
            }) : e.pipe(s), c = e.read(r) ?? e.read() ?? new Uint8Array(0);
            try {
              s.fileType = await this.fromBuffer(c);
            } catch (u) {
              u instanceof rr ? s.fileType = void 0 : o(u);
            }
            i(a);
          } catch (s) {
            o(s);
          }
        })();
      });
    });
  }
}
async function Cd(t, e) {
  return new S7(e).fromFile(t, e);
}
class ln {
  // 适用于获取服务器下发cookies时获取，仅GET
  static async HttpsGetCookies(e) {
    const n = e.startsWith("https") ? W2 : Gp;
    return new Promise((r, i) => {
      n.get(e, (s) => {
        const a = {};
        s.on("data", () => {
        }), s.on("end", () => {
          this.handleRedirect(s, e, a).then(r).catch(i);
        }), s.headers["set-cookie"] && this.extractCookies(s.headers["set-cookie"], a);
      }).on("error", (s) => {
        i(s);
      });
    });
  }
  static async handleRedirect(e, n, r) {
    if ((e.statusCode === 301 || e.statusCode === 302) && e.headers.location) {
      const i = new URL(e.headers.location, n), o = await this.HttpsGetCookies(i.href);
      return { ...r, ...o };
    }
    return r;
  }
  static extractCookies(e, n) {
    e.forEach((r) => {
      const i = r.split(";")[0]?.split("=");
      if (i) {
        const o = i[0], s = i[1];
        o && s && o.length > 0 && s.length > 0 && (n[o] = s);
      }
    });
  }
  // 请求和回复都是JSON data传原始内容 自动编码json
  // 支持 301/302 重定向（最多 5 次）
  static async HttpGetJson(e, n = "GET", r, i = {}, o = !0, s = !0, a = 5) {
    const c = new URL(e), u = e.startsWith("https://") ? W2 : Gp, l = {
      hostname: c.hostname,
      port: c.port,
      path: c.pathname + c.search,
      method: n,
      headers: i
    };
    return new Promise((d, f) => {
      const m = u.request(l, (h) => {
        if ((h.statusCode === 301 || h.statusCode === 302 || h.statusCode === 307 || h.statusCode === 308) && h.headers.location) {
          if (a <= 0) {
            f(new Error("Too many redirects"));
            return;
          }
          const x = new URL(h.headers.location, e).href;
          this.HttpGetJson(x, n, r, i, o, s, a - 1).then(d).catch(f);
          return;
        }
        let y = "";
        h.on("data", (x) => {
          y += x.toString();
        }), h.on("end", () => {
          try {
            if (h.statusCode && h.statusCode >= 200 && h.statusCode < 300)
              if (o) {
                const x = JSON.parse(y);
                d(x);
              } else
                d(y);
            else
              f(new Error(`Unexpected status code: ${h.statusCode}`));
          } catch (x) {
            f(new Error(x.message));
          }
        });
      });
      m.on("error", (h) => {
        f(h);
      }), (n === "POST" || n === "PUT" || n === "PATCH") && (s ? m.write(JSON.stringify(r)) : m.write(r)), m.end();
    });
  }
  // 请求返回都是原始内容
  static async HttpGetText(e, n = "GET", r, i = {}) {
    return this.HttpGetJson(e, n, r, i, !1, !1);
  }
}
class _7 {
  serverUrl = [];
  logger;
  rkeyData = {
    group_rkey: "",
    private_rkey: "",
    expired_time: 0
  };
  urlFailures = /* @__PURE__ */ new Map();
  FAILURE_LIMIT = 4;
  ONE_DAY = 1440 * 60 * 1e3;
  constructor(e, n) {
    this.logger = n, this.serverUrl = e;
  }
  async getRkey() {
    if (this.getAvailableUrls().length === 0)
      throw this.logger.logError("[Rkey] 所有服务均已禁用, 图片使用FallBack机制"), new Error("获取rkey失败：所有服务URL均已被禁用");
    if (this.isExpired())
      try {
        await this.refreshRkey();
      } catch (n) {
        throw new Error(`${n}`);
      }
    return this.rkeyData;
  }
  getAvailableUrls() {
    return this.serverUrl.filter((e) => !this.isUrlDisabled(e));
  }
  isUrlDisabled(e) {
    const n = this.urlFailures.get(e);
    return n ? (/* @__PURE__ */ new Date()).getTime() - n.lastTimestamp > this.ONE_DAY ? (n.count = 0, this.urlFailures.set(e, n), !1) : n.count >= this.FAILURE_LIMIT : !1;
  }
  updateUrlFailure(e) {
    const n = (/* @__PURE__ */ new Date()).getTime(), r = this.urlFailures.get(e) || { count: 0, lastTimestamp: 0 };
    n - r.lastTimestamp > this.ONE_DAY ? r.count = 1 : r.count++, r.lastTimestamp = n, this.urlFailures.set(e, r), r.count >= this.FAILURE_LIMIT && this.logger.logError(`[Rkey] URL ${e} 已被禁用，失败次数达到 ${this.FAILURE_LIMIT} 次`);
  }
  isExpired() {
    return (/* @__PURE__ */ new Date()).getTime() / 1e3 > this.rkeyData.expired_time;
  }
  async refreshRkey() {
    const e = this.getAvailableUrls();
    if (e.length === 0)
      throw this.logger.logError("[Rkey] 所有服务均已禁用"), new Error("获取rkey失败：所有服务URL均已被禁用");
    for (const n of e)
      try {
        let r = await ln.HttpGetJson(n, "GET");
        "retcode" in r && (r = r.data), this.rkeyData = {
          group_rkey: r.group_rkey.slice(6),
          private_rkey: r.private_rkey.slice(6),
          expired_time: r.expired_time
        };
        return;
      } catch (r) {
        if (this.logger.logError(`[Rkey] 异常服务 ${n} 异常 / `, r), this.updateUrlFailure(n), n === e[e.length - 1])
          throw new Error(`获取rkey失败: ${r}`);
      }
  }
}
const E7 = {}, Hu = typeof E7 < "u" && "4.18.9" || "1.0.0-dev", A7 = /^v?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
function Lw(t) {
  if (!t || typeof t != "string")
    return { valid: !1, normalized: "1.0.0-dev", major: 1, minor: 0, patch: 0, prerelease: "dev", buildmetadata: null };
  const e = t.trim().match(A7);
  if (e) {
    const n = parseInt(e[1], 10), r = parseInt(e[2], 10), i = parseInt(e[3], 10), o = e[4] || null, s = e[5] || null;
    let a = `${n}.${r}.${i}`;
    return o && (a += `-${o}`), s && (a += `+${s}`), { valid: !0, normalized: a, major: n, minor: r, patch: i, prerelease: o, buildmetadata: s };
  }
  return { valid: !1, normalized: "1.0.0-dev", major: 1, minor: 0, patch: 0, prerelease: "dev", buildmetadata: null };
}
function S6(t, e) {
  const n = Lw(t), r = Lw(e);
  if (!n.valid && !r.valid)
    return t.localeCompare(e);
  if (!n.valid) return -1;
  if (!r.valid) return 1;
  if (n.major !== r.major) return n.major > r.major ? 1 : -1;
  if (n.minor !== r.minor) return n.minor > r.minor ? 1 : -1;
  if (n.patch !== r.patch) return n.patch > r.patch ? 1 : -1;
  if (n.prerelease && !r.prerelease) return -1;
  if (!n.prerelease && r.prerelease) return 1;
  if (n.prerelease && r.prerelease) {
    const i = n.prerelease.split("."), o = r.prerelease.split("."), s = Math.max(i.length, o.length);
    for (let a = 0; a < s; a++) {
      const c = i[a], u = o[a];
      if (c === void 0) return -1;
      if (u === void 0) return 1;
      const l = /^\d+$/.test(c) ? parseInt(c, 10) : NaN, d = /^\d+$/.test(u) ? parseInt(u, 10) : NaN;
      if (!isNaN(l) && !isNaN(d)) {
        if (l !== d) return l > d ? 1 : -1;
        continue;
      }
      if (!isNaN(l)) return -1;
      if (!isNaN(d)) return 1;
      if (c !== u) return c > u ? 1 : -1;
    }
  }
  return 0;
}
Lw(Hu);
const dE = [
  "https://github.chenc.dev/",
  "https://ghproxy.cfd/",
  "https://github.tbedu.top/",
  "https://ghproxy.cc/",
  "https://gh.monlor.com/",
  "https://cdn.akaere.online/",
  "https://gh.idayer.com/",
  "https://gh.llkk.cc/",
  "https://ghpxy.hwinzniej.top/",
  "https://github-proxy.memory-echoes.cn/",
  "https://git.yylx.win/",
  "https://gitproxy.mrhjx.cn/",
  "https://gh.fhjhy.top/",
  "https://gp.zkitefly.eu.org/",
  "https://gh-proxy.com/",
  "https://ghfile.geekertao.top/",
  "https://j.1lin.dpdns.org/",
  "https://ghproxy.imciel.com/",
  "https://github-proxy.teach-english.tech/",
  "https://gh.927223.xyz/",
  "https://github.ednovas.xyz/",
  "https://ghf.xn--eqrr82bzpe.top/",
  "https://gh.dpik.top/",
  "https://gh.jasonzeng.dev/",
  "https://gh.xxooo.cf/",
  "https://gh.bugdey.us.kg/",
  "https://ghm.078465.xyz/",
  "https://j.1win.ggff.net/",
  "https://tvv.tw/",
  "https://gitproxy.127731.xyz/",
  "https://gh.inkchills.cn/",
  "https://ghproxy.cxkpro.top/",
  "https://gh.sixyin.com/",
  "https://github.geekery.cn/",
  "https://git.669966.xyz/",
  "https://gh.5050net.cn/",
  "https://gh.felicity.ac.cn/",
  "https://github.dpik.top/",
  "https://ghp.keleyaa.com/",
  "https://gh.wsmdn.dpdns.org/",
  "https://ghproxy.monkeyray.net/",
  "https://fastgit.cc/",
  "https://gh.catmak.name/",
  "https://gh.noki.icu/",
  ""
  // 原始 URL（无镜像）
], I7 = [
  "https://api.github.com"
  // 目前没有可用的公共 API 代理镜像
], Ug = [
  "https://raw.githubusercontent.com",
  // 测试确认支持 raw 文件的镜像
  "https://github.chenc.dev/https://raw.githubusercontent.com",
  "https://ghproxy.cfd/https://raw.githubusercontent.com",
  "https://ghproxy.cc/https://raw.githubusercontent.com",
  "https://gh-proxy.net/https://raw.githubusercontent.com"
], C7 = [
  "https://nightly.link"
  // 可以添加其他 nightly.link 镜像（如果有的话）
], T7 = {
  fileMirrors: dE,
  apiMirrors: I7,
  rawMirrors: Ug,
  nightlyLinkMirrors: C7,
  timeout: 5e3,
  // 5秒超时，平衡速度和可靠性
  enabled: !0,
  customMirror: void 0
};
let qi = { ...T7 }, tm = null, Nl = null;
const k7 = 1800 * 1e3;
let jw = 0;
async function N7(t, e = 5e3) {
  const r = du("https://github.com/NapNeko/NapCatQQ/releases/latest", t), i = Date.now();
  return new Promise((o) => {
    try {
      const s = new URL(r), a = s.protocol === "https:", u = (a ? Gu : fc).request({
        hostname: s.hostname,
        port: s.port || (a ? 443 : 80),
        path: s.pathname + s.search,
        method: "HEAD",
        timeout: e,
        headers: {
          "User-Agent": "NapCat-Mirror-Test"
        }
      }, (l) => {
        const d = l.statusCode || 0, f = d >= 200 && d < 400;
        o({
          mirror: t,
          latency: Date.now() - i,
          success: f
        });
      });
      u.on("error", () => {
        o({
          mirror: t,
          latency: 1 / 0,
          success: !1
        });
      }), u.on("timeout", () => {
        u.destroy(), o({
          mirror: t,
          latency: 1 / 0,
          success: !1
        });
      }), u.end();
    } catch {
      o({
        mirror: t,
        latency: 1 / 0,
        success: !1
      });
    }
  });
}
async function fE(t = !1) {
  const e = Date.now();
  if (!t && tm && e - jw < k7)
    return tm;
  if (Nl)
    return Nl;
  Nl = P7();
  try {
    const n = await Nl;
    return tm = n, jw = e, n;
  } finally {
    Nl = null;
  }
}
async function P7() {
  const e = qi.fileMirrors.filter((i) => i), r = (await Promise.all(
    e.map((i) => N7(i, 3e3))
  )).filter((i) => i.success).sort((i, o) => i.latency - o.latency).map((i) => i.mirror);
  return r.length === 0 ? [""] : r;
}
function D7() {
  tm = null, jw = 0;
}
function _6() {
  return { ...qi };
}
function F7(t) {
  qi.customMirror = t;
}
function du(t, e) {
  return e ? e.endsWith("/") ? e + t : e + "/" + t : t;
}
async function O7(t, e = 5e3) {
  try {
    return await Ys(ln.HttpGetText(t), e), !0;
  } catch {
    return !1;
  }
}
async function M7(t, e = 5e3) {
  return new Promise((n) => {
    const r = new URL(t), i = r.protocol === "https:", s = (i ? Gu : fc).request({
      hostname: r.hostname,
      port: r.port || (i ? 443 : 80),
      path: r.pathname + r.search,
      method: "HEAD",
      timeout: e,
      headers: {
        "User-Agent": "NapCat-Mirror-Test"
      }
    }, (a) => {
      const c = a.statusCode || 0, u = a.headers["content-type"] || "", l = c >= 200 && c < 400, d = !u.includes("text/html");
      n(l && d);
    });
    s.on("error", () => n(!1)), s.on("timeout", () => {
      s.destroy(), n(!1);
    }), s.end();
  });
}
async function R7(t, e = 5e3) {
  return new Promise((n) => {
    const r = new URL(t), i = r.protocol === "https:", s = (i ? Gu : fc).request({
      hostname: r.hostname,
      port: r.port || (i ? 443 : 80),
      path: r.pathname + r.search,
      method: "HEAD",
      timeout: e,
      headers: {
        "User-Agent": "NapCat-Mirror-Test"
      }
    }, (a) => {
      const c = a.statusCode || 0, u = a.headers["content-type"] || "", l = parseInt(a.headers["content-length"] || "0", 10), d = c >= 200 && c < 400, f = !u.includes("text/html");
      n(d ? f ? {
        valid: !0,
        statusCode: c,
        contentType: u,
        contentLength: l
      } : {
        valid: !1,
        statusCode: c,
        contentType: u,
        contentLength: l,
        error: "返回了 HTML 页面而非文件"
      } : {
        valid: !1,
        statusCode: c,
        contentType: u,
        contentLength: l,
        error: `HTTP ${c}`
      });
    });
    s.on("error", (a) => n({
      valid: !1,
      error: a.message
    })), s.on("timeout", () => {
      s.destroy(), n({
        valid: !1,
        error: "Timeout"
      });
    }), s.end();
  });
}
async function Qw(t, e = {}) {
  const {
    timeout: n = qi.timeout,
    customMirror: r = qi.customMirror,
    testMethod: i = "head",
    validateContent: o = !0,
    // 默认启用内容验证
    minFileSize: s,
    useFastMirrors: a = !0
    // 默认使用快速镜像列表
  } = e;
  let c = e.mirrors;
  c || (t.includes("nightly.link") ? c = qi.nightlyLinkMirrors : a ? c = await fE() : c = qi.fileMirrors);
  const u = async (d) => {
    if (o) {
      const m = await R7(d, n);
      return m.valid && s && m.contentLength && m.contentLength < s ? !1 : m.valid;
    }
    return i === "head" ? await M7(d, n) : await O7(d, n);
  };
  if (r)
    return du(t, r);
  if (await u(t))
    return t;
  let l = 0;
  for (const d of c) {
    if (!d) continue;
    let f;
    if (t.includes("nightly.link") ? f = t.replace("https://nightly.link", d.startsWith("http") ? d : `https://${d}`) : f = du(t, d), l++, await u(f))
      return f;
  }
  throw new Error(`所有下载源都不可用（已测试 ${l} 个镜像），请检查网络连接或配置自定义镜像`);
}
const E6 = /^v?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-.]+))?(?:\+([0-9A-Za-z-.]+))?$/;
function QI(t) {
  const e = t.match(E6);
  return e ? {
    major: parseInt(e[1] ?? "0", 10),
    minor: parseInt(e[2] ?? "0", 10),
    patch: parseInt(e[3] ?? "0", 10),
    prerelease: e[4] || ""
  } : null;
}
function B7(t, e) {
  const n = QI(t), r = QI(e);
  return !n && !r ? 0 : n ? r ? n.major !== r.major ? n.major - r.major : n.minor !== r.minor ? n.minor - r.minor : n.patch !== r.patch ? n.patch - r.patch : n.prerelease && !r.prerelease ? -1 : !n.prerelease && r.prerelease ? 1 : n.prerelease.localeCompare(r.prerelease) : 1 : -1;
}
async function U7(t, e, n) {
  const i = (await A6(t, e, n)).tags.filter((s) => E6.test(s));
  if (i.length === 0)
    throw new Error("未找到有效的 release tag");
  i.sort(B7);
  const o = i[i.length - 1];
  if (!o)
    throw new Error("未找到有效的 release tag");
  return o;
}
function L7(t, e, n, r) {
  return `https://github.com/${t}/${e}/releases/download/${n}/${r}`;
}
async function j7(t, e, n = "latest", r = {}) {
  const { assetNames: i = [], fetchChangelog: o = !1, mirror: s } = r;
  let a;
  n === "latest" ? a = await U7(t, e, s) : a = n;
  const c = i.map((l) => ({
    name: l,
    browser_download_url: L7(t, e, a, l)
  }));
  if (!o && i.length > 0)
    return {
      tag_name: a,
      assets: c,
      body: void 0
    };
  const u = `https://api.github.com/repos/${t}/${e}/releases/tags/${a}`;
  for (const l of qi.apiMirrors)
    try {
      const d = u.replace("https://api.github.com", l);
      return await Ys(
        ln.HttpGetJson(d, "GET", void 0, {
          "User-Agent": "NapCat",
          Accept: "application/vnd.github.v3+json"
        }),
        qi.timeout
      );
    } catch {
      continue;
    }
  if (i.length > 0)
    return {
      tag_name: a,
      assets: c,
      body: void 0
    };
  throw new Error("无法获取 release 信息，所有 API 源都不可用");
}
const Q7 = 600 * 1e3, $I = /* @__PURE__ */ new Map();
async function A6(t, e, n) {
  const r = `${t}/${e}/${n || "auto"}`, i = $I.get(r);
  if (i && Date.now() - i.timestamp < Q7)
    return { tags: i.tags, mirror: i.mirror };
  const o = `https://github.com/${t}/${e}.git/info/refs?service=git-upload-pack`, s = (l) => l.split(`
`).map((d) => {
    const f = d.match(/refs\/tags\/(.+)$/);
    return f ? f[1] : void 0;
  }).filter((d) => d !== void 0 && !d.endsWith("^{}")), a = async (l, d) => {
    try {
      const f = await Ys(
        ln.HttpGetText(l),
        qi.timeout
      );
      if (f.includes("refs/tags"))
        return { tags: s(f), mirror: d };
    } catch {
    }
    return null;
  };
  let c = [];
  n ? c = [n] : c = await fE();
  const u = c.map((l) => {
    const d = l ? du(o, l) : o;
    return a(d, l || "https://github.com");
  });
  try {
    const l = await Promise.any(u.filter((d) => d !== null));
    if (l)
      return $I.set(r, {
        tags: l.tags,
        mirror: l.mirror,
        timestamp: Date.now()
      }), l;
  } catch {
  }
  throw n ? new Error(`指定镜像 ${n} 获取 tags 失败`) : new Error("无法获取 tags，所有镜像源都不可用");
}
const $7 = 600 * 1e3, GI = /* @__PURE__ */ new Map();
async function G7(t, e, n = "build.yml", r = 10, i) {
  const o = `https://github.com/${t}/${e}/actions/workflows/${n}`;
  let s = [];
  i ? s = [i] : s = await fE();
  for (const a of s)
    try {
      const c = [], u = /* @__PURE__ */ new Set();
      let l = 1;
      const d = 10;
      for (; c.length < r && l <= d; ) {
        const f = l > 1 ? `${o}?page=${l}` : o, m = a ? du(f, a) : f, y = (await Ys(
          ln.HttpGetText(m),
          1e4
        )).split('<div class="Box-row');
        let x = 0;
        for (const g of y) {
          const v = new RegExp(`href="/${t}/${e}/actions/runs/(\\d+)"[^>]*aria-label="([^"]*)"`, "i").exec(g);
          if (!v || !v[1] || !v[2]) continue;
          const S = parseInt(v[1]), E = v[2];
          if (E.toLowerCase().includes("completed") && !u.has(S)) {
            const j = /<relative-time\s+datetime="([^"]+)"/.exec(g);
            if (j && j[1]) {
              u.add(S), x++;
              let q = "";
              const Y = /class="[^"]*markdown-title[^"]*"[^>]*>([\s\S]*?)<\/span>/i.exec(g);
              if (Y && Y[1] && (q = Y[1].trim()), !q) {
                q = E;
                const W = /^(completed successfully:\s*)/i.exec(q);
                W && (q = q.substring(W[0].length));
              }
              c.push({
                id: S,
                created_at: j[1],
                title: q.trim()
              });
            }
          }
        }
        if (x === 0 && y.length < 2)
          break;
        l++;
      }
      if (c.length > 0)
        return { runs: c, mirror: a || "https://github.com" };
    } catch {
      continue;
    }
  return { runs: [], mirror: "" };
}
async function q7(t, e, n = "build.yml", r = "main", i = 10, o) {
  try {
    const { runs: s, mirror: a } = await G7(t, e, n, i, o);
    if (s.length === 0)
      return { artifacts: [], mirror: a };
    const c = [], u = ["NapCat.Framework", "NapCat.Shell"], l = qi.nightlyLinkMirrors[0] || "https://nightly.link";
    for (const d of s)
      for (const f of u)
        c.push({
          id: d.id,
          name: f,
          size_in_bytes: 0,
          created_at: d.created_at,
          expires_at: new Date(new Date(d.created_at).getTime() + 4320 * 60 * 1e3).toISOString(),
          archive_download_url: `${l}/${t}/${e}/actions/runs/${d.id}/${f}.zip`,
          workflow_run_id: d.id,
          workflow_title: d.title
        });
    return { artifacts: c, mirror: a };
  } catch {
    return { artifacts: [], mirror: "" };
  }
}
async function H7(t, e, n = "build.yml", r = "main", i = 10, o) {
  const s = `${t}/${e}/${n}/${r}/${o || "auto"}`, a = GI.get(s);
  if (a && Date.now() - a.timestamp < $7)
    return { artifacts: a.artifacts, mirror: a.mirror };
  let c = { artifacts: [], mirror: "" };
  try {
    c = await q7(t, e, n, r, i, o);
  } catch {
  }
  return c.artifacts.length > 0 && GI.set(s, {
    artifacts: c.artifacts,
    mirror: c.mirror,
    timestamp: Date.now()
  }), c;
}
async function qI(t, ...e) {
  return new Promise((n) => {
    try {
      const r = t(...e);
      n(r);
    } catch {
      n(void 0);
    }
  });
}
async function I6(t, ...e) {
  return new Promise((n) => {
    t(...e).then((r) => {
      n(r);
    }).catch(() => {
      n(void 0);
    });
  });
}
function Kp(t) {
  return new Promise((e) => setTimeout(e, t));
}
function Ys(t, e) {
  const n = new Promise(
    (r, i) => setTimeout(() => i(new Error("PromiseTimer: Operation timed out")), e)
  );
  return Promise.race([t, n]);
}
function HI(t) {
  return t == null;
}
function C6(t) {
  return /^\d+$/.test(t);
}
function T6(t, e = 500) {
  return t !== null && typeof t == "object" && Object.keys(t).forEach((n) => {
    typeof t[n] == "string" ? t[n].length > e && (t[n] = t[n].substring(0, e) + "...") : typeof t[n] == "object" && T6(t[n], e);
  }), t;
}
function W7() {
  return dt.platform() === "linux" ? {
    baseVersion: "3.2.12.28060",
    curVersion: "3.2.12.28060",
    prevVersion: "",
    onErrorVersions: [],
    buildId: "27254"
  } : dt.platform() === "darwin" ? {
    baseVersion: "6.9.53.28060",
    curVersion: "6.9.53.28060",
    prevVersion: "",
    onErrorVersions: [],
    buildId: "28060"
  } : {
    baseVersion: "9.9.15-28131",
    curVersion: "9.9.15-28131",
    prevVersion: "",
    onErrorVersions: [],
    buildId: "28131"
  };
}
function z7(t = "", e) {
  if (process.env.NAPCAT_QQ_PACKAGE_INFO_PATH)
    return process.env.NAPCAT_QQ_PACKAGE_INFO_PATH;
  let n;
  return dt.platform() === "darwin" ? n = xe.join(xe.dirname(t), "..", "Resources", "app", "package.json") : dt.platform() === "linux" ? n = xe.join(xe.dirname(t), "./resources/app/package.json") : n = xe.join(xe.dirname(t), "./versions/" + e + "/resources/app/package.json"), de.existsSync(n) || (n = xe.join(xe.dirname(t), "./resources/app/versions/" + e + "/package.json")), n;
}
function K7(t = "") {
  if (process.env.NAPCAT_QQ_VERSION_CONFIG_PATH)
    return process.env.NAPCAT_QQ_VERSION_CONFIG_PATH;
  let e;
  if (dt.platform() === "win32")
    e = xe.join(xe.dirname(t), "versions", "config.json");
  else if (dt.platform() === "darwin") {
    const n = dt.homedir(), r = xe.resolve(n, "./Library/Application Support/QQ");
    e = xe.resolve(r, "./versions/config.json");
  } else {
    const n = dt.homedir(), r = xe.resolve(n, "./.config/QQ");
    e = xe.resolve(r, "./versions/config.json");
  }
  if (typeof e == "string" && (de.existsSync(e) || (e = xe.join(xe.dirname(t), "./resources/app/versions/config.json")), !!de.existsSync(e)))
    return e;
}
function $w(t) {
  if (!t) return 0;
  const { crownNum: e, sunNum: n, moonNum: r, starNum: i } = t;
  return e * 64 + n * 16 + r * 4 + i;
}
function Pl(t) {
  return JSON.stringify(
    t,
    (e, n) => typeof n == "bigint" ? n.toString() : n
  );
}
function V7(t) {
  const e = Buffer.from("QQAppId/", "utf-8"), n = xe.resolve(t), r = de.readFileSync(n);
  let i = 0;
  for (; ; ) {
    const o = r.indexOf(e, i);
    if (o === -1)
      break;
    const s = o + e.length, a = r.indexOf(0, s);
    if (a === -1)
      break;
    const u = r.subarray(s, a).toString("utf-8");
    if (/^\d+$/.test(u))
      return u;
    i = a + 1;
  }
}
function Y7(t) {
  const n = Buffer.from("A4 09 00 00 00 35".replace(/ /g, ""), "hex"), r = xe.resolve(t), i = de.readFileSync(r);
  let o = 0;
  for (; ; ) {
    const s = i.indexOf(n, o);
    if (s === -1)
      break;
    const a = s + n.length - 1, c = i.indexOf(0, a);
    if (c === -1)
      break;
    const u = i.subarray(a, c);
    if (!u.every((l) => l === 0))
      try {
        return u.toString("utf-8");
      } catch {
        break;
      }
    o = c + 1;
  }
}
async function k6(t) {
  return A6("NapNeko", "NapCatQQ", t);
}
async function J7(t) {
  const { tags: e } = await k6(t);
  e.sort((r, i) => S6(r, i));
  const n = e.at(-1);
  if (!n)
    throw new Error("No tags found");
  return n.replace(/^v/, "");
}
function hE(t, e = 3e3) {
  return new Promise((n, r) => {
    const i = Date.now();
    function o() {
      de.existsSync(t) ? n() : Date.now() - i > e ? r(new Error(`文件不存在: ${t}`)) : setTimeout(o, 100);
    }
    o();
  });
}
async function X7(t, e = 3e3) {
  await Promise.race([
    eQ(t),
    Z7(e, `文件不存在: ${t}`)
  ]);
}
function Z7(t, e) {
  return new Promise((n, r) => {
    setTimeout(() => {
      r(new Error(e));
    }, t);
  });
}
async function eQ(t) {
  try {
    await iL(t);
  } catch (e) {
    throw e.code === "ENOENT" ? new Error(`文件不存在: ${t}`) : e;
  }
}
function Lg(t) {
  return new Promise((e, n) => {
    const r = de.createReadStream(t), i = Si.createHash("md5");
    r.on("data", (o) => {
      i.update(o);
    }), r.on("end", () => {
      const o = i.digest("hex");
      e(o);
    }), r.on("error", (o) => {
      n(o);
    });
  });
}
async function WI(t, e = !1) {
  let n, r, i = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36"
  };
  if (typeof t == "string" ? (n = t, i.Host = new URL(n).hostname) : (n = t.url, r = t.proxy, t.headers && (typeof t.headers == "string" ? i = JSON.parse(t.headers) : i = t.headers)), e && !i.Referer && (i.Referer = n), r)
    try {
      const s = await mE(n, i, r);
      return new Response(s, { status: 200, statusText: "OK" });
    } catch (s) {
      console.error("代理下载失败，尝试直接下载:", s);
    }
  return await fetch(n, { headers: i, redirect: "follow" }).catch((s) => {
    throw s.cause ? s.cause : s;
  });
}
function mE(t, e, n) {
  return new Promise((r, i) => {
    const o = new URL(t), s = new URL(n), a = o.protocol === "https:", c = parseInt(s.port) || (s.protocol === "https:" ? 443 : 80), u = s.username && s.password ? { "Proxy-Authorization": "Basic " + Buffer.from(`${decodeURIComponent(s.username)}:${decodeURIComponent(s.password)}`).toString("base64") } : {};
    if (a) {
      const l = Gp.request({
        host: s.hostname,
        port: c,
        method: "CONNECT",
        path: `${o.hostname}:${o.port || 443}`,
        headers: {
          Host: `${o.hostname}:${o.port || 443}`,
          ...u
        }
      });
      l.on("connect", (d, f) => {
        if (d.statusCode !== 200) {
          f.destroy(), i(new Error(`代理 CONNECT 失败: ${d.statusCode} ${d.statusMessage}`));
          return;
        }
        const m = mL.connect({
          socket: f,
          servername: o.hostname,
          rejectUnauthorized: !0
        }, () => {
          const E = o.pathname + o.search, T = {
            ...e,
            Host: o.hostname,
            Connection: "close"
          }, j = Object.entries(T).map(([Y, W]) => `${Y}: ${W}`).join(`\r
`), q = `GET ${E} HTTP/1.1\r
${j}\r
\r
`;
          m.write(q);
        });
        let h = Buffer.alloc(0), y = !1, x = 0, g = !1, v = Buffer.alloc(0), S = null;
        m.on("data", (E) => {
          if (h = Buffer.concat([h, E]), y)
            v = Buffer.concat([v, E]);
          else {
            const T = h.indexOf(`\r
\r
`);
            if (T !== -1) {
              y = !0;
              const q = h.subarray(0, T).toString().split(`\r
`), W = q[0]?.match(/HTTP\/\d\.\d\s+(\d+)/);
              x = W ? parseInt(W[1]) : 0;
              for (const G of q.slice(1)) {
                const [J, ...B] = G.split(":"), D = B.join(":").trim();
                J?.toLowerCase() === "transfer-encoding" && D.toLowerCase() === "chunked" ? g = !0 : J?.toLowerCase() === "location" && (S = D);
              }
              v = h.subarray(T + 4);
            }
          }
        }), m.on("end", () => {
          if (x >= 300 && x < 400 && S) {
            const E = S.startsWith("http") ? S : `${o.protocol}//${o.host}${S}`;
            mE(E, e, n).then(r).catch(i);
            return;
          }
          if (x !== 200) {
            i(new Error(`下载失败: ${x}`));
            return;
          }
          r(g ? tQ(v) : v);
        }), m.on("error", (E) => {
          i(new Error(`TLS 连接错误: ${E.message}`));
        });
      }), l.on("error", (d) => {
        i(new Error(`代理连接错误: ${d.message}`));
      }), l.end();
    } else {
      const l = Gp.request({
        host: s.hostname,
        port: c,
        method: "GET",
        path: t,
        // 完整 URL
        headers: {
          ...e,
          Host: o.hostname,
          ...u
        }
      }, (d) => {
        nQ(d, r, i, t, e, n);
      });
      l.on("error", (d) => {
        i(new Error(`代理请求错误: ${d.message}`));
      }), l.end();
    }
  });
}
function tQ(t) {
  const e = [];
  let n = 0;
  for (; n < t.length; ) {
    const r = t.indexOf(`\r
`, n);
    if (r === -1) break;
    const i = t.subarray(n, r).toString().split(";")[0], o = parseInt(i, 16);
    if (o === 0) break;
    const s = r + 2, a = s + o;
    if (a > t.length) break;
    e.push(t.subarray(s, a)), n = a + 2;
  }
  return Buffer.concat(e);
}
function nQ(t, e, n, r, i, o) {
  if (t.statusCode && t.statusCode >= 300 && t.statusCode < 400 && t.headers.location) {
    mE(t.headers.location, i, o).then(e).catch(n);
    return;
  }
  if (t.statusCode !== 200) {
    n(new Error(`下载失败: ${t.statusCode} ${t.statusMessage}`));
    return;
  }
  const s = [];
  t.on("data", (a) => s.push(a)), t.on("end", () => e(Buffer.concat(s))), t.on("error", n);
}
async function rQ(t) {
  const e = typeof t == "string";
  let n = await WI(t);
  if (n.status === 403 && e && (n = await WI(t, !0)), !n.ok) throw new Error(`下载文件失败: ${n.statusText}`);
  const i = await (await n.blob()).arrayBuffer();
  return Buffer.from(i);
}
async function iQ(t) {
  const e = await qI((r) => {
    if (de.existsSync(xe.normalize(r)))
      return {
        Uri: xe.normalize(r),
        Type: 1
        /* Local */
      };
  }, t);
  if (e) return e;
  const n = await qI((r) => {
    if (r.startsWith("http:") || r.startsWith("https:"))
      return {
        Uri: r,
        Type: 2
        /* Remote */
      };
    if (r.startsWith("base64:"))
      return {
        Uri: r,
        Type: 3
        /* Base64 */
      };
    if (r.startsWith("file:"))
      return {
        Uri: decodeURIComponent(r.startsWith("file:///") && process.platform === "win32" ? r.slice(8) : r.slice(7)),
        Type: 1
        /* Local */
      };
    if (r.startsWith("data:")) {
      const i = r.split(",")[1];
      if (i) return {
        Uri: i,
        Type: 3
        /* Base64 */
      };
    }
  }, t);
  return n || {
    Uri: t,
    Type: 0
    /* Unknown */
  };
}
async function Ji(t, e, n = Do(), r, i) {
  const { Uri: o, Type: s } = await iQ(e), a = xe.join(t, n);
  switch (s) {
    case 1: {
      const c = xe.extname(o);
      return { success: !0, errMsg: "", fileName: xe.basename(o, c) + c, path: o, isLocal: !0 };
    }
    case 2: {
      const c = await rQ({ url: o, headers: r ?? {}, proxy: i });
      return de.writeFileSync(a, c), { success: !0, errMsg: "", fileName: n, path: a, isLocal: !1 };
    }
    case 3: {
      const c = o.replace(/^base64:\/\//, ""), u = Buffer.from(c, "base64");
      return de.writeFileSync(a, u), { success: !0, errMsg: "", fileName: n, path: a, isLocal: !1 };
    }
    default:
      return { success: !1, errMsg: `识别URL失败, uri= ${e}`, fileName: "", path: "", isLocal: !1 };
  }
}
const zI = {
  appid: b(4, w.UINT32, !0),
  ttl: b(10, w.UINT32, !0)
};
class oQ {
  context;
  core;
  rkeyManager;
  packetRkey;
  fetchRkeyFailures = 0;
  MAX_RKEY_FAILURES = 8;
  constructor(e, n) {
    this.context = e, this.core = n, this.rkeyManager = new _7(
      [
        "http://ss.xingzhige.com/music_card/rkey",
        "https://secret-service.bietiaop.com/rkeys"
      ],
      this.context.logger
    );
  }
  async fetchRkeyWithRetry() {
    if (this.fetchRkeyFailures >= this.MAX_RKEY_FAILURES)
      throw new Error("Native.FetchRkey 已被禁用");
    try {
      const e = await this.core.apis.PacketApi.pkt.operation.FetchRkey();
      return this.fetchRkeyFailures = 0, e;
    } catch (e) {
      throw this.fetchRkeyFailures++, this.context.logger.logError("FetchRkey 失败", e.message), e;
    }
  }
  async getFileUrl(e, n, r, i, o = 5e3) {
    if (this.core.apis.PacketApi.packetStatus)
      try {
        if (e === Ne.KCHATTYPEGROUP && r)
          return this.core.apis.PacketApi.pkt.operation.GetGroupFileUrl(+n, r, o);
        if (i && r)
          return this.core.apis.PacketApi.pkt.operation.GetPrivateFileUrl(n, r, i, o);
      } catch (s) {
        this.context.logger.logError("获取文件URL失败", s.message);
      }
    throw new Error("fileUUID or file10MMd5 is undefined");
  }
  async getPttUrl(e, n, r = 5e3) {
    if (this.core.apis.PacketApi.packetStatus && n) {
      const i = new fe(zI).decode(Buffer.from(n.replaceAll("-", "+").replaceAll("_", "/"), "base64")).appid;
      try {
        if (i && i === 1403)
          return this.core.apis.PacketApi.pkt.operation.GetGroupPttUrl(+e, {
            fileUuid: n,
            storeId: 1,
            uploadTime: 0,
            ttl: 0,
            subType: 0
          }, r);
        if (n)
          return this.core.apis.PacketApi.pkt.operation.GetPttUrl(e, {
            fileUuid: n,
            storeId: 1,
            uploadTime: 0,
            ttl: 0,
            subType: 0
          }, r);
      } catch (o) {
        this.context.logger.logError("获取文件URL失败", o.message);
      }
    }
    throw new Error("packet cant get ptt url");
  }
  async getVideoUrlPacket(e, n, r = 5e3) {
    if (this.core.apis.PacketApi.packetStatus && n) {
      const i = new fe(zI).decode(Buffer.from(n.replaceAll("-", "+").replaceAll("_", "/"), "base64")).appid;
      try {
        if (i && i === 1415)
          return this.core.apis.PacketApi.pkt.operation.GetGroupVideoUrl(+e, {
            fileUuid: n,
            storeId: 1,
            uploadTime: 0,
            ttl: 0,
            subType: 0
          }, r);
        if (n)
          return this.core.apis.PacketApi.pkt.operation.GetVideoUrl(e, {
            fileUuid: n,
            storeId: 1,
            uploadTime: 0,
            ttl: 0,
            subType: 0
          }, r);
      } catch (o) {
        this.context.logger.logError("获取文件URL失败", o.message);
      }
    }
    throw new Error("packet cant get video url");
  }
  async copyFile(e, n) {
    await this.core.util.copyFile(e, n);
  }
  async getFileSize(e) {
    return await this.core.util.getFileSize(e);
  }
  async getVideoUrl(e, n, r) {
    return (await this.context.session.getRichMediaService().getVideoPlayUrlV2(e, n, r, 0, {
      downSourceType: 1,
      triggerType: 1
    })).urlResult.domainUrl;
  }
  async uploadFile(e, n = _e.PIC, r = 0, i = !0) {
    const o = await Lg(e), s = await Cd(e).then((l) => l?.ext ?? "").catch(() => ""), a = s ? `.${s}` : "";
    let c = `${be.basename(e)}`;
    c.indexOf(".") === -1 && (c += a);
    const u = await this.getFileSize(e);
    if (i) {
      const l = this.context.session.getMsgService().getRichMediaFilePathForGuild({
        md5HexStr: o,
        fileName: c,
        elementType: n,
        elementSubType: r,
        thumbSize: 0,
        needCreate: !0,
        downloadType: 1,
        file_uuid: ""
      });
      return await this.copyFile(e, l), {
        md5: o,
        fileName: c,
        path: l,
        fileSize: u,
        ext: a
      };
    }
    return {
      md5: o,
      fileName: c,
      path: e,
      fileSize: u,
      ext: a
    };
  }
  async downloadFileForModelId(e, n, r, i = 1e3 * 60 * 2) {
    const [, o] = await this.core.eventWrapper.callNormalEventV2(
      "NodeIKernelRichMediaService/downloadFileForModelId",
      "NodeIKernelMsgListener/onRichMediaDownloadComplete",
      [e, [n], r],
      () => !0,
      (s) => s?.commonFileInfo?.fileModelId === n,
      1,
      i
    );
    return o.filePath;
  }
  async downloadRawMsgMedia(e) {
    const n = await Promise.all(
      e.map(
        (r) => Promise.all(
          r.elements.filter(
            (i) => i.elementType === _e.PIC || i.elementType === _e.VIDEO || i.elementType === _e.PTT || i.elementType === _e.FILE
          ).map(
            (i) => this.downloadMedia(r.msgId, r.chatType, r.peerUid, i.elementId, "", "", 12e4, !0)
          )
        )
      )
    );
    return e.forEach((r, i) => {
      const o = n[i];
      let s = 0;
      r.elements.forEach((a) => {
        if (a.elementType === _e.PIC || a.elementType === _e.VIDEO || a.elementType === _e.PTT || a.elementType === _e.FILE) {
          switch (a.elementType) {
            case _e.PIC:
              a.picElement.sourcePath = o?.[s] ?? "";
              break;
            case _e.VIDEO:
              a.videoElement.filePath = o?.[s] ?? "";
              break;
            case _e.PTT:
              a.pttElement.filePath = o?.[s] ?? "";
              break;
            case _e.FILE:
              a.fileElement.filePath = o?.[s] ?? "";
              break;
          }
          s++;
        }
      });
    }), n.flat();
  }
  async downloadMedia(e, n, r, i, o, s, a = 1e3 * 60 * 2, c = !1) {
    if (s && de.existsSync(s))
      if (c)
        try {
          await Ot.unlink(s);
        } catch {
        }
      else
        return s;
    const [, u] = await this.core.eventWrapper.callNormalEventV2(
      "NodeIKernelMsgService/downloadRichMedia",
      "NodeIKernelMsgListener/onRichMediaDownloadComplete",
      [{
        fileModelId: "0",
        downSourceType: 0,
        downloadSourceType: 0,
        triggerType: 1,
        msgId: e,
        chatType: n,
        peerUid: r,
        elementId: i,
        thumbSize: 0,
        downloadType: 1,
        filePath: o
      }],
      () => !0,
      (l) => l.msgElementId === i && l.msgId === e,
      1,
      a
    );
    return u.filePath;
  }
  async searchForFile(e) {
    const n = 1e5 + Math.floor(Math.random() * 1e4);
    let r = 0;
    const [, i] = await this.core.eventWrapper.callNormalEventV2(
      "NodeIKernelFileAssistantService/searchFile",
      "NodeIKernelFileAssistantListener/onFileSearch",
      [
        e,
        { resultType: 2, pageLimit: 1 },
        n
      ],
      (o) => (r = o, !0),
      (o) => o.searchId === r && o.resultId === n
    );
    return i.resultItems[0];
  }
  async downloadFileById(e, n = 1024576, r = n * 1e3 / 1024576 + 5e3) {
    const [, i] = await this.core.eventWrapper.callNormalEventV2(
      "NodeIKernelFileAssistantService/downloadFile",
      "NodeIKernelFileAssistantListener/onFileStatusChanged",
      [[e]],
      (o) => o.result === 0,
      (o) => o.fileStatus === 2 && o.fileProgress === "0",
      1,
      r
      // estimate 1MB/s
    );
    return i.filePath;
  }
  async getImageUrl(e) {
    if (!e)
      return "";
    const n = e.originImageUrl ?? "", r = e.md5HexStr, i = e.md5HexStr, o = new URL(By + n), s = o.searchParams.get("appid"), a = s && ["1406", "1407"].includes(s), c = o.searchParams.get("fileid");
    if (n && a && c) {
      const u = await this.getRkeyData();
      return this.getImageUrlFromParsedUrl(c, s, u);
    }
    return this.getImageUrlFromMd5(i, r);
  }
  async getRkeyData() {
    const e = {
      private_rkey: "CAQSKAB6JWENi5LM_xp9vumLbuThJSaYf-yzMrbZsuq7Uz2qEc3Rbib9LP4",
      group_rkey: "CAQSKAB6JWENi5LM_xp9vumLbuThJSaYf-yzMrbZsuq7Uz2qffcqm614gds",
      online_rkey: !1
    };
    try {
      if (this.core.apis.PacketApi.packetStatus) {
        const n = !this.packetRkey || this.packetRkey[0] && this.packetRkey[0].time + Number(this.packetRkey[0].ttl) < Date.now() / 1e3, r = !this.packetRkey || this.packetRkey[0] && this.packetRkey[0].time + Number(this.packetRkey[0].ttl) < Date.now() / 1e3;
        (n || r) && (this.packetRkey = await this.fetchRkeyWithRetry()), this.packetRkey && this.packetRkey.length > 0 && (e.group_rkey = this.packetRkey[1]?.rkey.slice(6) ?? "", e.private_rkey = this.packetRkey[0]?.rkey.slice(6) ?? "", e.online_rkey = !0);
      }
    } catch (n) {
      this.context.logger.logDebug("获取native.rkey失败", n.message);
    }
    if (!e.online_rkey)
      try {
        const n = await this.rkeyManager.getRkey();
        e.group_rkey = n.group_rkey, e.private_rkey = n.private_rkey, e.online_rkey = n.expired_time > Date.now() / 1e3;
      } catch (n) {
        this.context.logger.logDebug("获取remote.rkey失败", n.message);
      }
    return e;
  }
  getImageUrlFromParsedUrl(e, n, r) {
    const i = n === "1406" ? r.private_rkey : r.group_rkey;
    return r.online_rkey ? lj + `/download?appid=${n}&fileid=${e}&rkey=${i}` : By + `/download?appid=${n}&fileid=${e}&rkey=${i}&spec=0`;
  }
  getImageUrlFromMd5(e, n) {
    return e || n ? `${By}/gchatpic_new/0/0-0-${(e ?? n ?? "").toUpperCase()}/0` : (this.context.logger.logDebug("图片url获取失败", { fileMd5: e, md5HexStr: n }), "");
  }
}
class Am {
  keyToValue = /* @__PURE__ */ new Map();
  valueToKey = /* @__PURE__ */ new Map();
  maxSize;
  constructor(e) {
    this.maxSize = e;
  }
  resize(e) {
    this.maxSize = e;
  }
  set(e, n) {
    for (this.keyToValue.set(e, n), this.valueToKey.set(n, e); this.keyToValue.size !== this.valueToKey.size; )
      this.keyToValue.clear(), this.valueToKey.clear();
    for (; this.keyToValue.size > this.maxSize || this.valueToKey.size > this.maxSize; ) {
      const r = this.keyToValue.keys().next().value;
      r !== void 0 && (this.valueToKey.delete(this.keyToValue.get(r)), this.keyToValue.delete(r));
    }
  }
  getValue(e) {
    return this.keyToValue.get(e);
  }
  getKey(e) {
    return this.valueToKey.get(e);
  }
  deleteByValue(e) {
    const n = this.valueToKey.get(e);
    n !== void 0 && (this.keyToValue.delete(n), this.valueToKey.delete(e));
  }
  deleteByKey(e) {
    const n = this.keyToValue.get(e);
    n !== void 0 && (this.keyToValue.delete(e), this.valueToKey.delete(n));
  }
  getKeyList() {
    return Array.from(this.keyToValue.keys());
  }
  // 获取最近刚写入的几个值
  getHeads(e) {
    const n = this.getKeyList();
    if (n.length === 0)
      return;
    const r = [], i = Math.min(e, n.length);
    for (let o = 0; o < i; o++) {
      const s = n[i - o];
      s !== void 0 && r.push({ key: s, value: this.keyToValue.get(s) });
    }
    return r;
  }
}
class sQ {
  msgDataMap;
  msgIdMap;
  constructor(e = 5e3) {
    this.msgIdMap = new Am(e), this.msgDataMap = new Am(e);
  }
  getRecentMsgIds(e, n) {
    const r = this.msgIdMap.getHeads(n);
    return r ? r.map((s) => rt.getMsgIdAndPeerByShortId(s.value)).filter((s) => s?.Peer.chatType === e.chatType && s?.Peer.peerUid === e.peerUid).map((s) => s?.MsgId).filter((s) => s !== void 0) : [];
  }
  createUniqueMsgId(e, n) {
    const r = `${n}|${e.chatType}|${e.peerUid}`, i = Si.createHash("md5").update(r).digest();
    i[0] && (i[0] &= 127);
    const o = i.readInt32BE(0);
    return this.msgIdMap.set(n, o), this.msgDataMap.set(r, o), o;
  }
  getMsgIdAndPeerByShortId(e) {
    const n = this.msgDataMap.getKey(e);
    if (n) {
      const [r, i, o] = n.split("|"), s = {
        chatType: parseInt(i ?? "0"),
        peerUid: o ?? "",
        guildId: ""
      };
      return { MsgId: r ?? "0", Peer: s };
    }
  }
  getShortIdByMsgId(e) {
    return this.msgIdMap.getValue(e);
  }
  getPeerByMsgId(e) {
    const n = this.msgIdMap.getValue(e);
    if (n)
      return this.getMsgIdAndPeerByShortId(n);
  }
  resize(e) {
    this.msgIdMap.resize(e), this.msgDataMap.resize(e);
  }
  isShortId(e) {
    const n = Number(e);
    return Number.isInteger(n) && n >= -2147483648 && n <= 2147483647;
  }
}
const rt = new sQ();
class aQ {
  context;
  core;
  constructor(e, n) {
    this.context = e, this.core = n;
  }
  async setBuddyRemark(e, n) {
    return this.context.session.getBuddyService().setBuddyRemark({ uid: e, remark: n });
  }
  async getBuddyV2SimpleInfoMap() {
    const e = this.context.session.getBuddyService();
    let n = [];
    return this.core.context.basicInfoWrapper.requireMinNTQQBuild("41679") ? n = (await e.getBuddyListV2("0", !0, zl.KNOMAL)).data.flatMap((i) => i.buddyUids) : n = (await e.getBuddyListV2("0", zl.KNOMAL)).data.flatMap((i) => i.buddyUids), await this.core.eventWrapper.callNoListenerEvent(
      "NodeIKernelProfileService/getCoreAndBaseInfo",
      "nodeStore",
      n
    );
  }
  async getBuddy() {
    return Array.from((await this.getBuddyV2SimpleInfoMap()).values());
  }
  async getBuddyIdMap() {
    const e = new Am(5e3);
    return (await this.getBuddyV2SimpleInfoMap()).forEach((r) => e.set(r.uin, r.uid)), e;
  }
  async delBuddy(e, n = !1, r = !1) {
    return this.context.session.getBuddyService().delBuddy({
      friendUid: e,
      tempBlock: n,
      tempBothDel: r
    });
  }
  async getBuddyV2ExWithCate() {
    const e = this.context.session.getBuddyService();
    let n = [], r;
    this.core.context.basicInfoWrapper.requireMinNTQQBuild("41679") ? (r = (await e.getBuddyListV2("0", !0, zl.KNOMAL)).data, n = r.flatMap((o) => o.buddyUids)) : (r = (await e.getBuddyListV2("0", zl.KNOMAL)).data, n = r.flatMap((o) => o.buddyUids));
    const i = await this.core.eventWrapper.callNoListenerEvent(
      "NodeIKernelProfileService/getCoreAndBaseInfo",
      "nodeStore",
      n
    );
    return r.map((o) => ({
      categoryId: o.categoryId,
      categorySortId: o.categorySortId,
      categoryName: o.categroyName,
      categoryMbCount: o.categroyMbCount,
      onlineCount: o.onlineCount,
      buddyList: o.buddyUids.map((s) => i.get(s)).filter((s) => !!s)
    }));
  }
  async isBuddy(e) {
    return this.context.session.getBuddyService().isBuddy(e);
  }
  async clearBuddyReqUnreadCnt() {
    return this.context.session.getBuddyService().clearBuddyReqUnreadCnt();
  }
  async getBuddyReq() {
    const [, e] = await this.core.eventWrapper.callNormalEventV2(
      "NodeIKernelBuddyService/getBuddyReq",
      "NodeIKernelBuddyListener/onBuddyReqChange",
      []
    );
    return e;
  }
  async handleFriendRequest(e, n) {
    this.context.session.getBuddyService()?.approvalFriendRequest({
      friendUid: e.friendUid,
      reqTime: e.reqTime,
      accept: n
    });
  }
  async handleDoubtFriendRequest(e, n = "", r = "") {
    this.context.session.getBuddyService().approvalDoubtBuddyReq(e, n, r);
  }
  async getDoubtFriendRequest(e) {
    const n = Date.now().toString(), [, r] = await this.core.eventWrapper.callNormalEventV2(
      "NodeIKernelBuddyService/getDoubtBuddyReq",
      "NodeIKernelBuddyListener/onDoubtBuddyReqChange",
      [n, e, ""],
      () => !0,
      (o) => o.reqId === n
    );
    return Promise.all(r.doubtList.map(async (o) => ({
      flag: o.uid,
      // 注意强制String 非isNumeric 不遵守则不符合设计
      uin: await this.core.apis.UserApi.getUinByUidV2(o.uid) ?? 0,
      // 信息字段
      nick: o.nick,
      // 信息字段 这个不是nickname 可能是来源的群内的昵称
      source: o.source,
      // 信息字段
      reason: o.reason,
      // 信息字段
      msg: o.msg,
      // 信息字段
      group_code: o.groupCode,
      // 信息字段
      time: o.reqTime,
      // 信息字段
      type: "doubt"
      // 保留字段
    })));
  }
}
class cQ {
  promise;
  cancelCallback = null;
  isCanceled = !1;
  cancelListeners = [];
  constructor(e) {
    this.promise = new Promise((n, r) => {
      const i = (s) => {
        this.cancelCallback = s;
      };
      (async () => {
        try {
          await e(
            (s) => {
              this.isCanceled || n(s);
            },
            (s) => {
              this.isCanceled || r(s);
            },
            i
          );
        } catch (s) {
          this.isCanceled || r(s);
        }
      })();
    });
  }
  cancel() {
    this.cancelCallback && this.cancelCallback(), this.isCanceled = !0, this.cancelListeners.forEach((e) => e());
  }
  isTaskCanceled() {
    return this.isCanceled;
  }
  onCancel(e) {
    this.cancelListeners.push(e);
  }
  then(e, n) {
    return this.promise.then(e, n);
  }
  catch(e) {
    return this.promise.catch(e);
  }
  finally(e) {
    return this.promise.finally(e);
  }
  [Symbol.asyncIterator]() {
    return {
      next: () => this.promise.then((e) => ({ value: e, done: !0 }))
    };
  }
}
function KI(t) {
  return {
    groupCode: t,
    filter: {
      noCodeFingerOpenFlag: 0,
      noFingerOpenFlag: 0,
      groupName: 0,
      classExt: 0,
      classText: 0,
      fingerMemo: 0,
      richFingerMemo: 0,
      tagRecord: 0,
      groupGeoInfo: {
        ownerUid: 0,
        setTime: 0,
        cityId: 0,
        longitude: 0,
        latitude: 0,
        geoContent: 0,
        poiId: 0
      },
      groupExtAdminNum: 0,
      flag: 0,
      groupMemo: 0,
      groupAioSkinUrl: 0,
      groupBoardSkinUrl: 0,
      groupCoverSkinUrl: 0,
      groupGrade: 0,
      activeMemberNum: 0,
      certificationType: 0,
      certificationText: 0,
      groupNewGuideLines: {
        enabled: 0,
        content: 0
      },
      groupFace: 0,
      addOption: 0,
      shutUpTime: 0,
      groupTypeFlag: 0,
      appPrivilegeFlag: 0,
      appPrivilegeMask: 0,
      groupExtOnly: {
        tribeId: 0,
        moneyForAddGroup: 0
      },
      groupSecLevel: 0,
      groupSecLevelInfo: 0,
      subscriptionUin: 0,
      subscriptionUid: "",
      allowMemberInvite: 0,
      groupQuestion: 0,
      groupAnswer: 0,
      groupFlagExt3: 0,
      groupFlagExt3Mask: 0,
      groupOpenAppid: 0,
      rootId: 0,
      msgLimitFrequency: 0,
      hlGuildAppid: 0,
      hlGuildSubType: 0,
      hlGuildOrgId: 0,
      groupFlagExt4: 0,
      groupFlagExt4Mask: 0,
      groupSchoolInfo: {
        location: 0,
        grade: 0,
        school: 0
      },
      groupCardPrefix: {
        introduction: 0,
        rptPrefix: 0
      },
      allianceId: 0,
      groupFlagPro1: 0,
      groupFlagPro1Mask: 0
    },
    modifyInfo: {
      noCodeFingerOpenFlag: 0,
      noFingerOpenFlag: 0,
      groupName: "",
      classExt: 0,
      classText: "",
      fingerMemo: "",
      richFingerMemo: "",
      tagRecord: [],
      groupGeoInfo: {
        ownerUid: "",
        SetTime: 0,
        CityId: 0,
        Longitude: "",
        Latitude: "",
        GeoContent: "",
        poiId: ""
      },
      groupExtAdminNum: 0,
      flag: 0,
      groupMemo: "",
      groupAioSkinUrl: "",
      groupBoardSkinUrl: "",
      groupCoverSkinUrl: "",
      groupGrade: 0,
      activeMemberNum: 0,
      certificationType: 0,
      certificationText: "",
      groupNewGuideLines: {
        enabled: !1,
        content: ""
      },
      groupFace: 0,
      addOption: 0,
      shutUpTime: 0,
      groupTypeFlag: 0,
      appPrivilegeFlag: 0,
      appPrivilegeMask: 0,
      groupExtOnly: {
        tribeId: 0,
        moneyForAddGroup: 0
      },
      groupSecLevel: 0,
      groupSecLevelInfo: 0,
      subscriptionUin: "",
      subscriptionUid: "",
      allowMemberInvite: 0,
      groupQuestion: "",
      groupAnswer: "",
      groupFlagExt3: 0,
      groupFlagExt3Mask: 0,
      groupOpenAppid: 0,
      rootId: "",
      msgLimitFrequency: 0,
      hlGuildAppid: 0,
      hlGuildSubType: 0,
      hlGuildOrgId: 0,
      groupFlagExt4: 0,
      groupFlagExt4Mask: 0,
      groupSchoolInfo: {
        location: "",
        grade: 0,
        school: ""
      },
      groupCardPrefix: {
        introduction: "",
        rptPrefix: []
      },
      allianceId: "",
      groupFlagPro1: 0,
      groupFlagPro1Mask: 0
    }
  };
}
function uQ(t) {
  return {
    groupCode: t,
    resultCode: 0,
    extInfo: {
      groupInfoExtSeq: 0,
      reserve: 0,
      luckyWordId: "",
      lightCharNum: 0,
      luckyWord: "",
      starId: 0,
      essentialMsgSwitch: 0,
      todoSeq: 0,
      blacklistExpireTime: 0,
      isLimitGroupRtc: 0,
      companyId: 0,
      hasGroupCustomPortrait: 0,
      bindGuildId: "",
      groupOwnerId: {
        memberUin: "",
        memberUid: "",
        memberQid: ""
      },
      essentialMsgPrivilege: 0,
      msgEventSeq: "",
      inviteRobotSwitch: 0,
      gangUpId: "",
      qqMusicMedalSwitch: 0,
      showPlayTogetherSwitch: 0,
      groupFlagPro1: "",
      groupBindGuildIds: {
        guildIds: []
      },
      viewedMsgDisappearTime: "",
      groupExtFlameData: {
        switchState: 0,
        state: 0,
        dayNums: [],
        version: 0,
        updateTime: "",
        isDisplayDayNum: !1
      },
      groupBindGuildSwitch: 0,
      groupAioBindGuildId: "",
      groupExcludeGuildIds: {
        guildIds: []
      },
      fullGroupExpansionSwitch: 0,
      fullGroupExpansionSeq: "",
      inviteRobotMemberSwitch: 0,
      inviteRobotMemberExamine: 0,
      groupSquareSwitch: 0
    }
  };
}
function lQ() {
  return {
    groupInfoExtSeq: 0,
    reserve: 0,
    luckyWordId: 0,
    lightCharNum: 0,
    luckyWord: 0,
    starId: 0,
    essentialMsgSwitch: 0,
    todoSeq: 0,
    blacklistExpireTime: 0,
    isLimitGroupRtc: 0,
    companyId: 0,
    hasGroupCustomPortrait: 0,
    bindGuildId: 0,
    groupOwnerId: 0,
    essentialMsgPrivilege: 0,
    msgEventSeq: 0,
    inviteRobotSwitch: 0,
    gangUpId: 0,
    qqMusicMedalSwitch: 0,
    showPlayTogetherSwitch: 0,
    groupFlagPro1: 0,
    groupBindGuildIds: 0,
    viewedMsgDisappearTime: 0,
    groupExtFlameData: 0,
    groupBindGuildSwitch: 0,
    groupAioBindGuildId: 0,
    groupExcludeGuildIds: 0,
    fullGroupExpansionSwitch: 0,
    fullGroupExpansionSeq: 0,
    inviteRobotMemberSwitch: 0,
    inviteRobotMemberExamine: 0,
    groupSquareSwitch: 0
  };
}
class pQ {
  context;
  core;
  groupMemberCache = /* @__PURE__ */ new Map();
  essenceLRU = new Am(1e3);
  // psKey 滑动缓存，TTL 60 秒，惰性删除（不主动清理，等下次访问检测到过期再刷新）
  _qunPskeyCache = null;
  constructor(e, n) {
    this.context = e, this.core = n;
  }
  /** 获取 qun.qq.com 域名的 psKey，滑动 TTL 60 秒（每次访问顺延） */
  async getQunPskey() {
    const e = Date.now();
    if (this._qunPskeyCache && this._qunPskeyCache.expireAt > e)
      return this._qunPskeyCache.expireAt = e + 60 * 1e3, this._qunPskeyCache.value;
    const n = (await this.core.apis.UserApi.getPSkey(["qun.qq.com"])).domainPskeyMap.get("qun.qq.com");
    return this._qunPskeyCache = { value: n, expireAt: e + 60 * 1e3 }, n;
  }
  async setGroupRemark(e, n) {
    return this.context.session.getGroupService().modifyGroupRemark(e, n);
  }
  async fetchGroupDetail(e) {
    const [, n] = await this.core.eventWrapper.callNormalEventV2(
      "NodeIKernelGroupService/getGroupDetailInfo",
      "NodeIKernelGroupListener/onGroupDetailInfoChange",
      [e, n6.KDATACARD],
      (r) => r.result === 0,
      (r) => r.groupCode === e,
      1,
      5e3
    );
    return n;
  }
  async initApi() {
    this.initCache().then().catch((e) => this.context.logger.logError(e));
  }
  async createGrayTip(e, n) {
    return this.context.session.getMsgService().addLocalJsonGrayTipMsg(
      {
        chatType: Ne.KCHATTYPEGROUP,
        peerUid: e
      },
      {
        busiId: 2201,
        jsonStr: JSON.stringify({ align: "center", items: [{ txt: n, type: "nor" }] }),
        recentAbstract: n,
        isServer: !1
      },
      !0,
      !0
    );
  }
  async initCache() {
    for (const e of await this.getGroups(!0))
      this.refreshGroupMemberCache(e.groupCode, !1).then().catch((n) => this.context.logger.logError(n));
  }
  async fetchGroupEssenceList(e) {
    const n = await this.getQunPskey();
    return this.context.session.getGroupService().fetchGroupEssenceList({
      groupCode: e,
      pageStart: 0,
      pageLimit: 300
    }, n);
  }
  async getGroupShutUpMemberList(e) {
    const n = async (i, o, s) => {
      this.core.eventWrapper.registerListen(
        "NodeIKernelGroupListener/onShutUpMemberListChanged",
        (a) => a === e,
        1,
        1e3
      ).then((a) => {
        i(a[1]);
      }).catch(o), s(() => {
        o(new Error("Task was canceled"));
      });
    }, r = new cQ(n);
    return this.context.session.getGroupService().getGroupShutUpMemberList(e).then((i) => {
      i.result !== 0 && r.cancel();
    }), await r.catch(() => []);
  }
  async clearGroupNotifiesUnreadCount(e) {
    return this.context.session.getGroupService().clearGroupNotifiesUnreadCount(e);
  }
  async setGroupAvatar(e, n) {
    return this.context.session.getGroupService().setHeader(e, n);
  }
  // 0 0 无需管理员审核
  // 0 2 需要管理员审核
  // 1 2 禁止Bot入群( 最好只传一个1 ？)
  async setGroupRobotAddOption(e, n, r) {
    const i = uQ(e), o = lQ();
    return n !== void 0 && (i.extInfo.inviteRobotMemberSwitch = n, o.inviteRobotMemberSwitch = 1), r !== void 0 && (i.extInfo.inviteRobotMemberExamine = r, o.inviteRobotMemberExamine = 1), this.context.session.getGroupService().modifyGroupExtInfoV2(i, o);
  }
  async setGroupAddOption(e, n) {
    const r = KI(e);
    return r.filter.addOption = 1, (n.addOption === 4 || n.addOption === 5) && (r.filter.groupQuestion = 1, r.filter.groupAnswer = n.addOption === 4 ? 1 : 0, r.modifyInfo.groupQuestion = n.groupQuestion || "", r.modifyInfo.groupAnswer = n.addOption === 4 && n.groupAnswer || ""), r.modifyInfo.addOption = n.addOption, this.context.session.getGroupService().modifyGroupDetailInfoV2(r, 0);
  }
  async setGroupSearch(e, n) {
    const r = KI(e);
    return n.noCodeFingerOpenFlag && (r.filter.noCodeFingerOpenFlag = 1, r.modifyInfo.noCodeFingerOpenFlag = n.noCodeFingerOpenFlag), n.noFingerOpenFlag && (r.filter.noFingerOpenFlag = 1, r.modifyInfo.noFingerOpenFlag = n.noFingerOpenFlag), this.context.session.getGroupService().modifyGroupDetailInfoV2(r, 0);
  }
  async getGroups(e = !1) {
    const [, , n] = await this.core.eventWrapper.callNormalEventV2(
      "NodeIKernelGroupService/getGroupList",
      "NodeIKernelGroupListener/onGroupListUpdate",
      [e]
    );
    return n;
  }
  async getGroupExtFE0Info(e, n = !0) {
    return this.context.session.getGroupService().getGroupExt0xEF0Info(
      e,
      [],
      {
        bindGuildId: 1,
        blacklistExpireTime: 1,
        companyId: 1,
        essentialMsgPrivilege: 1,
        essentialMsgSwitch: 1,
        fullGroupExpansionSeq: 1,
        fullGroupExpansionSwitch: 1,
        gangUpId: 1,
        groupAioBindGuildId: 1,
        groupBindGuildIds: 1,
        groupBindGuildSwitch: 1,
        groupExcludeGuildIds: 1,
        groupExtFlameData: 1,
        groupFlagPro1: 1,
        groupInfoExtSeq: 1,
        groupOwnerId: 1,
        groupSquareSwitch: 1,
        hasGroupCustomPortrait: 1,
        inviteRobotMemberExamine: 1,
        inviteRobotMemberSwitch: 1,
        inviteRobotSwitch: 1,
        isLimitGroupRtc: 1,
        lightCharNum: 1,
        luckyWord: 1,
        luckyWordId: 1,
        msgEventSeq: 1,
        qqMusicMedalSwitch: 1,
        reserve: 1,
        showPlayTogetherSwitch: 1,
        starId: 1,
        todoSeq: 1,
        viewedMsgDisappearTime: 1
      },
      n
    );
  }
  async getGroupMemberAll(e, n = !1) {
    return this.context.session.getGroupService().getAllMemberList(e, n);
  }
  async refreshGroupMemberCache(e, n = !0) {
    const r = async () => {
      try {
        const i = await this.getGroupMemberAll(e, !0);
        this.groupMemberCache.set(e, i.result.infos);
      } catch (i) {
        this.context.logger.logError(`刷新群成员缓存失败, 群号: ${e}, 错误: ${i}`);
      }
    };
    return n ? await r() : r(), this.groupMemberCache.get(e);
  }
  async refreshGroupMemberCachePartial(e, n) {
    const r = await this.getGroupMemberEx(e, n, !0);
    return r && this.groupMemberCache.get(e)?.set(n, r), r;
  }
  async getGroupMember(e, n) {
    const r = e.toString(), i = n.toString();
    let o = this.groupMemberCache.get(r);
    o || (o = await this.refreshGroupMemberCache(r, !0));
    const s = () => C6(i) ? Array.from(o.values()).find((c) => c.uin === i) : o.get(i);
    let a = s();
    return a || (o = await this.refreshGroupMemberCache(r, !0), a = s()), a;
  }
  async getGroupRecommendContactArkJson(e) {
    return this.context.session.getGroupService().getGroupRecommendContactArkJson(e);
  }
  async creatGroupFileFolder(e, n) {
    return this.context.session.getRichMediaService().createGroupFolder(e, n);
  }
  async delGroupFile(e, n) {
    return this.context.session.getRichMediaService().deleteGroupFile(e, [102], n);
  }
  async delGroupFileFolder(e, n) {
    return this.context.session.getRichMediaService().deleteGroupFolder(e, n);
  }
  async transGroupFile(e, n) {
    return this.context.session.getRichMediaService().transGroupFile(e, n);
  }
  async addGroupEssence(e, n) {
    const r = await this.context.session.getMsgService().getMsgsIncludeSelf({
      chatType: 2,
      guildId: "",
      peerUid: e
    }, n, 1, !1);
    if (!r.msgList[0])
      throw new Error("消息不存在");
    const i = {
      groupCode: e,
      msgRandom: parseInt(r.msgList[0].msgRandom),
      msgSeq: parseInt(r.msgList[0].msgSeq)
    };
    return this.context.session.getGroupService().addGroupEssence(i);
  }
  async kickMemberV2Inner(e) {
    return this.context.session.getGroupService().kickMemberV2(e);
  }
  async deleteGroupBulletin(e, n) {
    const r = await this.getQunPskey();
    return this.context.session.getGroupService().deleteGroupBulletin(e, r, n);
  }
  async quitGroupV2(e, n) {
    const r = {
      groupCode: e,
      needDeleteLocalMsg: n
    };
    return this.context.session.getGroupService().quitGroupV2(r);
  }
  async removeGroupEssenceBySeq(e, n, r) {
    const i = {
      groupCode: e,
      msgRandom: parseInt(n),
      msgSeq: parseInt(r)
    };
    return this.context.session.getGroupService().removeGroupEssence(i);
  }
  async removeGroupEssence(e, n) {
    const r = await this.context.session.getMsgService().getMsgsIncludeSelf({
      chatType: 2,
      guildId: "",
      peerUid: e
    }, n, 1, !1);
    if (!r.msgList[0])
      throw new Error("消息不存在");
    const i = {
      groupCode: e,
      msgRandom: parseInt(r.msgList[0].msgRandom),
      msgSeq: parseInt(r.msgList[0].msgSeq)
    };
    return this.context.session.getGroupService().removeGroupEssence(i);
  }
  async getSingleScreenNotifies(e, n) {
    const [, , , r] = await this.core.eventWrapper.callNormalEventV2(
      "NodeIKernelGroupService/getSingleScreenNotifies",
      "NodeIKernelGroupListener/onGroupSingleScreenNotifies",
      [
        e,
        "",
        n
      ]
    );
    return r;
  }
  async searchGroup(e) {
    const [, n] = await this.core.eventWrapper.callNormalEventV2(
      "NodeIKernelSearchService/searchGroup",
      "NodeIKernelSearchListener/onSearchGroupResult",
      [{
        keyWords: e,
        groupNum: 25,
        exactSearch: !1,
        penetrate: ""
      }],
      (r) => r.result === 0,
      (r) => !!r.groupInfos.find((i) => i.groupCode === e),
      1,
      5e3
    );
    return n.groupInfos.find((r) => r.groupCode === e);
  }
  async getGroupMemberEx(e, n, r = !1, i = 2) {
    const o = await I6((s, a, c, u = !1) => s.callNormalEventV2(
      "NodeIKernelGroupService/getMemberInfo",
      "NodeIKernelGroupListener/onMemberInfoChange",
      [e, [c], u],
      (l) => l.result === 0,
      (l, d, f) => l === a && f.size > 0 && f.has(c),
      1,
      u ? 2500 : 250
    ), this.core.eventWrapper, e, n, r);
    if (o && o[3] instanceof Map && o[3].has(n))
      return o[3].get(n);
    if (i > 0) {
      const s = await this.getGroupMemberEx(e, n, !0, i - 1);
      if (s) return s;
    }
  }
  async getGroupFileCount(e) {
    return this.context.session.getRichMediaService().batchGetGroupFileCount(e);
  }
  // getGroupFileList also carries the group's used/total space in its call
  // result's `groupSpaceResult`; a single-item fetch is enough to read it.
  async getGroupFileSpace(e) {
    const [n] = await this.core.eventWrapper.callNormalEventV2(
      "NodeIKernelRichMediaService/getGroupFileList",
      "NodeIKernelMsgListener/onGroupFileInfoUpdate",
      [
        e,
        { sortType: 1, fileCount: 1, startIndex: 0, sortOrder: 1, showOnlinedocFolder: 0 }
      ],
      () => !0,
      () => !0,
      1,
      5e3
    );
    return n?.groupSpaceResult;
  }
  async getArkJsonGroupShare(e) {
    return (await this.core.eventWrapper.callNoListenerEvent(
      "NodeIKernelGroupService/getGroupRecommendContactArkJson",
      e
    )).arkJson;
  }
  async uploadGroupBulletinPic(e, n) {
    const r = await this.getQunPskey();
    return this.context.session.getGroupService().uploadGroupBulletinPic(e, r, n);
  }
  async handleGroupRequest(e, n, r, i) {
    return this.context.session.getGroupService().operateSysNotify(
      e,
      {
        operateType: r,
        targetMsg: {
          seq: n.seq,
          // 通知序列号
          type: n.type,
          groupCode: n.group.groupCode,
          postscript: i ?? " "
          // 仅传空值可能导致处理失败，故默认给个空格
        }
      }
    );
  }
  async quitGroup(e) {
    return this.context.session.getGroupService().quitGroup(e);
  }
  async kickMember(e, n, r = !1, i = "") {
    return this.context.session.getGroupService().kickMember(e, n, r, i);
  }
  async banMember(e, n) {
    return this.context.session.getGroupService().setMemberShutUp(e, n);
  }
  async banGroup(e, n) {
    return this.context.session.getGroupService().setGroupShutUp(e, n);
  }
  async setMemberCard(e, n, r) {
    return this.context.session.getGroupService().modifyMemberCardName(e, n, r);
  }
  async setMemberRole(e, n, r) {
    return this.context.session.getGroupService().modifyMemberRole(e, n, r);
  }
  async setGroupName(e, n, r = !1) {
    return this.context.session.getGroupService().modifyGroupName(e, n, r);
  }
  async publishGroupBulletin(e, n, r = void 0, i = 0, o = 0) {
    const s = await this.getQunPskey(), a = {
      text: encodeURI(n),
      picInfo: r,
      oldFeedsId: "",
      pinned: i,
      confirmRequired: o
    };
    return this.context.session.getGroupService().publishGroupBulletin(e, s, a);
  }
  async getGroupRemainAtTimes(e) {
    return this.context.session.getGroupService().getGroupRemainAtTimes(e);
  }
  async getMemberExtInfo(e, n) {
    return this.context.session.getGroupService().getMemberExtInfo(
      {
        groupCode: e,
        sourceType: i6.TITLETYPE,
        beginUin: "0",
        dataTime: "0",
        uinList: [n],
        uinNum: "",
        seq: "",
        groupType: "",
        richCardNameVer: "",
        memberExtFilter: {
          memberLevelInfoUin: 1,
          memberLevelInfoPoint: 1,
          memberLevelInfoActiveDay: 1,
          memberLevelInfoLevel: 1,
          memberLevelInfoName: 1,
          levelName: 1,
          dataTime: 1,
          userShowFlag: 1,
          sysShowFlag: 1,
          timeToUpdate: 1,
          nickName: 1,
          specialTitle: 1,
          levelNameNew: 1,
          userShowFlagNew: 1,
          msgNeedField: 1,
          cmdUinFlagExt3Grocery: 1,
          memberIcon: 1,
          memberInfoSeq: 1
        }
      }
    );
  }
}
class dQ {
  context;
  core;
  constructor(e, n) {
    this.context = e, this.core = n;
  }
  async clickInlineKeyboardButton(...e) {
    return this.context.session.getMsgService().clickInlineKeyboardButton(...e);
  }
  getMsgByClientSeqAndTime(e, n, r) {
    return this.context.session.getMsgService().getMsgByClientSeqAndTime(e, n, r);
  }
  async getAioFirstViewLatestMsgs(e, n) {
    return this.context.session.getMsgService().getAioFirstViewLatestMsgs(e, n);
  }
  async sendShowInputStatusReq(e, n) {
    return this.context.session.getMsgService().sendShowInputStatusReq(e.chatType, n, e.peerUid);
  }
  async getSourceOfReplyMsgV2(e, n, r) {
    return this.context.session.getMsgService().getSourceOfReplyMsgV2(e, n, r);
  }
  async getMsgEmojiLikesList(e, n, r, i, o = "", s = 20) {
    return this.context.session.getMsgService().getMsgEmojiLikesList(e, n, r, i, o, !1, s);
  }
  async setEmojiLike(e, n, r, i = !0) {
    return r = r.toString(), this.context.session.getMsgService().setMsgEmojiLikes(e, n, r, r.length > 3 ? "2" : "1", i);
  }
  async getMultiMsg(e, n, r) {
    return this.context.session.getMsgService().getMultiMsg(e, n, r);
  }
  async ForwardMsg(e, n) {
    return this.context.session.getMsgService().forwardMsg(n, e, [e], /* @__PURE__ */ new Map());
  }
  async getMsgsByMsgId(e, n) {
    if (!e) throw new Error("peer is not allowed");
    if (!n) throw new Error("msgIds is not allowed");
    return await this.context.session.getMsgService().getMsgsByMsgId(e, n);
  }
  async getSingleMsg(e, n) {
    return await this.context.session.getMsgService().getSingleMsg(e, n);
  }
  async fetchFavEmojiList(e) {
    return this.context.session.getMsgService().fetchFavEmojiList("", e, !0, !0);
  }
  async addFavEmoji(e) {
    return this.context.session.getMsgService().addFavEmoji(e);
  }
  async deleteFavEmoji(e) {
    return this.context.session.getMsgService().deleteFavEmoji(e);
  }
  async modifyFavEmojiDesc(e) {
    return this.context.session.getMsgService().modifyFavEmojiDesc(e);
  }
  async queryMsgsWithFilterExWithSeq(e, n) {
    return await this.context.session.getMsgService().queryMsgsWithFilterEx("0", "0", n, {
      chatInfo: e,
      // searchFields: 3,
      filterMsgType: [],
      filterSendersUid: [],
      filterMsgToTime: "0",
      filterMsgFromTime: "0",
      isReverseOrder: !1,
      isIncludeCurrent: !0,
      pageLimit: 1
    });
  }
  async queryMsgsWithFilterExWithSeqV2(e, n, r, i) {
    return await this.context.session.getMsgService().queryMsgsWithFilterEx("0", "0", n, {
      chatInfo: e,
      filterMsgType: [],
      // searchFields: 3,
      filterSendersUid: i,
      filterMsgToTime: r,
      filterMsgFromTime: r,
      isReverseOrder: !1,
      isIncludeCurrent: !0,
      pageLimit: 1
    });
  }
  async queryMsgsWithFilterExWithSeqV3(e, n, r) {
    return await this.context.session.getMsgService().queryMsgsWithFilterEx("0", "0", n, {
      chatInfo: e,
      filterMsgType: [],
      filterSendersUid: r,
      filterMsgToTime: "0",
      filterMsgFromTime: "0",
      isReverseOrder: !1,
      // searchFields: 3,
      isIncludeCurrent: !0,
      pageLimit: 1
    });
  }
  async queryFirstMsgBySeq(e, n) {
    return await this.context.session.getMsgService().queryMsgsWithFilterEx("0", "0", n, {
      chatInfo: e,
      filterMsgType: [],
      filterSendersUid: [],
      filterMsgToTime: "0",
      // searchFields: 3,
      filterMsgFromTime: "0",
      isReverseOrder: !0,
      isIncludeCurrent: !0,
      pageLimit: 1
    });
  }
  // 客户端还在用别慌
  async getMsgsBySeqAndCount(e, n, r, i, o) {
    return await this.context.session.getMsgService().getMsgsBySeqAndCount(e, n, r, i, o);
  }
  async getMsgExBySeq(e, n) {
    const r = Math.floor(Date.now() / 1e3), i = (r - 300).toString(), o = r.toString();
    return await this.context.session.getMsgService().queryMsgsWithFilterEx("0", "0", n, {
      chatInfo: e,
      // 此处为Peer 为关键查询参数 没有啥也没有 by mlik iowa
      filterMsgType: [],
      filterSendersUid: [],
      // searchFields: 3,
      filterMsgToTime: o,
      filterMsgFromTime: i,
      isReverseOrder: !1,
      isIncludeCurrent: !0,
      pageLimit: 100
    });
  }
  async queryFirstMsgBySender(e, n) {
    return await this.context.session.getMsgService().queryMsgsWithFilterEx("0", "0", "0", {
      chatInfo: e,
      filterMsgType: [],
      filterSendersUid: n,
      // searchFields: 3,
      filterMsgToTime: "0",
      filterMsgFromTime: "0",
      isReverseOrder: !0,
      isIncludeCurrent: !0,
      pageLimit: 2e4
    });
  }
  async setMsgRead(e) {
    return this.context.session.getMsgService().setMsgRead(e);
  }
  async getGroupFileList(e, n) {
    const r = [];
    let i = n.startIndex;
    for (; ; ) {
      n.startIndex = i;
      const [, o] = await this.core.eventWrapper.callNormalEventV2(
        "NodeIKernelRichMediaService/getGroupFileList",
        "NodeIKernelMsgListener/onGroupFileInfoUpdate",
        [
          e,
          n
        ],
        () => !0,
        () => !0,
        // 应当通过 groupFileListResult 判断
        1,
        5e3
      );
      if (!o?.item?.length || (r.push(...o.item), o.isEnd) || r.length === n.fileCount) break;
      i = o.nextIndex;
    }
    return r;
  }
  async getMsgHistory(e, n, r, i = !1) {
    return this.context.session.getMsgService().getMsgsIncludeSelf(e, n, r, i);
  }
  async recallMsg(e, n) {
    return await this.core.eventWrapper.callNormalEventV2(
      "NodeIKernelMsgService/recallMsg",
      "NodeIKernelMsgListener/onMsgInfoListUpdate",
      [e, [n]],
      () => !0,
      (r) => r.find((i) => i.msgId === n && i.recallTime !== "0") !== void 0,
      1,
      1e3
    );
  }
  async PrepareTempChat(e, n, r) {
    return this.context.session.getMsgService().prepareTempChat({
      chatType: Ne.KCHATTYPETEMPC2CFROMGROUP,
      peerUid: e,
      peerNickname: r,
      fromGroupCode: n,
      sig: "",
      selfPhone: "",
      selfUid: this.core.selfInfo.uid,
      gameSession: {
        nickname: "",
        gameAppId: "",
        selfTinyId: "",
        peerRoleId: "",
        peerOpenId: ""
      }
    });
  }
  async getTempChatInfo(e, n) {
    return this.context.session.getMsgService().getTempChatInfo(e, n);
  }
  async sendMsg(e, n, r = 1e4) {
    if (e.chatType === Ne.KCHATTYPETEMPC2CFROMGROUP && e.guildId && e.guildId !== "") {
      const s = await this.core.apis.GroupApi.getGroupMember(e.guildId, e.peerUid);
      s && await this.PrepareTempChat(e.peerUid, e.guildId, s.nick);
    }
    const i = await this.generateMsgUniqueId(e.chatType);
    e.guildId = i;
    const [, o] = await this.core.eventWrapper.callNormalEventV2(
      "NodeIKernelMsgService/sendMsg",
      "NodeIKernelMsgListener/onMsgInfoListUpdate",
      [
        "0",
        e,
        n,
        /* @__PURE__ */ new Map()
      ],
      (s) => s.result === 0,
      (s) => {
        for (const a of s)
          if (a.guildId === i && a.sendStatus === Dp.KSEND_STATUS_SUCCESS)
            return !0;
        return !1;
      },
      1,
      r
    );
    return o.find((s) => s.guildId === i);
  }
  async generateMsgUniqueId(e) {
    return this.context.session.getMsgService().generateMsgUniqueId(e, this.context.session.getMSFService().getServerTime());
  }
  async forwardMsg(e, n, r) {
    return this.context.session.getMsgService().forwardMsg(r, e, [n], /* @__PURE__ */ new Map());
  }
  async multiForwardMsg(e, n, r) {
    const i = r.map((s) => ({ msgId: s, senderShowName: this.core.selfInfo.nick })), [, o] = await this.core.eventWrapper.callNormalEventV2(
      "NodeIKernelMsgService/multiForwardMsgWithComment",
      "NodeIKernelMsgListener/onMsgInfoListUpdate",
      [
        i,
        e,
        n,
        [],
        /* @__PURE__ */ new Map()
      ],
      () => !0,
      (s) => s.some(
        (a) => a.peerUid === n.peerUid && a.senderUid === this.core.selfInfo.uid
      )
    );
    for (const s of o) {
      const a = s.elements.find((u) => u.arkElement);
      if (!(!a || JSON.parse(a.arkElement?.bytesData ?? "").app !== "com.tencent.multimsg") && s.peerUid === n.peerUid && s.senderUid === this.core.selfInfo.uid)
        return s;
    }
    throw new Error("转发消息超时");
  }
  async markAllMsgAsRead() {
    return this.context.session.getMsgService().setAllC2CAndGroupMsgRead();
  }
}
class VI {
  handlers = [];
  checker;
  constructor(e) {
    this.checker = e || (async (n) => n);
  }
  add(e) {
    return this.handlers.push(e), this;
  }
  // 执行处理程序链
  async run() {
    const e = [];
    for (const n of this.handlers)
      try {
        const r = await n(), i = await this.checker(r);
        if (i)
          return i;
      } catch (r) {
        e.push(r instanceof Error ? r : new Error(String(r)));
      }
    throw new AggregateError(e, "All handlers failed");
  }
}
class YI {
  static boolchecker(e, n) {
    if (n)
      return e;
    throw new Error("Condition is false, throwing error");
  }
}
class fQ {
  context;
  core;
  constructor(e, n) {
    this.context = e, this.core = n;
  }
  async getCoreAndBaseInfo(e) {
    return await this.core.eventWrapper.callNoListenerEvent(
      "NodeIKernelProfileService/getCoreAndBaseInfo",
      "nodeStore",
      e
    );
  }
  // 默认获取自己的 type = 2 获取别人 type = 1
  async getProfileLike(e, n, r, i = 2) {
    return this.context.session.getProfileLikeService().getBuddyProfileLike({
      friendUids: [e],
      basic: 1,
      vote: 1,
      favorite: 0,
      userProfile: 1,
      type: i,
      start: n,
      limit: r
    });
  }
  async setLongNick(e) {
    return this.context.session.getProfileService().setLongNick(e);
  }
  async setSelfOnlineStatus(e, n, r) {
    return this.context.session.getMsgService().setStatus({
      status: e,
      extStatus: n,
      batteryStatus: r
    });
  }
  async setDiySelfOnlineStatus(e, n, r) {
    return this.context.session.getMsgService().setStatus({
      status: 10,
      extStatus: 2e3,
      customStatus: { faceId: e, wording: n, faceType: r },
      batteryStatus: 0
    });
  }
  async getBuddyRecommendContactArkJson(e, n = "") {
    return this.context.session.getBuddyService().getBuddyRecommendContactArkJson(e, n);
  }
  async like(e, n = 1) {
    return this.context.session.getProfileLikeService().setBuddyProfileLike({
      friendUid: e,
      sourceId: 71,
      doLikeCount: n,
      doLikeTollCount: 0
    });
  }
  async setQQAvatar(e) {
    const n = await this.context.session.getProfileService().setHeader(e);
    return { result: n?.result, errMsg: n?.errMsg };
  }
  async setGroupAvatar(e, n) {
    return this.context.session.getGroupService().setHeader(e, n);
  }
  async fetchUserDetailInfo(e, n = Kl.KDB) {
    const [, r] = await this.core.eventWrapper.callNormalEventV2(
      "NodeIKernelProfileService/fetchUserDetailInfo",
      "NodeIKernelProfileListener/onUserDetailInfoChanged",
      [
        "BuddyProfileStore",
        [e],
        n,
        [t6.KALL]
      ],
      () => !0,
      (i) => i.uid === e
    );
    return r;
  }
  async getUserDetailInfo(e, n = !1) {
    let r = await I6(async (i) => this.fetchUserDetailInfo(i, n ? Kl.KSERVER : Kl.KDB), e);
    return r && r.uin !== "0" && r.commonExt ? {
      ...r.simpleInfo.status,
      ...r.simpleInfo.vasInfo,
      ...r.commonExt,
      ...r.simpleInfo.baseInfo,
      ...r.simpleInfo.coreInfo,
      qqLevel: r.commonExt?.qqLevel,
      age: r.simpleInfo.baseInfo.age,
      pendantId: "",
      nick: r.simpleInfo.coreInfo.nick || ""
    } : (this.context.logger.logDebug("[NapCat] [Mark] getUserDetailInfo Mode1 Failed."), r = await this.fetchUserDetailInfo(e, Kl.KSERVER), r && r.uin === "0" && (r.uin = await this.core.apis.UserApi.getUidByUinV2(e) ?? "0"), {
      ...r.simpleInfo.status,
      ...r.simpleInfo.vasInfo,
      ...r.commonExt,
      ...r.simpleInfo.baseInfo,
      ...r.simpleInfo.coreInfo,
      qqLevel: r.commonExt?.qqLevel,
      age: r.simpleInfo.baseInfo.age,
      pendantId: "",
      nick: r.simpleInfo.coreInfo.nick || ""
    });
  }
  async modifySelfProfile(e) {
    return this.context.session.getProfileService().modifyDesktopMiniProfile(e);
  }
  async getCookies(e) {
    const n = await this.forceFetchClientKey(), r = "https://ssl.ptlogin2.qq.com/jump?ptlang=1033&clientuin=" + this.core.selfInfo.uin + "&clientkey=" + n.clientKey + "&u1=https%3A%2F%2F" + e + "%2F" + this.core.selfInfo.uin + "%2Finfocenter&keyindex=19%27", i = await ln.HttpsGetCookies(r);
    if (!i.p_skey || i.p_skey.length === 0)
      try {
        const o = (await this.getPSkey([e])).domainPskeyMap.get(e);
        o && (i.p_skey = o);
      } catch {
        return i;
      }
    return i;
  }
  async getPSkey(e) {
    return await this.context.session.getTipOffService().getPskey(e, !0);
  }
  async getRobotUinRange() {
    return (await this.context.session.getRobotService().getRobotUinRange({
      justFetchMsgConfig: "1",
      type: 1,
      version: 0,
      aioKeywordVersion: 0
    }))?.response?.robotUinRanges;
  }
  // 需要异常处理
  async getQzoneCookies() {
    const e = await this.forceFetchClientKey(), n = "https://ssl.ptlogin2.qq.com/jump?ptlang=1033&clientuin=" + this.core.selfInfo.uin + "&clientkey=" + e.clientKey + "&u1=https%3A%2F%2Fuser.qzone.qq.com%2F" + this.core.selfInfo.uin + "%2Finfocenter&keyindex=19%27";
    return await ln.HttpsGetCookies(n);
  }
  // 需要异常处理
  async getSKey() {
    const e = await this.forceFetchClientKey();
    if (e.result !== 0)
      throw new Error("getClientKey Error");
    const n = e.clientKey, r = "https://ssl.ptlogin2.qq.com/jump?ptlang=1033&clientuin=" + this.core.selfInfo.uin + "&clientkey=" + n + "&u1=https%3A%2F%2Fh5.qzone.qq.com%2Fqqnt%2Fqzoneinpcqq%2Ffriend%3Frefresh%3D0%26clientuin%3D0%26darkMode%3D0&keyindex=19%27", o = (await ln.HttpsGetCookies(r)).skey;
    if (!o)
      throw new Error("SKey is Empty");
    return o;
  }
  async getUidByUinV2(e) {
    return e ? await new VI((i) => YI.boolchecker(i, i !== void 0 && i.indexOf("*") === -1 && i !== "")).add(() => this.context.session.getUixConvertService().getUid([e]).then((i) => i.uidInfo.get(e))).add(() => this.context.session.getProfileService().getUidByUin("FriendsServiceImpl", [e]).get(e)).add(() => this.context.session.getGroupService().getUidByUins([e]).then((i) => i.uids.get(e))).add(() => this.getUserDetailInfoByUin(e).then((i) => i.detail.uid)).run().catch(() => "") ?? "" : "";
  }
  async getUinByUidV2(e) {
    return e ? await new VI((i) => YI.boolchecker(i, i !== void 0 && i !== "0" && i !== "")).add(() => this.context.session.getUixConvertService().getUin([e]).then((i) => i.uinInfo.get(e))).add(() => this.context.session.getProfileService().getUinByUid("FriendsServiceImpl", [e]).get(e)).add(() => this.context.session.getGroupService().getUinByUids([e]).then((i) => i.uins.get(e))).add(() => this.getUserDetailInfo(e).then((i) => i.uin)).run().catch(() => "0") ?? "0" : "0";
  }
  async getRecentContactListSnapShot(e) {
    return await this.context.session.getRecentContactService().getRecentContactListSnapShot(e);
  }
  async getRecentContactListSyncLimit(e) {
    return await this.context.session.getRecentContactService().getRecentContactListSyncLimit(e);
  }
  async getRecentContactListSync() {
    return await this.context.session.getRecentContactService().getRecentContactListSync();
  }
  async getRecentContactList() {
    return await this.context.session.getRecentContactService().getRecentContactList();
  }
  async getUserDetailInfoByUin(e) {
    return await this.core.eventWrapper.callNoListenerEvent(
      "NodeIKernelProfileService/getUserDetailInfoByUin",
      e
    );
  }
  async forceFetchClientKey() {
    return await this.context.session.getTicketService().forceFetchClientKey("");
  }
}
function hQ({
  uin: t,
  group_id: e,
  pskey: n,
  pic_md5: r,
  img_size: i,
  img_name: o,
  sAlbumName: s,
  sAlbumID: a,
  photo_num: c = "1",
  video_num: u = "0",
  batch_num: l = "1"
}) {
  const d = Math.floor(Date.now() / 1e3);
  return {
    control_req: [
      {
        uin: t,
        token: {
          type: 4,
          data: n,
          appid: 5
        },
        appid: "qun",
        checksum: r,
        check_type: 0,
        file_len: i,
        env: {
          refer: "qzone",
          deviceInfo: "h5"
        },
        model: 0,
        biz_req: {
          sPicTitle: o,
          sPicDesc: "",
          sAlbumName: s,
          sAlbumID: a,
          iAlbumTypeID: 0,
          iBitmap: 0,
          iUploadType: 0,
          iUpPicType: 0,
          iBatchID: d,
          sPicPath: "",
          iPicWidth: 0,
          iPicHight: 0,
          iWaterType: 0,
          iDistinctUse: 0,
          iNeedFeeds: 1,
          iUploadTime: d,
          mapExt: {
            appid: "qun",
            userid: e
          },
          stExtendInfo: {
            mapParams: {
              photo_num: c,
              video_num: u,
              batch_num: l
            }
          }
        },
        session: "",
        asy_upload: 0,
        cmd: "FileUpload"
      }
    ]
  };
}
function mQ(t, e, n) {
  return {
    cell_common: {
      time: ""
    },
    cell_user_info: {
      user: {
        uin: t
      }
    },
    cell_media: {
      album_id: e,
      batch_id: "",
      media_items: [{
        image: {
          lloc: n
        }
      }]
    }
  };
}
function gQ(t, e, n) {
  return {
    client_key: n,
    // 暂时只支持纯文本吧
    content: [{
      type: 0,
      content: e,
      who: 0,
      uid: "",
      name: "",
      url: ""
    }],
    user: {
      uin: t
    }
  };
}
function yQ(t, e, n, r) {
  return {
    cell_common: {
      time: Date.now(),
      feed_id: `422_0_${r}`
      // 需要补全feed_id
    },
    cell_user_info: {
      user: {
        uin: e
      }
    },
    cell_media: {
      album_id: n,
      batch_id: r
    },
    cell_qun_info: {
      qun_id: t
    }
  };
}
class vQ {
  context;
  core;
  constructor(e, n) {
    this.context = e, this.core = n;
  }
  async shareDigest(e, n, r, i) {
    const o = await this.core.apis.UserApi.getCookies("qun.qq.com"), s = `https://qun.qq.com/cgi-bin/group_digest/share_digest?${new URLSearchParams({
      bkn: this.getBknFromCookie(o),
      group_code: e,
      msg_seq: n,
      msg_random: r,
      target_group_code: i
    }).toString()}`;
    try {
      return ln.HttpGetText(s, "GET", "", { Cookie: this.cookieToString(o) });
    } catch {
      return;
    }
  }
  async getGroupEssenceMsgAll(e) {
    const n = [];
    for (let r = 0; r < 20; r++) {
      const i = await this.getGroupEssenceMsg(e, r, 50);
      if (!i || (n.push(i), i.data.is_end)) break;
    }
    return n;
  }
  async getGroupEssenceMsg(e, n = 0, r = 50) {
    const i = await this.core.apis.UserApi.getCookies("qun.qq.com"), o = `https://qun.qq.com/cgi-bin/group_digest/digest_list?${new URLSearchParams({
      bkn: this.getBknFromCookie(i),
      page_start: n.toString(),
      page_limit: r.toString(),
      group_code: e
    }).toString()}`;
    try {
      const s = await ln.HttpGetJson(
        o,
        "GET",
        "",
        { Cookie: this.cookieToString(i) }
      );
      return s.retcode === 0 ? s : void 0;
    } catch {
      return;
    }
  }
  async getGroupMembers(e) {
    const n = new Array(), r = await this.core.apis.UserApi.getCookies("qun.qq.com"), i = [], o = await ln.HttpGetJson(
      `https://qun.qq.com/cgi-bin/qun_mgr/search_group_members?${new URLSearchParams({
        st: "0",
        end: "40",
        sort: "1",
        gc: e,
        bkn: this.getBknFromCookie(r)
      }).toString()}`,
      "POST",
      "",
      { Cookie: this.cookieToString(r) }
    );
    if (!o?.count || o?.errcode !== 0 || !o?.mems)
      return [];
    for (const a in o.mems)
      o.mems[a] && n.push(o.mems[a]);
    const s = Math.ceil(o.count / 40);
    for (let a = 2; a <= s; a++) {
      const c = ln.HttpGetJson(
        `https://qun.qq.com/cgi-bin/qun_mgr/search_group_members?${new URLSearchParams({
          st: ((a - 1) * 40).toString(),
          end: (a * 40).toString(),
          sort: "1",
          gc: e,
          bkn: this.getBknFromCookie(r)
        }).toString()}`,
        "POST",
        "",
        { Cookie: this.cookieToString(r) }
      );
      i.push(c);
    }
    for (let a = 1; a <= s; a++) {
      const c = await i[a];
      if (!(!c?.count || c?.errcode !== 0 || !c?.mems))
        for (const u in c.mems)
          c.mems[u] && n.push(c.mems[u]);
    }
    return n;
  }
  // public  async addGroupDigest(groupCode: string, msgSeq: string) {
  //   const url = `https://qun.qq.com/cgi-bin/group_digest/cancel_digest?random=665&X-CROSS-ORIGIN=fetch&group_code=${groupCode}&msg_seq=${msgSeq}&msg_random=444021292`;
  //   const res = await this.request(url);
  //   return await res.json();
  // }
  // public async getGroupDigest(groupCode: string) {
  //   const url = `https://qun.qq.com/cgi-bin/group_digest/digest_list?random=665&X-CROSS-ORIGIN=fetch&group_code=${groupCode}&page_start=0&page_limit=20`;
  //   const res = await this.request(url);
  //   return await res.json();
  // }
  async setGroupNotice(e, n, r = 0, i = 1, o = 1, s = 1, a = 1, c = "", u = 540, l = 300) {
    const d = await this.core.apis.UserApi.getCookies("qun.qq.com");
    try {
      const f = JSON.stringify({
        is_show_edit_card: o,
        tip_window_type: s,
        confirm_required: a
      }), m = {
        pic: c,
        imgWidth: u.toString(),
        imgHeight: l.toString()
      };
      return await ln.HttpGetJson(
        `https://web.qun.qq.com/cgi-bin/announce/add_qun_notice?${new URLSearchParams({
          bkn: this.getBknFromCookie(d),
          qid: e,
          text: n,
          pinned: r.toString(),
          type: i.toString(),
          settings: f,
          ...c === "" ? {} : m
        }).toString()}`,
        "POST",
        "",
        { Cookie: this.cookieToString(d) }
      );
    } catch {
      return;
    }
  }
  async getGroupNotice(e) {
    const n = await this.core.apis.UserApi.getCookies("qun.qq.com");
    try {
      const r = await ln.HttpGetJson(
        `https://web.qun.qq.com/cgi-bin/announce/get_t_list?${new URLSearchParams({
          bkn: this.getBknFromCookie(n),
          qid: e,
          ft: "23",
          ni: "1",
          n: "1",
          i: "1",
          log_read: "1",
          platform: "1",
          s: "-1"
        }).toString()}&n=20`,
        "GET",
        "",
        { Cookie: this.cookieToString(n) }
      );
      return r?.ec === 0 ? r : void 0;
    } catch {
      return;
    }
  }
  async getDataInternal(e, n, r) {
    let i;
    try {
      const o = await ln.HttpGetText(
        `https://qun.qq.com/interactive/honorlist?${new URLSearchParams({
          gc: n,
          type: r.toString()
        }).toString()}`,
        "GET",
        "",
        { Cookie: this.cookieToString(e) }
      ), s = /window\.__INITIAL_STATE__=(.*?);/.exec(o);
      return s?.[1] && (i = JSON.parse(s[1].trim())), r === 1 ? i?.talkativeList : i?.actorList;
    } catch (o) {
      this.context.logger.logDebug("获取当前群荣耀失败", o);
      return;
    }
  }
  async getHonorList(e, n, r) {
    const i = await this.getDataInternal(e, n, r);
    return i ? i.map((o) => ({
      user_id: o?.uin,
      nickname: o?.name,
      avatar: o?.avatar,
      description: o?.desc
    })) : (this.context.logger.logError(`获取类型 ${r} 的荣誉信息失败`), []);
  }
  async getGroupHonorInfo(e, n) {
    const r = await this.core.apis.UserApi.getCookies("qun.qq.com"), i = {
      group_id: Number(e),
      current_talkative: {},
      talkative_list: [],
      performer_list: [],
      legend_list: [],
      emotion_list: [],
      strong_newbie_list: []
    };
    if (n === ti.TALKATIVE || n === ti.ALL) {
      const o = await this.getHonorList(r, e, 1);
      o.length > 0 && (i.current_talkative = o[0], i.talkative_list = o);
    }
    return (n === ti.PERFORMER || n === ti.ALL) && (i.performer_list = await this.getHonorList(r, e, 2)), (n === ti.LEGEND || n === ti.ALL) && (i.legend_list = await this.getHonorList(r, e, 3)), (n === ti.EMOTION || n === ti.ALL) && (i.emotion_list = await this.getHonorList(r, e, 6)), (n === ti.EMOTION || n === ti.ALL) && (i.strong_newbie_list = []), i;
  }
  cookieToString(e) {
    return Object.entries(e).map(([n, r]) => `${n}=${r}`).join("; ");
  }
  getBknFromCookie(e) {
    const n = e.skey;
    let r = 5381;
    for (let i = 0; i < n.length; i++) {
      const o = n.charCodeAt(i);
      r = r + (r << 5) + o;
    }
    return (r & 2147483647).toString();
  }
  getBknFromSKey(e) {
    let n = 5381;
    for (let r = 0; r < e.length; r++) {
      const i = e.charCodeAt(r);
      n = n + (n << 5) + i;
    }
    return (n & 2147483647).toString();
  }
  getBknFromPSKey(e) {
    return this.getBknFromSKey(e);
  }
  async getAlbumListByNTQQ(e, n = "") {
    return await this.context.session.getAlbumService().getAlbumList({
      qun_id: e,
      attach_info: n,
      seq: 3331,
      request_time_line: {
        request_invoke_time: "0"
      }
    });
  }
  async getAlbumList(e) {
    const n = await this.core.apis.UserApi.getSKey() || "", r = (await this.core.apis.UserApi.getPSkey(["qzone.qq.com"])).domainPskeyMap.get("qzone.qq.com") || "", i = this.getBknFromSKey(n), o = this.core.selfInfo.uin || "10001", s = `p_uin=o${this.core.selfInfo.uin}; p_skey=${r}; skey=${n}; uin=o${o} `, a = "https://h5.qzone.qq.com/proxy/domain/u.photo.qzone.qq.com/cgi-bin/upp/qun_list_album_v2?", c = new URLSearchParams({
      random: "7570",
      g_tk: i,
      format: "json",
      inCharset: "utf-8",
      outCharset: "utf-8",
      qua: "V1_IPH_SQ_6.2.0_0_HDBM_T",
      cmd: "qunGetAlbumList",
      qunId: e,
      qunid: e,
      start: "0",
      num: "1000",
      uin: o,
      getMemberRole: "0"
    });
    return (await ln.HttpGetJson(a + c.toString(), "GET", "", {
      Cookie: s
    })).data.album;
  }
  async createQunAlbumSession(e, n, r, i, o, s, a, c) {
    const l = Fo(i).length, d = lO(i), f = this.getBknFromSKey(o), m = `p_uin=o${c}; p_skey=${s}; skey=${o}; uin=o${c}`, h = hQ({
      uin: c,
      group_id: e,
      pskey: s,
      pic_md5: a,
      img_size: l,
      img_name: d,
      sAlbumName: r,
      sAlbumID: n
    }), y = `https://h5.qzone.qq.com/webapp/json/sliceUpload/FileBatchControl/${a}?g_tk=${f}`;
    return await ln.HttpGetJson(y, "POST", h, {
      Cookie: m,
      "Content-Type": "application/json"
    });
  }
  async uploadQunAlbumSlice(e, n, r, i, o, s) {
    const a = bL(e).size;
    let c = 0, u = 0;
    const l = this.getBknFromSKey(r), d = `p_uin=o${o}; p_skey=${i}; skey=${r}; uin=o${o}`, f = xL(e, { highWaterMark: s });
    for await (const m of f) {
      const h = Math.min(u + m.length, a), y = new FormData();
      y.append("uin", o), y.append("appid", "qun"), y.append("session", n), y.append("offset", u.toString()), y.append("data", new Blob([m], { type: "application/octet-stream" }), "blob"), y.append("checksum", ""), y.append("check_type", "0"), y.append("retry", "0"), y.append("seq", c.toString()), y.append("end", h.toString()), y.append("cmd", "FileUpload"), y.append("slice_size", s.toString()), y.append("biz_req.iUploadType", "0");
      const x = `https://h5.qzone.qq.com/webapp/json/sliceUpload/FileUpload?seq=${c}&retry=0&offset=${u}&end=${h}&total=${a}&type=form&g_tk=${l}`, g = await fetch(x, {
        method: "POST",
        headers: {
          Cookie: d
        },
        body: y
      });
      if (!g.ok)
        throw new Error(`HTTP error! status: ${g.status}`);
      const v = await g.json();
      if (v.ret !== 0)
        throw new Error(`分片 ${c} 上传失败: ${v.msg}`);
      u += m.length, c++;
    }
    return { success: !0, message: "上传完成" };
  }
  async uploadImageToQunAlbum(e, n, r, i) {
    const o = await this.core.apis.UserApi.getSKey() || "", s = (await this.core.apis.UserApi.getPSkey(["qzone.qq.com"])).domainPskeyMap.get("qzone.qq.com") || "", a = _d("md5").update(Fo(i)).digest("hex"), c = this.core.selfInfo.uin || "10001", u = (await this.createQunAlbumSession(e, n, r, i, o, s, a, c)).data.session;
    if (!u) throw new Error("创建群相册会话失败");
    await this.uploadQunAlbumSlice(i, u, o, s, c, 16384);
  }
  async getAlbumMediaListByNTQQ(e, n, r = "") {
    return (await this.context.session.getAlbumService().getMediaList({
      qun_id: e,
      attach_info: r,
      seq: 0,
      request_time_line: {
        request_invoke_time: "0"
      },
      album_id: n,
      lloc: "",
      batch_id: ""
    })).response;
  }
  async doAlbumMediaPlainCommentByNTQQ(e, n, r, i) {
    const o = Math.floor(Math.random() * 9e3) + 1e3, s = this.core.selfInfo.uin || "10001", a = Date.now() * 1e3;
    return await this.context.session.getAlbumService().doQunComment(
      o,
      {
        map_info: [],
        map_bytes_info: [],
        map_user_account: []
      },
      e,
      2,
      mQ(s, n, r),
      gQ(s, i, a)
    );
  }
  async deleteAlbumMediaByNTQQ(e, n, r) {
    const i = Math.floor(Math.random() * 9e3) + 1e3;
    return await this.context.session.getAlbumService().deleteMedias(
      i,
      e,
      n,
      [r],
      []
    );
  }
  async doAlbumMediaLikeByNTQQ(e, n, r, i, o) {
    const s = Math.floor(Math.random() * 9e3) + 1e3, a = this.core.selfInfo.uin || "10001", c = o ? 2 : 1, u = o ? 0 : 1;
    let l = "";
    return i ? l = `421_1_0_${e}|${n}|${r}^||^421_1_0_${e}|${n}|${i}^||^0` : l = `421_1_0_${e}|${n}|${r}`, await this.context.session.getAlbumService().doQunLike(
      s,
      {
        map_info: [],
        map_bytes_info: [],
        map_user_account: []
      },
      c,
      {
        id: l,
        status: u
      },
      yQ(e, a, n, r)
    );
  }
  async getDaySignedList(e) {
    const n = (await this.core.apis.UserApi.getPSkey(["qun.qq.com"])).domainPskeyMap.get("qun.qq.com"), r = this.core.selfInfo.uin, i = `p_uin=o${r}; p_skey=${n}; uin=o${r}`;
    return await ln.HttpGetJson(`https://qun.qq.com/v2/signin/trpc/GetDaySignedList?g_tk=${this.getBknFromPSKey(n)}`, "POST", {
      dayYmd: (/* @__PURE__ */ new Date()).toISOString().slice(0, 10).replace(/-/g, ""),
      offset: 0,
      limit: 100,
      uid: r,
      groupId: e
    }, {
      Cookie: i,
      "Content-Type": "application/json"
    });
  }
}
class bQ {
  context;
  core;
  constructor(e, n) {
    this.context = e, this.core = n;
  }
  async hasOtherRunningQQProcess() {
    return this.core.util.hasOtherRunningQQProcess();
  }
  async ocrImage(e) {
    return this.context.session.getNodeMiscService().wantWinScreenOCR(e);
  }
  async translateEnWordToZn(e) {
    return this.context.session.getRichMediaService().translateEnWordToZn(e);
  }
  async getOnlineDev() {
    this.context.session.getMsgService().getOnLineDev();
  }
  async getArkJsonCollection() {
    return await this.core.eventWrapper.callNoListenerEvent("NodeIKernelCollectionService/collectionArkShare", "1717662698058");
  }
  async bootMiniApp(e, n) {
    return await this.context.session.getNodeMiscService().setMiniAppVersion("2.16.4"), this.context.session.getNodeMiscService().startNewMiniApp(e, n);
  }
}
const xQ = {
  "9.9.22-40990-x64": { send: "1B5699C", recv: "1D8CA9D" },
  "9.9.22-40824-x64": { send: "1B5699C", recv: "1D8CA9D" },
  "9.9.22-40768-x64": { send: "1B5699C", recv: "1D8CA9D" },
  "3.2.20-40768-x64": { send: "2A1B840", recv: "2D28F20" },
  "3.2.20-40824-x64": { send: "2A1B840", recv: "2D28F20" },
  "3.2.20-40990-x64": { send: "2A1B840", recv: "2D28F20" },
  "3.2.20-40990-arm64": { send: "157C0E8", recv: "1546658" },
  "3.2.20-40824-arm64": { send: "157C0E8", recv: "1546658" },
  "3.2.20-40768-arm64": { send: "157C0E8", recv: "1546658" },
  "9.9.23-41679-x64": { send: "09FF0F4", recv: "1D1A039" },
  "6.9.82-40824-arm64": { send: "05FA930", recv: "0B41B90" },
  "6.9.82-40768-arm64": { send: "05FA930", recv: "0B41B90" },
  "6.9.82-40990-arm64": { send: "05FA930", recv: "0B41B90" },
  "6.9.83-41679-arm64": { send: "237D114", recv: "0957648" },
  "6.9.83-41785-arm64": { send: "23B0BF0", recv: "095567C" },
  "9.9.23-41785-x64": { send: "09FF0A4", recv: "1D19FF9" },
  "6.9.83-41857-arm64": { send: "0815774", recv: "0958B3C" },
  "3.2.21-41857-x64": { send: "5B44510", recv: "2FDB0B0" },
  "3.2.21-41857-arm64": { send: "3D6EE6C", recv: "1479EDC" },
  "9.9.23-41857-x64": { send: "0A01394", recv: "1D1C4F9" },
  "9.9.23-42086-x64": { send: "0A01814", recv: "1D1C9B9" },
  "6.9.85-42086-arm64": { send: "23B0330", recv: "0957648" },
  "3.2.21-42086-arm64": { send: "3D6D98C", recv: "14797C8" },
  "3.2.21-42086-x64": { send: "5B42CF0", recv: "2FDA6F0" },
  "9.9.23-42430-x64": { send: "0A01A34", recv: "1D1CFF9" },
  "9.9.25-42744-x64": { send: "0A0D104", recv: "1D3E7F9" },
  "6.9.85-42744-arm64": { send: "23DFEF0", recv: "095FD80" },
  "9.9.25-42905-x64": { send: "0A12E74", recv: "1D450FD" },
  "6.9.86-42905-arm64": { send: "2342408", recv: "09639B8" },
  "3.2.22-42941-x64": { send: "5BC1630", recv: "3011E00" },
  "3.2.22-42941-arm64": { send: "3DC90AC", recv: "1497A70" },
  "9.9.25-42941-x64": { send: "0A131D4", recv: "1D4547D" },
  "6.9.86-42941-arm64": { send: "2346108", recv: "09675F0" },
  "9.9.26-44175-x64": { send: "0A0F2EC", recv: "1D3AD4D" },
  "9.9.26-44343-x64": { send: "0A0F7BC", recv: "1D3C3CD" },
  "3.2.23-44343-arm64": { send: "3C867DC", recv: "1404938" },
  "3.2.23-44343-x64": { send: "59A27B0", recv: "2FFBE90" },
  "9.9.26-44498-x64": { send: "0A1051C", recv: "1D3BC0D" },
  "9.9.26-44725-x64": { send: "0A18D0C", recv: "1D4BF0D" },
  "9.9.27-45627-x64": { send: "0A697CC", recv: "1E86AC1" },
  "6.9.88-44725-x64": { send: "2756EF6", recv: "0A36152" },
  "6.9.88-44725-arm64": { send: "2313C68", recv: "09693E4" },
  "3.2.25-45758-x64": { send: "5CF8F30", recv: "31667E0" },
  "3.2.25-45758-arm64": { send: "3EB6554", recv: "149AF0C" },
  "9.9.27-45758-x64": { send: "0A6A6BC", recv: "1E87EC1" },
  "9.9.28-46494-x64": { send: "0A6D66C", recv: "1E9890D" },
  "3.2.26-46494-x64": { send: "5D30910", recv: "31814B0" },
  "3.2.26-46494-arm64": { send: "3EDC654", recv: "14A3124" },
  "3.2.26-46928-x64": { send: "5D30910", recv: "31814B0" },
  "3.2.26-46928-arm64": { send: "3EDC654", recv: "14A3124" },
  "9.9.28-46928-x64": { send: "0A6D66C", recv: "1E9890D" },
  "3.2.27-47354-x64": { send: "5D38930", recv: "318D090" },
  "3.2.27-47354-arm64": { send: "3EE8B24", recv: "14D422C" },
  "9.9.29-47354-x64": { send: "0A70B3C", recv: "1EAFD51" },
  "6.9.93-47354-arm64": { send: "244066C", recv: "09BCCF8" },
  "6.9.93-47354-x64": { send: "28ADE46", recv: "0A8FD5A" },
  "9.9.30-48517-x64": { send: "0A9B1BC", recv: "1F0324D" },
  "3.2.28-48517-x64": { send: "5E41890", recv: "3216D10" },
  "3.2.28-48517-arm64": { send: "3F9C7E4", recv: "14E1AA8" },
  "9.9.30-48762-x64": { send: "0A9B1BC", recv: "1F0324D" },
  "9.9.31-49599-x64": { send: "0AF885C", recv: "20058E1" },
  "9.9.31-49738-x64": { send: "0AF9FCC", recv: "2007901" },
  "3.2.29-49738-x64": { send: "6234600", recv: "33D89D0" },
  "3.2.29-49738-arm64": { send: "426AA04", recv: "1596254" },
  "9.9.32-50828-x64": { send: "0B245CC", recv: "2073D65" },
  "3.2.30-50828-x64": { send: "6340530", recv: "0346DA50" },
  "3.2.30-50828-arm64": { send: "4327764", recv: "15e3184" }
};
class Im {
  static pack(e, n) {
    const r = 9 + e.length + n.length + 1, i = Buffer.allocUnsafe(r);
    return i[0] = 40, i.writeUInt32BE(e.length, 1), i.writeUInt32BE(n.length, 5), e.copy(i, 9), n.copy(i, 9 + e.length), i[r - 1] = 41, i;
  }
  static unpack(e) {
    kL(e[0] === 40 && e[e.length - 1] === 41, "Invalid frame!");
    const n = e.readUInt32BE(1), r = e.readUInt32BE(5);
    return [e.subarray(9, 9 + n), e.subarray(9 + n, 9 + n + r)];
  }
}
b(2, w.UINT32), b(3, w.UINT32), b(6, w.UINT32);
b(1, w.UINT32), b(2, w.STRING, !0), b(3, w.STRING, !0);
b(1, w.UINT32), b(2, w.STRING), b(3, w.UINT32);
b(1, w.STRING, !1, !0), b(2, w.STRING, !1, !0), b(3, w.STRING), b(4, w.UINT32), b(5, w.UINT32, !1, !0);
b(1, w.INT32), b(2, w.INT32), b(3, w.BYTES), b(7, w.INT32), b(8, w.INT32), b(9, w.BYTES), b(10, w.INT32), b(11, w.INT32), b(13, w.INT32);
b(1, w.INT32), b(2, w.STRING, !0), b(3, w.UINT32), b(10, w.UINT32), b(11, w.UINT32, !0), b(12, w.UINT32), b(14, w.UINT32);
b(1, w.UINT32), b(2, w.UINT32), b(3, w.UINT32);
b(1, w.UINT32), b(2, w.STRING, !0), b(3, w.UINT32);
b(2, w.STRING);
const wQ = {
  field1: b(1, w.INT32),
  field2: b(2, w.INT32),
  field3: b(3, w.INT32),
  field4: b(4, w.INT32),
  tgt: b(5, w.STRING),
  field6: b(6, w.INT32),
  serviceTypes: b(7, w.INT32, !1, !0),
  field9: b(9, w.INT32),
  field10: b(10, w.INT32),
  field11: b(11, w.INT32),
  ver: b(15, w.STRING)
}, SQ = {
  httpConn: b(1281, () => wQ)
}, _Q = {
  httpConn: b(1281, () => EQ)
}, EQ = {
  sigSession: b(1, w.BYTES),
  sessionKey: b(2, w.BYTES),
  serverInfos: b(3, () => IQ, !1, !0)
}, AQ = {
  type: b(1, w.UINT32),
  ip: b(2, w.FIXED32),
  port: b(3, w.UINT32),
  area: b(4, w.UINT32)
}, IQ = {
  serviceType: b(1, w.UINT32),
  serverAddrs: b(2, () => AQ, !1, !0)
}, CQ = {
  appId: b(2, w.STRING),
  body: b(4, () => TQ)
}, TQ = {
  extInfo: b(1, () => kQ),
  appid: b(2, w.STRING),
  title: b(3, w.STRING),
  desc: b(4, w.STRING),
  time: b(5, w.UINT64),
  scene: b(6, w.UINT32),
  templateType: b(7, w.UINT32),
  businessType: b(8, w.UINT32),
  picUrl: b(9, w.STRING),
  vidUrl: b(10, w.STRING),
  jumpUrl: b(11, w.STRING),
  iconUrl: b(12, w.STRING),
  verType: b(13, w.UINT32),
  shareType: b(14, w.UINT32),
  versionId: b(15, w.STRING),
  withShareTicket: b(16, w.UINT32),
  webURL: b(17, w.STRING),
  appidRich: b(18, w.BYTES),
  template: b(19, () => NQ),
  field20: b(20, w.STRING)
}, kQ = {
  field2: b(2, w.BYTES)
}, NQ = {
  templateId: b(1, w.STRING),
  templateData: b(2, w.STRING)
}, PQ = {
  field2: b(2, w.UINT32),
  field3: b(3, w.STRING),
  content: b(4, () => DQ)
}, DQ = {
  jsonContent: b(2, w.STRING)
}, N6 = {
  version: b(1, w.UINT32),
  uin: b(2, w.STRING, !0),
  command: b(3, w.STRING, !0),
  seq: b(4, w.UINT32, !0),
  retryTimes: b(5, w.UINT32, !0),
  appId: b(6, w.UINT32),
  dataFlag: b(7, w.UINT32),
  commandId: b(8, w.UINT32),
  buildVer: b(9, w.BYTES, !0)
}, JI = {
  unknown1: b(1, w.INT32),
  unknown2: b(2, w.INT32),
  unknown3: b(3, w.INT32),
  entry: b(100, () => FQ),
  unknown200: b(200, w.INT32)
}, FQ = {
  busiBuff: b(100, () => OQ),
  fileEntry: b(200, () => MQ),
  clientInfo: b(300, () => RQ),
  fileNameInfo: b(400, () => BQ),
  host: b(500, () => UQ)
}, OQ = {
  busId: b(1, w.INT32),
  senderUin: b(100, w.UINT64),
  receiverUin: b(200, w.UINT64),
  groupCode: b(400, w.UINT64)
}, MQ = {
  fileSize: b(100, w.UINT64),
  md5: b(200, w.BYTES),
  checkKey: b(300, w.BYTES),
  md5S2: b(400, w.BYTES),
  fileId: b(600, w.STRING),
  uploadKey: b(700, w.BYTES)
}, RQ = {
  clientType: b(100, w.INT32),
  appId: b(200, w.STRING),
  terminalType: b(300, w.INT32),
  clientVer: b(400, w.STRING),
  unknown: b(600, w.INT32)
}, BQ = {
  fileName: b(100, w.STRING)
}, UQ = {
  hosts: b(200, () => LQ, !1, !0)
}, LQ = {
  url: b(1, () => jQ),
  port: b(2, w.UINT32)
}, jQ = {
  unknown: b(1, w.INT32),
  host: b(2, w.STRING)
}, QQ = {
  uint32LoginSigType: b(1, w.UINT32),
  bytesLoginSig: b(2, w.BYTES),
  appId: b(3, w.UINT32)
}, Fs = {
  fileUuid: b(1, w.STRING),
  uKey: b(2, w.STRING),
  network: b(5, () => GQ),
  msgInfoBody: b(6, () => G6, !1, !0),
  blockSize: b(10, w.UINT32),
  hash: b(11, () => $Q)
}, $Q = {
  fileSha1: b(1, w.BYTES, !1, !0)
}, GQ = {
  ipv4s: b(1, () => qQ, !1, !0)
}, qQ = {
  domain: b(1, () => HQ),
  port: b(2, w.UINT32)
}, HQ = {
  isEnable: b(1, w.BOOL),
  ip: b(2, w.STRING)
}, WQ = {
  msgBaseHead: b(1, () => N6, !0),
  msgSegHead: b(2, () => D6, !0),
  bytesReqExtendInfo: b(3, w.BYTES, !0),
  timestamp: b(4, w.UINT64),
  msgLoginSigHead: b(5, () => QQ, !0)
}, P6 = {
  msgBaseHead: b(1, () => N6, !0),
  msgSegHead: b(2, () => D6, !0),
  errorCode: b(3, w.UINT32),
  allowRetry: b(4, w.UINT32),
  cacheCost: b(5, w.UINT32),
  htCost: b(6, w.UINT32),
  bytesRspExtendInfo: b(7, w.BYTES, !0),
  timestamp: b(8, w.UINT64),
  range: b(9, w.UINT64),
  isReset: b(10, w.UINT32)
}, D6 = {
  serviceId: b(1, w.UINT32, !0),
  filesize: b(2, w.UINT64),
  dataOffset: b(3, w.UINT64, !0),
  dataLength: b(4, w.UINT32),
  retCode: b(5, w.UINT32, !0),
  serviceTicket: b(6, w.BYTES),
  flag: b(7, w.UINT32, !0),
  md5: b(8, w.BYTES),
  fileMd5: b(9, w.BYTES),
  cacheAddr: b(10, w.UINT32, !0),
  queryTimes: b(11, w.UINT32),
  updateCacheIp: b(12, w.UINT32),
  cachePort: b(13, w.UINT32, !0)
};
b(1, w.UINT32), b(2, w.UINT32), b(5, w.UINT32), b(6, w.UINT32);
b(1, w.UINT32);
const Cm = {
  action: b(2, () => zQ, !1, !0)
}, zQ = {
  actionCommand: b(1, w.STRING),
  actionData: b(2, () => KQ)
}, KQ = {
  msgBody: b(1, () => Wu, !1, !0)
}, VQ = {
  info: b(1, () => YQ, !0),
  settings: b(15, () => jg, !0)
}, YQ = {
  uid: b(1, () => F6, !0),
  resId: b(2, w.STRING, !0),
  acquire: b(3, w.BOOL)
}, F6 = {
  uid: b(2, w.STRING, !0)
}, jg = {
  field1: b(1, w.UINT32),
  field2: b(2, w.UINT32),
  field3: b(3, w.UINT32),
  field4: b(4, w.UINT32)
}, JQ = {
  result: b(1, () => XQ),
  settings: b(15, () => jg)
}, XQ = {
  resId: b(3, w.STRING),
  payload: b(4, w.BYTES)
}, O6 = {
  info: b(2, () => ZQ),
  settings: b(15, () => jg)
}, ZQ = {
  type: b(1, w.UINT32),
  uid: b(2, () => F6, !0),
  groupUin: b(3, w.UINT32, !0),
  payload: b(4, w.BYTES, !0)
}, M6 = {
  result: b(2, () => e$),
  settings: b(15, () => jg)
}, e$ = {
  resId: b(3, w.STRING)
}, t$ = {
  info: b(1, () => n$),
  direction: b(2, w.BOOL)
}, n$ = {
  groupUin: b(1, w.UINT32),
  startSequence: b(2, w.UINT32),
  endSequence: b(3, w.UINT32)
}, r$ = {
  body: b(3, () => i$)
}, i$ = {
  groupUin: b(3, w.UINT32),
  startSequence: b(4, w.UINT32),
  endSequence: b(5, w.UINT32),
  messages: b(6, () => Wu, !1, !0)
};
b(1, w.STRING, !0), b(2, w.UINT32), b(3, w.UINT32), b(4, w.UINT32), b(5, w.BOOL);
b(3, w.STRING), b(5, w.UINT32), b(6, w.UINT32);
const o$ = {
  friendUid: b(2, w.STRING, !0),
  startSequence: b(3, w.UINT32),
  endSequence: b(4, w.UINT32)
}, s$ = {
  friendUid: b(4, w.STRING),
  messages: b(7, () => Wu, !1, !0)
};
b(1, w.UINT32, !0), b(2, w.STRING, !0), b(3, w.UINT32, !0), b(4, w.UINT32, !0), b(5, w.UINT32, !0), b(6, w.STRING, !0);
const a$ = {
  codePage: b(1, w.INT32),
  time: b(2, w.INT32),
  random: b(3, w.INT32),
  color: b(4, w.INT32),
  size: b(5, w.INT32),
  effect: b(6, w.INT32),
  charSet: b(7, w.INT32),
  pitchAndFamily: b(8, w.INT32),
  fontName: b(9, w.STRING),
  reserveData: b(10, w.BYTES)
}, R6 = {
  fileType: b(1, w.INT32, !0),
  sig: b(2, w.BYTES, !0),
  fileUuid: b(3, w.STRING, !0),
  fileMd5: b(4, w.BYTES, !0),
  fileName: b(5, w.STRING, !0),
  fileSize: b(6, w.INT64, !0),
  note: b(7, w.BYTES, !0),
  reserved: b(8, w.INT32, !0),
  subcmd: b(9, w.INT32, !0),
  microCloud: b(10, w.INT32, !0),
  bytesFileUrls: b(11, w.BYTES, !1, !0),
  downloadFlag: b(12, w.INT32, !0),
  dangerEvel: b(50, w.INT32, !0),
  lifeTime: b(51, w.INT32, !0),
  uploadTime: b(52, w.INT32, !0),
  absFileType: b(53, w.INT32, !0),
  clientType: b(54, w.INT32, !0),
  expireTime: b(55, w.INT32, !0),
  pbReserve: b(56, w.BYTES, !0),
  fileHash: b(57, w.STRING, !0)
}, c$ = {
  fileType: b(1, w.INT32),
  srcUin: b(2, w.UINT64),
  fileUuid: b(3, w.STRING),
  fileMd5: b(4, w.BYTES),
  fileName: b(5, w.STRING),
  fileSize: b(6, w.INT32),
  reserve: b(7, w.BYTES),
  fileId: b(8, w.INT32),
  serverIp: b(9, w.INT32),
  serverPort: b(10, w.INT32),
  boolValid: b(11, w.BOOL),
  signature: b(12, w.BYTES),
  shortcut: b(13, w.BYTES),
  fileKey: b(14, w.BYTES),
  magicPttIndex: b(15, w.INT32),
  voiceSwitch: b(16, w.INT32),
  pttUrl: b(17, w.BYTES),
  groupFileKey: b(18, w.STRING),
  time: b(19, w.INT32),
  downPara: b(20, w.BYTES),
  format: b(29, w.INT32),
  pbReserve: b(30, w.BYTES),
  bytesPttUrls: b(31, w.BYTES, !1, !0),
  downloadFlag: b(32, w.INT32)
}, u$ = {
  attr: b(1, () => a$, !0),
  elems: b(2, () => B6, !1, !0),
  notOnlineFile: b(3, () => R6, !0),
  ptt: b(4, () => c$, !0)
};
b(1, w.STRING);
b(1, w.STRING), b(2, w.STRING), b(3, w.INT32);
b(1, w.INT32), b(4, w.STRING), b(5, w.STRING), b(7, w.BOOL), b(8, w.BOOL);
b(1, w.INT32), b(2, w.STRING, !1, !0), b(3, w.STRING, !1, !0);
const l$ = {
  file: b(1, () => R6),
  field6: b(6, () => p$)
}, p$ = {
  field2: b(2, () => d$)
}, d$ = {
  field1: b(1, w.UINT32),
  fileUuid: b(4, w.STRING),
  fileName: b(5, w.STRING),
  field6: b(6, w.UINT32),
  field7: b(7, w.BYTES),
  field8: b(8, w.BYTES),
  timestamp1: b(9, w.UINT32),
  fileHash: b(14, w.STRING),
  selfUid: b(15, w.STRING),
  destUid: b(16, w.STRING)
}, f$ = {
  field1: b(1, w.UINT32),
  fileName: b(2, w.STRING),
  display: b(3, w.STRING),
  inner: b(7, () => h$)
}, h$ = {
  info: b(2, () => m$)
}, m$ = {
  busId: b(1, w.UINT32),
  fileId: b(2, w.STRING),
  fileSize: b(3, w.UINT64),
  fileName: b(4, w.STRING),
  field5: b(5, w.UINT32),
  fileSha: b(6, w.BYTES),
  extInfoString: b(7, w.STRING),
  fileMd5: b(8, w.BYTES)
};
b(30, w.STRING);
b(1, w.UINT32), b(7, w.UINT32), b(8, w.UINT32);
const B6 = {
  text: b(1, () => g$, !0),
  face: b(2, () => y$, !0),
  onlineImage: b(3, () => v$, !0),
  notOnlineImage: b(4, () => b$, !0),
  transElem: b(5, () => S$, !0),
  marketFace: b(6, () => _$, !0),
  customFace: b(8, () => A$, !0),
  elemFlags2: b(9, () => C$, !0),
  richMsg: b(12, () => k$, !0),
  groupFile: b(13, () => N$, !0),
  extraInfo: b(16, () => P$, !0),
  videoFile: b(19, () => D$, !0),
  anonymousGroupMessage: b(21, () => F$, !0),
  customElem: b(31, () => O$, !0),
  generalFlags: b(37, () => M$, !0),
  srcMsg: b(45, () => R$, !0),
  lightAppElem: b(51, () => U$, !0),
  commonElem: b(53, () => L$, !0)
}, g$ = {
  str: b(1, w.STRING, !0),
  lint: b(2, w.STRING, !0),
  attr6Buf: b(3, w.BYTES, !0),
  attr7Buf: b(4, w.BYTES, !0),
  buf: b(11, w.BYTES, !0),
  pbReserve: b(12, w.BYTES, !0)
}, y$ = {
  index: b(1, w.INT32, !0),
  old: b(2, w.BYTES, !0),
  buf: b(11, w.BYTES, !0)
}, v$ = {
  guid: b(1, w.BYTES),
  filePath: b(2, w.BYTES),
  oldVerSendFile: b(3, w.BYTES)
}, b$ = {
  filePath: b(1, w.STRING),
  fileLen: b(2, w.UINT32),
  downloadPath: b(3, w.STRING),
  oldVerSendFile: b(4, w.BYTES),
  imgType: b(5, w.INT32),
  previewsImage: b(6, w.BYTES),
  picMd5: b(7, w.BYTES),
  picHeight: b(8, w.UINT32),
  picWidth: b(9, w.UINT32),
  resId: b(10, w.STRING),
  flag: b(11, w.BYTES),
  thumbUrl: b(12, w.STRING),
  original: b(13, w.INT32),
  bigUrl: b(14, w.STRING),
  origUrl: b(15, w.STRING),
  bizType: b(16, w.INT32),
  result: b(17, w.INT32),
  index: b(18, w.INT32),
  opFaceBuf: b(19, w.BYTES),
  oldPicMd5: b(20, w.BOOL),
  thumbWidth: b(21, w.INT32),
  thumbHeight: b(22, w.INT32),
  fileId: b(23, w.INT32),
  showLen: b(24, w.UINT32),
  downloadLen: b(25, w.UINT32),
  x400Url: b(26, w.STRING),
  x400Width: b(27, w.INT32),
  x400Height: b(28, w.INT32),
  pbRes: b(29, () => x$)
}, x$ = {
  subType: b(1, w.INT32),
  field3: b(3, w.INT32),
  field4: b(4, w.INT32),
  summary: b(8, w.STRING),
  field10: b(10, w.INT32),
  field20: b(20, () => w$),
  url: b(30, w.STRING),
  md5Str: b(31, w.STRING)
}, w$ = {
  field1: b(1, w.INT32),
  field2: b(2, w.STRING),
  field3: b(3, w.INT32),
  field4: b(4, w.INT32),
  field5: b(5, w.INT32),
  field7: b(7, w.STRING)
}, S$ = {
  elemType: b(1, w.INT32),
  elemValue: b(2, w.BYTES)
}, _$ = {
  faceName: b(1, w.STRING),
  itemType: b(2, w.INT32),
  faceInfo: b(3, w.INT32),
  faceId: b(4, w.BYTES),
  tabId: b(5, w.INT32),
  subType: b(6, w.INT32),
  key: b(7, w.STRING),
  param: b(8, w.BYTES),
  mediaType: b(9, w.INT32),
  imageWidth: b(10, w.INT32),
  imageHeight: b(11, w.INT32),
  mobileparam: b(12, w.BYTES),
  pbReserve: b(13, () => E$)
}, E$ = {
  field8: b(8, w.INT32)
}, A$ = {
  guid: b(1, w.BYTES),
  filePath: b(2, w.STRING),
  shortcut: b(3, w.STRING),
  buffer: b(4, w.BYTES),
  flag: b(5, w.BYTES),
  oldData: b(6, w.BYTES, !0),
  fileId: b(7, w.UINT32),
  serverIp: b(8, w.INT32, !0),
  serverPort: b(9, w.INT32, !0),
  fileType: b(10, w.INT32),
  signature: b(11, w.BYTES),
  useful: b(12, w.INT32),
  md5: b(13, w.BYTES),
  thumbUrl: b(14, w.STRING),
  bigUrl: b(15, w.STRING),
  origUrl: b(16, w.STRING),
  bizType: b(17, w.INT32),
  repeatIndex: b(18, w.INT32),
  repeatImage: b(19, w.INT32),
  imageType: b(20, w.INT32),
  index: b(21, w.INT32),
  width: b(22, w.INT32),
  height: b(23, w.INT32),
  source: b(24, w.INT32),
  size: b(25, w.UINT32),
  origin: b(26, w.INT32),
  thumbWidth: b(27, w.INT32, !0),
  thumbHeight: b(28, w.INT32, !0),
  showLen: b(29, w.INT32),
  downloadLen: b(30, w.INT32),
  x400Url: b(31, w.STRING, !0),
  x400Width: b(32, w.INT32),
  x400Height: b(33, w.INT32),
  pbRes: b(34, () => I$, !0)
}, I$ = {
  subType: b(1, w.INT32),
  summary: b(9, w.STRING)
}, C$ = {
  colorTextId: b(1, w.UINT32),
  msgId: b(2, w.UINT64),
  whisperSessionId: b(3, w.UINT32),
  pttChangeBit: b(4, w.UINT32),
  vipStatus: b(5, w.UINT32),
  compatibleId: b(6, w.UINT32),
  insts: b(7, () => XI, !1, !0),
  msgRptCnt: b(8, w.UINT32),
  srcInst: b(9, () => XI),
  longtitude: b(10, w.UINT32),
  latitude: b(11, w.UINT32),
  customFont: b(12, w.UINT32),
  pcSupportDef: b(13, () => T$),
  crmFlags: b(14, w.UINT32, !0)
}, T$ = {
  pcPtlBegin: b(1, w.UINT32),
  pcPtlEnd: b(2, w.UINT32),
  macPtlBegin: b(3, w.UINT32),
  macPtlEnd: b(4, w.UINT32),
  ptlsSupport: b(5, w.INT32, !1, !0),
  ptlsNotSupport: b(6, w.UINT32, !1, !0)
}, XI = {
  appId: b(1, w.UINT32),
  instId: b(2, w.UINT32)
}, k$ = {
  template1: b(1, w.BYTES, !0),
  serviceId: b(2, w.INT32, !0),
  msgResId: b(3, w.BYTES, !0),
  rand: b(4, w.INT32, !0),
  seq: b(5, w.UINT32, !0)
}, N$ = {
  filename: b(1, w.BYTES),
  fileSize: b(2, w.UINT64),
  fileId: b(3, w.BYTES),
  batchId: b(4, w.BYTES),
  fileKey: b(5, w.BYTES),
  mark: b(6, w.BYTES),
  sequence: b(7, w.UINT64),
  batchItemId: b(8, w.BYTES),
  feedMsgTime: b(9, w.INT32),
  pbReserve: b(10, w.BYTES)
}, P$ = {
  nick: b(1, w.BYTES),
  groupCard: b(2, w.BYTES),
  level: b(3, w.INT32),
  flags: b(4, w.INT32),
  groupMask: b(5, w.INT32),
  msgTailId: b(6, w.INT32),
  senderTitle: b(7, w.BYTES),
  apnsTips: b(8, w.BYTES),
  uin: b(9, w.UINT64),
  msgStateFlag: b(10, w.INT32),
  apnsSoundType: b(11, w.INT32),
  newGroupFlag: b(12, w.INT32)
}, D$ = {
  fileUuid: b(1, w.STRING),
  fileMd5: b(2, w.BYTES),
  fileName: b(3, w.STRING),
  fileFormat: b(4, w.INT32),
  fileTime: b(5, w.INT32),
  fileSize: b(6, w.INT32),
  thumbWidth: b(7, w.INT32),
  thumbHeight: b(8, w.INT32),
  thumbFileMd5: b(9, w.BYTES),
  source: b(10, w.BYTES),
  thumbFileSize: b(11, w.INT32),
  busiType: b(12, w.INT32),
  fromChatType: b(13, w.INT32),
  toChatType: b(14, w.INT32),
  boolSupportProgressive: b(15, w.BOOL),
  fileWidth: b(16, w.INT32),
  fileHeight: b(17, w.INT32),
  subBusiType: b(18, w.INT32),
  videoAttr: b(19, w.INT32),
  bytesThumbFileUrls: b(20, w.BYTES, !1, !0),
  bytesVideoFileUrls: b(21, w.BYTES, !1, !0),
  thumbDownloadFlag: b(22, w.INT32),
  videoDownloadFlag: b(23, w.INT32),
  pbReserve: b(24, w.BYTES)
}, F$ = {
  flags: b(1, w.INT32),
  anonId: b(2, w.BYTES),
  anonNick: b(3, w.BYTES),
  headPortrait: b(4, w.INT32),
  expireTime: b(5, w.INT32),
  bubbleId: b(6, w.INT32),
  rankColor: b(7, w.BYTES)
}, O$ = {
  desc: b(1, w.BYTES),
  data: b(2, w.BYTES),
  enumType: b(3, w.INT32),
  ext: b(4, w.BYTES),
  sound: b(5, w.BYTES)
}, M$ = {
  bubbleDiyTextId: b(1, w.INT32),
  groupFlagNew: b(2, w.INT32),
  uin: b(3, w.UINT64),
  rpId: b(4, w.BYTES),
  prpFold: b(5, w.INT32),
  longTextFlag: b(6, w.INT32),
  longTextResId: b(7, w.STRING, !0),
  groupType: b(8, w.INT32),
  toUinFlag: b(9, w.INT32),
  glamourLevel: b(10, w.INT32),
  memberLevel: b(11, w.INT32),
  groupRankSeq: b(12, w.UINT64),
  olympicTorch: b(13, w.INT32),
  babyqGuideMsgCookie: b(14, w.BYTES),
  uin32ExpertFlag: b(15, w.INT32),
  bubbleSubId: b(16, w.INT32),
  pendantId: b(17, w.UINT64),
  rpIndex: b(18, w.BYTES),
  pbReserve: b(19, w.BYTES)
}, R$ = {
  origSeqs: b(1, w.UINT32, !1, !0),
  senderUin: b(2, w.UINT64),
  time: b(3, w.INT32, !0),
  flag: b(4, w.INT32, !0),
  elems: b(5, () => B6, !1, !0),
  type: b(6, w.INT32, !0),
  richMsg: b(7, w.BYTES, !0),
  pbReserve: b(8, () => B$, !0),
  sourceMsg: b(9, w.BYTES, !0),
  toUin: b(10, w.UINT64, !0),
  troopName: b(11, w.BYTES, !0)
}, B$ = {
  messageId: b(3, w.UINT64),
  senderUid: b(6, w.STRING, !0),
  receiverUid: b(7, w.STRING, !0),
  friendSeq: b(8, w.UINT32, !0)
}, U$ = {
  data: b(1, w.BYTES),
  msgResid: b(2, w.BYTES, !0)
}, L$ = {
  serviceType: b(1, w.INT32),
  pbElem: b(2, w.BYTES),
  businessType: b(3, w.UINT32)
};
b(1, w.INT32, !0);
const j$ = {
  type: b(3, w.INT32, !0),
  uin: b(4, w.UINT32, !0),
  field5: b(5, w.INT32, !0),
  uid: b(9, w.STRING, !0)
}, ZI = {
  AniStickerPackId: b(1, w.STRING, !0),
  AniStickerId: b(2, w.STRING, !0),
  faceId: b(3, w.INT32, !0),
  sourceType: b(4, w.INT32, !0),
  AniStickerType: b(5, w.INT32, !0),
  resultId: b(6, w.STRING, !0),
  preview: b(7, w.STRING, !0),
  randomType: b(9, w.INT32, !0)
}, eC = {
  faceId: b(1, w.UINT32),
  preview: b(2, w.STRING),
  preview2: b(3, w.STRING)
}, Q$ = {
  content: b(1, w.STRING)
};
b(1, w.UINT32), b(2, w.UINT32);
b(1, w.UINT32), b(2, w.UINT32), b(3, w.UINT32);
b(1, w.UINT32);
const $$ = {
  type: b(1, w.UINT32),
  subType: b(2, w.UINT32, !0),
  c2cCmd: b(3, w.UINT32, !0),
  ranDom: b(4, w.UINT32, !0),
  sequence: b(5, w.UINT32, !0),
  timeStamp: b(6, w.UINT32, !0),
  pkgNum: b(7, w.UINT64, !0),
  pkgIndex: b(8, w.UINT32, !0),
  divSeq: b(9, w.UINT32, !0),
  autoReply: b(10, w.UINT32),
  ntMsgSeq: b(10, w.UINT32, !0),
  newId: b(12, w.UINT64, !0),
  forward: b(15, () => Z$, !0)
}, G$ = {
  richText: b(1, () => u$, !0),
  msgContent: b(2, w.BYTES, !0),
  msgEncryptContent: b(3, w.BYTES, !0)
};
b(4, w.UINT32, !0), b(5, w.UINT32, !0), b(6, w.BYTES, !0), b(8, w.UINT32, !0), b(9, w.UINT32, !0), b(14, w.UINT32);
b(1, w.INT32);
const U6 = {
  message: b(1, () => Wu),
  status: b(3, w.INT32, !0),
  pingFlag: b(5, w.INT32, !0),
  generalFlag: b(9, w.INT32, !0)
}, q$ = {
  operator: b(1, () => H$, !0)
}, H$ = {
  operatorUid: b(1, w.STRING, !0)
}, tC = {
  groupUin: b(1, w.UINT32),
  flag: b(2, w.UINT32),
  memberUid: b(3, w.STRING, !0),
  decreaseType: b(4, w.UINT32),
  operatorInfo: b(5, w.BYTES, !0),
  increaseType: b(6, w.UINT32),
  field7: b(7, w.BYTES, !0)
}, W$ = {
  seq: b(1, w.UINT64, !0)
}, z$ = {
  code: b(1, w.STRING, !0),
  count: b(3, w.UINT32, !0),
  operatorUid: b(4, w.STRING, !0),
  type: b(5, w.UINT32, !0)
}, K$ = {
  groupReactionTarget: b(2, () => W$, !0),
  groupReactionDataContent: b(3, () => z$, !0)
}, V$ = {
  data: b(1, () => K$, !0)
}, Y$ = {
  data: b(1, () => V$, !0)
}, L6 = {
  groupUin: b(4, w.UINT64, !0),
  field13: b(13, w.UINT32, !0),
  groupReactionData: b(44, () => Y$, !0)
}, J$ = {
  groupUin: b(1, w.UINT32),
  field2: b(2, w.UINT32),
  field3: b(2, w.UINT32),
  field4: b(2, w.UINT32),
  invitorUid: b(5, w.STRING)
}, Wu = {
  responseHead: b(1, () => X$),
  contentHead: b(2, () => $$),
  body: b(3, () => G$, !0)
}, X$ = {
  fromUin: b(1, w.UINT32),
  fromUid: b(2, w.STRING, !0),
  type: b(3, w.UINT32),
  sigMap: b(4, w.UINT32),
  toUin: b(5, w.UINT32),
  toUid: b(6, w.STRING, !0),
  forward: b(7, () => eG, !0),
  grp: b(8, () => tG, !0)
};
b(2, w.UINT32), b(3, w.UINT32), b(4, w.UINT32), b(5, w.BYTES);
b(1, w.STRING), b(2, w.STRING), b(3, w.UINT32), b(4, w.UINT64), b(5, w.UINT32), b(6, w.UINT32), b(7, w.UINT32), b(8, w.UINT32), b(9, w.UINT32);
const Z$ = {
  field1: b(1, w.UINT32, !0),
  field2: b(2, w.UINT32, !0),
  field3: b(3, w.UINT32, !0),
  unknownBase64: b(5, w.STRING, !0),
  avatar: b(6, w.STRING, !0)
};
b(1, w.UINT32, !0);
b(1, w.UINT32, !0), b(2, w.UINT32, !0);
const eG = {
  friendName: b(6, w.STRING, !0)
}, tG = {
  groupUin: b(1, w.UINT32),
  memberName: b(4, w.STRING),
  unknown5: b(5, w.UINT32),
  groupName: b(7, w.STRING)
};
b(1, w.UINT64, !0), b(2, w.UINT32, !0), b(8, w.STRING, !0);
b(1, w.UINT64), b(2, w.BYTES);
const Pi = {
  ReqHead: b(1, () => j6),
  Upload: b(2, () => AG),
  Download: b(3, () => sG),
  DownloadRKey: b(4, () => dG),
  Delete: b(5, () => fG),
  UploadCompleted: b(6, () => hG),
  MsgInfoAuth: b(7, () => mG),
  UploadKeyRenewal: b(8, () => yG),
  DownloadSafe: b(9, () => gG),
  Extension: b(99, w.BYTES, !0)
}, j6 = {
  Common: b(1, () => Q6),
  Scene: b(2, () => nG),
  Client: b(3, () => oG)
}, Q6 = {
  RequestId: b(1, w.UINT32),
  Command: b(2, w.UINT32)
}, nG = {
  RequestType: b(101, w.UINT32),
  BusinessType: b(102, w.UINT32),
  SceneType: b(200, w.UINT32),
  C2C: b(201, () => rG, !0),
  Group: b(202, () => iG, !0)
}, rG = {
  AccountType: b(1, w.UINT32),
  TargetUid: b(2, w.STRING)
}, iG = {
  GroupUin: b(1, w.UINT32)
}, oG = {
  AgentType: b(1, w.UINT32)
}, sG = {
  Node: b(1, () => Qg),
  Download: b(2, () => cG)
}, Qg = {
  Info: b(1, () => $6),
  FileUuid: b(2, w.STRING),
  StoreId: b(3, w.UINT32),
  UploadTime: b(4, w.UINT32),
  Ttl: b(5, w.UINT32),
  SubType: b(6, w.UINT32)
}, $6 = {
  FileSize: b(1, w.UINT32),
  FileHash: b(2, w.STRING),
  FileSha1: b(3, w.STRING),
  FileName: b(4, w.STRING),
  Type: b(5, () => aG),
  Width: b(6, w.UINT32),
  Height: b(7, w.UINT32),
  Time: b(8, w.UINT32),
  Original: b(9, w.UINT32)
}, aG = {
  Type: b(1, w.UINT32),
  PicFormat: b(2, w.UINT32),
  VideoFormat: b(3, w.UINT32),
  VoiceFormat: b(4, w.UINT32)
}, cG = {
  Pic: b(1, () => lG),
  Video: b(2, () => uG),
  Ptt: b(3, () => pG)
}, uG = {
  BusiType: b(1, w.UINT32),
  SceneType: b(2, w.UINT32),
  SubBusiType: b(3, w.UINT32)
}, lG = {}, pG = {}, dG = {
  Types: b(1, w.INT32, !1, !0)
}, fG = {
  Index: b(1, () => Qg, !1, !0),
  NeedRecallMsg: b(2, w.BOOL),
  MsgSeq: b(3, w.UINT64),
  MsgRandom: b(4, w.UINT64),
  MsgTime: b(5, w.UINT64)
}, hG = {
  SrvSendMsg: b(1, w.BOOL),
  ClientRandomId: b(2, w.UINT64),
  MsgInfo: b(3, () => ea),
  ClientSeq: b(4, w.UINT32)
}, mG = {
  Msg: b(1, w.BYTES),
  AuthTime: b(2, w.UINT64)
}, gG = {
  Index: b(1, () => Qg)
}, yG = {
  OldUKey: b(1, w.STRING),
  SubType: b(2, w.UINT32)
}, ea = {
  MsgInfoBody: b(1, () => G6, !1, !0),
  ExtBizInfo: b(2, () => H6)
}, G6 = {
  Index: b(1, () => Qg),
  Picture: b(2, () => xG),
  Video: b(3, () => vG),
  Audio: b(4, () => bG),
  FileExist: b(5, w.BOOL),
  HashSum: b(6, w.BYTES)
}, vG = {}, bG = {}, xG = {
  UrlPath: b(1, w.STRING),
  Ext: b(2, () => q6),
  Domain: b(3, w.STRING)
}, q6 = {
  OriginalParameter: b(1, w.STRING),
  BigParameter: b(2, w.STRING),
  ThumbParameter: b(3, w.STRING)
}, wG = {
  VideoCodecFormat: b(1, w.UINT32)
}, H6 = {
  Pic: b(1, () => EG),
  Video: b(2, () => _G),
  Ptt: b(3, () => SG),
  BusiType: b(10, w.UINT32)
}, SG = {
  SrcUin: b(1, w.UINT64),
  PttScene: b(2, w.UINT32),
  PttType: b(3, w.UINT32),
  ChangeVoice: b(4, w.UINT32),
  Waveform: b(5, w.BYTES),
  AutoConvertText: b(6, w.UINT32),
  BytesReserve: b(11, w.BYTES),
  BytesPbReserve: b(12, w.BYTES),
  BytesGeneralFlags: b(13, w.BYTES)
}, _G = {
  FromScene: b(1, w.UINT32),
  ToScene: b(2, w.UINT32),
  BytesPbReserve: b(3, w.BYTES)
}, EG = {
  BizType: b(1, w.UINT32),
  TextSummary: b(2, w.STRING),
  BytesPbReserveC2c: b(11, () => CG),
  BytesPbReserveTroop: b(12, () => TG),
  FromScene: b(1001, w.UINT32),
  ToScene: b(1002, w.UINT32),
  OldFileId: b(1003, w.UINT32)
}, AG = {
  UploadInfo: b(1, () => IG, !1, !0),
  TryFastUploadCompleted: b(2, w.BOOL),
  SrvSendMsg: b(3, w.BOOL),
  ClientRandomId: b(4, w.UINT64),
  CompatQMsgSceneType: b(5, w.UINT32),
  ExtBizInfo: b(6, () => H6),
  ClientSeq: b(7, w.UINT32),
  NoNeedCompatMsg: b(8, w.BOOL)
}, IG = {
  FileInfo: b(1, () => $6),
  SubFileType: b(2, w.UINT32)
}, CG = {
  subType: b(1, w.UINT32),
  field3: b(3, w.UINT32),
  field4: b(4, w.UINT32),
  field8: b(8, w.STRING),
  field10: b(10, w.UINT32),
  field12: b(12, w.STRING),
  field18: b(18, w.STRING),
  field19: b(19, w.STRING),
  field20: b(20, w.BYTES)
}, TG = {
  subType: b(1, w.UINT32),
  field3: b(3, w.UINT32),
  field4: b(4, w.UINT32),
  field9: b(9, w.STRING),
  field10: b(10, w.UINT32),
  field12: b(12, w.STRING),
  field18: b(18, w.STRING),
  field19: b(19, w.STRING),
  field21: b(21, w.BYTES)
}, Di = {
  respHead: b(1, () => kG),
  upload: b(2, () => DG),
  download: b(3, () => NG),
  downloadRKey: b(4, () => jG),
  delete: b(5, () => LG),
  uploadCompleted: b(6, () => UG),
  msgInfoAuth: b(7, () => BG),
  uploadKeyRenewal: b(8, () => RG),
  downloadSafe: b(9, () => MG),
  extension: b(99, w.BYTES, !0)
}, kG = {
  common: b(1, () => Q6),
  retCode: b(2, w.UINT32),
  message: b(3, w.STRING)
}, NG = {
  rKeyParam: b(1, w.STRING),
  rKeyTtlSecond: b(2, w.UINT32),
  info: b(3, () => PG),
  rKeyCreateTime: b(4, w.UINT32)
}, PG = {
  domain: b(1, w.STRING),
  urlPath: b(2, w.STRING),
  httpsPort: b(3, w.UINT32),
  ipv4s: b(4, () => gE, !1, !0),
  ipv6s: b(5, () => yE, !1, !0),
  picUrlExtInfo: b(6, () => q6),
  videoExtInfo: b(7, () => wG)
}, gE = {
  outIP: b(1, w.UINT32),
  outPort: b(2, w.UINT32),
  inIP: b(3, w.UINT32),
  inPort: b(4, w.UINT32),
  ipType: b(5, w.UINT32)
}, yE = {
  outIP: b(1, w.BYTES),
  outPort: b(2, w.UINT32),
  inIP: b(3, w.BYTES),
  inPort: b(4, w.UINT32),
  ipType: b(5, w.UINT32)
}, DG = {
  uKey: b(1, w.STRING, !0),
  uKeyTtlSecond: b(2, w.UINT32),
  ipv4s: b(3, () => gE, !1, !0),
  ipv6s: b(4, () => yE, !1, !0),
  msgSeq: b(5, w.UINT64),
  msgInfo: b(6, () => ea),
  ext: b(7, () => FG, !1, !0),
  compatQMsg: b(8, w.BYTES),
  subFileInfos: b(10, () => OG, !1, !0)
}, FG = {
  subType: b(1, w.UINT32),
  extType: b(2, w.UINT32),
  extValue: b(3, w.BYTES)
}, OG = {
  subType: b(1, w.UINT32),
  uKey: b(2, w.STRING),
  uKeyTtlSecond: b(3, w.UINT32),
  ipv4s: b(4, () => gE, !1, !0),
  ipv6s: b(5, () => yE, !1, !0)
}, MG = {}, RG = {
  ukey: b(1, w.STRING),
  ukeyTtlSec: b(2, w.UINT64)
}, BG = {
  authCode: b(1, w.UINT32),
  msg: b(2, w.BYTES),
  resultTime: b(3, w.UINT64)
}, UG = {
  msgSeq: b(1, w.UINT64)
}, LG = {}, jG = {
  rKeys: b(1, () => QG, !1, !0)
}, QG = {
  rkey: b(1, w.STRING),
  rkeyTtlSec: b(2, w.UINT64),
  storeId: b(3, w.UINT32),
  rkeyCreateTime: b(4, w.UINT32, !0),
  type: b(5, w.UINT32, !0)
}, $g = {
  file: b(1, () => $G, !0),
  download: b(3, () => GG, !0),
  delete: b(4, () => qG, !0),
  rename: b(5, () => HG, !0),
  move: b(6, () => WG, !0)
}, $G = {
  groupUin: b(1, w.UINT32),
  appId: b(2, w.UINT32),
  busId: b(3, w.UINT32),
  entrance: b(4, w.UINT32),
  targetDirectory: b(5, w.STRING),
  fileName: b(6, w.STRING),
  localDirectory: b(7, w.STRING),
  fileSize: b(8, w.UINT64),
  fileSha1: b(9, w.BYTES),
  fileSha3: b(10, w.BYTES),
  fileMd5: b(11, w.BYTES),
  field15: b(15, w.BOOL)
}, GG = {
  groupUin: b(1, w.UINT32),
  appId: b(2, w.UINT32),
  busId: b(3, w.UINT32),
  fileId: b(4, w.STRING)
}, qG = {
  groupUin: b(1, w.UINT32),
  busId: b(3, w.UINT32),
  fileId: b(5, w.STRING)
}, HG = {
  groupUin: b(1, w.UINT32),
  busId: b(3, w.UINT32),
  fileId: b(4, w.STRING),
  parentFolder: b(5, w.STRING),
  newFileName: b(6, w.STRING)
}, WG = {
  groupUin: b(1, w.UINT32),
  appId: b(2, w.UINT32),
  busId: b(3, w.UINT32),
  fileId: b(4, w.STRING),
  parentDirectory: b(5, w.STRING),
  targetDirectory: b(6, w.STRING)
}, Gg = {
  upload: b(1, () => zG),
  download: b(3, () => KG),
  delete: b(4, () => $y),
  rename: b(5, () => $y),
  move: b(6, () => $y)
}, zG = {
  retCode: b(1, w.INT32),
  retMsg: b(2, w.STRING),
  clientWording: b(3, w.STRING),
  uploadIp: b(4, w.STRING),
  serverDns: b(5, w.STRING),
  busId: b(6, w.INT32),
  fileId: b(7, w.STRING),
  checkKey: b(8, w.BYTES),
  fileKey: b(9, w.BYTES),
  boolFileExist: b(10, w.BOOL),
  uploadIpLanV4: b(12, w.STRING, !1, !0),
  uploadIpLanV6: b(13, w.STRING, !1, !0),
  uploadPort: b(14, w.UINT32)
}, KG = {
  retCode: b(1, w.INT32),
  retMsg: b(2, w.STRING),
  clientWording: b(3, w.STRING),
  downloadIp: b(4, w.STRING),
  downloadDns: b(5, w.STRING),
  downloadUrl: b(6, w.BYTES),
  fileSha1: b(7, w.BYTES),
  fileSha3: b(8, w.BYTES),
  fileMd5: b(9, w.BYTES),
  cookieVal: b(10, w.BYTES),
  saveFileName: b(11, w.STRING),
  previewPort: b(12, w.UINT32)
}, $y = {
  retCode: b(1, w.INT32),
  retMsg: b(2, w.STRING),
  clientWording: b(3, w.STRING)
}, VG = {
  targetUid: b(1, w.STRING),
  specialTitle: b(5, w.STRING, !0),
  expiredTime: b(6, w.INT32),
  uinName: b(7, w.STRING, !0),
  targetName: b(8, w.STRING)
}, YG = {
  groupUin: b(1, w.UINT32),
  body: b(3, () => VG)
}, JG = {
  ReqHead: b(1, () => j6),
  DownloadRKeyReq: b(4, () => XG)
}, XG = {
  key: b(1, w.INT32, !1, !0)
}, ZG = {
  rkey: b(1, w.STRING),
  ttl: b(2, w.UINT64),
  time: b(4, w.UINT32),
  type: b(5, w.UINT32)
}, eq = {
  rkeyList: b(1, () => ZG, !1, !0)
}, tq = {
  data: b(4, () => eq)
}, nq = {
  groupUin: b(1, w.UINT32),
  chatType: b(2, w.UINT32)
}, rq = {
  content: b(1, () => iq, !1, !0)
}, iq = {
  category: b(1, w.STRING),
  voices: b(2, () => oq, !1, !0)
}, oq = {
  voiceId: b(1, w.STRING),
  voiceDisplayName: b(2, w.STRING),
  voiceExampleUrl: b(3, w.STRING)
}, sq = {
  groupUin: b(1, w.UINT32),
  voiceId: b(2, w.STRING),
  text: b(3, w.STRING),
  chatType: b(4, w.UINT32),
  session: b(5, () => aq)
}, aq = {
  sessionId: b(1, w.UINT32)
}, cq = {
  statusCode: b(1, w.UINT32),
  field2: b(2, w.UINT32, !0),
  field3: b(3, w.UINT32),
  msgInfo: b(4, () => ea, !0)
}, uq = {
  subCommand: b(1, w.UINT32, !0),
  field2: b(2, w.INT32, !0),
  body: b(14, () => lq, !0),
  field101: b(101, w.INT32, !0),
  field102: b(102, w.INT32, !0),
  field200: b(200, w.INT32, !0),
  field99999: b(99999, w.BYTES, !0)
}, lq = {
  receiverUid: b(10, w.STRING, !0),
  fileUuid: b(20, w.STRING, !0),
  type: b(30, w.INT32, !0),
  fileHash: b(60, w.STRING, !0),
  t2: b(601, w.INT32, !0)
}, pq = {
  command: b(1, w.UINT32, !0),
  subCommand: b(2, w.UINT32, !0),
  body: b(14, () => dq, !0),
  field50: b(50, w.UINT32, !0)
}, dq = {
  field10: b(10, w.UINT32, !0),
  state: b(20, w.STRING, !0),
  result: b(30, () => fq, !0),
  metadata: b(40, () => hq, !0)
}, fq = {
  server: b(20, w.STRING, !0),
  port: b(40, w.UINT32, !0),
  url: b(50, w.STRING, !0),
  additionalServer: b(60, w.STRING, !1, !0),
  ssoPort: b(80, w.UINT32, !0),
  ssoUrl: b(90, w.STRING, !0),
  extra: b(120, w.BYTES, !0)
}, hq = {
  uin: b(1, w.UINT32, !0),
  field2: b(2, w.UINT32, !0),
  field3: b(3, w.UINT32, !0),
  size: b(4, w.UINT32, !0),
  timestamp: b(5, w.UINT32, !0),
  fileUuid: b(6, w.STRING, !0),
  fileName: b(7, w.STRING, !0),
  field100: b(100, w.BYTES, !0),
  field101: b(101, w.BYTES, !0),
  field110: b(110, w.UINT32, !0),
  timestamp1: b(130, w.UINT32, !0),
  fileHash: b(140, w.STRING, !0),
  field141: b(141, w.BYTES, !0),
  field142: b(142, w.BYTES, !0)
}, mq = {
  command: b(1, w.UINT32, !0),
  seq: b(2, w.INT32, !0),
  upload: b(19, () => gq, !0),
  businessId: b(101, w.INT32, !0),
  clientType: b(102, w.INT32, !0),
  flagSupportMediaPlatform: b(200, w.INT32, !0)
}, gq = {
  senderUid: b(10, w.STRING, !0),
  receiverUid: b(20, w.STRING, !0),
  fileSize: b(30, w.UINT32, !0),
  fileName: b(40, w.STRING, !0),
  md510MCheckSum: b(50, w.BYTES, !0),
  sha1CheckSum: b(60, w.BYTES, !0),
  localPath: b(70, w.STRING, !0),
  md5CheckSum: b(110, w.BYTES, !0),
  sha3CheckSum: b(120, w.BYTES, !0)
}, yq = {
  subCommand: b(1, w.UINT32),
  field2: b(2, w.INT32),
  body: b(10, () => vq, !0),
  field101: b(101, w.INT32),
  field102: b(102, w.INT32),
  field200: b(200, w.INT32)
}, vq = {
  senderUid: b(10, w.STRING, !0),
  receiverUid: b(20, w.STRING, !0),
  fileUuid: b(30, w.STRING, !0),
  fileHash: b(40, w.STRING, !0)
}, W6 = {
  command: b(1, w.UINT32),
  seq: b(2, w.INT32),
  upload: b(19, () => bq, !0),
  businessId: b(101, w.INT32),
  clientType: b(102, w.INT32),
  flagSupportMediaPlatform: b(200, w.INT32)
}, bq = {
  retCode: b(10, w.INT32),
  retMsg: b(20, w.STRING, !0),
  totalSpace: b(30, w.INT64),
  usedSpace: b(40, w.INT64),
  uploadedSize: b(50, w.INT64),
  uploadIp: b(60, w.STRING, !0),
  uploadDomain: b(70, w.STRING, !0),
  uploadPort: b(80, w.UINT32),
  uuid: b(90, w.STRING, !0),
  uploadKey: b(100, w.BYTES, !0),
  boolFileExist: b(110, w.BOOL),
  packSize: b(120, w.INT32),
  uploadIpList: b(130, w.STRING, !1, !0),
  // repeated
  uploadHttpsPort: b(140, w.INT32),
  uploadHttpsDomain: b(150, w.STRING, !0),
  uploadDns: b(160, w.STRING, !0),
  uploadLanip: b(170, w.STRING, !0),
  fileAddon: b(200, w.STRING, !0),
  mediaPlatformUploadKey: b(220, w.BYTES, !0)
};
b(1, w.UINT32, !0), b(2, w.UINT32, !0), b(50, w.UINT32, !0);
b(10, w.UINT32, !0);
const xq = {
  value: b(1, w.STRING)
}, wq = {
  inner: b(2, () => xq)
}, Sq = {
  uin: b(1, w.STRING),
  groupUin: b(2, w.STRING),
  version: b(3, w.STRING)
}, _q = {
  body: b(2, () => Sq)
}, Eq = {
  uin: b(1, w.UINT32),
  groupUin: b(2, w.UINT32),
  friendUin: b(5, w.UINT32),
  ext: b(6, w.UINT32, !0)
}, Aq = {
  uin: b(1, w.UINT32),
  key: b(3, () => Iq, !1, !0)
}, Iq = {
  key: b(1, w.UINT32)
}, Cq = {
  key: b(1, w.UINT32),
  value: b(2, w.UINT64)
}, Tq = {
  status: b(2, () => Cq)
}, kq = {
  data: b(1, () => Tq)
}, Gw = {
  command: b(1, w.UINT32),
  subCommand: b(2, w.UINT32),
  errorCode: b(3, w.UINT32),
  body: b(4, w.BYTES),
  errorMsg: b(5, w.STRING, !0),
  isReserved: b(12, w.UINT32)
};
b(4, w.BYTES);
const Nq = {
  version: b(1, w.UINT32),
  client: b(2, w.UINT32),
  entrance: b(3, w.UINT32),
  ocrReqBody: b(10, () => Pq, !0)
}, Pq = {
  imageUrl: b(1, w.STRING),
  languageType: b(2, w.UINT32),
  scene: b(3, w.UINT32),
  originMd5: b(10, w.STRING),
  afterCompressMd5: b(11, w.STRING),
  afterCompressFileSize: b(12, w.STRING),
  afterCompressWeight: b(13, w.STRING),
  afterCompressHeight: b(14, w.STRING),
  isCut: b(15, w.BOOL)
}, Dq = {
  retCode: b(1, w.INT32),
  errMsg: b(2, w.STRING),
  wording: b(3, w.STRING),
  ocrRspBody: b(10, () => Fq)
}, Fq = {
  textDetections: b(1, () => Oq, !1, !0),
  language: b(2, w.STRING),
  requestId: b(3, w.STRING),
  ocrLanguageList: b(101, w.STRING, !1, !0),
  dstTranslateLanguageList: b(102, w.STRING, !1, !0),
  languageList: b(103, () => Bq, !1, !0),
  afterCompressWeight: b(111, w.UINT32),
  afterCompressHeight: b(112, w.UINT32)
}, Oq = {
  detectedText: b(1, w.STRING),
  confidence: b(2, w.UINT32),
  polygon: b(3, () => Mq),
  advancedInfo: b(4, w.STRING)
}, Mq = {
  coordinates: b(1, () => Rq, !1, !0)
}, Rq = {
  x: b(1, w.INT32),
  y: b(2, w.INT32)
}, Bq = {
  languageCode: b(1, w.STRING),
  languageDesc: b(2, w.STRING)
}, vE = {
  groupUin: b(1, w.UINT32),
  msgSeq: b(2, w.UINT64)
};
class z6 {
  trans;
  logger;
  constructor(e, n) {
    this.trans = e, this.logger = n;
  }
  // TODO: 没用到的加密方法先注释掉
  // private encryptTransExt (key: Uint8Array) {
  //   if (!this.trans.encrypt) return;
  //   this.trans.ext = tea.encrypt(Buffer.from(this.trans.ext), Buffer.from(key));
  // }
  timeout() {
    return new Promise((e, n) => {
      setTimeout(
        () => {
          n(new Error(`[Highway] timeout after ${this.trans.timeout}s`));
        },
        (this.trans.timeout ?? 1 / 0) * 1e3
      );
    });
  }
  buildPicUpHead(e, n, r) {
    return new fe(WQ).encode({
      msgBaseHead: {
        version: 1,
        uin: this.trans.uin,
        command: "PicUp.DataUp",
        seq: 0,
        retryTimes: 0,
        appId: 1600001604,
        dataFlag: 16,
        commandId: this.trans.cmd
      },
      msgSegHead: {
        serviceId: 0,
        filesize: BigInt(this.trans.size),
        dataOffset: BigInt(e),
        dataLength: n,
        serviceTicket: this.trans.ticket,
        md5: r,
        fileMd5: this.trans.sum,
        cacheAddr: 0,
        cachePort: 0
      },
      bytesReqExtendInfo: this.trans.ext,
      timestamp: BigInt(0),
      msgLoginSigHead: {
        uint32LoginSigType: 8,
        appId: 1600001604
      }
    });
  }
}
class Uq extends aL.Transform {
  uploader;
  offset;
  constructor(e) {
    super(), this.uploader = e, this.offset = 0;
  }
  _transform(e, n, r) {
    let i = 0;
    for (; i < e.length; ) {
      const o = Math.min(Cn, e.length - i), s = e.subarray(i, i + o), a = bs.createHash("md5").update(s).digest(), c = this.uploader.buildPicUpHead(this.offset, s.length, a);
      i += s.length, this.offset += s.length, this.push(Im.pack(Buffer.from(c), s));
    }
    r(null);
  }
}
class Lq extends z6 {
  async upload() {
    const e = new AbortController(), { signal: n } = e, r = new Promise((o, s) => {
      const a = new Uq(this), c = TL.connect(this.trans.port, this.trans.server, () => {
        this.trans.data.pipe(a).pipe(c, { end: !1 });
      }), u = (l) => {
        const d = new fe(P6).decode(l);
        d.errorCode !== 0 && (c.end(), s(new Error(`[Highway] tcpUpload failed (code=${d.errorCode})`)));
        const f = ((Number(d.msgSegHead?.dataOffset) + Number(d.msgSegHead?.dataLength)) / Number(d.msgSegHead?.filesize)).toFixed(2);
        this.logger.debug(`[Highway] tcpUpload ${d.errorCode} | ${f} | ${Buffer.from(l).toString("hex")}`), Number(d.msgSegHead?.dataOffset) + Number(d.msgSegHead?.dataLength) >= Number(d.msgSegHead?.filesize) && (this.logger.debug("[Highway] tcpUpload finished."), c.end(), o());
      };
      c.on("data", (l) => {
        n.aborted && (c.end(), s(new Error("Upload aborted due to timeout")));
        const [d] = Im.unpack(l);
        u(d);
      }), c.on("close", () => {
        this.logger.debug("[Highway] tcpUpload socket closed."), o();
      }), c.on("error", (l) => {
        c.end(), s(new Error(`[Highway] tcpUpload socket.on error: ${l}`));
      }), this.trans.data.on("error", (l) => {
        c.end(), s(new Error(`[Highway] tcpUpload readable error: ${l}`));
      });
    }), i = this.timeout().catch((o) => {
      throw e.abort(), new Error(o.message);
    });
    await Promise.race([r, i]);
  }
}
class jq extends z6 {
  async upload() {
    const e = new AbortController(), { signal: n } = e, r = (async () => {
      let o = 0;
      for await (const s of this.trans.data) {
        if (n.aborted)
          throw new Error("Upload aborted due to timeout");
        const a = s;
        try {
          await this.uploadBlock(a, o);
        } catch (c) {
          throw new Error(`[Highway] httpUpload Error uploading block at offset ${o}: ${c}`);
        }
        o += a.length;
      }
    })(), i = this.timeout().catch((o) => {
      throw e.abort(), new Error(o.message);
    });
    await Promise.race([r, i]);
  }
  async uploadBlock(e, n) {
    const r = bs.createHash("md5").update(e).digest(), i = this.buildPicUpHead(n, e.length, r), o = Im.pack(Buffer.from(i), e), s = await this.httpPostHighwayContent(o, `http://${this.trans.server}:${this.trans.port}/cgi-bin/httpconn?htcmd=0x6FF0087&uin=${this.trans.uin}`), [a, c] = Im.unpack(s), u = new fe(P6).decode(a);
    if (this.logger.debug(`[Highway] httpUploadBlock: ${u.errorCode} | ${u.msgSegHead?.retCode} | ${u.bytesRspExtendInfo} | ${a.toString("hex")} | ${c.toString("hex")}`), u.errorCode !== 0) throw new Error(`[Highway] httpUploadBlock failed (code=${u.errorCode})`);
  }
  async httpPostHighwayContent(e, n) {
    return new Promise((r, i) => {
      try {
        const o = {
          method: "POST",
          headers: {
            Connection: "keep-alive",
            "Accept-Encoding": "identity",
            "User-Agent": "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2)",
            "Content-Length": e.length.toString()
          }
        }, s = Gp.request(n, o, (a) => {
          const c = [];
          a.on("data", (u) => {
            c.push(u);
          }), a.on("end", () => {
            r(Buffer.concat(c));
          });
        });
        s.write(e), s.on("error", (a) => {
          i(a);
        });
      } catch (o) {
        i(new Error(o.message));
      }
    });
  }
}
class Qq {
  sig;
  server = "htdata3.qq.com";
  port = 80;
  logger;
  constructor(e, n, r = "htdata3.qq.com", i = 80) {
    this.sig = e, this.logger = n;
  }
  changeServer(e, n) {
    this.server = e, this.port = n;
  }
  buildDataUpTrans(e, n, r, i, o, s = 1200) {
    return {
      uin: this.sig.uin,
      cmd: e,
      command: "PicUp.DataUp",
      data: n,
      sum: i,
      size: r,
      ticket: this.sig.sigSession,
      ext: o,
      encrypt: !1,
      timeout: s,
      server: this.server,
      port: this.port
    };
  }
  async upload(e, n, r, i, o) {
    const s = this.buildDataUpTrans(e, n, r, i, o);
    try {
      await new Lq(s, this.logger).upload();
    } catch (a) {
      this.logger.error(`[Highway] upload failed: ${a}, fallback to http upload`);
      try {
        await new jq(s, this.logger).upload();
      } catch (c) {
        throw this.logger.error(`[Highway] http upload failed: ${c}`), c;
      }
    }
  }
}
class bE {
  static build(e, n, r, i, o, s, a) {
    const c = a ?? mO.randomUUID(), u = n.some((l) => l.isGroupMsg);
    return r || (r = n.length === 0 ? "聊天记录" : u ? "群聊的聊天记录" : n.map((l) => l.senderName).filter((l, d, f) => f.indexOf(l) === d).slice(0, 4).join("和") + "的聊天记录"), i || (i = n.length === 0 ? [{
      text: "Nya~ This message is send from NapCat.Packet!"
    }] : n.map((l) => ({
      text: `${l.senderName}: ${l.msg?.map((d) => d.preview).join("")}`
    }))), o || (o = `查看${n.length}条转发消息`), s || (s = "[聊天记录]"), {
      app: "com.tencent.multimsg",
      config: {
        autosize: 1,
        forward: 1,
        round: 1,
        type: "normal",
        width: 300
      },
      desc: s,
      extra: {
        filename: c,
        tsum: n.length
      },
      meta: {
        detail: {
          news: i,
          resid: e,
          source: r,
          summary: o,
          uniseq: c
        }
      },
      prompt: s,
      ver: "0.0.0.5",
      view: "contact"
    };
  }
  static fromResId(e) {
    return this.build(e, []);
  }
  static fromPacketMsg(e, n, r, i, o, s, a) {
    return this.build(
      e,
      n.map((c) => ({
        senderName: c.senderName,
        isGroupMsg: c.groupId !== void 0,
        msg: c.msg.map((u) => ({
          preview: u.valid ? u.toPreview() : "[该消息类型暂不支持查看]"
        }))
      })),
      r,
      i,
      o,
      s,
      a
    );
  }
}
class po {
  constructor(e) {
  }
  get valid() {
    return !0;
  }
  buildContent() {
  }
  buildElement() {
    return [];
  }
  static parseElement;
  toPreview() {
    return "[暂不支持该消息类型喵~]";
  }
}
class Tm extends po {
  text;
  constructor(e) {
    super(e), this.text = e.textElement.content;
  }
  buildElement() {
    return [{
      text: {
        str: this.text
      }
    }];
  }
  static parseElement = (e) => {
    if (e.text?.str && (e.text?.attr6Buf === void 0 || e.text?.attr6Buf?.length === 0))
      return [{
        textElement: {
          content: e.text?.str,
          atType: Mr.ATTYPEUNKNOWN,
          atUid: "",
          atTinyId: "",
          atNtUid: ""
        },
        elementType: _e.UNKNOWN,
        elementId: ""
      }, null];
  };
  toPreview() {
    return this.text;
  }
}
class nC extends Tm {
  targetUid;
  atAll;
  constructor(e) {
    super(e), this.targetUid = e.textElement.atNtUid, this.atAll = e.textElement.atType === Mr.ATTYPEALL;
  }
  buildElement() {
    return [{
      text: {
        str: this.text,
        pbReserve: new fe(j$).encode(
          {
            type: this.atAll ? 1 : 2,
            uin: 0,
            field5: 0,
            uid: this.targetUid
          }
        )
      }
    }];
  }
  static parseElement = (e) => {
    if (e.text?.str && (e.text?.attr6Buf?.length ?? 100) >= 11)
      return [{
        textElement: {
          content: e.text?.str,
          atType: Mr.ATTYPEONE,
          atUid: String(Buffer.from(e.text.attr6Buf).readUInt32BE(7)),
          // FIXME: hack
          atTinyId: "",
          atNtUid: ""
        },
        elementType: _e.UNKNOWN,
        elementId: ""
      }, null];
  };
}
class qw extends po {
  time;
  targetMessageId;
  targetMessageSeq;
  targetMessageClientSeq;
  targetUin;
  targetUid;
  targetElems;
  targetSourceMsg;
  targetPeer;
  constructor(e) {
    super(e), this.time = +(e.replyElement.replyMsgTime ?? Math.floor(Date.now() / 1e3)), this.targetMessageId = BigInt(e.replyElement.replayMsgId ?? 0), this.targetMessageSeq = +(e.replyElement.replayMsgSeq ?? 0), this.targetMessageClientSeq = +(e.replyElement.replyMsgClientSeq ?? 0), this.targetUin = +(e.replyElement.senderUin ?? 0), this.targetUid = e.replyElement.senderUidStr ?? "", this.targetPeer = e.replyElement._replyMsgPeer;
  }
  get isGroupReply() {
    return this.targetMessageClientSeq === 0;
  }
  buildElement() {
    return [{
      srcMsg: {
        origSeqs: [this.isGroupReply ? this.targetMessageSeq : this.targetMessageClientSeq],
        senderUin: BigInt(this.targetUin),
        time: this.time,
        elems: this.targetElems ?? [],
        sourceMsg: new fe(Wu).encode(this.targetSourceMsg ?? {}),
        toUin: BigInt(0)
      }
    }];
  }
  static parseElement = (e) => {
    if (e.srcMsg && e.srcMsg.pbReserve) {
      const n = e.srcMsg.pbReserve;
      return [{
        replyElement: {
          replayMsgSeq: String(n.friendSeq ?? e.srcMsg?.origSeqs?.[0] ?? 0),
          replayMsgId: String(n.messageId ?? 0),
          senderUin: String(e?.srcMsg ?? 0)
        },
        elementType: _e.UNKNOWN,
        elementId: ""
      }, null];
    }
  };
  toPreview() {
    return "[回复消息]";
  }
}
class $q extends po {
  faceId;
  isLargeFace;
  resultId;
  constructor(e) {
    super(e), this.faceId = e.faceElement.faceIndex, this.resultId = e.faceElement.resultId, this.isLargeFace = e.faceElement.faceType === qs.AniSticke;
  }
  buildElement() {
    return this.isLargeFace ? [{
      commonElem: {
        serviceType: 37,
        pbElem: new fe(ZI).encode({
          aniStickerPackId: "1",
          aniStickerId: "8",
          faceId: this.faceId,
          sourceType: 1,
          resultId: this.resultId,
          preview: "",
          randomType: 1
        }),
        businessType: 1
      }
    }] : this.faceId < 260 ? [{
      face: {
        index: this.faceId
      }
    }] : [{
      commonElem: {
        serviceType: 33,
        pbElem: new fe(eC).encode({
          faceId: this.faceId,
          preview: "",
          preview2: ""
        }),
        businessType: 1
      }
    }];
  }
  static parseElement = (e) => {
    if (e.face?.index)
      return [{
        faceElement: {
          faceIndex: e.face.index,
          faceType: qs.Normal
        },
        elementType: _e.UNKNOWN,
        elementId: ""
      }, null];
    if (e?.commonElem?.serviceType === 37 && e?.commonElem?.pbElem) {
      const n = new fe(ZI).decode(e?.commonElem?.pbElem);
      if (n?.faceId)
        return [{
          faceElement: {
            faceIndex: n.faceId,
            faceType: qs.Normal
          },
          elementType: _e.UNKNOWN,
          elementId: ""
        }, null];
    }
    if (e?.commonElem?.serviceType === 33 && e?.commonElem?.pbElem) {
      const n = new fe(eC).decode(e?.commonElem?.pbElem);
      if (n?.faceId)
        return [{
          faceElement: {
            faceIndex: n.faceId,
            faceType: qs.Normal
          },
          elementType: _e.UNKNOWN,
          elementId: ""
        }, null];
    }
  };
  toPreview() {
    return "[表情]";
  }
}
class Gq extends po {
  emojiName;
  emojiId;
  emojiPackageId;
  emojiKey;
  constructor(e) {
    super(e), this.emojiName = e.marketFaceElement.faceName, this.emojiId = e.marketFaceElement.emojiId, this.emojiPackageId = e.marketFaceElement.emojiPackageId, this.emojiKey = e.marketFaceElement.key;
  }
  buildElement() {
    return [{
      marketFace: {
        faceName: this.emojiName,
        itemType: 6,
        faceInfo: 1,
        faceId: Buffer.from(this.emojiId, "hex"),
        tabId: this.emojiPackageId,
        subType: 3,
        key: this.emojiKey,
        imageWidth: 300,
        imageHeight: 300,
        pbReserve: {
          field8: 1
        }
      }
    }];
  }
  toPreview() {
    return `${this.emojiName}`;
  }
}
class Hw extends po {
  path;
  name;
  size;
  md5;
  width;
  height;
  picType;
  picSubType;
  summary;
  sha1 = null;
  msgInfo = null;
  groupPicExt = null;
  c2cPicExt = null;
  constructor(e) {
    super(e), this.path = e.picElement.sourcePath, this.name = e.picElement.fileName, this.size = +e.picElement.fileSize, this.md5 = e.picElement.md5HexStr ?? "", this.width = e.picElement.picWidth, this.height = e.picElement.picHeight, this.picType = e.picElement.picType, this.picSubType = e.picElement.picSubType ?? 0, this.summary = e.picElement.summary === "" ? e.picElement.picSubType === 0 ? "[图片]" : "[动画表情]" : e.picElement.summary;
  }
  get valid() {
    return !!this.msgInfo;
  }
  buildElement() {
    return this.msgInfo ? [{
      commonElem: {
        serviceType: 48,
        pbElem: new fe(ea).encode(this.msgInfo),
        businessType: 10
      }
    }] : [];
  }
  static parseElement = (e) => {
    if (e?.commonElem?.serviceType === 48 || [10, 20].includes(e?.commonElem?.businessType ?? 0)) {
      const i = new fe(ea).decode(e.commonElem.pbElem).msgInfoBody[0]?.index;
      return [{
        picElement: {
          fileSize: i?.info.fileSize ?? 0,
          picWidth: i?.info?.width ?? 0,
          picHeight: i?.info?.height ?? 0,
          fileName: i?.info?.fileHash ?? "",
          sourcePath: "",
          original: !1,
          picType: Wp.NEWPIC_APNG,
          fileUuid: "",
          fileSubId: "",
          thumbFileSize: 0,
          summary: "[图片]",
          thumbPath: /* @__PURE__ */ new Map()
        },
        elementType: _e.UNKNOWN,
        elementId: ""
      }, e];
    }
    if (e?.notOnlineImage) {
      const n = e?.notOnlineImage, r = {
        picElement: {
          fileSize: n.fileLen ?? 0,
          picWidth: n.picWidth ?? 0,
          picHeight: n.picHeight ?? 0,
          fileName: Buffer.from(n.picMd5).toString("hex") ?? "",
          sourcePath: "",
          original: !1,
          picType: Wp.NEWPIC_APNG,
          fileUuid: "",
          fileSubId: "",
          thumbFileSize: 0,
          summary: "[图片]",
          thumbPath: /* @__PURE__ */ new Map()
        },
        elementType: _e.UNKNOWN,
        elementId: ""
      };
      return n.origUrl?.includes("&fileid=") ? r.picElement.originImageUrl = `https://multimedia.nt.qq.com.cn${n.origUrl}` : r.picElement.originImageUrl = `https://gchat.qpic.cn${n.origUrl}`, [r, e];
    }
  };
  toPreview() {
    return this.summary;
  }
}
class K6 extends po {
  fileSize;
  filePath;
  thumbSize;
  thumbPath;
  fileMd5;
  fileSha1;
  thumbMd5;
  thumbSha1;
  thumbWidth;
  thumbHeight;
  msgInfo = null;
  constructor(e) {
    super(e), this.fileSize = e.videoElement.fileSize, this.filePath = e.videoElement.filePath, this.thumbSize = e.videoElement.thumbSize, this.thumbPath = e.videoElement.thumbPath?.get(0), this.fileMd5 = e.videoElement.videoMd5, this.thumbMd5 = e.videoElement.thumbMd5, this.thumbWidth = e.videoElement.thumbWidth, this.thumbHeight = e.videoElement.thumbHeight;
  }
  get valid() {
    return !!this.msgInfo;
  }
  buildElement() {
    return this.msgInfo ? [{
      commonElem: {
        serviceType: 48,
        pbElem: new fe(ea).encode(this.msgInfo),
        businessType: 21
      }
    }] : [];
  }
  toPreview() {
    return "[视频]";
  }
}
class V6 extends po {
  filePath;
  fileSize;
  fileMd5;
  fileSha1;
  fileDuration;
  msgInfo = null;
  constructor(e) {
    super(e), this.filePath = e.pttElement.filePath, this.fileSize = +e.pttElement.fileSize, this.fileMd5 = e.pttElement.md5HexStr, this.fileDuration = Math.round(e.pttElement.duration);
  }
  get valid() {
    return !1;
  }
  buildElement() {
    return this.msgInfo ? [{
      commonElem: {
        serviceType: 48,
        pbElem: new fe(ea).encode(this.msgInfo),
        businessType: 22
      }
    }] : [];
  }
  toPreview() {
    return "[语音]";
  }
}
class Y6 extends po {
  fileName;
  filePath;
  fileSize;
  fileSha1;
  fileMd5;
  fileUuid;
  fileHash;
  isGroupFile;
  _private_send_uid;
  _private_recv_uid;
  _e37_800_rsp;
  constructor(e) {
    super(e), this.fileName = e.fileElement.fileName, this.filePath = e.fileElement.filePath, this.fileSize = +e.fileElement.fileSize;
  }
  get valid() {
    return this.isGroupFile || !!this._e37_800_rsp;
  }
  buildContent() {
    if (!(this.isGroupFile || !this._e37_800_rsp))
      return new fe(l$).encode({
        file: {
          fileType: 0,
          fileUuid: this.fileUuid,
          fileMd5: this.fileMd5,
          fileName: this.fileName,
          fileSize: BigInt(this.fileSize),
          subcmd: 1,
          dangerEvel: 0,
          expireTime: Math.floor(Date.now() / 1e3) + 10080 * 60,
          fileHash: this.fileHash
        },
        field6: {
          field2: {
            field1: this._e37_800_rsp?.body?.field30?.field110,
            fileUuid: this.fileUuid,
            fileName: this.fileName,
            field6: this._e37_800_rsp?.body?.field30?.field3,
            field7: this._e37_800_rsp?.body?.field30?.field101,
            field8: this._e37_800_rsp?.body?.field30?.field100,
            timestamp1: this._e37_800_rsp?.body?.field30?.timestamp1,
            fileHash: this.fileHash,
            selfUid: this._private_send_uid,
            destUid: this._private_recv_uid
          }
        }
      });
  }
  buildElement() {
    if (!this.isGroupFile) return [];
    const e = Buffer.alloc(2), n = new fe(f$).encode({
      field1: 6,
      fileName: this.fileName,
      inner: {
        info: {
          busId: 102,
          fileId: this.fileUuid,
          fileSize: BigInt(this.fileSize),
          fileName: this.fileName,
          fileSha: this.fileSha1,
          extInfoString: "",
          fileMd5: this.fileMd5
        }
      }
    });
    return e.writeUInt16BE(n.length), [{
      transElem: {
        elemType: 24,
        elemValue: Buffer.concat([Buffer.from([1]), e, n])
        // TLV
      }
    }];
  }
  toPreview() {
    return `[文件]${this.fileName}`;
  }
}
class qq extends po {
  payload;
  constructor(e) {
    super(e), this.payload = e.arkElement.bytesData;
  }
  buildElement() {
    return [{
      lightAppElem: {
        data: Buffer.concat([
          Buffer.from([1]),
          vO.deflateSync(Buffer.from(this.payload, "utf-8"))
        ])
      }
    }];
  }
  toPreview() {
    return "[卡片消息]";
  }
}
class Hq extends po {
  content;
  constructor(e) {
    super(e), this.content = e.markdownElement.content;
  }
  buildElement() {
    return [{
      commonElem: {
        serviceType: 45,
        pbElem: new fe(Q$).encode({
          content: this.content
        }),
        businessType: 1
      }
    }];
  }
  toPreview() {
    return `[Markdown消息 ${this.content}]`;
  }
}
class Wq extends po {
  resid;
  message;
  uuid;
  constructor(e, n) {
    super(e), this.resid = e.multiForwardMsgElement.resId, this.message = n ?? [], this.uuid = e.multiForwardMsgElement.fileName || mO.randomUUID();
  }
  buildElement() {
    return [{
      lightAppElem: {
        data: Buffer.concat([
          Buffer.from([1]),
          vO.deflateSync(Buffer.from(JSON.stringify(bE.fromPacketMsg(this.resid, this.message, void 0, void 0, void 0, void 0, this.uuid)), "utf-8"))
        ])
      }
    }];
  }
  toPreview() {
    return "[聊天记录]";
  }
}
class xE {
  static failBackText = new Tm(
    {
      textElement: { content: "[该消息类型暂不支持查看]" }
    }
  );
  buildFakeMsg(e, n) {
    return n.map((r) => {
      const i = `https://q.qlogo.cn/headimg_dl?dst_uin=${r.senderUin}&spec=0&img_type=jpg`, o = r.msg.reduceRight((a, c) => a ?? c.buildContent(), void 0), s = r.msg.flatMap((a) => a.buildElement() ?? []);
      return !o && !s.length && s.push(xE.failBackText.buildElement()), {
        responseHead: {
          fromUin: r.senderUin,
          type: 0,
          sigMap: 0,
          toUin: 0,
          fromUid: "",
          forward: r.groupId ? void 0 : {
            friendName: r.senderName
          },
          toUid: r.groupId ? void 0 : e,
          grp: r.groupId ? {
            groupUin: r.groupId,
            memberName: r.senderName,
            unknown5: 2
          } : void 0
        },
        contentHead: {
          type: r.groupId ? 82 : 9,
          subType: r.groupId ? void 0 : 4,
          divSeq: r.groupId ? void 0 : 4,
          autoReply: 0,
          sequence: Ng.randomBytes(4).readUInt32LE(0),
          timeStamp: +r.time.toString().substring(0, 10),
          forward: {
            field1: 0,
            field2: 0,
            field3: r.groupId ? 1 : 2,
            unknownBase64: i,
            avatar: i
          }
        },
        body: {
          richText: {
            elems: s
          },
          msgContent: o
        }
      };
    });
  }
}
const fa = (t) => Buffer.from(t);
class mt {
  msgBuilder;
  constructor() {
    this.msgBuilder = new xE();
  }
}
class zq extends mt {
  build() {
    const e = new fe(SQ).encode({
      httpConn: {
        field1: 0,
        field2: 0,
        field3: 16,
        field4: 1,
        field6: 3,
        serviceTypes: [1, 5, 10, 21],
        // tgt: "",  // TODO: do we really need tgt? seems not
        field9: 2,
        field10: 9,
        field11: 8,
        ver: "1.0.1"
      }
    });
    return {
      cmd: "HttpConn.0x6ff_501",
      data: fa(e)
    };
  }
  parse(e) {
    return new fe(_Q).decode(e);
  }
}
const rC = new zq(), nm = (t) => (t = t & 4294967295, [t & 255, (t & 65280) >> 8, (t & 16711680) >> 16, (t & 4278190080) >> 24 & 255].join(".")), Os = (t) => t.map((e) => ({
  domain: {
    isEnable: !0,
    ip: nm(e.outIP ?? 0)
  },
  port: e.outPort
}));
class Kq {
  Sha1BlockSize = 64;
  Sha1DigestSize = 20;
  _padding = Buffer.concat([Buffer.from([128]), Buffer.alloc(63)]);
  _state = new Uint32Array(5);
  _count = new Uint32Array(2);
  _buffer = Buffer.allocUnsafe(this.Sha1BlockSize);
  _w = new Uint32Array(80);
  constructor() {
    this.reset();
  }
  reset() {
    this._state[0] = 1732584193, this._state[1] = 4023233417, this._state[2] = 2562383102, this._state[3] = 271733878, this._state[4] = 3285377520, this._count[0] = 0, this._count[1] = 0, this._buffer.fill(0);
  }
  rotateLeft(e, n) {
    return (e << n | e >>> 32 - n) >>> 0;
  }
  transform(e, n) {
    const r = this._w, i = new DataView(e.buffer, e.byteOffset + n, 64);
    for (let l = 0; l < 16; l++)
      r[l] = i.getUint32(l * 4, !1);
    for (let l = 16; l < 80; l++)
      r[l] = this.rotateLeft(r[l - 3] ^ r[l - 8] ^ r[l - 14] ^ r[l - 16], 1) >>> 0;
    let o = this._state[0], s = this._state[1], a = this._state[2], c = this._state[3], u = this._state[4];
    for (let l = 0; l < 80; l++) {
      let d;
      l < 20 ? d = (s & a | ~s & c) + 1518500249 : l < 40 ? d = (s ^ a ^ c) + 1859775393 : l < 60 ? d = (s & a | s & c | a & c) + 2400959708 : d = (s ^ a ^ c) + 3395469782, d += this.rotateLeft(o, 5) + u + r[l] >>> 0, u = c, c = a, a = this.rotateLeft(s, 30) >>> 0, s = o, o = d;
    }
    this._state[0] = this._state[0] + o >>> 0, this._state[1] = this._state[1] + s >>> 0, this._state[2] = this._state[2] + a >>> 0, this._state[3] = this._state[3] + c >>> 0, this._state[4] = this._state[4] + u >>> 0;
  }
  update(e, n) {
    let r = (this._count[0] >>> 3 & 63) >>> 0;
    const i = n ?? e.length;
    this._count[0] = this._count[0] + (i << 3) >>> 0, this._count[0] < i << 3 && (this._count[1] = this._count[1] + 1 >>> 0), this._count[1] = this._count[1] + (i >>> 29) >>> 0;
    const o = this.Sha1BlockSize - r >>> 0;
    let s = 0;
    if (i >= o) {
      for (e.copy(this._buffer, r, 0, o), this.transform(this._buffer, 0), s = o; s + this.Sha1BlockSize <= i; s = s + this.Sha1BlockSize >>> 0)
        this.transform(e, s);
      r = 0;
    }
    e.copy(this._buffer, r, s, i);
  }
  hash(e = !0) {
    const n = Buffer.allocUnsafe(this.Sha1DigestSize);
    if (e)
      for (let r = 0; r < 5; r++) n.writeUInt32BE(this._state[r], r * 4);
    else
      for (let r = 0; r < 5; r++) n.writeUInt32LE(this._state[r], r * 4);
    return n;
  }
  final() {
    const e = Buffer.allocUnsafe(this.Sha1DigestSize), n = Buffer.allocUnsafe(8);
    n.writeUInt32BE(this._count[1], 0), n.writeUInt32BE(this._count[0], 4);
    const r = (this._count[0] >>> 3 & 63) >>> 0, i = (r < 56 ? 56 - r : 120 - r) >>> 0;
    this.update(this._padding, i), this.update(n);
    for (let o = 0; o < 5; o++)
      e.writeUInt32BE(this._state[o], o * 4);
    return e;
  }
}
class Vq extends sL.Transform {
  blockSize = 1024 * 1024;
  sha1;
  buffer;
  bytesRead;
  byteArrayList;
  constructor() {
    super(), this.sha1 = new Kq(), this.buffer = Buffer.alloc(0), this.bytesRead = 0, this.byteArrayList = [];
  }
  _transform(e, n, r) {
    try {
      this.buffer = Buffer.concat([this.buffer, e]);
      let i = 0;
      for (; this.buffer.length - i >= this.sha1.Sha1BlockSize; ) {
        const o = this.buffer.subarray(i, i + this.sha1.Sha1BlockSize);
        if (this.sha1.update(o), i += this.sha1.Sha1BlockSize, this.bytesRead += this.sha1.Sha1BlockSize, this.bytesRead % this.blockSize === 0) {
          const s = this.sha1.hash(!1);
          this.byteArrayList.push(Buffer.from(s));
        }
      }
      this.buffer = this.buffer.subarray(i), r(null);
    } catch (i) {
      r(i);
    }
  }
  _flush(e) {
    try {
      this.buffer.length > 0 && this.sha1.update(this.buffer);
      const n = this.sha1.final();
      this.byteArrayList.push(Buffer.from(n));
      for (const r of this.byteArrayList)
        this.push(r);
      e(null);
    } catch (n) {
      e(n);
    }
  }
}
function Yq(t) {
  return new Promise((e, n) => {
    t.on("error", n), t.pipe(Ng.createHash("sha1").on("error", n).on("data", e));
  });
}
function Jq(t) {
  return new Promise((e, n) => {
    t.on("error", n), t.pipe(Ng.createHash("md5").on("error", n).on("data", e));
  });
}
function Eo(t) {
  const e = Ae.createReadStream(t);
  return Yq(e);
}
function Ww(t, e) {
  const n = Ae.createReadStream(t, e ? { start: 0, end: e - 1 } : {});
  return Jq(n);
}
function iC(t) {
  return new Promise((e, n) => {
    const r = Ae.createReadStream(t), i = new Vq(), o = [];
    i.on("data", (s) => {
      o.push(s);
    }), i.on("end", () => {
      e(o);
    }), i.on("error", (s) => {
      n(s);
    }), r.pipe(i);
  });
}
class Xq extends mt {
  build(e, n, r, i = !0, o = !1) {
    const s = new fe(Gw).encode({
      command: e,
      subCommand: n,
      body: r,
      isReserved: i ? 1 : 0
    });
    return {
      cmd: `OidbSvcTrpcTcp.0x${e.toString(16).toUpperCase()}_${n}`,
      data: fa(s)
    };
  }
  parse(e) {
    const n = new fe(Gw).decode(e);
    if (n.errorCode !== 0)
      throw new Error(`OidbSvcTrpcTcpBase parse error: ${n.errorMsg} (code=${n.errorCode})`);
    return n;
  }
}
const $e = new Xq();
class Zq extends mt {
  build(e, n) {
    const r = new fe(Pi).encode(
      {
        reqHead: {
          common: {
            requestId: 1,
            command: 100
          },
          scene: {
            requestType: 2,
            businessType: 1,
            sceneType: 2,
            group: {
              groupUin: e
            }
          },
          client: {
            agentType: 2
          }
        },
        upload: {
          uploadInfo: [
            {
              fileInfo: {
                fileSize: +n.size,
                fileHash: n.md5,
                fileSha1: n.sha1,
                fileName: n.name,
                type: {
                  type: 1,
                  picFormat: n.picType,
                  // TODO: extend NapCat imgType /cc @MliKiowa
                  videoFormat: 0,
                  voiceFormat: 0
                },
                width: n.width,
                height: n.height,
                time: 0,
                original: 1
              },
              subFileType: 0
            }
          ],
          tryFastUploadCompleted: !0,
          srvSendMsg: !1,
          clientRandomId: bs.randomBytes(8).readBigUInt64BE() & BigInt("0x7FFFFFFFFFFFFFFF"),
          compatQMsgSceneType: 2,
          extBizInfo: {
            pic: {
              bizType: n.picSubType,
              bytesPbReserveTroop: {
                subType: n.picSubType
              },
              textSummary: n.summary
            },
            video: {
              bytesPbReserve: Buffer.alloc(0)
            },
            ptt: {
              bytesPbReserve: Buffer.alloc(0),
              bytesReserve: Buffer.alloc(0),
              bytesGeneralFlags: Buffer.alloc(0)
            }
          },
          clientSeq: 0,
          noNeedCompatMsg: !1
        }
      }
    );
    return $e.build(4548, 100, r, !0, !1);
  }
  parse(e) {
    const n = $e.parse(e).body;
    return new fe(Di).decode(n);
  }
}
const oC = new Zq();
class eH extends mt {
  build(e, n) {
    const r = new fe(nq).encode({
      groupUin: e,
      chatType: n
    });
    return $e.build(37533, 0, r);
  }
  parse(e) {
    const n = $e.parse(e).body;
    return new fe(rq).decode(n);
  }
}
const sC = new eH();
class tH extends mt {
  build(e, n, r, i, o) {
    const s = new fe(sq).encode({
      groupUin: e,
      voiceId: n,
      text: r,
      chatType: o,
      session: {
        sessionId: i
      }
    });
    return $e.build(37531, 0, s);
  }
  parse(e) {
    const n = $e.parse(e).body;
    return new fe(cq).decode(n);
  }
}
const aC = new tH();
class nH extends mt {
  build(e) {
    const n = new fe(CQ).encode({
      appId: e.sdkId,
      body: {
        extInfo: {
          field2: Buffer.alloc(0)
        },
        appid: e.appId,
        title: e.title,
        desc: e.desc,
        time: BigInt(Date.now()),
        scene: e.scene,
        templateType: e.templateType,
        businessType: e.businessType,
        picUrl: e.picUrl,
        vidUrl: "",
        jumpUrl: e.jumpUrl,
        iconUrl: e.iconUrl,
        verType: e.verType,
        shareType: e.shareType,
        versionId: e.versionId,
        withShareTicket: e.withShareTicket,
        webURL: e.webUrl ?? "",
        appidRich: Buffer.alloc(0),
        template: {
          templateId: "",
          templateData: ""
        },
        field20: ""
      }
    });
    return {
      cmd: "LightAppSvc.mini_app_share.AdaptShareInfo",
      data: fa(n)
    };
  }
  parse(e) {
    return new fe(PQ).decode(e);
  }
}
const cC = new nH();
class rH extends mt {
  build(e, n) {
    const r = new fe(_q).encode(
      {
        body: {
          uin: String(e),
          groupUin: String(n),
          version: "9.0.90"
        }
      }
    );
    return $e.build(3767, 1, r, !1, !1);
  }
  parse(e) {
    return $e.parse(e);
  }
}
const iH = new rH();
class oH extends mt {
  build(e) {
    const n = new fe(Aq).encode({
      uin: e,
      key: [{ key: 27372 }]
    });
    return $e.build(4065, 2, n);
  }
  parse(e) {
    const n = $e.parse(e).body;
    return new fe(kq).decode(n);
  }
}
const uC = new oH();
let sH = class extends mt {
  build(e, n, r) {
    const i = {
      uin: r,
      ext: 0,
      ...e ? { groupUin: n } : { friendUin: n }
    }, o = new fe(Eq).encode(i);
    return $e.build(3795, 1, o);
  }
  parse(e) {
    return $e.parse(e);
  }
};
const aH = new sH();
let cH = class extends mt {
  build(e, n, r) {
    const i = new fe(YG).encode({
      groupUin: +e,
      body: {
        targetUid: n,
        specialTitle: r,
        expiredTime: -1,
        uinName: r
      }
    });
    return $e.build(2300, 2, i, !1, !1);
  }
  parse(e) {
    return $e.parse(e);
  }
};
const uH = new cH();
class lH extends mt {
  build(e) {
    const n = new fe(Nq).encode(
      {
        version: 1,
        client: 0,
        entrance: 1,
        ocrReqBody: {
          imageUrl: e,
          originMd5: "",
          afterCompressMd5: "",
          afterCompressFileSize: "",
          afterCompressWeight: "",
          afterCompressHeight: "",
          isCut: !1
        }
      }
    );
    return $e.build(3767, 1, n, !1, !1);
  }
  parse(e) {
    const n = $e.parse(e);
    return new fe(Dq).decode(n.body);
  }
}
const lC = new lH();
let pH = class extends mt {
  build(e, n, r, i) {
    const o = new fe($g).encode({
      move: {
        groupUin: e,
        appId: 5,
        busId: 102,
        fileId: n,
        parentDirectory: r,
        targetDirectory: i
      }
    });
    return $e.build(1750, 5, o, !0, !1);
  }
  parse(e) {
    const n = $e.parse(e).body, r = new fe(Gg).decode(n);
    if (r.move.retCode !== 0)
      throw new Error(`sendGroupFileMoveReq error: ${r.move.clientWording} (code=${r.move.retCode})`);
    return r;
  }
};
const pC = new pH();
let dH = class extends mt {
  build(e, n, r, i) {
    const o = new fe($g).encode({
      rename: {
        groupUin: e,
        busId: 102,
        fileId: n,
        parentFolder: r,
        newFileName: i
      }
    });
    return $e.build(1750, 4, o, !0, !1);
  }
  parse(e) {
    const n = $e.parse(e).body, r = new fe(Gg).decode(n);
    if (r.rename.retCode !== 0)
      throw new Error(`sendGroupFileRenameReq error: ${r.rename.clientWording} (code=${r.rename.retCode})`);
    return r;
  }
};
const dC = new dH();
let fH = class extends mt {
  build(e, n) {
    const r = new fe(vE).encode({
      groupUin: e,
      msgSeq: BigInt(n)
    });
    return $e.build(3984, 2, r);
  }
  parse(e) {
    return $e.parse(e);
  }
};
const hH = new fH();
let mH = class extends mt {
  build(e, n) {
    const r = new fe(vE).encode({
      groupUin: e,
      msgSeq: BigInt(n)
    });
    return $e.build(3984, 3, r);
  }
  parse(e) {
    return $e.parse(e);
  }
};
const gH = new mH();
let yH = class extends mt {
  build(e, n) {
    const r = new fe(vE).encode({
      groupUin: e,
      msgSeq: BigInt(n)
    });
    return $e.build(3984, 1, r);
  }
  parse(e) {
    return $e.parse(e);
  }
};
const vH = new yH();
class bH extends mt {
  build(e, n) {
    const r = new fe($g).encode({
      download: {
        groupUin: e,
        appId: 7,
        busId: 102,
        fileId: n
      }
    });
    return $e.build(1750, 2, r, !0, !1);
  }
  parse(e) {
    const n = $e.parse(e).body, r = new fe(Gg).decode(n);
    if (r.download.retCode !== 0)
      throw new Error(`sendGroupFileDownloadReq error: ${r.download.clientWording} (code=${r.download.retCode})`);
    return r;
  }
}
const fC = new bH();
class xH extends mt {
  build(e, n) {
    const r = new fe(Pi).encode({
      reqHead: {
        common: {
          requestId: 4,
          command: 200
        },
        scene: {
          requestType: 1,
          businessType: 3,
          sceneType: 2,
          group: {
            groupUin: e
          }
        },
        client: {
          agentType: 2
        }
      },
      download: {
        node: n,
        download: {
          video: {
            busiType: 0,
            sceneType: 0
          }
        }
      }
    });
    return $e.build(4718, 200, r, !0, !1);
  }
  parse(e) {
    const n = $e.parse(e).body;
    return new fe(Di).decode(n);
  }
}
const wH = new xH();
class SH extends mt {
  build(e, n, r, i) {
    const o = new fe(yq).encode({
      subCommand: 800,
      field2: 0,
      body: {
        senderUid: r,
        receiverUid: i,
        fileUuid: e,
        fileHash: n
      },
      field101: 3,
      field102: 1,
      field200: 1
    });
    return $e.build(3639, 800, o, !1, !1);
  }
  // TODO:check
  parse(e) {
    const n = $e.parse(e).body;
    return new fe(W6).decode(n);
  }
}
const hC = new SH();
class _H extends mt {
  build(e, n, r) {
    const i = new fe(uq).encode({
      subCommand: 1200,
      field2: 1,
      body: {
        receiverUid: e,
        fileUuid: n,
        type: 2,
        fileHash: r,
        t2: 0
      },
      field101: 3,
      field102: 103,
      field200: 1,
      field99999: Buffer.from([192, 133, 44, 1])
    });
    return $e.build(3639, 1200, i, !1, !1);
  }
  parse(e) {
    const n = $e.parse(e).body;
    return new fe(pq).decode(n);
  }
}
const mC = new _H();
class EH extends mt {
  build(e, n) {
    const r = new fe($g).encode({
      file: {
        groupUin: e,
        appId: 4,
        busId: 102,
        entrance: 6,
        targetDirectory: "/",
        // TODO:
        fileName: n.fileName,
        localDirectory: `/${n.fileName}`,
        fileSize: BigInt(n.fileSize),
        fileMd5: n.fileMd5,
        fileSha1: n.fileSha1,
        fileSha3: Buffer.alloc(0),
        field15: !0
      }
    });
    return $e.build(1750, 0, r, !0, !1);
  }
  parse(e) {
    const n = $e.parse(e).body;
    return new fe(Gg).decode(n);
  }
}
const gC = new EH();
class AH extends mt {
  build(e, n) {
    const r = new fe(Pi).encode({
      reqHead: {
        common: {
          requestId: 1,
          command: 100
        },
        scene: {
          requestType: 2,
          businessType: 3,
          sceneType: 2,
          group: {
            groupUin: e
          }
        },
        client: {
          agentType: 2
        }
      },
      upload: {
        uploadInfo: [
          {
            fileInfo: {
              fileSize: n.fileSize,
              fileHash: n.fileMd5,
              fileSha1: n.fileSha1,
              fileName: `${n.fileMd5}.amr`,
              type: {
                type: 3,
                picFormat: 0,
                videoFormat: 0,
                voiceFormat: 1
              },
              height: 0,
              width: 0,
              time: n.fileDuration,
              original: 0
            },
            subFileType: 0
          }
        ],
        tryFastUploadCompleted: !0,
        srvSendMsg: !1,
        clientRandomId: bs.randomBytes(8).readBigUInt64BE() & BigInt("0x7FFFFFFFFFFFFFFF"),
        compatQMsgSceneType: 2,
        extBizInfo: {
          pic: {
            textSummary: "Nya~"
          },
          video: {
            bytesPbReserve: Buffer.alloc(0)
          },
          ptt: {
            bytesPbReserve: Buffer.alloc(0),
            bytesReserve: Buffer.from([8, 0, 56, 0]),
            bytesGeneralFlags: Buffer.from([154, 1, 7, 170, 3, 4, 8, 8, 18, 0])
          }
        },
        clientSeq: 0,
        noNeedCompatMsg: !1
      }
    });
    return $e.build(4718, 100, r, !0, !1);
  }
  parse(e) {
    const n = $e.parse(e).body;
    return new fe(Di).decode(n);
  }
}
const yC = new AH();
class IH extends mt {
  build(e, n) {
    if (!n.fileSize || !n.thumbSize) throw new Error("video.fileSize or video.thumbSize is empty");
    const r = new fe(Pi).encode({
      reqHead: {
        common: {
          requestId: 3,
          command: 100
        },
        scene: {
          requestType: 2,
          businessType: 2,
          sceneType: 2,
          group: {
            groupUin: e
          }
        },
        client: {
          agentType: 2
        }
      },
      upload: {
        uploadInfo: [
          {
            fileInfo: {
              fileSize: +n.fileSize,
              fileHash: n.fileMd5,
              fileSha1: n.fileSha1,
              fileName: "nya.mp4",
              type: {
                type: 2,
                picFormat: 0,
                videoFormat: 0,
                voiceFormat: 0
              },
              height: 0,
              width: 0,
              time: 0,
              original: 0
            },
            subFileType: 0
          },
          {
            fileInfo: {
              fileSize: +n.thumbSize,
              fileHash: n.thumbMd5,
              fileSha1: n.thumbSha1,
              fileName: "nya.jpg",
              type: {
                type: 1,
                picFormat: 0,
                videoFormat: 0,
                voiceFormat: 0
              },
              height: n.thumbHeight,
              width: n.thumbWidth,
              time: 0,
              original: 0
            },
            subFileType: 100
          }
        ],
        tryFastUploadCompleted: !0,
        srvSendMsg: !1,
        clientRandomId: bs.randomBytes(8).readBigUInt64BE() & BigInt("0x7FFFFFFFFFFFFFFF"),
        compatQMsgSceneType: 2,
        extBizInfo: {
          pic: {
            bizType: 0,
            textSummary: "Nya~"
          },
          video: {
            bytesPbReserve: Buffer.from([128, 1, 0])
          },
          ptt: {
            bytesPbReserve: Buffer.alloc(0),
            bytesReserve: Buffer.alloc(0),
            bytesGeneralFlags: Buffer.alloc(0)
          }
        },
        clientSeq: 0,
        noNeedCompatMsg: !1
      }
    });
    return $e.build(4586, 100, r, !0, !1);
  }
  parse(e) {
    const n = $e.parse(e).body;
    return new fe(Di).decode(n);
  }
}
const vC = new IH();
class CH extends mt {
  async build(e, n, r) {
    const i = new fe(mq).encode({
      command: 1700,
      seq: 0,
      upload: {
        senderUid: e,
        receiverUid: n,
        fileSize: r.fileSize,
        fileName: r.fileName,
        md510MCheckSum: await Ww(r.filePath, 10485760),
        sha1CheckSum: r.fileSha1,
        localPath: "/",
        md5CheckSum: r.fileMd5,
        sha3CheckSum: Buffer.alloc(0)
      },
      businessId: 3,
      clientType: 1,
      flagSupportMediaPlatform: 1
    });
    return $e.build(3639, 1700, i, !1, !1);
  }
  parse(e) {
    const n = $e.parse(e).body;
    return new fe(W6).decode(n);
  }
}
const bC = new CH();
class TH extends mt {
  build(e, n) {
    const r = new fe(Pi).encode(
      {
        reqHead: {
          common: {
            requestId: 1,
            command: 100
          },
          scene: {
            requestType: 2,
            businessType: 1,
            sceneType: 1,
            c2C: {
              accountType: 2,
              targetUid: e
            }
          },
          client: {
            agentType: 2
          }
        },
        upload: {
          uploadInfo: [
            {
              fileInfo: {
                fileSize: +n.size,
                fileHash: n.md5,
                fileSha1: n.sha1,
                fileName: n.name,
                type: {
                  type: 1,
                  picFormat: n.picType,
                  // TODO: extend NapCat imgType /cc @MliKiowa
                  videoFormat: 0,
                  voiceFormat: 0
                },
                width: n.width,
                height: n.height,
                time: 0,
                original: 1
              },
              subFileType: 0
            }
          ],
          tryFastUploadCompleted: !0,
          srvSendMsg: !1,
          clientRandomId: bs.randomBytes(8).readBigUInt64BE() & BigInt("0x7FFFFFFFFFFFFFFF"),
          compatQMsgSceneType: 1,
          extBizInfo: {
            pic: {
              bizType: n.picSubType,
              bytesPbReserveC2C: {
                subType: n.picSubType
              },
              textSummary: n.summary
            },
            video: {
              bytesPbReserve: Buffer.alloc(0)
            },
            ptt: {
              bytesPbReserve: Buffer.alloc(0),
              bytesReserve: Buffer.alloc(0),
              bytesGeneralFlags: Buffer.alloc(0)
            }
          },
          clientSeq: 0,
          noNeedCompatMsg: !1
        }
      }
    );
    return $e.build(4549, 100, r, !0, !1);
  }
  parse(e) {
    const n = $e.parse(e).body;
    return new fe(Di).decode(n);
  }
}
const xC = new TH();
class kH extends mt {
  build(e, n) {
    const r = new fe(Pi).encode({
      reqHead: {
        common: {
          requestId: 4,
          command: 100
        },
        scene: {
          requestType: 2,
          businessType: 3,
          sceneType: 1,
          c2C: {
            accountType: 2,
            targetUid: e
          }
        },
        client: {
          agentType: 2
        }
      },
      upload: {
        uploadInfo: [
          {
            fileInfo: {
              fileSize: n.fileSize,
              fileHash: n.fileMd5,
              fileSha1: n.fileSha1,
              fileName: `${n.fileMd5}.amr`,
              type: {
                type: 3,
                picFormat: 0,
                videoFormat: 0,
                voiceFormat: 1
              },
              height: 0,
              width: 0,
              time: n.fileDuration,
              original: 0
            },
            subFileType: 0
          }
        ],
        tryFastUploadCompleted: !0,
        srvSendMsg: !1,
        clientRandomId: bs.randomBytes(8).readBigUInt64BE() & BigInt("0x7FFFFFFFFFFFFFFF"),
        compatQMsgSceneType: 1,
        extBizInfo: {
          pic: {
            textSummary: "Nya~"
          },
          ptt: {
            bytesReserve: Buffer.from([8, 0, 56, 0]),
            bytesGeneralFlags: Buffer.from([154, 1, 11, 170, 3, 8, 8, 4, 18, 4, 0, 0, 0, 0])
          }
        },
        clientSeq: 0,
        noNeedCompatMsg: !1
      }
    });
    return $e.build(4717, 100, r, !0, !1);
  }
  parse(e) {
    const n = $e.parse(e).body;
    return new fe(Di).decode(n);
  }
}
const wC = new kH();
class NH extends mt {
  build(e, n) {
    if (!n.fileSize || !n.thumbSize) throw new Error("video.fileSize or video.thumbSize is empty");
    const r = new fe(Pi).encode({
      reqHead: {
        common: {
          requestId: 3,
          command: 100
        },
        scene: {
          requestType: 2,
          businessType: 2,
          sceneType: 1,
          c2C: {
            accountType: 2,
            targetUid: e
          }
        },
        client: {
          agentType: 2
        }
      },
      upload: {
        uploadInfo: [
          {
            fileInfo: {
              fileSize: +n.fileSize,
              fileHash: n.fileMd5,
              fileSha1: n.fileSha1,
              fileName: "nya.mp4",
              type: {
                type: 2,
                picFormat: 0,
                videoFormat: 0,
                voiceFormat: 0
              },
              height: 0,
              width: 0,
              time: 0,
              original: 0
            },
            subFileType: 0
          },
          {
            fileInfo: {
              fileSize: +n.thumbSize,
              fileHash: n.thumbMd5,
              fileSha1: n.thumbSha1,
              fileName: "nya.jpg",
              type: {
                type: 1,
                picFormat: 0,
                videoFormat: 0,
                voiceFormat: 0
              },
              height: n.thumbHeight,
              width: n.thumbWidth,
              time: 0,
              original: 0
            },
            subFileType: 100
          }
        ],
        tryFastUploadCompleted: !0,
        srvSendMsg: !1,
        clientRandomId: bs.randomBytes(8).readBigUInt64BE() & BigInt("0x7FFFFFFFFFFFFFFF"),
        compatQMsgSceneType: 2,
        extBizInfo: {
          pic: {
            bizType: 0,
            textSummary: "Nya~"
          },
          video: {
            bytesPbReserve: Buffer.from([128, 1, 0])
          },
          ptt: {
            bytesPbReserve: Buffer.alloc(0),
            bytesReserve: Buffer.alloc(0),
            bytesGeneralFlags: Buffer.alloc(0)
          }
        },
        clientSeq: 0,
        noNeedCompatMsg: !1
      }
    });
    return $e.build(4585, 100, r, !0, !1);
  }
  parse(e) {
    const n = $e.parse(e).body;
    return new fe(Di).decode(n);
  }
}
const SC = new NH();
class PH extends mt {
  build(e, n) {
    const r = new fe(Pi).encode({
      reqHead: {
        common: {
          requestId: 1,
          command: 200
        },
        scene: {
          requestType: 2,
          businessType: 1,
          sceneType: 1,
          c2C: {
            accountType: 2,
            targetUid: e
          }
        },
        client: {
          agentType: 2
        }
      },
      download: {
        node: n,
        download: {
          video: {
            busiType: 0,
            sceneType: 0
          }
        }
      }
    });
    return $e.build(4549, 200, r, !0, !1);
  }
  parse(e) {
    const n = $e.parse(e).body;
    return new fe(Di).decode(n);
  }
}
const Dl = new PH();
class DH extends mt {
  build(e, n) {
    const r = new fe(Pi).encode({
      reqHead: {
        common: {
          requestId: 1,
          command: 200
        },
        scene: {
          requestType: 2,
          businessType: 1,
          sceneType: 2,
          group: {
            groupUin: e
          }
        },
        client: {
          agentType: 2
        }
      },
      download: {
        node: n,
        download: {
          video: {
            busiType: 0,
            sceneType: 0
          }
        }
      }
    });
    return $e.build(4548, 200, r, !0, !1);
  }
  parse(e) {
    const n = $e.parse(e).body;
    return new fe(Di).decode(n);
  }
}
const FH = new DH();
class OH extends mt {
  build(e, n) {
    const r = new fe(Pi).encode({
      reqHead: {
        common: {
          requestId: 1,
          command: 200
        },
        scene: {
          requestType: 2,
          businessType: 2,
          sceneType: 1,
          c2C: {
            accountType: 2,
            targetUid: e
          }
        },
        client: {
          agentType: 2
        }
      },
      download: {
        node: n,
        download: {
          video: {
            busiType: 0,
            sceneType: 0
          }
        }
      }
    });
    return $e.build(4585, 200, r, !0, !1);
  }
  parse(e) {
    const n = $e.parse(e).body;
    return new fe(Di).decode(n);
  }
}
const _C = new OH();
class MH extends mt {
  build(e, n) {
    const r = new fe(Pi).encode({
      reqHead: {
        common: {
          requestId: 1,
          command: 200
        },
        scene: {
          requestType: 2,
          businessType: 2,
          sceneType: 2,
          group: {
            groupUin: e
          }
        },
        client: {
          agentType: 2
        }
      },
      download: {
        node: n,
        download: {
          video: {
            busiType: 0,
            sceneType: 0
          }
        }
      }
    });
    return $e.build(4586, 200, r, !0, !1);
  }
  parse(e) {
    const n = $e.parse(e).body;
    return new fe(Di).decode(n);
  }
}
const RH = new MH();
class BH extends mt {
  build(e, n) {
    const r = new fe(Pi).encode({
      reqHead: {
        common: {
          requestId: 1,
          command: 200
        },
        scene: {
          requestType: 1,
          businessType: 3,
          sceneType: 1,
          c2C: {
            accountType: 2,
            targetUid: e
          }
        },
        client: {
          agentType: 2
        }
      },
      download: {
        node: n,
        download: {
          video: {
            busiType: 0,
            sceneType: 0
          }
        }
      }
    });
    return $e.build(4717, 200, r, !0, !1);
  }
  parse(e) {
    const n = $e.parse(e).body;
    return new fe(Di).decode(n);
  }
}
const EC = new BH();
class UH extends mt {
  build(e, n, r = 0) {
    const i = this.msgBuilder.buildFakeMsg(e, n), o = new fe(Cm).encode(
      {
        action: [{
          actionCommand: "MultiMsg",
          actionData: {
            msgBody: i
          }
        }]
      }
    ), s = bO.gzipSync(Buffer.from(o)), a = new fe(O6).encode(
      {
        info: {
          type: r === 0 ? 1 : 3,
          uid: {
            uid: r === 0 ? e : r.toString()
          },
          groupUin: r,
          payload: s
        },
        settings: {
          field1: 4,
          field2: 1,
          field3: 7,
          field4: 0
        }
      }
    );
    return {
      cmd: "trpc.group.long_msg_interface.MsgService.SsoSendLongMsg",
      data: fa(a)
    };
  }
  parse(e) {
    return new fe(M6).decode(e);
  }
}
const Gy = new UH();
class LH extends mt {
  build(e, n, r) {
    const i = new fe(t$).encode({
      info: {
        groupUin: e,
        startSequence: n,
        endSequence: r
      },
      direction: !0
    });
    return {
      cmd: "trpc.msg.register_proxy.RegisterProxy.SsoGetGroupMsg",
      data: fa(i)
    };
  }
  parse(e) {
    return new fe(r$).decode(e);
  }
}
const AC = new LH();
class jH extends mt {
  build(e, n, r) {
    const i = new fe(o$).encode({
      friendUid: e,
      startSequence: n,
      endSequence: r
    });
    return {
      cmd: "trpc.msg.register_proxy.RegisterProxy.SsoGetC2cMsg",
      data: fa(i)
    };
  }
  parse(e) {
    return new fe(s$).decode(e);
  }
}
const IC = new jH();
class QH extends mt {
  build(e, n) {
    const r = new fe(VQ).encode({
      info: {
        uid: {
          uid: e
        },
        resId: n,
        acquire: !0
      },
      settings: {
        field1: 2,
        field2: 0,
        field3: 0,
        field4: 0
      }
    });
    return {
      cmd: "trpc.group.long_msg_interface.MsgService.SsoRecvLongMsg",
      data: fa(r)
    };
  }
  parse(e) {
    return new fe(JQ).decode(e);
  }
}
const Rf = new QH();
class $H extends mt {
  build(e, n, r = 0) {
    const i = n.map((c) => ({
      actionCommand: c.actionCommand,
      actionData: {
        msgBody: c.actionMsgBody ?? this.msgBuilder.buildFakeMsg(e, c.actionMsg ?? [])
      }
    })), o = new fe(Cm).encode(
      {
        action: i
      }
    ), s = bO.gzipSync(Buffer.from(o)), a = new fe(O6).encode(
      {
        info: {
          type: r === 0 ? 1 : 3,
          uid: {
            uid: r === 0 ? e : r.toString()
          },
          groupUin: r,
          payload: s
        },
        settings: {
          field1: 4,
          field2: 1,
          field3: 7,
          field4: 0
        }
      }
    );
    return {
      cmd: "trpc.group.long_msg_interface.MsgService.SsoSendLongMsg",
      data: fa(a)
    };
  }
  parse(e) {
    return new fe(M6).decode(e);
  }
}
const GH = new $H();
class qH extends mt {
  build() {
    const e = new fe(JG).encode({
      reqHead: {
        common: {
          requestId: 1,
          command: 202
        },
        scene: {
          requestType: 2,
          businessType: 1,
          sceneType: 0
        },
        client: {
          agentType: 2
        }
      },
      downloadRKeyReq: {
        key: [10, 20, 2]
      }
    });
    return $e.build(36967, 202, e);
  }
  parse(e) {
    const n = $e.parse(e).body;
    return new fe(tq).decode(n);
  }
}
const CC = new qH();
function HH(t) {
  const e = pO(), n = gL(), r = process.platform + "." + process.arch, i = xe.join(t, "./native/ffmpeg/", `ffmpegAddon.${r}.node`);
  if (!sr(i))
    throw new Error(`Unsupported platform: ${e} ${n} - Addon not found at ${i}`);
  return i;
}
class WH {
  name = "FFmpegAddon";
  addon = null;
  binaryPath;
  constructor(e) {
    this.binaryPath = e;
  }
  /**
     * 检查 Addon 是否可用
     */
  async isAvailable() {
    try {
      const e = { exports: {} };
      return NL(e, HH(this.binaryPath)), this.addon = e.exports, this.addon !== null;
    } catch (e) {
      return console.log("[FFmpegAddonAdapter] Failed to load addon:", e), !1;
    }
  }
  ensureAddon() {
    if (!this.addon)
      throw new Error("FFmpeg Addon is not available");
    return this.addon;
  }
  /**
     * 获取视频信息
     */
  async getVideoInfo(e) {
    const r = await this.ensureAddon().getVideoInfo(e), i = r.format.includes(",") ? r.format.split(",")[0] ?? r.format : r.format;
    return console.log("[FFmpegAddonAdapter] Detected format:", i), {
      width: r.width,
      height: r.height,
      duration: r.duration,
      format: i,
      thumbnail: r.image
    };
  }
  /**
     * 获取时长
     */
  async getDuration(e) {
    return this.ensureAddon().getDuration(e);
  }
  /**
   * 判断是否为 Silk 格式
   */
  async isSilk(e) {
    try {
      const n = wL(e, "r"), r = Buffer.alloc(10);
      SL(n, r, 0, 10, 0), _L(n);
      const i = r.toString();
      return i.includes("#!SILK") || i.includes("#!SILK");
    } catch {
      return !1;
    }
  }
  /**
     * 转换为 PCM
     */
  async convertToPCM(e, n) {
    return await this.ensureAddon().decodeAudioToPCM(e, n, 24e3);
  }
  /**
     * 转换文件
     */
  async convertFile(e, n, r) {
    const i = this.ensureAddon();
    console.log("[FFmpegAddonAdapter] Converting file:", e, "to", n, "as", r), await i.decodeAudioToFmt(e, n, r);
  }
  async convertToNTSilkTct(e, n) {
    await this.ensureAddon().convertToNTSilkTct(e, n);
  }
  /**
     * 提取缩略图
     */
  async extractThumbnail(e, n) {
    const i = await this.ensureAddon().getVideoInfo(e);
    await lL(n, i.image);
  }
}
class zH {
  type = mc.BMP;
  // BMP 魔术头：42 4D (BM)
  BMP_SIGNATURE = [66, 77];
  canParse(e) {
    return ko(e, this.BMP_SIGNATURE);
  }
  async parseSize(e) {
    return new Promise((n, r) => {
      e.once("error", r), e.once("readable", () => {
        const i = e.read(26);
        if (!i || i.length < 26)
          return n(void 0);
        if (this.canParse(i)) {
          const o = i.readUInt32LE(18), s = i.readUInt32LE(22);
          n({ width: o, height: s });
        } else
          n(void 0);
      });
    });
  }
}
class KH {
  type = mc.GIF;
  // GIF87a 魔术头：47 49 46 38 37 61
  GIF87A_SIGNATURE = [71, 73, 70, 56, 55, 97];
  // GIF89a 魔术头：47 49 46 38 39 61
  GIF89A_SIGNATURE = [71, 73, 70, 56, 57, 97];
  canParse(e) {
    return ko(e, this.GIF87A_SIGNATURE) || ko(e, this.GIF89A_SIGNATURE);
  }
  async parseSize(e) {
    return new Promise((n, r) => {
      e.once("error", r), e.once("readable", () => {
        const i = e.read(10);
        if (!i || i.length < 10)
          return n(void 0);
        if (this.canParse(i)) {
          const o = i.readUInt16LE(6), s = i.readUInt16LE(8);
          n({ width: o, height: s });
        } else
          n(void 0);
      });
    });
  }
}
class VH {
  type = mc.JPEG;
  // JPEG 魔术头：FF D8
  JPEG_SIGNATURE = [255, 216];
  // JPEG标记常量
  SOF_MARKERS = {
    SOF0: 192,
    // 基线DCT
    SOF1: 193,
    // 扩展顺序DCT
    SOF2: 194,
    // 渐进式DCT
    SOF3: 195
    // 无损
  };
  // 非SOF标记
  NON_SOF_MARKERS = [
    196,
    // DHT
    200,
    // JPEG扩展
    204
    // DAC
  ];
  canParse(e) {
    return ko(e, this.JPEG_SIGNATURE);
  }
  isSOFMarker(e) {
    return e === this.SOF_MARKERS.SOF0 || e === this.SOF_MARKERS.SOF1 || e === this.SOF_MARKERS.SOF2 || e === this.SOF_MARKERS.SOF3;
  }
  isNonSOFMarker(e) {
    return this.NON_SOF_MARKERS.includes(e);
  }
  async parseSize(e) {
    return new Promise((n, r) => {
      let o = Buffer.alloc(0), s = 0, a = !1;
      e.on("error", (c) => {
        e.destroy(), r(c);
      }), e.on("data", (c) => {
        const u = Buffer.isBuffer(c) ? c : Buffer.from(c);
        o = Buffer.concat([o.subarray(s), u]), s = 0;
        const l = o.length, d = 10;
        for (; s < l - d; ) {
          if (o[s] === 255 && o[s + 1] >= 192 && o[s + 1] <= 207) {
            const f = o[s + 1];
            if (!f)
              break;
            if (this.isNonSOFMarker(f)) {
              s += 2;
              continue;
            }
            if (this.isSOFMarker(f))
              if (s + 9 < l) {
                const m = o.readUInt16BE(s + 5), h = o.readUInt16BE(s + 7);
                a = !0, e.destroy(), n({ width: h, height: m });
                return;
              } else
                break;
          }
          s++;
        }
        s > 1024 && s > 20 && (o = o.subarray(s - 20), s = 20);
      }), e.on("end", () => {
        a || n(void 0);
      });
    });
  }
}
class YH {
  type = mc.PNG;
  // PNG 魔术头：89 50 4E 47 0D 0A 1A 0A
  PNG_SIGNATURE = [137, 80, 78, 71, 13, 10, 26, 10];
  canParse(e) {
    return ko(e, this.PNG_SIGNATURE);
  }
  async parseSize(e) {
    return new Promise((n, r) => {
      e.once("error", r), e.once("readable", () => {
        const i = e.read(24);
        if (!i || i.length < 24)
          return n(void 0);
        if (this.canParse(i)) {
          const o = i.readUInt32BE(16), s = i.readUInt32BE(20);
          n({ width: o, height: s });
        } else
          n(void 0);
      });
    });
  }
}
class JH {
  type = mc.TIFF;
  // TIFF Little Endian 魔术头：49 49 2A 00 (II)
  TIFF_LE_SIGNATURE = [73, 73, 42, 0];
  // TIFF Big Endian 魔术头：4D 4D 00 2A (MM)
  TIFF_BE_SIGNATURE = [77, 77, 0, 42];
  canParse(e) {
    return ko(e, this.TIFF_LE_SIGNATURE) || ko(e, this.TIFF_BE_SIGNATURE);
  }
  async parseSize(e) {
    return new Promise((n, r) => {
      const i = [];
      let o = 0;
      const s = 64 * 1024;
      e.on("error", r), e.on("data", (a) => {
        const c = Buffer.isBuffer(a) ? a : Buffer.from(a);
        i.push(c), o += c.length, o >= s && e.destroy();
      }), e.on("end", () => {
        const a = Buffer.concat(i), c = this.parseTiffSize(a);
        n(c);
      }), e.on("close", () => {
        if (i.length > 0) {
          const a = Buffer.concat(i), c = this.parseTiffSize(a);
          n(c);
        }
      });
    });
  }
  parseTiffSize(e) {
    if (e.length < 8)
      return;
    const n = e[0] === 73, r = n ? (d) => e.readUInt16LE(d) : (d) => e.readUInt16BE(d), i = n ? (d) => e.readUInt32LE(d) : (d) => e.readUInt32BE(d), o = i(4);
    if (o + 2 > e.length)
      return;
    const s = r(o);
    let a, c;
    const u = 256, l = 257;
    for (let d = 0; d < s; d++) {
      const f = o + 2 + d * 12;
      if (f + 12 > e.length)
        break;
      const m = r(f), h = r(f + 2);
      let y;
      if (h === 3)
        y = r(f + 8);
      else if (h === 4)
        y = i(f + 8);
      else
        continue;
      if (m === u ? a = y : m === l && (c = y), a !== void 0 && c !== void 0)
        return { width: a, height: c };
    }
    if (a !== void 0 && c !== void 0)
      return { width: a, height: c };
  }
}
class XH {
  type = mc.WEBP;
  // WEBP RIFF 头：52 49 46 46 (RIFF)
  RIFF_SIGNATURE = [82, 73, 70, 70];
  // WEBP 魔术头：57 45 42 50 (WEBP)
  WEBP_SIGNATURE = [87, 69, 66, 80];
  // WEBP 块头
  CHUNK_VP8 = [86, 80, 56, 32];
  // "VP8 "
  CHUNK_VP8L = [86, 80, 56, 76];
  // "VP8L"
  CHUNK_VP8X = [86, 80, 56, 88];
  // "VP8X"
  canParse(e) {
    return e.length >= 12 && ko(e, this.RIFF_SIGNATURE, 0) && ko(e, this.WEBP_SIGNATURE, 8);
  }
  isChunkType(e, n, r) {
    return e.length >= n + 4 && ko(e, r, n);
  }
  async parseSize(e) {
    return new Promise((n, r) => {
      let o = 0, s = Buffer.alloc(0);
      e.on("error", r), e.on("data", (a) => {
        const c = Buffer.isBuffer(a) ? a : Buffer.from(a);
        if (s = Buffer.concat([s, c]), o += a.length, o >= 32) {
          if (e.destroy(), !this.canParse(s))
            return n(void 0);
          if (this.isChunkType(s, 12, this.CHUNK_VP8)) {
            const u = s.readUInt16LE(26) & 16383, l = s.readUInt16LE(28) & 16383;
            return n({ width: u, height: l });
          } else if (this.isChunkType(s, 12, this.CHUNK_VP8L)) {
            const u = s.readUInt32LE(21), l = 1 + (u & 16383), d = 1 + (u >> 14 & 16383);
            return n({ width: l, height: d });
          } else if (this.isChunkType(s, 12, this.CHUNK_VP8X)) {
            if (s.length < 30)
              return n(void 0);
            const u = 1 + ((s[24] | s[25] << 8 | s[26] << 16) & 16777215), l = 1 + ((s[27] | s[28] << 8 | s[29] << 16) & 16777215);
            return n({ width: u, height: l });
          } else
            return n(void 0);
        }
      }), e.on("end", () => {
        o < 32 && n(void 0);
      });
    });
  }
}
var mc = /* @__PURE__ */ ((t) => (t.JPEG = "jpeg", t.PNG = "png", t.BMP = "bmp", t.GIF = "gif", t.WEBP = "webp", t.TIFF = "tiff", t.UNKNOWN = "unknown", t))(mc || {});
function ko(t, e, n = 0) {
  if (t.length < n + e.length)
    return !1;
  for (let r = 0; r < e.length; r++)
    if (t[n + r] !== e[r])
      return !1;
  return !0;
}
const Oa = {
  png: new YH(),
  jpeg: new VH(),
  bmp: new zH(),
  gif: new KH(),
  webp: new XH(),
  tiff: new JH()
}, ZH = /* @__PURE__ */ new Map([
  ["png", Oa.png],
  ["jpeg", Oa.jpeg],
  ["bmp", Oa.bmp],
  ["gif", Oa.gif],
  ["webp", Oa.webp],
  ["tiff", Oa.tiff]
]), eW = Object.values(Oa);
async function tW(t) {
  return new Promise((e, n) => {
    const r = Ae.createReadStream(t, {
      highWaterMark: 64,
      // 优化读取buffer大小
      start: 0,
      end: 63
    }), i = [];
    r.on("error", (o) => {
      r.destroy(), n(o);
    }), r.on("data", (o) => {
      const s = Buffer.isBuffer(o) ? o : Buffer.from(o);
      i.push(s);
    }), r.on("end", () => {
      const o = Buffer.concat(i);
      if (o.length === 0)
        return e(
          "unknown"
          /* UNKNOWN */
        );
      for (const s of eW)
        if (s.canParse(o))
          return e(s.type);
      e(
        "unknown"
        /* UNKNOWN */
      );
    });
  });
}
async function nW(t) {
  try {
    const e = await tW(t), n = ZH.get(e);
    if (!n)
      return;
    const r = Ae.createReadStream(t);
    try {
      return await n.parseSize(r);
    } catch (i) {
      console.error(`解析图片尺寸出错: ${i}`);
      return;
    } finally {
      r.destroyed || r.destroy();
    }
  } catch (e) {
    console.error(`检测图片类型出错: ${e}`);
    return;
  }
}
async function wE(t, e = {
  width: 1024,
  height: 1024
}) {
  return await nW(t) ?? e;
}
var Fc = {}, Go = {}, yi = {}, qy, TC;
function J6() {
  if (TC) return qy;
  TC = 1;
  var t = be, e = de, n = parseInt("0777", 8);
  qy = r.mkdirp = r.mkdirP = r;
  function r(i, o, s, a) {
    typeof o == "function" ? (s = o, o = {}) : (!o || typeof o != "object") && (o = { mode: o });
    var c = o.mode, u = o.fs || e;
    c === void 0 && (c = n), a || (a = null);
    var l = s || /* istanbul ignore next */
    function() {
    };
    i = t.resolve(i), u.mkdir(i, c, function(d) {
      if (!d)
        return a = a || i, l(null, a);
      switch (d.code) {
        case "ENOENT":
          if (t.dirname(i) === i) return l(d);
          r(t.dirname(i), o, function(f, m) {
            f ? l(f, m) : r(i, o, l, m);
          });
          break;
        // In the case of any other error, just see if there's a dir
        // there already.  If so, then hooray!  If not, then something
        // is borked.
        default:
          u.stat(i, function(f, m) {
            f || !m.isDirectory() ? l(d, a) : l(null, a);
          });
          break;
      }
    });
  }
  return r.sync = function i(o, s, a) {
    (!s || typeof s != "object") && (s = { mode: s });
    var c = s.mode, u = s.fs || e;
    c === void 0 && (c = n), a || (a = null), o = t.resolve(o);
    try {
      u.mkdirSync(o, c), a = a || o;
    } catch (d) {
      switch (d.code) {
        case "ENOENT":
          a = i(t.dirname(o), s, a), i(o, s, a);
          break;
        // In the case of any other error, just see if there's a dir
        // there already.  If so, then hooray!  If not, then something
        // is borked.
        default:
          var l;
          try {
            l = u.statSync(o);
          } catch {
            throw d;
          }
          if (!l.isDirectory()) throw d;
          break;
      }
    }
    return a;
  }, qy;
}
var Bf = { exports: {} }, Hy, kC;
function rW() {
  if (kC) return Hy;
  kC = 1, Hy = t;
  function t(e, n) {
    if (e && n) return t(e)(n);
    if (typeof e != "function")
      throw new TypeError("need wrapper function");
    return Object.keys(e).forEach(function(i) {
      r[i] = e[i];
    }), r;
    function r() {
      for (var i = new Array(arguments.length), o = 0; o < i.length; o++)
        i[o] = arguments[o];
      var s = e.apply(this, i), a = i[i.length - 1];
      return typeof s == "function" && s !== a && Object.keys(a).forEach(function(c) {
        s[c] = a[c];
      }), s;
    }
  }
  return Hy;
}
var NC;
function X6() {
  if (NC) return Bf.exports;
  NC = 1;
  var t = rW();
  Bf.exports = t(e), Bf.exports.strict = t(n), e.proto = e(function() {
    Object.defineProperty(Function.prototype, "once", {
      value: function() {
        return e(this);
      },
      configurable: !0
    }), Object.defineProperty(Function.prototype, "onceStrict", {
      value: function() {
        return n(this);
      },
      configurable: !0
    });
  });
  function e(r) {
    var i = function() {
      return i.called ? i.value : (i.called = !0, i.value = r.apply(this, arguments));
    };
    return i.called = !1, i;
  }
  function n(r) {
    var i = function() {
      if (i.called)
        throw new Error(i.onceError);
      return i.called = !0, i.value = r.apply(this, arguments);
    }, o = r.name || "Function wrapped with `once`";
    return i.onceError = o + " shouldn't be called more than once", i.called = !1, i;
  }
  return Bf.exports;
}
var Wy, PC;
function Z6() {
  if (PC) return Wy;
  PC = 1;
  var t = X6(), e = function() {
  }, n = On.Bare ? queueMicrotask : process.nextTick.bind(process), r = function(s) {
    return s.setHeader && typeof s.abort == "function";
  }, i = function(s) {
    return s.stdio && Array.isArray(s.stdio) && s.stdio.length === 3;
  }, o = function(s, a, c) {
    if (typeof a == "function") return o(s, null, a);
    a || (a = {}), c = t(c || e);
    var u = s._writableState, l = s._readableState, d = a.readable || a.readable !== !1 && s.readable, f = a.writable || a.writable !== !1 && s.writable, m = !1, h = function() {
      s.writable || y();
    }, y = function() {
      f = !1, d || c.call(s);
    }, x = function() {
      d = !1, f || c.call(s);
    }, g = function(j) {
      c.call(s, j ? new Error("exited with error code: " + j) : null);
    }, v = function(j) {
      c.call(s, j);
    }, S = function() {
      n(E);
    }, E = function() {
      if (!m) {
        if (d && !(l && l.ended && !l.destroyed)) return c.call(s, new Error("premature close"));
        if (f && !(u && u.ended && !u.destroyed)) return c.call(s, new Error("premature close"));
      }
    }, T = function() {
      s.req.on("finish", y);
    };
    return r(s) ? (s.on("complete", y), s.on("abort", S), s.req ? T() : s.on("request", T)) : f && !u && (s.on("end", h), s.on("close", h)), i(s) && s.on("exit", g), s.on("end", x), s.on("finish", y), a.error !== !1 && s.on("error", v), s.on("close", S), function() {
      m = !0, s.removeListener("complete", y), s.removeListener("abort", S), s.removeListener("request", T), s.req && s.req.removeListener("finish", y), s.removeListener("end", h), s.removeListener("close", h), s.removeListener("finish", y), s.removeListener("exit", g), s.removeListener("end", x), s.removeListener("error", v), s.removeListener("close", S);
    };
  };
  return Wy = o, Wy;
}
var zy, DC;
function e8() {
  if (DC) return zy;
  DC = 1;
  var t = X6(), e = Z6(), n;
  try {
    n = require("fs");
  } catch {
  }
  var r = function() {
  }, i = typeof process > "u" ? !1 : /^v?\.0/.test(process.version), o = function(f) {
    return typeof f == "function";
  }, s = function(f) {
    return !i || !n ? !1 : (f instanceof (n.ReadStream || r) || f instanceof (n.WriteStream || r)) && o(f.close);
  }, a = function(f) {
    return f.setHeader && o(f.abort);
  }, c = function(f, m, h, y) {
    y = t(y);
    var x = !1;
    f.on("close", function() {
      x = !0;
    }), e(f, { readable: m, writable: h }, function(v) {
      if (v) return y(v);
      x = !0, y();
    });
    var g = !1;
    return function(v) {
      if (!x && !g) {
        if (g = !0, s(f)) return f.close(r);
        if (a(f)) return f.abort();
        if (o(f.destroy)) return f.destroy();
        y(v || new Error("stream was destroyed"));
      }
    };
  }, u = function(f) {
    f();
  }, l = function(f, m) {
    return f.pipe(m);
  }, d = function() {
    var f = Array.prototype.slice.call(arguments), m = o(f[f.length - 1] || r) && f.pop() || r;
    if (Array.isArray(f[0]) && (f = f[0]), f.length < 2) throw new Error("pump requires two streams per minimum");
    var h, y = f.map(function(x, g) {
      var v = g < f.length - 1, S = g > 0;
      return c(x, v, S, function(E) {
        h || (h = E), E && y.forEach(u), !v && (y.forEach(u), m(h));
      });
    });
    return f.reduce(l);
  };
  return zy = d, zy;
}
var FC;
function pi() {
  if (FC) return yi;
  FC = 1;
  const t = de, e = be, n = J6(), r = e8();
  yi.sourceType = (u) => {
    if (u) {
      if (u instanceof Buffer) return "buffer";
      if (typeof u._read == "function" || typeof u._transform == "function") return "stream";
      if (typeof u != "string") {
        const l = new Error("Type is not supported, must be a file path, file buffer, or a readable stream");
        throw l.name = "IlligalSourceError", l;
      }
      return "file";
    }
  };
  function i(u) {
    if (typeof u._write == "function" || typeof u._transform == "function") return "stream";
    if (typeof u != "string") {
      const l = new Error("Type is not supported, must be a file path, or a writable stream");
      throw l.name = "IlligalDestinationError", l;
    }
    return "path";
  }
  yi.destType = i;
  const o = new Error("Type is not supported, must be a file path, directory path, file buffer, or a readable stream");
  o.name = "IlligalEntryError", yi.entryType = (u) => {
    if (u) {
      if (u instanceof Buffer) return "buffer";
      if (typeof u._read == "function" || typeof u._transform == "function") return "stream";
      if (typeof u != "string") throw o;
      return "fileOrDir";
    }
  }, yi.clone = (u) => {
    const l = {};
    for (const d in u)
      l[d] = u[d];
    return l;
  }, yi.makeFileProcessFn = (u) => (l, d, f) => {
    f = f || {}, f.source = l;
    const m = i(d) === "path" ? t.createWriteStream(d) : d, h = new u(f);
    return s([h, m]);
  }, yi.makeCompressDirFn = (u) => (l, d, f) => {
    const m = i(d) === "path" ? t.createWriteStream(d) : d, h = new u();
    return h.addEntry(l, f), s([h, m]);
  }, yi.makeUncompressFn = (u) => (l, d, f) => {
    if (f = f || {}, f.source = l, !l) {
      const m = new Error("Type is not supported, must be a file path, file buffer, or a readable stream");
      throw m.name = "IlligalSourceError", m;
    }
    if (i(d) !== "path") {
      const m = new Error("uncompress destination must be a directory");
      throw m.name = "IlligalDestError", m;
    }
    return new Promise((m, h) => {
      n(d, (y) => {
        if (y) return h(y);
        let x = 0, g = 0, v = !1;
        function S() {
          v && x === g && m();
        }
        new u(f).on("finish", () => {
          v = !0, S();
        }).on("error", h).on("entry", (E, T, j) => {
          T.on("end", j);
          const q = e.join(d, E.name);
          if (E.type === "file") {
            const Y = e.dirname(q);
            n(Y, (W) => {
              if (W) return h(W);
              x++, r(T, t.createWriteStream(q, { mode: f.mode || E.mode }), (G) => {
                if (G) return h(G);
                g++, S();
              });
            });
          } else if (E.type === "symlink") {
            const Y = e.dirname(q), W = e.resolve(Y, E.linkname);
            x++, n(Y, (G) => {
              if (G) return h(G);
              const J = e.relative(Y, W);
              t.symlink(J, q, (B) => {
                if (B) return h(B);
                g++, T.resume();
              });
            });
          } else
            n(q, (Y) => {
              if (Y) return h(Y);
              T.resume();
            });
        });
      });
    });
  }, yi.streamToBuffer = (u) => new Promise((l, d) => {
    const f = [];
    u.on("readable", () => {
      let m;
      for (; m = u.read(); ) f.push(m);
    }).on("end", () => l(Buffer.concat(f))).on("error", (m) => d(m));
  });
  function s(u) {
    return new Promise((l, d) => {
      r(u[0], u[1], (f) => {
        if (f) return d(f);
        l();
      });
    });
  }
  yi.safePipe = s;
  function a(u) {
    return u = e.normalize(u), process.platform === "win32" && (u = u.replace(/\\+/g, "/")), u;
  }
  function c(u, l, d) {
    Buffer.isBuffer(l) && (l = l.toString()), l.indexOf("\\") !== -1 && (l = l.replace(/\\+/g, "/")), l[0] === "/" && (l = l.replace(/^\/+/, "")), l && (l = a(l));
    let f = l.split("/");
    return f.indexOf("..") !== -1 && (l = l.replace(/(\.\.\/)+/, ""), d === "directory" && l && l[l.length - 1] !== "/" && (l += "/"), f = l.split("/")), u = Math.min(u, f.length - 1), f.slice(u).join("/") || "/";
  }
  return yi.stripFileName = c, yi;
}
var Uf = {}, Ky, OC;
function t8() {
  if (OC) return Ky;
  OC = 1;
  var t = pa.Buffer, e = [
    0,
    1996959894,
    3993919788,
    2567524794,
    124634137,
    1886057615,
    3915621685,
    2657392035,
    249268274,
    2044508324,
    3772115230,
    2547177864,
    162941995,
    2125561021,
    3887607047,
    2428444049,
    498536548,
    1789927666,
    4089016648,
    2227061214,
    450548861,
    1843258603,
    4107580753,
    2211677639,
    325883990,
    1684777152,
    4251122042,
    2321926636,
    335633487,
    1661365465,
    4195302755,
    2366115317,
    997073096,
    1281953886,
    3579855332,
    2724688242,
    1006888145,
    1258607687,
    3524101629,
    2768942443,
    901097722,
    1119000684,
    3686517206,
    2898065728,
    853044451,
    1172266101,
    3705015759,
    2882616665,
    651767980,
    1373503546,
    3369554304,
    3218104598,
    565507253,
    1454621731,
    3485111705,
    3099436303,
    671266974,
    1594198024,
    3322730930,
    2970347812,
    795835527,
    1483230225,
    3244367275,
    3060149565,
    1994146192,
    31158534,
    2563907772,
    4023717930,
    1907459465,
    112637215,
    2680153253,
    3904427059,
    2013776290,
    251722036,
    2517215374,
    3775830040,
    2137656763,
    141376813,
    2439277719,
    3865271297,
    1802195444,
    476864866,
    2238001368,
    4066508878,
    1812370925,
    453092731,
    2181625025,
    4111451223,
    1706088902,
    314042704,
    2344532202,
    4240017532,
    1658658271,
    366619977,
    2362670323,
    4224994405,
    1303535960,
    984961486,
    2747007092,
    3569037538,
    1256170817,
    1037604311,
    2765210733,
    3554079995,
    1131014506,
    879679996,
    2909243462,
    3663771856,
    1141124467,
    855842277,
    2852801631,
    3708648649,
    1342533948,
    654459306,
    3188396048,
    3373015174,
    1466479909,
    544179635,
    3110523913,
    3462522015,
    1591671054,
    702138776,
    2966460450,
    3352799412,
    1504918807,
    783551873,
    3082640443,
    3233442989,
    3988292384,
    2596254646,
    62317068,
    1957810842,
    3939845945,
    2647816111,
    81470997,
    1943803523,
    3814918930,
    2489596804,
    225274430,
    2053790376,
    3826175755,
    2466906013,
    167816743,
    2097651377,
    4027552580,
    2265490386,
    503444072,
    1762050814,
    4150417245,
    2154129355,
    426522225,
    1852507879,
    4275313526,
    2312317920,
    282753626,
    1742555852,
    4189708143,
    2394877945,
    397917763,
    1622183637,
    3604390888,
    2714866558,
    953729732,
    1340076626,
    3518719985,
    2797360999,
    1068828381,
    1219638859,
    3624741850,
    2936675148,
    906185462,
    1090812512,
    3747672003,
    2825379669,
    829329135,
    1181335161,
    3412177804,
    3160834842,
    628085408,
    1382605366,
    3423369109,
    3138078467,
    570562233,
    1426400815,
    3317316542,
    2998733608,
    733239954,
    1555261956,
    3268935591,
    3050360625,
    752459403,
    1541320221,
    2607071920,
    3965973030,
    1969922972,
    40735498,
    2617837225,
    3943577151,
    1913087877,
    83908371,
    2512341634,
    3803740692,
    2075208622,
    213261112,
    2463272603,
    3855990285,
    2094854071,
    198958881,
    2262029012,
    4057260610,
    1759359992,
    534414190,
    2176718541,
    4139329115,
    1873836001,
    414664567,
    2282248934,
    4279200368,
    1711684554,
    285281116,
    2405801727,
    4167216745,
    1634467795,
    376229701,
    2685067896,
    3608007406,
    1308918612,
    956543938,
    2808555105,
    3495958263,
    1231636301,
    1047427035,
    2932959818,
    3654703836,
    1088359270,
    936918e3,
    2847714899,
    3736837829,
    1202900863,
    817233897,
    3183342108,
    3401237130,
    1404277552,
    615818150,
    3134207493,
    3453421203,
    1423857449,
    601450431,
    3009837614,
    3294710456,
    1567103746,
    711928724,
    3020668471,
    3272380065,
    1510334235,
    755167117
  ];
  typeof Int32Array < "u" && (e = new Int32Array(e));
  function n(s) {
    if (t.isBuffer(s))
      return s;
    var a = typeof t.alloc == "function" && typeof t.from == "function";
    if (typeof s == "number")
      return a ? t.alloc(s) : new t(s);
    if (typeof s == "string")
      return a ? t.from(s) : new t(s);
    throw new Error("input must be buffer, number, or string, received " + typeof s);
  }
  function r(s) {
    var a = n(4);
    return a.writeInt32BE(s, 0), a;
  }
  function i(s, a) {
    s = n(s), t.isBuffer(a) && (a = a.readUInt32BE(0));
    for (var c = ~~a ^ -1, u = 0; u < s.length; u++)
      c = e[(c ^ s[u]) & 255] ^ c >>> 8;
    return c ^ -1;
  }
  function o() {
    return r(i.apply(null, arguments));
  }
  return o.signed = function() {
    return i.apply(null, arguments);
  }, o.unsigned = function() {
    return i.apply(null, arguments) >>> 0;
  }, Ky = o, Ky;
}
var MC;
function n8() {
  if (MC) return Uf;
  MC = 1;
  var t = de, e = ir.Transform, n = ir.PassThrough, r = qu, i = _n, o = xs.EventEmitter, s = t8();
  Uf.ZipFile = a, Uf.dateToDosDateTime = X, i.inherits(a, o);
  function a() {
    this.outputStream = new n(), this.entries = [], this.outputStreamCursor = 0, this.ended = !1, this.allDone = !1, this.forceZip64Eocd = !1;
  }
  a.prototype.addFile = function(k, M, F) {
    var A = this;
    M = g(M, !1), F == null && (F = {});
    var O = new S(M, !1, F);
    A.entries.push(O), t.stat(k, function(Z, ee) {
      if (Z) return A.emit("error", Z);
      if (!ee.isFile()) return A.emit("error", new Error("not a file: " + k));
      O.uncompressedSize = ee.size, F.mtime == null && O.setLastModDate(ee.mtime), F.mode == null && O.setFileAttributesMode(ee.mode), O.setFileDataPumpFunction(function() {
        var P = t.createReadStream(k);
        O.state = S.FILE_DATA_IN_PROGRESS, P.on("error", function(Q) {
          A.emit("error", Q);
        }), l(A, O, P);
      }), d(A);
    });
  }, a.prototype.addReadStream = function(k, M, F) {
    var A = this;
    M = g(M, !1), F == null && (F = {});
    var O = new S(M, !1, F);
    A.entries.push(O), O.setFileDataPumpFunction(function() {
      O.state = S.FILE_DATA_IN_PROGRESS, l(A, O, k);
    }), d(A);
  }, a.prototype.addBuffer = function(k, M, F) {
    var A = this;
    if (M = g(M, !1), k.length > 1073741823) throw new Error("buffer too large: " + k.length + " > 1073741823");
    if (F == null && (F = {}), F.size != null) throw new Error("options.size not allowed");
    var O = new S(M, !1, F);
    O.uncompressedSize = k.length, O.crc32 = s.unsigned(k), O.crcAndFileSizeKnown = !0, A.entries.push(O), O.compress ? r.deflateRaw(k, function(ee, P) {
      Z(P);
    }) : Z(k);
    function Z(ee) {
      O.compressedSize = ee.length, O.setFileDataPumpFunction(function() {
        u(A, ee), u(A, O.getDataDescriptor()), O.state = S.FILE_DATA_DONE, setImmediate(function() {
          d(A);
        });
      }), d(A);
    }
  }, a.prototype.addEmptyDirectory = function(k, M) {
    var F = this;
    if (k = g(k, !0), M == null && (M = {}), M.size != null) throw new Error("options.size not allowed");
    if (M.compress != null) throw new Error("options.compress not allowed");
    var A = new S(k, !0, M);
    F.entries.push(A), A.setFileDataPumpFunction(function() {
      u(F, A.getDataDescriptor()), A.state = S.FILE_DATA_DONE, d(F);
    }), d(F);
  };
  var c = C([80, 75, 5, 6]);
  a.prototype.end = function(k, M) {
    if (typeof k == "function" && (M = k, k = null), k == null && (k = {}), !this.ended) {
      if (this.ended = !0, this.finalSizeCallback = M, this.forceZip64Eocd = !!k.forceZip64Format, k.comment) {
        if (typeof k.comment == "string" ? this.comment = N(k.comment) : this.comment = k.comment, this.comment.length > 65535) throw new Error("comment is too large");
        if (L(this.comment, c)) throw new Error("comment contains end of central directory record signature");
      } else
        this.comment = v;
      d(this);
    }
  };
  function u(k, M) {
    k.outputStream.write(M), k.outputStreamCursor += M.length;
  }
  function l(k, M, F) {
    var A = new $(), O = new K(), Z = M.compress ? new r.DeflateRaw() : new n(), ee = new K();
    F.pipe(A).pipe(O).pipe(Z).pipe(ee).pipe(k.outputStream, { end: !1 }), ee.on("end", function() {
      if (M.crc32 = A.crc32, M.uncompressedSize == null)
        M.uncompressedSize = O.byteCount;
      else if (M.uncompressedSize !== O.byteCount) return k.emit("error", new Error("file data stream has unexpected number of bytes"));
      M.compressedSize = ee.byteCount, k.outputStreamCursor += M.compressedSize, u(k, M.getDataDescriptor()), M.state = S.FILE_DATA_DONE, d(k);
    });
  }
  function d(k) {
    if (k.allDone) return;
    if (k.ended && k.finalSizeCallback != null) {
      var M = f(k);
      M != null && (k.finalSizeCallback(M), k.finalSizeCallback = null);
    }
    var F = A();
    function A() {
      for (var Z = 0; Z < k.entries.length; Z++) {
        var ee = k.entries[Z];
        if (ee.state < S.FILE_DATA_DONE) return ee;
      }
      return null;
    }
    if (F != null) {
      if (F.state < S.READY_TO_PUMP_FILE_DATA || F.state === S.FILE_DATA_IN_PROGRESS) return;
      F.relativeOffsetOfLocalHeader = k.outputStreamCursor;
      var O = F.getLocalFileHeader();
      u(k, O), F.doFileDataPump();
    } else
      k.ended && (k.offsetOfStartOfCentralDirectory = k.outputStreamCursor, k.entries.forEach(function(Z) {
        var ee = Z.getCentralDirectoryRecord();
        u(k, ee);
      }), u(k, x(k)), k.outputStream.end(), k.allDone = !0);
  }
  function f(k) {
    for (var M = 0, F = 0, A = 0; A < k.entries.length; A++) {
      var O = k.entries[A];
      if (O.compress) return -1;
      if (O.state >= S.READY_TO_PUMP_FILE_DATA) {
        if (O.uncompressedSize == null) return -1;
      } else if (O.uncompressedSize == null) return null;
      O.relativeOffsetOfLocalHeader = M;
      var Z = O.useZip64Format();
      M += E + O.utf8FileName.length, M += O.uncompressedSize, O.crcAndFileSizeKnown || (Z ? M += J : M += G), F += B + O.utf8FileName.length + O.fileComment.length, Z && (F += D);
    }
    var ee = 0;
    return (k.forceZip64Eocd || k.entries.length >= 65535 || F >= 65535 || M >= 4294967295) && (ee += m + h), ee += y + k.comment.length, M + F + ee;
  }
  var m = 56, h = 20, y = 22;
  function x(k, M) {
    var F = !1, A = k.entries.length;
    (k.forceZip64Eocd || k.entries.length >= 65535) && (A = 65535, F = !0);
    var O = k.outputStreamCursor - k.offsetOfStartOfCentralDirectory, Z = O;
    (k.forceZip64Eocd || O >= 4294967295) && (Z = 4294967295, F = !0);
    var ee = k.offsetOfStartOfCentralDirectory;
    (k.forceZip64Eocd || k.offsetOfStartOfCentralDirectory >= 4294967295) && (ee = 4294967295, F = !0);
    var P = U(y + k.comment.length);
    if (P.writeUInt32LE(101010256, 0), P.writeUInt16LE(0, 4), P.writeUInt16LE(0, 6), P.writeUInt16LE(A, 8), P.writeUInt16LE(A, 10), P.writeUInt32LE(Z, 12), P.writeUInt32LE(ee, 16), P.writeUInt16LE(k.comment.length, 20), k.comment.copy(P, 22), !F) return P;
    var Q = U(m);
    Q.writeUInt32LE(101075792, 0), V(Q, m - 12, 4), Q.writeUInt16LE(q, 12), Q.writeUInt16LE(j, 14), Q.writeUInt32LE(0, 16), Q.writeUInt32LE(0, 20), V(Q, k.entries.length, 24), V(Q, k.entries.length, 32), V(Q, O, 40), V(Q, k.offsetOfStartOfCentralDirectory, 48);
    var z = U(h);
    return z.writeUInt32LE(117853008, 0), z.writeUInt32LE(0, 4), V(z, k.outputStreamCursor, 8), z.writeUInt32LE(1, 16), Buffer.concat([
      Q,
      z,
      P
    ]);
  }
  function g(k, M) {
    if (k === "") throw new Error("empty metadataPath");
    if (k = k.replace(/\\/g, "/"), /^[a-zA-Z]:/.test(k) || /^\//.test(k)) throw new Error("absolute path: " + k);
    if (k.split("/").indexOf("..") !== -1) throw new Error("invalid relative path: " + k);
    var F = /\/$/.test(k);
    if (M)
      F || (k += "/");
    else if (F) throw new Error("file path cannot end with '/': " + k);
    return k;
  }
  var v = U(0);
  function S(k, M, F) {
    if (this.utf8FileName = C(k), this.utf8FileName.length > 65535) throw new Error("utf8 file name too long. " + utf8FileName.length + " > 65535");
    if (this.isDirectory = M, this.state = S.WAITING_FOR_METADATA, this.setLastModDate(F.mtime != null ? F.mtime : /* @__PURE__ */ new Date()), F.mode != null ? this.setFileAttributesMode(F.mode) : this.setFileAttributesMode(M ? 16893 : 33204), M ? (this.crcAndFileSizeKnown = !0, this.crc32 = 0, this.uncompressedSize = 0, this.compressedSize = 0) : (this.crcAndFileSizeKnown = !1, this.crc32 = null, this.uncompressedSize = null, this.compressedSize = null, F.size != null && (this.uncompressedSize = F.size)), M ? this.compress = !1 : (this.compress = !0, F.compress != null && (this.compress = !!F.compress)), this.forceZip64Format = !!F.forceZip64Format, F.fileComment) {
      if (typeof F.fileComment == "string" ? this.fileComment = C(F.fileComment, "utf-8") : this.fileComment = F.fileComment, this.fileComment.length > 65535) throw new Error("fileComment is too large");
    } else
      this.fileComment = v;
  }
  S.WAITING_FOR_METADATA = 0, S.READY_TO_PUMP_FILE_DATA = 1, S.FILE_DATA_IN_PROGRESS = 2, S.FILE_DATA_DONE = 3, S.prototype.setLastModDate = function(k) {
    var M = X(k);
    this.lastModFileTime = M.time, this.lastModFileDate = M.date;
  }, S.prototype.setFileAttributesMode = function(k) {
    if ((k & 65535) !== k) throw new Error("invalid mode. expected: 0 <= " + k + " <= 65535");
    this.externalFileAttributes = k << 16 >>> 0;
  }, S.prototype.setFileDataPumpFunction = function(k) {
    this.doFileDataPump = k, this.state = S.READY_TO_PUMP_FILE_DATA;
  }, S.prototype.useZip64Format = function() {
    return this.forceZip64Format || this.uncompressedSize != null && this.uncompressedSize > 4294967294 || this.compressedSize != null && this.compressedSize > 4294967294 || this.relativeOffsetOfLocalHeader != null && this.relativeOffsetOfLocalHeader > 4294967294;
  };
  var E = 30, T = 20, j = 45, q = 831, Y = 2048, W = 8;
  S.prototype.getLocalFileHeader = function() {
    var k = 0, M = 0, F = 0;
    this.crcAndFileSizeKnown && (k = this.crc32, M = this.compressedSize, F = this.uncompressedSize);
    var A = U(E), O = Y;
    return this.crcAndFileSizeKnown || (O |= W), A.writeUInt32LE(67324752, 0), A.writeUInt16LE(T, 4), A.writeUInt16LE(O, 6), A.writeUInt16LE(this.getCompressionMethod(), 8), A.writeUInt16LE(this.lastModFileTime, 10), A.writeUInt16LE(this.lastModFileDate, 12), A.writeUInt32LE(k, 14), A.writeUInt32LE(M, 18), A.writeUInt32LE(F, 22), A.writeUInt16LE(this.utf8FileName.length, 26), A.writeUInt16LE(0, 28), Buffer.concat([
      A,
      // file name (variable size)
      this.utf8FileName
      // extra field (variable size)
      // no extra fields
    ]);
  };
  var G = 16, J = 24;
  S.prototype.getDataDescriptor = function() {
    if (this.crcAndFileSizeKnown)
      return v;
    if (this.useZip64Format()) {
      var k = U(J);
      return k.writeUInt32LE(134695760, 0), k.writeUInt32LE(this.crc32, 4), V(k, this.compressedSize, 8), V(k, this.uncompressedSize, 16), k;
    } else {
      var k = U(G);
      return k.writeUInt32LE(134695760, 0), k.writeUInt32LE(this.crc32, 4), k.writeUInt32LE(this.compressedSize, 8), k.writeUInt32LE(this.uncompressedSize, 12), k;
    }
  };
  var B = 46, D = 28;
  S.prototype.getCentralDirectoryRecord = function() {
    var k = U(B), M = Y;
    this.crcAndFileSizeKnown || (M |= W);
    var F = this.compressedSize, A = this.uncompressedSize, O = this.relativeOffsetOfLocalHeader, Z, ee;
    return this.useZip64Format() ? (F = 4294967295, A = 4294967295, O = 4294967295, Z = j, ee = U(D), ee.writeUInt16LE(1, 0), ee.writeUInt16LE(D - 4, 2), V(ee, this.uncompressedSize, 4), V(ee, this.compressedSize, 12), V(ee, this.relativeOffsetOfLocalHeader, 20)) : (Z = T, ee = v), k.writeUInt32LE(33639248, 0), k.writeUInt16LE(q, 4), k.writeUInt16LE(Z, 6), k.writeUInt16LE(M, 8), k.writeUInt16LE(this.getCompressionMethod(), 10), k.writeUInt16LE(this.lastModFileTime, 12), k.writeUInt16LE(this.lastModFileDate, 14), k.writeUInt32LE(this.crc32, 16), k.writeUInt32LE(F, 20), k.writeUInt32LE(A, 24), k.writeUInt16LE(this.utf8FileName.length, 28), k.writeUInt16LE(ee.length, 30), k.writeUInt16LE(this.fileComment.length, 32), k.writeUInt16LE(0, 34), k.writeUInt16LE(0, 36), k.writeUInt32LE(this.externalFileAttributes, 38), k.writeUInt32LE(O, 42), Buffer.concat([
      k,
      // file name (variable size)
      this.utf8FileName,
      // extra field (variable size)
      ee,
      // file comment (variable size)
      this.fileComment
    ]);
  }, S.prototype.getCompressionMethod = function() {
    var k = 0, M = 8;
    return this.compress ? M : k;
  };
  function X(k) {
    var M = 0;
    M |= k.getDate() & 31, M |= (k.getMonth() + 1 & 15) << 5, M |= (k.getFullYear() - 1980 & 127) << 9;
    var F = 0;
    return F |= Math.floor(k.getSeconds() / 2), F |= (k.getMinutes() & 63) << 5, F |= (k.getHours() & 31) << 11, { date: M, time: F };
  }
  function V(k, M, F) {
    var A = Math.floor(M / 4294967296), O = M % 4294967296;
    k.writeUInt32LE(O, F), k.writeUInt32LE(A, F + 4);
  }
  i.inherits(K, e);
  function K(k) {
    e.call(this, k), this.byteCount = 0;
  }
  K.prototype._transform = function(k, M, F) {
    this.byteCount += k.length, F(null, k);
  }, i.inherits($, e);
  function $(k) {
    e.call(this, k), this.crc32 = 0;
  }
  $.prototype._transform = function(k, M, F) {
    this.crc32 = s.unsigned(k, this.crc32), F(null, k);
  };
  var _ = "\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñÑªº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ";
  if (_.length !== 256) throw new Error("assertion failure");
  var I = null;
  function N(k) {
    if (/^[\x20-\x7e]*$/.test(k))
      return C(k, "utf-8");
    if (I == null) {
      I = {};
      for (var M = 0; M < _.length; M++)
        I[_[M]] = M;
    }
    for (var F = U(k.length), M = 0; M < k.length; M++) {
      var A = I[k[M]];
      if (A == null) throw new Error("character not encodable in CP437: " + JSON.stringify(k[M]));
      F[M] = A;
    }
    return F;
  }
  function U(k) {
    U = M;
    try {
      return U(k);
    } catch {
      return U = F, U(k);
    }
    function M(A) {
      return Buffer.allocUnsafe(A);
    }
    function F(A) {
      return new Buffer(A);
    }
  }
  function C(k, M) {
    C = F;
    try {
      return C(k, M);
    } catch {
      return C = A, C(k, M);
    }
    function F(O, Z) {
      return Buffer.from(O, Z);
    }
    function A(O, Z) {
      return new Buffer(O, Z);
    }
  }
  function L(k, M) {
    L = F;
    try {
      return L(k, M);
    } catch {
      return L = A, L(k, M);
    }
    function F(O, Z) {
      return O.includes(Z);
    }
    function A(O, Z) {
      for (var ee = 0; ee <= O.length - Z.length; ee++)
        for (var P = 0; ; P++) {
          if (P === Z.length) return !0;
          if (O[ee + P] !== Z[P]) break;
        }
      return !1;
    }
  }
  return Uf;
}
var Lf = {}, jf = { exports: {} }, RC;
function qg() {
  if (RC) return jf.exports;
  RC = 1, typeof process > "u" || !process.version || process.version.indexOf("v0.") === 0 || process.version.indexOf("v1.") === 0 && process.version.indexOf("v1.8.") !== 0 ? jf.exports = { nextTick: t } : jf.exports = process;
  function t(e, n, r, i) {
    if (typeof e != "function")
      throw new TypeError('"callback" argument must be a function');
    var o = arguments.length, s, a;
    switch (o) {
      case 0:
      case 1:
        return process.nextTick(e);
      case 2:
        return process.nextTick(function() {
          e.call(null, n);
        });
      case 3:
        return process.nextTick(function() {
          e.call(null, n, r);
        });
      case 4:
        return process.nextTick(function() {
          e.call(null, n, r, i);
        });
      default:
        for (s = new Array(o - 1), a = 0; a < s.length; )
          s[a++] = arguments[a];
        return process.nextTick(function() {
          e.apply(null, s);
        });
    }
  }
  return jf.exports;
}
var er = {}, BC;
function Td() {
  if (BC) return er;
  BC = 1;
  function t(y) {
    return Array.isArray ? Array.isArray(y) : h(y) === "[object Array]";
  }
  er.isArray = t;
  function e(y) {
    return typeof y == "boolean";
  }
  er.isBoolean = e;
  function n(y) {
    return y === null;
  }
  er.isNull = n;
  function r(y) {
    return y == null;
  }
  er.isNullOrUndefined = r;
  function i(y) {
    return typeof y == "number";
  }
  er.isNumber = i;
  function o(y) {
    return typeof y == "string";
  }
  er.isString = o;
  function s(y) {
    return typeof y == "symbol";
  }
  er.isSymbol = s;
  function a(y) {
    return y === void 0;
  }
  er.isUndefined = a;
  function c(y) {
    return h(y) === "[object RegExp]";
  }
  er.isRegExp = c;
  function u(y) {
    return typeof y == "object" && y !== null;
  }
  er.isObject = u;
  function l(y) {
    return h(y) === "[object Date]";
  }
  er.isDate = l;
  function d(y) {
    return h(y) === "[object Error]" || y instanceof Error;
  }
  er.isError = d;
  function f(y) {
    return typeof y == "function";
  }
  er.isFunction = f;
  function m(y) {
    return y === null || typeof y == "boolean" || typeof y == "number" || typeof y == "string" || typeof y == "symbol" || // ES6 symbol
    typeof y > "u";
  }
  er.isPrimitive = m, er.isBuffer = pa.Buffer.isBuffer;
  function h(y) {
    return Object.prototype.toString.call(y);
  }
  return er;
}
var Qf = { exports: {} }, UC;
function fo() {
  return UC || (UC = 1, typeof Object.create == "function" ? Qf.exports = function(e, n) {
    n && (e.super_ = n, e.prototype = Object.create(n.prototype, {
      constructor: {
        value: e,
        enumerable: !1,
        writable: !0,
        configurable: !0
      }
    }));
  } : Qf.exports = function(e, n) {
    if (n) {
      e.super_ = n;
      var r = function() {
      };
      r.prototype = n.prototype, e.prototype = new r(), e.prototype.constructor = e;
    }
  }), Qf.exports;
}
var Vy, LC;
function iW() {
  if (LC) return Vy;
  LC = 1;
  var t = {}.toString;
  return Vy = Array.isArray || function(e) {
    return t.call(e) == "[object Array]";
  }, Vy;
}
var Yy, jC;
function r8() {
  return jC || (jC = 1, Yy = xs.EventEmitter), Yy;
}
var $f = { exports: {} }, QC;
function Hg() {
  return QC || (QC = 1, (function(t, e) {
    var n = pa, r = n.Buffer;
    function i(s, a) {
      for (var c in s)
        a[c] = s[c];
    }
    r.from && r.alloc && r.allocUnsafe && r.allocUnsafeSlow ? t.exports = n : (i(n, e), e.Buffer = o);
    function o(s, a, c) {
      return r(s, a, c);
    }
    i(r, o), o.from = function(s, a, c) {
      if (typeof s == "number")
        throw new TypeError("Argument must not be a number");
      return r(s, a, c);
    }, o.alloc = function(s, a, c) {
      if (typeof s != "number")
        throw new TypeError("Argument must be a number");
      var u = r(s);
      return a !== void 0 ? typeof c == "string" ? u.fill(a, c) : u.fill(a) : u.fill(0), u;
    }, o.allocUnsafe = function(s) {
      if (typeof s != "number")
        throw new TypeError("Argument must be a number");
      return r(s);
    }, o.allocUnsafeSlow = function(s) {
      if (typeof s != "number")
        throw new TypeError("Argument must be a number");
      return n.SlowBuffer(s);
    };
  })($f, $f.exports)), $f.exports;
}
var Jy = { exports: {} }, $C;
function oW() {
  return $C || ($C = 1, (function(t) {
    function e(o, s) {
      if (!(o instanceof s))
        throw new TypeError("Cannot call a class as a function");
    }
    var n = Hg().Buffer, r = _n;
    function i(o, s, a) {
      o.copy(s, a);
    }
    t.exports = (function() {
      function o() {
        e(this, o), this.head = null, this.tail = null, this.length = 0;
      }
      return o.prototype.push = function(a) {
        var c = { data: a, next: null };
        this.length > 0 ? this.tail.next = c : this.head = c, this.tail = c, ++this.length;
      }, o.prototype.unshift = function(a) {
        var c = { data: a, next: this.head };
        this.length === 0 && (this.tail = c), this.head = c, ++this.length;
      }, o.prototype.shift = function() {
        if (this.length !== 0) {
          var a = this.head.data;
          return this.length === 1 ? this.head = this.tail = null : this.head = this.head.next, --this.length, a;
        }
      }, o.prototype.clear = function() {
        this.head = this.tail = null, this.length = 0;
      }, o.prototype.join = function(a) {
        if (this.length === 0) return "";
        for (var c = this.head, u = "" + c.data; c = c.next; )
          u += a + c.data;
        return u;
      }, o.prototype.concat = function(a) {
        if (this.length === 0) return n.alloc(0);
        for (var c = n.allocUnsafe(a >>> 0), u = this.head, l = 0; u; )
          i(u.data, c, l), l += u.data.length, u = u.next;
        return c;
      }, o;
    })(), r && r.inspect && r.inspect.custom && (t.exports.prototype[r.inspect.custom] = function() {
      var o = r.inspect({ length: this.length });
      return this.constructor.name + " " + o;
    });
  })(Jy)), Jy.exports;
}
var Xy, GC;
function i8() {
  if (GC) return Xy;
  GC = 1;
  var t = qg();
  function e(i, o) {
    var s = this, a = this._readableState && this._readableState.destroyed, c = this._writableState && this._writableState.destroyed;
    return a || c ? (o ? o(i) : i && (this._writableState ? this._writableState.errorEmitted || (this._writableState.errorEmitted = !0, t.nextTick(r, this, i)) : t.nextTick(r, this, i)), this) : (this._readableState && (this._readableState.destroyed = !0), this._writableState && (this._writableState.destroyed = !0), this._destroy(i || null, function(u) {
      !o && u ? s._writableState ? s._writableState.errorEmitted || (s._writableState.errorEmitted = !0, t.nextTick(r, s, u)) : t.nextTick(r, s, u) : o && o(u);
    }), this);
  }
  function n() {
    this._readableState && (this._readableState.destroyed = !1, this._readableState.reading = !1, this._readableState.ended = !1, this._readableState.endEmitted = !1), this._writableState && (this._writableState.destroyed = !1, this._writableState.ended = !1, this._writableState.ending = !1, this._writableState.finalCalled = !1, this._writableState.prefinished = !1, this._writableState.finished = !1, this._writableState.errorEmitted = !1);
  }
  function r(i, o) {
    i.emit("error", o);
  }
  return Xy = {
    destroy: e,
    undestroy: n
  }, Xy;
}
var Zy = {}, qC;
function HC() {
  if (qC) return Zy;
  qC = 1;
  var t = Hg().Buffer, e = t.isEncoding || function(g) {
    switch (g = "" + g, g && g.toLowerCase()) {
      case "hex":
      case "utf8":
      case "utf-8":
      case "ascii":
      case "binary":
      case "base64":
      case "ucs2":
      case "ucs-2":
      case "utf16le":
      case "utf-16le":
      case "raw":
        return !0;
      default:
        return !1;
    }
  };
  function n(g) {
    if (!g) return "utf8";
    for (var v; ; )
      switch (g) {
        case "utf8":
        case "utf-8":
          return "utf8";
        case "ucs2":
        case "ucs-2":
        case "utf16le":
        case "utf-16le":
          return "utf16le";
        case "latin1":
        case "binary":
          return "latin1";
        case "base64":
        case "ascii":
        case "hex":
          return g;
        default:
          if (v) return;
          g = ("" + g).toLowerCase(), v = !0;
      }
  }
  function r(g) {
    var v = n(g);
    if (typeof v != "string" && (t.isEncoding === e || !e(g))) throw new Error("Unknown encoding: " + g);
    return v || g;
  }
  Zy.StringDecoder = i;
  function i(g) {
    this.encoding = r(g);
    var v;
    switch (this.encoding) {
      case "utf16le":
        this.text = d, this.end = f, v = 4;
        break;
      case "utf8":
        this.fillLast = c, v = 4;
        break;
      case "base64":
        this.text = m, this.end = h, v = 3;
        break;
      default:
        this.write = y, this.end = x;
        return;
    }
    this.lastNeed = 0, this.lastTotal = 0, this.lastChar = t.allocUnsafe(v);
  }
  i.prototype.write = function(g) {
    if (g.length === 0) return "";
    var v, S;
    if (this.lastNeed) {
      if (v = this.fillLast(g), v === void 0) return "";
      S = this.lastNeed, this.lastNeed = 0;
    } else
      S = 0;
    return S < g.length ? v ? v + this.text(g, S) : this.text(g, S) : v || "";
  }, i.prototype.end = l, i.prototype.text = u, i.prototype.fillLast = function(g) {
    if (this.lastNeed <= g.length)
      return g.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal);
    g.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, g.length), this.lastNeed -= g.length;
  };
  function o(g) {
    return g <= 127 ? 0 : g >> 5 === 6 ? 2 : g >> 4 === 14 ? 3 : g >> 3 === 30 ? 4 : g >> 6 === 2 ? -1 : -2;
  }
  function s(g, v, S) {
    var E = v.length - 1;
    if (E < S) return 0;
    var T = o(v[E]);
    return T >= 0 ? (T > 0 && (g.lastNeed = T - 1), T) : --E < S || T === -2 ? 0 : (T = o(v[E]), T >= 0 ? (T > 0 && (g.lastNeed = T - 2), T) : --E < S || T === -2 ? 0 : (T = o(v[E]), T >= 0 ? (T > 0 && (T === 2 ? T = 0 : g.lastNeed = T - 3), T) : 0));
  }
  function a(g, v, S) {
    if ((v[0] & 192) !== 128)
      return g.lastNeed = 0, "�";
    if (g.lastNeed > 1 && v.length > 1) {
      if ((v[1] & 192) !== 128)
        return g.lastNeed = 1, "�";
      if (g.lastNeed > 2 && v.length > 2 && (v[2] & 192) !== 128)
        return g.lastNeed = 2, "�";
    }
  }
  function c(g) {
    var v = this.lastTotal - this.lastNeed, S = a(this, g);
    if (S !== void 0) return S;
    if (this.lastNeed <= g.length)
      return g.copy(this.lastChar, v, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal);
    g.copy(this.lastChar, v, 0, g.length), this.lastNeed -= g.length;
  }
  function u(g, v) {
    var S = s(this, g, v);
    if (!this.lastNeed) return g.toString("utf8", v);
    this.lastTotal = S;
    var E = g.length - (S - this.lastNeed);
    return g.copy(this.lastChar, 0, E), g.toString("utf8", v, E);
  }
  function l(g) {
    var v = g && g.length ? this.write(g) : "";
    return this.lastNeed ? v + "�" : v;
  }
  function d(g, v) {
    if ((g.length - v) % 2 === 0) {
      var S = g.toString("utf16le", v);
      if (S) {
        var E = S.charCodeAt(S.length - 1);
        if (E >= 55296 && E <= 56319)
          return this.lastNeed = 2, this.lastTotal = 4, this.lastChar[0] = g[g.length - 2], this.lastChar[1] = g[g.length - 1], S.slice(0, -1);
      }
      return S;
    }
    return this.lastNeed = 1, this.lastTotal = 2, this.lastChar[0] = g[g.length - 1], g.toString("utf16le", v, g.length - 1);
  }
  function f(g) {
    var v = g && g.length ? this.write(g) : "";
    if (this.lastNeed) {
      var S = this.lastTotal - this.lastNeed;
      return v + this.lastChar.toString("utf16le", 0, S);
    }
    return v;
  }
  function m(g, v) {
    var S = (g.length - v) % 3;
    return S === 0 ? g.toString("base64", v) : (this.lastNeed = 3 - S, this.lastTotal = 3, S === 1 ? this.lastChar[0] = g[g.length - 1] : (this.lastChar[0] = g[g.length - 2], this.lastChar[1] = g[g.length - 1]), g.toString("base64", v, g.length - S));
  }
  function h(g) {
    var v = g && g.length ? this.write(g) : "";
    return this.lastNeed ? v + this.lastChar.toString("base64", 0, 3 - this.lastNeed) : v;
  }
  function y(g) {
    return g.toString(this.encoding);
  }
  function x(g) {
    return g && g.length ? this.write(g) : "";
  }
  return Zy;
}
var e1, WC;
function o8() {
  if (WC) return e1;
  WC = 1;
  var t = qg();
  e1 = v;
  var e = iW(), n;
  v.ReadableState = g, xs.EventEmitter;
  var r = function(A, O) {
    return A.listeners(O).length;
  }, i = r8(), o = Hg().Buffer, s = (typeof On < "u" ? On : typeof window < "u" ? window : typeof self < "u" ? self : {}).Uint8Array || function() {
  };
  function a(A) {
    return o.from(A);
  }
  function c(A) {
    return o.isBuffer(A) || A instanceof s;
  }
  var u = Object.create(Td());
  u.inherits = fo();
  var l = _n, d = void 0;
  l && l.debuglog ? d = l.debuglog("stream") : d = function() {
  };
  var f = oW(), m = i8(), h;
  u.inherits(v, i);
  var y = ["error", "close", "destroy", "pause", "resume"];
  function x(A, O, Z) {
    if (typeof A.prependListener == "function") return A.prependListener(O, Z);
    !A._events || !A._events[O] ? A.on(O, Z) : e(A._events[O]) ? A._events[O].unshift(Z) : A._events[O] = [Z, A._events[O]];
  }
  function g(A, O) {
    n = n || Ya(), A = A || {};
    var Z = O instanceof n;
    this.objectMode = !!A.objectMode, Z && (this.objectMode = this.objectMode || !!A.readableObjectMode);
    var ee = A.highWaterMark, P = A.readableHighWaterMark, Q = this.objectMode ? 16 : 16 * 1024;
    ee || ee === 0 ? this.highWaterMark = ee : Z && (P || P === 0) ? this.highWaterMark = P : this.highWaterMark = Q, this.highWaterMark = Math.floor(this.highWaterMark), this.buffer = new f(), this.length = 0, this.pipes = null, this.pipesCount = 0, this.flowing = null, this.ended = !1, this.endEmitted = !1, this.reading = !1, this.sync = !0, this.needReadable = !1, this.emittedReadable = !1, this.readableListening = !1, this.resumeScheduled = !1, this.destroyed = !1, this.defaultEncoding = A.defaultEncoding || "utf8", this.awaitDrain = 0, this.readingMore = !1, this.decoder = null, this.encoding = null, A.encoding && (h || (h = HC().StringDecoder), this.decoder = new h(A.encoding), this.encoding = A.encoding);
  }
  function v(A) {
    if (n = n || Ya(), !(this instanceof v)) return new v(A);
    this._readableState = new g(A, this), this.readable = !0, A && (typeof A.read == "function" && (this._read = A.read), typeof A.destroy == "function" && (this._destroy = A.destroy)), i.call(this);
  }
  Object.defineProperty(v.prototype, "destroyed", {
    get: function() {
      return this._readableState === void 0 ? !1 : this._readableState.destroyed;
    },
    set: function(A) {
      this._readableState && (this._readableState.destroyed = A);
    }
  }), v.prototype.destroy = m.destroy, v.prototype._undestroy = m.undestroy, v.prototype._destroy = function(A, O) {
    this.push(null), O(A);
  }, v.prototype.push = function(A, O) {
    var Z = this._readableState, ee;
    return Z.objectMode ? ee = !0 : typeof A == "string" && (O = O || Z.defaultEncoding, O !== Z.encoding && (A = o.from(A, O), O = ""), ee = !0), S(this, A, O, !1, ee);
  }, v.prototype.unshift = function(A) {
    return S(this, A, null, !0, !1);
  };
  function S(A, O, Z, ee, P) {
    var Q = A._readableState;
    if (O === null)
      Q.reading = !1, G(A, Q);
    else {
      var z;
      P || (z = T(Q, O)), z ? A.emit("error", z) : Q.objectMode || O && O.length > 0 ? (typeof O != "string" && !Q.objectMode && Object.getPrototypeOf(O) !== o.prototype && (O = a(O)), ee ? Q.endEmitted ? A.emit("error", new Error("stream.unshift() after end event")) : E(A, Q, O, !0) : Q.ended ? A.emit("error", new Error("stream.push() after EOF")) : (Q.reading = !1, Q.decoder && !Z ? (O = Q.decoder.write(O), Q.objectMode || O.length !== 0 ? E(A, Q, O, !1) : D(A, Q)) : E(A, Q, O, !1))) : ee || (Q.reading = !1);
    }
    return j(Q);
  }
  function E(A, O, Z, ee) {
    O.flowing && O.length === 0 && !O.sync ? (A.emit("data", Z), A.read(0)) : (O.length += O.objectMode ? 1 : Z.length, ee ? O.buffer.unshift(Z) : O.buffer.push(Z), O.needReadable && J(A)), D(A, O);
  }
  function T(A, O) {
    var Z;
    return !c(O) && typeof O != "string" && O !== void 0 && !A.objectMode && (Z = new TypeError("Invalid non-string/buffer chunk")), Z;
  }
  function j(A) {
    return !A.ended && (A.needReadable || A.length < A.highWaterMark || A.length === 0);
  }
  v.prototype.isPaused = function() {
    return this._readableState.flowing === !1;
  }, v.prototype.setEncoding = function(A) {
    return h || (h = HC().StringDecoder), this._readableState.decoder = new h(A), this._readableState.encoding = A, this;
  };
  var q = 8388608;
  function Y(A) {
    return A >= q ? A = q : (A--, A |= A >>> 1, A |= A >>> 2, A |= A >>> 4, A |= A >>> 8, A |= A >>> 16, A++), A;
  }
  function W(A, O) {
    return A <= 0 || O.length === 0 && O.ended ? 0 : O.objectMode ? 1 : A !== A ? O.flowing && O.length ? O.buffer.head.data.length : O.length : (A > O.highWaterMark && (O.highWaterMark = Y(A)), A <= O.length ? A : O.ended ? O.length : (O.needReadable = !0, 0));
  }
  v.prototype.read = function(A) {
    d("read", A), A = parseInt(A, 10);
    var O = this._readableState, Z = A;
    if (A !== 0 && (O.emittedReadable = !1), A === 0 && O.needReadable && (O.length >= O.highWaterMark || O.ended))
      return d("read: emitReadable", O.length, O.ended), O.length === 0 && O.ended ? k(this) : J(this), null;
    if (A = W(A, O), A === 0 && O.ended)
      return O.length === 0 && k(this), null;
    var ee = O.needReadable;
    d("need readable", ee), (O.length === 0 || O.length - A < O.highWaterMark) && (ee = !0, d("length less than watermark", ee)), O.ended || O.reading ? (ee = !1, d("reading or ended", ee)) : ee && (d("do read"), O.reading = !0, O.sync = !0, O.length === 0 && (O.needReadable = !0), this._read(O.highWaterMark), O.sync = !1, O.reading || (A = W(Z, O)));
    var P;
    return A > 0 ? P = N(A, O) : P = null, P === null ? (O.needReadable = !0, A = 0) : O.length -= A, O.length === 0 && (O.ended || (O.needReadable = !0), Z !== A && O.ended && k(this)), P !== null && this.emit("data", P), P;
  };
  function G(A, O) {
    if (!O.ended) {
      if (O.decoder) {
        var Z = O.decoder.end();
        Z && Z.length && (O.buffer.push(Z), O.length += O.objectMode ? 1 : Z.length);
      }
      O.ended = !0, J(A);
    }
  }
  function J(A) {
    var O = A._readableState;
    O.needReadable = !1, O.emittedReadable || (d("emitReadable", O.flowing), O.emittedReadable = !0, O.sync ? t.nextTick(B, A) : B(A));
  }
  function B(A) {
    d("emit readable"), A.emit("readable"), I(A);
  }
  function D(A, O) {
    O.readingMore || (O.readingMore = !0, t.nextTick(X, A, O));
  }
  function X(A, O) {
    for (var Z = O.length; !O.reading && !O.flowing && !O.ended && O.length < O.highWaterMark && (d("maybeReadMore read 0"), A.read(0), Z !== O.length); )
      Z = O.length;
    O.readingMore = !1;
  }
  v.prototype._read = function(A) {
    this.emit("error", new Error("_read() is not implemented"));
  }, v.prototype.pipe = function(A, O) {
    var Z = this, ee = this._readableState;
    switch (ee.pipesCount) {
      case 0:
        ee.pipes = A;
        break;
      case 1:
        ee.pipes = [ee.pipes, A];
        break;
      default:
        ee.pipes.push(A);
        break;
    }
    ee.pipesCount += 1, d("pipe count=%d opts=%j", ee.pipesCount, O);
    var P = (!O || O.end !== !1) && A !== process.stdout && A !== process.stderr, Q = P ? se : nt;
    ee.endEmitted ? t.nextTick(Q) : Z.once("end", Q), A.on("unpipe", z);
    function z(qe, Nt) {
      d("onunpipe"), qe === Z && Nt && Nt.hasUnpiped === !1 && (Nt.hasUnpiped = !0, we());
    }
    function se() {
      d("onend"), A.end();
    }
    var ae = V(Z);
    A.on("drain", ae);
    var ie = !1;
    function we() {
      d("cleanup"), A.removeListener("close", Ye), A.removeListener("finish", Ke), A.removeListener("drain", ae), A.removeListener("error", We), A.removeListener("unpipe", z), Z.removeListener("end", se), Z.removeListener("end", nt), Z.removeListener("data", He), ie = !0, ee.awaitDrain && (!A._writableState || A._writableState.needDrain) && ae();
    }
    var Oe = !1;
    Z.on("data", He);
    function He(qe) {
      d("ondata"), Oe = !1;
      var Nt = A.write(qe);
      Nt === !1 && !Oe && ((ee.pipesCount === 1 && ee.pipes === A || ee.pipesCount > 1 && F(ee.pipes, A) !== -1) && !ie && (d("false write response, pause", ee.awaitDrain), ee.awaitDrain++, Oe = !0), Z.pause());
    }
    function We(qe) {
      d("onerror", qe), nt(), A.removeListener("error", We), r(A, "error") === 0 && A.emit("error", qe);
    }
    x(A, "error", We);
    function Ye() {
      A.removeListener("finish", Ke), nt();
    }
    A.once("close", Ye);
    function Ke() {
      d("onfinish"), A.removeListener("close", Ye), nt();
    }
    A.once("finish", Ke);
    function nt() {
      d("unpipe"), Z.unpipe(A);
    }
    return A.emit("pipe", Z), ee.flowing || (d("pipe resume"), Z.resume()), A;
  };
  function V(A) {
    return function() {
      var O = A._readableState;
      d("pipeOnDrain", O.awaitDrain), O.awaitDrain && O.awaitDrain--, O.awaitDrain === 0 && r(A, "data") && (O.flowing = !0, I(A));
    };
  }
  v.prototype.unpipe = function(A) {
    var O = this._readableState, Z = { hasUnpiped: !1 };
    if (O.pipesCount === 0) return this;
    if (O.pipesCount === 1)
      return A && A !== O.pipes ? this : (A || (A = O.pipes), O.pipes = null, O.pipesCount = 0, O.flowing = !1, A && A.emit("unpipe", this, Z), this);
    if (!A) {
      var ee = O.pipes, P = O.pipesCount;
      O.pipes = null, O.pipesCount = 0, O.flowing = !1;
      for (var Q = 0; Q < P; Q++)
        ee[Q].emit("unpipe", this, { hasUnpiped: !1 });
      return this;
    }
    var z = F(O.pipes, A);
    return z === -1 ? this : (O.pipes.splice(z, 1), O.pipesCount -= 1, O.pipesCount === 1 && (O.pipes = O.pipes[0]), A.emit("unpipe", this, Z), this);
  }, v.prototype.on = function(A, O) {
    var Z = i.prototype.on.call(this, A, O);
    if (A === "data")
      this._readableState.flowing !== !1 && this.resume();
    else if (A === "readable") {
      var ee = this._readableState;
      !ee.endEmitted && !ee.readableListening && (ee.readableListening = ee.needReadable = !0, ee.emittedReadable = !1, ee.reading ? ee.length && J(this) : t.nextTick(K, this));
    }
    return Z;
  }, v.prototype.addListener = v.prototype.on;
  function K(A) {
    d("readable nexttick read 0"), A.read(0);
  }
  v.prototype.resume = function() {
    var A = this._readableState;
    return A.flowing || (d("resume"), A.flowing = !0, $(this, A)), this;
  };
  function $(A, O) {
    O.resumeScheduled || (O.resumeScheduled = !0, t.nextTick(_, A, O));
  }
  function _(A, O) {
    O.reading || (d("resume read 0"), A.read(0)), O.resumeScheduled = !1, O.awaitDrain = 0, A.emit("resume"), I(A), O.flowing && !O.reading && A.read(0);
  }
  v.prototype.pause = function() {
    return d("call pause flowing=%j", this._readableState.flowing), this._readableState.flowing !== !1 && (d("pause"), this._readableState.flowing = !1, this.emit("pause")), this;
  };
  function I(A) {
    var O = A._readableState;
    for (d("flow", O.flowing); O.flowing && A.read() !== null; )
      ;
  }
  v.prototype.wrap = function(A) {
    var O = this, Z = this._readableState, ee = !1;
    A.on("end", function() {
      if (d("wrapped end"), Z.decoder && !Z.ended) {
        var z = Z.decoder.end();
        z && z.length && O.push(z);
      }
      O.push(null);
    }), A.on("data", function(z) {
      if (d("wrapped data"), Z.decoder && (z = Z.decoder.write(z)), !(Z.objectMode && z == null) && !(!Z.objectMode && (!z || !z.length))) {
        var se = O.push(z);
        se || (ee = !0, A.pause());
      }
    });
    for (var P in A)
      this[P] === void 0 && typeof A[P] == "function" && (this[P] = /* @__PURE__ */ (function(z) {
        return function() {
          return A[z].apply(A, arguments);
        };
      })(P));
    for (var Q = 0; Q < y.length; Q++)
      A.on(y[Q], this.emit.bind(this, y[Q]));
    return this._read = function(z) {
      d("wrapped _read", z), ee && (ee = !1, A.resume());
    }, this;
  }, Object.defineProperty(v.prototype, "readableHighWaterMark", {
    // making it explicit this property is not enumerable
    // because otherwise some prototype manipulation in
    // userland will fail
    enumerable: !1,
    get: function() {
      return this._readableState.highWaterMark;
    }
  }), v._fromList = N;
  function N(A, O) {
    if (O.length === 0) return null;
    var Z;
    return O.objectMode ? Z = O.buffer.shift() : !A || A >= O.length ? (O.decoder ? Z = O.buffer.join("") : O.buffer.length === 1 ? Z = O.buffer.head.data : Z = O.buffer.concat(O.length), O.buffer.clear()) : Z = U(A, O.buffer, O.decoder), Z;
  }
  function U(A, O, Z) {
    var ee;
    return A < O.head.data.length ? (ee = O.head.data.slice(0, A), O.head.data = O.head.data.slice(A)) : A === O.head.data.length ? ee = O.shift() : ee = Z ? C(A, O) : L(A, O), ee;
  }
  function C(A, O) {
    var Z = O.head, ee = 1, P = Z.data;
    for (A -= P.length; Z = Z.next; ) {
      var Q = Z.data, z = A > Q.length ? Q.length : A;
      if (z === Q.length ? P += Q : P += Q.slice(0, A), A -= z, A === 0) {
        z === Q.length ? (++ee, Z.next ? O.head = Z.next : O.head = O.tail = null) : (O.head = Z, Z.data = Q.slice(z));
        break;
      }
      ++ee;
    }
    return O.length -= ee, P;
  }
  function L(A, O) {
    var Z = o.allocUnsafe(A), ee = O.head, P = 1;
    for (ee.data.copy(Z), A -= ee.data.length; ee = ee.next; ) {
      var Q = ee.data, z = A > Q.length ? Q.length : A;
      if (Q.copy(Z, Z.length - A, 0, z), A -= z, A === 0) {
        z === Q.length ? (++P, ee.next ? O.head = ee.next : O.head = O.tail = null) : (O.head = ee, ee.data = Q.slice(z));
        break;
      }
      ++P;
    }
    return O.length -= P, Z;
  }
  function k(A) {
    var O = A._readableState;
    if (O.length > 0) throw new Error('"endReadable()" called on non-empty stream');
    O.endEmitted || (O.ended = !0, t.nextTick(M, O, A));
  }
  function M(A, O) {
    !A.endEmitted && A.length === 0 && (A.endEmitted = !0, O.readable = !1, O.emit("end"));
  }
  function F(A, O) {
    for (var Z = 0, ee = A.length; Z < ee; Z++)
      if (A[Z] === O) return Z;
    return -1;
  }
  return e1;
}
var t1, zC;
function s8() {
  if (zC) return t1;
  zC = 1, t1 = t;
  function t(n, r) {
    if (e("noDeprecation"))
      return n;
    var i = !1;
    function o() {
      if (!i) {
        if (e("throwDeprecation"))
          throw new Error(r);
        e("traceDeprecation") ? console.trace(r) : console.warn(r), i = !0;
      }
      return n.apply(this, arguments);
    }
    return o;
  }
  function e(n) {
    try {
      if (!On.localStorage) return !1;
    } catch {
      return !1;
    }
    var r = On.localStorage[n];
    return r == null ? !1 : String(r).toLowerCase() === "true";
  }
  return t1;
}
var n1, KC;
function a8() {
  if (KC) return n1;
  KC = 1;
  var t = qg();
  n1 = y;
  function e($) {
    var _ = this;
    this.next = null, this.entry = null, this.finish = function() {
      K(_, $);
    };
  }
  var n = !process.browser && ["v0.10", "v0.9."].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : t.nextTick, r;
  y.WritableState = m;
  var i = Object.create(Td());
  i.inherits = fo();
  var o = {
    deprecate: s8()
  }, s = r8(), a = Hg().Buffer, c = (typeof On < "u" ? On : typeof window < "u" ? window : typeof self < "u" ? self : {}).Uint8Array || function() {
  };
  function u($) {
    return a.from($);
  }
  function l($) {
    return a.isBuffer($) || $ instanceof c;
  }
  var d = i8();
  i.inherits(y, s);
  function f() {
  }
  function m($, _) {
    r = r || Ya(), $ = $ || {};
    var I = _ instanceof r;
    this.objectMode = !!$.objectMode, I && (this.objectMode = this.objectMode || !!$.writableObjectMode);
    var N = $.highWaterMark, U = $.writableHighWaterMark, C = this.objectMode ? 16 : 16 * 1024;
    N || N === 0 ? this.highWaterMark = N : I && (U || U === 0) ? this.highWaterMark = U : this.highWaterMark = C, this.highWaterMark = Math.floor(this.highWaterMark), this.finalCalled = !1, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1, this.destroyed = !1;
    var L = $.decodeStrings === !1;
    this.decodeStrings = !L, this.defaultEncoding = $.defaultEncoding || "utf8", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = function(k) {
      q(_, k);
    }, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = !1, this.errorEmitted = !1, this.bufferedRequestCount = 0, this.corkedRequestsFree = new e(this);
  }
  m.prototype.getBuffer = function() {
    for (var _ = this.bufferedRequest, I = []; _; )
      I.push(_), _ = _.next;
    return I;
  }, (function() {
    try {
      Object.defineProperty(m.prototype, "buffer", {
        get: o.deprecate(function() {
          return this.getBuffer();
        }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003")
      });
    } catch {
    }
  })();
  var h;
  typeof Symbol == "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] == "function" ? (h = Function.prototype[Symbol.hasInstance], Object.defineProperty(y, Symbol.hasInstance, {
    value: function($) {
      return h.call(this, $) ? !0 : this !== y ? !1 : $ && $._writableState instanceof m;
    }
  })) : h = function($) {
    return $ instanceof this;
  };
  function y($) {
    if (r = r || Ya(), !h.call(y, this) && !(this instanceof r))
      return new y($);
    this._writableState = new m($, this), this.writable = !0, $ && (typeof $.write == "function" && (this._write = $.write), typeof $.writev == "function" && (this._writev = $.writev), typeof $.destroy == "function" && (this._destroy = $.destroy), typeof $.final == "function" && (this._final = $.final)), s.call(this);
  }
  y.prototype.pipe = function() {
    this.emit("error", new Error("Cannot pipe, not readable"));
  };
  function x($, _) {
    var I = new Error("write after end");
    $.emit("error", I), t.nextTick(_, I);
  }
  function g($, _, I, N) {
    var U = !0, C = !1;
    return I === null ? C = new TypeError("May not write null values to stream") : typeof I != "string" && I !== void 0 && !_.objectMode && (C = new TypeError("Invalid non-string/buffer chunk")), C && ($.emit("error", C), t.nextTick(N, C), U = !1), U;
  }
  y.prototype.write = function($, _, I) {
    var N = this._writableState, U = !1, C = !N.objectMode && l($);
    return C && !a.isBuffer($) && ($ = u($)), typeof _ == "function" && (I = _, _ = null), C ? _ = "buffer" : _ || (_ = N.defaultEncoding), typeof I != "function" && (I = f), N.ended ? x(this, I) : (C || g(this, N, $, I)) && (N.pendingcb++, U = S(this, N, C, $, _, I)), U;
  }, y.prototype.cork = function() {
    var $ = this._writableState;
    $.corked++;
  }, y.prototype.uncork = function() {
    var $ = this._writableState;
    $.corked && ($.corked--, !$.writing && !$.corked && !$.bufferProcessing && $.bufferedRequest && G(this, $));
  }, y.prototype.setDefaultEncoding = function(_) {
    if (typeof _ == "string" && (_ = _.toLowerCase()), !(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((_ + "").toLowerCase()) > -1)) throw new TypeError("Unknown encoding: " + _);
    return this._writableState.defaultEncoding = _, this;
  };
  function v($, _, I) {
    return !$.objectMode && $.decodeStrings !== !1 && typeof _ == "string" && (_ = a.from(_, I)), _;
  }
  Object.defineProperty(y.prototype, "writableHighWaterMark", {
    // making it explicit this property is not enumerable
    // because otherwise some prototype manipulation in
    // userland will fail
    enumerable: !1,
    get: function() {
      return this._writableState.highWaterMark;
    }
  });
  function S($, _, I, N, U, C) {
    if (!I) {
      var L = v(_, N, U);
      N !== L && (I = !0, U = "buffer", N = L);
    }
    var k = _.objectMode ? 1 : N.length;
    _.length += k;
    var M = _.length < _.highWaterMark;
    if (M || (_.needDrain = !0), _.writing || _.corked) {
      var F = _.lastBufferedRequest;
      _.lastBufferedRequest = {
        chunk: N,
        encoding: U,
        isBuf: I,
        callback: C,
        next: null
      }, F ? F.next = _.lastBufferedRequest : _.bufferedRequest = _.lastBufferedRequest, _.bufferedRequestCount += 1;
    } else
      E($, _, !1, k, N, U, C);
    return M;
  }
  function E($, _, I, N, U, C, L) {
    _.writelen = N, _.writecb = L, _.writing = !0, _.sync = !0, I ? $._writev(U, _.onwrite) : $._write(U, C, _.onwrite), _.sync = !1;
  }
  function T($, _, I, N, U) {
    --_.pendingcb, I ? (t.nextTick(U, N), t.nextTick(X, $, _), $._writableState.errorEmitted = !0, $.emit("error", N)) : (U(N), $._writableState.errorEmitted = !0, $.emit("error", N), X($, _));
  }
  function j($) {
    $.writing = !1, $.writecb = null, $.length -= $.writelen, $.writelen = 0;
  }
  function q($, _) {
    var I = $._writableState, N = I.sync, U = I.writecb;
    if (j(I), _) T($, I, N, _, U);
    else {
      var C = J(I);
      !C && !I.corked && !I.bufferProcessing && I.bufferedRequest && G($, I), N ? n(Y, $, I, C, U) : Y($, I, C, U);
    }
  }
  function Y($, _, I, N) {
    I || W($, _), _.pendingcb--, N(), X($, _);
  }
  function W($, _) {
    _.length === 0 && _.needDrain && (_.needDrain = !1, $.emit("drain"));
  }
  function G($, _) {
    _.bufferProcessing = !0;
    var I = _.bufferedRequest;
    if ($._writev && I && I.next) {
      var N = _.bufferedRequestCount, U = new Array(N), C = _.corkedRequestsFree;
      C.entry = I;
      for (var L = 0, k = !0; I; )
        U[L] = I, I.isBuf || (k = !1), I = I.next, L += 1;
      U.allBuffers = k, E($, _, !0, _.length, U, "", C.finish), _.pendingcb++, _.lastBufferedRequest = null, C.next ? (_.corkedRequestsFree = C.next, C.next = null) : _.corkedRequestsFree = new e(_), _.bufferedRequestCount = 0;
    } else {
      for (; I; ) {
        var M = I.chunk, F = I.encoding, A = I.callback, O = _.objectMode ? 1 : M.length;
        if (E($, _, !1, O, M, F, A), I = I.next, _.bufferedRequestCount--, _.writing)
          break;
      }
      I === null && (_.lastBufferedRequest = null);
    }
    _.bufferedRequest = I, _.bufferProcessing = !1;
  }
  y.prototype._write = function($, _, I) {
    I(new Error("_write() is not implemented"));
  }, y.prototype._writev = null, y.prototype.end = function($, _, I) {
    var N = this._writableState;
    typeof $ == "function" ? (I = $, $ = null, _ = null) : typeof _ == "function" && (I = _, _ = null), $ != null && this.write($, _), N.corked && (N.corked = 1, this.uncork()), N.ending || V(this, N, I);
  };
  function J($) {
    return $.ending && $.length === 0 && $.bufferedRequest === null && !$.finished && !$.writing;
  }
  function B($, _) {
    $._final(function(I) {
      _.pendingcb--, I && $.emit("error", I), _.prefinished = !0, $.emit("prefinish"), X($, _);
    });
  }
  function D($, _) {
    !_.prefinished && !_.finalCalled && (typeof $._final == "function" ? (_.pendingcb++, _.finalCalled = !0, t.nextTick(B, $, _)) : (_.prefinished = !0, $.emit("prefinish")));
  }
  function X($, _) {
    var I = J(_);
    return I && (D($, _), _.pendingcb === 0 && (_.finished = !0, $.emit("finish"))), I;
  }
  function V($, _, I) {
    _.ending = !0, X($, _), I && (_.finished ? t.nextTick(I) : $.once("finish", I)), _.ended = !0, $.writable = !1;
  }
  function K($, _, I) {
    var N = $.entry;
    for ($.entry = null; N; ) {
      var U = N.callback;
      _.pendingcb--, U(I), N = N.next;
    }
    _.corkedRequestsFree.next = $;
  }
  return Object.defineProperty(y.prototype, "destroyed", {
    get: function() {
      return this._writableState === void 0 ? !1 : this._writableState.destroyed;
    },
    set: function($) {
      this._writableState && (this._writableState.destroyed = $);
    }
  }), y.prototype.destroy = d.destroy, y.prototype._undestroy = d.undestroy, y.prototype._destroy = function($, _) {
    this.end(), _($);
  }, n1;
}
var r1, VC;
function Ya() {
  if (VC) return r1;
  VC = 1;
  var t = qg(), e = Object.keys || function(d) {
    var f = [];
    for (var m in d)
      f.push(m);
    return f;
  };
  r1 = c;
  var n = Object.create(Td());
  n.inherits = fo();
  var r = o8(), i = a8();
  n.inherits(c, r);
  for (var o = e(i.prototype), s = 0; s < o.length; s++) {
    var a = o[s];
    c.prototype[a] || (c.prototype[a] = i.prototype[a]);
  }
  function c(d) {
    if (!(this instanceof c)) return new c(d);
    r.call(this, d), i.call(this, d), d && d.readable === !1 && (this.readable = !1), d && d.writable === !1 && (this.writable = !1), this.allowHalfOpen = !0, d && d.allowHalfOpen === !1 && (this.allowHalfOpen = !1), this.once("end", u);
  }
  Object.defineProperty(c.prototype, "writableHighWaterMark", {
    // making it explicit this property is not enumerable
    // because otherwise some prototype manipulation in
    // userland will fail
    enumerable: !1,
    get: function() {
      return this._writableState.highWaterMark;
    }
  });
  function u() {
    this.allowHalfOpen || this._writableState.ended || t.nextTick(l, this);
  }
  function l(d) {
    d.end();
  }
  return Object.defineProperty(c.prototype, "destroyed", {
    get: function() {
      return this._readableState === void 0 || this._writableState === void 0 ? !1 : this._readableState.destroyed && this._writableState.destroyed;
    },
    set: function(d) {
      this._readableState === void 0 || this._writableState === void 0 || (this._readableState.destroyed = d, this._writableState.destroyed = d);
    }
  }), c.prototype._destroy = function(d, f) {
    this.push(null), this.end(), t.nextTick(f, d);
  }, r1;
}
var i1, YC;
function sW() {
  return YC || (YC = 1, i1 = Ya()), i1;
}
var Gf = { exports: {} };
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
var JC;
function Wg() {
  return JC || (JC = 1, (function(t, e) {
    var n = pa, r = n.Buffer;
    function i(s, a) {
      for (var c in s)
        a[c] = s[c];
    }
    r.from && r.alloc && r.allocUnsafe && r.allocUnsafeSlow ? t.exports = n : (i(n, e), e.Buffer = o);
    function o(s, a, c) {
      return r(s, a, c);
    }
    o.prototype = Object.create(r.prototype), i(r, o), o.from = function(s, a, c) {
      if (typeof s == "number")
        throw new TypeError("Argument must not be a number");
      return r(s, a, c);
    }, o.alloc = function(s, a, c) {
      if (typeof s != "number")
        throw new TypeError("Argument must be a number");
      var u = r(s);
      return a !== void 0 ? typeof c == "string" ? u.fill(a, c) : u.fill(a) : u.fill(0), u;
    }, o.allocUnsafe = function(s) {
      if (typeof s != "number")
        throw new TypeError("Argument must be a number");
      return r(s);
    }, o.allocUnsafeSlow = function(s) {
      if (typeof s != "number")
        throw new TypeError("Argument must be a number");
      return n.SlowBuffer(s);
    };
  })(Gf, Gf.exports)), Gf.exports;
}
var o1, XC;
function aW() {
  if (XC) return o1;
  XC = 1;
  var t = sW(), e = _n, n = Wg().Buffer;
  function r(i) {
    if (!(this instanceof r))
      return new r(i);
    if (this._bufs = [], this.length = 0, typeof i == "function") {
      this._callback = i;
      var o = function(a) {
        this._callback && (this._callback(a), this._callback = null);
      }.bind(this);
      this.on("pipe", function(a) {
        a.on("error", o);
      }), this.on("unpipe", function(a) {
        a.removeListener("error", o);
      });
    } else
      this.append(i);
    t.call(this);
  }
  return e.inherits(r, t), r.prototype._offset = function(o) {
    var s = 0, a = 0, c;
    if (o === 0) return [0, 0];
    for (; a < this._bufs.length; a++) {
      if (c = s + this._bufs[a].length, o < c || a == this._bufs.length - 1)
        return [a, o - s];
      s = c;
    }
  }, r.prototype.append = function(o) {
    var s = 0;
    if (n.isBuffer(o))
      this._appendBuffer(o);
    else if (Array.isArray(o))
      for (; s < o.length; s++)
        this.append(o[s]);
    else if (o instanceof r)
      for (; s < o._bufs.length; s++)
        this.append(o._bufs[s]);
    else o != null && (typeof o == "number" && (o = o.toString()), this._appendBuffer(n.from(o)));
    return this;
  }, r.prototype._appendBuffer = function(o) {
    this._bufs.push(o), this.length += o.length;
  }, r.prototype._write = function(o, s, a) {
    this._appendBuffer(o), typeof a == "function" && a();
  }, r.prototype._read = function(o) {
    if (!this.length)
      return this.push(null);
    o = Math.min(o, this.length), this.push(this.slice(0, o)), this.consume(o);
  }, r.prototype.end = function(o) {
    t.prototype.end.call(this, o), this._callback && (this._callback(null, this.slice()), this._callback = null);
  }, r.prototype.get = function(o) {
    return this.slice(o, o + 1)[0];
  }, r.prototype.slice = function(o, s) {
    return typeof o == "number" && o < 0 && (o += this.length), typeof s == "number" && s < 0 && (s += this.length), this.copy(null, 0, o, s);
  }, r.prototype.copy = function(o, s, a, c) {
    if ((typeof a != "number" || a < 0) && (a = 0), (typeof c != "number" || c > this.length) && (c = this.length), a >= this.length || c <= 0)
      return o || n.alloc(0);
    var u = !!o, l = this._offset(a), d = c - a, f = d, m = u && s || 0, h = l[1], y, x;
    if (a === 0 && c == this.length) {
      if (!u)
        return this._bufs.length === 1 ? this._bufs[0] : n.concat(this._bufs, this.length);
      for (x = 0; x < this._bufs.length; x++)
        this._bufs[x].copy(o, m), m += this._bufs[x].length;
      return o;
    }
    if (f <= this._bufs[l[0]].length - h)
      return u ? this._bufs[l[0]].copy(o, s, h, h + f) : this._bufs[l[0]].slice(h, h + f);
    for (u || (o = n.allocUnsafe(d)), x = l[0]; x < this._bufs.length; x++) {
      if (y = this._bufs[x].length - h, f > y)
        this._bufs[x].copy(o, m, h), m += y;
      else {
        this._bufs[x].copy(o, m, h, h + f), m += y;
        break;
      }
      f -= y, h && (h = 0);
    }
    return o.length > m ? o.slice(0, m) : o;
  }, r.prototype.shallowSlice = function(o, s) {
    o = o || 0, s = s || this.length, o < 0 && (o += this.length), s < 0 && (s += this.length);
    var a = this._offset(o), c = this._offset(s), u = this._bufs.slice(a[0], c[0] + 1);
    return c[1] == 0 ? u.pop() : u[u.length - 1] = u[u.length - 1].slice(0, c[1]), a[1] != 0 && (u[0] = u[0].slice(a[1])), new r(u);
  }, r.prototype.toString = function(o, s, a) {
    return this.slice(s, a).toString(o);
  }, r.prototype.consume = function(o) {
    if (o = Math.trunc(o), Number.isNaN(o) || o <= 0) return this;
    for (; this._bufs.length; )
      if (o >= this._bufs[0].length)
        o -= this._bufs[0].length, this.length -= this._bufs[0].length, this._bufs.shift();
      else {
        this._bufs[0] = this._bufs[0].slice(o), this.length -= o;
        break;
      }
    return this;
  }, r.prototype.duplicate = function() {
    for (var o = 0, s = new r(); o < this._bufs.length; o++)
      s.append(this._bufs[o]);
    return s;
  }, r.prototype.destroy = function() {
    this._bufs.length = 0, this.length = 0, this.push(null);
  }, (function() {
    var i = {
      readDoubleBE: 8,
      readDoubleLE: 8,
      readFloatBE: 4,
      readFloatLE: 4,
      readInt32BE: 4,
      readInt32LE: 4,
      readUInt32BE: 4,
      readUInt32LE: 4,
      readInt16BE: 2,
      readInt16LE: 2,
      readUInt16BE: 2,
      readUInt16LE: 2,
      readInt8: 1,
      readUInt8: 1
    };
    for (var o in i)
      (function(s) {
        r.prototype[s] = function(a) {
          return this.slice(a, a + i[s])[s](0);
        };
      })(o);
  })(), o1 = r, o1;
}
var s1, ZC;
function c8() {
  if (ZC) return s1;
  ZC = 1, s1 = e;
  var t = Object.prototype.hasOwnProperty;
  function e() {
    for (var n = {}, r = 0; r < arguments.length; r++) {
      var i = arguments[r];
      for (var o in i)
        t.call(i, o) && (n[o] = i[o]);
    }
    return n;
  }
  return s1;
}
var Ta = {}, a1, e3;
function cW() {
  if (e3) return a1;
  e3 = 1;
  var t = {}.toString;
  return a1 = Array.isArray || function(e) {
    return t.call(e) == "[object Array]";
  }, a1;
}
var c1, t3;
function kd() {
  return t3 || (t3 = 1, c1 = TypeError), c1;
}
var u1, n3;
function u8() {
  return n3 || (n3 = 1, u1 = Object), u1;
}
var l1, r3;
function uW() {
  return r3 || (r3 = 1, l1 = Error), l1;
}
var p1, i3;
function lW() {
  return i3 || (i3 = 1, p1 = EvalError), p1;
}
var d1, o3;
function pW() {
  return o3 || (o3 = 1, d1 = RangeError), d1;
}
var f1, s3;
function dW() {
  return s3 || (s3 = 1, f1 = ReferenceError), f1;
}
var h1, a3;
function l8() {
  return a3 || (a3 = 1, h1 = SyntaxError), h1;
}
var m1, c3;
function fW() {
  return c3 || (c3 = 1, m1 = URIError), m1;
}
var g1, u3;
function hW() {
  return u3 || (u3 = 1, g1 = Math.abs), g1;
}
var y1, l3;
function mW() {
  return l3 || (l3 = 1, y1 = Math.floor), y1;
}
var v1, p3;
function gW() {
  return p3 || (p3 = 1, v1 = Math.max), v1;
}
var b1, d3;
function yW() {
  return d3 || (d3 = 1, b1 = Math.min), b1;
}
var x1, f3;
function vW() {
  return f3 || (f3 = 1, x1 = Math.pow), x1;
}
var w1, h3;
function bW() {
  return h3 || (h3 = 1, w1 = Math.round), w1;
}
var S1, m3;
function xW() {
  return m3 || (m3 = 1, S1 = Number.isNaN || function(e) {
    return e !== e;
  }), S1;
}
var _1, g3;
function wW() {
  if (g3) return _1;
  g3 = 1;
  var t = /* @__PURE__ */ xW();
  return _1 = function(n) {
    return t(n) || n === 0 ? n : n < 0 ? -1 : 1;
  }, _1;
}
var E1, y3;
function SW() {
  return y3 || (y3 = 1, E1 = Object.getOwnPropertyDescriptor), E1;
}
var A1, v3;
function Nd() {
  if (v3) return A1;
  v3 = 1;
  var t = /* @__PURE__ */ SW();
  if (t)
    try {
      t([], "length");
    } catch {
      t = null;
    }
  return A1 = t, A1;
}
var I1, b3;
function zg() {
  if (b3) return I1;
  b3 = 1;
  var t = Object.defineProperty || !1;
  if (t)
    try {
      t({}, "a", { value: 1 });
    } catch {
      t = !1;
    }
  return I1 = t, I1;
}
var C1, x3;
function p8() {
  return x3 || (x3 = 1, C1 = function() {
    if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
      return !1;
    if (typeof Symbol.iterator == "symbol")
      return !0;
    var e = {}, n = Symbol("test"), r = Object(n);
    if (typeof n == "string" || Object.prototype.toString.call(n) !== "[object Symbol]" || Object.prototype.toString.call(r) !== "[object Symbol]")
      return !1;
    var i = 42;
    e[n] = i;
    for (var o in e)
      return !1;
    if (typeof Object.keys == "function" && Object.keys(e).length !== 0 || typeof Object.getOwnPropertyNames == "function" && Object.getOwnPropertyNames(e).length !== 0)
      return !1;
    var s = Object.getOwnPropertySymbols(e);
    if (s.length !== 1 || s[0] !== n || !Object.prototype.propertyIsEnumerable.call(e, n))
      return !1;
    if (typeof Object.getOwnPropertyDescriptor == "function") {
      var a = (
        /** @type {PropertyDescriptor} */
        Object.getOwnPropertyDescriptor(e, n)
      );
      if (a.value !== i || a.enumerable !== !0)
        return !1;
    }
    return !0;
  }), C1;
}
var T1, w3;
function _W() {
  if (w3) return T1;
  w3 = 1;
  var t = typeof Symbol < "u" && Symbol, e = p8();
  return T1 = function() {
    return typeof t != "function" || typeof Symbol != "function" || typeof t("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : e();
  }, T1;
}
var k1, S3;
function d8() {
  return S3 || (S3 = 1, k1 = typeof Reflect < "u" && Reflect.getPrototypeOf || null), k1;
}
var N1, _3;
function f8() {
  if (_3) return N1;
  _3 = 1;
  var t = /* @__PURE__ */ u8();
  return N1 = t.getPrototypeOf || null, N1;
}
var P1, E3;
function EW() {
  if (E3) return P1;
  E3 = 1;
  var t = "Function.prototype.bind called on incompatible ", e = Object.prototype.toString, n = Math.max, r = "[object Function]", i = function(c, u) {
    for (var l = [], d = 0; d < c.length; d += 1)
      l[d] = c[d];
    for (var f = 0; f < u.length; f += 1)
      l[f + c.length] = u[f];
    return l;
  }, o = function(c, u) {
    for (var l = [], d = u, f = 0; d < c.length; d += 1, f += 1)
      l[f] = c[d];
    return l;
  }, s = function(a, c) {
    for (var u = "", l = 0; l < a.length; l += 1)
      u += a[l], l + 1 < a.length && (u += c);
    return u;
  };
  return P1 = function(c) {
    var u = this;
    if (typeof u != "function" || e.apply(u) !== r)
      throw new TypeError(t + u);
    for (var l = o(arguments, 1), d, f = function() {
      if (this instanceof d) {
        var g = u.apply(
          this,
          i(l, arguments)
        );
        return Object(g) === g ? g : this;
      }
      return u.apply(
        c,
        i(l, arguments)
      );
    }, m = n(0, u.length - l.length), h = [], y = 0; y < m; y++)
      h[y] = "$" + y;
    if (d = Function("binder", "return function (" + s(h, ",") + "){ return binder.apply(this,arguments); }")(f), u.prototype) {
      var x = function() {
      };
      x.prototype = u.prototype, d.prototype = new x(), x.prototype = null;
    }
    return d;
  }, P1;
}
var D1, A3;
function Pd() {
  if (A3) return D1;
  A3 = 1;
  var t = EW();
  return D1 = Function.prototype.bind || t, D1;
}
var F1, I3;
function SE() {
  return I3 || (I3 = 1, F1 = Function.prototype.call), F1;
}
var O1, C3;
function _E() {
  return C3 || (C3 = 1, O1 = Function.prototype.apply), O1;
}
var M1, T3;
function AW() {
  return T3 || (T3 = 1, M1 = typeof Reflect < "u" && Reflect && Reflect.apply), M1;
}
var R1, k3;
function h8() {
  if (k3) return R1;
  k3 = 1;
  var t = Pd(), e = _E(), n = SE(), r = AW();
  return R1 = r || t.call(n, e), R1;
}
var B1, N3;
function EE() {
  if (N3) return B1;
  N3 = 1;
  var t = Pd(), e = /* @__PURE__ */ kd(), n = SE(), r = h8();
  return B1 = function(o) {
    if (o.length < 1 || typeof o[0] != "function")
      throw new e("a function is required");
    return r(t, n, o);
  }, B1;
}
var U1, P3;
function IW() {
  if (P3) return U1;
  P3 = 1;
  var t = EE(), e = /* @__PURE__ */ Nd(), n;
  try {
    n = /** @type {{ __proto__?: typeof Array.prototype }} */
    [].__proto__ === Array.prototype;
  } catch (s) {
    if (!s || typeof s != "object" || !("code" in s) || s.code !== "ERR_PROTO_ACCESS")
      throw s;
  }
  var r = !!n && e && e(
    Object.prototype,
    /** @type {keyof typeof Object.prototype} */
    "__proto__"
  ), i = Object, o = i.getPrototypeOf;
  return U1 = r && typeof r.get == "function" ? t([r.get]) : typeof o == "function" ? (
    /** @type {import('./get')} */
    function(a) {
      return o(a == null ? a : i(a));
    }
  ) : !1, U1;
}
var L1, D3;
function m8() {
  if (D3) return L1;
  D3 = 1;
  var t = d8(), e = f8(), n = /* @__PURE__ */ IW();
  return L1 = t ? function(i) {
    return t(i);
  } : e ? function(i) {
    if (!i || typeof i != "object" && typeof i != "function")
      throw new TypeError("getProto: not an object");
    return e(i);
  } : n ? function(i) {
    return n(i);
  } : null, L1;
}
var j1, F3;
function CW() {
  if (F3) return j1;
  F3 = 1;
  var t = Function.prototype.call, e = Object.prototype.hasOwnProperty, n = Pd();
  return j1 = n.call(t, e), j1;
}
var Q1, O3;
function g8() {
  if (O3) return Q1;
  O3 = 1;
  var t, e = /* @__PURE__ */ u8(), n = /* @__PURE__ */ uW(), r = /* @__PURE__ */ lW(), i = /* @__PURE__ */ pW(), o = /* @__PURE__ */ dW(), s = /* @__PURE__ */ l8(), a = /* @__PURE__ */ kd(), c = /* @__PURE__ */ fW(), u = /* @__PURE__ */ hW(), l = /* @__PURE__ */ mW(), d = /* @__PURE__ */ gW(), f = /* @__PURE__ */ yW(), m = /* @__PURE__ */ vW(), h = /* @__PURE__ */ bW(), y = /* @__PURE__ */ wW(), x = Function, g = function(Z) {
    try {
      return x('"use strict"; return (' + Z + ").constructor;")();
    } catch {
    }
  }, v = /* @__PURE__ */ Nd(), S = /* @__PURE__ */ zg(), E = function() {
    throw new a();
  }, T = v ? (function() {
    try {
      return arguments.callee, E;
    } catch {
      try {
        return v(arguments, "callee").get;
      } catch {
        return E;
      }
    }
  })() : E, j = _W()(), q = m8(), Y = f8(), W = d8(), G = _E(), J = SE(), B = {}, D = typeof Uint8Array > "u" || !q ? t : q(Uint8Array), X = {
    __proto__: null,
    "%AggregateError%": typeof AggregateError > "u" ? t : AggregateError,
    "%Array%": Array,
    "%ArrayBuffer%": typeof ArrayBuffer > "u" ? t : ArrayBuffer,
    "%ArrayIteratorPrototype%": j && q ? q([][Symbol.iterator]()) : t,
    "%AsyncFromSyncIteratorPrototype%": t,
    "%AsyncFunction%": B,
    "%AsyncGenerator%": B,
    "%AsyncGeneratorFunction%": B,
    "%AsyncIteratorPrototype%": B,
    "%Atomics%": typeof Atomics > "u" ? t : Atomics,
    "%BigInt%": typeof BigInt > "u" ? t : BigInt,
    "%BigInt64Array%": typeof BigInt64Array > "u" ? t : BigInt64Array,
    "%BigUint64Array%": typeof BigUint64Array > "u" ? t : BigUint64Array,
    "%Boolean%": Boolean,
    "%DataView%": typeof DataView > "u" ? t : DataView,
    "%Date%": Date,
    "%decodeURI%": decodeURI,
    "%decodeURIComponent%": decodeURIComponent,
    "%encodeURI%": encodeURI,
    "%encodeURIComponent%": encodeURIComponent,
    "%Error%": n,
    "%eval%": eval,
    // eslint-disable-line no-eval
    "%EvalError%": r,
    "%Float16Array%": typeof Float16Array > "u" ? t : Float16Array,
    "%Float32Array%": typeof Float32Array > "u" ? t : Float32Array,
    "%Float64Array%": typeof Float64Array > "u" ? t : Float64Array,
    "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? t : FinalizationRegistry,
    "%Function%": x,
    "%GeneratorFunction%": B,
    "%Int8Array%": typeof Int8Array > "u" ? t : Int8Array,
    "%Int16Array%": typeof Int16Array > "u" ? t : Int16Array,
    "%Int32Array%": typeof Int32Array > "u" ? t : Int32Array,
    "%isFinite%": isFinite,
    "%isNaN%": isNaN,
    "%IteratorPrototype%": j && q ? q(q([][Symbol.iterator]())) : t,
    "%JSON%": typeof JSON == "object" ? JSON : t,
    "%Map%": typeof Map > "u" ? t : Map,
    "%MapIteratorPrototype%": typeof Map > "u" || !j || !q ? t : q((/* @__PURE__ */ new Map())[Symbol.iterator]()),
    "%Math%": Math,
    "%Number%": Number,
    "%Object%": e,
    "%Object.getOwnPropertyDescriptor%": v,
    "%parseFloat%": parseFloat,
    "%parseInt%": parseInt,
    "%Promise%": typeof Promise > "u" ? t : Promise,
    "%Proxy%": typeof Proxy > "u" ? t : Proxy,
    "%RangeError%": i,
    "%ReferenceError%": o,
    "%Reflect%": typeof Reflect > "u" ? t : Reflect,
    "%RegExp%": RegExp,
    "%Set%": typeof Set > "u" ? t : Set,
    "%SetIteratorPrototype%": typeof Set > "u" || !j || !q ? t : q((/* @__PURE__ */ new Set())[Symbol.iterator]()),
    "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? t : SharedArrayBuffer,
    "%String%": String,
    "%StringIteratorPrototype%": j && q ? q(""[Symbol.iterator]()) : t,
    "%Symbol%": j ? Symbol : t,
    "%SyntaxError%": s,
    "%ThrowTypeError%": T,
    "%TypedArray%": D,
    "%TypeError%": a,
    "%Uint8Array%": typeof Uint8Array > "u" ? t : Uint8Array,
    "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? t : Uint8ClampedArray,
    "%Uint16Array%": typeof Uint16Array > "u" ? t : Uint16Array,
    "%Uint32Array%": typeof Uint32Array > "u" ? t : Uint32Array,
    "%URIError%": c,
    "%WeakMap%": typeof WeakMap > "u" ? t : WeakMap,
    "%WeakRef%": typeof WeakRef > "u" ? t : WeakRef,
    "%WeakSet%": typeof WeakSet > "u" ? t : WeakSet,
    "%Function.prototype.call%": J,
    "%Function.prototype.apply%": G,
    "%Object.defineProperty%": S,
    "%Object.getPrototypeOf%": Y,
    "%Math.abs%": u,
    "%Math.floor%": l,
    "%Math.max%": d,
    "%Math.min%": f,
    "%Math.pow%": m,
    "%Math.round%": h,
    "%Math.sign%": y,
    "%Reflect.getPrototypeOf%": W
  };
  if (q)
    try {
      null.error;
    } catch (Z) {
      var V = q(q(Z));
      X["%Error.prototype%"] = V;
    }
  var K = function Z(ee) {
    var P;
    if (ee === "%AsyncFunction%")
      P = g("async function () {}");
    else if (ee === "%GeneratorFunction%")
      P = g("function* () {}");
    else if (ee === "%AsyncGeneratorFunction%")
      P = g("async function* () {}");
    else if (ee === "%AsyncGenerator%") {
      var Q = Z("%AsyncGeneratorFunction%");
      Q && (P = Q.prototype);
    } else if (ee === "%AsyncIteratorPrototype%") {
      var z = Z("%AsyncGenerator%");
      z && q && (P = q(z.prototype));
    }
    return X[ee] = P, P;
  }, $ = {
    __proto__: null,
    "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
    "%ArrayPrototype%": ["Array", "prototype"],
    "%ArrayProto_entries%": ["Array", "prototype", "entries"],
    "%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
    "%ArrayProto_keys%": ["Array", "prototype", "keys"],
    "%ArrayProto_values%": ["Array", "prototype", "values"],
    "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
    "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
    "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"],
    "%BooleanPrototype%": ["Boolean", "prototype"],
    "%DataViewPrototype%": ["DataView", "prototype"],
    "%DatePrototype%": ["Date", "prototype"],
    "%ErrorPrototype%": ["Error", "prototype"],
    "%EvalErrorPrototype%": ["EvalError", "prototype"],
    "%Float32ArrayPrototype%": ["Float32Array", "prototype"],
    "%Float64ArrayPrototype%": ["Float64Array", "prototype"],
    "%FunctionPrototype%": ["Function", "prototype"],
    "%Generator%": ["GeneratorFunction", "prototype"],
    "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"],
    "%Int8ArrayPrototype%": ["Int8Array", "prototype"],
    "%Int16ArrayPrototype%": ["Int16Array", "prototype"],
    "%Int32ArrayPrototype%": ["Int32Array", "prototype"],
    "%JSONParse%": ["JSON", "parse"],
    "%JSONStringify%": ["JSON", "stringify"],
    "%MapPrototype%": ["Map", "prototype"],
    "%NumberPrototype%": ["Number", "prototype"],
    "%ObjectPrototype%": ["Object", "prototype"],
    "%ObjProto_toString%": ["Object", "prototype", "toString"],
    "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
    "%PromisePrototype%": ["Promise", "prototype"],
    "%PromiseProto_then%": ["Promise", "prototype", "then"],
    "%Promise_all%": ["Promise", "all"],
    "%Promise_reject%": ["Promise", "reject"],
    "%Promise_resolve%": ["Promise", "resolve"],
    "%RangeErrorPrototype%": ["RangeError", "prototype"],
    "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
    "%RegExpPrototype%": ["RegExp", "prototype"],
    "%SetPrototype%": ["Set", "prototype"],
    "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
    "%StringPrototype%": ["String", "prototype"],
    "%SymbolPrototype%": ["Symbol", "prototype"],
    "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
    "%TypedArrayPrototype%": ["TypedArray", "prototype"],
    "%TypeErrorPrototype%": ["TypeError", "prototype"],
    "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
    "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
    "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
    "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
    "%URIErrorPrototype%": ["URIError", "prototype"],
    "%WeakMapPrototype%": ["WeakMap", "prototype"],
    "%WeakSetPrototype%": ["WeakSet", "prototype"]
  }, _ = Pd(), I = /* @__PURE__ */ CW(), N = _.call(J, Array.prototype.concat), U = _.call(G, Array.prototype.splice), C = _.call(J, String.prototype.replace), L = _.call(J, String.prototype.slice), k = _.call(J, RegExp.prototype.exec), M = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, F = /\\(\\)?/g, A = function(ee) {
    var P = L(ee, 0, 1), Q = L(ee, -1);
    if (P === "%" && Q !== "%")
      throw new s("invalid intrinsic syntax, expected closing `%`");
    if (Q === "%" && P !== "%")
      throw new s("invalid intrinsic syntax, expected opening `%`");
    var z = [];
    return C(ee, M, function(se, ae, ie, we) {
      z[z.length] = ie ? C(we, F, "$1") : ae || se;
    }), z;
  }, O = function(ee, P) {
    var Q = ee, z;
    if (I($, Q) && (z = $[Q], Q = "%" + z[0] + "%"), I(X, Q)) {
      var se = X[Q];
      if (se === B && (se = K(Q)), typeof se > "u" && !P)
        throw new a("intrinsic " + ee + " exists, but is not available. Please file an issue!");
      return {
        alias: z,
        name: Q,
        value: se
      };
    }
    throw new s("intrinsic " + ee + " does not exist!");
  };
  return Q1 = function(ee, P) {
    if (typeof ee != "string" || ee.length === 0)
      throw new a("intrinsic name must be a non-empty string");
    if (arguments.length > 1 && typeof P != "boolean")
      throw new a('"allowMissing" argument must be a boolean');
    if (k(/^%?[^%]*%?$/, ee) === null)
      throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
    var Q = A(ee), z = Q.length > 0 ? Q[0] : "", se = O("%" + z + "%", P), ae = se.name, ie = se.value, we = !1, Oe = se.alias;
    Oe && (z = Oe[0], U(Q, N([0, 1], Oe)));
    for (var He = 1, We = !0; He < Q.length; He += 1) {
      var Ye = Q[He], Ke = L(Ye, 0, 1), nt = L(Ye, -1);
      if ((Ke === '"' || Ke === "'" || Ke === "`" || nt === '"' || nt === "'" || nt === "`") && Ke !== nt)
        throw new s("property names with quotes must have matching quotes");
      if ((Ye === "constructor" || !We) && (we = !0), z += "." + Ye, ae = "%" + z + "%", I(X, ae))
        ie = X[ae];
      else if (ie != null) {
        if (!(Ye in ie)) {
          if (!P)
            throw new a("base intrinsic for " + ee + " exists, but the property is not available.");
          return;
        }
        if (v && He + 1 >= Q.length) {
          var qe = v(ie, Ye);
          We = !!qe, We && "get" in qe && !("originalValue" in qe.get) ? ie = qe.get : ie = ie[Ye];
        } else
          We = I(ie, Ye), ie = ie[Ye];
        We && !we && (X[ae] = ie);
      }
    }
    return ie;
  }, Q1;
}
var $1, M3;
function y8() {
  if (M3) return $1;
  M3 = 1;
  var t = /* @__PURE__ */ g8(), e = EE(), n = e([t("%String.prototype.indexOf%")]);
  return $1 = function(i, o) {
    var s = (
      /** @type {(this: unknown, ...args: unknown[]) => unknown} */
      t(i, !!o)
    );
    return typeof s == "function" && n(i, ".prototype.") > -1 ? e(
      /** @type {const} */
      [s]
    ) : s;
  }, $1;
}
var G1, R3;
function TW() {
  if (R3) return G1;
  R3 = 1;
  var t = Function.prototype.toString, e = typeof Reflect == "object" && Reflect !== null && Reflect.apply, n, r;
  if (typeof e == "function" && typeof Object.defineProperty == "function")
    try {
      n = Object.defineProperty({}, "length", {
        get: function() {
          throw r;
        }
      }), r = {}, e(function() {
        throw 42;
      }, null, n);
    } catch (v) {
      v !== r && (e = null);
    }
  else
    e = null;
  var i = /^\s*class\b/, o = function(S) {
    try {
      var E = t.call(S);
      return i.test(E);
    } catch {
      return !1;
    }
  }, s = function(S) {
    try {
      return o(S) ? !1 : (t.call(S), !0);
    } catch {
      return !1;
    }
  }, a = Object.prototype.toString, c = "[object Object]", u = "[object Function]", l = "[object GeneratorFunction]", d = "[object HTMLAllCollection]", f = "[object HTML document.all class]", m = "[object HTMLCollection]", h = typeof Symbol == "function" && !!Symbol.toStringTag, y = !(0 in [,]), x = function() {
    return !1;
  };
  if (typeof document == "object") {
    var g = document.all;
    a.call(g) === a.call(document.all) && (x = function(S) {
      if ((y || !S) && (typeof S > "u" || typeof S == "object"))
        try {
          var E = a.call(S);
          return (E === d || E === f || E === m || E === c) && S("") == null;
        } catch {
        }
      return !1;
    });
  }
  return G1 = e ? function(S) {
    if (x(S))
      return !0;
    if (!S || typeof S != "function" && typeof S != "object")
      return !1;
    try {
      e(S, null, n);
    } catch (E) {
      if (E !== r)
        return !1;
    }
    return !o(S) && s(S);
  } : function(S) {
    if (x(S))
      return !0;
    if (!S || typeof S != "function" && typeof S != "object")
      return !1;
    if (h)
      return s(S);
    if (o(S))
      return !1;
    var E = a.call(S);
    return E !== u && E !== l && !/^\[object HTML/.test(E) ? !1 : s(S);
  }, G1;
}
var q1, B3;
function kW() {
  if (B3) return q1;
  B3 = 1;
  var t = TW(), e = Object.prototype.toString, n = Object.prototype.hasOwnProperty, r = function(c, u, l) {
    for (var d = 0, f = c.length; d < f; d++)
      n.call(c, d) && (l == null ? u(c[d], d, c) : u.call(l, c[d], d, c));
  }, i = function(c, u, l) {
    for (var d = 0, f = c.length; d < f; d++)
      l == null ? u(c.charAt(d), d, c) : u.call(l, c.charAt(d), d, c);
  }, o = function(c, u, l) {
    for (var d in c)
      n.call(c, d) && (l == null ? u(c[d], d, c) : u.call(l, c[d], d, c));
  };
  function s(a) {
    return e.call(a) === "[object Array]";
  }
  return q1 = function(c, u, l) {
    if (!t(u))
      throw new TypeError("iterator must be a function");
    var d;
    arguments.length >= 3 && (d = l), s(c) ? r(c, u, d) : typeof c == "string" ? i(c, u, d) : o(c, u, d);
  }, q1;
}
var H1, U3;
function NW() {
  return U3 || (U3 = 1, H1 = [
    "Float16Array",
    "Float32Array",
    "Float64Array",
    "Int8Array",
    "Int16Array",
    "Int32Array",
    "Uint8Array",
    "Uint8ClampedArray",
    "Uint16Array",
    "Uint32Array",
    "BigInt64Array",
    "BigUint64Array"
  ]), H1;
}
var W1, L3;
function PW() {
  if (L3) return W1;
  L3 = 1;
  var t = /* @__PURE__ */ NW(), e = typeof globalThis > "u" ? On : globalThis;
  return W1 = function() {
    for (var r = [], i = 0; i < t.length; i++)
      typeof e[t[i]] == "function" && (r[r.length] = t[i]);
    return r;
  }, W1;
}
var z1 = { exports: {} }, K1, j3;
function DW() {
  if (j3) return K1;
  j3 = 1;
  var t = /* @__PURE__ */ zg(), e = /* @__PURE__ */ l8(), n = /* @__PURE__ */ kd(), r = /* @__PURE__ */ Nd();
  return K1 = function(o, s, a) {
    if (!o || typeof o != "object" && typeof o != "function")
      throw new n("`obj` must be an object or a function`");
    if (typeof s != "string" && typeof s != "symbol")
      throw new n("`property` must be a string or a symbol`");
    if (arguments.length > 3 && typeof arguments[3] != "boolean" && arguments[3] !== null)
      throw new n("`nonEnumerable`, if provided, must be a boolean or null");
    if (arguments.length > 4 && typeof arguments[4] != "boolean" && arguments[4] !== null)
      throw new n("`nonWritable`, if provided, must be a boolean or null");
    if (arguments.length > 5 && typeof arguments[5] != "boolean" && arguments[5] !== null)
      throw new n("`nonConfigurable`, if provided, must be a boolean or null");
    if (arguments.length > 6 && typeof arguments[6] != "boolean")
      throw new n("`loose`, if provided, must be a boolean");
    var c = arguments.length > 3 ? arguments[3] : null, u = arguments.length > 4 ? arguments[4] : null, l = arguments.length > 5 ? arguments[5] : null, d = arguments.length > 6 ? arguments[6] : !1, f = !!r && r(o, s);
    if (t)
      t(o, s, {
        configurable: l === null && f ? f.configurable : !l,
        enumerable: c === null && f ? f.enumerable : !c,
        value: a,
        writable: u === null && f ? f.writable : !u
      });
    else if (d || !c && !u && !l)
      o[s] = a;
    else
      throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
  }, K1;
}
var V1, Q3;
function FW() {
  if (Q3) return V1;
  Q3 = 1;
  var t = /* @__PURE__ */ zg(), e = function() {
    return !!t;
  };
  return e.hasArrayLengthDefineBug = function() {
    if (!t)
      return null;
    try {
      return t([], "length", { value: 1 }).length !== 1;
    } catch {
      return !0;
    }
  }, V1 = e, V1;
}
var Y1, $3;
function OW() {
  if ($3) return Y1;
  $3 = 1;
  var t = /* @__PURE__ */ g8(), e = /* @__PURE__ */ DW(), n = /* @__PURE__ */ FW()(), r = /* @__PURE__ */ Nd(), i = /* @__PURE__ */ kd(), o = t("%Math.floor%");
  return Y1 = function(a, c) {
    if (typeof a != "function")
      throw new i("`fn` is not a function");
    if (typeof c != "number" || c < 0 || c > 4294967295 || o(c) !== c)
      throw new i("`length` must be a positive 32-bit integer");
    var u = arguments.length > 2 && !!arguments[2], l = !0, d = !0;
    if ("length" in a && r) {
      var f = r(a, "length");
      f && !f.configurable && (l = !1), f && !f.writable && (d = !1);
    }
    return (l || d || !u) && (n ? e(
      /** @type {Parameters<define>[0]} */
      a,
      "length",
      c,
      !0,
      !0
    ) : e(
      /** @type {Parameters<define>[0]} */
      a,
      "length",
      c
    )), a;
  }, Y1;
}
var J1, G3;
function MW() {
  if (G3) return J1;
  G3 = 1;
  var t = Pd(), e = _E(), n = h8();
  return J1 = function() {
    return n(t, e, arguments);
  }, J1;
}
var q3;
function RW() {
  return q3 || (q3 = 1, (function(t) {
    var e = /* @__PURE__ */ OW(), n = /* @__PURE__ */ zg(), r = EE(), i = MW();
    t.exports = function(s) {
      var a = r(arguments), c = s.length - (arguments.length - 1);
      return e(
        a,
        1 + (c > 0 ? c : 0),
        !0
      );
    }, n ? n(t.exports, "apply", { value: i }) : t.exports.apply = i;
  })(z1)), z1.exports;
}
var X1, H3;
function BW() {
  if (H3) return X1;
  H3 = 1;
  var t = p8();
  return X1 = function() {
    return t() && !!Symbol.toStringTag;
  }, X1;
}
var Z1, W3;
function UW() {
  if (W3) return Z1;
  W3 = 1;
  var t = kW(), e = /* @__PURE__ */ PW(), n = RW(), r = /* @__PURE__ */ y8(), i = /* @__PURE__ */ Nd(), o = m8(), s = r("Object.prototype.toString"), a = BW()(), c = typeof globalThis > "u" ? On : globalThis, u = e(), l = r("String.prototype.slice"), d = r("Array.prototype.indexOf", !0) || function(x, g) {
    for (var v = 0; v < x.length; v += 1)
      if (x[v] === g)
        return v;
    return -1;
  }, f = { __proto__: null };
  a && i && o ? t(u, function(y) {
    var x = new c[y]();
    if (Symbol.toStringTag in x && o) {
      var g = o(x), v = i(g, Symbol.toStringTag);
      if (!v && g) {
        var S = o(g);
        v = i(S, Symbol.toStringTag);
      }
      f["$" + y] = n(v.get);
    }
  }) : t(u, function(y) {
    var x = new c[y](), g = x.slice || x.set;
    g && (f[
      /** @type {`$${import('.').TypedArrayName}`} */
      "$" + y
    ] = /** @type {import('./types').BoundSlice | import('./types').BoundSet} */
    // @ts-expect-error TODO FIXME
    n(g));
  });
  var m = function(x) {
    var g = !1;
    return t(
      /** @type {Record<`\$${import('.').TypedArrayName}`, Getter>} */
      f,
      /** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */
      function(v, S) {
        if (!g)
          try {
            "$" + v(x) === S && (g = /** @type {import('.').TypedArrayName} */
            l(S, 1));
          } catch {
          }
      }
    ), g;
  }, h = function(x) {
    var g = !1;
    return t(
      /** @type {Record<`\$${import('.').TypedArrayName}`, Getter>} */
      f,
      /** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */
      function(v, S) {
        if (!g)
          try {
            v(x), g = /** @type {import('.').TypedArrayName} */
            l(S, 1);
          } catch {
          }
      }
    ), g;
  };
  return Z1 = function(x) {
    if (!x || typeof x != "object")
      return !1;
    if (!a) {
      var g = l(s(x), 8, -1);
      return d(u, g) > -1 ? g : g !== "Object" ? !1 : h(x);
    }
    return i ? m(x) : null;
  }, Z1;
}
var ev, z3;
function LW() {
  if (z3) return ev;
  z3 = 1;
  var t = /* @__PURE__ */ UW();
  return ev = function(n) {
    return !!t(n);
  }, ev;
}
var tv, K3;
function jW() {
  if (K3) return tv;
  K3 = 1;
  var t = /* @__PURE__ */ kd(), e = /* @__PURE__ */ y8(), n = e("TypedArray.prototype.buffer", !0), r = /* @__PURE__ */ LW();
  return tv = n || function(o) {
    if (!r(o))
      throw new t("Not a Typed Array");
    return o.buffer;
  }, tv;
}
var nv, V3;
function v8() {
  if (V3) return nv;
  V3 = 1;
  var t = Wg().Buffer, e = cW(), n = /* @__PURE__ */ jW(), r = ArrayBuffer.isView || function(c) {
    try {
      return n(c), !0;
    } catch {
      return !1;
    }
  }, i = typeof Uint8Array < "u", o = typeof ArrayBuffer < "u" && typeof Uint8Array < "u", s = o && (t.prototype instanceof Uint8Array || t.TYPED_ARRAY_SUPPORT);
  return nv = function(c, u) {
    if (t.isBuffer(c))
      return c.constructor && !("isBuffer" in c) ? t.from(c) : c;
    if (typeof c == "string")
      return t.from(c, u);
    if (o && r(c)) {
      if (c.byteLength === 0)
        return t.alloc(0);
      if (s) {
        var l = t.from(c.buffer, c.byteOffset, c.byteLength);
        if (l.byteLength === c.byteLength)
          return l;
      }
      var d = c instanceof Uint8Array ? c : new Uint8Array(c.buffer, c.byteOffset, c.byteLength), f = t.from(d);
      if (f.length === c.byteLength)
        return f;
    }
    if (i && c instanceof Uint8Array)
      return t.from(c);
    var m = e(c);
    if (m)
      for (var h = 0; h < c.length; h += 1) {
        var y = c[h];
        if (typeof y != "number" || y < 0 || y > 255 || ~~y !== y)
          throw new RangeError("Array items must be numbers in the range 0-255.");
      }
    if (m || t.isBuffer(c) && c.constructor && typeof c.constructor.isBuffer == "function" && c.constructor.isBuffer(c))
      return t.from(c);
    throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.');
  }, nv;
}
var rv, Y3;
function QW() {
  if (Y3) return rv;
  Y3 = 1;
  var t = (function() {
    try {
      if (!Buffer.isEncoding("latin1"))
        return !1;
      var o = Buffer.alloc ? Buffer.alloc(4) : new Buffer(4);
      return o.fill("ab", "ucs2"), o.toString("hex") === "61006200";
    } catch {
      return !1;
    }
  })();
  function e(o) {
    return o.length === 1 && o.charCodeAt(0) < 256;
  }
  function n(o, s, a, c) {
    if (a < 0 || c > o.length)
      throw new RangeError("Out of range index");
    return a = a >>> 0, c = c === void 0 ? o.length : c >>> 0, c > a && o.fill(s, a, c), o;
  }
  function r(o, s, a, c) {
    if (a < 0 || c > o.length)
      throw new RangeError("Out of range index");
    if (c <= a)
      return o;
    a = a >>> 0, c = c === void 0 ? o.length : c >>> 0;
    for (var u = a, l = s.length; u <= c - l; )
      s.copy(o, u), u += l;
    return u !== c && s.copy(o, u, 0, c - u), o;
  }
  function i(o, s, a, c, u) {
    if (t)
      return o.fill(s, a, c, u);
    if (typeof s == "number")
      return n(o, s, a, c);
    if (typeof s == "string") {
      if (typeof a == "string" ? (u = a, a = 0, c = o.length) : typeof c == "string" && (u = c, c = o.length), u !== void 0 && typeof u != "string")
        throw new TypeError("encoding must be a string");
      if (u === "latin1" && (u = "binary"), typeof u == "string" && !Buffer.isEncoding(u))
        throw new TypeError("Unknown encoding: " + u);
      if (s === "")
        return n(o, 0, a, c);
      if (e(s))
        return n(o, s.charCodeAt(0), a, c);
      s = new Buffer(s, u);
    }
    return Buffer.isBuffer(s) ? r(o, s, a, c) : n(o, 0, a, c);
  }
  return rv = i, rv;
}
var iv, J3;
function $W() {
  if (J3) return iv;
  J3 = 1;
  function t(e) {
    if (typeof e != "number")
      throw new TypeError('"size" argument must be a number');
    if (e < 0)
      throw new RangeError('"size" argument must not be negative');
    return Buffer.allocUnsafe ? Buffer.allocUnsafe(e) : new Buffer(e);
  }
  return iv = t, iv;
}
var ov, X3;
function b8() {
  if (X3) return ov;
  X3 = 1;
  var t = QW(), e = $W();
  return ov = function(r, i, o) {
    if (typeof r != "number")
      throw new TypeError('"size" argument must be a number');
    if (r < 0)
      throw new RangeError('"size" argument must not be negative');
    if (Buffer.alloc)
      return Buffer.alloc(r, i, o);
    var s = e(r);
    return r === 0 ? s : i === void 0 ? t(s, 0) : (typeof o != "string" && (o = void 0), t(s, i, o));
  }, ov;
}
var Z3;
function x8() {
  if (Z3) return Ta;
  Z3 = 1;
  var t = /* @__PURE__ */ v8(), e = b8(), n = "0000000000000000000", r = "7777777777777777777", i = 48, o = "ustar\x0000", s = parseInt("7777", 8), a = function(g, v, S) {
    return typeof g != "number" ? S : (g = ~~g, g >= v ? v : g >= 0 || (g += v, g >= 0) ? g : 0);
  }, c = function(g) {
    switch (g) {
      case 0:
        return "file";
      case 1:
        return "link";
      case 2:
        return "symlink";
      case 3:
        return "character-device";
      case 4:
        return "block-device";
      case 5:
        return "directory";
      case 6:
        return "fifo";
      case 7:
        return "contiguous-file";
      case 72:
        return "pax-header";
      case 55:
        return "pax-global-header";
      case 27:
        return "gnu-long-link-path";
      case 28:
      case 30:
        return "gnu-long-path";
    }
    return null;
  }, u = function(g) {
    switch (g) {
      case "file":
        return 0;
      case "link":
        return 1;
      case "symlink":
        return 2;
      case "character-device":
        return 3;
      case "block-device":
        return 4;
      case "directory":
        return 5;
      case "fifo":
        return 6;
      case "contiguous-file":
        return 7;
      case "pax-header":
        return 72;
    }
    return 0;
  }, l = function(g, v, S, E) {
    for (; S < E; S++)
      if (g[S] === v) return S;
    return E;
  }, d = function(g) {
    for (var v = 256, S = 0; S < 148; S++) v += g[S];
    for (var E = 156; E < 512; E++) v += g[E];
    return v;
  }, f = function(g, v) {
    return g = g.toString(8), g.length > v ? r.slice(0, v) + " " : n.slice(0, v - g.length) + g + " ";
  };
  function m(g) {
    var v;
    if (g[0] === 128) v = !0;
    else if (g[0] === 255) v = !1;
    else return null;
    for (var S = [], E = g.length - 1; E > 0; E--) {
      var T = g[E];
      v ? S.push(T) : S.push(255 - T);
    }
    var j = 0, q = S.length;
    for (E = 0; E < q; E++)
      j += S[E] * Math.pow(256, E);
    return v ? j : -1 * j;
  }
  var h = function(g, v, S) {
    if (g = g.slice(v, v + S), v = 0, g[v] & 128)
      return m(g);
    for (; v < g.length && g[v] === 32; ) v++;
    for (var E = a(l(g, 32, v, g.length), g.length, g.length); v < E && g[v] === 0; ) v++;
    return E === v ? 0 : parseInt(g.slice(v, E).toString(), 8);
  }, y = function(g, v, S, E) {
    return g.slice(v, l(g, 0, v, v + S)).toString(E);
  }, x = function(g) {
    var v = Buffer.byteLength(g), S = Math.floor(Math.log(v) / Math.log(10)) + 1;
    return v + S >= Math.pow(10, S) && S++, v + S + g;
  };
  return Ta.decodeLongPath = function(g, v) {
    return y(g, 0, g.length, v);
  }, Ta.encodePax = function(g) {
    var v = "";
    g.name && (v += x(" path=" + g.name + `
`)), g.linkname && (v += x(" linkpath=" + g.linkname + `
`));
    var S = g.pax;
    if (S)
      for (var E in S)
        v += x(" " + E + "=" + S[E] + `
`);
    return t(v);
  }, Ta.decodePax = function(g) {
    for (var v = {}; g.length; ) {
      for (var S = 0; S < g.length && g[S] !== 32; ) S++;
      var E = parseInt(g.slice(0, S).toString(), 10);
      if (!E) return v;
      var T = g.slice(S + 1, E - 1).toString(), j = T.indexOf("=");
      if (j === -1) return v;
      v[T.slice(0, j)] = T.slice(j + 1), g = g.slice(E);
    }
    return v;
  }, Ta.encode = function(g) {
    var v = e(512), S = g.name, E = "";
    if (g.typeflag === 5 && S[S.length - 1] !== "/" && (S += "/"), Buffer.byteLength(S) !== S.length) return null;
    for (; Buffer.byteLength(S) > 100; ) {
      var T = S.indexOf("/");
      if (T === -1) return null;
      E += E ? "/" + S.slice(0, T) : S.slice(0, T), S = S.slice(T + 1);
    }
    return Buffer.byteLength(S) > 100 || Buffer.byteLength(E) > 155 || g.linkname && Buffer.byteLength(g.linkname) > 100 ? null : (v.write(S), v.write(f(g.mode & s, 6), 100), v.write(f(g.uid, 6), 108), v.write(f(g.gid, 6), 116), v.write(f(g.size, 11), 124), v.write(f(g.mtime.getTime() / 1e3 | 0, 11), 136), v[156] = i + u(g.type), g.linkname && v.write(g.linkname, 157), v.write(o, 257), g.uname && v.write(g.uname, 265), g.gname && v.write(g.gname, 297), v.write(f(g.devmajor || 0, 6), 329), v.write(f(g.devminor || 0, 6), 337), E && v.write(E, 345), v.write(f(d(v), 6), 148), v);
  }, Ta.decode = function(g, v) {
    var S = g[156] === 0 ? 0 : g[156] - i, E = y(g, 0, 100, v), T = h(g, 100, 8), j = h(g, 108, 8), q = h(g, 116, 8), Y = h(g, 124, 12), W = h(g, 136, 12), G = c(S), J = g[157] === 0 ? null : y(g, 157, 100, v), B = y(g, 265, 32), D = y(g, 297, 32), X = h(g, 329, 8), V = h(g, 337, 8);
    g[345] && (E = y(g, 345, 155, v) + "/" + E), S === 0 && E && E[E.length - 1] === "/" && (S = 5);
    var K = d(g);
    if (K === 256) return null;
    if (K !== h(g, 148, 8)) throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");
    return {
      name: E,
      mode: T,
      uid: j,
      gid: q,
      size: Y,
      mtime: new Date(1e3 * W),
      type: G,
      linkname: J,
      uname: B,
      gname: D,
      devmajor: X,
      devminor: V
    };
  }, Ta;
}
var qf = { exports: {} }, sv, eT;
function w8() {
  if (eT) return sv;
  eT = 1, sv = r;
  var t = Ya(), e = Object.create(Td());
  e.inherits = fo(), e.inherits(r, t);
  function n(s, a) {
    var c = this._transformState;
    c.transforming = !1;
    var u = c.writecb;
    if (!u)
      return this.emit("error", new Error("write callback called multiple times"));
    c.writechunk = null, c.writecb = null, a != null && this.push(a), u(s);
    var l = this._readableState;
    l.reading = !1, (l.needReadable || l.length < l.highWaterMark) && this._read(l.highWaterMark);
  }
  function r(s) {
    if (!(this instanceof r)) return new r(s);
    t.call(this, s), this._transformState = {
      afterTransform: n.bind(this),
      needTransform: !1,
      transforming: !1,
      writecb: null,
      writechunk: null,
      writeencoding: null
    }, this._readableState.needReadable = !0, this._readableState.sync = !1, s && (typeof s.transform == "function" && (this._transform = s.transform), typeof s.flush == "function" && (this._flush = s.flush)), this.on("prefinish", i);
  }
  function i() {
    var s = this;
    typeof this._flush == "function" ? this._flush(function(a, c) {
      o(s, a, c);
    }) : o(this, null, null);
  }
  r.prototype.push = function(s, a) {
    return this._transformState.needTransform = !1, t.prototype.push.call(this, s, a);
  }, r.prototype._transform = function(s, a, c) {
    throw new Error("_transform() is not implemented");
  }, r.prototype._write = function(s, a, c) {
    var u = this._transformState;
    if (u.writecb = c, u.writechunk = s, u.writeencoding = a, !u.transforming) {
      var l = this._readableState;
      (u.needTransform || l.needReadable || l.length < l.highWaterMark) && this._read(l.highWaterMark);
    }
  }, r.prototype._read = function(s) {
    var a = this._transformState;
    a.writechunk !== null && a.writecb && !a.transforming ? (a.transforming = !0, this._transform(a.writechunk, a.writeencoding, a.afterTransform)) : a.needTransform = !0;
  }, r.prototype._destroy = function(s, a) {
    var c = this;
    t.prototype._destroy.call(this, s, function(u) {
      a(u), c.emit("close");
    });
  };
  function o(s, a, c) {
    if (a) return s.emit("error", a);
    if (c != null && s.push(c), s._writableState.length) throw new Error("Calling transform done when ws.length != 0");
    if (s._transformState.transforming) throw new Error("Calling transform done when still transforming");
    return s.push(null);
  }
  return sv;
}
var av, tT;
function GW() {
  if (tT) return av;
  tT = 1, av = n;
  var t = w8(), e = Object.create(Td());
  e.inherits = fo(), e.inherits(n, t);
  function n(r) {
    if (!(this instanceof n)) return new n(r);
    t.call(this, r);
  }
  return n.prototype._transform = function(r, i, o) {
    o(null, r);
  }, av;
}
var nT;
function km() {
  return nT || (nT = 1, (function(t, e) {
    e = t.exports = o8(), e.Stream = e, e.Readable = e, e.Writable = a8(), e.Duplex = Ya(), e.Transform = w8(), e.PassThrough = GW();
  })(qf, qf.exports)), qf.exports;
}
var cv, rT;
function qW() {
  if (rT) return cv;
  rT = 1;
  var t = _n, e = aW(), n = c8(), r = x8(), i = km().Writable, o = km().PassThrough, s = function() {
  }, a = function(f) {
    return f &= 511, f && 512 - f;
  }, c = function(f, m) {
    var h = new l(f, m);
    return h.end(), h;
  }, u = function(f, m) {
    return m.path && (f.name = m.path), m.linkpath && (f.linkname = m.linkpath), m.size && (f.size = parseInt(m.size, 10)), f.pax = m, f;
  }, l = function(f, m) {
    this._parent = f, this.offset = m, o.call(this);
  };
  t.inherits(l, o), l.prototype.destroy = function(f) {
    this._parent.destroy(f);
  };
  var d = function(f) {
    if (!(this instanceof d)) return new d(f);
    i.call(this, f), f = f || {}, this._offset = 0, this._buffer = e(), this._missing = 0, this._partial = !1, this._onparse = s, this._header = null, this._stream = null, this._overflow = null, this._cb = null, this._locked = !1, this._destroyed = !1, this._pax = null, this._paxGlobal = null, this._gnuLongPath = null, this._gnuLongLinkPath = null;
    var m = this, h = m._buffer, y = function() {
      m._continue();
    }, x = function(Y) {
      if (m._locked = !1, Y) return m.destroy(Y);
      m._stream || y();
    }, g = function() {
      m._stream = null;
      var Y = a(m._header.size);
      Y ? m._parse(Y, v) : m._parse(512, q), m._locked || y();
    }, v = function() {
      m._buffer.consume(a(m._header.size)), m._parse(512, q), y();
    }, S = function() {
      var Y = m._header.size;
      m._paxGlobal = r.decodePax(h.slice(0, Y)), h.consume(Y), g();
    }, E = function() {
      var Y = m._header.size;
      m._pax = r.decodePax(h.slice(0, Y)), m._paxGlobal && (m._pax = n(m._paxGlobal, m._pax)), h.consume(Y), g();
    }, T = function() {
      var Y = m._header.size;
      this._gnuLongPath = r.decodeLongPath(h.slice(0, Y), f.filenameEncoding), h.consume(Y), g();
    }, j = function() {
      var Y = m._header.size;
      this._gnuLongLinkPath = r.decodeLongPath(h.slice(0, Y), f.filenameEncoding), h.consume(Y), g();
    }, q = function() {
      var Y = m._offset, W;
      try {
        W = m._header = r.decode(h.slice(0, 512), f.filenameEncoding);
      } catch (G) {
        m.emit("error", G);
      }
      if (h.consume(512), !W) {
        m._parse(512, q), y();
        return;
      }
      if (W.type === "gnu-long-path") {
        m._parse(W.size, T), y();
        return;
      }
      if (W.type === "gnu-long-link-path") {
        m._parse(W.size, j), y();
        return;
      }
      if (W.type === "pax-global-header") {
        m._parse(W.size, S), y();
        return;
      }
      if (W.type === "pax-header") {
        m._parse(W.size, E), y();
        return;
      }
      if (m._gnuLongPath && (W.name = m._gnuLongPath, m._gnuLongPath = null), m._gnuLongLinkPath && (W.linkname = m._gnuLongLinkPath, m._gnuLongLinkPath = null), m._pax && (m._header = W = u(W, m._pax), m._pax = null), m._locked = !0, !W.size || W.type === "directory") {
        m._parse(512, q), m.emit("entry", W, c(m, Y), x);
        return;
      }
      m._stream = new l(m, Y), m.emit("entry", W, m._stream, x), m._parse(W.size, g), y();
    };
    this._onheader = q, this._parse(512, q);
  };
  return t.inherits(d, i), d.prototype.destroy = function(f) {
    this._destroyed || (this._destroyed = !0, f && this.emit("error", f), this.emit("close"), this._stream && this._stream.emit("close"));
  }, d.prototype._parse = function(f, m) {
    this._destroyed || (this._offset += f, this._missing = f, m === this._onheader && (this._partial = !1), this._onparse = m);
  }, d.prototype._continue = function() {
    if (!this._destroyed) {
      var f = this._cb;
      this._cb = s, this._overflow ? this._write(this._overflow, void 0, f) : f();
    }
  }, d.prototype._write = function(f, m, h) {
    if (!this._destroyed) {
      var y = this._stream, x = this._buffer, g = this._missing;
      if (f.length && (this._partial = !0), f.length < g)
        return this._missing -= f.length, this._overflow = null, y ? y.write(f, h) : (x.append(f), h());
      this._cb = h, this._missing = 0;
      var v = null;
      f.length > g && (v = f.slice(g), f = f.slice(0, g)), y ? y.end(f) : x.append(f), this._overflow = v, this._onparse();
    }
  }, d.prototype._final = function(f) {
    if (this._partial) return this.destroy(new Error("Unexpected end of data"));
    f();
  }, cv = d, cv;
}
var uv, iT;
function HW() {
  return iT || (iT = 1, uv = BL), uv;
}
var lv, oT;
function WW() {
  if (oT) return lv;
  oT = 1;
  var t = HW(), e = Z6(), n = _n, r = b8(), i = /* @__PURE__ */ v8(), o = km().Readable, s = km().Writable, a = K_.StringDecoder, c = x8(), u = parseInt("755", 8), l = parseInt("644", 8), d = r(1024), f = function() {
  }, m = function(S, E) {
    E &= 511, E && S.push(d.slice(0, 512 - E));
  };
  function h(S) {
    switch (S & t.S_IFMT) {
      case t.S_IFBLK:
        return "block-device";
      case t.S_IFCHR:
        return "character-device";
      case t.S_IFDIR:
        return "directory";
      case t.S_IFIFO:
        return "fifo";
      case t.S_IFLNK:
        return "symlink";
    }
    return "file";
  }
  var y = function(S) {
    s.call(this), this.written = 0, this._to = S, this._destroyed = !1;
  };
  n.inherits(y, s), y.prototype._write = function(S, E, T) {
    if (this.written += S.length, this._to.push(S)) return T();
    this._to._drain = T;
  }, y.prototype.destroy = function() {
    this._destroyed || (this._destroyed = !0, this.emit("close"));
  };
  var x = function() {
    s.call(this), this.linkname = "", this._decoder = new a("utf-8"), this._destroyed = !1;
  };
  n.inherits(x, s), x.prototype._write = function(S, E, T) {
    this.linkname += this._decoder.write(S), T();
  }, x.prototype.destroy = function() {
    this._destroyed || (this._destroyed = !0, this.emit("close"));
  };
  var g = function() {
    s.call(this), this._destroyed = !1;
  };
  n.inherits(g, s), g.prototype._write = function(S, E, T) {
    T(new Error("No body allowed for this entry"));
  }, g.prototype.destroy = function() {
    this._destroyed || (this._destroyed = !0, this.emit("close"));
  };
  var v = function(S) {
    if (!(this instanceof v)) return new v(S);
    o.call(this, S), this._drain = f, this._finalized = !1, this._finalizing = !1, this._destroyed = !1, this._stream = null;
  };
  return n.inherits(v, o), v.prototype.entry = function(S, E, T) {
    if (this._stream) throw new Error("already piping an entry");
    if (!(this._finalized || this._destroyed)) {
      typeof E == "function" && (T = E, E = null), T || (T = f);
      var j = this;
      if ((!S.size || S.type === "symlink") && (S.size = 0), S.type || (S.type = h(S.mode)), S.mode || (S.mode = S.type === "directory" ? u : l), S.uid || (S.uid = 0), S.gid || (S.gid = 0), S.mtime || (S.mtime = /* @__PURE__ */ new Date()), typeof E == "string" && (E = i(E)), Buffer.isBuffer(E))
        return S.size = E.length, this._encode(S), this.push(E), m(j, S.size), process.nextTick(T), new g();
      if (S.type === "symlink" && !S.linkname) {
        var q = new x();
        return e(q, function(W) {
          if (W)
            return j.destroy(), T(W);
          S.linkname = q.linkname, j._encode(S), T();
        }), q;
      }
      if (this._encode(S), S.type !== "file" && S.type !== "contiguous-file")
        return process.nextTick(T), new g();
      var Y = new y(this);
      return this._stream = Y, e(Y, function(W) {
        if (j._stream = null, W)
          return j.destroy(), T(W);
        if (Y.written !== S.size)
          return j.destroy(), T(new Error("size mismatch"));
        m(j, S.size), j._finalizing && j.finalize(), T();
      }), Y;
    }
  }, v.prototype.finalize = function() {
    if (this._stream) {
      this._finalizing = !0;
      return;
    }
    this._finalized || (this._finalized = !0, this.push(d), this.push(null));
  }, v.prototype.destroy = function(S) {
    this._destroyed || (this._destroyed = !0, S && this.emit("error", S), this.emit("close"), this._stream && this._stream.destroy && this._stream.destroy());
  }, v.prototype._encode = function(S) {
    if (!S.pax) {
      var E = c.encode(S);
      if (E) {
        this.push(E);
        return;
      }
    }
    this._encodePax(S);
  }, v.prototype._encodePax = function(S) {
    var E = c.encodePax({
      name: S.name,
      linkname: S.linkname,
      pax: S.pax
    }), T = {
      name: "PaxHeader",
      mode: S.mode,
      uid: S.uid,
      gid: S.gid,
      size: E.length,
      mtime: S.mtime,
      type: "pax-header",
      linkname: S.linkname && "PaxHeader",
      uname: S.uname,
      gname: S.gname,
      devmajor: S.devmajor,
      devminor: S.devminor
    };
    this.push(c.encode(T)), this.push(E), m(this, E.length), T.size = S.size, T.type = S.type, this.push(c.encode(T));
  }, v.prototype._read = function(S) {
    var E = this._drain;
    this._drain = f, E();
  }, lv = v, lv;
}
var sT;
function AE() {
  return sT || (sT = 1, Lf.extract = qW(), Lf.pack = WW()), Lf;
}
var pv, aT;
function S8() {
  if (aT) return pv;
  aT = 1;
  const t = ir;
  class e extends t.Readable {
    addEntry() {
      throw new Error(".addEntry not implemented in sub class!");
    }
    _read() {
    }
    emit(r, i) {
      if (r === "error") {
        const o = i;
        o.name === "Error" && (o.name = this.constructor.name + "Error");
      }
      super.emit(r, i);
    }
  }
  return pv = e, pv;
}
var dv, cT;
function _8() {
  if (cT) return dv;
  cT = 1;
  const t = de, e = be, n = ir, r = AE(), i = pi(), o = S8();
  class s extends o {
    constructor(c) {
      super(c), this._waitingEntries = [], this._processing = !1, this._init(c);
    }
    _init() {
      const c = this._pack = r.pack();
      c.on("end", () => this.push(null)), c.on("data", (u) => this.push(u)), c.on("error", (u) => this.emit("error", u));
    }
    addEntry(c, u) {
      if (this._processing)
        return this._waitingEntries.push([c, u]);
      u = u || {}, this._processing = !0;
      const l = i.entryType(c);
      l && (l === "fileOrDir" ? this._addFileOrDirEntry(c, u) : l === "buffer" ? this._addBufferEntry(c, u) : this._addStreamEntry(c, u));
    }
    _addFileOrDirEntry(c, u) {
      t.stat(c, (l, d) => {
        if (l) return this.emit("error", l);
        if (d.isDirectory()) return this._addDirEntry(c, u);
        if (d.isFile()) return this._addFileEntry(c, u);
        const f = new Error("Type is not supported, must be a file path, directory path, file buffer, or a readable stream");
        f.name = "IlligalEntryError", this.emit("error", f);
      });
    }
    _addFileEntry(c, u) {
      t.stat(c, (l, d) => {
        if (l) return this.emit("error", l);
        const f = this._pack.entry({ name: u.relativePath || e.basename(c), size: d.size, mode: d.mode & 511 }, this._onEntryFinish.bind(this)), m = t.createReadStream(c, u.fs);
        m.on("error", (h) => this.emit("error", h)), m.pipe(f);
      });
    }
    _addDirEntry(c, u) {
      t.readdir(c, (l, d) => {
        if (l) return this.emit("error", l);
        const f = u.relativePath || "";
        d.forEach((m) => {
          const h = i.clone(u);
          u.ignoreBase ? h.relativePath = e.posix.join(f, m) : h.relativePath = e.posix.join(f, e.basename(c), m), h.ignoreBase = !0, this.addEntry(e.posix.join(c, m), h);
        }), this._onEntryFinish();
      });
    }
    _addBufferEntry(c, u) {
      if (!u.relativePath) return this.emit("error", "opts.relativePath is required if entry is a buffer");
      this._pack.entry({ name: u.relativePath }, c, this._onEntryFinish.bind(this));
    }
    _addStreamEntry(c, u) {
      if (c.on("error", (l) => this.emit("error", l)), !u.relativePath) return this.emit("error", new Error("opts.relativePath is required"));
      if (u.size) {
        const l = this._pack.entry({ name: u.relativePath, size: u.size }, this._onEntryFinish.bind(this));
        c.pipe(l);
      } else {
        u.suppressSizeWarning || console.warn("You should specify the size of streamming data by opts.size to prevent all streaming data from loading into memory. If you are sure about memory cost, pass opts.suppressSizeWarning: true to suppress this warning");
        const l = [], d = new n.Writable({
          write(f, m, h) {
            l.push(f), h();
          }
        });
        d.on("error", (f) => this.emit("error", f)), d.on("finish", () => {
          this._pack.entry({ name: u.relativePath }, Buffer.concat(l), this._onEntryFinish.bind(this));
        }), c.pipe(d);
      }
    }
    _read() {
    }
    _onEntryFinish(c) {
      if (c) return this.emit("error", c);
      this._processing = !1;
      const u = this._waitingEntries.shift();
      u ? this.addEntry.apply(this, u) : this._finalize();
    }
    _finalize() {
      this._pack.finalize();
    }
  }
  return dv = s, dv;
}
var fv, uT;
function zW() {
  if (uT) return fv;
  uT = 1;
  const t = be, e = n8(), n = _8();
  class r extends n {
    _init() {
      const s = (this._zipfile = new e.ZipFile()).outputStream;
      s.on("end", () => this.push(null)), s.on("data", (a) => this.push(a)), s.on("error", (a) => this.emit("error", a));
    }
    _addFileEntry(o, s) {
      this._zipfile.addFile(o, s.relativePath || t.basename(o), s), this._onEntryFinish();
    }
    _addBufferEntry(o, s) {
      if (!s.relativePath) return this.emit("error", new Error("opts.relativePath is required if entry is a buffer"));
      this._zipfile.addBuffer(o, s.relativePath, s), this._onEntryFinish();
    }
    _addStreamEntry(o, s) {
      if (!s.relativePath) return this.emit("error", new Error("opts.relativePath is required if entry is a stream"));
      o.on("error", (a) => this.emit("error", a)), this._zipfile.addReadStream(o, s.relativePath, s), this._onEntryFinish();
    }
    _finalize() {
      this._zipfile.end();
    }
  }
  return fv = r, fv;
}
var Hf = { exports: {} }, lT;
function Kg() {
  if (lT) return Hf.exports;
  lT = 1;
  function t(n) {
    if (this._ready = !!this._ready, this._readyCallbacks = this._readyCallbacks || [], arguments.length === 0)
      return new Promise(function(r) {
        if (this._ready)
          return r();
        this._readyCallbacks.push(r);
      }.bind(this));
    typeof n == "function" ? this._readyCallbacks.push(n) : this._ready = !!n, this._ready && this._readyCallbacks.splice(0, 1 / 0).forEach(function(r) {
      process.nextTick(r);
    });
  }
  function e(n) {
    n.ready = t;
  }
  return Hf.exports = e, Hf.exports.mixin = e, Hf.exports;
}
var hv, pT;
function KW() {
  if (pT) return hv;
  pT = 1;
  const t = be, e = n8(), n = UL, r = ir, i = pi(), o = Kg();
  class s extends r.Transform {
    constructor(c) {
      super(c);
      const u = i.sourceType(c.source), l = new e.ZipFile(), d = l.outputStream;
      if (d.on("data", (f) => this.push(f)), d.on("end", () => this.ready(!0)), l.on("error", (f) => this.emit("error", f)), u !== "file" && n(c.relativePath, "opts.relativePath is required when compressing a buffer, or a stream"), u && this.end(), u === "file")
        l.addFile(c.source, c.relativePath || t.basename(c.source), c.yazl);
      else if (u === "buffer")
        l.addBuffer(c.source, c.relativePath, c.yazl);
      else if (u === "stream")
        l.addReadStream(c.source, c.relativePath, c.yazl);
      else {
        const f = this._passThrough = new r.PassThrough();
        this.on("finish", () => f.end()), l.addReadStream(f, c.relativePath, c.yazl);
      }
      l.end(c.yazl);
    }
    _transform(c, u, l) {
      this._passThrough && this._passThrough.write(c, u, l);
    }
    _flush(c) {
      this.ready(c);
    }
  }
  return o.mixin(s.prototype), hv = s, hv;
}
var Ui = {}, Oc = {}, mv, dT;
function VW() {
  if (dT) return mv;
  dT = 1, mv = t;
  function t() {
    this.pending = 0, this.max = 1 / 0, this.listeners = [], this.waiting = [], this.error = null;
  }
  t.prototype.go = function(r) {
    this.pending < this.max ? n(this, r) : this.waiting.push(r);
  }, t.prototype.wait = function(r) {
    this.pending === 0 ? r(this.error) : this.listeners.push(r);
  }, t.prototype.hold = function() {
    return e(this);
  };
  function e(r) {
    r.pending += 1;
    var i = !1;
    return o;
    function o(a) {
      if (i) throw new Error("callback called twice");
      if (i = !0, r.error = r.error || a, r.pending -= 1, r.waiting.length > 0 && r.pending < r.max)
        n(r, r.waiting.shift());
      else if (r.pending === 0) {
        var c = r.listeners;
        r.listeners = [], c.forEach(s);
      }
    }
    function s(a) {
      a(r.error);
    }
  }
  function n(r, i) {
    i(e(r));
  }
  return mv;
}
var fT;
function YW() {
  if (fT) return Oc;
  fT = 1;
  const t = de, { Readable: e, Writable: n, PassThrough: r } = ir, i = VW(), { EventEmitter: o } = xs;
  class s extends o {
    constructor(h, y = {}) {
      super(), this.fd = h, this.pend = new i(), this.pend.max = 1, this.refCount = 0, this.autoClose = !!y.autoClose;
    }
    read(h, y, x, g, v) {
      this.pend.go((S) => {
        t.read(this.fd, h, y, x, g, (E, T, j) => {
          S(), v(E, T, j);
        });
      });
    }
    write(h, y, x, g, v) {
      this.pend.go((S) => {
        t.write(this.fd, h, y, x, g, (E, T, j) => {
          S(), v(E, T, j);
        });
      });
    }
    createReadStream(h) {
      return new a(this, h);
    }
    createWriteStream(h) {
      return new c(this, h);
    }
    ref() {
      this.refCount += 1;
    }
    unref() {
      if (this.refCount -= 1, !(this.refCount > 0)) {
        if (this.refCount < 0) throw new Error("invalid unref");
        this.autoClose && t.close(this.fd, (h) => {
          h ? this.emit("error", h) : this.emit("close");
        });
      }
    }
  }
  class a extends e {
    constructor(h, y = {}) {
      super(y), this.context = h, this.context.ref(), this.start = y.start || 0, this.endOffset = y.end, this.pos = this.start, this.destroyed = !1;
    }
    _read(h) {
      if (this.destroyed) return;
      let y = Math.min(this._readableState.highWaterMark, h);
      if (this.endOffset != null && (y = Math.min(y, this.endOffset - this.pos)), y <= 0) {
        this.destroyed = !0, this.push(null), this.context.unref();
        return;
      }
      this.context.pend.go((x) => {
        if (this.destroyed) return x();
        const g = Buffer.alloc(y);
        t.read(this.context.fd, g, 0, y, this.pos, (v, S) => {
          v ? this.destroy(v) : S === 0 ? (this.destroyed = !0, this.push(null), this.context.unref()) : (this.pos += S, this.push(g.slice(0, S))), x();
        });
      });
    }
    destroy(h) {
      this.destroyed || (h = h || new Error("stream destroyed"), this.destroyed = !0, this.emit("error", h), this.context.unref());
    }
  }
  class c extends n {
    constructor(h, y = {}) {
      super(y), this.context = h, this.context.ref(), this.start = y.start || 0, this.endOffset = y.end == null ? 1 / 0 : +y.end, this.bytesWritten = 0, this.pos = this.start, this.destroyed = !1, this.on("finish", this.destroy.bind(this));
    }
    _write(h, y, x) {
      if (!this.destroyed) {
        if (this.pos + h.length > this.endOffset) {
          const g = new Error("maximum file length exceeded");
          g.code = "ETOOBIG", this.destroy(), x(g);
          return;
        }
        this.context.pend.go((g) => {
          if (this.destroyed) return g();
          t.write(this.context.fd, h, 0, h.length, this.pos, (v, S) => {
            v ? (this.destroy(), g(), x(v)) : (this.bytesWritten += S, this.pos += S, this.emit("progress"), g(), x());
          });
        });
      }
    }
    destroy() {
      this.destroyed || (this.destroyed = !0, this.context.unref());
    }
  }
  const { MAX_SAFE_INTEGER: u } = Number;
  class l extends o {
    constructor(h, y) {
      super(), y = y || {}, this.refCount = 0, this.buffer = h, this.maxChunkSize = y.maxChunkSize || u;
    }
    read(h, y, x, g, v) {
      const S = g + x, E = S - this.buffer.length, T = E > 0 ? E : x;
      this.buffer.copy(h, y, g, S), setImmediate(() => {
        v(null, T);
      });
    }
    write(h, y, x, g, v) {
      h.copy(this.buffer, g, y, y + x), setImmediate(() => {
        v(null, x, h);
      });
    }
    createReadStream(h = {}) {
      const y = new r(h);
      y.destroyed = !1, y.start = h.start || 0, y.endOffset = h.end, y.pos = y.endOffset || this.buffer.length;
      const x = this.buffer.slice(y.start, y.pos);
      let g = 0;
      for (; ; ) {
        const v = g + this.maxChunkSize;
        if (v >= x.length) {
          g < x.length && y.write(x.slice(g, x.length));
          break;
        }
        y.write(x.slice(g, v)), g = v;
      }
      return y.end(), y.destroy = () => {
        y.destroyed = !0;
      }, y;
    }
    createWriteStream(h) {
      const y = this;
      h = h || {};
      const x = new n(h);
      return x.start = h.start || 0, x.endOffset = h.end == null ? this.buffer.length : +h.end, x.bytesWritten = 0, x.pos = x.start, x.destroyed = !1, x._write = (g, v, S) => {
        if (x.destroyed) return;
        const E = x.pos + g.length;
        if (E > x.endOffset) {
          const T = new Error("maximum file length exceeded");
          T.code = "ETOOBIG", x.destroyed = !0, S(T);
          return;
        }
        g.copy(y.buffer, x.pos, 0, g.length), x.bytesWritten += g.length, x.pos = E, x.emit("progress"), S();
      }, x.destroy = () => {
        x.destroyed = !0;
      }, x;
    }
    ref() {
      this.refCount += 1;
    }
    unref() {
      if (this.refCount -= 1, this.refCount < 0)
        throw new Error("invalid unref");
    }
  }
  function d(m, h) {
    return new l(m, h);
  }
  function f(m, h) {
    return new s(m, h);
  }
  return Oc.createFromBuffer = d, Oc.createFromFd = f, Oc.BufferSlicer = l, Oc.FdSlicer = s, Oc;
}
var hT;
function JW() {
  if (hT) return Ui;
  hT = 1;
  var t = de, e = qu, n = YW(), r = t8(), i = _n, o = xs.EventEmitter, s = ir.Transform, a = ir.PassThrough, c = ir.Writable;
  Ui.open = u, Ui.fromFd = l, Ui.fromBuffer = d, Ui.fromRandomAccessReader = f, Ui.dosDateTimeToDate = g, Ui.validateFileName = v, Ui.ZipFile = m, Ui.Entry = x, Ui.RandomAccessReader = T;
  function u(B, D, X) {
    typeof D == "function" && (X = D, D = null), D == null && (D = {}), D.autoClose == null && (D.autoClose = !0), D.lazyEntries == null && (D.lazyEntries = !1), D.decodeStrings == null && (D.decodeStrings = !0), D.validateEntrySizes == null && (D.validateEntrySizes = !0), D.strictFileNames == null && (D.strictFileNames = !1), X == null && (X = J), t.open(B, "r", function(V, K) {
      if (V) return X(V);
      l(K, D, function($, _) {
        $ && t.close(K, J), X($, _);
      });
    });
  }
  function l(B, D, X) {
    typeof D == "function" && (X = D, D = null), D == null && (D = {}), D.autoClose == null && (D.autoClose = !1), D.lazyEntries == null && (D.lazyEntries = !1), D.decodeStrings == null && (D.decodeStrings = !0), D.validateEntrySizes == null && (D.validateEntrySizes = !0), D.strictFileNames == null && (D.strictFileNames = !1), X == null && (X = J), t.fstat(B, function(V, K) {
      if (V) return X(V);
      var $ = n.createFromFd(B, { autoClose: !0 });
      f($, K.size, D, X);
    });
  }
  function d(B, D, X) {
    typeof D == "function" && (X = D, D = null), D == null && (D = {}), D.autoClose = !1, D.lazyEntries == null && (D.lazyEntries = !1), D.decodeStrings == null && (D.decodeStrings = !0), D.validateEntrySizes == null && (D.validateEntrySizes = !0), D.strictFileNames == null && (D.strictFileNames = !1);
    var V = n.createFromBuffer(B, { maxChunkSize: 65536 });
    f(V, B.length, D, X);
  }
  function f(B, D, X, V) {
    typeof X == "function" && (V = X, X = null), X == null && (X = {}), X.autoClose == null && (X.autoClose = !0), X.lazyEntries == null && (X.lazyEntries = !1), X.decodeStrings == null && (X.decodeStrings = !0);
    var K = !!X.decodeStrings;
    if (X.validateEntrySizes == null && (X.validateEntrySizes = !0), X.strictFileNames == null && (X.strictFileNames = !1), V == null && (V = J), typeof D != "number") throw new Error("expected totalSize parameter to be a number");
    if (D > Number.MAX_SAFE_INTEGER)
      throw new Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.");
    B.ref();
    var $ = 22, _ = 65535, I = Math.min($ + _, D), N = G(I), U = D - N.length;
    S(B, N, 0, I, U, function(C) {
      if (C) return V(C);
      for (var L = I - $; L >= 0; L -= 1)
        if (N.readUInt32LE(L) === 101010256) {
          var k = N.slice(L), M = k.readUInt16LE(4);
          if (M !== 0)
            return V(new Error("multi-disk zip files are not supported: found disk number: " + M));
          var F = k.readUInt16LE(10), A = k.readUInt32LE(16), O = k.readUInt16LE(20), Z = k.length - $;
          if (O !== Z)
            return V(new Error("invalid comment length. expected: " + Z + ". found: " + O));
          var ee = K ? Y(k, 22, k.length, !1) : k.slice(22);
          if (!(F === 65535 || A === 4294967295))
            return V(null, new m(B, A, D, F, ee, X.autoClose, X.lazyEntries, K, X.validateEntrySizes, X.strictFileNames));
          var P = G(20), Q = U + L - P.length;
          S(B, P, 0, P.length, Q, function(z) {
            if (z) return V(z);
            if (P.readUInt32LE(0) !== 117853008)
              return V(new Error("invalid zip64 end of central directory locator signature"));
            var se = W(P, 8), ae = G(56);
            S(B, ae, 0, ae.length, se, function(ie) {
              return ie ? V(ie) : ae.readUInt32LE(0) !== 101075792 ? V(new Error("invalid zip64 end of central directory record signature")) : (F = W(ae, 32), A = W(ae, 48), V(null, new m(B, A, D, F, ee, X.autoClose, X.lazyEntries, K, X.validateEntrySizes, X.strictFileNames)));
            });
          });
          return;
        }
      V(new Error("end of central directory record signature not found"));
    });
  }
  i.inherits(m, o);
  function m(B, D, X, V, K, $, _, I, N, U) {
    var C = this;
    o.call(C), C.reader = B, C.reader.on("error", function(L) {
      y(C, L);
    }), C.reader.once("close", function() {
      C.emit("close");
    }), C.readEntryCursor = D, C.fileSize = X, C.entryCount = V, C.comment = K, C.entriesRead = 0, C.autoClose = !!$, C.lazyEntries = !!_, C.decodeStrings = !!I, C.validateEntrySizes = !!N, C.strictFileNames = !!U, C.isOpen = !0, C.emittedError = !1, C.lazyEntries || C._readEntry();
  }
  m.prototype.close = function() {
    this.isOpen && (this.isOpen = !1, this.reader.unref());
  };
  function h(B, D) {
    B.autoClose && B.close(), y(B, D);
  }
  function y(B, D) {
    B.emittedError || (B.emittedError = !0, B.emit("error", D));
  }
  m.prototype.readEntry = function() {
    if (!this.lazyEntries) throw new Error("readEntry() called without lazyEntries:true");
    this._readEntry();
  }, m.prototype._readEntry = function() {
    var B = this;
    if (B.entryCount === B.entriesRead) {
      setImmediate(function() {
        B.autoClose && B.close(), !B.emittedError && B.emit("end");
      });
      return;
    }
    if (!B.emittedError) {
      var D = G(46);
      S(B.reader, D, 0, D.length, B.readEntryCursor, function(X) {
        if (X) return h(B, X);
        if (!B.emittedError) {
          var V = new x(), K = D.readUInt32LE(0);
          if (K !== 33639248) return h(B, new Error("invalid central directory file header signature: 0x" + K.toString(16)));
          if (V.versionMadeBy = D.readUInt16LE(4), V.versionNeededToExtract = D.readUInt16LE(6), V.generalPurposeBitFlag = D.readUInt16LE(8), V.compressionMethod = D.readUInt16LE(10), V.lastModFileTime = D.readUInt16LE(12), V.lastModFileDate = D.readUInt16LE(14), V.crc32 = D.readUInt32LE(16), V.compressedSize = D.readUInt32LE(20), V.uncompressedSize = D.readUInt32LE(24), V.fileNameLength = D.readUInt16LE(28), V.extraFieldLength = D.readUInt16LE(30), V.fileCommentLength = D.readUInt16LE(32), V.internalFileAttributes = D.readUInt16LE(36), V.externalFileAttributes = D.readUInt32LE(38), V.relativeOffsetOfLocalHeader = D.readUInt32LE(42), V.generalPurposeBitFlag & 64) return h(B, new Error("strong encryption is not supported"));
          B.readEntryCursor += 46, D = G(V.fileNameLength + V.extraFieldLength + V.fileCommentLength), S(B.reader, D, 0, D.length, B.readEntryCursor, function($) {
            if ($) return h(B, $);
            if (!B.emittedError) {
              var _ = (V.generalPurposeBitFlag & 2048) !== 0;
              V.fileName = B.decodeStrings ? Y(D, 0, V.fileNameLength, _) : D.slice(0, V.fileNameLength);
              var I = V.fileNameLength + V.extraFieldLength, N = D.slice(V.fileNameLength, I);
              V.extraFields = [];
              for (var U = 0; U < N.length - 3; ) {
                var C = N.readUInt16LE(U + 0), L = N.readUInt16LE(U + 2), k = U + 4, M = k + L;
                if (M > N.length) return h(B, new Error("extra field length exceeds extra field buffer size"));
                var F = G(L);
                N.copy(F, 0, k, M), V.extraFields.push({
                  id: C,
                  data: F
                }), U = M;
              }
              if (V.fileComment = B.decodeStrings ? Y(D, I, I + V.fileCommentLength, _) : D.slice(I, I + V.fileCommentLength), V.comment = V.fileComment, B.readEntryCursor += D.length, B.entriesRead += 1, V.uncompressedSize === 4294967295 || V.compressedSize === 4294967295 || V.relativeOffsetOfLocalHeader === 4294967295) {
                for (var A = null, U = 0; U < V.extraFields.length; U++) {
                  var O = V.extraFields[U];
                  if (O.id === 1) {
                    A = O.data;
                    break;
                  }
                }
                if (A == null)
                  return h(B, new Error("expected zip64 extended information extra field"));
                var Z = 0;
                if (V.uncompressedSize === 4294967295) {
                  if (Z + 8 > A.length)
                    return h(B, new Error("zip64 extended information extra field does not include uncompressed size"));
                  V.uncompressedSize = W(A, Z), Z += 8;
                }
                if (V.compressedSize === 4294967295) {
                  if (Z + 8 > A.length)
                    return h(B, new Error("zip64 extended information extra field does not include compressed size"));
                  V.compressedSize = W(A, Z), Z += 8;
                }
                if (V.relativeOffsetOfLocalHeader === 4294967295) {
                  if (Z + 8 > A.length)
                    return h(B, new Error("zip64 extended information extra field does not include relative header offset"));
                  V.relativeOffsetOfLocalHeader = W(A, Z), Z += 8;
                }
              }
              if (B.decodeStrings)
                for (var U = 0; U < V.extraFields.length; U++) {
                  var O = V.extraFields[U];
                  if (O.id === 28789) {
                    if (O.data.length < 6 || O.data.readUInt8(0) !== 1)
                      continue;
                    var ee = O.data.readUInt32LE(1);
                    if (r.unsigned(D.slice(0, V.fileNameLength)) !== ee)
                      continue;
                    V.fileName = Y(O.data, 5, O.data.length, !0);
                    break;
                  }
                }
              if (B.validateEntrySizes && V.compressionMethod === 0) {
                var P = V.uncompressedSize;
                if (V.isEncrypted() && (P += 12), V.compressedSize !== P) {
                  var Q = "compressed/uncompressed size mismatch for stored file: " + V.compressedSize + " != " + V.uncompressedSize;
                  return h(B, new Error(Q));
                }
              }
              if (B.decodeStrings) {
                B.strictFileNames || (V.fileName = V.fileName.replace(/\\/g, "/"));
                var z = v(V.fileName, B.validateFileNameOptions);
                if (z != null) return h(B, new Error(z));
              }
              B.emit("entry", V), B.lazyEntries || B._readEntry();
            }
          });
        }
      });
    }
  }, m.prototype.openReadStream = function(B, D, X) {
    var V = this, K = 0, $ = B.compressedSize;
    if (X == null)
      X = D, D = {};
    else {
      if (D.decrypt != null) {
        if (!B.isEncrypted())
          throw new Error("options.decrypt can only be specified for encrypted entries");
        if (D.decrypt !== !1) throw new Error("invalid options.decrypt value: " + D.decrypt);
        if (B.isCompressed() && D.decompress !== !1)
          throw new Error("entry is encrypted and compressed, and options.decompress !== false");
      }
      if (D.decompress != null) {
        if (!B.isCompressed())
          throw new Error("options.decompress can only be specified for compressed entries");
        if (!(D.decompress === !1 || D.decompress === !0))
          throw new Error("invalid options.decompress value: " + D.decompress);
      }
      if (D.start != null || D.end != null) {
        if (B.isCompressed() && D.decompress !== !1)
          throw new Error("start/end range not allowed for compressed entry without options.decompress === false");
        if (B.isEncrypted() && D.decrypt !== !1)
          throw new Error("start/end range not allowed for encrypted entry without options.decrypt === false");
      }
      if (D.start != null) {
        if (K = D.start, K < 0) throw new Error("options.start < 0");
        if (K > B.compressedSize) throw new Error("options.start > entry.compressedSize");
      }
      if (D.end != null) {
        if ($ = D.end, $ < 0) throw new Error("options.end < 0");
        if ($ > B.compressedSize) throw new Error("options.end > entry.compressedSize");
        if ($ < K) throw new Error("options.end < options.start");
      }
    }
    if (!V.isOpen) return X(new Error("closed"));
    if (B.isEncrypted() && D.decrypt !== !1)
      return X(new Error("entry is encrypted, and options.decrypt !== false"));
    V.reader.ref();
    var _ = G(30);
    S(V.reader, _, 0, _.length, B.relativeOffsetOfLocalHeader, function(I) {
      try {
        if (I) return X(I);
        var N = _.readUInt32LE(0);
        if (N !== 67324752)
          return X(new Error("invalid local file header signature: 0x" + N.toString(16)));
        var U = _.readUInt16LE(26), C = _.readUInt16LE(28), L = B.relativeOffsetOfLocalHeader + _.length + U + C, k;
        if (B.compressionMethod === 0)
          k = !1;
        else if (B.compressionMethod === 8)
          k = D.decompress != null ? D.decompress : !0;
        else
          return X(new Error("unsupported compression method: " + B.compressionMethod));
        var M = L, F = M + B.compressedSize;
        if (B.compressedSize !== 0 && F > V.fileSize)
          return X(new Error("file data overflows file bounds: " + M + " + " + B.compressedSize + " > " + V.fileSize));
        var A = V.reader.createReadStream({
          start: M + K,
          end: M + $
        }), O = A;
        if (k) {
          var Z = !1, ee = e.createInflateRaw();
          A.on("error", function(P) {
            setImmediate(function() {
              Z || ee.emit("error", P);
            });
          }), A.pipe(ee), V.validateEntrySizes ? (O = new E(B.uncompressedSize), ee.on("error", function(P) {
            setImmediate(function() {
              Z || O.emit("error", P);
            });
          }), ee.pipe(O)) : O = ee, O.destroy = function() {
            Z = !0, ee !== O && ee.unpipe(O), A.unpipe(ee), A.destroy();
          };
        }
        X(null, O);
      } finally {
        V.reader.unref();
      }
    });
  };
  function x() {
  }
  x.prototype.getLastModDate = function() {
    return g(this.lastModFileDate, this.lastModFileTime);
  }, x.prototype.isEncrypted = function() {
    return (this.generalPurposeBitFlag & 1) !== 0;
  }, x.prototype.isCompressed = function() {
    return this.compressionMethod === 8;
  };
  function g(B, D) {
    var X = B & 31, V = (B >> 5 & 15) - 1, K = (B >> 9 & 127) + 1980, $ = 0, _ = (D & 31) * 2, I = D >> 5 & 63, N = D >> 11 & 31;
    return new Date(K, V, X, N, I, _, $);
  }
  function v(B) {
    return B.indexOf("\\") !== -1 ? "invalid characters in fileName: " + B : /^[a-zA-Z]:/.test(B) || /^\//.test(B) ? "absolute path: " + B : B.split("/").indexOf("..") !== -1 ? "invalid relative path: " + B : null;
  }
  function S(B, D, X, V, K, $) {
    if (V === 0)
      return setImmediate(function() {
        $(null, G(0));
      });
    B.read(D, X, V, K, function(_, I) {
      if (_) return $(_);
      if (I < V)
        return $(new Error("unexpected EOF"));
      $();
    });
  }
  i.inherits(E, s);
  function E(B) {
    s.call(this), this.actualByteCount = 0, this.expectedByteCount = B;
  }
  E.prototype._transform = function(B, D, X) {
    if (this.actualByteCount += B.length, this.actualByteCount > this.expectedByteCount) {
      var V = "too many bytes in the stream. expected " + this.expectedByteCount + ". got at least " + this.actualByteCount;
      return X(new Error(V));
    }
    X(null, B);
  }, E.prototype._flush = function(B) {
    if (this.actualByteCount < this.expectedByteCount) {
      var D = "not enough bytes in the stream. expected " + this.expectedByteCount + ". got only " + this.actualByteCount;
      return B(new Error(D));
    }
    B();
  }, i.inherits(T, o);
  function T() {
    o.call(this), this.refCount = 0;
  }
  T.prototype.ref = function() {
    this.refCount += 1;
  }, T.prototype.unref = function() {
    var B = this;
    if (B.refCount -= 1, B.refCount > 0) return;
    if (B.refCount < 0) throw new Error("invalid unref");
    B.close(D);
    function D(X) {
      if (X) return B.emit("error", X);
      B.emit("close");
    }
  }, T.prototype.createReadStream = function(B) {
    var D = B.start, X = B.end;
    if (D === X) {
      var V = new a();
      return setImmediate(function() {
        V.end();
      }), V;
    }
    var K = this._readStreamForRange(D, X), $ = !1, _ = new j(this);
    K.on("error", function(N) {
      setImmediate(function() {
        $ || _.emit("error", N);
      });
    }), _.destroy = function() {
      K.unpipe(_), _.unref(), K.destroy();
    };
    var I = new E(X - D);
    return _.on("error", function(N) {
      setImmediate(function() {
        $ || I.emit("error", N);
      });
    }), I.destroy = function() {
      $ = !0, _.unpipe(I), _.destroy();
    }, K.pipe(_).pipe(I);
  }, T.prototype._readStreamForRange = function(B, D) {
    throw new Error("not implemented");
  }, T.prototype.read = function(B, D, X, V, K) {
    var $ = this.createReadStream({ start: V, end: V + X }), _ = new c(), I = 0;
    _._write = function(N, U, C) {
      N.copy(B, D + I, 0, N.length), I += N.length, C();
    }, _.on("finish", K), $.on("error", function(N) {
      K(N);
    }), $.pipe(_);
  }, T.prototype.close = function(B) {
    setImmediate(B);
  }, i.inherits(j, a);
  function j(B) {
    a.call(this), this.context = B, this.context.ref(), this.unreffedYet = !1;
  }
  j.prototype._flush = function(B) {
    this.unref(), B();
  }, j.prototype.unref = function(B) {
    this.unreffedYet || (this.unreffedYet = !0, this.context.unref());
  };
  var q = "\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñÑªº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ";
  function Y(B, D, X, V) {
    if (V)
      return B.toString("utf8", D, X);
    for (var K = "", $ = D; $ < X; $++)
      K += q[B[$]];
    return K;
  }
  function W(B, D) {
    var X = B.readUInt32LE(D), V = B.readUInt32LE(D + 4);
    return V * 4294967296 + X;
  }
  var G;
  typeof Buffer.allocUnsafe == "function" ? G = function(B) {
    return Buffer.allocUnsafe(B);
  } : G = function(B) {
    return new Buffer(B);
  };
  function J(B) {
    if (B) throw B;
  }
  return Ui;
}
var gv, mT;
function XW() {
  if (mT) return gv;
  mT = 1;
  const t = ir;
  class e extends t.Writable {
    emit(r, i) {
      if (r === "error") {
        const o = i;
        o.name === "Error" && (o.name = this.constructor.name + "Error");
      }
      super.emit.apply(this, arguments);
    }
  }
  return gv = e, gv;
}
var yv = { exports: {} }, vv, gT;
function gc() {
  if (gT) return vv;
  gT = 1;
  var t = pa, e = t.Buffer, n = {}, r;
  for (r in t)
    t.hasOwnProperty(r) && (r === "SlowBuffer" || r === "Buffer" || (n[r] = t[r]));
  var i = n.Buffer = {};
  for (r in e)
    e.hasOwnProperty(r) && (r === "allocUnsafe" || r === "allocUnsafeSlow" || (i[r] = e[r]));
  if (n.Buffer.prototype = e.prototype, (!i.from || i.from === Uint8Array.from) && (i.from = function(o, s, a) {
    if (typeof o == "number")
      throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof o);
    if (o && typeof o.length > "u")
      throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof o);
    return e(o, s, a);
  }), i.alloc || (i.alloc = function(o, s, a) {
    if (typeof o != "number")
      throw new TypeError('The "size" argument must be of type number. Received type ' + typeof o);
    if (o < 0 || o >= 2 * (1 << 30))
      throw new RangeError('The value "' + o + '" is invalid for option "size"');
    var c = e(o);
    return !s || s.length === 0 ? c.fill(0) : typeof a == "string" ? c.fill(s, a) : c.fill(s), c;
  }), !n.kStringMaxLength)
    try {
      n.kStringMaxLength = process.binding("buffer").kStringMaxLength;
    } catch {
    }
  return n.constants || (n.constants = {
    MAX_LENGTH: n.kMaxLength
  }, n.kStringMaxLength && (n.constants.MAX_STRING_LENGTH = n.kStringMaxLength)), vv = n, vv;
}
var Wf = {}, yT;
function ZW() {
  if (yT) return Wf;
  yT = 1;
  var t = "\uFEFF";
  Wf.PrependBOM = e;
  function e(r, i) {
    this.encoder = r, this.addBOM = !0;
  }
  e.prototype.write = function(r) {
    return this.addBOM && (r = t + r, this.addBOM = !1), this.encoder.write(r);
  }, e.prototype.end = function() {
    return this.encoder.end();
  }, Wf.StripBOM = n;
  function n(r, i) {
    this.decoder = r, this.pass = !1, this.options = i || {};
  }
  return n.prototype.write = function(r) {
    var i = this.decoder.write(r);
    return this.pass || !i || (i[0] === t && (i = i.slice(1), typeof this.options.stripBOM == "function" && this.options.stripBOM()), this.pass = !0), i;
  }, n.prototype.end = function() {
    return this.decoder.end();
  }, Wf;
}
var bv = {}, xv, vT;
function ez() {
  if (vT) return xv;
  vT = 1;
  var t = gc().Buffer;
  xv = {
    // Encodings
    utf8: { type: "_internal", bomAware: !0 },
    cesu8: { type: "_internal", bomAware: !0 },
    unicode11utf8: "utf8",
    ucs2: { type: "_internal", bomAware: !0 },
    utf16le: "ucs2",
    binary: { type: "_internal" },
    base64: { type: "_internal" },
    hex: { type: "_internal" },
    // Codec.
    _internal: e
  };
  function e(c, u) {
    this.enc = c.encodingName, this.bomAware = c.bomAware, this.enc === "base64" ? this.encoder = o : this.enc === "cesu8" && (this.enc = "utf8", this.encoder = s, t.from("eda0bdedb2a9", "hex").toString() !== "💩" && (this.decoder = a, this.defaultCharUnicode = u.defaultCharUnicode));
  }
  e.prototype.encoder = i, e.prototype.decoder = r;
  var n = K_.StringDecoder;
  n.prototype.end || (n.prototype.end = function() {
  });
  function r(c, u) {
    n.call(this, u.enc);
  }
  r.prototype = n.prototype;
  function i(c, u) {
    this.enc = u.enc;
  }
  i.prototype.write = function(c) {
    return t.from(c, this.enc);
  }, i.prototype.end = function() {
  };
  function o(c, u) {
    this.prevStr = "";
  }
  o.prototype.write = function(c) {
    c = this.prevStr + c;
    var u = c.length - c.length % 4;
    return this.prevStr = c.slice(u), c = c.slice(0, u), t.from(c, "base64");
  }, o.prototype.end = function() {
    return t.from(this.prevStr, "base64");
  };
  function s(c, u) {
  }
  s.prototype.write = function(c) {
    for (var u = t.alloc(c.length * 3), l = 0, d = 0; d < c.length; d++) {
      var f = c.charCodeAt(d);
      f < 128 ? u[l++] = f : f < 2048 ? (u[l++] = 192 + (f >>> 6), u[l++] = 128 + (f & 63)) : (u[l++] = 224 + (f >>> 12), u[l++] = 128 + (f >>> 6 & 63), u[l++] = 128 + (f & 63));
    }
    return u.slice(0, l);
  }, s.prototype.end = function() {
  };
  function a(c, u) {
    this.acc = 0, this.contBytes = 0, this.accBytes = 0, this.defaultCharUnicode = u.defaultCharUnicode;
  }
  return a.prototype.write = function(c) {
    for (var u = this.acc, l = this.contBytes, d = this.accBytes, f = "", m = 0; m < c.length; m++) {
      var h = c[m];
      (h & 192) !== 128 ? (l > 0 && (f += this.defaultCharUnicode, l = 0), h < 128 ? f += String.fromCharCode(h) : h < 224 ? (u = h & 31, l = 1, d = 1) : h < 240 ? (u = h & 15, l = 2, d = 1) : f += this.defaultCharUnicode) : l > 0 ? (u = u << 6 | h & 63, l--, d++, l === 0 && (d === 2 && u < 128 && u > 0 ? f += this.defaultCharUnicode : d === 3 && u < 2048 ? f += this.defaultCharUnicode : f += String.fromCharCode(u))) : f += this.defaultCharUnicode;
    }
    return this.acc = u, this.contBytes = l, this.accBytes = d, f;
  }, a.prototype.end = function() {
    var c = 0;
    return this.contBytes > 0 && (c += this.defaultCharUnicode), c;
  }, xv;
}
var qo = {}, bT;
function tz() {
  if (bT) return qo;
  bT = 1;
  var t = gc().Buffer;
  qo._utf32 = e;
  function e(c, u) {
    this.iconv = u, this.bomAware = !0, this.isLE = c.isLE;
  }
  qo.utf32le = { type: "_utf32", isLE: !0 }, qo.utf32be = { type: "_utf32", isLE: !1 }, qo.ucs4le = "utf32le", qo.ucs4be = "utf32be", e.prototype.encoder = n, e.prototype.decoder = r;
  function n(c, u) {
    this.isLE = u.isLE, this.highSurrogate = 0;
  }
  n.prototype.write = function(c) {
    for (var u = t.from(c, "ucs2"), l = t.alloc(u.length * 2), d = this.isLE ? l.writeUInt32LE : l.writeUInt32BE, f = 0, m = 0; m < u.length; m += 2) {
      var h = u.readUInt16LE(m), y = 55296 <= h && h < 56320, x = 56320 <= h && h < 57344;
      if (this.highSurrogate)
        if (y || !x)
          d.call(l, this.highSurrogate, f), f += 4;
        else {
          var g = (this.highSurrogate - 55296 << 10 | h - 56320) + 65536;
          d.call(l, g, f), f += 4, this.highSurrogate = 0;
          continue;
        }
      y ? this.highSurrogate = h : (d.call(l, h, f), f += 4, this.highSurrogate = 0);
    }
    return f < l.length && (l = l.slice(0, f)), l;
  }, n.prototype.end = function() {
    if (this.highSurrogate) {
      var c = t.alloc(4);
      return this.isLE ? c.writeUInt32LE(this.highSurrogate, 0) : c.writeUInt32BE(this.highSurrogate, 0), this.highSurrogate = 0, c;
    }
  };
  function r(c, u) {
    this.isLE = u.isLE, this.badChar = u.iconv.defaultCharUnicode.charCodeAt(0), this.overflow = null;
  }
  r.prototype.write = function(c) {
    if (c.length === 0)
      return "";
    this.overflow && (c = t.concat([this.overflow, c]));
    var u = c.length - c.length % 4;
    c.length !== u ? (this.overflow = c.slice(u), c = c.slice(0, u)) : this.overflow = null;
    for (var l = t.alloc(u), d = 0, f = 0; f < u; f += 4) {
      var m = this.isLE ? c.readUInt32LE(f) : c.readUInt32BE(f);
      if (m < 65536)
        l.writeUInt16LE(m, d), d += 2;
      else if (m > 1114111)
        l.writeUInt16LE(this.badChar, d), d += 2;
      else {
        m -= 65536;
        var h = 55296 | m >> 10, y = 56320 + (m & 1023);
        l.writeUInt16LE(h, d), d += 2, l.writeUInt16LE(y, d), d += 2;
      }
    }
    return l.slice(0, d).toString("ucs2");
  }, r.prototype.end = function() {
    this.overflow = null;
  }, qo.utf32 = i, qo.ucs4 = i;
  function i(c, u) {
    this.iconv = u;
  }
  i.prototype.encoder = o, i.prototype.decoder = s;
  function o(c, u) {
    c = c || {}, c.addBOM === void 0 && (c.addBOM = !0), this.encoder = u.iconv.getEncoder(c.defaultEncoding || "utf-32le", c);
  }
  o.prototype.write = function(c) {
    return this.encoder.write(c);
  }, o.prototype.end = function() {
    return this.encoder.end();
  };
  function s(c, u) {
    this.decoder = null, this.initialBytes = [], this.initialBytesLen = 0, this.options = c || {}, this.iconv = u.iconv;
  }
  s.prototype.write = function(c) {
    if (!this.decoder) {
      if (this.initialBytes.push(c), this.initialBytesLen += c.length, this.initialBytesLen < 32)
        return "";
      var u = t.concat(this.initialBytes), l = a(u, this.options.defaultEncoding);
      this.decoder = this.iconv.getDecoder(l, this.options), this.initialBytes.length = this.initialBytesLen = 0;
    }
    return this.decoder.write(c);
  }, s.prototype.end = function() {
    if (!this.decoder) {
      var c = t.concat(this.initialBytes), u = a(c, this.options.defaultEncoding);
      this.decoder = this.iconv.getDecoder(u, this.options);
      var l = this.decoder.write(c), d = this.decoder.end();
      return d ? l + d : l;
    }
    return this.decoder.end();
  };
  function a(c, u) {
    var l = u || "utf-32le";
    if (c.length >= 4)
      if (c.readUInt32BE(0) === 65279)
        l = "utf-32be";
      else if (c.readUInt32LE(0) === 65279)
        l = "utf-32le";
      else {
        for (var d = 0, f = 0, m = 0, h = 0, y = Math.min(c.length - c.length % 4, 128), x = 0; x < y; x += 4) {
          var g = c[x], v = c[x + 1], S = c[x + 2], E = c[x + 3];
          (g !== 0 || v > 16) && ++f, (E !== 0 || S > 16) && ++d, g === 0 && v === 0 && S === 0 && E !== 0 && h++, g !== 0 && v === 0 && S === 0 && E === 0 && m++;
        }
        f < d ? l = "utf-32be" : d < f && (l = "utf-32le"), h > m ? l = "utf-32be" : h < m && (l = "utf-32le");
      }
    return l;
  }
  return qo;
}
var zf = {}, xT;
function nz() {
  if (xT) return zf;
  xT = 1;
  var t = gc().Buffer;
  zf.utf16be = e;
  function e() {
  }
  e.prototype.encoder = n, e.prototype.decoder = r, e.prototype.bomAware = !0;
  function n() {
  }
  n.prototype.write = function(c) {
    for (var u = t.from(c, "ucs2"), l = 0; l < u.length; l += 2) {
      var d = u[l];
      u[l] = u[l + 1], u[l + 1] = d;
    }
    return u;
  }, n.prototype.end = function() {
  };
  function r() {
    this.overflowByte = -1;
  }
  r.prototype.write = function(c) {
    if (c.length == 0)
      return "";
    var u = t.alloc(c.length + 1), l = 0, d = 0;
    for (this.overflowByte !== -1 && (u[0] = c[0], u[1] = this.overflowByte, l = 1, d = 2); l < c.length - 1; l += 2, d += 2)
      u[d] = c[l + 1], u[d + 1] = c[l];
    return this.overflowByte = l == c.length - 1 ? c[c.length - 1] : -1, u.slice(0, d).toString("ucs2");
  }, r.prototype.end = function() {
  }, zf.utf16 = i;
  function i(c, u) {
    this.iconv = u;
  }
  i.prototype.encoder = o, i.prototype.decoder = s;
  function o(c, u) {
    c = c || {}, c.addBOM === void 0 && (c.addBOM = !0), this.encoder = u.iconv.getEncoder("utf-16le", c);
  }
  o.prototype.write = function(c) {
    return this.encoder.write(c);
  }, o.prototype.end = function() {
    return this.encoder.end();
  };
  function s(c, u) {
    this.decoder = null, this.initialBytes = [], this.initialBytesLen = 0, this.options = c || {}, this.iconv = u.iconv;
  }
  s.prototype.write = function(c) {
    if (!this.decoder) {
      if (this.initialBytes.push(c), this.initialBytesLen += c.length, this.initialBytesLen < 16)
        return "";
      var c = t.concat(this.initialBytes), u = a(c, this.options.defaultEncoding);
      this.decoder = this.iconv.getDecoder(u, this.options), this.initialBytes.length = this.initialBytesLen = 0;
    }
    return this.decoder.write(c);
  }, s.prototype.end = function() {
    if (!this.decoder) {
      var c = t.concat(this.initialBytes), u = a(c, this.options.defaultEncoding);
      this.decoder = this.iconv.getDecoder(u, this.options);
      var l = this.decoder.write(c), d = this.decoder.end();
      return d ? l + d : l;
    }
    return this.decoder.end();
  };
  function a(c, u) {
    var l = u || "utf-16le";
    if (c.length >= 2)
      if (c[0] == 254 && c[1] == 255)
        l = "utf-16be";
      else if (c[0] == 255 && c[1] == 254)
        l = "utf-16le";
      else {
        for (var d = 0, f = 0, m = Math.min(c.length - c.length % 2, 64), h = 0; h < m; h += 2)
          c[h] === 0 && c[h + 1] !== 0 && f++, c[h] !== 0 && c[h + 1] === 0 && d++;
        f > d ? l = "utf-16be" : f < d && (l = "utf-16le");
      }
    return l;
  }
  return zf;
}
var Fl = {}, wT;
function rz() {
  if (wT) return Fl;
  wT = 1;
  var t = gc().Buffer;
  Fl.utf7 = e, Fl.unicode11utf7 = "utf7";
  function e(y, x) {
    this.iconv = x;
  }
  e.prototype.encoder = r, e.prototype.decoder = i, e.prototype.bomAware = !0;
  var n = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g;
  function r(y, x) {
    this.iconv = x.iconv;
  }
  r.prototype.write = function(y) {
    return t.from(y.replace(n, function(x) {
      return "+" + (x === "+" ? "" : this.iconv.encode(x, "utf16-be").toString("base64").replace(/=+$/, "")) + "-";
    }.bind(this)));
  }, r.prototype.end = function() {
  };
  function i(y, x) {
    this.iconv = x.iconv, this.inBase64 = !1, this.base64Accum = "";
  }
  for (var o = /[A-Za-z0-9\/+]/, s = [], a = 0; a < 256; a++)
    s[a] = o.test(String.fromCharCode(a));
  var c = 43, u = 45, l = 38;
  i.prototype.write = function(y) {
    for (var x = "", g = 0, v = this.inBase64, S = this.base64Accum, E = 0; E < y.length; E++)
      if (!v)
        y[E] == c && (x += this.iconv.decode(y.slice(g, E), "ascii"), g = E + 1, v = !0);
      else if (!s[y[E]]) {
        if (E == g && y[E] == u)
          x += "+";
        else {
          var T = S + y.slice(g, E).toString();
          x += this.iconv.decode(t.from(T, "base64"), "utf16-be");
        }
        y[E] != u && E--, g = E + 1, v = !1, S = "";
      }
    if (!v)
      x += this.iconv.decode(y.slice(g), "ascii");
    else {
      var T = S + y.slice(g).toString(), j = T.length - T.length % 8;
      S = T.slice(j), T = T.slice(0, j), x += this.iconv.decode(t.from(T, "base64"), "utf16-be");
    }
    return this.inBase64 = v, this.base64Accum = S, x;
  }, i.prototype.end = function() {
    var y = "";
    return this.inBase64 && this.base64Accum.length > 0 && (y = this.iconv.decode(t.from(this.base64Accum, "base64"), "utf16-be")), this.inBase64 = !1, this.base64Accum = "", y;
  }, Fl.utf7imap = d;
  function d(y, x) {
    this.iconv = x;
  }
  d.prototype.encoder = f, d.prototype.decoder = m, d.prototype.bomAware = !0;
  function f(y, x) {
    this.iconv = x.iconv, this.inBase64 = !1, this.base64Accum = t.alloc(6), this.base64AccumIdx = 0;
  }
  f.prototype.write = function(y) {
    for (var x = this.inBase64, g = this.base64Accum, v = this.base64AccumIdx, S = t.alloc(y.length * 5 + 10), E = 0, T = 0; T < y.length; T++) {
      var j = y.charCodeAt(T);
      32 <= j && j <= 126 ? (x && (v > 0 && (E += S.write(g.slice(0, v).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), E), v = 0), S[E++] = u, x = !1), x || (S[E++] = j, j === l && (S[E++] = u))) : (x || (S[E++] = l, x = !0), x && (g[v++] = j >> 8, g[v++] = j & 255, v == g.length && (E += S.write(g.toString("base64").replace(/\//g, ","), E), v = 0)));
    }
    return this.inBase64 = x, this.base64AccumIdx = v, S.slice(0, E);
  }, f.prototype.end = function() {
    var y = t.alloc(10), x = 0;
    return this.inBase64 && (this.base64AccumIdx > 0 && (x += y.write(this.base64Accum.slice(0, this.base64AccumIdx).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), x), this.base64AccumIdx = 0), y[x++] = u, this.inBase64 = !1), y.slice(0, x);
  };
  function m(y, x) {
    this.iconv = x.iconv, this.inBase64 = !1, this.base64Accum = "";
  }
  var h = s.slice();
  return h[44] = !0, m.prototype.write = function(y) {
    for (var x = "", g = 0, v = this.inBase64, S = this.base64Accum, E = 0; E < y.length; E++)
      if (!v)
        y[E] == l && (x += this.iconv.decode(y.slice(g, E), "ascii"), g = E + 1, v = !0);
      else if (!h[y[E]]) {
        if (E == g && y[E] == u)
          x += "&";
        else {
          var T = S + y.slice(g, E).toString().replace(/,/g, "/");
          x += this.iconv.decode(t.from(T, "base64"), "utf16-be");
        }
        y[E] != u && E--, g = E + 1, v = !1, S = "";
      }
    if (!v)
      x += this.iconv.decode(y.slice(g), "ascii");
    else {
      var T = S + y.slice(g).toString().replace(/,/g, "/"), j = T.length - T.length % 8;
      S = T.slice(j), T = T.slice(0, j), x += this.iconv.decode(t.from(T, "base64"), "utf16-be");
    }
    return this.inBase64 = v, this.base64Accum = S, x;
  }, m.prototype.end = function() {
    var y = "";
    return this.inBase64 && this.base64Accum.length > 0 && (y = this.iconv.decode(t.from(this.base64Accum, "base64"), "utf16-be")), this.inBase64 = !1, this.base64Accum = "", y;
  }, Fl;
}
var wv = {}, ST;
function iz() {
  if (ST) return wv;
  ST = 1;
  var t = gc().Buffer;
  wv._sbcs = e;
  function e(i, o) {
    if (!i)
      throw new Error("SBCS codec is called without the data.");
    if (!i.chars || i.chars.length !== 128 && i.chars.length !== 256)
      throw new Error("Encoding '" + i.type + "' has incorrect 'chars' (must be of len 128 or 256)");
    if (i.chars.length === 128) {
      for (var s = "", a = 0; a < 128; a++)
        s += String.fromCharCode(a);
      i.chars = s + i.chars;
    }
    this.decodeBuf = t.from(i.chars, "ucs2");
    for (var c = t.alloc(65536, o.defaultCharSingleByte.charCodeAt(0)), a = 0; a < i.chars.length; a++)
      c[i.chars.charCodeAt(a)] = a;
    this.encodeBuf = c;
  }
  e.prototype.encoder = n, e.prototype.decoder = r;
  function n(i, o) {
    this.encodeBuf = o.encodeBuf;
  }
  n.prototype.write = function(i) {
    for (var o = t.alloc(i.length), s = 0; s < i.length; s++)
      o[s] = this.encodeBuf[i.charCodeAt(s)];
    return o;
  }, n.prototype.end = function() {
  };
  function r(i, o) {
    this.decodeBuf = o.decodeBuf;
  }
  return r.prototype.write = function(i) {
    for (var o = this.decodeBuf, s = t.alloc(i.length * 2), a = 0, c = 0, u = 0; u < i.length; u++)
      a = i[u] * 2, c = u * 2, s[c] = o[a], s[c + 1] = o[a + 1];
    return s.toString("ucs2");
  }, r.prototype.end = function() {
  }, wv;
}
var Sv, _T;
function oz() {
  return _T || (_T = 1, Sv = {
    // Not supported by iconv, not sure why.
    10029: "maccenteuro",
    maccenteuro: {
      type: "_sbcs",
      chars: "ÄĀāÉĄÖÜáąČäčĆćéŹźĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņŃ¬√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ"
    },
    808: "cp808",
    ibm808: "cp808",
    cp808: {
      type: "_sbcs",
      chars: "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ "
    },
    mik: {
      type: "_sbcs",
      chars: "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
    },
    cp720: {
      type: "_sbcs",
      chars: "éâàçêëèïîّْô¤ـûùءآأؤ£إئابةتثجحخدذرزسشص«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ضطظعغفµقكلمنهوىي≡ًٌٍَُِ≈°∙·√ⁿ²■ "
    },
    // Aliases of generated encodings.
    ascii8bit: "ascii",
    usascii: "ascii",
    ansix34: "ascii",
    ansix341968: "ascii",
    ansix341986: "ascii",
    csascii: "ascii",
    cp367: "ascii",
    ibm367: "ascii",
    isoir6: "ascii",
    iso646us: "ascii",
    iso646irv: "ascii",
    us: "ascii",
    latin1: "iso88591",
    latin2: "iso88592",
    latin3: "iso88593",
    latin4: "iso88594",
    latin5: "iso88599",
    latin6: "iso885910",
    latin7: "iso885913",
    latin8: "iso885914",
    latin9: "iso885915",
    latin10: "iso885916",
    csisolatin1: "iso88591",
    csisolatin2: "iso88592",
    csisolatin3: "iso88593",
    csisolatin4: "iso88594",
    csisolatincyrillic: "iso88595",
    csisolatinarabic: "iso88596",
    csisolatingreek: "iso88597",
    csisolatinhebrew: "iso88598",
    csisolatin5: "iso88599",
    csisolatin6: "iso885910",
    l1: "iso88591",
    l2: "iso88592",
    l3: "iso88593",
    l4: "iso88594",
    l5: "iso88599",
    l6: "iso885910",
    l7: "iso885913",
    l8: "iso885914",
    l9: "iso885915",
    l10: "iso885916",
    isoir14: "iso646jp",
    isoir57: "iso646cn",
    isoir100: "iso88591",
    isoir101: "iso88592",
    isoir109: "iso88593",
    isoir110: "iso88594",
    isoir144: "iso88595",
    isoir127: "iso88596",
    isoir126: "iso88597",
    isoir138: "iso88598",
    isoir148: "iso88599",
    isoir157: "iso885910",
    isoir166: "tis620",
    isoir179: "iso885913",
    isoir199: "iso885914",
    isoir203: "iso885915",
    isoir226: "iso885916",
    cp819: "iso88591",
    ibm819: "iso88591",
    cyrillic: "iso88595",
    arabic: "iso88596",
    arabic8: "iso88596",
    ecma114: "iso88596",
    asmo708: "iso88596",
    greek: "iso88597",
    greek8: "iso88597",
    ecma118: "iso88597",
    elot928: "iso88597",
    hebrew: "iso88598",
    hebrew8: "iso88598",
    turkish: "iso88599",
    turkish8: "iso88599",
    thai: "iso885911",
    thai8: "iso885911",
    celtic: "iso885914",
    celtic8: "iso885914",
    isoceltic: "iso885914",
    tis6200: "tis620",
    tis62025291: "tis620",
    tis62025330: "tis620",
    1e4: "macroman",
    10006: "macgreek",
    10007: "maccyrillic",
    10079: "maciceland",
    10081: "macturkish",
    cspc8codepage437: "cp437",
    cspc775baltic: "cp775",
    cspc850multilingual: "cp850",
    cspcp852: "cp852",
    cspc862latinhebrew: "cp862",
    cpgr: "cp869",
    msee: "cp1250",
    mscyrl: "cp1251",
    msansi: "cp1252",
    msgreek: "cp1253",
    msturk: "cp1254",
    mshebr: "cp1255",
    msarab: "cp1256",
    winbaltrim: "cp1257",
    cp20866: "koi8r",
    20866: "koi8r",
    ibm878: "koi8r",
    cskoi8r: "koi8r",
    cp21866: "koi8u",
    21866: "koi8u",
    ibm1168: "koi8u",
    strk10482002: "rk1048",
    tcvn5712: "tcvn",
    tcvn57121: "tcvn",
    gb198880: "iso646cn",
    cn: "iso646cn",
    csiso14jisc6220ro: "iso646jp",
    jisc62201969ro: "iso646jp",
    jp: "iso646jp",
    cshproman8: "hproman8",
    r8: "hproman8",
    roman8: "hproman8",
    xroman8: "hproman8",
    ibm1051: "hproman8",
    mac: "macintosh",
    csmacintosh: "macintosh"
  }), Sv;
}
var _v, ET;
function sz() {
  return ET || (ET = 1, _v = {
    437: "cp437",
    737: "cp737",
    775: "cp775",
    850: "cp850",
    852: "cp852",
    855: "cp855",
    856: "cp856",
    857: "cp857",
    858: "cp858",
    860: "cp860",
    861: "cp861",
    862: "cp862",
    863: "cp863",
    864: "cp864",
    865: "cp865",
    866: "cp866",
    869: "cp869",
    874: "windows874",
    922: "cp922",
    1046: "cp1046",
    1124: "cp1124",
    1125: "cp1125",
    1129: "cp1129",
    1133: "cp1133",
    1161: "cp1161",
    1162: "cp1162",
    1163: "cp1163",
    1250: "windows1250",
    1251: "windows1251",
    1252: "windows1252",
    1253: "windows1253",
    1254: "windows1254",
    1255: "windows1255",
    1256: "windows1256",
    1257: "windows1257",
    1258: "windows1258",
    28591: "iso88591",
    28592: "iso88592",
    28593: "iso88593",
    28594: "iso88594",
    28595: "iso88595",
    28596: "iso88596",
    28597: "iso88597",
    28598: "iso88598",
    28599: "iso88599",
    28600: "iso885910",
    28601: "iso885911",
    28603: "iso885913",
    28604: "iso885914",
    28605: "iso885915",
    28606: "iso885916",
    windows874: {
      type: "_sbcs",
      chars: "€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"
    },
    win874: "windows874",
    cp874: "windows874",
    windows1250: {
      type: "_sbcs",
      chars: "€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙"
    },
    win1250: "windows1250",
    cp1250: "windows1250",
    windows1251: {
      type: "_sbcs",
      chars: "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"
    },
    win1251: "windows1251",
    cp1251: "windows1251",
    windows1252: {
      type: "_sbcs",
      chars: "€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
    },
    win1252: "windows1252",
    cp1252: "windows1252",
    windows1253: {
      type: "_sbcs",
      chars: "€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�"
    },
    win1253: "windows1253",
    cp1253: "windows1253",
    windows1254: {
      type: "_sbcs",
      chars: "€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ"
    },
    win1254: "windows1254",
    cp1254: "windows1254",
    windows1255: {
      type: "_sbcs",
      chars: "€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�"
    },
    win1255: "windows1255",
    cp1255: "windows1255",
    windows1256: {
      type: "_sbcs",
      chars: "€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے"
    },
    win1256: "windows1256",
    cp1256: "windows1256",
    windows1257: {
      type: "_sbcs",
      chars: "€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙"
    },
    win1257: "windows1257",
    cp1257: "windows1257",
    windows1258: {
      type: "_sbcs",
      chars: "€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"
    },
    win1258: "windows1258",
    cp1258: "windows1258",
    iso88591: {
      type: "_sbcs",
      chars: " ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
    },
    cp28591: "iso88591",
    iso88592: {
      type: "_sbcs",
      chars: " Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙"
    },
    cp28592: "iso88592",
    iso88593: {
      type: "_sbcs",
      chars: " Ħ˘£¤�Ĥ§¨İŞĞĴ­�Ż°ħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙"
    },
    cp28593: "iso88593",
    iso88594: {
      type: "_sbcs",
      chars: " ĄĸŖ¤ĨĻ§¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩļˇ¸šēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖ×ØŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙"
    },
    cp28594: "iso88594",
    iso88595: {
      type: "_sbcs",
      chars: " ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ"
    },
    cp28595: "iso88595",
    iso88596: {
      type: "_sbcs",
      chars: " ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������"
    },
    cp28596: "iso88596",
    iso88597: {
      type: "_sbcs",
      chars: " ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�"
    },
    cp28597: "iso88597",
    iso88598: {
      type: "_sbcs",
      chars: " �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�"
    },
    cp28598: "iso88598",
    iso88599: {
      type: "_sbcs",
      chars: " ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ"
    },
    cp28599: "iso88599",
    iso885910: {
      type: "_sbcs",
      chars: " ĄĒĢĪĨĶ§ĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ"
    },
    cp28600: "iso885910",
    iso885911: {
      type: "_sbcs",
      chars: " กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"
    },
    cp28601: "iso885911",
    iso885913: {
      type: "_sbcs",
      chars: " ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’"
    },
    cp28603: "iso885913",
    iso885914: {
      type: "_sbcs",
      chars: " Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ"
    },
    cp28604: "iso885914",
    iso885915: {
      type: "_sbcs",
      chars: " ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
    },
    cp28605: "iso885915",
    iso885916: {
      type: "_sbcs",
      chars: " ĄąŁ€„Š§š©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ"
    },
    cp28606: "iso885916",
    cp437: {
      type: "_sbcs",
      chars: "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñÑªº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
    },
    ibm437: "cp437",
    csibm437: "cp437",
    cp737: {
      type: "_sbcs",
      chars: "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ "
    },
    ibm737: "cp737",
    csibm737: "cp737",
    cp775: {
      type: "_sbcs",
      chars: "ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£Ø×¤ĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ "
    },
    ibm775: "cp775",
    csibm775: "cp775",
    cp850: {
      type: "_sbcs",
      chars: "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñÑªº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýÝ¯´­±‗¾¶§÷¸°¨·¹³²■ "
    },
    ibm850: "cp850",
    csibm850: "cp850",
    cp852: {
      type: "_sbcs",
      chars: "ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘę¬źČş«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ "
    },
    ibm852: "cp852",
    csibm852: "cp852",
    cp855: {
      type: "_sbcs",
      chars: "ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ "
    },
    ibm855: "cp855",
    csibm855: "cp855",
    cp856: {
      type: "_sbcs",
      chars: "אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´­±‗¾¶§÷¸°¨·¹³²■ "
    },
    ibm856: "cp856",
    csibm856: "cp856",
    cp857: {
      type: "_sbcs",
      chars: "ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞğ¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ "
    },
    ibm857: "cp857",
    csibm857: "cp857",
    cp858: {
      type: "_sbcs",
      chars: "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñÑªº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýÝ¯´­±‗¾¶§÷¸°¨·¹³²■ "
    },
    ibm858: "cp858",
    csibm858: "cp858",
    cp860: {
      type: "_sbcs",
      chars: "ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñÑªº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
    },
    ibm860: "cp860",
    csibm860: "cp860",
    cp861: {
      type: "_sbcs",
      chars: "ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
    },
    ibm861: "cp861",
    csibm861: "cp861",
    cp862: {
      type: "_sbcs",
      chars: "אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñÑªº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
    },
    ibm862: "cp862",
    csibm862: "cp862",
    cp863: {
      type: "_sbcs",
      chars: "ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
    },
    ibm863: "cp863",
    csibm863: "cp863",
    cp864: {
      type: "_sbcs",
      chars: `\0\x07\b	
\v\f\r\x1B !"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�`
    },
    ibm864: "cp864",
    csibm864: "cp864",
    cp865: {
      type: "_sbcs",
      chars: "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñÑªº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
    },
    ibm865: "cp865",
    csibm865: "cp865",
    cp866: {
      type: "_sbcs",
      chars: "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ "
    },
    ibm866: "cp866",
    csibm866: "cp866",
    cp869: {
      type: "_sbcs",
      chars: "������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ "
    },
    ibm869: "cp869",
    csibm869: "cp869",
    cp922: {
      type: "_sbcs",
      chars: " ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖ×ØÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ"
    },
    ibm922: "cp922",
    csibm922: "cp922",
    cp1046: {
      type: "_sbcs",
      chars: "ﺈ×÷ﹱ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�"
    },
    ibm1046: "cp1046",
    csibm1046: "cp1046",
    cp1124: {
      type: "_sbcs",
      chars: " ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ"
    },
    ibm1124: "cp1124",
    csibm1124: "cp1124",
    cp1125: {
      type: "_sbcs",
      chars: "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ "
    },
    ibm1125: "cp1125",
    csibm1125: "cp1125",
    cp1129: {
      type: "_sbcs",
      chars: " ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"
    },
    ibm1129: "cp1129",
    csibm1129: "cp1129",
    cp1133: {
      type: "_sbcs",
      chars: " ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�"
    },
    ibm1133: "cp1133",
    csibm1133: "cp1133",
    cp1161: {
      type: "_sbcs",
      chars: "��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ "
    },
    ibm1161: "cp1161",
    csibm1161: "cp1161",
    cp1162: {
      type: "_sbcs",
      chars: "€…‘’“”•–— กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"
    },
    ibm1162: "cp1162",
    csibm1162: "cp1162",
    cp1163: {
      type: "_sbcs",
      chars: " ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"
    },
    ibm1163: "cp1163",
    csibm1163: "cp1163",
    maccroatian: {
      type: "_sbcs",
      chars: "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ"
    },
    maccyrillic: {
      type: "_sbcs",
      chars: "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤"
    },
    macgreek: {
      type: "_sbcs",
      chars: "Ä¹²É³ÖÜ΅àâä΄¨çéèêë£™îï•½‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�"
    },
    maciceland: {
      type: "_sbcs",
      chars: "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"
    },
    macroman: {
      type: "_sbcs",
      chars: "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›ﬁﬂ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"
    },
    macromania: {
      type: "_sbcs",
      chars: "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"
    },
    macthai: {
      type: "_sbcs",
      chars: "«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู\uFEFF​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����"
    },
    macturkish: {
      type: "_sbcs",
      chars: "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ"
    },
    macukraine: {
      type: "_sbcs",
      chars: "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤"
    },
    koi8r: {
      type: "_sbcs",
      chars: "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"
    },
    koi8u: {
      type: "_sbcs",
      chars: "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"
    },
    koi8ru: {
      type: "_sbcs",
      chars: "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"
    },
    koi8t: {
      type: "_sbcs",
      chars: "қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"
    },
    armscii8: {
      type: "_sbcs",
      chars: " �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�"
    },
    rk1048: {
      type: "_sbcs",
      chars: "ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"
    },
    tcvn: {
      type: "_sbcs",
      chars: `\0ÚỤỪỬỮ\x07\b	
\v\f\rỨỰỲỶỸÝỴ\x1B !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ`
    },
    georgianacademy: {
      type: "_sbcs",
      chars: "‚ƒ„…†‡ˆ‰Š‹Œ‘’“”•–—˜™š›œŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
    },
    georgianps: {
      type: "_sbcs",
      chars: "‚ƒ„…†‡ˆ‰Š‹Œ‘’“”•–—˜™š›œŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
    },
    pt154: {
      type: "_sbcs",
      chars: "ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"
    },
    viscii: {
      type: "_sbcs",
      chars: `\0ẲẴẪ\x07\b	
\v\f\rỶỸ\x1BỴ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ`
    },
    iso646cn: {
      type: "_sbcs",
      chars: `\0\x07\b	
\v\f\r\x1B !"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������`
    },
    iso646jp: {
      type: "_sbcs",
      chars: `\0\x07\b	
\v\f\r\x1B !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_\`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������`
    },
    hproman8: {
      type: "_sbcs",
      chars: " ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�"
    },
    macintosh: {
      type: "_sbcs",
      chars: "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›ﬁﬂ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"
    },
    ascii: {
      type: "_sbcs",
      chars: "��������������������������������������������������������������������������������������������������������������������������������"
    },
    tis620: {
      type: "_sbcs",
      chars: "���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"
    }
  }), _v;
}
var Ev = {}, AT;
function az() {
  if (AT) return Ev;
  AT = 1;
  var t = gc().Buffer;
  Ev._dbcs = c;
  for (var e = -1, n = -2, r = -10, i = -1e3, o = new Array(256), s = -1, a = 0; a < 256; a++)
    o[a] = e;
  function c(f, m) {
    if (this.encodingName = f.encodingName, !f)
      throw new Error("DBCS codec is called without the data.");
    if (!f.table)
      throw new Error("Encoding '" + this.encodingName + "' has no data.");
    var h = f.table();
    this.decodeTables = [], this.decodeTables[0] = o.slice(0), this.decodeTableSeq = [];
    for (var y = 0; y < h.length; y++)
      this._addDecodeChunk(h[y]);
    this.defaultCharUnicode = m.defaultCharUnicode, this.encodeTable = [], this.encodeTableSeq = [];
    var x = {};
    if (f.encodeSkipVals)
      for (var y = 0; y < f.encodeSkipVals.length; y++) {
        var g = f.encodeSkipVals[y];
        if (typeof g == "number")
          x[g] = !0;
        else
          for (var v = g.from; v <= g.to; v++)
            x[v] = !0;
      }
    if (this._fillEncodeTable(0, 0, x), f.encodeAdd)
      for (var S in f.encodeAdd)
        Object.prototype.hasOwnProperty.call(f.encodeAdd, S) && this._setEncodeChar(S.charCodeAt(0), f.encodeAdd[S]);
    if (this.defCharSB = this.encodeTable[0][m.defaultCharSingleByte.charCodeAt(0)], this.defCharSB === e && (this.defCharSB = this.encodeTable[0]["?"]), this.defCharSB === e && (this.defCharSB = 63), typeof f.gb18030 == "function") {
      this.gb18030 = f.gb18030();
      for (var E = this.decodeTables.length, T = this.decodeTables[E] = o.slice(0), j = this.decodeTables.length, q = this.decodeTables[j] = o.slice(0), y = 129; y <= 254; y++)
        for (var Y = i - this.decodeTables[0][y], W = this.decodeTables[Y], v = 48; v <= 57; v++)
          W[v] = i - E;
      for (var y = 129; y <= 254; y++)
        T[y] = i - j;
      for (var y = 48; y <= 57; y++)
        q[y] = n;
    }
  }
  c.prototype.encoder = u, c.prototype.decoder = l, c.prototype._getDecodeTrieNode = function(f) {
    for (var m = []; f > 0; f >>= 8)
      m.push(f & 255);
    m.length == 0 && m.push(0);
    for (var h = this.decodeTables[0], y = m.length - 1; y > 0; y--) {
      var x = h[m[y]];
      if (x == e)
        h[m[y]] = i - this.decodeTables.length, this.decodeTables.push(h = o.slice(0));
      else if (x <= i)
        h = this.decodeTables[i - x];
      else
        throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + f.toString(16));
    }
    return h;
  }, c.prototype._addDecodeChunk = function(f) {
    var m = parseInt(f[0], 16), h = this._getDecodeTrieNode(m);
    m = m & 255;
    for (var y = 1; y < f.length; y++) {
      var x = f[y];
      if (typeof x == "string")
        for (var g = 0; g < x.length; ) {
          var v = x.charCodeAt(g++);
          if (55296 <= v && v < 56320) {
            var S = x.charCodeAt(g++);
            if (56320 <= S && S < 57344)
              h[m++] = 65536 + (v - 55296) * 1024 + (S - 56320);
            else
              throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + f[0]);
          } else if (4080 < v && v <= 4095) {
            for (var E = 4095 - v + 2, T = [], j = 0; j < E; j++)
              T.push(x.charCodeAt(g++));
            h[m++] = r - this.decodeTableSeq.length, this.decodeTableSeq.push(T);
          } else
            h[m++] = v;
        }
      else if (typeof x == "number")
        for (var q = h[m - 1] + 1, g = 0; g < x; g++)
          h[m++] = q++;
      else
        throw new Error("Incorrect type '" + typeof x + "' given in " + this.encodingName + " at chunk " + f[0]);
    }
    if (m > 255)
      throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + f[0] + ": too long" + m);
  }, c.prototype._getEncodeBucket = function(f) {
    var m = f >> 8;
    return this.encodeTable[m] === void 0 && (this.encodeTable[m] = o.slice(0)), this.encodeTable[m];
  }, c.prototype._setEncodeChar = function(f, m) {
    var h = this._getEncodeBucket(f), y = f & 255;
    h[y] <= r ? this.encodeTableSeq[r - h[y]][s] = m : h[y] == e && (h[y] = m);
  }, c.prototype._setEncodeSequence = function(f, m) {
    var h = f[0], y = this._getEncodeBucket(h), x = h & 255, g;
    y[x] <= r ? g = this.encodeTableSeq[r - y[x]] : (g = {}, y[x] !== e && (g[s] = y[x]), y[x] = r - this.encodeTableSeq.length, this.encodeTableSeq.push(g));
    for (var v = 1; v < f.length - 1; v++) {
      var S = g[h];
      typeof S == "object" ? g = S : (g = g[h] = {}, S !== void 0 && (g[s] = S));
    }
    h = f[f.length - 1], g[h] = m;
  }, c.prototype._fillEncodeTable = function(f, m, h) {
    for (var y = this.decodeTables[f], x = 0; x < 256; x++) {
      var g = y[x], v = m + x;
      h[v] || (g >= 0 ? this._setEncodeChar(g, v) : g <= i ? this._fillEncodeTable(i - g, v << 8, h) : g <= r && this._setEncodeSequence(this.decodeTableSeq[r - g], v));
    }
  };
  function u(f, m) {
    this.leadSurrogate = -1, this.seqObj = void 0, this.encodeTable = m.encodeTable, this.encodeTableSeq = m.encodeTableSeq, this.defaultCharSingleByte = m.defCharSB, this.gb18030 = m.gb18030;
  }
  u.prototype.write = function(f) {
    for (var m = t.alloc(f.length * (this.gb18030 ? 4 : 3)), h = this.leadSurrogate, y = this.seqObj, x = -1, g = 0, v = 0; ; ) {
      if (x === -1) {
        if (g == f.length) break;
        var S = f.charCodeAt(g++);
      } else {
        var S = x;
        x = -1;
      }
      if (55296 <= S && S < 57344)
        if (S < 56320)
          if (h === -1) {
            h = S;
            continue;
          } else
            h = S, S = e;
        else
          h !== -1 ? (S = 65536 + (h - 55296) * 1024 + (S - 56320), h = -1) : S = e;
      else h !== -1 && (x = S, S = e, h = -1);
      var E = e;
      if (y !== void 0 && S != e) {
        var T = y[S];
        if (typeof T == "object") {
          y = T;
          continue;
        } else typeof T == "number" ? E = T : T == null && (T = y[s], T !== void 0 && (E = T, x = S));
        y = void 0;
      } else if (S >= 0) {
        var j = this.encodeTable[S >> 8];
        if (j !== void 0 && (E = j[S & 255]), E <= r) {
          y = this.encodeTableSeq[r - E];
          continue;
        }
        if (E == e && this.gb18030) {
          var q = d(this.gb18030.uChars, S);
          if (q != -1) {
            var E = this.gb18030.gbChars[q] + (S - this.gb18030.uChars[q]);
            m[v++] = 129 + Math.floor(E / 12600), E = E % 12600, m[v++] = 48 + Math.floor(E / 1260), E = E % 1260, m[v++] = 129 + Math.floor(E / 10), E = E % 10, m[v++] = 48 + E;
            continue;
          }
        }
      }
      E === e && (E = this.defaultCharSingleByte), E < 256 ? m[v++] = E : E < 65536 ? (m[v++] = E >> 8, m[v++] = E & 255) : (m[v++] = E >> 16, m[v++] = E >> 8 & 255, m[v++] = E & 255);
    }
    return this.seqObj = y, this.leadSurrogate = h, m.slice(0, v);
  }, u.prototype.end = function() {
    if (!(this.leadSurrogate === -1 && this.seqObj === void 0)) {
      var f = t.alloc(10), m = 0;
      if (this.seqObj) {
        var h = this.seqObj[s];
        h !== void 0 && (h < 256 ? f[m++] = h : (f[m++] = h >> 8, f[m++] = h & 255)), this.seqObj = void 0;
      }
      return this.leadSurrogate !== -1 && (f[m++] = this.defaultCharSingleByte, this.leadSurrogate = -1), f.slice(0, m);
    }
  }, u.prototype.findIdx = d;
  function l(f, m) {
    this.nodeIdx = 0, this.prevBuf = t.alloc(0), this.decodeTables = m.decodeTables, this.decodeTableSeq = m.decodeTableSeq, this.defaultCharUnicode = m.defaultCharUnicode, this.gb18030 = m.gb18030;
  }
  l.prototype.write = function(f) {
    var m = t.alloc(f.length * 2), h = this.nodeIdx, y = this.prevBuf, x = this.prevBuf.length, g = -this.prevBuf.length, v;
    x > 0 && (y = t.concat([y, f.slice(0, 10)]));
    for (var S = 0, E = 0; S < f.length; S++) {
      var T = S >= 0 ? f[S] : y[S + x], v = this.decodeTables[h][T];
      if (!(v >= 0)) if (v === e)
        S = g, v = this.defaultCharUnicode.charCodeAt(0);
      else if (v === n) {
        var j = g >= 0 ? f.slice(g, S + 1) : y.slice(g + x, S + 1 + x), q = (j[0] - 129) * 12600 + (j[1] - 48) * 1260 + (j[2] - 129) * 10 + (j[3] - 48), Y = d(this.gb18030.gbChars, q);
        v = this.gb18030.uChars[Y] + q - this.gb18030.gbChars[Y];
      } else if (v <= i) {
        h = i - v;
        continue;
      } else if (v <= r) {
        for (var W = this.decodeTableSeq[r - v], G = 0; G < W.length - 1; G++)
          v = W[G], m[E++] = v & 255, m[E++] = v >> 8;
        v = W[W.length - 1];
      } else
        throw new Error("iconv-lite internal error: invalid decoding table value " + v + " at " + h + "/" + T);
      if (v > 65535) {
        v -= 65536;
        var J = 55296 + Math.floor(v / 1024);
        m[E++] = J & 255, m[E++] = J >> 8, v = 56320 + v % 1024;
      }
      m[E++] = v & 255, m[E++] = v >> 8, h = 0, g = S + 1;
    }
    return this.nodeIdx = h, this.prevBuf = g >= 0 ? f.slice(g) : y.slice(g + x), m.slice(0, E).toString("ucs2");
  }, l.prototype.end = function() {
    for (var f = ""; this.prevBuf.length > 0; ) {
      f += this.defaultCharUnicode;
      var m = this.prevBuf.slice(1);
      this.prevBuf = t.alloc(0), this.nodeIdx = 0, m.length > 0 && (f += this.write(m));
    }
    return this.nodeIdx = 0, f;
  };
  function d(f, m) {
    if (f[0] > m)
      return -1;
    for (var h = 0, y = f.length; h < y - 1; ) {
      var x = h + Math.floor((y - h + 1) / 2);
      f[x] <= m ? h = x : y = x;
    }
    return h;
  }
  return Ev;
}
const cz = [
  [
    "0",
    "\0",
    128
  ],
  [
    "a1",
    "｡",
    62
  ],
  [
    "8140",
    "　、。，．・：；？！゛゜´｀¨＾￣＿ヽヾゝゞ〃仝々〆〇ー―‐／＼～∥｜…‥‘’“”（）〔〕［］｛｝〈",
    9,
    "＋－±×"
  ],
  [
    "8180",
    "÷＝≠＜＞≦≧∞∴♂♀°′″℃￥＄￠￡％＃＆＊＠§☆★○●◎◇◆□■△▲▽▼※〒→←↑↓〓"
  ],
  [
    "81b8",
    "∈∋⊆⊇⊂⊃∪∩"
  ],
  [
    "81c8",
    "∧∨￢⇒⇔∀∃"
  ],
  [
    "81da",
    "∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"
  ],
  [
    "81f0",
    "Å‰♯♭♪†‡¶"
  ],
  [
    "81fc",
    "◯"
  ],
  [
    "824f",
    "０",
    9
  ],
  [
    "8260",
    "Ａ",
    25
  ],
  [
    "8281",
    "ａ",
    25
  ],
  [
    "829f",
    "ぁ",
    82
  ],
  [
    "8340",
    "ァ",
    62
  ],
  [
    "8380",
    "ム",
    22
  ],
  [
    "839f",
    "Α",
    16,
    "Σ",
    6
  ],
  [
    "83bf",
    "α",
    16,
    "σ",
    6
  ],
  [
    "8440",
    "А",
    5,
    "ЁЖ",
    25
  ],
  [
    "8470",
    "а",
    5,
    "ёж",
    7
  ],
  [
    "8480",
    "о",
    17
  ],
  [
    "849f",
    "─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"
  ],
  [
    "8740",
    "①",
    19,
    "Ⅰ",
    9
  ],
  [
    "875f",
    "㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"
  ],
  [
    "877e",
    "㍻"
  ],
  [
    "8780",
    "〝〟№㏍℡㊤",
    4,
    "㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"
  ],
  [
    "889f",
    "亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"
  ],
  [
    "8940",
    "院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円"
  ],
  [
    "8980",
    "園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"
  ],
  [
    "8a40",
    "魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫"
  ],
  [
    "8a80",
    "橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"
  ],
  [
    "8b40",
    "機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救"
  ],
  [
    "8b80",
    "朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"
  ],
  [
    "8c40",
    "掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨"
  ],
  [
    "8c80",
    "劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"
  ],
  [
    "8d40",
    "后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降"
  ],
  [
    "8d80",
    "項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"
  ],
  [
    "8e40",
    "察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止"
  ],
  [
    "8e80",
    "死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"
  ],
  [
    "8f40",
    "宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳"
  ],
  [
    "8f80",
    "準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"
  ],
  [
    "9040",
    "拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨"
  ],
  [
    "9080",
    "逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"
  ],
  [
    "9140",
    "繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻"
  ],
  [
    "9180",
    "操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"
  ],
  [
    "9240",
    "叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄"
  ],
  [
    "9280",
    "逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"
  ],
  [
    "9340",
    "邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬"
  ],
  [
    "9380",
    "凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"
  ],
  [
    "9440",
    "如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅"
  ],
  [
    "9480",
    "楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"
  ],
  [
    "9540",
    "鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷"
  ],
  [
    "9580",
    "斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"
  ],
  [
    "9640",
    "法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆"
  ],
  [
    "9680",
    "摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"
  ],
  [
    "9740",
    "諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲"
  ],
  [
    "9780",
    "沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"
  ],
  [
    "9840",
    "蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"
  ],
  [
    "989f",
    "弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"
  ],
  [
    "9940",
    "僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭"
  ],
  [
    "9980",
    "凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"
  ],
  [
    "9a40",
    "咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸"
  ],
  [
    "9a80",
    "噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"
  ],
  [
    "9b40",
    "奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀"
  ],
  [
    "9b80",
    "它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"
  ],
  [
    "9c40",
    "廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠"
  ],
  [
    "9c80",
    "怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"
  ],
  [
    "9d40",
    "戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫"
  ],
  [
    "9d80",
    "捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"
  ],
  [
    "9e40",
    "曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎"
  ],
  [
    "9e80",
    "梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"
  ],
  [
    "9f40",
    "檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯"
  ],
  [
    "9f80",
    "麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"
  ],
  [
    "e040",
    "漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝"
  ],
  [
    "e080",
    "烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"
  ],
  [
    "e140",
    "瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿"
  ],
  [
    "e180",
    "痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"
  ],
  [
    "e240",
    "磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰"
  ],
  [
    "e280",
    "窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"
  ],
  [
    "e340",
    "紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷"
  ],
  [
    "e380",
    "縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"
  ],
  [
    "e440",
    "隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤"
  ],
  [
    "e480",
    "艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"
  ],
  [
    "e540",
    "蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬"
  ],
  [
    "e580",
    "蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"
  ],
  [
    "e640",
    "襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧"
  ],
  [
    "e680",
    "諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"
  ],
  [
    "e740",
    "蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜"
  ],
  [
    "e780",
    "轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"
  ],
  [
    "e840",
    "錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙"
  ],
  [
    "e880",
    "閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"
  ],
  [
    "e940",
    "顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃"
  ],
  [
    "e980",
    "騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"
  ],
  [
    "ea40",
    "鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯"
  ],
  [
    "ea80",
    "黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠堯槇遙瑤凜熙"
  ],
  [
    "ed40",
    "纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏"
  ],
  [
    "ed80",
    "塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"
  ],
  [
    "ee40",
    "犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙"
  ],
  [
    "ee80",
    "蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"
  ],
  [
    "eeef",
    "ⅰ",
    9,
    "￢￤＇＂"
  ],
  [
    "f040",
    "",
    62
  ],
  [
    "f080",
    "",
    124
  ],
  [
    "f140",
    "",
    62
  ],
  [
    "f180",
    "",
    124
  ],
  [
    "f240",
    "",
    62
  ],
  [
    "f280",
    "",
    124
  ],
  [
    "f340",
    "",
    62
  ],
  [
    "f380",
    "",
    124
  ],
  [
    "f440",
    "",
    62
  ],
  [
    "f480",
    "",
    124
  ],
  [
    "f540",
    "",
    62
  ],
  [
    "f580",
    "",
    124
  ],
  [
    "f640",
    "",
    62
  ],
  [
    "f680",
    "",
    124
  ],
  [
    "f740",
    "",
    62
  ],
  [
    "f780",
    "",
    124
  ],
  [
    "f840",
    "",
    62
  ],
  [
    "f880",
    "",
    124
  ],
  [
    "f940",
    ""
  ],
  [
    "fa40",
    "ⅰ",
    9,
    "Ⅰ",
    9,
    "￢￤＇＂㈱№℡∵纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊"
  ],
  [
    "fa80",
    "兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯"
  ],
  [
    "fb40",
    "涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神"
  ],
  [
    "fb80",
    "祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙"
  ],
  [
    "fc40",
    "髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"
  ]
], uz = /* @__PURE__ */ JSON.parse('[["0","\\u0000",127],["8ea1","｡",62],["a1a1","　、。，．・：；？！゛゜´｀¨＾￣＿ヽヾゝゞ〃仝々〆〇ー―‐／＼～∥｜…‥‘’“”（）〔〕［］｛｝〈",9,"＋－±×÷＝≠＜＞≦≧∞∴♂♀°′″℃￥＄￠￡％＃＆＊＠§☆★○●◎◇"],["a2a1","◆□■△▲▽▼※〒→←↑↓〓"],["a2ba","∈∋⊆⊇⊂⊃∪∩"],["a2ca","∧∨￢⇒⇔∀∃"],["a2dc","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"],["a2f2","Å‰♯♭♪†‡¶"],["a2fe","◯"],["a3b0","０",9],["a3c1","Ａ",25],["a3e1","ａ",25],["a4a1","ぁ",82],["a5a1","ァ",85],["a6a1","Α",16,"Σ",6],["a6c1","α",16,"σ",6],["a7a1","А",5,"ЁЖ",25],["a7d1","а",5,"ёж",25],["a8a1","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"],["ada1","①",19,"Ⅰ",9],["adc0","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"],["addf","㍻〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"],["b0a1","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"],["b1a1","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応"],["b2a1","押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"],["b3a1","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱"],["b4a1","粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"],["b5a1","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京"],["b6a1","供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"],["b7a1","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲"],["b8a1","検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"],["b9a1","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込"],["baa1","此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"],["bba1","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時"],["bca1","次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"],["bda1","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償"],["bea1","勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"],["bfa1","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾"],["c0a1","澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"],["c1a1","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎"],["c2a1","臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"],["c3a1","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵"],["c4a1","帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"],["c5a1","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到"],["c6a1","董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"],["c7a1","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦"],["c8a1","函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"],["c9a1","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服"],["caa1","福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"],["cba1","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満"],["cca1","漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"],["cda1","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃"],["cea1","痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"],["cfa1","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"],["d0a1","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"],["d1a1","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨"],["d2a1","辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"],["d3a1","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉"],["d4a1","圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"],["d5a1","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓"],["d6a1","屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"],["d7a1","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚"],["d8a1","悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"],["d9a1","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼"],["daa1","據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"],["dba1","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍"],["dca1","棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"],["dda1","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾"],["dea1","沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"],["dfa1","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼"],["e0a1","燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"],["e1a1","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰"],["e2a1","癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"],["e3a1","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐"],["e4a1","筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"],["e5a1","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺"],["e6a1","罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"],["e7a1","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙"],["e8a1","茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"],["e9a1","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙"],["eaa1","蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"],["eba1","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫"],["eca1","譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"],["eda1","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸"],["eea1","遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"],["efa1","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞"],["f0a1","陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"],["f1a1","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷"],["f2a1","髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"],["f3a1","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠"],["f4a1","堯槇遙瑤凜熙"],["f9a1","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德"],["faa1","忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"],["fba1","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚"],["fca1","釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"],["fcf1","ⅰ",9,"￢￤＇＂"],["8fa2af","˘ˇ¸˙˝¯˛˚～΄΅"],["8fa2c2","¡¦¿"],["8fa2eb","ºª©®™¤№"],["8fa6e1","ΆΈΉΊΪ"],["8fa6e7","Ό"],["8fa6e9","ΎΫ"],["8fa6ec","Ώ"],["8fa6f1","άέήίϊΐόςύϋΰώ"],["8fa7c2","Ђ",10,"ЎЏ"],["8fa7f2","ђ",10,"ўџ"],["8fa9a1","ÆĐ"],["8fa9a4","Ħ"],["8fa9a6","Ĳ"],["8fa9a8","ŁĿ"],["8fa9ab","ŊØŒ"],["8fa9af","ŦÞ"],["8fa9c1","æđðħıĳĸłŀŉŋøœßŧþ"],["8faaa1","ÁÀÄÂĂǍĀĄÅÃĆĈČÇĊĎÉÈËÊĚĖĒĘ"],["8faaba","ĜĞĢĠĤÍÌÏÎǏİĪĮĨĴĶĹĽĻŃŇŅÑÓÒÖÔǑŐŌÕŔŘŖŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙǕŴÝŸŶŹŽŻ"],["8faba1","áàäâăǎāąåãćĉčçċďéèëêěėēęǵĝğ"],["8fabbd","ġĥíìïîǐ"],["8fabc5","īįĩĵķĺľļńňņñóòöôǒőōõŕřŗśŝšşťţúùüûŭǔűūųůũǘǜǚǖŵýÿŷźžż"],["8fb0a1","丂丄丅丌丒丟丣两丨丫丮丯丰丵乀乁乄乇乑乚乜乣乨乩乴乵乹乿亍亖亗亝亯亹仃仐仚仛仠仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘佟佣佪佬佮佱佷佸佹佺佽佾侁侂侄"],["8fb1a1","侅侉侊侌侎侐侒侓侔侗侙侚侞侟侲侷侹侻侼侽侾俀俁俅俆俈俉俋俌俍俏俒俜俠俢俰俲俼俽俿倀倁倄倇倊倌倎倐倓倗倘倛倜倝倞倢倧倮倰倲倳倵偀偁偂偅偆偊偌偎偑偒偓偗偙偟偠偢偣偦偧偪偭偰偱倻傁傃傄傆傊傎傏傐"],["8fb2a1","傒傓傔傖傛傜傞",4,"傪傯傰傹傺傽僀僃僄僇僌僎僐僓僔僘僜僝僟僢僤僦僨僩僯僱僶僺僾儃儆儇儈儋儌儍儎僲儐儗儙儛儜儝儞儣儧儨儬儭儯儱儳儴儵儸儹兂兊兏兓兕兗兘兟兤兦兾冃冄冋冎冘冝冡冣冭冸冺冼冾冿凂"],["8fb3a1","凈减凑凒凓凕凘凞凢凥凮凲凳凴凷刁刂刅划刓刕刖刘刢刨刱刲刵刼剅剉剕剗剘剚剜剟剠剡剦剮剷剸剹劀劂劅劊劌劓劕劖劗劘劚劜劤劥劦劧劯劰劶劷劸劺劻劽勀勄勆勈勌勏勑勔勖勛勜勡勥勨勩勪勬勰勱勴勶勷匀匃匊匋"],["8fb4a1","匌匑匓匘匛匜匞匟匥匧匨匩匫匬匭匰匲匵匼匽匾卂卌卋卙卛卡卣卥卬卭卲卹卾厃厇厈厎厓厔厙厝厡厤厪厫厯厲厴厵厷厸厺厽叀叅叏叒叓叕叚叝叞叠另叧叵吂吓吚吡吧吨吪启吱吴吵呃呄呇呍呏呞呢呤呦呧呩呫呭呮呴呿"],["8fb5a1","咁咃咅咈咉咍咑咕咖咜咟咡咦咧咩咪咭咮咱咷咹咺咻咿哆哊响哎哠哪哬哯哶哼哾哿唀唁唅唈唉唌唍唎唕唪唫唲唵唶唻唼唽啁啇啉啊啍啐啑啘啚啛啞啠啡啤啦啿喁喂喆喈喎喏喑喒喓喔喗喣喤喭喲喿嗁嗃嗆嗉嗋嗌嗎嗑嗒"],["8fb6a1","嗓嗗嗘嗛嗞嗢嗩嗶嗿嘅嘈嘊嘍",5,"嘙嘬嘰嘳嘵嘷嘹嘻嘼嘽嘿噀噁噃噄噆噉噋噍噏噔噞噠噡噢噣噦噩噭噯噱噲噵嚄嚅嚈嚋嚌嚕嚙嚚嚝嚞嚟嚦嚧嚨嚩嚫嚬嚭嚱嚳嚷嚾囅囉囊囋囏囐囌囍囙囜囝囟囡囤",4,"囱囫园"],["8fb7a1","囶囷圁圂圇圊圌圑圕圚圛圝圠圢圣圤圥圩圪圬圮圯圳圴圽圾圿坅坆坌坍坒坢坥坧坨坫坭",4,"坳坴坵坷坹坺坻坼坾垁垃垌垔垗垙垚垜垝垞垟垡垕垧垨垩垬垸垽埇埈埌埏埕埝埞埤埦埧埩埭埰埵埶埸埽埾埿堃堄堈堉埡"],["8fb8a1","堌堍堛堞堟堠堦堧堭堲堹堿塉塌塍塏塐塕塟塡塤塧塨塸塼塿墀墁墇墈墉墊墌墍墏墐墔墖墝墠墡墢墦墩墱墲壄墼壂壈壍壎壐壒壔壖壚壝壡壢壩壳夅夆夋夌夒夓夔虁夝夡夣夤夨夯夰夳夵夶夿奃奆奒奓奙奛奝奞奟奡奣奫奭"],["8fb9a1","奯奲奵奶她奻奼妋妌妎妒妕妗妟妤妧妭妮妯妰妳妷妺妼姁姃姄姈姊姍姒姝姞姟姣姤姧姮姯姱姲姴姷娀娄娌娍娎娒娓娞娣娤娧娨娪娭娰婄婅婇婈婌婐婕婞婣婥婧婭婷婺婻婾媋媐媓媖媙媜媞媟媠媢媧媬媱媲媳媵媸媺媻媿"],["8fbaa1","嫄嫆嫈嫏嫚嫜嫠嫥嫪嫮嫵嫶嫽嬀嬁嬈嬗嬴嬙嬛嬝嬡嬥嬭嬸孁孋孌孒孖孞孨孮孯孼孽孾孿宁宄宆宊宎宐宑宓宔宖宨宩宬宭宯宱宲宷宺宼寀寁寍寏寖",4,"寠寯寱寴寽尌尗尞尟尣尦尩尫尬尮尰尲尵尶屙屚屜屢屣屧屨屩"],["8fbba1","屭屰屴屵屺屻屼屽岇岈岊岏岒岝岟岠岢岣岦岪岲岴岵岺峉峋峒峝峗峮峱峲峴崁崆崍崒崫崣崤崦崧崱崴崹崽崿嵂嵃嵆嵈嵕嵑嵙嵊嵟嵠嵡嵢嵤嵪嵭嵰嵹嵺嵾嵿嶁嶃嶈嶊嶒嶓嶔嶕嶙嶛嶟嶠嶧嶫嶰嶴嶸嶹巃巇巋巐巎巘巙巠巤"],["8fbca1","巩巸巹帀帇帍帒帔帕帘帟帠帮帨帲帵帾幋幐幉幑幖幘幛幜幞幨幪",4,"幰庀庋庎庢庤庥庨庪庬庱庳庽庾庿廆廌廋廎廑廒廔廕廜廞廥廫异弆弇弈弎弙弜弝弡弢弣弤弨弫弬弮弰弴弶弻弽弿彀彄彅彇彍彐彔彘彛彠彣彤彧"],["8fbda1","彯彲彴彵彸彺彽彾徉徍徏徖徜徝徢徧徫徤徬徯徰徱徸忄忇忈忉忋忐",4,"忞忡忢忨忩忪忬忭忮忯忲忳忶忺忼怇怊怍怓怔怗怘怚怟怤怭怳怵恀恇恈恉恌恑恔恖恗恝恡恧恱恾恿悂悆悈悊悎悑悓悕悘悝悞悢悤悥您悰悱悷"],["8fbea1","悻悾惂惄惈惉惊惋惎惏惔惕惙惛惝惞惢惥惲惵惸惼惽愂愇愊愌愐",4,"愖愗愙愜愞愢愪愫愰愱愵愶愷愹慁慅慆慉慞慠慬慲慸慻慼慿憀憁憃憄憋憍憒憓憗憘憜憝憟憠憥憨憪憭憸憹憼懀懁懂懎懏懕懜懝懞懟懡懢懧懩懥"],["8fbfa1","懬懭懯戁戃戄戇戓戕戜戠戢戣戧戩戫戹戽扂扃扄扆扌扐扑扒扔扖扚扜扤扭扯扳扺扽抍抎抏抐抦抨抳抶抷抺抾抿拄拎拕拖拚拪拲拴拼拽挃挄挊挋挍挐挓挖挘挩挪挭挵挶挹挼捁捂捃捄捆捊捋捎捒捓捔捘捛捥捦捬捭捱捴捵"],["8fc0a1","捸捼捽捿掂掄掇掊掐掔掕掙掚掞掤掦掭掮掯掽揁揅揈揎揑揓揔揕揜揠揥揪揬揲揳揵揸揹搉搊搐搒搔搘搞搠搢搤搥搩搪搯搰搵搽搿摋摏摑摒摓摔摚摛摜摝摟摠摡摣摭摳摴摻摽撅撇撏撐撑撘撙撛撝撟撡撣撦撨撬撳撽撾撿"],["8fc1a1","擄擉擊擋擌擎擐擑擕擗擤擥擩擪擭擰擵擷擻擿攁攄攈攉攊攏攓攔攖攙攛攞攟攢攦攩攮攱攺攼攽敃敇敉敐敒敔敟敠敧敫敺敽斁斅斊斒斕斘斝斠斣斦斮斲斳斴斿旂旈旉旎旐旔旖旘旟旰旲旴旵旹旾旿昀昄昈昉昍昑昒昕昖昝"],["8fc2a1","昞昡昢昣昤昦昩昪昫昬昮昰昱昳昹昷晀晅晆晊晌晑晎晗晘晙晛晜晠晡曻晪晫晬晾晳晵晿晷晸晹晻暀晼暋暌暍暐暒暙暚暛暜暟暠暤暭暱暲暵暻暿曀曂曃曈曌曎曏曔曛曟曨曫曬曮曺朅朇朎朓朙朜朠朢朳朾杅杇杈杌杔杕杝"],["8fc3a1","杦杬杮杴杶杻极构枎枏枑枓枖枘枙枛枰枱枲枵枻枼枽柹柀柂柃柅柈柉柒柗柙柜柡柦柰柲柶柷桒栔栙栝栟栨栧栬栭栯栰栱栳栻栿桄桅桊桌桕桗桘桛桫桮",4,"桵桹桺桻桼梂梄梆梈梖梘梚梜梡梣梥梩梪梮梲梻棅棈棌棏"],["8fc4a1","棐棑棓棖棙棜棝棥棨棪棫棬棭棰棱棵棶棻棼棽椆椉椊椐椑椓椖椗椱椳椵椸椻楂楅楉楎楗楛楣楤楥楦楨楩楬楰楱楲楺楻楿榀榍榒榖榘榡榥榦榨榫榭榯榷榸榺榼槅槈槑槖槗槢槥槮槯槱槳槵槾樀樁樃樏樑樕樚樝樠樤樨樰樲"],["8fc5a1","樴樷樻樾樿橅橆橉橊橎橐橑橒橕橖橛橤橧橪橱橳橾檁檃檆檇檉檋檑檛檝檞檟檥檫檯檰檱檴檽檾檿櫆櫉櫈櫌櫐櫔櫕櫖櫜櫝櫤櫧櫬櫰櫱櫲櫼櫽欂欃欆欇欉欏欐欑欗欛欞欤欨欫欬欯欵欶欻欿歆歊歍歒歖歘歝歠歧歫歮歰歵歽"],["8fc6a1","歾殂殅殗殛殟殠殢殣殨殩殬殭殮殰殸殹殽殾毃毄毉毌毖毚毡毣毦毧毮毱毷毹毿氂氄氅氉氍氎氐氒氙氟氦氧氨氬氮氳氵氶氺氻氿汊汋汍汏汒汔汙汛汜汫汭汯汴汶汸汹汻沅沆沇沉沔沕沗沘沜沟沰沲沴泂泆泍泏泐泑泒泔泖"],["8fc7a1","泚泜泠泧泩泫泬泮泲泴洄洇洊洎洏洑洓洚洦洧洨汧洮洯洱洹洼洿浗浞浟浡浥浧浯浰浼涂涇涑涒涔涖涗涘涪涬涴涷涹涽涿淄淈淊淎淏淖淛淝淟淠淢淥淩淯淰淴淶淼渀渄渞渢渧渲渶渹渻渼湄湅湈湉湋湏湑湒湓湔湗湜湝湞"],["8fc8a1","湢湣湨湳湻湽溍溓溙溠溧溭溮溱溳溻溿滀滁滃滇滈滊滍滎滏滫滭滮滹滻滽漄漈漊漌漍漖漘漚漛漦漩漪漯漰漳漶漻漼漭潏潑潒潓潗潙潚潝潞潡潢潨潬潽潾澃澇澈澋澌澍澐澒澓澔澖澚澟澠澥澦澧澨澮澯澰澵澶澼濅濇濈濊"],["8fc9a1","濚濞濨濩濰濵濹濼濽瀀瀅瀆瀇瀍瀗瀠瀣瀯瀴瀷瀹瀼灃灄灈灉灊灋灔灕灝灞灎灤灥灬灮灵灶灾炁炅炆炔",4,"炛炤炫炰炱炴炷烊烑烓烔烕烖烘烜烤烺焃",4,"焋焌焏焞焠焫焭焯焰焱焸煁煅煆煇煊煋煐煒煗煚煜煞煠"],["8fcaa1","煨煹熀熅熇熌熒熚熛熠熢熯熰熲熳熺熿燀燁燄燋燌燓燖燙燚燜燸燾爀爇爈爉爓爗爚爝爟爤爫爯爴爸爹牁牂牃牅牎牏牐牓牕牖牚牜牞牠牣牨牫牮牯牱牷牸牻牼牿犄犉犍犎犓犛犨犭犮犱犴犾狁狇狉狌狕狖狘狟狥狳狴狺狻"],["8fcba1","狾猂猄猅猇猋猍猒猓猘猙猞猢猤猧猨猬猱猲猵猺猻猽獃獍獐獒獖獘獝獞獟獠獦獧獩獫獬獮獯獱獷獹獼玀玁玃玅玆玎玐玓玕玗玘玜玞玟玠玢玥玦玪玫玭玵玷玹玼玽玿珅珆珉珋珌珏珒珓珖珙珝珡珣珦珧珩珴珵珷珹珺珻珽"],["8fcca1","珿琀琁琄琇琊琑琚琛琤琦琨",9,"琹瑀瑃瑄瑆瑇瑋瑍瑑瑒瑗瑝瑢瑦瑧瑨瑫瑭瑮瑱瑲璀璁璅璆璇璉璏璐璑璒璘璙璚璜璟璠璡璣璦璨璩璪璫璮璯璱璲璵璹璻璿瓈瓉瓌瓐瓓瓘瓚瓛瓞瓟瓤瓨瓪瓫瓯瓴瓺瓻瓼瓿甆"],["8fcda1","甒甖甗甠甡甤甧甩甪甯甶甹甽甾甿畀畃畇畈畎畐畒畗畞畟畡畯畱畹",5,"疁疅疐疒疓疕疙疜疢疤疴疺疿痀痁痄痆痌痎痏痗痜痟痠痡痤痧痬痮痯痱痹瘀瘂瘃瘄瘇瘈瘊瘌瘏瘒瘓瘕瘖瘙瘛瘜瘝瘞瘣瘥瘦瘩瘭瘲瘳瘵瘸瘹"],["8fcea1","瘺瘼癊癀癁癃癄癅癉癋癕癙癟癤癥癭癮癯癱癴皁皅皌皍皕皛皜皝皟皠皢",6,"皪皭皽盁盅盉盋盌盎盔盙盠盦盨盬盰盱盶盹盼眀眆眊眎眒眔眕眗眙眚眜眢眨眭眮眯眴眵眶眹眽眾睂睅睆睊睍睎睏睒睖睗睜睞睟睠睢"],["8fcfa1","睤睧睪睬睰睲睳睴睺睽瞀瞄瞌瞍瞔瞕瞖瞚瞟瞢瞧瞪瞮瞯瞱瞵瞾矃矉矑矒矕矙矞矟矠矤矦矪矬矰矱矴矸矻砅砆砉砍砎砑砝砡砢砣砭砮砰砵砷硃硄硇硈硌硎硒硜硞硠硡硣硤硨硪确硺硾碊碏碔碘碡碝碞碟碤碨碬碭碰碱碲碳"],["8fd0a1","碻碽碿磇磈磉磌磎磒磓磕磖磤磛磟磠磡磦磪磲磳礀磶磷磺磻磿礆礌礐礚礜礞礟礠礥礧礩礭礱礴礵礻礽礿祄祅祆祊祋祏祑祔祘祛祜祧祩祫祲祹祻祼祾禋禌禑禓禔禕禖禘禛禜禡禨禩禫禯禱禴禸离秂秄秇秈秊秏秔秖秚秝秞"],["8fd1a1","秠秢秥秪秫秭秱秸秼稂稃稇稉稊稌稑稕稛稞稡稧稫稭稯稰稴稵稸稹稺穄穅穇穈穌穕穖穙穜穝穟穠穥穧穪穭穵穸穾窀窂窅窆窊窋窐窑窔窞窠窣窬窳窵窹窻窼竆竉竌竎竑竛竨竩竫竬竱竴竻竽竾笇笔笟笣笧笩笪笫笭笮笯笰"],["8fd2a1","笱笴笽笿筀筁筇筎筕筠筤筦筩筪筭筯筲筳筷箄箉箎箐箑箖箛箞箠箥箬箯箰箲箵箶箺箻箼箽篂篅篈篊篔篖篗篙篚篛篨篪篲篴篵篸篹篺篼篾簁簂簃簄簆簉簋簌簎簏簙簛簠簥簦簨簬簱簳簴簶簹簺籆籊籕籑籒籓籙",5],["8fd3a1","籡籣籧籩籭籮籰籲籹籼籽粆粇粏粔粞粠粦粰粶粷粺粻粼粿糄糇糈糉糍糏糓糔糕糗糙糚糝糦糩糫糵紃紇紈紉紏紑紒紓紖紝紞紣紦紪紭紱紼紽紾絀絁絇絈絍絑絓絗絙絚絜絝絥絧絪絰絸絺絻絿綁綂綃綅綆綈綋綌綍綑綖綗綝"],["8fd4a1","綞綦綧綪綳綶綷綹緂",4,"緌緍緎緗緙縀緢緥緦緪緫緭緱緵緶緹緺縈縐縑縕縗縜縝縠縧縨縬縭縯縳縶縿繄繅繇繎繐繒繘繟繡繢繥繫繮繯繳繸繾纁纆纇纊纍纑纕纘纚纝纞缼缻缽缾缿罃罄罇罏罒罓罛罜罝罡罣罤罥罦罭"],["8fd5a1","罱罽罾罿羀羋羍羏羐羑羖羗羜羡羢羦羪羭羴羼羿翀翃翈翎翏翛翟翣翥翨翬翮翯翲翺翽翾翿耇耈耊耍耎耏耑耓耔耖耝耞耟耠耤耦耬耮耰耴耵耷耹耺耼耾聀聄聠聤聦聭聱聵肁肈肎肜肞肦肧肫肸肹胈胍胏胒胔胕胗胘胠胭胮"],["8fd6a1","胰胲胳胶胹胺胾脃脋脖脗脘脜脞脠脤脧脬脰脵脺脼腅腇腊腌腒腗腠腡腧腨腩腭腯腷膁膐膄膅膆膋膎膖膘膛膞膢膮膲膴膻臋臃臅臊臎臏臕臗臛臝臞臡臤臫臬臰臱臲臵臶臸臹臽臿舀舃舏舓舔舙舚舝舡舢舨舲舴舺艃艄艅艆"],["8fd7a1","艋艎艏艑艖艜艠艣艧艭艴艻艽艿芀芁芃芄芇芉芊芎芑芔芖芘芚芛芠芡芣芤芧芨芩芪芮芰芲芴芷芺芼芾芿苆苐苕苚苠苢苤苨苪苭苯苶苷苽苾茀茁茇茈茊茋荔茛茝茞茟茡茢茬茭茮茰茳茷茺茼茽荂荃荄荇荍荎荑荕荖荗荰荸"],["8fd8a1","荽荿莀莂莄莆莍莒莔莕莘莙莛莜莝莦莧莩莬莾莿菀菇菉菏菐菑菔菝荓菨菪菶菸菹菼萁萆萊萏萑萕萙莭萯萹葅葇葈葊葍葏葑葒葖葘葙葚葜葠葤葥葧葪葰葳葴葶葸葼葽蒁蒅蒒蒓蒕蒞蒦蒨蒩蒪蒯蒱蒴蒺蒽蒾蓀蓂蓇蓈蓌蓏蓓"],["8fd9a1","蓜蓧蓪蓯蓰蓱蓲蓷蔲蓺蓻蓽蔂蔃蔇蔌蔎蔐蔜蔞蔢蔣蔤蔥蔧蔪蔫蔯蔳蔴蔶蔿蕆蕏",4,"蕖蕙蕜",6,"蕤蕫蕯蕹蕺蕻蕽蕿薁薅薆薉薋薌薏薓薘薝薟薠薢薥薧薴薶薷薸薼薽薾薿藂藇藊藋藎薭藘藚藟藠藦藨藭藳藶藼"],["8fdaa1","藿蘀蘄蘅蘍蘎蘐蘑蘒蘘蘙蘛蘞蘡蘧蘩蘶蘸蘺蘼蘽虀虂虆虒虓虖虗虘虙虝虠",4,"虩虬虯虵虶虷虺蚍蚑蚖蚘蚚蚜蚡蚦蚧蚨蚭蚱蚳蚴蚵蚷蚸蚹蚿蛀蛁蛃蛅蛑蛒蛕蛗蛚蛜蛠蛣蛥蛧蚈蛺蛼蛽蜄蜅蜇蜋蜎蜏蜐蜓蜔蜙蜞蜟蜡蜣"],["8fdba1","蜨蜮蜯蜱蜲蜹蜺蜼蜽蜾蝀蝃蝅蝍蝘蝝蝡蝤蝥蝯蝱蝲蝻螃",6,"螋螌螐螓螕螗螘螙螞螠螣螧螬螭螮螱螵螾螿蟁蟈蟉蟊蟎蟕蟖蟙蟚蟜蟟蟢蟣蟤蟪蟫蟭蟱蟳蟸蟺蟿蠁蠃蠆蠉蠊蠋蠐蠙蠒蠓蠔蠘蠚蠛蠜蠞蠟蠨蠭蠮蠰蠲蠵"],["8fdca1","蠺蠼衁衃衅衈衉衊衋衎衑衕衖衘衚衜衟衠衤衩衱衹衻袀袘袚袛袜袟袠袨袪袺袽袾裀裊",4,"裑裒裓裛裞裧裯裰裱裵裷褁褆褍褎褏褕褖褘褙褚褜褠褦褧褨褰褱褲褵褹褺褾襀襂襅襆襉襏襒襗襚襛襜襡襢襣襫襮襰襳襵襺"],["8fdda1","襻襼襽覉覍覐覔覕覛覜覟覠覥覰覴覵覶覷覼觔",4,"觥觩觫觭觱觳觶觹觽觿訄訅訇訏訑訒訔訕訞訠訢訤訦訫訬訯訵訷訽訾詀詃詅詇詉詍詎詓詖詗詘詜詝詡詥詧詵詶詷詹詺詻詾詿誀誃誆誋誏誐誒誖誗誙誟誧誩誮誯誳"],["8fdea1","誶誷誻誾諃諆諈諉諊諑諓諔諕諗諝諟諬諰諴諵諶諼諿謅謆謋謑謜謞謟謊謭謰謷謼譂",4,"譈譒譓譔譙譍譞譣譭譶譸譹譼譾讁讄讅讋讍讏讔讕讜讞讟谸谹谽谾豅豇豉豋豏豑豓豔豗豘豛豝豙豣豤豦豨豩豭豳豵豶豻豾貆"],["8fdfa1","貇貋貐貒貓貙貛貜貤貹貺賅賆賉賋賏賖賕賙賝賡賨賬賯賰賲賵賷賸賾賿贁贃贉贒贗贛赥赩赬赮赿趂趄趈趍趐趑趕趞趟趠趦趫趬趯趲趵趷趹趻跀跅跆跇跈跊跎跑跔跕跗跙跤跥跧跬跰趼跱跲跴跽踁踄踅踆踋踑踔踖踠踡踢"],["8fe0a1","踣踦踧踱踳踶踷踸踹踽蹀蹁蹋蹍蹎蹏蹔蹛蹜蹝蹞蹡蹢蹩蹬蹭蹯蹰蹱蹹蹺蹻躂躃躉躐躒躕躚躛躝躞躢躧躩躭躮躳躵躺躻軀軁軃軄軇軏軑軔軜軨軮軰軱軷軹軺軭輀輂輇輈輏輐輖輗輘輞輠輡輣輥輧輨輬輭輮輴輵輶輷輺轀轁"],["8fe1a1","轃轇轏轑",4,"轘轝轞轥辝辠辡辤辥辦辵辶辸达迀迁迆迊迋迍运迒迓迕迠迣迤迨迮迱迵迶迻迾适逄逈逌逘逛逨逩逯逪逬逭逳逴逷逿遃遄遌遛遝遢遦遧遬遰遴遹邅邈邋邌邎邐邕邗邘邙邛邠邡邢邥邰邲邳邴邶邽郌邾郃"],["8fe2a1","郄郅郇郈郕郗郘郙郜郝郟郥郒郶郫郯郰郴郾郿鄀鄄鄅鄆鄈鄍鄐鄔鄖鄗鄘鄚鄜鄞鄠鄥鄢鄣鄧鄩鄮鄯鄱鄴鄶鄷鄹鄺鄼鄽酃酇酈酏酓酗酙酚酛酡酤酧酭酴酹酺酻醁醃醅醆醊醎醑醓醔醕醘醞醡醦醨醬醭醮醰醱醲醳醶醻醼醽醿"],["8fe3a1","釂釃釅釓釔釗釙釚釞釤釥釩釪釬",5,"釷釹釻釽鈀鈁鈄鈅鈆鈇鈉鈊鈌鈐鈒鈓鈖鈘鈜鈝鈣鈤鈥鈦鈨鈮鈯鈰鈳鈵鈶鈸鈹鈺鈼鈾鉀鉂鉃鉆鉇鉊鉍鉎鉏鉑鉘鉙鉜鉝鉠鉡鉥鉧鉨鉩鉮鉯鉰鉵",4,"鉻鉼鉽鉿銈銉銊銍銎銒銗"],["8fe4a1","銙銟銠銤銥銧銨銫銯銲銶銸銺銻銼銽銿",4,"鋅鋆鋇鋈鋋鋌鋍鋎鋐鋓鋕鋗鋘鋙鋜鋝鋟鋠鋡鋣鋥鋧鋨鋬鋮鋰鋹鋻鋿錀錂錈錍錑錔錕錜錝錞錟錡錤錥錧錩錪錳錴錶錷鍇鍈鍉鍐鍑鍒鍕鍗鍘鍚鍞鍤鍥鍧鍩鍪鍭鍯鍰鍱鍳鍴鍶"],["8fe5a1","鍺鍽鍿鎀鎁鎂鎈鎊鎋鎍鎏鎒鎕鎘鎛鎞鎡鎣鎤鎦鎨鎫鎴鎵鎶鎺鎩鏁鏄鏅鏆鏇鏉",4,"鏓鏙鏜鏞鏟鏢鏦鏧鏹鏷鏸鏺鏻鏽鐁鐂鐄鐈鐉鐍鐎鐏鐕鐖鐗鐟鐮鐯鐱鐲鐳鐴鐻鐿鐽鑃鑅鑈鑊鑌鑕鑙鑜鑟鑡鑣鑨鑫鑭鑮鑯鑱鑲钄钃镸镹"],["8fe6a1","镾閄閈閌閍閎閝閞閟閡閦閩閫閬閴閶閺閽閿闆闈闉闋闐闑闒闓闙闚闝闞闟闠闤闦阝阞阢阤阥阦阬阱阳阷阸阹阺阼阽陁陒陔陖陗陘陡陮陴陻陼陾陿隁隂隃隄隉隑隖隚隝隟隤隥隦隩隮隯隳隺雊雒嶲雘雚雝雞雟雩雯雱雺霂"],["8fe7a1","霃霅霉霚霛霝霡霢霣霨霱霳靁靃靊靎靏靕靗靘靚靛靣靧靪靮靳靶靷靸靻靽靿鞀鞉鞕鞖鞗鞙鞚鞞鞟鞢鞬鞮鞱鞲鞵鞶鞸鞹鞺鞼鞾鞿韁韄韅韇韉韊韌韍韎韐韑韔韗韘韙韝韞韠韛韡韤韯韱韴韷韸韺頇頊頙頍頎頔頖頜頞頠頣頦"],["8fe8a1","頫頮頯頰頲頳頵頥頾顄顇顊顑顒顓顖顗顙顚顢顣顥顦顪顬颫颭颮颰颴颷颸颺颻颿飂飅飈飌飡飣飥飦飧飪飳飶餂餇餈餑餕餖餗餚餛餜餟餢餦餧餫餱",4,"餹餺餻餼饀饁饆饇饈饍饎饔饘饙饛饜饞饟饠馛馝馟馦馰馱馲馵"],["8fe9a1","馹馺馽馿駃駉駓駔駙駚駜駞駧駪駫駬駰駴駵駹駽駾騂騃騄騋騌騐騑騖騞騠騢騣騤騧騭騮騳騵騶騸驇驁驄驊驋驌驎驑驔驖驝骪骬骮骯骲骴骵骶骹骻骾骿髁髃髆髈髎髐髒髕髖髗髛髜髠髤髥髧髩髬髲髳髵髹髺髽髿",4],["8feaa1","鬄鬅鬈鬉鬋鬌鬍鬎鬐鬒鬖鬙鬛鬜鬠鬦鬫鬭鬳鬴鬵鬷鬹鬺鬽魈魋魌魕魖魗魛魞魡魣魥魦魨魪",4,"魳魵魷魸魹魿鮀鮄鮅鮆鮇鮉鮊鮋鮍鮏鮐鮔鮚鮝鮞鮦鮧鮩鮬鮰鮱鮲鮷鮸鮻鮼鮾鮿鯁鯇鯈鯎鯐鯗鯘鯝鯟鯥鯧鯪鯫鯯鯳鯷鯸"],["8feba1","鯹鯺鯽鯿鰀鰂鰋鰏鰑鰖鰘鰙鰚鰜鰞鰢鰣鰦",4,"鰱鰵鰶鰷鰽鱁鱃鱄鱅鱉鱊鱎鱏鱐鱓鱔鱖鱘鱛鱝鱞鱟鱣鱩鱪鱜鱫鱨鱮鱰鱲鱵鱷鱻鳦鳲鳷鳹鴋鴂鴑鴗鴘鴜鴝鴞鴯鴰鴲鴳鴴鴺鴼鵅鴽鵂鵃鵇鵊鵓鵔鵟鵣鵢鵥鵩鵪鵫鵰鵶鵷鵻"],["8feca1","鵼鵾鶃鶄鶆鶊鶍鶎鶒鶓鶕鶖鶗鶘鶡鶪鶬鶮鶱鶵鶹鶼鶿鷃鷇鷉鷊鷔鷕鷖鷗鷚鷞鷟鷠鷥鷧鷩鷫鷮鷰鷳鷴鷾鸊鸂鸇鸎鸐鸑鸒鸕鸖鸙鸜鸝鹺鹻鹼麀麂麃麄麅麇麎麏麖麘麛麞麤麨麬麮麯麰麳麴麵黆黈黋黕黟黤黧黬黭黮黰黱黲黵"],["8feda1","黸黿鼂鼃鼉鼏鼐鼑鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃",4,"齓齕齖齗齘齚齝齞齨齩齭",4,"齳齵齺齽龏龐龑龒龔龖龗龞龡龢龣龥"]]'), Av = /* @__PURE__ */ JSON.parse('[["0","\\u0000",127,"€"],["8140","丂丄丅丆丏丒丗丟丠両丣並丩丮丯丱丳丵丷丼乀乁乂乄乆乊乑乕乗乚乛乢乣乤乥乧乨乪",5,"乲乴",9,"乿",6,"亇亊"],["8180","亐亖亗亙亜亝亞亣亪亯亰亱亴亶亷亸亹亼亽亾仈仌仏仐仒仚仛仜仠仢仦仧仩仭仮仯仱仴仸仹仺仼仾伀伂",6,"伋伌伒",4,"伜伝伡伣伨伩伬伭伮伱伳伵伷伹伻伾",4,"佄佅佇",5,"佒佔佖佡佢佦佨佪佫佭佮佱佲併佷佸佹佺佽侀侁侂侅來侇侊侌侎侐侒侓侕侖侘侙侚侜侞侟価侢"],["8240","侤侫侭侰",4,"侶",8,"俀俁係俆俇俈俉俋俌俍俒",4,"俙俛俠俢俤俥俧俫俬俰俲俴俵俶俷俹俻俼俽俿",11],["8280","個倎倐們倓倕倖倗倛倝倞倠倢倣値倧倫倯",10,"倻倽倿偀偁偂偄偅偆偉偊偋偍偐",4,"偖偗偘偙偛偝",7,"偦",5,"偭",8,"偸偹偺偼偽傁傂傃傄傆傇傉傊傋傌傎",20,"傤傦傪傫傭",4,"傳",6,"傼"],["8340","傽",17,"僐",5,"僗僘僙僛",10,"僨僩僪僫僯僰僱僲僴僶",4,"僼",9,"儈"],["8380","儉儊儌",5,"儓",13,"儢",28,"兂兇兊兌兎兏児兒兓兗兘兙兛兝",4,"兣兤兦內兩兪兯兲兺兾兿冃冄円冇冊冋冎冏冐冑冓冔冘冚冝冞冟冡冣冦",4,"冭冮冴冸冹冺冾冿凁凂凃凅凈凊凍凎凐凒",5],["8440","凘凙凚凜凞凟凢凣凥",5,"凬凮凱凲凴凷凾刄刅刉刋刌刏刐刓刔刕刜刞刟刡刢刣別刦刧刪刬刯刱刲刴刵刼刾剄",5,"剋剎剏剒剓剕剗剘"],["8480","剙剚剛剝剟剠剢剣剤剦剨剫剬剭剮剰剱剳",9,"剾劀劃",4,"劉",6,"劑劒劔",6,"劜劤劥劦劧劮劯劰労",9,"勀勁勂勄勅勆勈勊勌勍勎勏勑勓勔動勗務",5,"勠勡勢勣勥",10,"勱",7,"勻勼勽匁匂匃匄匇匉匊匋匌匎"],["8540","匑匒匓匔匘匛匜匞匟匢匤匥匧匨匩匫匬匭匯",9,"匼匽區卂卄卆卋卌卍卐協単卙卛卝卥卨卪卬卭卲卶卹卻卼卽卾厀厁厃厇厈厊厎厏"],["8580","厐",4,"厖厗厙厛厜厞厠厡厤厧厪厫厬厭厯",6,"厷厸厹厺厼厽厾叀參",4,"収叏叐叒叓叕叚叜叝叞叡叢叧叴叺叾叿吀吂吅吇吋吔吘吙吚吜吢吤吥吪吰吳吶吷吺吽吿呁呂呄呅呇呉呌呍呎呏呑呚呝",4,"呣呥呧呩",7,"呴呹呺呾呿咁咃咅咇咈咉咊咍咑咓咗咘咜咞咟咠咡"],["8640","咢咥咮咰咲咵咶咷咹咺咼咾哃哅哊哋哖哘哛哠",4,"哫哬哯哰哱哴",5,"哻哾唀唂唃唄唅唈唊",4,"唒唓唕",5,"唜唝唞唟唡唥唦"],["8680","唨唩唫唭唲唴唵唶唸唹唺唻唽啀啂啅啇啈啋",4,"啑啒啓啔啗",4,"啝啞啟啠啢啣啨啩啫啯",5,"啹啺啽啿喅喆喌喍喎喐喒喓喕喖喗喚喛喞喠",6,"喨",8,"喲喴営喸喺喼喿",4,"嗆嗇嗈嗊嗋嗎嗏嗐嗕嗗",4,"嗞嗠嗢嗧嗩嗭嗮嗰嗱嗴嗶嗸",4,"嗿嘂嘃嘄嘅"],["8740","嘆嘇嘊嘋嘍嘐",7,"嘙嘚嘜嘝嘠嘡嘢嘥嘦嘨嘩嘪嘫嘮嘯嘰嘳嘵嘷嘸嘺嘼嘽嘾噀",11,"噏",4,"噕噖噚噛噝",4],["8780","噣噥噦噧噭噮噯噰噲噳噴噵噷噸噹噺噽",7,"嚇",6,"嚐嚑嚒嚔",14,"嚤",10,"嚰",6,"嚸嚹嚺嚻嚽",12,"囋",8,"囕囖囘囙囜団囥",5,"囬囮囯囲図囶囷囸囻囼圀圁圂圅圇國",6],["8840","園",9,"圝圞圠圡圢圤圥圦圧圫圱圲圴",4,"圼圽圿坁坃坄坅坆坈坉坋坒",4,"坘坙坢坣坥坧坬坮坰坱坲坴坵坸坹坺坽坾坿垀"],["8880","垁垇垈垉垊垍",4,"垔",6,"垜垝垞垟垥垨垪垬垯垰垱垳垵垶垷垹",8,"埄",6,"埌埍埐埑埓埖埗埛埜埞埡埢埣埥",7,"埮埰埱埲埳埵埶執埻埼埾埿堁堃堄堅堈堉堊堌堎堏堐堒堓堔堖堗堘堚堛堜堝堟堢堣堥",4,"堫",4,"報堲堳場堶",7],["8940","堾",5,"塅",6,"塎塏塐塒塓塕塖塗塙",4,"塟",5,"塦",4,"塭",16,"塿墂墄墆墇墈墊墋墌"],["8980","墍",4,"墔",4,"墛墜墝墠",7,"墪",17,"墽墾墿壀壂壃壄壆",10,"壒壓壔壖",13,"壥",5,"壭壯壱売壴壵壷壸壺",7,"夃夅夆夈",4,"夎夐夑夒夓夗夘夛夝夞夠夡夢夣夦夨夬夰夲夳夵夶夻"],["8a40","夽夾夿奀奃奅奆奊奌奍奐奒奓奙奛",4,"奡奣奤奦",12,"奵奷奺奻奼奾奿妀妅妉妋妌妎妏妐妑妔妕妘妚妛妜妝妟妠妡妢妦"],["8a80","妧妬妭妰妱妳",5,"妺妼妽妿",6,"姇姈姉姌姍姎姏姕姖姙姛姞",4,"姤姦姧姩姪姫姭",11,"姺姼姽姾娀娂娊娋娍娎娏娐娒娔娕娖娗娙娚娛娝娞娡娢娤娦娧娨娪",6,"娳娵娷",4,"娽娾娿婁",4,"婇婈婋",9,"婖婗婘婙婛",5],["8b40","婡婣婤婥婦婨婩婫",8,"婸婹婻婼婽婾媀",17,"媓",6,"媜",13,"媫媬"],["8b80","媭",4,"媴媶媷媹",4,"媿嫀嫃",5,"嫊嫋嫍",4,"嫓嫕嫗嫙嫚嫛嫝嫞嫟嫢嫤嫥嫧嫨嫪嫬",4,"嫲",22,"嬊",11,"嬘",25,"嬳嬵嬶嬸",7,"孁",6],["8c40","孈",7,"孒孖孞孠孡孧孨孫孭孮孯孲孴孶孷學孹孻孼孾孿宂宆宊宍宎宐宑宒宔宖実宧宨宩宬宭宮宯宱宲宷宺宻宼寀寁寃寈寉寊寋寍寎寏"],["8c80","寑寔",8,"寠寢寣實寧審",4,"寯寱",6,"寽対尀専尃尅將專尋尌對導尐尒尓尗尙尛尞尟尠尡尣尦尨尩尪尫尭尮尯尰尲尳尵尶尷屃屄屆屇屌屍屒屓屔屖屗屘屚屛屜屝屟屢層屧",6,"屰屲",6,"屻屼屽屾岀岃",4,"岉岊岋岎岏岒岓岕岝",4,"岤",4],["8d40","岪岮岯岰岲岴岶岹岺岻岼岾峀峂峃峅",5,"峌",5,"峓",5,"峚",6,"峢峣峧峩峫峬峮峯峱",9,"峼",4],["8d80","崁崄崅崈",5,"崏",4,"崕崗崘崙崚崜崝崟",4,"崥崨崪崫崬崯",4,"崵",7,"崿",7,"嵈嵉嵍",10,"嵙嵚嵜嵞",10,"嵪嵭嵮嵰嵱嵲嵳嵵",12,"嶃",21,"嶚嶛嶜嶞嶟嶠"],["8e40","嶡",21,"嶸",12,"巆",6,"巎",12,"巜巟巠巣巤巪巬巭"],["8e80","巰巵巶巸",4,"巿帀帄帇帉帊帋帍帎帒帓帗帞",7,"帨",4,"帯帰帲",4,"帹帺帾帿幀幁幃幆",5,"幍",6,"幖",4,"幜幝幟幠幣",14,"幵幷幹幾庁庂広庅庈庉庌庍庎庒庘庛庝庡庢庣庤庨",4,"庮",4,"庴庺庻庼庽庿",6],["8f40","廆廇廈廋",5,"廔廕廗廘廙廚廜",11,"廩廫",8,"廵廸廹廻廼廽弅弆弇弉弌弍弎弐弒弔弖弙弚弜弝弞弡弢弣弤"],["8f80","弨弫弬弮弰弲",6,"弻弽弾弿彁",14,"彑彔彙彚彛彜彞彟彠彣彥彧彨彫彮彯彲彴彵彶彸彺彽彾彿徃徆徍徎徏徑従徔徖徚徛徝從徟徠徢",5,"復徫徬徯",5,"徶徸徹徺徻徾",4,"忇忈忊忋忎忓忔忕忚忛応忞忟忢忣忥忦忨忩忬忯忰忲忳忴忶忷忹忺忼怇"],["9040","怈怉怋怌怐怑怓怗怘怚怞怟怢怣怤怬怭怮怰",4,"怶",4,"怽怾恀恄",6,"恌恎恏恑恓恔恖恗恘恛恜恞恟恠恡恥恦恮恱恲恴恵恷恾悀"],["9080","悁悂悅悆悇悈悊悋悎悏悐悑悓悕悗悘悙悜悞悡悢悤悥悧悩悪悮悰悳悵悶悷悹悺悽",7,"惇惈惉惌",4,"惒惓惔惖惗惙惛惞惡",4,"惪惱惲惵惷惸惻",4,"愂愃愄愅愇愊愋愌愐",4,"愖愗愘愙愛愜愝愞愡愢愥愨愩愪愬",18,"慀",6],["9140","慇慉態慍慏慐慒慓慔慖",6,"慞慟慠慡慣慤慥慦慩",6,"慱慲慳慴慶慸",18,"憌憍憏",4,"憕"],["9180","憖",6,"憞",8,"憪憫憭",9,"憸",5,"憿懀懁懃",4,"應懌",4,"懓懕",16,"懧",13,"懶",8,"戀",5,"戇戉戓戔戙戜戝戞戠戣戦戧戨戩戫戭戯戰戱戲戵戶戸",4,"扂扄扅扆扊"],["9240","扏扐払扖扗扙扚扜",6,"扤扥扨扱扲扴扵扷扸扺扻扽抁抂抃抅抆抇抈抋",5,"抔抙抜抝択抣抦抧抩抪抭抮抯抰抲抳抴抶抷抸抺抾拀拁"],["9280","拃拋拏拑拕拝拞拠拡拤拪拫拰拲拵拸拹拺拻挀挃挄挅挆挊挋挌挍挏挐挒挓挔挕挗挘挙挜挦挧挩挬挭挮挰挱挳",5,"挻挼挾挿捀捁捄捇捈捊捑捒捓捔捖",7,"捠捤捥捦捨捪捫捬捯捰捲捳捴捵捸捹捼捽捾捿掁掃掄掅掆掋掍掑掓掔掕掗掙",6,"採掤掦掫掯掱掲掵掶掹掻掽掿揀"],["9340","揁揂揃揅揇揈揊揋揌揑揓揔揕揗",6,"揟揢揤",4,"揫揬揮揯揰揱揳揵揷揹揺揻揼揾搃搄搆",4,"損搎搑搒搕",5,"搝搟搢搣搤"],["9380","搥搧搨搩搫搮",5,"搵",4,"搻搼搾摀摂摃摉摋",6,"摓摕摖摗摙",4,"摟",7,"摨摪摫摬摮",9,"摻",6,"撃撆撈",8,"撓撔撗撘撚撛撜撝撟",4,"撥撦撧撨撪撫撯撱撲撳撴撶撹撻撽撾撿擁擃擄擆",6,"擏擑擓擔擕擖擙據"],["9440","擛擜擝擟擠擡擣擥擧",24,"攁",7,"攊",7,"攓",4,"攙",8],["9480","攢攣攤攦",4,"攬攭攰攱攲攳攷攺攼攽敀",4,"敆敇敊敋敍敎敐敒敓敔敗敘敚敜敟敠敡敤敥敧敨敩敪敭敮敯敱敳敵敶數",14,"斈斉斊斍斎斏斒斔斕斖斘斚斝斞斠斢斣斦斨斪斬斮斱",7,"斺斻斾斿旀旂旇旈旉旊旍旐旑旓旔旕旘",7,"旡旣旤旪旫"],["9540","旲旳旴旵旸旹旻",4,"昁昄昅昇昈昉昋昍昐昑昒昖昗昘昚昛昜昞昡昢昣昤昦昩昪昫昬昮昰昲昳昷",4,"昽昿晀時晄",6,"晍晎晐晑晘"],["9580","晙晛晜晝晞晠晢晣晥晧晩",4,"晱晲晳晵晸晹晻晼晽晿暀暁暃暅暆暈暉暊暋暍暎暏暐暒暓暔暕暘",4,"暞",8,"暩",4,"暯",4,"暵暶暷暸暺暻暼暽暿",25,"曚曞",7,"曧曨曪",5,"曱曵曶書曺曻曽朁朂會"],["9640","朄朅朆朇朌朎朏朑朒朓朖朘朙朚朜朞朠",5,"朧朩朮朰朲朳朶朷朸朹朻朼朾朿杁杄杅杇杊杋杍杒杔杕杗",4,"杝杢杣杤杦杧杫杬杮東杴杶"],["9680","杸杹杺杻杽枀枂枃枅枆枈枊枌枍枎枏枑枒枓枔枖枙枛枟枠枡枤枦枩枬枮枱枲枴枹",7,"柂柅",9,"柕柖柗柛柟柡柣柤柦柧柨柪柫柭柮柲柵",7,"柾栁栂栃栄栆栍栐栒栔栕栘",4,"栞栟栠栢",6,"栫",6,"栴栵栶栺栻栿桇桋桍桏桒桖",5],["9740","桜桝桞桟桪桬",7,"桵桸",8,"梂梄梇",7,"梐梑梒梔梕梖梘",9,"梣梤梥梩梪梫梬梮梱梲梴梶梷梸"],["9780","梹",6,"棁棃",5,"棊棌棎棏棐棑棓棔棖棗棙棛",4,"棡棢棤",9,"棯棲棳棴棶棷棸棻棽棾棿椀椂椃椄椆",4,"椌椏椑椓",11,"椡椢椣椥",7,"椮椯椱椲椳椵椶椷椸椺椻椼椾楀楁楃",16,"楕楖楘楙楛楜楟"],["9840","楡楢楤楥楧楨楩楪楬業楯楰楲",4,"楺楻楽楾楿榁榃榅榊榋榌榎",5,"榖榗榙榚榝",9,"榩榪榬榮榯榰榲榳榵榶榸榹榺榼榽"],["9880","榾榿槀槂",7,"構槍槏槑槒槓槕",5,"槜槝槞槡",11,"槮槯槰槱槳",9,"槾樀",9,"樋",11,"標",5,"樠樢",5,"権樫樬樭樮樰樲樳樴樶",6,"樿",4,"橅橆橈",7,"橑",6,"橚"],["9940","橜",4,"橢橣橤橦",10,"橲",6,"橺橻橽橾橿檁檂檃檅",8,"檏檒",4,"檘",7,"檡",5],["9980","檧檨檪檭",114,"欥欦欨",6],["9a40","欯欰欱欳欴欵欶欸欻欼欽欿歀歁歂歄歅歈歊歋歍",11,"歚",7,"歨歩歫",13,"歺歽歾歿殀殅殈"],["9a80","殌殎殏殐殑殔殕殗殘殙殜",4,"殢",7,"殫",7,"殶殸",6,"毀毃毄毆",4,"毌毎毐毑毘毚毜",4,"毢",7,"毬毭毮毰毱毲毴毶毷毸毺毻毼毾",6,"氈",4,"氎氒気氜氝氞氠氣氥氫氬氭氱氳氶氷氹氺氻氼氾氿汃汄汅汈汋",4,"汑汒汓汖汘"],["9b40","汙汚汢汣汥汦汧汫",4,"汱汳汵汷汸決汻汼汿沀沄沇沊沋沍沎沑沒沕沖沗沘沚沜沝沞沠沢沨沬沯沰沴沵沶沷沺泀況泂泃泆泇泈泋泍泎泏泑泒泘"],["9b80","泙泚泜泝泟泤泦泧泩泬泭泲泴泹泿洀洂洃洅洆洈洉洊洍洏洐洑洓洔洕洖洘洜洝洟",5,"洦洨洩洬洭洯洰洴洶洷洸洺洿浀浂浄浉浌浐浕浖浗浘浛浝浟浡浢浤浥浧浨浫浬浭浰浱浲浳浵浶浹浺浻浽",4,"涃涄涆涇涊涋涍涏涐涒涖",4,"涜涢涥涬涭涰涱涳涴涶涷涹",5,"淁淂淃淈淉淊"],["9c40","淍淎淏淐淒淓淔淕淗淚淛淜淟淢淣淥淧淨淩淪淭淯淰淲淴淵淶淸淺淽",7,"渆渇済渉渋渏渒渓渕渘渙減渜渞渟渢渦渧渨渪測渮渰渱渳渵"],["9c80","渶渷渹渻",7,"湅",7,"湏湐湑湒湕湗湙湚湜湝湞湠",10,"湬湭湯",14,"満溁溂溄溇溈溊",4,"溑",6,"溙溚溛溝溞溠溡溣溤溦溨溩溫溬溭溮溰溳溵溸溹溼溾溿滀滃滄滅滆滈滉滊滌滍滎滐滒滖滘滙滛滜滝滣滧滪",5],["9d40","滰滱滲滳滵滶滷滸滺",7,"漃漄漅漇漈漊",4,"漐漑漒漖",9,"漡漢漣漥漦漧漨漬漮漰漲漴漵漷",6,"漿潀潁潂"],["9d80","潃潄潅潈潉潊潌潎",9,"潙潚潛潝潟潠潡潣潤潥潧",5,"潯潰潱潳潵潶潷潹潻潽",6,"澅澆澇澊澋澏",12,"澝澞澟澠澢",4,"澨",10,"澴澵澷澸澺",5,"濁濃",5,"濊",6,"濓",10,"濟濢濣濤濥"],["9e40","濦",7,"濰",32,"瀒",7,"瀜",6,"瀤",6],["9e80","瀫",9,"瀶瀷瀸瀺",17,"灍灎灐",13,"灟",11,"灮灱灲灳灴灷灹灺灻災炁炂炃炄炆炇炈炋炌炍炏炐炑炓炗炘炚炛炞",12,"炰炲炴炵炶為炾炿烄烅烆烇烉烋",12,"烚"],["9f40","烜烝烞烠烡烢烣烥烪烮烰",6,"烸烺烻烼烾",10,"焋",4,"焑焒焔焗焛",10,"焧",7,"焲焳焴"],["9f80","焵焷",13,"煆煇煈煉煋煍煏",12,"煝煟",4,"煥煩",4,"煯煰煱煴煵煶煷煹煻煼煾",5,"熅",4,"熋熌熍熎熐熑熒熓熕熖熗熚",4,"熡",6,"熩熪熫熭",5,"熴熶熷熸熺",8,"燄",9,"燏",4],["a040","燖",9,"燡燢燣燤燦燨",5,"燯",9,"燺",11,"爇",19],["a080","爛爜爞",9,"爩爫爭爮爯爲爳爴爺爼爾牀",6,"牉牊牋牎牏牐牑牓牔牕牗牘牚牜牞牠牣牤牥牨牪牫牬牭牰牱牳牴牶牷牸牻牼牽犂犃犅",4,"犌犎犐犑犓",11,"犠",11,"犮犱犲犳犵犺",6,"狅狆狇狉狊狋狌狏狑狓狔狕狖狘狚狛"],["a1a1","　、。·ˉˇ¨〃々—～‖…‘’“”〔〕〈",7,"〖〗【】±×÷∶∧∨∑∏∪∩∈∷√⊥∥∠⌒⊙∫∮≡≌≈∽∝≠≮≯≤≥∞∵∴♂♀°′″℃＄¤￠￡‰§№☆★○●◎◇◆□■△▲※→←↑↓〓"],["a2a1","ⅰ",9],["a2b1","⒈",19,"⑴",19,"①",9],["a2e5","㈠",9],["a2f1","Ⅰ",11],["a3a1","！＂＃￥％",88,"￣"],["a4a1","ぁ",82],["a5a1","ァ",85],["a6a1","Α",16,"Σ",6],["a6c1","α",16,"σ",6],["a6e0","︵︶︹︺︿﹀︽︾﹁﹂﹃﹄"],["a6ee","︻︼︷︸︱"],["a6f4","︳︴"],["a7a1","А",5,"ЁЖ",25],["a7d1","а",5,"ёж",25],["a840","ˊˋ˙–―‥‵℅℉↖↗↘↙∕∟∣≒≦≧⊿═",35,"▁",6],["a880","█",7,"▓▔▕▼▽◢◣◤◥☉⊕〒〝〞"],["a8a1","āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜüêɑ"],["a8bd","ńň"],["a8c0","ɡ"],["a8c5","ㄅ",36],["a940","〡",8,"㊣㎎㎏㎜㎝㎞㎡㏄㏎㏑㏒㏕︰￢￤"],["a959","℡㈱"],["a95c","‐"],["a960","ー゛゜ヽヾ〆ゝゞ﹉",9,"﹔﹕﹖﹗﹙",8],["a980","﹢",4,"﹨﹩﹪﹫"],["a996","〇"],["a9a4","─",75],["aa40","狜狝狟狢",5,"狪狫狵狶狹狽狾狿猀猂猄",5,"猋猌猍猏猐猑猒猔猘猙猚猟猠猣猤猦猧猨猭猯猰猲猳猵猶猺猻猼猽獀",8],["aa80","獉獊獋獌獎獏獑獓獔獕獖獘",7,"獡",10,"獮獰獱"],["ab40","獲",11,"獿",4,"玅玆玈玊玌玍玏玐玒玓玔玕玗玘玙玚玜玝玞玠玡玣",5,"玪玬玭玱玴玵玶玸玹玼玽玾玿珁珃",4],["ab80","珋珌珎珒",6,"珚珛珜珝珟珡珢珣珤珦珨珪珫珬珮珯珰珱珳",4],["ac40","珸",10,"琄琇琈琋琌琍琎琑",8,"琜",5,"琣琤琧琩琫琭琯琱琲琷",4,"琽琾琿瑀瑂",11],["ac80","瑎",6,"瑖瑘瑝瑠",12,"瑮瑯瑱",4,"瑸瑹瑺"],["ad40","瑻瑼瑽瑿璂璄璅璆璈璉璊璌璍璏璑",10,"璝璟",7,"璪",15,"璻",12],["ad80","瓈",9,"瓓",8,"瓝瓟瓡瓥瓧",6,"瓰瓱瓲"],["ae40","瓳瓵瓸",6,"甀甁甂甃甅",7,"甎甐甒甔甕甖甗甛甝甞甠",4,"甦甧甪甮甴甶甹甼甽甿畁畂畃畄畆畇畉畊畍畐畑畒畓畕畖畗畘"],["ae80","畝",7,"畧畨畩畫",6,"畳畵當畷畺",4,"疀疁疂疄疅疇"],["af40","疈疉疊疌疍疎疐疓疕疘疛疜疞疢疦",4,"疭疶疷疺疻疿痀痁痆痋痌痎痏痐痑痓痗痙痚痜痝痟痠痡痥痩痬痭痮痯痲痳痵痶痷痸痺痻痽痾瘂瘄瘆瘇"],["af80","瘈瘉瘋瘍瘎瘏瘑瘒瘓瘔瘖瘚瘜瘝瘞瘡瘣瘧瘨瘬瘮瘯瘱瘲瘶瘷瘹瘺瘻瘽癁療癄"],["b040","癅",6,"癎",5,"癕癗",4,"癝癟癠癡癢癤",6,"癬癭癮癰",7,"癹発發癿皀皁皃皅皉皊皌皍皏皐皒皔皕皗皘皚皛"],["b080","皜",7,"皥",8,"皯皰皳皵",9,"盀盁盃啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥"],["b140","盄盇盉盋盌盓盕盙盚盜盝盞盠",4,"盦",7,"盰盳盵盶盷盺盻盽盿眀眂眃眅眆眊県眎",10,"眛眜眝眞眡眣眤眥眧眪眫"],["b180","眬眮眰",4,"眹眻眽眾眿睂睄睅睆睈",7,"睒",7,"睜薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳"],["b240","睝睞睟睠睤睧睩睪睭",11,"睺睻睼瞁瞂瞃瞆",5,"瞏瞐瞓",11,"瞡瞣瞤瞦瞨瞫瞭瞮瞯瞱瞲瞴瞶",4],["b280","瞼瞾矀",12,"矎",8,"矘矙矚矝",4,"矤病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖"],["b340","矦矨矪矯矰矱矲矴矵矷矹矺矻矼砃",5,"砊砋砎砏砐砓砕砙砛砞砠砡砢砤砨砪砫砮砯砱砲砳砵砶砽砿硁硂硃硄硆硈硉硊硋硍硏硑硓硔硘硙硚"],["b380","硛硜硞",11,"硯",7,"硸硹硺硻硽",6,"场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚"],["b440","碄碅碆碈碊碋碏碐碒碔碕碖碙碝碞碠碢碤碦碨",7,"碵碶碷碸確碻碼碽碿磀磂磃磄磆磇磈磌磍磎磏磑磒磓磖磗磘磚",9],["b480","磤磥磦磧磩磪磫磭",4,"磳磵磶磸磹磻",5,"礂礃礄礆",6,"础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮"],["b540","礍",5,"礔",9,"礟",4,"礥",14,"礵",4,"礽礿祂祃祄祅祇祊",8,"祔祕祘祙祡祣"],["b580","祤祦祩祪祫祬祮祰",6,"祹祻",4,"禂禃禆禇禈禉禋禌禍禎禐禑禒怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠"],["b640","禓",6,"禛",11,"禨",10,"禴",4,"禼禿秂秄秅秇秈秊秌秎秏秐秓秔秖秗秙",5,"秠秡秢秥秨秪"],["b680","秬秮秱",6,"秹秺秼秾秿稁稄稅稇稈稉稊稌稏",4,"稕稖稘稙稛稜丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二"],["b740","稝稟稡稢稤",14,"稴稵稶稸稺稾穀",5,"穇",9,"穒",4,"穘",16],["b780","穩",6,"穱穲穳穵穻穼穽穾窂窅窇窉窊窋窌窎窏窐窓窔窙窚窛窞窡窢贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服"],["b840","窣窤窧窩窪窫窮",4,"窴",10,"竀",10,"竌",9,"竗竘竚竛竜竝竡竢竤竧",5,"竮竰竱竲竳"],["b880","竴",4,"竻竼竾笀笁笂笅笇笉笌笍笎笐笒笓笖笗笘笚笜笝笟笡笢笣笧笩笭浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹"],["b940","笯笰笲笴笵笶笷笹笻笽笿",5,"筆筈筊筍筎筓筕筗筙筜筞筟筡筣",10,"筯筰筳筴筶筸筺筼筽筿箁箂箃箄箆",6,"箎箏"],["b980","箑箒箓箖箘箙箚箛箞箟箠箣箤箥箮箯箰箲箳箵箶箷箹",7,"篂篃範埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈"],["ba40","篅篈築篊篋篍篎篏篐篒篔",4,"篛篜篞篟篠篢篣篤篧篨篩篫篬篭篯篰篲",4,"篸篹篺篻篽篿",7,"簈簉簊簍簎簐",5,"簗簘簙"],["ba80","簚",4,"簠",5,"簨簩簫",12,"簹",5,"籂骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖"],["bb40","籃",9,"籎",36,"籵",5,"籾",9],["bb80","粈粊",6,"粓粔粖粙粚粛粠粡粣粦粧粨粩粫粬粭粯粰粴",4,"粺粻弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕"],["bc40","粿糀糂糃糄糆糉糋糎",6,"糘糚糛糝糞糡",6,"糩",5,"糰",7,"糹糺糼",13,"紋",5],["bc80","紑",14,"紡紣紤紥紦紨紩紪紬紭紮細",6,"肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件"],["bd40","紷",54,"絯",7],["bd80","絸",32,"健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸"],["be40","継",12,"綧",6,"綯",42],["be80","線",32,"尽劲荆兢茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵觉决诀绝均菌钧军君峻"],["bf40","緻",62],["bf80","縺縼",4,"繂",4,"繈",21,"俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀"],["c040","繞",35,"纃",23,"纜纝纞"],["c080","纮纴纻纼绖绤绬绹缊缐缞缷缹缻",6,"罃罆",9,"罒罓馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐"],["c140","罖罙罛罜罝罞罠罣",4,"罫罬罭罯罰罳罵罶罷罸罺罻罼罽罿羀羂",7,"羋羍羏",4,"羕",4,"羛羜羠羢羣羥羦羨",6,"羱"],["c180","羳",4,"羺羻羾翀翂翃翄翆翇翈翉翋翍翏",4,"翖翗翙",5,"翢翣痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿"],["c240","翤翧翨翪翫翬翭翯翲翴",6,"翽翾翿耂耇耈耉耊耎耏耑耓耚耛耝耞耟耡耣耤耫",5,"耲耴耹耺耼耾聀聁聄聅聇聈聉聎聏聐聑聓聕聖聗"],["c280","聙聛",13,"聫",5,"聲",11,"隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫"],["c340","聾肁肂肅肈肊肍",5,"肔肕肗肙肞肣肦肧肨肬肰肳肵肶肸肹肻胅胇",4,"胏",6,"胘胟胠胢胣胦胮胵胷胹胻胾胿脀脁脃脄脅脇脈脋"],["c380","脌脕脗脙脛脜脝脟",12,"脭脮脰脳脴脵脷脹",4,"脿谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸"],["c440","腀",5,"腇腉腍腎腏腒腖腗腘腛",4,"腡腢腣腤腦腨腪腫腬腯腲腳腵腶腷腸膁膃",4,"膉膋膌膍膎膐膒",5,"膙膚膞",4,"膤膥"],["c480","膧膩膫",7,"膴",5,"膼膽膾膿臄臅臇臈臉臋臍",6,"摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁"],["c540","臔",14,"臤臥臦臨臩臫臮",4,"臵",5,"臽臿舃與",4,"舎舏舑舓舕",5,"舝舠舤舥舦舧舩舮舲舺舼舽舿"],["c580","艀艁艂艃艅艆艈艊艌艍艎艐",7,"艙艛艜艝艞艠",7,"艩拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗"],["c640","艪艫艬艭艱艵艶艷艸艻艼芀芁芃芅芆芇芉芌芐芓芔芕芖芚芛芞芠芢芣芧芲芵芶芺芻芼芿苀苂苃苅苆苉苐苖苙苚苝苢苧苨苩苪苬苭苮苰苲苳苵苶苸"],["c680","苺苼",4,"茊茋茍茐茒茓茖茘茙茝",9,"茩茪茮茰茲茷茻茽啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐"],["c740","茾茿荁荂荄荅荈荊",4,"荓荕",4,"荝荢荰",6,"荹荺荾",6,"莇莈莊莋莌莍莏莐莑莔莕莖莗莙莚莝莟莡",6,"莬莭莮"],["c780","莯莵莻莾莿菂菃菄菆菈菉菋菍菎菐菑菒菓菕菗菙菚菛菞菢菣菤菦菧菨菫菬菭恰洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠"],["c840","菮華菳",4,"菺菻菼菾菿萀萂萅萇萈萉萊萐萒",5,"萙萚萛萞",5,"萩",7,"萲",5,"萹萺萻萾",7,"葇葈葉"],["c880","葊",6,"葒",4,"葘葝葞葟葠葢葤",4,"葪葮葯葰葲葴葷葹葻葼取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁"],["c940","葽",4,"蒃蒄蒅蒆蒊蒍蒏",7,"蒘蒚蒛蒝蒞蒟蒠蒢",12,"蒰蒱蒳蒵蒶蒷蒻蒼蒾蓀蓂蓃蓅蓆蓇蓈蓋蓌蓎蓏蓒蓔蓕蓗"],["c980","蓘",4,"蓞蓡蓢蓤蓧",4,"蓭蓮蓯蓱",10,"蓽蓾蔀蔁蔂伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳"],["ca40","蔃",8,"蔍蔎蔏蔐蔒蔔蔕蔖蔘蔙蔛蔜蔝蔞蔠蔢",8,"蔭",9,"蔾",4,"蕄蕅蕆蕇蕋",10],["ca80","蕗蕘蕚蕛蕜蕝蕟",4,"蕥蕦蕧蕩",8,"蕳蕵蕶蕷蕸蕼蕽蕿薀薁省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱"],["cb40","薂薃薆薈",6,"薐",10,"薝",6,"薥薦薧薩薫薬薭薱",5,"薸薺",6,"藂",6,"藊",4,"藑藒"],["cb80","藔藖",5,"藝",6,"藥藦藧藨藪",14,"恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔"],["cc40","藹藺藼藽藾蘀",4,"蘆",10,"蘒蘓蘔蘕蘗",15,"蘨蘪",13,"蘹蘺蘻蘽蘾蘿虀"],["cc80","虁",11,"虒虓處",4,"虛虜虝號虠虡虣",7,"獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃"],["cd40","虭虯虰虲",6,"蚃",6,"蚎",4,"蚔蚖",5,"蚞",4,"蚥蚦蚫蚭蚮蚲蚳蚷蚸蚹蚻",4,"蛁蛂蛃蛅蛈蛌蛍蛒蛓蛕蛖蛗蛚蛜"],["cd80","蛝蛠蛡蛢蛣蛥蛦蛧蛨蛪蛫蛬蛯蛵蛶蛷蛺蛻蛼蛽蛿蜁蜄蜅蜆蜋蜌蜎蜏蜐蜑蜔蜖汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威"],["ce40","蜙蜛蜝蜟蜠蜤蜦蜧蜨蜪蜫蜬蜭蜯蜰蜲蜳蜵蜶蜸蜹蜺蜼蜽蝀",6,"蝊蝋蝍蝏蝐蝑蝒蝔蝕蝖蝘蝚",5,"蝡蝢蝦",7,"蝯蝱蝲蝳蝵"],["ce80","蝷蝸蝹蝺蝿螀螁螄螆螇螉螊螌螎",4,"螔螕螖螘",6,"螠",4,"巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺"],["cf40","螥螦螧螩螪螮螰螱螲螴螶螷螸螹螻螼螾螿蟁",4,"蟇蟈蟉蟌",4,"蟔",6,"蟜蟝蟞蟟蟡蟢蟣蟤蟦蟧蟨蟩蟫蟬蟭蟯",9],["cf80","蟺蟻蟼蟽蟿蠀蠁蠂蠄",5,"蠋",7,"蠔蠗蠘蠙蠚蠜",4,"蠣稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓"],["d040","蠤",13,"蠳",5,"蠺蠻蠽蠾蠿衁衂衃衆",5,"衎",5,"衕衖衘衚",6,"衦衧衪衭衯衱衳衴衵衶衸衹衺"],["d080","衻衼袀袃袆袇袉袊袌袎袏袐袑袓袔袕袗",4,"袝",4,"袣袥",5,"小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄"],["d140","袬袮袯袰袲",4,"袸袹袺袻袽袾袿裀裃裄裇裈裊裋裌裍裏裐裑裓裖裗裚",4,"裠裡裦裧裩",6,"裲裵裶裷裺裻製裿褀褁褃",5],["d180","褉褋",4,"褑褔",4,"褜",4,"褢褣褤褦褧褨褩褬褭褮褯褱褲褳褵褷选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶"],["d240","褸",8,"襂襃襅",24,"襠",5,"襧",19,"襼"],["d280","襽襾覀覂覄覅覇",26,"摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐"],["d340","覢",30,"觃觍觓觔觕觗觘觙觛觝觟觠觡觢觤觧觨觩觪觬觭觮觰觱觲觴",6],["d380","觻",4,"訁",5,"計",21,"印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉"],["d440","訞",31,"訿",8,"詉",21],["d480","詟",25,"詺",6,"浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧"],["d540","誁",7,"誋",7,"誔",46],["d580","諃",32,"铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政"],["d640","諤",34,"謈",27],["d680","謤謥謧",30,"帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑"],["d740","譆",31,"譧",4,"譭",25],["d780","讇",24,"讬讱讻诇诐诪谉谞住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座"],["d840","谸",8,"豂豃豄豅豈豊豋豍",7,"豖豗豘豙豛",5,"豣",6,"豬",6,"豴豵豶豷豻",6,"貃貄貆貇"],["d880","貈貋貍",6,"貕貖貗貙",20,"亍丌兀丐廿卅丕亘丞鬲孬噩丨禺丿匕乇夭爻卮氐囟胤馗毓睾鼗丶亟鼐乜乩亓芈孛啬嘏仄厍厝厣厥厮靥赝匚叵匦匮匾赜卦卣刂刈刎刭刳刿剀剌剞剡剜蒯剽劂劁劐劓冂罔亻仃仉仂仨仡仫仞伛仳伢佤仵伥伧伉伫佞佧攸佚佝"],["d940","貮",62],["d980","賭",32,"佟佗伲伽佶佴侑侉侃侏佾佻侪佼侬侔俦俨俪俅俚俣俜俑俟俸倩偌俳倬倏倮倭俾倜倌倥倨偾偃偕偈偎偬偻傥傧傩傺僖儆僭僬僦僮儇儋仝氽佘佥俎龠汆籴兮巽黉馘冁夔勹匍訇匐凫夙兕亠兖亳衮袤亵脔裒禀嬴蠃羸冫冱冽冼"],["da40","贎",14,"贠赑赒赗赟赥赨赩赪赬赮赯赱赲赸",8,"趂趃趆趇趈趉趌",4,"趒趓趕",9,"趠趡"],["da80","趢趤",12,"趲趶趷趹趻趽跀跁跂跅跇跈跉跊跍跐跒跓跔凇冖冢冥讠讦讧讪讴讵讷诂诃诋诏诎诒诓诔诖诘诙诜诟诠诤诨诩诮诰诳诶诹诼诿谀谂谄谇谌谏谑谒谔谕谖谙谛谘谝谟谠谡谥谧谪谫谮谯谲谳谵谶卩卺阝阢阡阱阪阽阼陂陉陔陟陧陬陲陴隈隍隗隰邗邛邝邙邬邡邴邳邶邺"],["db40","跕跘跙跜跠跡跢跥跦跧跩跭跮跰跱跲跴跶跼跾",6,"踆踇踈踋踍踎踐踑踒踓踕",7,"踠踡踤",4,"踫踭踰踲踳踴踶踷踸踻踼踾"],["db80","踿蹃蹅蹆蹌",4,"蹓",5,"蹚",11,"蹧蹨蹪蹫蹮蹱邸邰郏郅邾郐郄郇郓郦郢郜郗郛郫郯郾鄄鄢鄞鄣鄱鄯鄹酃酆刍奂劢劬劭劾哿勐勖勰叟燮矍廴凵凼鬯厶弁畚巯坌垩垡塾墼壅壑圩圬圪圳圹圮圯坜圻坂坩垅坫垆坼坻坨坭坶坳垭垤垌垲埏垧垴垓垠埕埘埚埙埒垸埴埯埸埤埝"],["dc40","蹳蹵蹷",4,"蹽蹾躀躂躃躄躆躈",6,"躑躒躓躕",6,"躝躟",11,"躭躮躰躱躳",6,"躻",7],["dc80","軃",10,"軏",21,"堋堍埽埭堀堞堙塄堠塥塬墁墉墚墀馨鼙懿艹艽艿芏芊芨芄芎芑芗芙芫芸芾芰苈苊苣芘芷芮苋苌苁芩芴芡芪芟苄苎芤苡茉苷苤茏茇苜苴苒苘茌苻苓茑茚茆茔茕苠苕茜荑荛荜茈莒茼茴茱莛荞茯荏荇荃荟荀茗荠茭茺茳荦荥"],["dd40","軥",62],["dd80","輤",32,"荨茛荩荬荪荭荮莰荸莳莴莠莪莓莜莅荼莶莩荽莸荻莘莞莨莺莼菁萁菥菘堇萘萋菝菽菖萜萸萑萆菔菟萏萃菸菹菪菅菀萦菰菡葜葑葚葙葳蒇蒈葺蒉葸萼葆葩葶蒌蒎萱葭蓁蓍蓐蓦蒽蓓蓊蒿蒺蓠蒡蒹蒴蒗蓥蓣蔌甍蔸蓰蔹蔟蔺"],["de40","轅",32,"轪辀辌辒辝辠辡辢辤辥辦辧辪辬辭辮辯農辳辴辵辷辸辺辻込辿迀迃迆"],["de80","迉",4,"迏迒迖迗迚迠迡迣迧迬迯迱迲迴迵迶迺迻迼迾迿逇逈逌逎逓逕逘蕖蔻蓿蓼蕙蕈蕨蕤蕞蕺瞢蕃蕲蕻薤薨薇薏蕹薮薜薅薹薷薰藓藁藜藿蘧蘅蘩蘖蘼廾弈夼奁耷奕奚奘匏尢尥尬尴扌扪抟抻拊拚拗拮挢拶挹捋捃掭揶捱捺掎掴捭掬掊捩掮掼揲揸揠揿揄揞揎摒揆掾摅摁搋搛搠搌搦搡摞撄摭撖"],["df40","這逜連逤逥逧",5,"逰",4,"逷逹逺逽逿遀遃遅遆遈",4,"過達違遖遙遚遜",5,"遤遦遧適遪遫遬遯",4,"遶",6,"遾邁"],["df80","還邅邆邇邉邊邌",4,"邒邔邖邘邚邜邞邟邠邤邥邧邨邩邫邭邲邷邼邽邿郀摺撷撸撙撺擀擐擗擤擢攉攥攮弋忒甙弑卟叱叽叩叨叻吒吖吆呋呒呓呔呖呃吡呗呙吣吲咂咔呷呱呤咚咛咄呶呦咝哐咭哂咴哒咧咦哓哔呲咣哕咻咿哌哙哚哜咩咪咤哝哏哞唛哧唠哽唔哳唢唣唏唑唧唪啧喏喵啉啭啁啕唿啐唼"],["e040","郂郃郆郈郉郋郌郍郒郔郕郖郘郙郚郞郟郠郣郤郥郩郪郬郮郰郱郲郳郵郶郷郹郺郻郼郿鄀鄁鄃鄅",19,"鄚鄛鄜"],["e080","鄝鄟鄠鄡鄤",10,"鄰鄲",6,"鄺",8,"酄唷啖啵啶啷唳唰啜喋嗒喃喱喹喈喁喟啾嗖喑啻嗟喽喾喔喙嗪嗷嗉嘟嗑嗫嗬嗔嗦嗝嗄嗯嗥嗲嗳嗌嗍嗨嗵嗤辔嘞嘈嘌嘁嘤嘣嗾嘀嘧嘭噘嘹噗嘬噍噢噙噜噌噔嚆噤噱噫噻噼嚅嚓嚯囔囗囝囡囵囫囹囿圄圊圉圜帏帙帔帑帱帻帼"],["e140","酅酇酈酑酓酔酕酖酘酙酛酜酟酠酦酧酨酫酭酳酺酻酼醀",4,"醆醈醊醎醏醓",6,"醜",5,"醤",5,"醫醬醰醱醲醳醶醷醸醹醻"],["e180","醼",10,"釈釋釐釒",9,"針",8,"帷幄幔幛幞幡岌屺岍岐岖岈岘岙岑岚岜岵岢岽岬岫岱岣峁岷峄峒峤峋峥崂崃崧崦崮崤崞崆崛嵘崾崴崽嵬嵛嵯嵝嵫嵋嵊嵩嵴嶂嶙嶝豳嶷巅彳彷徂徇徉後徕徙徜徨徭徵徼衢彡犭犰犴犷犸狃狁狎狍狒狨狯狩狲狴狷猁狳猃狺"],["e240","釦",62],["e280","鈥",32,"狻猗猓猡猊猞猝猕猢猹猥猬猸猱獐獍獗獠獬獯獾舛夥飧夤夂饣饧",5,"饴饷饽馀馄馇馊馍馐馑馓馔馕庀庑庋庖庥庠庹庵庾庳赓廒廑廛廨廪膺忄忉忖忏怃忮怄忡忤忾怅怆忪忭忸怙怵怦怛怏怍怩怫怊怿怡恸恹恻恺恂"],["e340","鉆",45,"鉵",16],["e380","銆",7,"銏",24,"恪恽悖悚悭悝悃悒悌悛惬悻悱惝惘惆惚悴愠愦愕愣惴愀愎愫慊慵憬憔憧憷懔懵忝隳闩闫闱闳闵闶闼闾阃阄阆阈阊阋阌阍阏阒阕阖阗阙阚丬爿戕氵汔汜汊沣沅沐沔沌汨汩汴汶沆沩泐泔沭泷泸泱泗沲泠泖泺泫泮沱泓泯泾"],["e440","銨",5,"銯",24,"鋉",31],["e480","鋩",32,"洹洧洌浃浈洇洄洙洎洫浍洮洵洚浏浒浔洳涑浯涞涠浞涓涔浜浠浼浣渚淇淅淞渎涿淠渑淦淝淙渖涫渌涮渫湮湎湫溲湟溆湓湔渲渥湄滟溱溘滠漭滢溥溧溽溻溷滗溴滏溏滂溟潢潆潇漤漕滹漯漶潋潴漪漉漩澉澍澌潸潲潼潺濑"],["e540","錊",51,"錿",10],["e580","鍊",31,"鍫濉澧澹澶濂濡濮濞濠濯瀚瀣瀛瀹瀵灏灞宀宄宕宓宥宸甯骞搴寤寮褰寰蹇謇辶迓迕迥迮迤迩迦迳迨逅逄逋逦逑逍逖逡逵逶逭逯遄遑遒遐遨遘遢遛暹遴遽邂邈邃邋彐彗彖彘尻咫屐屙孱屣屦羼弪弩弭艴弼鬻屮妁妃妍妩妪妣"],["e640","鍬",34,"鎐",27],["e680","鎬",29,"鏋鏌鏍妗姊妫妞妤姒妲妯姗妾娅娆姝娈姣姘姹娌娉娲娴娑娣娓婀婧婊婕娼婢婵胬媪媛婷婺媾嫫媲嫒嫔媸嫠嫣嫱嫖嫦嫘嫜嬉嬗嬖嬲嬷孀尕尜孚孥孳孑孓孢驵驷驸驺驿驽骀骁骅骈骊骐骒骓骖骘骛骜骝骟骠骢骣骥骧纟纡纣纥纨纩"],["e740","鏎",7,"鏗",54],["e780","鐎",32,"纭纰纾绀绁绂绉绋绌绐绔绗绛绠绡绨绫绮绯绱绲缍绶绺绻绾缁缂缃缇缈缋缌缏缑缒缗缙缜缛缟缡",6,"缪缫缬缭缯",4,"缵幺畿巛甾邕玎玑玮玢玟珏珂珑玷玳珀珉珈珥珙顼琊珩珧珞玺珲琏琪瑛琦琥琨琰琮琬"],["e840","鐯",14,"鐿",43,"鑬鑭鑮鑯"],["e880","鑰",20,"钑钖钘铇铏铓铔铚铦铻锜锠琛琚瑁瑜瑗瑕瑙瑷瑭瑾璜璎璀璁璇璋璞璨璩璐璧瓒璺韪韫韬杌杓杞杈杩枥枇杪杳枘枧杵枨枞枭枋杷杼柰栉柘栊柩枰栌柙枵柚枳柝栀柃枸柢栎柁柽栲栳桠桡桎桢桄桤梃栝桕桦桁桧桀栾桊桉栩梵梏桴桷梓桫棂楮棼椟椠棹"],["e940","锧锳锽镃镈镋镕镚镠镮镴镵長",7,"門",42],["e980","閫",32,"椤棰椋椁楗棣椐楱椹楠楂楝榄楫榀榘楸椴槌榇榈槎榉楦楣楹榛榧榻榫榭槔榱槁槊槟榕槠榍槿樯槭樗樘橥槲橄樾檠橐橛樵檎橹樽樨橘橼檑檐檩檗檫猷獒殁殂殇殄殒殓殍殚殛殡殪轫轭轱轲轳轵轶轸轷轹轺轼轾辁辂辄辇辋"],["ea40","闌",27,"闬闿阇阓阘阛阞阠阣",6,"阫阬阭阯阰阷阸阹阺阾陁陃陊陎陏陑陒陓陖陗"],["ea80","陘陙陚陜陝陞陠陣陥陦陫陭",4,"陳陸",12,"隇隉隊辍辎辏辘辚軎戋戗戛戟戢戡戥戤戬臧瓯瓴瓿甏甑甓攴旮旯旰昊昙杲昃昕昀炅曷昝昴昱昶昵耆晟晔晁晏晖晡晗晷暄暌暧暝暾曛曜曦曩贲贳贶贻贽赀赅赆赈赉赇赍赕赙觇觊觋觌觎觏觐觑牮犟牝牦牯牾牿犄犋犍犏犒挈挲掰"],["eb40","隌階隑隒隓隕隖隚際隝",9,"隨",7,"隱隲隴隵隷隸隺隻隿雂雃雈雊雋雐雑雓雔雖",9,"雡",6,"雫"],["eb80","雬雭雮雰雱雲雴雵雸雺電雼雽雿霂霃霅霊霋霌霐霑霒霔霕霗",4,"霝霟霠搿擘耄毪毳毽毵毹氅氇氆氍氕氘氙氚氡氩氤氪氲攵敕敫牍牒牖爰虢刖肟肜肓肼朊肽肱肫肭肴肷胧胨胩胪胛胂胄胙胍胗朐胝胫胱胴胭脍脎胲胼朕脒豚脶脞脬脘脲腈腌腓腴腙腚腱腠腩腼腽腭腧塍媵膈膂膑滕膣膪臌朦臊膻"],["ec40","霡",8,"霫霬霮霯霱霳",4,"霺霻霼霽霿",18,"靔靕靗靘靚靜靝靟靣靤靦靧靨靪",7],["ec80","靲靵靷",4,"靽",7,"鞆",4,"鞌鞎鞏鞐鞓鞕鞖鞗鞙",4,"臁膦欤欷欹歃歆歙飑飒飓飕飙飚殳彀毂觳斐齑斓於旆旄旃旌旎旒旖炀炜炖炝炻烀炷炫炱烨烊焐焓焖焯焱煳煜煨煅煲煊煸煺熘熳熵熨熠燠燔燧燹爝爨灬焘煦熹戾戽扃扈扉礻祀祆祉祛祜祓祚祢祗祠祯祧祺禅禊禚禧禳忑忐"],["ed40","鞞鞟鞡鞢鞤",6,"鞬鞮鞰鞱鞳鞵",46],["ed80","韤韥韨韮",4,"韴韷",23,"怼恝恚恧恁恙恣悫愆愍慝憩憝懋懑戆肀聿沓泶淼矶矸砀砉砗砘砑斫砭砜砝砹砺砻砟砼砥砬砣砩硎硭硖硗砦硐硇硌硪碛碓碚碇碜碡碣碲碹碥磔磙磉磬磲礅磴礓礤礞礴龛黹黻黼盱眄眍盹眇眈眚眢眙眭眦眵眸睐睑睇睃睚睨"],["ee40","頏",62],["ee80","顎",32,"睢睥睿瞍睽瞀瞌瞑瞟瞠瞰瞵瞽町畀畎畋畈畛畲畹疃罘罡罟詈罨罴罱罹羁罾盍盥蠲钅钆钇钋钊钌钍钏钐钔钗钕钚钛钜钣钤钫钪钭钬钯钰钲钴钶",4,"钼钽钿铄铈",6,"铐铑铒铕铖铗铙铘铛铞铟铠铢铤铥铧铨铪"],["ef40","顯",5,"颋颎颒颕颙颣風",37,"飏飐飔飖飗飛飜飝飠",4],["ef80","飥飦飩",30,"铩铫铮铯铳铴铵铷铹铼铽铿锃锂锆锇锉锊锍锎锏锒",4,"锘锛锝锞锟锢锪锫锩锬锱锲锴锶锷锸锼锾锿镂锵镄镅镆镉镌镎镏镒镓镔镖镗镘镙镛镞镟镝镡镢镤",8,"镯镱镲镳锺矧矬雉秕秭秣秫稆嵇稃稂稞稔"],["f040","餈",4,"餎餏餑",28,"餯",26],["f080","饊",9,"饖",12,"饤饦饳饸饹饻饾馂馃馉稹稷穑黏馥穰皈皎皓皙皤瓞瓠甬鸠鸢鸨",4,"鸲鸱鸶鸸鸷鸹鸺鸾鹁鹂鹄鹆鹇鹈鹉鹋鹌鹎鹑鹕鹗鹚鹛鹜鹞鹣鹦",6,"鹱鹭鹳疒疔疖疠疝疬疣疳疴疸痄疱疰痃痂痖痍痣痨痦痤痫痧瘃痱痼痿瘐瘀瘅瘌瘗瘊瘥瘘瘕瘙"],["f140","馌馎馚",10,"馦馧馩",47],["f180","駙",32,"瘛瘼瘢瘠癀瘭瘰瘿瘵癃瘾瘳癍癞癔癜癖癫癯翊竦穸穹窀窆窈窕窦窠窬窨窭窳衤衩衲衽衿袂袢裆袷袼裉裢裎裣裥裱褚裼裨裾裰褡褙褓褛褊褴褫褶襁襦襻疋胥皲皴矜耒耔耖耜耠耢耥耦耧耩耨耱耋耵聃聆聍聒聩聱覃顸颀颃"],["f240","駺",62],["f280","騹",32,"颉颌颍颏颔颚颛颞颟颡颢颥颦虍虔虬虮虿虺虼虻蚨蚍蚋蚬蚝蚧蚣蚪蚓蚩蚶蛄蚵蛎蚰蚺蚱蚯蛉蛏蚴蛩蛱蛲蛭蛳蛐蜓蛞蛴蛟蛘蛑蜃蜇蛸蜈蜊蜍蜉蜣蜻蜞蜥蜮蜚蜾蝈蜴蜱蜩蜷蜿螂蜢蝽蝾蝻蝠蝰蝌蝮螋蝓蝣蝼蝤蝙蝥螓螯螨蟒"],["f340","驚",17,"驲骃骉骍骎骔骕骙骦骩",6,"骲骳骴骵骹骻骽骾骿髃髄髆",4,"髍髎髏髐髒體髕髖髗髙髚髛髜"],["f380","髝髞髠髢髣髤髥髧髨髩髪髬髮髰",8,"髺髼",6,"鬄鬅鬆蟆螈螅螭螗螃螫蟥螬螵螳蟋蟓螽蟑蟀蟊蟛蟪蟠蟮蠖蠓蟾蠊蠛蠡蠹蠼缶罂罄罅舐竺竽笈笃笄笕笊笫笏筇笸笪笙笮笱笠笥笤笳笾笞筘筚筅筵筌筝筠筮筻筢筲筱箐箦箧箸箬箝箨箅箪箜箢箫箴篑篁篌篝篚篥篦篪簌篾篼簏簖簋"],["f440","鬇鬉",5,"鬐鬑鬒鬔",10,"鬠鬡鬢鬤",10,"鬰鬱鬳",7,"鬽鬾鬿魀魆魊魋魌魎魐魒魓魕",5],["f480","魛",32,"簟簪簦簸籁籀臾舁舂舄臬衄舡舢舣舭舯舨舫舸舻舳舴舾艄艉艋艏艚艟艨衾袅袈裘裟襞羝羟羧羯羰羲籼敉粑粝粜粞粢粲粼粽糁糇糌糍糈糅糗糨艮暨羿翎翕翥翡翦翩翮翳糸絷綦綮繇纛麸麴赳趄趔趑趱赧赭豇豉酊酐酎酏酤"],["f540","魼",62],["f580","鮻",32,"酢酡酰酩酯酽酾酲酴酹醌醅醐醍醑醢醣醪醭醮醯醵醴醺豕鹾趸跫踅蹙蹩趵趿趼趺跄跖跗跚跞跎跏跛跆跬跷跸跣跹跻跤踉跽踔踝踟踬踮踣踯踺蹀踹踵踽踱蹉蹁蹂蹑蹒蹊蹰蹶蹼蹯蹴躅躏躔躐躜躞豸貂貊貅貘貔斛觖觞觚觜"],["f640","鯜",62],["f680","鰛",32,"觥觫觯訾謦靓雩雳雯霆霁霈霏霎霪霭霰霾龀龃龅",5,"龌黾鼋鼍隹隼隽雎雒瞿雠銎銮鋈錾鍪鏊鎏鐾鑫鱿鲂鲅鲆鲇鲈稣鲋鲎鲐鲑鲒鲔鲕鲚鲛鲞",5,"鲥",4,"鲫鲭鲮鲰",7,"鲺鲻鲼鲽鳄鳅鳆鳇鳊鳋"],["f740","鰼",62],["f780","鱻鱽鱾鲀鲃鲄鲉鲊鲌鲏鲓鲖鲗鲘鲙鲝鲪鲬鲯鲹鲾",4,"鳈鳉鳑鳒鳚鳛鳠鳡鳌",4,"鳓鳔鳕鳗鳘鳙鳜鳝鳟鳢靼鞅鞑鞒鞔鞯鞫鞣鞲鞴骱骰骷鹘骶骺骼髁髀髅髂髋髌髑魅魃魇魉魈魍魑飨餍餮饕饔髟髡髦髯髫髻髭髹鬈鬏鬓鬟鬣麽麾縻麂麇麈麋麒鏖麝麟黛黜黝黠黟黢黩黧黥黪黯鼢鼬鼯鼹鼷鼽鼾齄"],["f840","鳣",62],["f880","鴢",32],["f940","鵃",62],["f980","鶂",32],["fa40","鶣",62],["fa80","鷢",32],["fb40","鸃",27,"鸤鸧鸮鸰鸴鸻鸼鹀鹍鹐鹒鹓鹔鹖鹙鹝鹟鹠鹡鹢鹥鹮鹯鹲鹴",9,"麀"],["fb80","麁麃麄麅麆麉麊麌",5,"麔",8,"麞麠",5,"麧麨麩麪"],["fc40","麫",8,"麵麶麷麹麺麼麿",4,"黅黆黇黈黊黋黌黐黒黓黕黖黗黙黚點黡黣黤黦黨黫黬黭黮黰",8,"黺黽黿",6],["fc80","鼆",4,"鼌鼏鼑鼒鼔鼕鼖鼘鼚",5,"鼡鼣",8,"鼭鼮鼰鼱"],["fd40","鼲",4,"鼸鼺鼼鼿",4,"齅",10,"齒",38],["fd80","齹",5,"龁龂龍",11,"龜龝龞龡",4,"郎凉秊裏隣"],["fe40","兀嗀﨎﨏﨑﨓﨔礼﨟蘒﨡﨣﨤﨧﨨﨩"]]'), IT = [
  [
    "a140",
    "",
    62
  ],
  [
    "a180",
    "",
    32
  ],
  [
    "a240",
    "",
    62
  ],
  [
    "a280",
    "",
    32
  ],
  [
    "a2ab",
    "",
    5
  ],
  [
    "a2e3",
    "€"
  ],
  [
    "a2ef",
    ""
  ],
  [
    "a2fd",
    ""
  ],
  [
    "a340",
    "",
    62
  ],
  [
    "a380",
    "",
    31,
    "　"
  ],
  [
    "a440",
    "",
    62
  ],
  [
    "a480",
    "",
    32
  ],
  [
    "a4f4",
    "",
    10
  ],
  [
    "a540",
    "",
    62
  ],
  [
    "a580",
    "",
    32
  ],
  [
    "a5f7",
    "",
    7
  ],
  [
    "a640",
    "",
    62
  ],
  [
    "a680",
    "",
    32
  ],
  [
    "a6b9",
    "",
    7
  ],
  [
    "a6d9",
    "",
    6
  ],
  [
    "a6ec",
    ""
  ],
  [
    "a6f3",
    ""
  ],
  [
    "a6f6",
    "",
    8
  ],
  [
    "a740",
    "",
    62
  ],
  [
    "a780",
    "",
    32
  ],
  [
    "a7c2",
    "",
    14
  ],
  [
    "a7f2",
    "",
    12
  ],
  [
    "a896",
    "",
    10
  ],
  [
    "a8bc",
    ""
  ],
  [
    "a8bf",
    "ǹ"
  ],
  [
    "a8c1",
    ""
  ],
  [
    "a8ea",
    "",
    20
  ],
  [
    "a958",
    ""
  ],
  [
    "a95b",
    ""
  ],
  [
    "a95d",
    ""
  ],
  [
    "a989",
    "〾⿰",
    11
  ],
  [
    "a997",
    "",
    12
  ],
  [
    "a9f0",
    "",
    14
  ],
  [
    "aaa1",
    "",
    93
  ],
  [
    "aba1",
    "",
    93
  ],
  [
    "aca1",
    "",
    93
  ],
  [
    "ada1",
    "",
    93
  ],
  [
    "aea1",
    "",
    93
  ],
  [
    "afa1",
    "",
    93
  ],
  [
    "d7fa",
    "",
    4
  ],
  [
    "f8a1",
    "",
    93
  ],
  [
    "f9a1",
    "",
    93
  ],
  [
    "faa1",
    "",
    93
  ],
  [
    "fba1",
    "",
    93
  ],
  [
    "fca1",
    "",
    93
  ],
  [
    "fda1",
    "",
    93
  ],
  [
    "fe50",
    "⺁⺄㑳㑇⺈⺋㖞㘚㘎⺌⺗㥮㤘㧏㧟㩳㧐㭎㱮㳠⺧⺪䁖䅟⺮䌷⺳⺶⺷䎱䎬⺻䏝䓖䙡䙌"
  ],
  [
    "fe80",
    "䜣䜩䝼䞍⻊䥇䥺䥽䦂䦃䦅䦆䦟䦛䦷䦶䲣䲟䲠䲡䱷䲢䴓",
    6,
    "䶮",
    93
  ]
], lz = [128, 165, 169, 178, 184, 216, 226, 235, 238, 244, 248, 251, 253, 258, 276, 284, 300, 325, 329, 334, 364, 463, 465, 467, 469, 471, 473, 475, 477, 506, 594, 610, 712, 716, 730, 930, 938, 962, 970, 1026, 1104, 1106, 8209, 8215, 8218, 8222, 8231, 8241, 8244, 8246, 8252, 8365, 8452, 8454, 8458, 8471, 8482, 8556, 8570, 8596, 8602, 8713, 8720, 8722, 8726, 8731, 8737, 8740, 8742, 8748, 8751, 8760, 8766, 8777, 8781, 8787, 8802, 8808, 8816, 8854, 8858, 8870, 8896, 8979, 9322, 9372, 9548, 9588, 9616, 9622, 9634, 9652, 9662, 9672, 9676, 9680, 9702, 9735, 9738, 9793, 9795, 11906, 11909, 11913, 11917, 11928, 11944, 11947, 11951, 11956, 11960, 11964, 11979, 12284, 12292, 12312, 12319, 12330, 12351, 12436, 12447, 12535, 12543, 12586, 12842, 12850, 12964, 13200, 13215, 13218, 13253, 13263, 13267, 13270, 13384, 13428, 13727, 13839, 13851, 14617, 14703, 14801, 14816, 14964, 15183, 15471, 15585, 16471, 16736, 17208, 17325, 17330, 17374, 17623, 17997, 18018, 18212, 18218, 18301, 18318, 18760, 18811, 18814, 18820, 18823, 18844, 18848, 18872, 19576, 19620, 19738, 19887, 40870, 59244, 59336, 59367, 59413, 59417, 59423, 59431, 59437, 59443, 59452, 59460, 59478, 59493, 63789, 63866, 63894, 63976, 63986, 64016, 64018, 64021, 64025, 64034, 64037, 64042, 65074, 65093, 65107, 65112, 65127, 65132, 65375, 65510, 65536], pz = [0, 36, 38, 45, 50, 81, 89, 95, 96, 100, 103, 104, 105, 109, 126, 133, 148, 172, 175, 179, 208, 306, 307, 308, 309, 310, 311, 312, 313, 341, 428, 443, 544, 545, 558, 741, 742, 749, 750, 805, 819, 820, 7922, 7924, 7925, 7927, 7934, 7943, 7944, 7945, 7950, 8062, 8148, 8149, 8152, 8164, 8174, 8236, 8240, 8262, 8264, 8374, 8380, 8381, 8384, 8388, 8390, 8392, 8393, 8394, 8396, 8401, 8406, 8416, 8419, 8424, 8437, 8439, 8445, 8482, 8485, 8496, 8521, 8603, 8936, 8946, 9046, 9050, 9063, 9066, 9076, 9092, 9100, 9108, 9111, 9113, 9131, 9162, 9164, 9218, 9219, 11329, 11331, 11334, 11336, 11346, 11361, 11363, 11366, 11370, 11372, 11375, 11389, 11682, 11686, 11687, 11692, 11694, 11714, 11716, 11723, 11725, 11730, 11736, 11982, 11989, 12102, 12336, 12348, 12350, 12384, 12393, 12395, 12397, 12510, 12553, 12851, 12962, 12973, 13738, 13823, 13919, 13933, 14080, 14298, 14585, 14698, 15583, 15847, 16318, 16434, 16438, 16481, 16729, 17102, 17122, 17315, 17320, 17402, 17418, 17859, 17909, 17911, 17915, 17916, 17936, 17939, 17961, 18664, 18703, 18814, 18962, 19043, 33469, 33470, 33471, 33484, 33485, 33490, 33497, 33501, 33505, 33513, 33520, 33536, 33550, 37845, 37921, 37948, 38029, 38038, 38064, 38065, 38066, 38069, 38075, 38076, 38078, 39108, 39109, 39113, 39114, 39115, 39116, 39265, 39394, 189e3], dz = {
  uChars: lz,
  gbChars: pz
}, fz = /* @__PURE__ */ JSON.parse('[["0","\\u0000",127],["8141","갂갃갅갆갋",4,"갘갞갟갡갢갣갥",6,"갮갲갳갴"],["8161","갵갶갷갺갻갽갾갿걁",9,"걌걎",5,"걕"],["8181","걖걗걙걚걛걝",18,"걲걳걵걶걹걻",4,"겂겇겈겍겎겏겑겒겓겕",6,"겞겢",5,"겫겭겮겱",6,"겺겾겿곀곂곃곅곆곇곉곊곋곍",7,"곖곘",7,"곢곣곥곦곩곫곭곮곲곴곷",4,"곾곿괁괂괃괅괇",4,"괎괐괒괓"],["8241","괔괕괖괗괙괚괛괝괞괟괡",7,"괪괫괮",5],["8261","괶괷괹괺괻괽",6,"굆굈굊",5,"굑굒굓굕굖굗"],["8281","굙",7,"굢굤",7,"굮굯굱굲굷굸굹굺굾궀궃",4,"궊궋궍궎궏궑",10,"궞",5,"궥",17,"궸",7,"귂귃귅귆귇귉",6,"귒귔",7,"귝귞귟귡귢귣귥",18],["8341","귺귻귽귾긂",5,"긊긌긎",5,"긕",7],["8361","긝",18,"긲긳긵긶긹긻긼"],["8381","긽긾긿깂깄깇깈깉깋깏깑깒깓깕깗",4,"깞깢깣깤깦깧깪깫깭깮깯깱",6,"깺깾",5,"꺆",5,"꺍",46,"꺿껁껂껃껅",6,"껎껒",5,"껚껛껝",8],["8441","껦껧껩껪껬껮",5,"껵껶껷껹껺껻껽",8],["8461","꼆꼉꼊꼋꼌꼎꼏꼑",18],["8481","꼤",7,"꼮꼯꼱꼳꼵",6,"꼾꽀꽄꽅꽆꽇꽊",5,"꽑",10,"꽞",5,"꽦",18,"꽺",5,"꾁꾂꾃꾅꾆꾇꾉",6,"꾒꾓꾔꾖",5,"꾝",26,"꾺꾻꾽꾾"],["8541","꾿꿁",5,"꿊꿌꿏",4,"꿕",6,"꿝",4],["8561","꿢",5,"꿪",5,"꿲꿳꿵꿶꿷꿹",6,"뀂뀃"],["8581","뀅",6,"뀍뀎뀏뀑뀒뀓뀕",6,"뀞",9,"뀩",26,"끆끇끉끋끍끏끐끑끒끖끘끚끛끜끞",29,"끾끿낁낂낃낅",6,"낎낐낒",5,"낛낝낞낣낤"],["8641","낥낦낧낪낰낲낶낷낹낺낻낽",6,"냆냊",5,"냒"],["8661","냓냕냖냗냙",6,"냡냢냣냤냦",10],["8681","냱",22,"넊넍넎넏넑넔넕넖넗넚넞",4,"넦넧넩넪넫넭",6,"넶넺",5,"녂녃녅녆녇녉",6,"녒녓녖녗녙녚녛녝녞녟녡",22,"녺녻녽녾녿놁놃",4,"놊놌놎놏놐놑놕놖놗놙놚놛놝"],["8741","놞",9,"놩",15],["8761","놹",18,"뇍뇎뇏뇑뇒뇓뇕"],["8781","뇖",5,"뇞뇠",7,"뇪뇫뇭뇮뇯뇱",7,"뇺뇼뇾",5,"눆눇눉눊눍",6,"눖눘눚",5,"눡",18,"눵",6,"눽",26,"뉙뉚뉛뉝뉞뉟뉡",6,"뉪",4],["8841","뉯",4,"뉶",5,"뉽",6,"늆늇늈늊",4],["8861","늏늒늓늕늖늗늛",4,"늢늤늧늨늩늫늭늮늯늱늲늳늵늶늷"],["8881","늸",15,"닊닋닍닎닏닑닓",4,"닚닜닞닟닠닡닣닧닩닪닰닱닲닶닼닽닾댂댃댅댆댇댉",6,"댒댖",5,"댝",54,"덗덙덚덝덠덡덢덣"],["8941","덦덨덪덬덭덯덲덳덵덶덷덹",6,"뎂뎆",5,"뎍"],["8961","뎎뎏뎑뎒뎓뎕",10,"뎢",5,"뎩뎪뎫뎭"],["8981","뎮",21,"돆돇돉돊돍돏돑돒돓돖돘돚돜돞돟돡돢돣돥돦돧돩",18,"돽",18,"됑",6,"됙됚됛됝됞됟됡",6,"됪됬",7,"됵",15],["8a41","둅",10,"둒둓둕둖둗둙",6,"둢둤둦"],["8a61","둧",4,"둭",18,"뒁뒂"],["8a81","뒃",4,"뒉",19,"뒞",5,"뒥뒦뒧뒩뒪뒫뒭",7,"뒶뒸뒺",5,"듁듂듃듅듆듇듉",6,"듑듒듓듔듖",5,"듞듟듡듢듥듧",4,"듮듰듲",5,"듹",26,"딖딗딙딚딝"],["8b41","딞",5,"딦딫",4,"딲딳딵딶딷딹",6,"땂땆"],["8b61","땇땈땉땊땎땏땑땒땓땕",6,"땞땢",8],["8b81","땫",52,"떢떣떥떦떧떩떬떭떮떯떲떶",4,"떾떿뗁뗂뗃뗅",6,"뗎뗒",5,"뗙",18,"뗭",18],["8c41","똀",15,"똒똓똕똖똗똙",4],["8c61","똞",6,"똦",5,"똭",6,"똵",5],["8c81","똻",12,"뙉",26,"뙥뙦뙧뙩",50,"뚞뚟뚡뚢뚣뚥",5,"뚭뚮뚯뚰뚲",16],["8d41","뛃",16,"뛕",8],["8d61","뛞",17,"뛱뛲뛳뛵뛶뛷뛹뛺"],["8d81","뛻",4,"뜂뜃뜄뜆",33,"뜪뜫뜭뜮뜱",6,"뜺뜼",7,"띅띆띇띉띊띋띍",6,"띖",9,"띡띢띣띥띦띧띩",6,"띲띴띶",5,"띾띿랁랂랃랅",6,"랎랓랔랕랚랛랝랞"],["8e41","랟랡",6,"랪랮",5,"랶랷랹",8],["8e61","럂",4,"럈럊",19],["8e81","럞",13,"럮럯럱럲럳럵",6,"럾렂",4,"렊렋렍렎렏렑",6,"렚렜렞",5,"렦렧렩렪렫렭",6,"렶렺",5,"롁롂롃롅",11,"롒롔",7,"롞롟롡롢롣롥",6,"롮롰롲",5,"롹롺롻롽",7],["8f41","뢅",7,"뢎",17],["8f61","뢠",7,"뢩",6,"뢱뢲뢳뢵뢶뢷뢹",4],["8f81","뢾뢿룂룄룆",5,"룍룎룏룑룒룓룕",7,"룞룠룢",5,"룪룫룭룮룯룱",6,"룺룼룾",5,"뤅",18,"뤙",6,"뤡",26,"뤾뤿륁륂륃륅",6,"륍륎륐륒",5],["9041","륚륛륝륞륟륡",6,"륪륬륮",5,"륶륷륹륺륻륽"],["9061","륾",5,"릆릈릋릌릏",15],["9081","릟",12,"릮릯릱릲릳릵",6,"릾맀맂",5,"맊맋맍맓",4,"맚맜맟맠맢맦맧맩맪맫맭",6,"맶맻",4,"먂",5,"먉",11,"먖",33,"먺먻먽먾먿멁멃멄멅멆"],["9141","멇멊멌멏멐멑멒멖멗멙멚멛멝",6,"멦멪",5],["9161","멲멳멵멶멷멹",9,"몆몈몉몊몋몍",5],["9181","몓",20,"몪몭몮몯몱몳",4,"몺몼몾",5,"뫅뫆뫇뫉",14,"뫚",33,"뫽뫾뫿묁묂묃묅",7,"묎묐묒",5,"묙묚묛묝묞묟묡",6],["9241","묨묪묬",7,"묷묹묺묿",4,"뭆뭈뭊뭋뭌뭎뭑뭒"],["9261","뭓뭕뭖뭗뭙",7,"뭢뭤",7,"뭭",4],["9281","뭲",21,"뮉뮊뮋뮍뮎뮏뮑",18,"뮥뮦뮧뮩뮪뮫뮭",6,"뮵뮶뮸",7,"믁믂믃믅믆믇믉",6,"믑믒믔",35,"믺믻믽믾밁"],["9341","밃",4,"밊밎밐밒밓밙밚밠밡밢밣밦밨밪밫밬밮밯밲밳밵"],["9361","밶밷밹",6,"뱂뱆뱇뱈뱊뱋뱎뱏뱑",8],["9381","뱚뱛뱜뱞",37,"벆벇벉벊벍벏",4,"벖벘벛",4,"벢벣벥벦벩",6,"벲벶",5,"벾벿볁볂볃볅",7,"볎볒볓볔볖볗볙볚볛볝",22,"볷볹볺볻볽"],["9441","볾",5,"봆봈봊",5,"봑봒봓봕",8],["9461","봞",5,"봥",6,"봭",12],["9481","봺",5,"뵁",6,"뵊뵋뵍뵎뵏뵑",6,"뵚",9,"뵥뵦뵧뵩",22,"붂붃붅붆붋",4,"붒붔붖붗붘붛붝",6,"붥",10,"붱",6,"붹",24],["9541","뷒뷓뷖뷗뷙뷚뷛뷝",11,"뷪",5,"뷱"],["9561","뷲뷳뷵뷶뷷뷹",6,"븁븂븄븆",5,"븎븏븑븒븓"],["9581","븕",6,"븞븠",35,"빆빇빉빊빋빍빏",4,"빖빘빜빝빞빟빢빣빥빦빧빩빫",4,"빲빶",4,"빾빿뺁뺂뺃뺅",6,"뺎뺒",5,"뺚",13,"뺩",14],["9641","뺸",23,"뻒뻓"],["9661","뻕뻖뻙",6,"뻡뻢뻦",5,"뻭",8],["9681","뻶",10,"뼂",5,"뼊",13,"뼚뼞",33,"뽂뽃뽅뽆뽇뽉",6,"뽒뽓뽔뽖",44],["9741","뾃",16,"뾕",8],["9761","뾞",17,"뾱",7],["9781","뾹",11,"뿆",5,"뿎뿏뿑뿒뿓뿕",6,"뿝뿞뿠뿢",89,"쀽쀾쀿"],["9841","쁀",16,"쁒",5,"쁙쁚쁛"],["9861","쁝쁞쁟쁡",6,"쁪",15],["9881","쁺",21,"삒삓삕삖삗삙",6,"삢삤삦",5,"삮삱삲삷",4,"삾샂샃샄샆샇샊샋샍샎샏샑",6,"샚샞",5,"샦샧샩샪샫샭",6,"샶샸샺",5,"섁섂섃섅섆섇섉",6,"섑섒섓섔섖",5,"섡섢섥섨섩섪섫섮"],["9941","섲섳섴섵섷섺섻섽섾섿셁",6,"셊셎",5,"셖셗"],["9961","셙셚셛셝",6,"셦셪",5,"셱셲셳셵셶셷셹셺셻"],["9981","셼",8,"솆",5,"솏솑솒솓솕솗",4,"솞솠솢솣솤솦솧솪솫솭솮솯솱",11,"솾",5,"쇅쇆쇇쇉쇊쇋쇍",6,"쇕쇖쇙",6,"쇡쇢쇣쇥쇦쇧쇩",6,"쇲쇴",7,"쇾쇿숁숂숃숅",6,"숎숐숒",5,"숚숛숝숞숡숢숣"],["9a41","숤숥숦숧숪숬숮숰숳숵",16],["9a61","쉆쉇쉉",6,"쉒쉓쉕쉖쉗쉙",6,"쉡쉢쉣쉤쉦"],["9a81","쉧",4,"쉮쉯쉱쉲쉳쉵",6,"쉾슀슂",5,"슊",5,"슑",6,"슙슚슜슞",5,"슦슧슩슪슫슮",5,"슶슸슺",33,"싞싟싡싢싥",5,"싮싰싲싳싴싵싷싺싽싾싿쌁",6,"쌊쌋쌎쌏"],["9b41","쌐쌑쌒쌖쌗쌙쌚쌛쌝",6,"쌦쌧쌪",8],["9b61","쌳",17,"썆",7],["9b81","썎",25,"썪썫썭썮썯썱썳",4,"썺썻썾",5,"쎅쎆쎇쎉쎊쎋쎍",50,"쏁",22,"쏚"],["9c41","쏛쏝쏞쏡쏣",4,"쏪쏫쏬쏮",5,"쏶쏷쏹",5],["9c61","쏿",8,"쐉",6,"쐑",9],["9c81","쐛",8,"쐥",6,"쐭쐮쐯쐱쐲쐳쐵",6,"쐾",9,"쑉",26,"쑦쑧쑩쑪쑫쑭",6,"쑶쑷쑸쑺",5,"쒁",18,"쒕",6,"쒝",12],["9d41","쒪",13,"쒹쒺쒻쒽",8],["9d61","쓆",25],["9d81","쓠",8,"쓪",5,"쓲쓳쓵쓶쓷쓹쓻쓼쓽쓾씂",9,"씍씎씏씑씒씓씕",6,"씝",10,"씪씫씭씮씯씱",6,"씺씼씾",5,"앆앇앋앏앐앑앒앖앚앛앜앟앢앣앥앦앧앩",6,"앲앶",5,"앾앿얁얂얃얅얆얈얉얊얋얎얐얒얓얔"],["9e41","얖얙얚얛얝얞얟얡",7,"얪",9,"얶"],["9e61","얷얺얿",4,"엋엍엏엒엓엕엖엗엙",6,"엢엤엦엧"],["9e81","엨엩엪엫엯엱엲엳엵엸엹엺엻옂옃옄옉옊옋옍옎옏옑",6,"옚옝",6,"옦옧옩옪옫옯옱옲옶옸옺옼옽옾옿왂왃왅왆왇왉",6,"왒왖",5,"왞왟왡",10,"왭왮왰왲",5,"왺왻왽왾왿욁",6,"욊욌욎",5,"욖욗욙욚욛욝",6,"욦"],["9f41","욨욪",5,"욲욳욵욶욷욻",4,"웂웄웆",5,"웎"],["9f61","웏웑웒웓웕",6,"웞웟웢",5,"웪웫웭웮웯웱웲"],["9f81","웳",4,"웺웻웼웾",5,"윆윇윉윊윋윍",6,"윖윘윚",5,"윢윣윥윦윧윩",6,"윲윴윶윸윹윺윻윾윿읁읂읃읅",4,"읋읎읐읙읚읛읝읞읟읡",6,"읩읪읬",7,"읶읷읹읺읻읿잀잁잂잆잋잌잍잏잒잓잕잙잛",4,"잢잧",4,"잮잯잱잲잳잵잶잷"],["a041","잸잹잺잻잾쟂",5,"쟊쟋쟍쟏쟑",6,"쟙쟚쟛쟜"],["a061","쟞",5,"쟥쟦쟧쟩쟪쟫쟭",13],["a081","쟻",4,"젂젃젅젆젇젉젋",4,"젒젔젗",4,"젞젟젡젢젣젥",6,"젮젰젲",5,"젹젺젻젽젾젿졁",6,"졊졋졎",5,"졕",26,"졲졳졵졶졷졹졻",4,"좂좄좈좉좊좎",5,"좕",7,"좞좠좢좣좤"],["a141","좥좦좧좩",18,"좾좿죀죁"],["a161","죂죃죅죆죇죉죊죋죍",6,"죖죘죚",5,"죢죣죥"],["a181","죦",14,"죶",5,"죾죿줁줂줃줇",4,"줎　、。·‥…¨〃­―∥＼∼‘’“”〔〕〈",9,"±×÷≠≤≥∞∴°′″℃Å￠￡￥♂♀∠⊥⌒∂∇≡≒§※☆★○●◎◇◆□■△▲▽▼→←↑↓↔〓≪≫√∽∝∵∫∬∈∋⊆⊇⊂⊃∪∩∧∨￢"],["a241","줐줒",5,"줙",18],["a261","줭",6,"줵",18],["a281","쥈",7,"쥒쥓쥕쥖쥗쥙",6,"쥢쥤",7,"쥭쥮쥯⇒⇔∀∃´～ˇ˘˝˚˙¸˛¡¿ː∮∑∏¤℉‰◁◀▷▶♤♠♡♥♧♣⊙◈▣◐◑▒▤▥▨▧▦▩♨☏☎☜☞¶†‡↕↗↙↖↘♭♩♪♬㉿㈜№㏇™㏂㏘℡€®"],["a341","쥱쥲쥳쥵",6,"쥽",10,"즊즋즍즎즏"],["a361","즑",6,"즚즜즞",16],["a381","즯",16,"짂짃짅짆짉짋",4,"짒짔짗짘짛！",58,"￦］",32,"￣"],["a441","짞짟짡짣짥짦짨짩짪짫짮짲",5,"짺짻짽짾짿쨁쨂쨃쨄"],["a461","쨅쨆쨇쨊쨎",5,"쨕쨖쨗쨙",12],["a481","쨦쨧쨨쨪",28,"ㄱ",93],["a541","쩇",4,"쩎쩏쩑쩒쩓쩕",6,"쩞쩢",5,"쩩쩪"],["a561","쩫",17,"쩾",5,"쪅쪆"],["a581","쪇",16,"쪙",14,"ⅰ",9],["a5b0","Ⅰ",9],["a5c1","Α",16,"Σ",6],["a5e1","α",16,"σ",6],["a641","쪨",19,"쪾쪿쫁쫂쫃쫅"],["a661","쫆",5,"쫎쫐쫒쫔쫕쫖쫗쫚",5,"쫡",6],["a681","쫨쫩쫪쫫쫭",6,"쫵",18,"쬉쬊─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂┒┑┚┙┖┕┎┍┞┟┡┢┦┧┩┪┭┮┱┲┵┶┹┺┽┾╀╁╃",7],["a741","쬋",4,"쬑쬒쬓쬕쬖쬗쬙",6,"쬢",7],["a761","쬪",22,"쭂쭃쭄"],["a781","쭅쭆쭇쭊쭋쭍쭎쭏쭑",6,"쭚쭛쭜쭞",5,"쭥",7,"㎕㎖㎗ℓ㎘㏄㎣㎤㎥㎦㎙",9,"㏊㎍㎎㎏㏏㎈㎉㏈㎧㎨㎰",9,"㎀",4,"㎺",5,"㎐",4,"Ω㏀㏁㎊㎋㎌㏖㏅㎭㎮㎯㏛㎩㎪㎫㎬㏝㏐㏓㏃㏉㏜㏆"],["a841","쭭",10,"쭺",14],["a861","쮉",18,"쮝",6],["a881","쮤",19,"쮹",11,"ÆÐªĦ"],["a8a6","Ĳ"],["a8a8","ĿŁØŒºÞŦŊ"],["a8b1","㉠",27,"ⓐ",25,"①",14,"½⅓⅔¼¾⅛⅜⅝⅞"],["a941","쯅",14,"쯕",10],["a961","쯠쯡쯢쯣쯥쯦쯨쯪",18],["a981","쯽",14,"찎찏찑찒찓찕",6,"찞찟찠찣찤æđðħıĳĸŀłøœßþŧŋŉ㈀",27,"⒜",25,"⑴",14,"¹²³⁴ⁿ₁₂₃₄"],["aa41","찥찦찪찫찭찯찱",6,"찺찿",4,"챆챇챉챊챋챍챎"],["aa61","챏",4,"챖챚",5,"챡챢챣챥챧챩",6,"챱챲"],["aa81","챳챴챶",29,"ぁ",82],["ab41","첔첕첖첗첚첛첝첞첟첡",6,"첪첮",5,"첶첷첹"],["ab61","첺첻첽",6,"쳆쳈쳊",5,"쳑쳒쳓쳕",5],["ab81","쳛",8,"쳥",6,"쳭쳮쳯쳱",12,"ァ",85],["ac41","쳾쳿촀촂",5,"촊촋촍촎촏촑",6,"촚촜촞촟촠"],["ac61","촡촢촣촥촦촧촩촪촫촭",11,"촺",4],["ac81","촿",28,"쵝쵞쵟А",5,"ЁЖ",25],["acd1","а",5,"ёж",25],["ad41","쵡쵢쵣쵥",6,"쵮쵰쵲",5,"쵹",7],["ad61","춁",6,"춉",10,"춖춗춙춚춛춝춞춟"],["ad81","춠춡춢춣춦춨춪",5,"춱",18,"췅"],["ae41","췆",5,"췍췎췏췑",16],["ae61","췢",5,"췩췪췫췭췮췯췱",6,"췺췼췾",4],["ae81","츃츅츆츇츉츊츋츍",6,"츕츖츗츘츚",5,"츢츣츥츦츧츩츪츫"],["af41","츬츭츮츯츲츴츶",19],["af61","칊",13,"칚칛칝칞칢",5,"칪칬"],["af81","칮",5,"칶칷칹칺칻칽",6,"캆캈캊",5,"캒캓캕캖캗캙"],["b041","캚",5,"캢캦",5,"캮",12],["b061","캻",5,"컂",19],["b081","컖",13,"컦컧컩컪컭",6,"컶컺",5,"가각간갇갈갉갊감",7,"같",4,"갠갤갬갭갯갰갱갸갹갼걀걋걍걔걘걜거걱건걷걸걺검겁것겄겅겆겉겊겋게겐겔겜겝겟겠겡겨격겪견겯결겸겹겻겼경곁계곈곌곕곗고곡곤곧골곪곬곯곰곱곳공곶과곽관괄괆"],["b141","켂켃켅켆켇켉",6,"켒켔켖",5,"켝켞켟켡켢켣"],["b161","켥",6,"켮켲",5,"켹",11],["b181","콅",14,"콖콗콙콚콛콝",6,"콦콨콪콫콬괌괍괏광괘괜괠괩괬괭괴괵괸괼굄굅굇굉교굔굘굡굣구국군굳굴굵굶굻굼굽굿궁궂궈궉권궐궜궝궤궷귀귁귄귈귐귑귓규균귤그극근귿글긁금급긋긍긔기긱긴긷길긺김깁깃깅깆깊까깍깎깐깔깖깜깝깟깠깡깥깨깩깬깰깸"],["b241","콭콮콯콲콳콵콶콷콹",6,"쾁쾂쾃쾄쾆",5,"쾍"],["b261","쾎",18,"쾢",5,"쾩"],["b281","쾪",5,"쾱",18,"쿅",6,"깹깻깼깽꺄꺅꺌꺼꺽꺾껀껄껌껍껏껐껑께껙껜껨껫껭껴껸껼꼇꼈꼍꼐꼬꼭꼰꼲꼴꼼꼽꼿꽁꽂꽃꽈꽉꽐꽜꽝꽤꽥꽹꾀꾄꾈꾐꾑꾕꾜꾸꾹꾼꿀꿇꿈꿉꿋꿍꿎꿔꿜꿨꿩꿰꿱꿴꿸뀀뀁뀄뀌뀐뀔뀜뀝뀨끄끅끈끊끌끎끓끔끕끗끙"],["b341","쿌",19,"쿢쿣쿥쿦쿧쿩"],["b361","쿪",5,"쿲쿴쿶",5,"쿽쿾쿿퀁퀂퀃퀅",5],["b381","퀋",5,"퀒",5,"퀙",19,"끝끼끽낀낄낌낍낏낑나낙낚난낟날낡낢남납낫",4,"낱낳내낵낸낼냄냅냇냈냉냐냑냔냘냠냥너넉넋넌널넒넓넘넙넛넜넝넣네넥넨넬넴넵넷넸넹녀녁년녈념녑녔녕녘녜녠노녹논놀놂놈놉놋농높놓놔놘놜놨뇌뇐뇔뇜뇝"],["b441","퀮",5,"퀶퀷퀹퀺퀻퀽",6,"큆큈큊",5],["b461","큑큒큓큕큖큗큙",6,"큡",10,"큮큯"],["b481","큱큲큳큵",6,"큾큿킀킂",18,"뇟뇨뇩뇬뇰뇹뇻뇽누눅눈눋눌눔눕눗눙눠눴눼뉘뉜뉠뉨뉩뉴뉵뉼늄늅늉느늑는늘늙늚늠늡늣능늦늪늬늰늴니닉닌닐닒님닙닛닝닢다닥닦단닫",4,"닳담답닷",4,"닿대댁댄댈댐댑댓댔댕댜더덕덖던덛덜덞덟덤덥"],["b541","킕",14,"킦킧킩킪킫킭",5],["b561","킳킶킸킺",5,"탂탃탅탆탇탊",5,"탒탖",4],["b581","탛탞탟탡탢탣탥",6,"탮탲",5,"탹",11,"덧덩덫덮데덱덴델뎀뎁뎃뎄뎅뎌뎐뎔뎠뎡뎨뎬도독돈돋돌돎돐돔돕돗동돛돝돠돤돨돼됐되된될됨됩됫됴두둑둔둘둠둡둣둥둬뒀뒈뒝뒤뒨뒬뒵뒷뒹듀듄듈듐듕드득든듣들듦듬듭듯등듸디딕딘딛딜딤딥딧딨딩딪따딱딴딸"],["b641","턅",7,"턎",17],["b661","턠",15,"턲턳턵턶턷턹턻턼턽턾"],["b681","턿텂텆",5,"텎텏텑텒텓텕",6,"텞텠텢",5,"텩텪텫텭땀땁땃땄땅땋때땍땐땔땜땝땟땠땡떠떡떤떨떪떫떰떱떳떴떵떻떼떽뗀뗄뗌뗍뗏뗐뗑뗘뗬또똑똔똘똥똬똴뙈뙤뙨뚜뚝뚠뚤뚫뚬뚱뛔뛰뛴뛸뜀뜁뜅뜨뜩뜬뜯뜰뜸뜹뜻띄띈띌띔띕띠띤띨띰띱띳띵라락란랄람랍랏랐랑랒랖랗"],["b741","텮",13,"텽",6,"톅톆톇톉톊"],["b761","톋",20,"톢톣톥톦톧"],["b781","톩",6,"톲톴톶톷톸톹톻톽톾톿퇁",14,"래랙랜랠램랩랫랬랭랴략랸럇량러럭런럴럼럽럿렀렁렇레렉렌렐렘렙렛렝려력련렬렴렵렷렸령례롄롑롓로록론롤롬롭롯롱롸롼뢍뢨뢰뢴뢸룀룁룃룅료룐룔룝룟룡루룩룬룰룸룹룻룽뤄뤘뤠뤼뤽륀륄륌륏륑류륙륜률륨륩"],["b841","퇐",7,"퇙",17],["b861","퇫",8,"퇵퇶퇷퇹",13],["b881","툈툊",5,"툑",24,"륫륭르륵른를름릅릇릉릊릍릎리릭린릴림립릿링마막만많",4,"맘맙맛망맞맡맣매맥맨맬맴맵맷맸맹맺먀먁먈먕머먹먼멀멂멈멉멋멍멎멓메멕멘멜멤멥멧멨멩며멱면멸몃몄명몇몌모목몫몬몰몲몸몹못몽뫄뫈뫘뫙뫼"],["b941","툪툫툮툯툱툲툳툵",6,"툾퉀퉂",5,"퉉퉊퉋퉌"],["b961","퉍",14,"퉝",6,"퉥퉦퉧퉨"],["b981","퉩",22,"튂튃튅튆튇튉튊튋튌묀묄묍묏묑묘묜묠묩묫무묵묶문묻물묽묾뭄뭅뭇뭉뭍뭏뭐뭔뭘뭡뭣뭬뮈뮌뮐뮤뮨뮬뮴뮷므믄믈믐믓미믹민믿밀밂밈밉밋밌밍및밑바",4,"받",4,"밤밥밧방밭배백밴밸뱀뱁뱃뱄뱅뱉뱌뱍뱐뱝버벅번벋벌벎범법벗"],["ba41","튍튎튏튒튓튔튖",5,"튝튞튟튡튢튣튥",6,"튭"],["ba61","튮튯튰튲",5,"튺튻튽튾틁틃",4,"틊틌",5],["ba81","틒틓틕틖틗틙틚틛틝",6,"틦",9,"틲틳틵틶틷틹틺벙벚베벡벤벧벨벰벱벳벴벵벼벽변별볍볏볐병볕볘볜보복볶본볼봄봅봇봉봐봔봤봬뵀뵈뵉뵌뵐뵘뵙뵤뵨부북분붇불붉붊붐붑붓붕붙붚붜붤붰붸뷔뷕뷘뷜뷩뷰뷴뷸븀븃븅브븍븐블븜븝븟비빅빈빌빎빔빕빗빙빚빛빠빡빤"],["bb41","틻",4,"팂팄팆",5,"팏팑팒팓팕팗",4,"팞팢팣"],["bb61","팤팦팧팪팫팭팮팯팱",6,"팺팾",5,"퍆퍇퍈퍉"],["bb81","퍊",31,"빨빪빰빱빳빴빵빻빼빽뺀뺄뺌뺍뺏뺐뺑뺘뺙뺨뻐뻑뻔뻗뻘뻠뻣뻤뻥뻬뼁뼈뼉뼘뼙뼛뼜뼝뽀뽁뽄뽈뽐뽑뽕뾔뾰뿅뿌뿍뿐뿔뿜뿟뿡쀼쁑쁘쁜쁠쁨쁩삐삑삔삘삠삡삣삥사삭삯산삳살삵삶삼삽삿샀상샅새색샌샐샘샙샛샜생샤"],["bc41","퍪",17,"퍾퍿펁펂펃펅펆펇"],["bc61","펈펉펊펋펎펒",5,"펚펛펝펞펟펡",6,"펪펬펮"],["bc81","펯",4,"펵펶펷펹펺펻펽",6,"폆폇폊",5,"폑",5,"샥샨샬샴샵샷샹섀섄섈섐섕서",4,"섣설섦섧섬섭섯섰성섶세섹센셀셈셉셋셌셍셔셕션셜셤셥셧셨셩셰셴셸솅소속솎손솔솖솜솝솟송솥솨솩솬솰솽쇄쇈쇌쇔쇗쇘쇠쇤쇨쇰쇱쇳쇼쇽숀숄숌숍숏숑수숙순숟술숨숩숫숭"],["bd41","폗폙",7,"폢폤",7,"폮폯폱폲폳폵폶폷"],["bd61","폸폹폺폻폾퐀퐂",5,"퐉",13],["bd81","퐗",5,"퐞",25,"숯숱숲숴쉈쉐쉑쉔쉘쉠쉥쉬쉭쉰쉴쉼쉽쉿슁슈슉슐슘슛슝스슥슨슬슭슴습슷승시식신싣실싫심십싯싱싶싸싹싻싼쌀쌈쌉쌌쌍쌓쌔쌕쌘쌜쌤쌥쌨쌩썅써썩썬썰썲썸썹썼썽쎄쎈쎌쏀쏘쏙쏜쏟쏠쏢쏨쏩쏭쏴쏵쏸쐈쐐쐤쐬쐰"],["be41","퐸",7,"푁푂푃푅",14],["be61","푔",7,"푝푞푟푡푢푣푥",7,"푮푰푱푲"],["be81","푳",4,"푺푻푽푾풁풃",4,"풊풌풎",5,"풕",8,"쐴쐼쐽쑈쑤쑥쑨쑬쑴쑵쑹쒀쒔쒜쒸쒼쓩쓰쓱쓴쓸쓺쓿씀씁씌씐씔씜씨씩씬씰씸씹씻씽아악안앉않알앍앎앓암압앗았앙앝앞애액앤앨앰앱앳앴앵야약얀얄얇얌얍얏양얕얗얘얜얠얩어억언얹얻얼얽얾엄",6,"엌엎"],["bf41","풞",10,"풪",14],["bf61","풹",18,"퓍퓎퓏퓑퓒퓓퓕"],["bf81","퓖",5,"퓝퓞퓠",7,"퓩퓪퓫퓭퓮퓯퓱",6,"퓹퓺퓼에엑엔엘엠엡엣엥여역엮연열엶엷염",5,"옅옆옇예옌옐옘옙옛옜오옥온올옭옮옰옳옴옵옷옹옻와왁완왈왐왑왓왔왕왜왝왠왬왯왱외왹왼욀욈욉욋욍요욕욘욜욤욥욧용우욱운울욹욺움웁웃웅워웍원월웜웝웠웡웨"],["c041","퓾",5,"픅픆픇픉픊픋픍",6,"픖픘",5],["c061","픞",25],["c081","픸픹픺픻픾픿핁핂핃핅",6,"핎핐핒",5,"핚핛핝핞핟핡핢핣웩웬웰웸웹웽위윅윈윌윔윕윗윙유육윤율윰윱윳융윷으윽은을읊음읍읏응",7,"읜읠읨읫이익인일읽읾잃임입잇있잉잊잎자작잔잖잗잘잚잠잡잣잤장잦재잭잰잴잼잽잿쟀쟁쟈쟉쟌쟎쟐쟘쟝쟤쟨쟬저적전절젊"],["c141","핤핦핧핪핬핮",5,"핶핷핹핺핻핽",6,"햆햊햋"],["c161","햌햍햎햏햑",19,"햦햧"],["c181","햨",31,"점접젓정젖제젝젠젤젬젭젯젱져젼졀졈졉졌졍졔조족존졸졺좀좁좃종좆좇좋좌좍좔좝좟좡좨좼좽죄죈죌죔죕죗죙죠죡죤죵주죽준줄줅줆줌줍줏중줘줬줴쥐쥑쥔쥘쥠쥡쥣쥬쥰쥴쥼즈즉즌즐즘즙즛증지직진짇질짊짐집짓"],["c241","헊헋헍헎헏헑헓",4,"헚헜헞",5,"헦헧헩헪헫헭헮"],["c261","헯",4,"헶헸헺",5,"혂혃혅혆혇혉",6,"혒"],["c281","혖",5,"혝혞혟혡혢혣혥",7,"혮",9,"혺혻징짖짙짚짜짝짠짢짤짧짬짭짯짰짱째짹짼쨀쨈쨉쨋쨌쨍쨔쨘쨩쩌쩍쩐쩔쩜쩝쩟쩠쩡쩨쩽쪄쪘쪼쪽쫀쫄쫌쫍쫏쫑쫓쫘쫙쫠쫬쫴쬈쬐쬔쬘쬠쬡쭁쭈쭉쭌쭐쭘쭙쭝쭤쭸쭹쮜쮸쯔쯤쯧쯩찌찍찐찔찜찝찡찢찧차착찬찮찰참찹찻"],["c341","혽혾혿홁홂홃홄홆홇홊홌홎홏홐홒홓홖홗홙홚홛홝",4],["c361","홢",4,"홨홪",5,"홲홳홵",11],["c381","횁횂횄횆",5,"횎횏횑횒횓횕",7,"횞횠횢",5,"횩횪찼창찾채책챈챌챔챕챗챘챙챠챤챦챨챰챵처척천철첨첩첫첬청체첵첸첼쳄쳅쳇쳉쳐쳔쳤쳬쳰촁초촉촌촐촘촙촛총촤촨촬촹최쵠쵤쵬쵭쵯쵱쵸춈추축춘출춤춥춧충춰췄췌췐취췬췰췸췹췻췽츄츈츌츔츙츠측츤츨츰츱츳층"],["c441","횫횭횮횯횱",7,"횺횼",7,"훆훇훉훊훋"],["c461","훍훎훏훐훒훓훕훖훘훚",5,"훡훢훣훥훦훧훩",4],["c481","훮훯훱훲훳훴훶",5,"훾훿휁휂휃휅",11,"휒휓휔치칙친칟칠칡침칩칫칭카칵칸칼캄캅캇캉캐캑캔캘캠캡캣캤캥캬캭컁커컥컨컫컬컴컵컷컸컹케켁켄켈켐켑켓켕켜켠켤켬켭켯켰켱켸코콕콘콜콤콥콧콩콰콱콴콸쾀쾅쾌쾡쾨쾰쿄쿠쿡쿤쿨쿰쿱쿳쿵쿼퀀퀄퀑퀘퀭퀴퀵퀸퀼"],["c541","휕휖휗휚휛휝휞휟휡",6,"휪휬휮",5,"휶휷휹"],["c561","휺휻휽",6,"흅흆흈흊",5,"흒흓흕흚",4],["c581","흟흢흤흦흧흨흪흫흭흮흯흱흲흳흵",6,"흾흿힀힂",5,"힊힋큄큅큇큉큐큔큘큠크큭큰클큼큽킁키킥킨킬킴킵킷킹타탁탄탈탉탐탑탓탔탕태택탠탤탬탭탯탰탱탸턍터턱턴털턺텀텁텃텄텅테텍텐텔템텝텟텡텨텬텼톄톈토톡톤톨톰톱톳통톺톼퇀퇘퇴퇸툇툉툐투툭툰툴툼툽툿퉁퉈퉜"],["c641","힍힎힏힑",6,"힚힜힞",5],["c6a1","퉤튀튁튄튈튐튑튕튜튠튤튬튱트특튼튿틀틂틈틉틋틔틘틜틤틥티틱틴틸팀팁팃팅파팍팎판팔팖팜팝팟팠팡팥패팩팬팰팸팹팻팼팽퍄퍅퍼퍽펀펄펌펍펏펐펑페펙펜펠펨펩펫펭펴편펼폄폅폈평폐폘폡폣포폭폰폴폼폽폿퐁"],["c7a1","퐈퐝푀푄표푠푤푭푯푸푹푼푿풀풂품풉풋풍풔풩퓌퓐퓔퓜퓟퓨퓬퓰퓸퓻퓽프픈플픔픕픗피픽핀필핌핍핏핑하학한할핥함합핫항해핵핸핼햄햅햇했행햐향허헉헌헐헒험헙헛헝헤헥헨헬헴헵헷헹혀혁현혈혐협혓혔형혜혠"],["c8a1","혤혭호혹혼홀홅홈홉홋홍홑화확환활홧황홰홱홴횃횅회획횐횔횝횟횡효횬횰횹횻후훅훈훌훑훔훗훙훠훤훨훰훵훼훽휀휄휑휘휙휜휠휨휩휫휭휴휵휸휼흄흇흉흐흑흔흖흗흘흙흠흡흣흥흩희흰흴흼흽힁히힉힌힐힘힙힛힝"],["caa1","伽佳假價加可呵哥嘉嫁家暇架枷柯歌珂痂稼苛茄街袈訶賈跏軻迦駕刻却各恪慤殼珏脚覺角閣侃刊墾奸姦干幹懇揀杆柬桿澗癎看磵稈竿簡肝艮艱諫間乫喝曷渴碣竭葛褐蝎鞨勘坎堪嵌感憾戡敢柑橄減甘疳監瞰紺邯鑑鑒龕"],["cba1","匣岬甲胛鉀閘剛堈姜岡崗康强彊慷江畺疆糠絳綱羌腔舡薑襁講鋼降鱇介价個凱塏愷愾慨改槪漑疥皆盖箇芥蓋豈鎧開喀客坑更粳羹醵倨去居巨拒据據擧渠炬祛距踞車遽鉅鋸乾件健巾建愆楗腱虔蹇鍵騫乞傑杰桀儉劍劒檢"],["cca1","瞼鈐黔劫怯迲偈憩揭擊格檄激膈覡隔堅牽犬甄絹繭肩見譴遣鵑抉決潔結缺訣兼慊箝謙鉗鎌京俓倞傾儆勁勍卿坰境庚徑慶憬擎敬景暻更梗涇炅烱璟璥瓊痙硬磬竟競絅經耕耿脛莖警輕逕鏡頃頸驚鯨係啓堺契季屆悸戒桂械"],["cda1","棨溪界癸磎稽系繫繼計誡谿階鷄古叩告呱固姑孤尻庫拷攷故敲暠枯槁沽痼皐睾稿羔考股膏苦苽菰藁蠱袴誥賈辜錮雇顧高鼓哭斛曲梏穀谷鵠困坤崑昆梱棍滾琨袞鯤汨滑骨供公共功孔工恐恭拱控攻珙空蚣貢鞏串寡戈果瓜"],["cea1","科菓誇課跨過鍋顆廓槨藿郭串冠官寬慣棺款灌琯瓘管罐菅觀貫關館刮恝括适侊光匡壙廣曠洸炚狂珖筐胱鑛卦掛罫乖傀塊壞怪愧拐槐魁宏紘肱轟交僑咬喬嬌嶠巧攪敎校橋狡皎矯絞翹膠蕎蛟較轎郊餃驕鮫丘久九仇俱具勾"],["cfa1","區口句咎嘔坵垢寇嶇廐懼拘救枸柩構歐毆毬求溝灸狗玖球瞿矩究絿耉臼舅舊苟衢謳購軀逑邱鉤銶駒驅鳩鷗龜國局菊鞠鞫麴君窘群裙軍郡堀屈掘窟宮弓穹窮芎躬倦券勸卷圈拳捲權淃眷厥獗蕨蹶闕机櫃潰詭軌饋句晷歸貴"],["d0a1","鬼龜叫圭奎揆槻珪硅窺竅糾葵規赳逵閨勻均畇筠菌鈞龜橘克剋劇戟棘極隙僅劤勤懃斤根槿瑾筋芹菫覲謹近饉契今妗擒昑檎琴禁禽芩衾衿襟金錦伋及急扱汲級給亘兢矜肯企伎其冀嗜器圻基埼夔奇妓寄岐崎己幾忌技旗旣"],["d1a1","朞期杞棋棄機欺氣汽沂淇玘琦琪璂璣畸畿碁磯祁祇祈祺箕紀綺羈耆耭肌記譏豈起錡錤飢饑騎騏驥麒緊佶吉拮桔金喫儺喇奈娜懦懶拏拿癩",5,"那樂",4,"諾酪駱亂卵暖欄煖爛蘭難鸞捏捺南嵐枏楠湳濫男藍襤拉"],["d2a1","納臘蠟衲囊娘廊",4,"乃來內奈柰耐冷女年撚秊念恬拈捻寧寗努勞奴弩怒擄櫓爐瑙盧",5,"駑魯",10,"濃籠聾膿農惱牢磊腦賂雷尿壘",7,"嫩訥杻紐勒",5,"能菱陵尼泥匿溺多茶"],["d3a1","丹亶但單團壇彖斷旦檀段湍短端簞緞蛋袒鄲鍛撻澾獺疸達啖坍憺擔曇淡湛潭澹痰聃膽蕁覃談譚錟沓畓答踏遝唐堂塘幢戇撞棠當糖螳黨代垈坮大對岱帶待戴擡玳臺袋貸隊黛宅德悳倒刀到圖堵塗導屠島嶋度徒悼挑掉搗桃"],["d4a1","棹櫂淘渡滔濤燾盜睹禱稻萄覩賭跳蹈逃途道都鍍陶韜毒瀆牘犢獨督禿篤纛讀墩惇敦旽暾沌焞燉豚頓乭突仝冬凍動同憧東桐棟洞潼疼瞳童胴董銅兜斗杜枓痘竇荳讀豆逗頭屯臀芚遁遯鈍得嶝橙燈登等藤謄鄧騰喇懶拏癩羅"],["d5a1","蘿螺裸邏樂洛烙珞絡落諾酪駱丹亂卵欄欒瀾爛蘭鸞剌辣嵐擥攬欖濫籃纜藍襤覽拉臘蠟廊朗浪狼琅瑯螂郞來崍徠萊冷掠略亮倆兩凉梁樑粮粱糧良諒輛量侶儷勵呂廬慮戾旅櫚濾礪藜蠣閭驢驪麗黎力曆歷瀝礫轢靂憐戀攣漣"],["d6a1","煉璉練聯蓮輦連鍊冽列劣洌烈裂廉斂殮濂簾獵令伶囹寧岺嶺怜玲笭羚翎聆逞鈴零靈領齡例澧禮醴隷勞怒撈擄櫓潞瀘爐盧老蘆虜路輅露魯鷺鹵碌祿綠菉錄鹿麓論壟弄朧瀧瓏籠聾儡瀨牢磊賂賚賴雷了僚寮廖料燎療瞭聊蓼"],["d7a1","遼鬧龍壘婁屢樓淚漏瘻累縷蔞褸鏤陋劉旒柳榴流溜瀏琉瑠留瘤硫謬類六戮陸侖倫崙淪綸輪律慄栗率隆勒肋凜凌楞稜綾菱陵俚利厘吏唎履悧李梨浬犁狸理璃異痢籬罹羸莉裏裡里釐離鯉吝潾燐璘藺躪隣鱗麟林淋琳臨霖砬"],["d8a1","立笠粒摩瑪痲碼磨馬魔麻寞幕漠膜莫邈万卍娩巒彎慢挽晩曼滿漫灣瞞萬蔓蠻輓饅鰻唜抹末沫茉襪靺亡妄忘忙望網罔芒茫莽輞邙埋妹媒寐昧枚梅每煤罵買賣邁魅脈貊陌驀麥孟氓猛盲盟萌冪覓免冕勉棉沔眄眠綿緬面麵滅"],["d9a1","蔑冥名命明暝椧溟皿瞑茗蓂螟酩銘鳴袂侮冒募姆帽慕摸摹暮某模母毛牟牡瑁眸矛耗芼茅謀謨貌木沐牧目睦穆鶩歿沒夢朦蒙卯墓妙廟描昴杳渺猫竗苗錨務巫憮懋戊拇撫无楙武毋無珷畝繆舞茂蕪誣貿霧鵡墨默們刎吻問文"],["daa1","汶紊紋聞蚊門雯勿沕物味媚尾嵋彌微未梶楣渼湄眉米美薇謎迷靡黴岷悶愍憫敏旻旼民泯玟珉緡閔密蜜謐剝博拍搏撲朴樸泊珀璞箔粕縛膊舶薄迫雹駁伴半反叛拌搬攀斑槃泮潘班畔瘢盤盼磐磻礬絆般蟠返頒飯勃拔撥渤潑"],["dba1","發跋醱鉢髮魃倣傍坊妨尨幇彷房放方旁昉枋榜滂磅紡肪膀舫芳蒡蚌訪謗邦防龐倍俳北培徘拜排杯湃焙盃背胚裴裵褙賠輩配陪伯佰帛柏栢白百魄幡樊煩燔番磻繁蕃藩飜伐筏罰閥凡帆梵氾汎泛犯範范法琺僻劈壁擘檗璧癖"],["dca1","碧蘗闢霹便卞弁變辨辯邊別瞥鱉鼈丙倂兵屛幷昞昺柄棅炳甁病秉竝輧餠騈保堡報寶普步洑湺潽珤甫菩補褓譜輔伏僕匐卜宓復服福腹茯蔔複覆輹輻馥鰒本乶俸奉封峯峰捧棒烽熢琫縫蓬蜂逢鋒鳳不付俯傅剖副否咐埠夫婦"],["dda1","孚孵富府復扶敷斧浮溥父符簿缶腐腑膚艀芙莩訃負賦賻赴趺部釜阜附駙鳧北分吩噴墳奔奮忿憤扮昐汾焚盆粉糞紛芬賁雰不佛弗彿拂崩朋棚硼繃鵬丕備匕匪卑妃婢庇悲憊扉批斐枇榧比毖毗毘沸泌琵痺砒碑秕秘粃緋翡肥"],["dea1","脾臂菲蜚裨誹譬費鄙非飛鼻嚬嬪彬斌檳殯浜濱瀕牝玭貧賓頻憑氷聘騁乍事些仕伺似使俟僿史司唆嗣四士奢娑寫寺射巳師徙思捨斜斯柶査梭死沙泗渣瀉獅砂社祀祠私篩紗絲肆舍莎蓑蛇裟詐詞謝賜赦辭邪飼駟麝削數朔索"],["dfa1","傘刪山散汕珊産疝算蒜酸霰乷撒殺煞薩三參杉森渗芟蔘衫揷澁鈒颯上傷像償商喪嘗孀尙峠常床庠廂想桑橡湘爽牀狀相祥箱翔裳觴詳象賞霜塞璽賽嗇塞穡索色牲生甥省笙墅壻嶼序庶徐恕抒捿敍暑曙書栖棲犀瑞筮絮緖署"],["e0a1","胥舒薯西誓逝鋤黍鼠夕奭席惜昔晳析汐淅潟石碩蓆釋錫仙僊先善嬋宣扇敾旋渲煽琁瑄璇璿癬禪線繕羨腺膳船蘚蟬詵跣選銑鐥饍鮮卨屑楔泄洩渫舌薛褻設說雪齧剡暹殲纖蟾贍閃陝攝涉燮葉城姓宬性惺成星晟猩珹盛省筬"],["e1a1","聖聲腥誠醒世勢歲洗稅笹細說貰召嘯塑宵小少巢所掃搔昭梳沼消溯瀟炤燒甦疏疎瘙笑篠簫素紹蔬蕭蘇訴逍遡邵銷韶騷俗屬束涑粟續謖贖速孫巽損蓀遜飡率宋悚松淞訟誦送頌刷殺灑碎鎖衰釗修受嗽囚垂壽嫂守岫峀帥愁"],["e2a1","戍手授搜收數樹殊水洙漱燧狩獸琇璲瘦睡秀穗竪粹綏綬繡羞脩茱蒐蓚藪袖誰讐輸遂邃酬銖銹隋隧隨雖需須首髓鬚叔塾夙孰宿淑潚熟琡璹肅菽巡徇循恂旬栒楯橓殉洵淳珣盾瞬筍純脣舜荀蓴蕣詢諄醇錞順馴戌術述鉥崇崧"],["e3a1","嵩瑟膝蝨濕拾習褶襲丞乘僧勝升承昇繩蠅陞侍匙嘶始媤尸屎屍市弑恃施是時枾柴猜矢示翅蒔蓍視試詩諡豕豺埴寔式息拭植殖湜熄篒蝕識軾食飾伸侁信呻娠宸愼新晨燼申神紳腎臣莘薪藎蜃訊身辛辰迅失室實悉審尋心沁"],["e4a1","沈深瀋甚芯諶什十拾雙氏亞俄兒啞娥峨我牙芽莪蛾衙訝阿雅餓鴉鵝堊岳嶽幄惡愕握樂渥鄂鍔顎鰐齷安岸按晏案眼雁鞍顔鮟斡謁軋閼唵岩巖庵暗癌菴闇壓押狎鴨仰央怏昻殃秧鴦厓哀埃崖愛曖涯碍艾隘靄厄扼掖液縊腋額"],["e5a1","櫻罌鶯鸚也倻冶夜惹揶椰爺耶若野弱掠略約若葯蒻藥躍亮佯兩凉壤孃恙揚攘敭暘梁楊樣洋瀁煬痒瘍禳穰糧羊良襄諒讓釀陽量養圄御於漁瘀禦語馭魚齬億憶抑檍臆偃堰彦焉言諺孼蘖俺儼嚴奄掩淹嶪業円予余勵呂女如廬"],["e6a1","旅歟汝濾璵礖礪與艅茹輿轝閭餘驪麗黎亦力域役易曆歷疫繹譯轢逆驛嚥堧姸娟宴年延憐戀捐挻撚椽沇沿涎涓淵演漣烟然煙煉燃燕璉硏硯秊筵緣練縯聯衍軟輦蓮連鉛鍊鳶列劣咽悅涅烈熱裂說閱厭廉念捻染殮炎焰琰艶苒"],["e7a1","簾閻髥鹽曄獵燁葉令囹塋寧嶺嶸影怜映暎楹榮永泳渶潁濚瀛瀯煐營獰玲瑛瑩瓔盈穎纓羚聆英詠迎鈴鍈零霙靈領乂倪例刈叡曳汭濊猊睿穢芮藝蘂禮裔詣譽豫醴銳隸霓預五伍俉傲午吾吳嗚塢墺奧娛寤悟惡懊敖旿晤梧汚澳"],["e8a1","烏熬獒筽蜈誤鰲鼇屋沃獄玉鈺溫瑥瘟穩縕蘊兀壅擁瓮甕癰翁邕雍饔渦瓦窩窪臥蛙蝸訛婉完宛梡椀浣玩琓琬碗緩翫脘腕莞豌阮頑曰往旺枉汪王倭娃歪矮外嵬巍猥畏了僚僥凹堯夭妖姚寥寮尿嶢拗搖撓擾料曜樂橈燎燿瑤療"],["e9a1","窈窯繇繞耀腰蓼蟯要謠遙遼邀饒慾欲浴縟褥辱俑傭冗勇埇墉容庸慂榕涌湧溶熔瑢用甬聳茸蓉踊鎔鏞龍于佑偶優又友右宇寓尤愚憂旴牛玗瑀盂祐禑禹紆羽芋藕虞迂遇郵釪隅雨雩勖彧旭昱栯煜稶郁頊云暈橒殞澐熉耘芸蕓"],["eaa1","運隕雲韻蔚鬱亐熊雄元原員圓園垣媛嫄寃怨愿援沅洹湲源爰猿瑗苑袁轅遠阮院願鴛月越鉞位偉僞危圍委威尉慰暐渭爲瑋緯胃萎葦蔿蝟衛褘謂違韋魏乳侑儒兪劉唯喩孺宥幼幽庾悠惟愈愉揄攸有杻柔柚柳楡楢油洧流游溜"],["eba1","濡猶猷琉瑜由留癒硫紐維臾萸裕誘諛諭踰蹂遊逾遺酉釉鍮類六堉戮毓肉育陸倫允奫尹崙淪潤玧胤贇輪鈗閏律慄栗率聿戎瀜絨融隆垠恩慇殷誾銀隱乙吟淫蔭陰音飮揖泣邑凝應膺鷹依倚儀宜意懿擬椅毅疑矣義艤薏蟻衣誼"],["eca1","議醫二以伊利吏夷姨履已弛彛怡易李梨泥爾珥理異痍痢移罹而耳肄苡荑裏裡貽貳邇里離飴餌匿溺瀷益翊翌翼謚人仁刃印吝咽因姻寅引忍湮燐璘絪茵藺蚓認隣靭靷鱗麟一佚佾壹日溢逸鎰馹任壬妊姙恁林淋稔臨荏賃入卄"],["eda1","立笠粒仍剩孕芿仔刺咨姉姿子字孜恣慈滋炙煮玆瓷疵磁紫者自茨蔗藉諮資雌作勺嚼斫昨灼炸爵綽芍酌雀鵲孱棧殘潺盞岑暫潛箴簪蠶雜丈仗匠場墻壯奬將帳庄張掌暲杖樟檣欌漿牆狀獐璋章粧腸臟臧莊葬蔣薔藏裝贓醬長"],["eea1","障再哉在宰才材栽梓渽滓災縡裁財載齋齎爭箏諍錚佇低儲咀姐底抵杵楮樗沮渚狙猪疽箸紵苧菹著藷詛貯躇這邸雎齟勣吊嫡寂摘敵滴狄炙的積笛籍績翟荻謫賊赤跡蹟迪迹適鏑佃佺傳全典前剪塡塼奠專展廛悛戰栓殿氈澱"],["efa1","煎琠田甸畑癲筌箋箭篆纏詮輾轉鈿銓錢鐫電顚顫餞切截折浙癤竊節絶占岾店漸点粘霑鮎點接摺蝶丁井亭停偵呈姃定幀庭廷征情挺政整旌晶晸柾楨檉正汀淀淨渟湞瀞炡玎珽町睛碇禎程穽精綎艇訂諪貞鄭酊釘鉦鋌錠霆靖"],["f0a1","靜頂鼎制劑啼堤帝弟悌提梯濟祭第臍薺製諸蹄醍除際霽題齊俎兆凋助嘲弔彫措操早晁曺曹朝條棗槽漕潮照燥爪璪眺祖祚租稠窕粗糟組繰肇藻蚤詔調趙躁造遭釣阻雕鳥族簇足鏃存尊卒拙猝倧宗從悰慫棕淙琮種終綜縱腫"],["f1a1","踪踵鍾鐘佐坐左座挫罪主住侏做姝胄呪周嗾奏宙州廚晝朱柱株注洲湊澍炷珠疇籌紂紬綢舟蛛註誅走躊輳週酎酒鑄駐竹粥俊儁准埈寯峻晙樽浚準濬焌畯竣蠢逡遵雋駿茁中仲衆重卽櫛楫汁葺增憎曾拯烝甑症繒蒸證贈之只"],["f2a1","咫地址志持指摯支旨智枝枳止池沚漬知砥祉祗紙肢脂至芝芷蜘誌識贄趾遲直稙稷織職唇嗔塵振搢晉晋桭榛殄津溱珍瑨璡畛疹盡眞瞋秦縉縝臻蔯袗診賑軫辰進鎭陣陳震侄叱姪嫉帙桎瓆疾秩窒膣蛭質跌迭斟朕什執潗緝輯"],["f3a1","鏶集徵懲澄且侘借叉嗟嵯差次此磋箚茶蹉車遮捉搾着窄錯鑿齪撰澯燦璨瓚竄簒纂粲纘讚贊鑽餐饌刹察擦札紮僭參塹慘慙懺斬站讒讖倉倡創唱娼廠彰愴敞昌昶暢槍滄漲猖瘡窓脹艙菖蒼債埰寀寨彩採砦綵菜蔡采釵冊柵策"],["f4a1","責凄妻悽處倜刺剔尺慽戚拓擲斥滌瘠脊蹠陟隻仟千喘天川擅泉淺玔穿舛薦賤踐遷釧闡阡韆凸哲喆徹撤澈綴輟轍鐵僉尖沾添甛瞻簽籤詹諂堞妾帖捷牒疊睫諜貼輒廳晴淸聽菁請靑鯖切剃替涕滯締諦逮遞體初剿哨憔抄招梢"],["f5a1","椒楚樵炒焦硝礁礎秒稍肖艸苕草蕉貂超酢醋醮促囑燭矗蜀觸寸忖村邨叢塚寵悤憁摠總聰蔥銃撮催崔最墜抽推椎楸樞湫皺秋芻萩諏趨追鄒酋醜錐錘鎚雛騶鰍丑畜祝竺筑築縮蓄蹙蹴軸逐春椿瑃出朮黜充忠沖蟲衝衷悴膵萃"],["f6a1","贅取吹嘴娶就炊翠聚脆臭趣醉驟鷲側仄厠惻測層侈値嗤峙幟恥梔治淄熾痔痴癡稚穉緇緻置致蚩輜雉馳齒則勅飭親七柒漆侵寢枕沈浸琛砧針鍼蟄秤稱快他咤唾墮妥惰打拖朶楕舵陀馱駝倬卓啄坼度托拓擢晫柝濁濯琢琸託"],["f7a1","鐸呑嘆坦彈憚歎灘炭綻誕奪脫探眈耽貪塔搭榻宕帑湯糖蕩兌台太怠態殆汰泰笞胎苔跆邰颱宅擇澤撑攄兎吐土討慟桶洞痛筒統通堆槌腿褪退頹偸套妬投透鬪慝特闖坡婆巴把播擺杷波派爬琶破罷芭跛頗判坂板版瓣販辦鈑"],["f8a1","阪八叭捌佩唄悖敗沛浿牌狽稗覇貝彭澎烹膨愎便偏扁片篇編翩遍鞭騙貶坪平枰萍評吠嬖幣廢弊斃肺蔽閉陛佈包匍匏咆哺圃布怖抛抱捕暴泡浦疱砲胞脯苞葡蒲袍褒逋鋪飽鮑幅暴曝瀑爆輻俵剽彪慓杓標漂瓢票表豹飇飄驃"],["f9a1","品稟楓諷豊風馮彼披疲皮被避陂匹弼必泌珌畢疋筆苾馝乏逼下何厦夏廈昰河瑕荷蝦賀遐霞鰕壑學虐謔鶴寒恨悍旱汗漢澣瀚罕翰閑閒限韓割轄函含咸啣喊檻涵緘艦銜陷鹹合哈盒蛤閤闔陜亢伉姮嫦巷恒抗杭桁沆港缸肛航"],["faa1","行降項亥偕咳垓奚孩害懈楷海瀣蟹解該諧邂駭骸劾核倖幸杏荇行享向嚮珦鄕響餉饗香噓墟虛許憲櫶獻軒歇險驗奕爀赫革俔峴弦懸晛泫炫玄玹現眩睍絃絢縣舷衒見賢鉉顯孑穴血頁嫌俠協夾峽挾浹狹脅脇莢鋏頰亨兄刑型"],["fba1","形泂滎瀅灐炯熒珩瑩荊螢衡逈邢鎣馨兮彗惠慧暳蕙蹊醯鞋乎互呼壕壺好岵弧戶扈昊晧毫浩淏湖滸澔濠濩灝狐琥瑚瓠皓祜糊縞胡芦葫蒿虎號蝴護豪鎬頀顥惑或酷婚昏混渾琿魂忽惚笏哄弘汞泓洪烘紅虹訌鴻化和嬅樺火畵"],["fca1","禍禾花華話譁貨靴廓擴攫確碻穫丸喚奐宦幻患換歡晥桓渙煥環紈還驩鰥活滑猾豁闊凰幌徨恍惶愰慌晃晄榥況湟滉潢煌璜皇篁簧荒蝗遑隍黃匯回廻徊恢悔懷晦會檜淮澮灰獪繪膾茴蛔誨賄劃獲宖橫鐄哮嚆孝效斅曉梟涍淆"],["fda1","爻肴酵驍侯候厚后吼喉嗅帿後朽煦珝逅勛勳塤壎焄熏燻薰訓暈薨喧暄煊萱卉喙毁彙徽揮暉煇諱輝麾休携烋畦虧恤譎鷸兇凶匈洶胸黑昕欣炘痕吃屹紇訖欠欽歆吸恰洽翕興僖凞喜噫囍姬嬉希憙憘戱晞曦熙熹熺犧禧稀羲詰"]]'), CT = /* @__PURE__ */ JSON.parse('[["0","\\u0000",127],["a140","　，、。．‧；：？！︰…‥﹐﹑﹒·﹔﹕﹖﹗｜–︱—︳╴︴﹏（）︵︶｛｝︷︸〔〕︹︺【】︻︼《》︽︾〈〉︿﹀「」﹁﹂『』﹃﹄﹙﹚"],["a1a1","﹛﹜﹝﹞‘’“”〝〞‵′＃＆＊※§〃○●△▲◎☆★◇◆□■▽▼㊣℅¯￣＿ˍ﹉﹊﹍﹎﹋﹌﹟﹠﹡＋－×÷±√＜＞＝≦≧≠∞≒≡﹢",4,"～∩∪⊥∠∟⊿㏒㏑∫∮∵∴♀♂⊕⊙↑↓←→↖↗↙↘∥∣／"],["a240","＼∕﹨＄￥〒￠￡％＠℃℉﹩﹪﹫㏕㎜㎝㎞㏎㎡㎎㎏㏄°兙兛兞兝兡兣嗧瓩糎▁",7,"▏▎▍▌▋▊▉┼┴┬┤├▔─│▕┌┐└┘╭"],["a2a1","╮╰╯═╞╪╡◢◣◥◤╱╲╳０",9,"Ⅰ",9,"〡",8,"十卄卅Ａ",25,"ａ",21],["a340","ｗｘｙｚΑ",16,"Σ",6,"α",16,"σ",6,"ㄅ",10],["a3a1","ㄐ",25,"˙ˉˊˇˋ"],["a3e1","€"],["a440","一乙丁七乃九了二人儿入八几刀刁力匕十卜又三下丈上丫丸凡久么也乞于亡兀刃勺千叉口土士夕大女子孑孓寸小尢尸山川工己已巳巾干廾弋弓才"],["a4a1","丑丐不中丰丹之尹予云井互五亢仁什仃仆仇仍今介仄元允內六兮公冗凶分切刈勻勾勿化匹午升卅卞厄友及反壬天夫太夭孔少尤尺屯巴幻廿弔引心戈戶手扎支文斗斤方日曰月木欠止歹毋比毛氏水火爪父爻片牙牛犬王丙"],["a540","世丕且丘主乍乏乎以付仔仕他仗代令仙仞充兄冉冊冬凹出凸刊加功包匆北匝仟半卉卡占卯卮去可古右召叮叩叨叼司叵叫另只史叱台句叭叻四囚外"],["a5a1","央失奴奶孕它尼巨巧左市布平幼弁弘弗必戊打扔扒扑斥旦朮本未末札正母民氐永汁汀氾犯玄玉瓜瓦甘生用甩田由甲申疋白皮皿目矛矢石示禾穴立丞丟乒乓乩亙交亦亥仿伉伙伊伕伍伐休伏仲件任仰仳份企伋光兇兆先全"],["a640","共再冰列刑划刎刖劣匈匡匠印危吉吏同吊吐吁吋各向名合吃后吆吒因回囝圳地在圭圬圯圩夙多夷夸妄奸妃好她如妁字存宇守宅安寺尖屹州帆并年"],["a6a1","式弛忙忖戎戌戍成扣扛托收早旨旬旭曲曳有朽朴朱朵次此死氖汝汗汙江池汐汕污汛汍汎灰牟牝百竹米糸缶羊羽老考而耒耳聿肉肋肌臣自至臼舌舛舟艮色艾虫血行衣西阡串亨位住佇佗佞伴佛何估佐佑伽伺伸佃佔似但佣"],["a740","作你伯低伶余佝佈佚兌克免兵冶冷別判利刪刨劫助努劬匣即卵吝吭吞吾否呎吧呆呃吳呈呂君吩告吹吻吸吮吵吶吠吼呀吱含吟听囪困囤囫坊坑址坍"],["a7a1","均坎圾坐坏圻壯夾妝妒妨妞妣妙妖妍妤妓妊妥孝孜孚孛完宋宏尬局屁尿尾岐岑岔岌巫希序庇床廷弄弟彤形彷役忘忌志忍忱快忸忪戒我抄抗抖技扶抉扭把扼找批扳抒扯折扮投抓抑抆改攻攸旱更束李杏材村杜杖杞杉杆杠"],["a840","杓杗步每求汞沙沁沈沉沅沛汪決沐汰沌汨沖沒汽沃汲汾汴沆汶沍沔沘沂灶灼災灸牢牡牠狄狂玖甬甫男甸皂盯矣私秀禿究系罕肖肓肝肘肛肚育良芒"],["a8a1","芋芍見角言谷豆豕貝赤走足身車辛辰迂迆迅迄巡邑邢邪邦那酉釆里防阮阱阪阬並乖乳事些亞享京佯依侍佳使佬供例來侃佰併侈佩佻侖佾侏侑佺兔兒兕兩具其典冽函刻券刷刺到刮制剁劾劻卒協卓卑卦卷卸卹取叔受味呵"],["a940","咖呸咕咀呻呷咄咒咆呼咐呱呶和咚呢周咋命咎固垃坷坪坩坡坦坤坼夜奉奇奈奄奔妾妻委妹妮姑姆姐姍始姓姊妯妳姒姅孟孤季宗定官宜宙宛尚屈居"],["a9a1","屆岷岡岸岩岫岱岳帘帚帖帕帛帑幸庚店府底庖延弦弧弩往征彿彼忝忠忽念忿怏怔怯怵怖怪怕怡性怩怫怛或戕房戾所承拉拌拄抿拂抹拒招披拓拔拋拈抨抽押拐拙拇拍抵拚抱拘拖拗拆抬拎放斧於旺昔易昌昆昂明昀昏昕昊"],["aa40","昇服朋杭枋枕東果杳杷枇枝林杯杰板枉松析杵枚枓杼杪杲欣武歧歿氓氛泣注泳沱泌泥河沽沾沼波沫法泓沸泄油況沮泗泅泱沿治泡泛泊沬泯泜泖泠"],["aaa1","炕炎炒炊炙爬爭爸版牧物狀狎狙狗狐玩玨玟玫玥甽疝疙疚的盂盲直知矽社祀祁秉秈空穹竺糾罔羌羋者肺肥肢肱股肫肩肴肪肯臥臾舍芳芝芙芭芽芟芹花芬芥芯芸芣芰芾芷虎虱初表軋迎返近邵邸邱邶采金長門阜陀阿阻附"],["ab40","陂隹雨青非亟亭亮信侵侯便俠俑俏保促侶俘俟俊俗侮俐俄係俚俎俞侷兗冒冑冠剎剃削前剌剋則勇勉勃勁匍南卻厚叛咬哀咨哎哉咸咦咳哇哂咽咪品"],["aba1","哄哈咯咫咱咻咩咧咿囿垂型垠垣垢城垮垓奕契奏奎奐姜姘姿姣姨娃姥姪姚姦威姻孩宣宦室客宥封屎屏屍屋峙峒巷帝帥帟幽庠度建弈弭彥很待徊律徇後徉怒思怠急怎怨恍恰恨恢恆恃恬恫恪恤扁拜挖按拼拭持拮拽指拱拷"],["ac40","拯括拾拴挑挂政故斫施既春昭映昧是星昨昱昤曷柿染柱柔某柬架枯柵柩柯柄柑枴柚查枸柏柞柳枰柙柢柝柒歪殃殆段毒毗氟泉洋洲洪流津洌洱洞洗"],["aca1","活洽派洶洛泵洹洧洸洩洮洵洎洫炫為炳炬炯炭炸炮炤爰牲牯牴狩狠狡玷珊玻玲珍珀玳甚甭畏界畎畋疫疤疥疢疣癸皆皇皈盈盆盃盅省盹相眉看盾盼眇矜砂研砌砍祆祉祈祇禹禺科秒秋穿突竿竽籽紂紅紀紉紇約紆缸美羿耄"],["ad40","耐耍耑耶胖胥胚胃胄背胡胛胎胞胤胝致舢苧范茅苣苛苦茄若茂茉苒苗英茁苜苔苑苞苓苟苯茆虐虹虻虺衍衫要觔計訂訃貞負赴赳趴軍軌述迦迢迪迥"],["ada1","迭迫迤迨郊郎郁郃酋酊重閂限陋陌降面革韋韭音頁風飛食首香乘亳倌倍倣俯倦倥俸倩倖倆值借倚倒們俺倀倔倨俱倡個候倘俳修倭倪俾倫倉兼冤冥冢凍凌准凋剖剜剔剛剝匪卿原厝叟哨唐唁唷哼哥哲唆哺唔哩哭員唉哮哪"],["ae40","哦唧唇哽唏圃圄埂埔埋埃堉夏套奘奚娑娘娜娟娛娓姬娠娣娩娥娌娉孫屘宰害家宴宮宵容宸射屑展屐峭峽峻峪峨峰島崁峴差席師庫庭座弱徒徑徐恙"],["aea1","恣恥恐恕恭恩息悄悟悚悍悔悌悅悖扇拳挈拿捎挾振捕捂捆捏捉挺捐挽挪挫挨捍捌效敉料旁旅時晉晏晃晒晌晅晁書朔朕朗校核案框桓根桂桔栩梳栗桌桑栽柴桐桀格桃株桅栓栘桁殊殉殷氣氧氨氦氤泰浪涕消涇浦浸海浙涓"],["af40","浬涉浮浚浴浩涌涊浹涅浥涔烊烘烤烙烈烏爹特狼狹狽狸狷玆班琉珮珠珪珞畔畝畜畚留疾病症疲疳疽疼疹痂疸皋皰益盍盎眩真眠眨矩砰砧砸砝破砷"],["afa1","砥砭砠砟砲祕祐祠祟祖神祝祗祚秤秣秧租秦秩秘窄窈站笆笑粉紡紗紋紊素索純紐紕級紜納紙紛缺罟羔翅翁耆耘耕耙耗耽耿胱脂胰脅胭胴脆胸胳脈能脊胼胯臭臬舀舐航舫舨般芻茫荒荔荊茸荐草茵茴荏茲茹茶茗荀茱茨荃"],["b040","虔蚊蚪蚓蚤蚩蚌蚣蚜衰衷袁袂衽衹記訐討訌訕訊託訓訖訏訑豈豺豹財貢起躬軒軔軏辱送逆迷退迺迴逃追逅迸邕郡郝郢酒配酌釘針釗釜釙閃院陣陡"],["b0a1","陛陝除陘陞隻飢馬骨高鬥鬲鬼乾偺偽停假偃偌做偉健偶偎偕偵側偷偏倏偯偭兜冕凰剪副勒務勘動匐匏匙匿區匾參曼商啪啦啄啞啡啃啊唱啖問啕唯啤唸售啜唬啣唳啁啗圈國圉域堅堊堆埠埤基堂堵執培夠奢娶婁婉婦婪婀"],["b140","娼婢婚婆婊孰寇寅寄寂宿密尉專將屠屜屝崇崆崎崛崖崢崑崩崔崙崤崧崗巢常帶帳帷康庸庶庵庾張強彗彬彩彫得徙從徘御徠徜恿患悉悠您惋悴惦悽"],["b1a1","情悻悵惜悼惘惕惆惟悸惚惇戚戛扈掠控捲掖探接捷捧掘措捱掩掉掃掛捫推掄授掙採掬排掏掀捻捩捨捺敝敖救教敗啟敏敘敕敔斜斛斬族旋旌旎晝晚晤晨晦晞曹勗望梁梯梢梓梵桿桶梱梧梗械梃棄梭梆梅梔條梨梟梡梂欲殺"],["b240","毫毬氫涎涼淳淙液淡淌淤添淺清淇淋涯淑涮淞淹涸混淵淅淒渚涵淚淫淘淪深淮淨淆淄涪淬涿淦烹焉焊烽烯爽牽犁猜猛猖猓猙率琅琊球理現琍瓠瓶"],["b2a1","瓷甜產略畦畢異疏痔痕疵痊痍皎盔盒盛眷眾眼眶眸眺硫硃硎祥票祭移窒窕笠笨笛第符笙笞笮粒粗粕絆絃統紮紹紼絀細紳組累終紲紱缽羞羚翌翎習耜聊聆脯脖脣脫脩脰脤舂舵舷舶船莎莞莘荸莢莖莽莫莒莊莓莉莠荷荻荼"],["b340","莆莧處彪蛇蛀蚶蛄蚵蛆蛋蚱蚯蛉術袞袈被袒袖袍袋覓規訪訝訣訥許設訟訛訢豉豚販責貫貨貪貧赧赦趾趺軛軟這逍通逗連速逝逐逕逞造透逢逖逛途"],["b3a1","部郭都酗野釵釦釣釧釭釩閉陪陵陳陸陰陴陶陷陬雀雪雩章竟頂頃魚鳥鹵鹿麥麻傢傍傅備傑傀傖傘傚最凱割剴創剩勞勝勛博厥啻喀喧啼喊喝喘喂喜喪喔喇喋喃喳單喟唾喲喚喻喬喱啾喉喫喙圍堯堪場堤堰報堡堝堠壹壺奠"],["b440","婷媚婿媒媛媧孳孱寒富寓寐尊尋就嵌嵐崴嵇巽幅帽幀幃幾廊廁廂廄弼彭復循徨惑惡悲悶惠愜愣惺愕惰惻惴慨惱愎惶愉愀愒戟扉掣掌描揀揩揉揆揍"],["b4a1","插揣提握揖揭揮捶援揪換摒揚揹敞敦敢散斑斐斯普晰晴晶景暑智晾晷曾替期朝棺棕棠棘棗椅棟棵森棧棹棒棲棣棋棍植椒椎棉棚楮棻款欺欽殘殖殼毯氮氯氬港游湔渡渲湧湊渠渥渣減湛湘渤湖湮渭渦湯渴湍渺測湃渝渾滋"],["b540","溉渙湎湣湄湲湩湟焙焚焦焰無然煮焜牌犄犀猶猥猴猩琺琪琳琢琥琵琶琴琯琛琦琨甥甦畫番痢痛痣痙痘痞痠登發皖皓皴盜睏短硝硬硯稍稈程稅稀窘"],["b5a1","窗窖童竣等策筆筐筒答筍筋筏筑粟粥絞結絨絕紫絮絲絡給絢絰絳善翔翕耋聒肅腕腔腋腑腎脹腆脾腌腓腴舒舜菩萃菸萍菠菅萋菁華菱菴著萊菰萌菌菽菲菊萸萎萄菜萇菔菟虛蛟蛙蛭蛔蛛蛤蛐蛞街裁裂袱覃視註詠評詞証詁"],["b640","詔詛詐詆訴診訶詖象貂貯貼貳貽賁費賀貴買貶貿貸越超趁跎距跋跚跑跌跛跆軻軸軼辜逮逵週逸進逶鄂郵鄉郾酣酥量鈔鈕鈣鈉鈞鈍鈐鈇鈑閔閏開閑"],["b6a1","間閒閎隊階隋陽隅隆隍陲隄雁雅雄集雇雯雲韌項順須飧飪飯飩飲飭馮馭黃黍黑亂傭債傲傳僅傾催傷傻傯僇剿剷剽募勦勤勢勣匯嗟嗨嗓嗦嗎嗜嗇嗑嗣嗤嗯嗚嗡嗅嗆嗥嗉園圓塞塑塘塗塚塔填塌塭塊塢塒塋奧嫁嫉嫌媾媽媼"],["b740","媳嫂媲嵩嵯幌幹廉廈弒彙徬微愚意慈感想愛惹愁愈慎慌慄慍愾愴愧愍愆愷戡戢搓搾搞搪搭搽搬搏搜搔損搶搖搗搆敬斟新暗暉暇暈暖暄暘暍會榔業"],["b7a1","楚楷楠楔極椰概楊楨楫楞楓楹榆楝楣楛歇歲毀殿毓毽溢溯滓溶滂源溝滇滅溥溘溼溺溫滑準溜滄滔溪溧溴煎煙煩煤煉照煜煬煦煌煥煞煆煨煖爺牒猷獅猿猾瑯瑚瑕瑟瑞瑁琿瑙瑛瑜當畸瘀痰瘁痲痱痺痿痴痳盞盟睛睫睦睞督"],["b840","睹睪睬睜睥睨睢矮碎碰碗碘碌碉硼碑碓硿祺祿禁萬禽稜稚稠稔稟稞窟窠筷節筠筮筧粱粳粵經絹綑綁綏絛置罩罪署義羨群聖聘肆肄腱腰腸腥腮腳腫"],["b8a1","腹腺腦舅艇蒂葷落萱葵葦葫葉葬葛萼萵葡董葩葭葆虞虜號蛹蜓蜈蜇蜀蛾蛻蜂蜃蜆蜊衙裟裔裙補裘裝裡裊裕裒覜解詫該詳試詩詰誇詼詣誠話誅詭詢詮詬詹詻訾詨豢貊貉賊資賈賄貲賃賂賅跡跟跨路跳跺跪跤跦躲較載軾輊"],["b940","辟農運遊道遂達逼違遐遇遏過遍遑逾遁鄒鄗酬酪酩釉鈷鉗鈸鈽鉀鈾鉛鉋鉤鉑鈴鉉鉍鉅鈹鈿鉚閘隘隔隕雍雋雉雊雷電雹零靖靴靶預頑頓頊頒頌飼飴"],["b9a1","飽飾馳馱馴髡鳩麂鼎鼓鼠僧僮僥僖僭僚僕像僑僱僎僩兢凳劃劂匱厭嗾嘀嘛嘗嗽嘔嘆嘉嘍嘎嗷嘖嘟嘈嘐嗶團圖塵塾境墓墊塹墅塽壽夥夢夤奪奩嫡嫦嫩嫗嫖嫘嫣孵寞寧寡寥實寨寢寤察對屢嶄嶇幛幣幕幗幔廓廖弊彆彰徹慇"],["ba40","愿態慷慢慣慟慚慘慵截撇摘摔撤摸摟摺摑摧搴摭摻敲斡旗旖暢暨暝榜榨榕槁榮槓構榛榷榻榫榴槐槍榭槌榦槃榣歉歌氳漳演滾漓滴漩漾漠漬漏漂漢"],["baa1","滿滯漆漱漸漲漣漕漫漯澈漪滬漁滲滌滷熔熙煽熊熄熒爾犒犖獄獐瑤瑣瑪瑰瑭甄疑瘧瘍瘋瘉瘓盡監瞄睽睿睡磁碟碧碳碩碣禎福禍種稱窪窩竭端管箕箋筵算箝箔箏箸箇箄粹粽精綻綰綜綽綾綠緊綴網綱綺綢綿綵綸維緒緇綬"],["bb40","罰翠翡翟聞聚肇腐膀膏膈膊腿膂臧臺與舔舞艋蓉蒿蓆蓄蒙蒞蒲蒜蓋蒸蓀蓓蒐蒼蓑蓊蜿蜜蜻蜢蜥蜴蜘蝕蜷蜩裳褂裴裹裸製裨褚裯誦誌語誣認誡誓誤"],["bba1","說誥誨誘誑誚誧豪貍貌賓賑賒赫趙趕跼輔輒輕輓辣遠遘遜遣遙遞遢遝遛鄙鄘鄞酵酸酷酴鉸銀銅銘銖鉻銓銜銨鉼銑閡閨閩閣閥閤隙障際雌雒需靼鞅韶頗領颯颱餃餅餌餉駁骯骰髦魁魂鳴鳶鳳麼鼻齊億儀僻僵價儂儈儉儅凜"],["bc40","劇劈劉劍劊勰厲嘮嘻嘹嘲嘿嘴嘩噓噎噗噴嘶嘯嘰墀墟增墳墜墮墩墦奭嬉嫻嬋嫵嬌嬈寮寬審寫層履嶝嶔幢幟幡廢廚廟廝廣廠彈影德徵慶慧慮慝慕憂"],["bca1","慼慰慫慾憧憐憫憎憬憚憤憔憮戮摩摯摹撞撲撈撐撰撥撓撕撩撒撮播撫撚撬撙撢撳敵敷數暮暫暴暱樣樟槨樁樞標槽模樓樊槳樂樅槭樑歐歎殤毅毆漿潼澄潑潦潔澆潭潛潸潮澎潺潰潤澗潘滕潯潠潟熟熬熱熨牖犛獎獗瑩璋璃"],["bd40","瑾璀畿瘠瘩瘟瘤瘦瘡瘢皚皺盤瞎瞇瞌瞑瞋磋磅確磊碾磕碼磐稿稼穀稽稷稻窯窮箭箱範箴篆篇篁箠篌糊締練緯緻緘緬緝編緣線緞緩綞緙緲緹罵罷羯"],["bda1","翩耦膛膜膝膠膚膘蔗蔽蔚蓮蔬蔭蔓蔑蔣蔡蔔蓬蔥蓿蔆螂蝴蝶蝠蝦蝸蝨蝙蝗蝌蝓衛衝褐複褒褓褕褊誼諒談諄誕請諸課諉諂調誰論諍誶誹諛豌豎豬賠賞賦賤賬賭賢賣賜質賡赭趟趣踫踐踝踢踏踩踟踡踞躺輝輛輟輩輦輪輜輞"],["be40","輥適遮遨遭遷鄰鄭鄧鄱醇醉醋醃鋅銻銷鋪銬鋤鋁銳銼鋒鋇鋰銲閭閱霄霆震霉靠鞍鞋鞏頡頫頜颳養餓餒餘駝駐駟駛駑駕駒駙骷髮髯鬧魅魄魷魯鴆鴉"],["bea1","鴃麩麾黎墨齒儒儘儔儐儕冀冪凝劑劓勳噙噫噹噩噤噸噪器噥噱噯噬噢噶壁墾壇壅奮嬝嬴學寰導彊憲憑憩憊懍憶憾懊懈戰擅擁擋撻撼據擄擇擂操撿擒擔撾整曆曉暹曄曇暸樽樸樺橙橫橘樹橄橢橡橋橇樵機橈歙歷氅濂澱澡"],["bf40","濃澤濁澧澳激澹澶澦澠澴熾燉燐燒燈燕熹燎燙燜燃燄獨璜璣璘璟璞瓢甌甍瘴瘸瘺盧盥瞠瞞瞟瞥磨磚磬磧禦積穎穆穌穋窺篙簑築篤篛篡篩篦糕糖縊"],["bfa1","縑縈縛縣縞縝縉縐罹羲翰翱翮耨膳膩膨臻興艘艙蕊蕙蕈蕨蕩蕃蕉蕭蕪蕞螃螟螞螢融衡褪褲褥褫褡親覦諦諺諫諱謀諜諧諮諾謁謂諷諭諳諶諼豫豭貓賴蹄踱踴蹂踹踵輻輯輸輳辨辦遵遴選遲遼遺鄴醒錠錶鋸錳錯錢鋼錫錄錚"],["c040","錐錦錡錕錮錙閻隧隨險雕霎霑霖霍霓霏靛靜靦鞘頰頸頻頷頭頹頤餐館餞餛餡餚駭駢駱骸骼髻髭鬨鮑鴕鴣鴦鴨鴒鴛默黔龍龜優償儡儲勵嚎嚀嚐嚅嚇"],["c0a1","嚏壕壓壑壎嬰嬪嬤孺尷屨嶼嶺嶽嶸幫彌徽應懂懇懦懋戲戴擎擊擘擠擰擦擬擱擢擭斂斃曙曖檀檔檄檢檜櫛檣橾檗檐檠歜殮毚氈濘濱濟濠濛濤濫濯澀濬濡濩濕濮濰燧營燮燦燥燭燬燴燠爵牆獰獲璩環璦璨癆療癌盪瞳瞪瞰瞬"],["c140","瞧瞭矯磷磺磴磯礁禧禪穗窿簇簍篾篷簌篠糠糜糞糢糟糙糝縮績繆縷縲繃縫總縱繅繁縴縹繈縵縿縯罄翳翼聱聲聰聯聳臆臃膺臂臀膿膽臉膾臨舉艱薪"],["c1a1","薄蕾薜薑薔薯薛薇薨薊虧蟀蟑螳蟒蟆螫螻螺蟈蟋褻褶襄褸褽覬謎謗謙講謊謠謝謄謐豁谿豳賺賽購賸賻趨蹉蹋蹈蹊轄輾轂轅輿避遽還邁邂邀鄹醣醞醜鍍鎂錨鍵鍊鍥鍋錘鍾鍬鍛鍰鍚鍔闊闋闌闈闆隱隸雖霜霞鞠韓顆颶餵騁"],["c240","駿鮮鮫鮪鮭鴻鴿麋黏點黜黝黛鼾齋叢嚕嚮壙壘嬸彝懣戳擴擲擾攆擺擻擷斷曜朦檳檬櫃檻檸櫂檮檯歟歸殯瀉瀋濾瀆濺瀑瀏燻燼燾燸獷獵璧璿甕癖癘"],["c2a1","癒瞽瞿瞻瞼礎禮穡穢穠竄竅簫簧簪簞簣簡糧織繕繞繚繡繒繙罈翹翻職聶臍臏舊藏薩藍藐藉薰薺薹薦蟯蟬蟲蟠覆覲觴謨謹謬謫豐贅蹙蹣蹦蹤蹟蹕軀轉轍邇邃邈醫醬釐鎔鎊鎖鎢鎳鎮鎬鎰鎘鎚鎗闔闖闐闕離雜雙雛雞霤鞣鞦"],["c340","鞭韹額顏題顎顓颺餾餿餽餮馥騎髁鬃鬆魏魎魍鯊鯉鯽鯈鯀鵑鵝鵠黠鼕鼬儳嚥壞壟壢寵龐廬懲懷懶懵攀攏曠曝櫥櫝櫚櫓瀛瀟瀨瀚瀝瀕瀘爆爍牘犢獸"],["c3a1","獺璽瓊瓣疇疆癟癡矇礙禱穫穩簾簿簸簽簷籀繫繭繹繩繪羅繳羶羹羸臘藩藝藪藕藤藥藷蟻蠅蠍蟹蟾襠襟襖襞譁譜識證譚譎譏譆譙贈贊蹼蹲躇蹶蹬蹺蹴轔轎辭邊邋醱醮鏡鏑鏟鏃鏈鏜鏝鏖鏢鏍鏘鏤鏗鏨關隴難霪霧靡韜韻類"],["c440","願顛颼饅饉騖騙鬍鯨鯧鯖鯛鶉鵡鵲鵪鵬麒麗麓麴勸嚨嚷嚶嚴嚼壤孀孃孽寶巉懸懺攘攔攙曦朧櫬瀾瀰瀲爐獻瓏癢癥礦礪礬礫竇競籌籃籍糯糰辮繽繼"],["c4a1","纂罌耀臚艦藻藹蘑藺蘆蘋蘇蘊蠔蠕襤覺觸議譬警譯譟譫贏贍躉躁躅躂醴釋鐘鐃鏽闡霰飄饒饑馨騫騰騷騵鰓鰍鹹麵黨鼯齟齣齡儷儸囁囀囂夔屬巍懼懾攝攜斕曩櫻欄櫺殲灌爛犧瓖瓔癩矓籐纏續羼蘗蘭蘚蠣蠢蠡蠟襪襬覽譴"],["c540","護譽贓躊躍躋轟辯醺鐮鐳鐵鐺鐸鐲鐫闢霸霹露響顧顥饗驅驃驀騾髏魔魑鰭鰥鶯鶴鷂鶸麝黯鼙齜齦齧儼儻囈囊囉孿巔巒彎懿攤權歡灑灘玀瓤疊癮癬"],["c5a1","禳籠籟聾聽臟襲襯觼讀贖贗躑躓轡酈鑄鑑鑒霽霾韃韁顫饕驕驍髒鬚鱉鰱鰾鰻鷓鷗鼴齬齪龔囌巖戀攣攫攪曬欐瓚竊籤籣籥纓纖纔臢蘸蘿蠱變邐邏鑣鑠鑤靨顯饜驚驛驗髓體髑鱔鱗鱖鷥麟黴囑壩攬灞癱癲矗罐羈蠶蠹衢讓讒"],["c640","讖艷贛釀鑪靂靈靄韆顰驟鬢魘鱟鷹鷺鹼鹽鼇齷齲廳欖灣籬籮蠻觀躡釁鑲鑰顱饞髖鬣黌灤矚讚鑷韉驢驥纜讜躪釅鑽鑾鑼鱷鱸黷豔鑿鸚爨驪鬱鸛鸞籲"],["c940","乂乜凵匚厂万丌乇亍囗兀屮彳丏冇与丮亓仂仉仈冘勼卬厹圠夃夬尐巿旡殳毌气爿丱丼仨仜仩仡仝仚刌匜卌圢圣夗夯宁宄尒尻屴屳帄庀庂忉戉扐氕"],["c9a1","氶汃氿氻犮犰玊禸肊阞伎优伬仵伔仱伀价伈伝伂伅伢伓伄仴伒冱刓刉刐劦匢匟卍厊吇囡囟圮圪圴夼妀奼妅奻奾奷奿孖尕尥屼屺屻屾巟幵庄异弚彴忕忔忏扜扞扤扡扦扢扙扠扚扥旯旮朾朹朸朻机朿朼朳氘汆汒汜汏汊汔汋"],["ca40","汌灱牞犴犵玎甪癿穵网艸艼芀艽艿虍襾邙邗邘邛邔阢阤阠阣佖伻佢佉体佤伾佧佒佟佁佘伭伳伿佡冏冹刜刞刡劭劮匉卣卲厎厏吰吷吪呔呅吙吜吥吘"],["caa1","吽呏呁吨吤呇囮囧囥坁坅坌坉坋坒夆奀妦妘妠妗妎妢妐妏妧妡宎宒尨尪岍岏岈岋岉岒岊岆岓岕巠帊帎庋庉庌庈庍弅弝彸彶忒忑忐忭忨忮忳忡忤忣忺忯忷忻怀忴戺抃抌抎抏抔抇扱扻扺扰抁抈扷扽扲扴攷旰旴旳旲旵杅杇"],["cb40","杙杕杌杈杝杍杚杋毐氙氚汸汧汫沄沋沏汱汯汩沚汭沇沕沜汦汳汥汻沎灴灺牣犿犽狃狆狁犺狅玕玗玓玔玒町甹疔疕皁礽耴肕肙肐肒肜芐芏芅芎芑芓"],["cba1","芊芃芄豸迉辿邟邡邥邞邧邠阰阨阯阭丳侘佼侅佽侀侇佶佴侉侄佷佌侗佪侚佹侁佸侐侜侔侞侒侂侕佫佮冞冼冾刵刲刳剆刱劼匊匋匼厒厔咇呿咁咑咂咈呫呺呾呥呬呴呦咍呯呡呠咘呣呧呤囷囹坯坲坭坫坱坰坶垀坵坻坳坴坢"],["cc40","坨坽夌奅妵妺姏姎妲姌姁妶妼姃姖妱妽姀姈妴姇孢孥宓宕屄屇岮岤岠岵岯岨岬岟岣岭岢岪岧岝岥岶岰岦帗帔帙弨弢弣弤彔徂彾彽忞忥怭怦怙怲怋"],["cca1","怴怊怗怳怚怞怬怢怍怐怮怓怑怌怉怜戔戽抭抴拑抾抪抶拊抮抳抯抻抩抰抸攽斨斻昉旼昄昒昈旻昃昋昍昅旽昑昐曶朊枅杬枎枒杶杻枘枆构杴枍枌杺枟枑枙枃杽极杸杹枔欥殀歾毞氝沓泬泫泮泙沶泔沭泧沷泐泂沺泃泆泭泲"],["cd40","泒泝沴沊沝沀泞泀洰泍泇沰泹泏泩泑炔炘炅炓炆炄炑炖炂炚炃牪狖狋狘狉狜狒狔狚狌狑玤玡玭玦玢玠玬玝瓝瓨甿畀甾疌疘皯盳盱盰盵矸矼矹矻矺"],["cda1","矷祂礿秅穸穻竻籵糽耵肏肮肣肸肵肭舠芠苀芫芚芘芛芵芧芮芼芞芺芴芨芡芩苂芤苃芶芢虰虯虭虮豖迒迋迓迍迖迕迗邲邴邯邳邰阹阽阼阺陃俍俅俓侲俉俋俁俔俜俙侻侳俛俇俖侺俀侹俬剄剉勀勂匽卼厗厖厙厘咺咡咭咥哏"],["ce40","哃茍咷咮哖咶哅哆咠呰咼咢咾呲哞咰垵垞垟垤垌垗垝垛垔垘垏垙垥垚垕壴复奓姡姞姮娀姱姝姺姽姼姶姤姲姷姛姩姳姵姠姾姴姭宨屌峐峘峌峗峋峛"],["cea1","峞峚峉峇峊峖峓峔峏峈峆峎峟峸巹帡帢帣帠帤庰庤庢庛庣庥弇弮彖徆怷怹恔恲恞恅恓恇恉恛恌恀恂恟怤恄恘恦恮扂扃拏挍挋拵挎挃拫拹挏挌拸拶挀挓挔拺挕拻拰敁敃斪斿昶昡昲昵昜昦昢昳昫昺昝昴昹昮朏朐柁柲柈枺"],["cf40","柜枻柸柘柀枷柅柫柤柟枵柍枳柷柶柮柣柂枹柎柧柰枲柼柆柭柌枮柦柛柺柉柊柃柪柋欨殂殄殶毖毘毠氠氡洨洴洭洟洼洿洒洊泚洳洄洙洺洚洑洀洝浂"],["cfa1","洁洘洷洃洏浀洇洠洬洈洢洉洐炷炟炾炱炰炡炴炵炩牁牉牊牬牰牳牮狊狤狨狫狟狪狦狣玅珌珂珈珅玹玶玵玴珫玿珇玾珃珆玸珋瓬瓮甮畇畈疧疪癹盄眈眃眄眅眊盷盻盺矧矨砆砑砒砅砐砏砎砉砃砓祊祌祋祅祄秕种秏秖秎窀"],["d040","穾竑笀笁籺籸籹籿粀粁紃紈紁罘羑羍羾耇耎耏耔耷胘胇胠胑胈胂胐胅胣胙胜胊胕胉胏胗胦胍臿舡芔苙苾苹茇苨茀苕茺苫苖苴苬苡苲苵茌苻苶苰苪"],["d0a1","苤苠苺苳苭虷虴虼虳衁衎衧衪衩觓訄訇赲迣迡迮迠郱邽邿郕郅邾郇郋郈釔釓陔陏陑陓陊陎倞倅倇倓倢倰倛俵俴倳倷倬俶俷倗倜倠倧倵倯倱倎党冔冓凊凄凅凈凎剡剚剒剞剟剕剢勍匎厞唦哢唗唒哧哳哤唚哿唄唈哫唑唅哱"],["d140","唊哻哷哸哠唎唃唋圁圂埌堲埕埒垺埆垽垼垸垶垿埇埐垹埁夎奊娙娖娭娮娕娏娗娊娞娳孬宧宭宬尃屖屔峬峿峮峱峷崀峹帩帨庨庮庪庬弳弰彧恝恚恧"],["d1a1","恁悢悈悀悒悁悝悃悕悛悗悇悜悎戙扆拲挐捖挬捄捅挶捃揤挹捋捊挼挩捁挴捘捔捙挭捇挳捚捑挸捗捀捈敊敆旆旃旄旂晊晟晇晑朒朓栟栚桉栲栳栻桋桏栖栱栜栵栫栭栯桎桄栴栝栒栔栦栨栮桍栺栥栠欬欯欭欱欴歭肂殈毦毤"],["d240","毨毣毢毧氥浺浣浤浶洍浡涒浘浢浭浯涑涍淯浿涆浞浧浠涗浰浼浟涂涘洯浨涋浾涀涄洖涃浻浽浵涐烜烓烑烝烋缹烢烗烒烞烠烔烍烅烆烇烚烎烡牂牸"],["d2a1","牷牶猀狺狴狾狶狳狻猁珓珙珥珖玼珧珣珩珜珒珛珔珝珚珗珘珨瓞瓟瓴瓵甡畛畟疰痁疻痄痀疿疶疺皊盉眝眛眐眓眒眣眑眕眙眚眢眧砣砬砢砵砯砨砮砫砡砩砳砪砱祔祛祏祜祓祒祑秫秬秠秮秭秪秜秞秝窆窉窅窋窌窊窇竘笐"],["d340","笄笓笅笏笈笊笎笉笒粄粑粊粌粈粍粅紞紝紑紎紘紖紓紟紒紏紌罜罡罞罠罝罛羖羒翃翂翀耖耾耹胺胲胹胵脁胻脀舁舯舥茳茭荄茙荑茥荖茿荁茦茜茢"],["d3a1","荂荎茛茪茈茼荍茖茤茠茷茯茩荇荅荌荓茞茬荋茧荈虓虒蚢蚨蚖蚍蚑蚞蚇蚗蚆蚋蚚蚅蚥蚙蚡蚧蚕蚘蚎蚝蚐蚔衃衄衭衵衶衲袀衱衿衯袃衾衴衼訒豇豗豻貤貣赶赸趵趷趶軑軓迾迵适迿迻逄迼迶郖郠郙郚郣郟郥郘郛郗郜郤酐"],["d440","酎酏釕釢釚陜陟隼飣髟鬯乿偰偪偡偞偠偓偋偝偲偈偍偁偛偊偢倕偅偟偩偫偣偤偆偀偮偳偗偑凐剫剭剬剮勖勓匭厜啵啶唼啍啐唴唪啑啢唶唵唰啒啅"],["d4a1","唌唲啥啎唹啈唭唻啀啋圊圇埻堔埢埶埜埴堀埭埽堈埸堋埳埏堇埮埣埲埥埬埡堎埼堐埧堁堌埱埩埰堍堄奜婠婘婕婧婞娸娵婭婐婟婥婬婓婤婗婃婝婒婄婛婈媎娾婍娹婌婰婩婇婑婖婂婜孲孮寁寀屙崞崋崝崚崠崌崨崍崦崥崏"],["d540","崰崒崣崟崮帾帴庱庴庹庲庳弶弸徛徖徟悊悐悆悾悰悺惓惔惏惤惙惝惈悱惛悷惊悿惃惍惀挲捥掊掂捽掽掞掭掝掗掫掎捯掇掐据掯捵掜捭掮捼掤挻掟"],["d5a1","捸掅掁掑掍捰敓旍晥晡晛晙晜晢朘桹梇梐梜桭桮梮梫楖桯梣梬梩桵桴梲梏桷梒桼桫桲梪梀桱桾梛梖梋梠梉梤桸桻梑梌梊桽欶欳欷欸殑殏殍殎殌氪淀涫涴涳湴涬淩淢涷淶淔渀淈淠淟淖涾淥淜淝淛淴淊涽淭淰涺淕淂淏淉"],["d640","淐淲淓淽淗淍淣涻烺焍烷焗烴焌烰焄烳焐烼烿焆焓焀烸烶焋焂焎牾牻牼牿猝猗猇猑猘猊猈狿猏猞玈珶珸珵琄琁珽琇琀珺珼珿琌琋珴琈畤畣痎痒痏"],["d6a1","痋痌痑痐皏皉盓眹眯眭眱眲眴眳眽眥眻眵硈硒硉硍硊硌砦硅硐祤祧祩祪祣祫祡离秺秸秶秷窏窔窐笵筇笴笥笰笢笤笳笘笪笝笱笫笭笯笲笸笚笣粔粘粖粣紵紽紸紶紺絅紬紩絁絇紾紿絊紻紨罣羕羜羝羛翊翋翍翐翑翇翏翉耟"],["d740","耞耛聇聃聈脘脥脙脛脭脟脬脞脡脕脧脝脢舑舸舳舺舴舲艴莐莣莨莍荺荳莤荴莏莁莕莙荵莔莩荽莃莌莝莛莪莋荾莥莯莈莗莰荿莦莇莮荶莚虙虖蚿蚷"],["d7a1","蛂蛁蛅蚺蚰蛈蚹蚳蚸蛌蚴蚻蚼蛃蚽蚾衒袉袕袨袢袪袚袑袡袟袘袧袙袛袗袤袬袌袓袎覂觖觙觕訰訧訬訞谹谻豜豝豽貥赽赻赹趼跂趹趿跁軘軞軝軜軗軠軡逤逋逑逜逌逡郯郪郰郴郲郳郔郫郬郩酖酘酚酓酕釬釴釱釳釸釤釹釪"],["d840","釫釷釨釮镺閆閈陼陭陫陱陯隿靪頄飥馗傛傕傔傞傋傣傃傌傎傝偨傜傒傂傇兟凔匒匑厤厧喑喨喥喭啷噅喢喓喈喏喵喁喣喒喤啽喌喦啿喕喡喎圌堩堷"],["d8a1","堙堞堧堣堨埵塈堥堜堛堳堿堶堮堹堸堭堬堻奡媯媔媟婺媢媞婸媦婼媥媬媕媮娷媄媊媗媃媋媩婻婽媌媜媏媓媝寪寍寋寔寑寊寎尌尰崷嵃嵫嵁嵋崿崵嵑嵎嵕崳崺嵒崽崱嵙嵂崹嵉崸崼崲崶嵀嵅幄幁彘徦徥徫惉悹惌惢惎惄愔"],["d940","惲愊愖愅惵愓惸惼惾惁愃愘愝愐惿愄愋扊掔掱掰揎揥揨揯揃撝揳揊揠揶揕揲揵摡揟掾揝揜揄揘揓揂揇揌揋揈揰揗揙攲敧敪敤敜敨敥斌斝斞斮旐旒"],["d9a1","晼晬晻暀晱晹晪晲朁椌棓椄棜椪棬棪棱椏棖棷棫棤棶椓椐棳棡椇棌椈楰梴椑棯棆椔棸棐棽棼棨椋椊椗棎棈棝棞棦棴棑椆棔棩椕椥棇欹欻欿欼殔殗殙殕殽毰毲毳氰淼湆湇渟湉溈渼渽湅湢渫渿湁湝湳渜渳湋湀湑渻渃渮湞"],["da40","湨湜湡渱渨湠湱湫渹渢渰湓湥渧湸湤湷湕湹湒湦渵渶湚焠焞焯烻焮焱焣焥焢焲焟焨焺焛牋牚犈犉犆犅犋猒猋猰猢猱猳猧猲猭猦猣猵猌琮琬琰琫琖"],["daa1","琚琡琭琱琤琣琝琩琠琲瓻甯畯畬痧痚痡痦痝痟痤痗皕皒盚睆睇睄睍睅睊睎睋睌矞矬硠硤硥硜硭硱硪确硰硩硨硞硢祴祳祲祰稂稊稃稌稄窙竦竤筊笻筄筈筌筎筀筘筅粢粞粨粡絘絯絣絓絖絧絪絏絭絜絫絒絔絩絑絟絎缾缿罥"],["db40","罦羢羠羡翗聑聏聐胾胔腃腊腒腏腇脽腍脺臦臮臷臸臹舄舼舽舿艵茻菏菹萣菀菨萒菧菤菼菶萐菆菈菫菣莿萁菝菥菘菿菡菋菎菖菵菉萉萏菞萑萆菂菳"],["dba1","菕菺菇菑菪萓菃菬菮菄菻菗菢萛菛菾蛘蛢蛦蛓蛣蛚蛪蛝蛫蛜蛬蛩蛗蛨蛑衈衖衕袺裗袹袸裀袾袶袼袷袽袲褁裉覕覘覗觝觚觛詎詍訹詙詀詗詘詄詅詒詈詑詊詌詏豟貁貀貺貾貰貹貵趄趀趉跘跓跍跇跖跜跏跕跙跈跗跅軯軷軺"],["dc40","軹軦軮軥軵軧軨軶軫軱軬軴軩逭逴逯鄆鄬鄄郿郼鄈郹郻鄁鄀鄇鄅鄃酡酤酟酢酠鈁鈊鈥鈃鈚鈦鈏鈌鈀鈒釿釽鈆鈄鈧鈂鈜鈤鈙鈗鈅鈖镻閍閌閐隇陾隈"],["dca1","隉隃隀雂雈雃雱雰靬靰靮頇颩飫鳦黹亃亄亶傽傿僆傮僄僊傴僈僂傰僁傺傱僋僉傶傸凗剺剸剻剼嗃嗛嗌嗐嗋嗊嗝嗀嗔嗄嗩喿嗒喍嗏嗕嗢嗖嗈嗲嗍嗙嗂圔塓塨塤塏塍塉塯塕塎塝塙塥塛堽塣塱壼嫇嫄嫋媺媸媱媵媰媿嫈媻嫆"],["dd40","媷嫀嫊媴媶嫍媹媐寖寘寙尟尳嵱嵣嵊嵥嵲嵬嵞嵨嵧嵢巰幏幎幊幍幋廅廌廆廋廇彀徯徭惷慉慊愫慅愶愲愮慆愯慏愩慀戠酨戣戥戤揅揱揫搐搒搉搠搤"],["dda1","搳摃搟搕搘搹搷搢搣搌搦搰搨摁搵搯搊搚摀搥搧搋揧搛搮搡搎敯斒旓暆暌暕暐暋暊暙暔晸朠楦楟椸楎楢楱椿楅楪椹楂楗楙楺楈楉椵楬椳椽楥棰楸椴楩楀楯楄楶楘楁楴楌椻楋椷楜楏楑椲楒椯楻椼歆歅歃歂歈歁殛嗀毻毼"],["de40","毹毷毸溛滖滈溏滀溟溓溔溠溱溹滆滒溽滁溞滉溷溰滍溦滏溲溾滃滜滘溙溒溎溍溤溡溿溳滐滊溗溮溣煇煔煒煣煠煁煝煢煲煸煪煡煂煘煃煋煰煟煐煓"],["dea1","煄煍煚牏犍犌犑犐犎猼獂猻猺獀獊獉瑄瑊瑋瑒瑑瑗瑀瑏瑐瑎瑂瑆瑍瑔瓡瓿瓾瓽甝畹畷榃痯瘏瘃痷痾痼痹痸瘐痻痶痭痵痽皙皵盝睕睟睠睒睖睚睩睧睔睙睭矠碇碚碔碏碄碕碅碆碡碃硹碙碀碖硻祼禂祽祹稑稘稙稒稗稕稢稓"],["df40","稛稐窣窢窞竫筦筤筭筴筩筲筥筳筱筰筡筸筶筣粲粴粯綈綆綀綍絿綅絺綎絻綃絼綌綔綄絽綒罭罫罧罨罬羦羥羧翛翜耡腤腠腷腜腩腛腢腲朡腞腶腧腯"],["dfa1","腄腡舝艉艄艀艂艅蓱萿葖葶葹蒏蒍葥葑葀蒆葧萰葍葽葚葙葴葳葝蔇葞萷萺萴葺葃葸萲葅萩菙葋萯葂萭葟葰萹葎葌葒葯蓅蒎萻葇萶萳葨葾葄萫葠葔葮葐蜋蜄蛷蜌蛺蛖蛵蝍蛸蜎蜉蜁蛶蜍蜅裖裋裍裎裞裛裚裌裐覅覛觟觥觤"],["e040","觡觠觢觜触詶誆詿詡訿詷誂誄詵誃誁詴詺谼豋豊豥豤豦貆貄貅賌赨赩趑趌趎趏趍趓趔趐趒跰跠跬跱跮跐跩跣跢跧跲跫跴輆軿輁輀輅輇輈輂輋遒逿"],["e0a1","遄遉逽鄐鄍鄏鄑鄖鄔鄋鄎酮酯鉈鉒鈰鈺鉦鈳鉥鉞銃鈮鉊鉆鉭鉬鉏鉠鉧鉯鈶鉡鉰鈱鉔鉣鉐鉲鉎鉓鉌鉖鈲閟閜閞閛隒隓隑隗雎雺雽雸雵靳靷靸靲頏頍頎颬飶飹馯馲馰馵骭骫魛鳪鳭鳧麀黽僦僔僗僨僳僛僪僝僤僓僬僰僯僣僠"],["e140","凘劀劁勩勫匰厬嘧嘕嘌嘒嗼嘏嘜嘁嘓嘂嗺嘝嘄嗿嗹墉塼墐墘墆墁塿塴墋塺墇墑墎塶墂墈塻墔墏壾奫嫜嫮嫥嫕嫪嫚嫭嫫嫳嫢嫠嫛嫬嫞嫝嫙嫨嫟孷寠"],["e1a1","寣屣嶂嶀嵽嶆嵺嶁嵷嶊嶉嶈嵾嵼嶍嵹嵿幘幙幓廘廑廗廎廜廕廙廒廔彄彃彯徶愬愨慁慞慱慳慒慓慲慬憀慴慔慺慛慥愻慪慡慖戩戧戫搫摍摛摝摴摶摲摳摽摵摦撦摎撂摞摜摋摓摠摐摿搿摬摫摙摥摷敳斠暡暠暟朅朄朢榱榶槉"],["e240","榠槎榖榰榬榼榑榙榎榧榍榩榾榯榿槄榽榤槔榹槊榚槏榳榓榪榡榞槙榗榐槂榵榥槆歊歍歋殞殟殠毃毄毾滎滵滱漃漥滸漷滻漮漉潎漙漚漧漘漻漒滭漊"],["e2a1","漶潳滹滮漭潀漰漼漵滫漇漎潃漅滽滶漹漜滼漺漟漍漞漈漡熇熐熉熀熅熂熏煻熆熁熗牄牓犗犕犓獃獍獑獌瑢瑳瑱瑵瑲瑧瑮甀甂甃畽疐瘖瘈瘌瘕瘑瘊瘔皸瞁睼瞅瞂睮瞀睯睾瞃碲碪碴碭碨硾碫碞碥碠碬碢碤禘禊禋禖禕禔禓"],["e340","禗禈禒禐稫穊稰稯稨稦窨窫窬竮箈箜箊箑箐箖箍箌箛箎箅箘劄箙箤箂粻粿粼粺綧綷緂綣綪緁緀緅綝緎緄緆緋緌綯綹綖綼綟綦綮綩綡緉罳翢翣翥翞"],["e3a1","耤聝聜膉膆膃膇膍膌膋舕蒗蒤蒡蒟蒺蓎蓂蒬蒮蒫蒹蒴蓁蓍蒪蒚蒱蓐蒝蒧蒻蒢蒔蓇蓌蒛蒩蒯蒨蓖蒘蒶蓏蒠蓗蓔蓒蓛蒰蒑虡蜳蜣蜨蝫蝀蜮蜞蜡蜙蜛蝃蜬蝁蜾蝆蜠蜲蜪蜭蜼蜒蜺蜱蜵蝂蜦蜧蜸蜤蜚蜰蜑裷裧裱裲裺裾裮裼裶裻"],["e440","裰裬裫覝覡覟覞觩觫觨誫誙誋誒誏誖谽豨豩賕賏賗趖踉踂跿踍跽踊踃踇踆踅跾踀踄輐輑輎輍鄣鄜鄠鄢鄟鄝鄚鄤鄡鄛酺酲酹酳銥銤鉶銛鉺銠銔銪銍"],["e4a1","銦銚銫鉹銗鉿銣鋮銎銂銕銢鉽銈銡銊銆銌銙銧鉾銇銩銝銋鈭隞隡雿靘靽靺靾鞃鞀鞂靻鞄鞁靿韎韍頖颭颮餂餀餇馝馜駃馹馻馺駂馽駇骱髣髧鬾鬿魠魡魟鳱鳲鳵麧僿儃儰僸儆儇僶僾儋儌僽儊劋劌勱勯噈噂噌嘵噁噊噉噆噘"],["e540","噚噀嘳嘽嘬嘾嘸嘪嘺圚墫墝墱墠墣墯墬墥墡壿嫿嫴嫽嫷嫶嬃嫸嬂嫹嬁嬇嬅嬏屧嶙嶗嶟嶒嶢嶓嶕嶠嶜嶡嶚嶞幩幝幠幜緳廛廞廡彉徲憋憃慹憱憰憢憉"],["e5a1","憛憓憯憭憟憒憪憡憍慦憳戭摮摰撖撠撅撗撜撏撋撊撌撣撟摨撱撘敶敺敹敻斲斳暵暰暩暲暷暪暯樀樆樗槥槸樕槱槤樠槿槬槢樛樝槾樧槲槮樔槷槧橀樈槦槻樍槼槫樉樄樘樥樏槶樦樇槴樖歑殥殣殢殦氁氀毿氂潁漦潾澇濆澒"],["e640","澍澉澌潢潏澅潚澖潶潬澂潕潲潒潐潗澔澓潝漀潡潫潽潧澐潓澋潩潿澕潣潷潪潻熲熯熛熰熠熚熩熵熝熥熞熤熡熪熜熧熳犘犚獘獒獞獟獠獝獛獡獚獙"],["e6a1","獢璇璉璊璆璁瑽璅璈瑼瑹甈甇畾瘥瘞瘙瘝瘜瘣瘚瘨瘛皜皝皞皛瞍瞏瞉瞈磍碻磏磌磑磎磔磈磃磄磉禚禡禠禜禢禛歶稹窲窴窳箷篋箾箬篎箯箹篊箵糅糈糌糋緷緛緪緧緗緡縃緺緦緶緱緰緮緟罶羬羰羭翭翫翪翬翦翨聤聧膣膟"],["e740","膞膕膢膙膗舖艏艓艒艐艎艑蔤蔻蔏蔀蔩蔎蔉蔍蔟蔊蔧蔜蓻蔫蓺蔈蔌蓴蔪蓲蔕蓷蓫蓳蓼蔒蓪蓩蔖蓾蔨蔝蔮蔂蓽蔞蓶蔱蔦蓧蓨蓰蓯蓹蔘蔠蔰蔋蔙蔯虢"],["e7a1","蝖蝣蝤蝷蟡蝳蝘蝔蝛蝒蝡蝚蝑蝞蝭蝪蝐蝎蝟蝝蝯蝬蝺蝮蝜蝥蝏蝻蝵蝢蝧蝩衚褅褌褔褋褗褘褙褆褖褑褎褉覢覤覣觭觰觬諏諆誸諓諑諔諕誻諗誾諀諅諘諃誺誽諙谾豍貏賥賟賙賨賚賝賧趠趜趡趛踠踣踥踤踮踕踛踖踑踙踦踧"],["e840","踔踒踘踓踜踗踚輬輤輘輚輠輣輖輗遳遰遯遧遫鄯鄫鄩鄪鄲鄦鄮醅醆醊醁醂醄醀鋐鋃鋄鋀鋙銶鋏鋱鋟鋘鋩鋗鋝鋌鋯鋂鋨鋊鋈鋎鋦鋍鋕鋉鋠鋞鋧鋑鋓"],["e8a1","銵鋡鋆銴镼閬閫閮閰隤隢雓霅霈霂靚鞊鞎鞈韐韏頞頝頦頩頨頠頛頧颲餈飺餑餔餖餗餕駜駍駏駓駔駎駉駖駘駋駗駌骳髬髫髳髲髱魆魃魧魴魱魦魶魵魰魨魤魬鳼鳺鳽鳿鳷鴇鴀鳹鳻鴈鴅鴄麃黓鼏鼐儜儓儗儚儑凞匴叡噰噠噮"],["e940","噳噦噣噭噲噞噷圜圛壈墽壉墿墺壂墼壆嬗嬙嬛嬡嬔嬓嬐嬖嬨嬚嬠嬞寯嶬嶱嶩嶧嶵嶰嶮嶪嶨嶲嶭嶯嶴幧幨幦幯廩廧廦廨廥彋徼憝憨憖懅憴懆懁懌憺"],["e9a1","憿憸憌擗擖擐擏擉撽撉擃擛擳擙攳敿敼斢曈暾曀曊曋曏暽暻暺曌朣樴橦橉橧樲橨樾橝橭橶橛橑樨橚樻樿橁橪橤橐橏橔橯橩橠樼橞橖橕橍橎橆歕歔歖殧殪殫毈毇氄氃氆澭濋澣濇澼濎濈潞濄澽澞濊澨瀄澥澮澺澬澪濏澿澸"],["ea40","澢濉澫濍澯澲澰燅燂熿熸燖燀燁燋燔燊燇燏熽燘熼燆燚燛犝犞獩獦獧獬獥獫獪瑿璚璠璔璒璕璡甋疀瘯瘭瘱瘽瘳瘼瘵瘲瘰皻盦瞚瞝瞡瞜瞛瞢瞣瞕瞙"],["eaa1","瞗磝磩磥磪磞磣磛磡磢磭磟磠禤穄穈穇窶窸窵窱窷篞篣篧篝篕篥篚篨篹篔篪篢篜篫篘篟糒糔糗糐糑縒縡縗縌縟縠縓縎縜縕縚縢縋縏縖縍縔縥縤罃罻罼罺羱翯耪耩聬膱膦膮膹膵膫膰膬膴膲膷膧臲艕艖艗蕖蕅蕫蕍蕓蕡蕘"],["eb40","蕀蕆蕤蕁蕢蕄蕑蕇蕣蔾蕛蕱蕎蕮蕵蕕蕧蕠薌蕦蕝蕔蕥蕬虣虥虤螛螏螗螓螒螈螁螖螘蝹螇螣螅螐螑螝螄螔螜螚螉褞褦褰褭褮褧褱褢褩褣褯褬褟觱諠"],["eba1","諢諲諴諵諝謔諤諟諰諈諞諡諨諿諯諻貑貒貐賵賮賱賰賳赬赮趥趧踳踾踸蹀蹅踶踼踽蹁踰踿躽輶輮輵輲輹輷輴遶遹遻邆郺鄳鄵鄶醓醐醑醍醏錧錞錈錟錆錏鍺錸錼錛錣錒錁鍆錭錎錍鋋錝鋺錥錓鋹鋷錴錂錤鋿錩錹錵錪錔錌"],["ec40","錋鋾錉錀鋻錖閼闍閾閹閺閶閿閵閽隩雔霋霒霐鞙鞗鞔韰韸頵頯頲餤餟餧餩馞駮駬駥駤駰駣駪駩駧骹骿骴骻髶髺髹髷鬳鮀鮅鮇魼魾魻鮂鮓鮒鮐魺鮕"],["eca1","魽鮈鴥鴗鴠鴞鴔鴩鴝鴘鴢鴐鴙鴟麈麆麇麮麭黕黖黺鼒鼽儦儥儢儤儠儩勴嚓嚌嚍嚆嚄嚃噾嚂噿嚁壖壔壏壒嬭嬥嬲嬣嬬嬧嬦嬯嬮孻寱寲嶷幬幪徾徻懃憵憼懧懠懥懤懨懞擯擩擣擫擤擨斁斀斶旚曒檍檖檁檥檉檟檛檡檞檇檓檎"],["ed40","檕檃檨檤檑橿檦檚檅檌檒歛殭氉濌澩濴濔濣濜濭濧濦濞濲濝濢濨燡燱燨燲燤燰燢獳獮獯璗璲璫璐璪璭璱璥璯甐甑甒甏疄癃癈癉癇皤盩瞵瞫瞲瞷瞶"],["eda1","瞴瞱瞨矰磳磽礂磻磼磲礅磹磾礄禫禨穜穛穖穘穔穚窾竀竁簅簏篲簀篿篻簎篴簋篳簂簉簃簁篸篽簆篰篱簐簊糨縭縼繂縳顈縸縪繉繀繇縩繌縰縻縶繄縺罅罿罾罽翴翲耬膻臄臌臊臅臇膼臩艛艚艜薃薀薏薧薕薠薋薣蕻薤薚薞"],["ee40","蕷蕼薉薡蕺蕸蕗薎薖薆薍薙薝薁薢薂薈薅蕹蕶薘薐薟虨螾螪螭蟅螰螬螹螵螼螮蟉蟃蟂蟌螷螯蟄蟊螴螶螿螸螽蟞螲褵褳褼褾襁襒褷襂覭覯覮觲觳謞"],["eea1","謘謖謑謅謋謢謏謒謕謇謍謈謆謜謓謚豏豰豲豱豯貕貔賹赯蹎蹍蹓蹐蹌蹇轃轀邅遾鄸醚醢醛醙醟醡醝醠鎡鎃鎯鍤鍖鍇鍼鍘鍜鍶鍉鍐鍑鍠鍭鎏鍌鍪鍹鍗鍕鍒鍏鍱鍷鍻鍡鍞鍣鍧鎀鍎鍙闇闀闉闃闅閷隮隰隬霠霟霘霝霙鞚鞡鞜"],["ef40","鞞鞝韕韔韱顁顄顊顉顅顃餥餫餬餪餳餲餯餭餱餰馘馣馡騂駺駴駷駹駸駶駻駽駾駼騃骾髾髽鬁髼魈鮚鮨鮞鮛鮦鮡鮥鮤鮆鮢鮠鮯鴳鵁鵧鴶鴮鴯鴱鴸鴰"],["efa1","鵅鵂鵃鴾鴷鵀鴽翵鴭麊麉麍麰黈黚黻黿鼤鼣鼢齔龠儱儭儮嚘嚜嚗嚚嚝嚙奰嬼屩屪巀幭幮懘懟懭懮懱懪懰懫懖懩擿攄擽擸攁攃擼斔旛曚曛曘櫅檹檽櫡櫆檺檶檷櫇檴檭歞毉氋瀇瀌瀍瀁瀅瀔瀎濿瀀濻瀦濼濷瀊爁燿燹爃燽獶"],["f040","璸瓀璵瓁璾璶璻瓂甔甓癜癤癙癐癓癗癚皦皽盬矂瞺磿礌礓礔礉礐礒礑禭禬穟簜簩簙簠簟簭簝簦簨簢簥簰繜繐繖繣繘繢繟繑繠繗繓羵羳翷翸聵臑臒"],["f0a1","臐艟艞薴藆藀藃藂薳薵薽藇藄薿藋藎藈藅薱薶藒蘤薸薷薾虩蟧蟦蟢蟛蟫蟪蟥蟟蟳蟤蟔蟜蟓蟭蟘蟣螤蟗蟙蠁蟴蟨蟝襓襋襏襌襆襐襑襉謪謧謣謳謰謵譇謯謼謾謱謥謷謦謶謮謤謻謽謺豂豵貙貘貗賾贄贂贀蹜蹢蹠蹗蹖蹞蹥蹧"],["f140","蹛蹚蹡蹝蹩蹔轆轇轈轋鄨鄺鄻鄾醨醥醧醯醪鎵鎌鎒鎷鎛鎝鎉鎧鎎鎪鎞鎦鎕鎈鎙鎟鎍鎱鎑鎲鎤鎨鎴鎣鎥闒闓闑隳雗雚巂雟雘雝霣霢霥鞬鞮鞨鞫鞤鞪"],["f1a1","鞢鞥韗韙韖韘韺顐顑顒颸饁餼餺騏騋騉騍騄騑騊騅騇騆髀髜鬈鬄鬅鬩鬵魊魌魋鯇鯆鯃鮿鯁鮵鮸鯓鮶鯄鮹鮽鵜鵓鵏鵊鵛鵋鵙鵖鵌鵗鵒鵔鵟鵘鵚麎麌黟鼁鼀鼖鼥鼫鼪鼩鼨齌齕儴儵劖勷厴嚫嚭嚦嚧嚪嚬壚壝壛夒嬽嬾嬿巃幰"],["f240","徿懻攇攐攍攉攌攎斄旞旝曞櫧櫠櫌櫑櫙櫋櫟櫜櫐櫫櫏櫍櫞歠殰氌瀙瀧瀠瀖瀫瀡瀢瀣瀩瀗瀤瀜瀪爌爊爇爂爅犥犦犤犣犡瓋瓅璷瓃甖癠矉矊矄矱礝礛"],["f2a1","礡礜礗礞禰穧穨簳簼簹簬簻糬糪繶繵繸繰繷繯繺繲繴繨罋罊羃羆羷翽翾聸臗臕艤艡艣藫藱藭藙藡藨藚藗藬藲藸藘藟藣藜藑藰藦藯藞藢蠀蟺蠃蟶蟷蠉蠌蠋蠆蟼蠈蟿蠊蠂襢襚襛襗襡襜襘襝襙覈覷覶觶譐譈譊譀譓譖譔譋譕"],["f340","譑譂譒譗豃豷豶貚贆贇贉趬趪趭趫蹭蹸蹳蹪蹯蹻軂轒轑轏轐轓辴酀鄿醰醭鏞鏇鏏鏂鏚鏐鏹鏬鏌鏙鎩鏦鏊鏔鏮鏣鏕鏄鏎鏀鏒鏧镽闚闛雡霩霫霬霨霦"],["f3a1","鞳鞷鞶韝韞韟顜顙顝顗颿颽颻颾饈饇饃馦馧騚騕騥騝騤騛騢騠騧騣騞騜騔髂鬋鬊鬎鬌鬷鯪鯫鯠鯞鯤鯦鯢鯰鯔鯗鯬鯜鯙鯥鯕鯡鯚鵷鶁鶊鶄鶈鵱鶀鵸鶆鶋鶌鵽鵫鵴鵵鵰鵩鶅鵳鵻鶂鵯鵹鵿鶇鵨麔麑黀黼鼭齀齁齍齖齗齘匷嚲"],["f440","嚵嚳壣孅巆巇廮廯忀忁懹攗攖攕攓旟曨曣曤櫳櫰櫪櫨櫹櫱櫮櫯瀼瀵瀯瀷瀴瀱灂瀸瀿瀺瀹灀瀻瀳灁爓爔犨獽獼璺皫皪皾盭矌矎矏矍矲礥礣礧礨礤礩"],["f4a1","禲穮穬穭竷籉籈籊籇籅糮繻繾纁纀羺翿聹臛臙舋艨艩蘢藿蘁藾蘛蘀藶蘄蘉蘅蘌藽蠙蠐蠑蠗蠓蠖襣襦覹觷譠譪譝譨譣譥譧譭趮躆躈躄轙轖轗轕轘轚邍酃酁醷醵醲醳鐋鐓鏻鐠鐏鐔鏾鐕鐐鐨鐙鐍鏵鐀鏷鐇鐎鐖鐒鏺鐉鏸鐊鏿"],["f540","鏼鐌鏶鐑鐆闞闠闟霮霯鞹鞻韽韾顠顢顣顟飁飂饐饎饙饌饋饓騲騴騱騬騪騶騩騮騸騭髇髊髆鬐鬒鬑鰋鰈鯷鰅鰒鯸鱀鰇鰎鰆鰗鰔鰉鶟鶙鶤鶝鶒鶘鶐鶛"],["f5a1","鶠鶔鶜鶪鶗鶡鶚鶢鶨鶞鶣鶿鶩鶖鶦鶧麙麛麚黥黤黧黦鼰鼮齛齠齞齝齙龑儺儹劘劗囃嚽嚾孈孇巋巏廱懽攛欂櫼欃櫸欀灃灄灊灈灉灅灆爝爚爙獾甗癪矐礭礱礯籔籓糲纊纇纈纋纆纍罍羻耰臝蘘蘪蘦蘟蘣蘜蘙蘧蘮蘡蘠蘩蘞蘥"],["f640","蠩蠝蠛蠠蠤蠜蠫衊襭襩襮襫觺譹譸譅譺譻贐贔趯躎躌轞轛轝酆酄酅醹鐿鐻鐶鐩鐽鐼鐰鐹鐪鐷鐬鑀鐱闥闤闣霵霺鞿韡顤飉飆飀饘饖騹騽驆驄驂驁騺"],["f6a1","騿髍鬕鬗鬘鬖鬺魒鰫鰝鰜鰬鰣鰨鰩鰤鰡鶷鶶鶼鷁鷇鷊鷏鶾鷅鷃鶻鶵鷎鶹鶺鶬鷈鶱鶭鷌鶳鷍鶲鹺麜黫黮黭鼛鼘鼚鼱齎齥齤龒亹囆囅囋奱孋孌巕巑廲攡攠攦攢欋欈欉氍灕灖灗灒爞爟犩獿瓘瓕瓙瓗癭皭礵禴穰穱籗籜籙籛籚"],["f740","糴糱纑罏羇臞艫蘴蘵蘳蘬蘲蘶蠬蠨蠦蠪蠥襱覿覾觻譾讄讂讆讅譿贕躕躔躚躒躐躖躗轠轢酇鑌鑐鑊鑋鑏鑇鑅鑈鑉鑆霿韣顪顩飋饔饛驎驓驔驌驏驈驊"],["f7a1","驉驒驐髐鬙鬫鬻魖魕鱆鱈鰿鱄鰹鰳鱁鰼鰷鰴鰲鰽鰶鷛鷒鷞鷚鷋鷐鷜鷑鷟鷩鷙鷘鷖鷵鷕鷝麶黰鼵鼳鼲齂齫龕龢儽劙壨壧奲孍巘蠯彏戁戃戄攩攥斖曫欑欒欏毊灛灚爢玂玁玃癰矔籧籦纕艬蘺虀蘹蘼蘱蘻蘾蠰蠲蠮蠳襶襴襳觾"],["f840","讌讎讋讈豅贙躘轤轣醼鑢鑕鑝鑗鑞韄韅頀驖驙鬞鬟鬠鱒鱘鱐鱊鱍鱋鱕鱙鱌鱎鷻鷷鷯鷣鷫鷸鷤鷶鷡鷮鷦鷲鷰鷢鷬鷴鷳鷨鷭黂黐黲黳鼆鼜鼸鼷鼶齃齏"],["f8a1","齱齰齮齯囓囍孎屭攭曭曮欓灟灡灝灠爣瓛瓥矕礸禷禶籪纗羉艭虃蠸蠷蠵衋讔讕躞躟躠躝醾醽釂鑫鑨鑩雥靆靃靇韇韥驞髕魙鱣鱧鱦鱢鱞鱠鸂鷾鸇鸃鸆鸅鸀鸁鸉鷿鷽鸄麠鼞齆齴齵齶囔攮斸欘欙欗欚灢爦犪矘矙礹籩籫糶纚"],["f940","纘纛纙臠臡虆虇虈襹襺襼襻觿讘讙躥躤躣鑮鑭鑯鑱鑳靉顲饟鱨鱮鱭鸋鸍鸐鸏鸒鸑麡黵鼉齇齸齻齺齹圞灦籯蠼趲躦釃鑴鑸鑶鑵驠鱴鱳鱱鱵鸔鸓黶鼊"],["f9a1","龤灨灥糷虪蠾蠽蠿讞貜躩軉靋顳顴飌饡馫驤驦驧鬤鸕鸗齈戇欞爧虌躨钂钀钁驩驨鬮鸙爩虋讟钃鱹麷癵驫鱺鸝灩灪麤齾齉龘碁銹裏墻恒粧嫺╔╦╗╠╬╣╚╩╝╒╤╕╞╪╡╘╧╛╓╥╖╟╫╢╙╨╜║═╭╮╰╯▓"]]'), hz = [
  [
    "8740",
    "䏰䰲䘃䖦䕸𧉧䵷䖳𧲱䳢𧳅㮕䜶䝄䱇䱀𤊿𣘗𧍒𦺋𧃒䱗𪍑䝏䗚䲅𧱬䴇䪤䚡𦬣爥𥩔𡩣𣸆𣽡晍囻"
  ],
  [
    "8767",
    "綕夝𨮹㷴霴𧯯寛𡵞媤㘥𩺰嫑宷峼杮薓𩥅瑡璝㡵𡵓𣚞𦀡㻬"
  ],
  [
    "87a1",
    "𥣞㫵竼龗𤅡𨤍𣇪𠪊𣉞䌊蒄龖鐯䤰蘓墖靊鈘秐稲晠権袝瑌篅枂稬剏遆㓦珄𥶹瓆鿇垳䤯呌䄱𣚎堘穲𧭥讏䚮𦺈䆁𥶙箮𢒼鿈𢓁𢓉𢓌鿉蔄𣖻䂴鿊䓡𪷿拁灮鿋"
  ],
  [
    "8840",
    "㇀",
    4,
    "𠄌㇅𠃑𠃍㇆㇇𠃋𡿨㇈𠃊㇉㇊㇋㇌𠄎㇍㇎ĀÁǍÀĒÉĚÈŌÓǑÒ࿿Ê̄Ế࿿Ê̌ỀÊāáǎàɑēéěèīíǐìōóǒòūúǔùǖǘǚ"
  ],
  [
    "88a1",
    "ǜü࿿ê̄ế࿿ê̌ềêɡ⏚⏛"
  ],
  [
    "8940",
    "𪎩𡅅"
  ],
  [
    "8943",
    "攊"
  ],
  [
    "8946",
    "丽滝鵎釟"
  ],
  [
    "894c",
    "𧜵撑会伨侨兖兴农凤务动医华发变团声处备夲头学实実岚庆总斉柾栄桥济炼电纤纬纺织经统缆缷艺苏药视设询车轧轮"
  ],
  [
    "89a1",
    "琑糼緍楆竉刧"
  ],
  [
    "89ab",
    "醌碸酞肼"
  ],
  [
    "89b0",
    "贋胶𠧧"
  ],
  [
    "89b5",
    "肟黇䳍鷉鸌䰾𩷶𧀎鸊𪄳㗁"
  ],
  [
    "89c1",
    "溚舾甙"
  ],
  [
    "89c5",
    "䤑马骏龙禇𨑬𡷊𠗐𢫦两亁亀亇亿仫伷㑌侽㹈倃傈㑽㒓㒥円夅凛凼刅争剹劐匧㗇厩㕑厰㕓参吣㕭㕲㚁咓咣咴咹哐哯唘唣唨㖘唿㖥㖿嗗㗅"
  ],
  [
    "8a40",
    "𧶄唥"
  ],
  [
    "8a43",
    "𠱂𠴕𥄫喐𢳆㧬𠍁蹆𤶸𩓥䁓𨂾睺𢰸㨴䟕𨅝𦧲𤷪擝𠵼𠾴𠳕𡃴撍蹾𠺖𠰋𠽤𢲩𨉖𤓓"
  ],
  [
    "8a64",
    "𠵆𩩍𨃩䟴𤺧𢳂骲㩧𩗴㿭㔆𥋇𩟔𧣈𢵄鵮頕"
  ],
  [
    "8a76",
    "䏙𦂥撴哣𢵌𢯊𡁷㧻𡁯"
  ],
  [
    "8aa1",
    "𦛚𦜖𧦠擪𥁒𠱃蹨𢆡𨭌𠜱"
  ],
  [
    "8aac",
    "䠋𠆩㿺塳𢶍"
  ],
  [
    "8ab2",
    "𤗈𠓼𦂗𠽌𠶖啹䂻䎺"
  ],
  [
    "8abb",
    "䪴𢩦𡂝膪飵𠶜捹㧾𢝵跀嚡摼㹃"
  ],
  [
    "8ac9",
    "𪘁𠸉𢫏𢳉"
  ],
  [
    "8ace",
    "𡃈𣧂㦒㨆𨊛㕸𥹉𢃇噒𠼱𢲲𩜠㒼氽𤸻"
  ],
  [
    "8adf",
    "𧕴𢺋𢈈𪙛𨳍𠹺𠰴𦠜羓𡃏𢠃𢤹㗻𥇣𠺌𠾍𠺪㾓𠼰𠵇𡅏𠹌"
  ],
  [
    "8af6",
    "𠺫𠮩𠵈𡃀𡄽㿹𢚖搲𠾭"
  ],
  [
    "8b40",
    "𣏴𧘹𢯎𠵾𠵿𢱑𢱕㨘𠺘𡃇𠼮𪘲𦭐𨳒𨶙𨳊閪哌苄喹"
  ],
  [
    "8b55",
    "𩻃鰦骶𧝞𢷮煀腭胬尜𦕲脴㞗卟𨂽醶𠻺𠸏𠹷𠻻㗝𤷫㘉𠳖嚯𢞵𡃉𠸐𠹸𡁸𡅈𨈇𡑕𠹹𤹐𢶤婔𡀝𡀞𡃵𡃶垜𠸑"
  ],
  [
    "8ba1",
    "𧚔𨋍𠾵𠹻𥅾㜃𠾶𡆀𥋘𪊽𤧚𡠺𤅷𨉼墙剨㘚𥜽箲孨䠀䬬鼧䧧鰟鮍𥭴𣄽嗻㗲嚉丨夂𡯁屮靑𠂆乛亻㔾尣彑忄㣺扌攵歺氵氺灬爫丬犭𤣩罒礻糹罓𦉪㓁"
  ],
  [
    "8bde",
    "𦍋耂肀𦘒𦥑卝衤见𧢲讠贝钅镸长门𨸏韦页风飞饣𩠐鱼鸟黄歯龜丷𠂇阝户钢"
  ],
  [
    "8c40",
    "倻淾𩱳龦㷉袏𤅎灷峵䬠𥇍㕙𥴰愢𨨲辧釶熑朙玺𣊁𪄇㲋𡦀䬐磤琂冮𨜏䀉橣𪊺䈣蘏𠩯稪𩥇𨫪靕灍匤𢁾鏴盙𨧣龧矝亣俰傼丯众龨吴綋墒壐𡶶庒庙忂𢜒斋"
  ],
  [
    "8ca1",
    "𣏹椙橃𣱣泿"
  ],
  [
    "8ca7",
    "爀𤔅玌㻛𤨓嬕璹讃𥲤𥚕窓篬糃繬苸薗龩袐龪躹龫迏蕟駠鈡龬𨶹𡐿䁱䊢娚"
  ],
  [
    "8cc9",
    "顨杫䉶圽"
  ],
  [
    "8cce",
    "藖𤥻芿𧄍䲁𦵴嵻𦬕𦾾龭龮宖龯曧繛湗秊㶈䓃𣉖𢞖䎚䔶"
  ],
  [
    "8ce6",
    "峕𣬚諹屸㴒𣕑嵸龲煗䕘𤃬𡸣䱷㥸㑊𠆤𦱁諌侴𠈹妿腬顖𩣺弻"
  ],
  [
    "8d40",
    "𠮟"
  ],
  [
    "8d42",
    "𢇁𨥭䄂䚻𩁹㼇龳𪆵䃸㟖䛷𦱆䅼𨚲𧏿䕭㣔𥒚䕡䔛䶉䱻䵶䗪㿈𤬏㙡䓞䒽䇭崾嵈嵖㷼㠏嶤嶹㠠㠸幂庽弥徃㤈㤔㤿㥍惗愽峥㦉憷憹懏㦸戬抐拥挘㧸嚱"
  ],
  [
    "8da1",
    "㨃揢揻搇摚㩋擀崕嘡龟㪗斆㪽旿晓㫲暒㬢朖㭂枤栀㭘桊梄㭲㭱㭻椉楃牜楤榟榅㮼槖㯝橥橴橱檂㯬檙㯲檫檵櫔櫶殁毁毪汵沪㳋洂洆洦涁㳯涤涱渕渘温溆𨧀溻滢滚齿滨滩漤漴㵆𣽁澁澾㵪㵵熷岙㶊瀬㶑灐灔灯灿炉𠌥䏁㗱𠻘"
  ],
  [
    "8e40",
    "𣻗垾𦻓焾𥟠㙎榢𨯩孴穉𥣡𩓙穥穽𥦬窻窰竂竃燑𦒍䇊竚竝竪䇯咲𥰁笋筕笩𥌎𥳾箢筯莜𥮴𦱿篐萡箒箸𥴠㶭𥱥蒒篺簆簵𥳁籄粃𤢂粦晽𤕸糉糇糦籴糳糵糎"
  ],
  [
    "8ea1",
    "繧䔝𦹄絝𦻖璍綉綫焵綳緒𤁗𦀩緤㴓緵𡟹緥𨍭縝𦄡𦅚繮纒䌫鑬縧罀罁罇礶𦋐駡羗𦍑羣𡙡𠁨䕜𣝦䔃𨌺翺𦒉者耈耝耨耯𪂇𦳃耻耼聡𢜔䦉𦘦𣷣𦛨朥肧𨩈脇脚墰𢛶汿𦒘𤾸擧𡒊舘𡡞橓𤩥𤪕䑺舩𠬍𦩒𣵾俹𡓽蓢荢𦬊𤦧𣔰𡝳𣷸芪椛芳䇛"
  ],
  [
    "8f40",
    "蕋苐茚𠸖𡞴㛁𣅽𣕚艻苢茘𣺋𦶣𦬅𦮗𣗎㶿茝嗬莅䔋𦶥莬菁菓㑾𦻔橗蕚㒖𦹂𢻯葘𥯤葱㷓䓤檧葊𣲵祘蒨𦮖𦹷𦹃蓞萏莑䒠蒓蓤𥲑䉀𥳀䕃蔴嫲𦺙䔧蕳䔖枿蘖"
  ],
  [
    "8fa1",
    "𨘥𨘻藁𧂈蘂𡖂𧃍䕫䕪蘨㙈𡢢号𧎚虾蝱𪃸蟮𢰧螱蟚蠏噡虬桖䘏衅衆𧗠𣶹𧗤衞袜䙛袴袵揁装睷𧜏覇覊覦覩覧覼𨨥觧𧤤𧪽誜瞓釾誐𧩙竩𧬺𣾏䜓𧬸煼謌謟𥐰𥕥謿譌譍誩𤩺讐讛誯𡛟䘕衏貛𧵔𧶏貫㜥𧵓賖𧶘𧶽贒贃𡤐賛灜贑𤳉㻐起"
  ],
  [
    "9040",
    "趩𨀂𡀔𤦊㭼𨆼𧄌竧躭躶軃鋔輙輭𨍥𨐒辥錃𪊟𠩐辳䤪𨧞𨔽𣶻廸𣉢迹𪀔𨚼𨔁𢌥㦀𦻗逷𨔼𧪾遡𨕬𨘋邨𨜓郄𨛦邮都酧㫰醩釄粬𨤳𡺉鈎沟鉁鉢𥖹銹𨫆𣲛𨬌𥗛"
  ],
  [
    "90a1",
    "𠴱錬鍫𨫡𨯫炏嫃𨫢𨫥䥥鉄𨯬𨰹𨯿鍳鑛躼閅閦鐦閠濶䊹𢙺𨛘𡉼𣸮䧟氜陻隖䅬隣𦻕懚隶磵𨫠隽双䦡𦲸𠉴𦐐𩂯𩃥𤫑𡤕𣌊霱虂霶䨏䔽䖅𤫩灵孁霛靜𩇕靗孊𩇫靟鐥僐𣂷𣂼鞉鞟鞱鞾韀韒韠𥑬韮琜𩐳響韵𩐝𧥺䫑頴頳顋顦㬎𧅵㵑𠘰𤅜"
  ],
  [
    "9140",
    "𥜆飊颷飈飇䫿𦴧𡛓喰飡飦飬鍸餹𤨩䭲𩡗𩤅駵騌騻騐驘𥜥㛄𩂱𩯕髠髢𩬅髴䰎鬔鬭𨘀倴鬴𦦨㣃𣁽魐魀𩴾婅𡡣鮎𤉋鰂鯿鰌𩹨鷔𩾷𪆒𪆫𪃡𪄣𪇟鵾鶃𪄴鸎梈"
  ],
  [
    "91a1",
    "鷄𢅛𪆓𪈠𡤻𪈳鴹𪂹𪊴麐麕麞麢䴴麪麯𤍤黁㭠㧥㴝伲㞾𨰫鼂鼈䮖鐤𦶢鼗鼖鼹嚟嚊齅馸𩂋韲葿齢齩竜龎爖䮾𤥵𤦻煷𤧸𤍈𤩑玞𨯚𡣺禟𨥾𨸶鍩鏳𨩄鋬鎁鏋𨥬𤒹爗㻫睲穃烐𤑳𤏸煾𡟯炣𡢾𣖙㻇𡢅𥐯𡟸㜢𡛻𡠹㛡𡝴𡣑𥽋㜣𡛀坛𤨥𡏾𡊨"
  ],
  [
    "9240",
    "𡏆𡒶蔃𣚦蔃葕𤦔𧅥𣸱𥕜𣻻𧁒䓴𣛮𩦝𦼦柹㜳㰕㷧塬𡤢栐䁗𣜿𤃡𤂋𤄏𦰡哋嚞𦚱嚒𠿟𠮨𠸍鏆𨬓鎜仸儫㠙𤐶亼𠑥𠍿佋侊𥙑婨𠆫𠏋㦙𠌊𠐔㐵伩𠋀𨺳𠉵諚𠈌亘"
  ],
  [
    "92a1",
    "働儍侢伃𤨎𣺊佂倮偬傁俌俥偘僼兙兛兝兞湶𣖕𣸹𣺿浲𡢄𣺉冨凃𠗠䓝𠒣𠒒𠒑赺𨪜𠜎剙劤𠡳勡鍮䙺熌𤎌𠰠𤦬𡃤槑𠸝瑹㻞璙琔瑖玘䮎𤪼𤂍叐㖄爏𤃉喴𠍅响𠯆圝鉝雴鍦埝垍坿㘾壋媙𨩆𡛺𡝯𡜐娬妸銏婾嫏娒𥥆𡧳𡡡𤊕㛵洅瑃娡𥺃"
  ],
  [
    "9340",
    "媁𨯗𠐓鏠璌𡌃焅䥲鐈𨧻鎽㞠尞岞幞幈𡦖𡥼𣫮廍孏𡤃𡤄㜁𡢠㛝𡛾㛓脪𨩇𡶺𣑲𨦨弌弎𡤧𡞫婫𡜻孄蘔𧗽衠恾𢡠𢘫忛㺸𢖯𢖾𩂈𦽳懀𠀾𠁆𢘛憙憘恵𢲛𢴇𤛔𩅍"
  ],
  [
    "93a1",
    "摱𤙥𢭪㨩𢬢𣑐𩣪𢹸挷𪑛撶挱揑𤧣𢵧护𢲡搻敫楲㯴𣂎𣊭𤦉𣊫唍𣋠𡣙𩐿曎𣊉𣆳㫠䆐𥖄𨬢𥖏𡛼𥕛𥐥磮𣄃𡠪𣈴㑤𣈏𣆂𤋉暎𦴤晫䮓昰𧡰𡷫晣𣋒𣋡昞𥡲㣑𣠺𣞼㮙𣞢𣏾瓐㮖枏𤘪梶栞㯄檾㡣𣟕𤒇樳橒櫉欅𡤒攑梘橌㯗橺歗𣿀𣲚鎠鋲𨯪𨫋"
  ],
  [
    "9440",
    "銉𨀞𨧜鑧涥漋𤧬浧𣽿㶏渄𤀼娽渊塇洤硂焻𤌚𤉶烱牐犇犔𤞏𤜥兹𤪤𠗫瑺𣻸𣙟𤩊𤤗𥿡㼆㺱𤫟𨰣𣼵悧㻳瓌琼鎇琷䒟𦷪䕑疃㽣𤳙𤴆㽘畕癳𪗆㬙瑨𨫌𤦫𤦎㫻"
  ],
  [
    "94a1",
    "㷍𤩎㻿𤧅𤣳釺圲鍂𨫣𡡤僟𥈡𥇧睸𣈲眎眏睻𤚗𣞁㩞𤣰琸璛㺿𤪺𤫇䃈𤪖𦆮錇𥖁砞碍碈磒珐祙𧝁𥛣䄎禛蒖禥樭𣻺稺秴䅮𡛦䄲鈵秱𠵌𤦌𠊙𣶺𡝮㖗啫㕰㚪𠇔𠰍竢婙𢛵𥪯𥪜娍𠉛磰娪𥯆竾䇹籝籭䈑𥮳𥺼𥺦糍𤧹𡞰粎籼粮檲緜縇緓罎𦉡"
  ],
  [
    "9540",
    "𦅜𧭈綗𥺂䉪𦭵𠤖柖𠁎𣗏埄𦐒𦏸𤥢翝笧𠠬𥫩𥵃笌𥸎駦虅驣樜𣐿㧢𤧷𦖭騟𦖠蒀𧄧𦳑䓪脷䐂胆脉腂𦞴飃𦩂艢艥𦩑葓𦶧蘐𧈛媆䅿𡡀嬫𡢡嫤𡣘蚠蜨𣶏蠭𧐢娂"
  ],
  [
    "95a1",
    "衮佅袇袿裦襥襍𥚃襔𧞅𧞄𨯵𨯙𨮜𨧹㺭蒣䛵䛏㟲訽訜𩑈彍鈫𤊄旔焩烄𡡅鵭貟賩𧷜妚矃姰䍮㛔踪躧𤰉輰轊䋴汘澻𢌡䢛潹溋𡟚鯩㚵𤤯邻邗啱䤆醻鐄𨩋䁢𨫼鐧𨰝𨰻蓥訫閙閧閗閖𨴴瑅㻂𤣿𤩂𤏪㻧𣈥随𨻧𨹦𨹥㻌𤧭𤩸𣿮琒瑫㻼靁𩂰"
  ],
  [
    "9640",
    "桇䨝𩂓𥟟靝鍨𨦉𨰦𨬯𦎾銺嬑譩䤼珹𤈛鞛靱餸𠼦巁𨯅𤪲頟𩓚鋶𩗗釥䓀𨭐𤩧𨭤飜𨩅㼀鈪䤥萔餻饍𧬆㷽馛䭯馪驜𨭥𥣈檏騡嫾騯𩣱䮐𩥈馼䮽䮗鍽塲𡌂堢𤦸"
  ],
  [
    "96a1",
    "𡓨硄𢜟𣶸棅㵽鑘㤧慐𢞁𢥫愇鱏鱓鱻鰵鰐魿鯏𩸭鮟𪇵𪃾鴡䲮𤄄鸘䲰鴌𪆴𪃭𪃳𩤯鶥蒽𦸒𦿟𦮂藼䔳𦶤𦺄𦷰萠藮𦸀𣟗𦁤秢𣖜𣙀䤭𤧞㵢鏛銾鍈𠊿碹鉷鑍俤㑀遤𥕝砽硔碶硋𡝗𣇉𤥁㚚佲濚濙瀞瀞吔𤆵垻壳垊鴖埗焴㒯𤆬燫𦱀𤾗嬨𡞵𨩉"
  ],
  [
    "9740",
    "愌嫎娋䊼𤒈㜬䭻𨧼鎻鎸𡣖𠼝葲𦳀𡐓𤋺𢰦𤏁妔𣶷𦝁綨𦅛𦂤𤦹𤦋𨧺鋥珢㻩璴𨭣𡢟㻡𤪳櫘珳珻㻖𤨾𤪔𡟙𤩦𠎧𡐤𤧥瑈𤤖炥𤥶銄珦鍟𠓾錱𨫎𨨖鎆𨯧𥗕䤵𨪂煫"
  ],
  [
    "97a1",
    "𤥃𠳿嚤𠘚𠯫𠲸唂秄𡟺緾𡛂𤩐𡡒䔮鐁㜊𨫀𤦭妰𡢿𡢃𧒄媡㛢𣵛㚰鉟婹𨪁𡡢鍴㳍𠪴䪖㦊僴㵩㵌𡎜煵䋻𨈘渏𩃤䓫浗𧹏灧沯㳖𣿭𣸭渂漌㵯𠏵畑㚼㓈䚀㻚䡱姄鉮䤾轁𨰜𦯀堒埈㛖𡑒烾𤍢𤩱𢿣𡊰𢎽梹楧𡎘𣓥𧯴𣛟𨪃𣟖𣏺𤲟樚𣚭𦲷萾䓟䓎"
  ],
  [
    "9840",
    "𦴦𦵑𦲂𦿞漗𧄉茽𡜺菭𦲀𧁓𡟛妉媂𡞳婡婱𡤅𤇼㜭姯𡜼㛇熎鎐暚𤊥婮娫𤊓樫𣻹𧜶𤑛𤋊焝𤉙𨧡侰𦴨峂𤓎𧹍𤎽樌𤉖𡌄炦焳𤏩㶥泟勇𤩏繥姫崯㷳彜𤩝𡟟綤萦"
  ],
  [
    "98a1",
    "咅𣫺𣌀𠈔坾𠣕𠘙㿥𡾞𪊶瀃𩅛嵰玏糓𨩙𩐠俈翧狍猐𧫴猸猹𥛶獁獈㺩𧬘遬燵𤣲珡臶㻊県㻑沢国琙琞琟㻢㻰㻴㻺瓓㼎㽓畂畭畲疍㽼痈痜㿀癍㿗癴㿜発𤽜熈嘣覀塩䀝睃䀹条䁅㗛瞘䁪䁯属瞾矋売砘点砜䂨砹硇硑硦葈𥔵礳栃礲䄃"
  ],
  [
    "9940",
    "䄉禑禙辻稆込䅧窑䆲窼艹䇄竏竛䇏両筢筬筻簒簛䉠䉺类粜䊌粸䊔糭输烀𠳏総緔緐緽羮羴犟䎗耠耥笹耮耱联㷌垴炠肷胩䏭脌猪脎脒畠脔䐁㬹腖腙腚"
  ],
  [
    "99a1",
    "䐓堺腼膄䐥膓䐭膥埯臁臤艔䒏芦艶苊苘苿䒰荗险榊萅烵葤惣蒈䔄蒾蓡蓸蔐蔸蕒䔻蕯蕰藠䕷虲蚒蚲蛯际螋䘆䘗袮裿褤襇覑𧥧訩訸誔誴豑賔賲贜䞘塟跃䟭仮踺嗘坔蹱嗵躰䠷軎転軤軭軲辷迁迊迌逳駄䢭飠鈓䤞鈨鉘鉫銱銮銿"
  ],
  [
    "9a40",
    "鋣鋫鋳鋴鋽鍃鎄鎭䥅䥑麿鐗匁鐝鐭鐾䥪鑔鑹锭関䦧间阳䧥枠䨤靀䨵鞲韂噔䫤惨颹䬙飱塄餎餙冴餜餷饂饝饢䭰駅䮝騼鬏窃魩鮁鯝鯱鯴䱭鰠㝯𡯂鵉鰺"
  ],
  [
    "9aa1",
    "黾噐鶓鶽鷀鷼银辶鹻麬麱麽黆铜黢黱黸竈齄𠂔𠊷𠎠椚铃妬𠓗塀铁㞹𠗕𠘕𠙶𡚺块煳𠫂𠫍𠮿呪吆𠯋咞𠯻𠰻𠱓𠱥𠱼惧𠲍噺𠲵𠳝𠳭𠵯𠶲𠷈楕鰯螥𠸄𠸎𠻗𠾐𠼭𠹳尠𠾼帋𡁜𡁏𡁶朞𡁻𡂈𡂖㙇𡂿𡃓𡄯𡄻卤蒭𡋣𡍵𡌶讁𡕷𡘙𡟃𡟇乸炻𡠭𡥪"
  ],
  [
    "9b40",
    "𡨭𡩅𡰪𡱰𡲬𡻈拃𡻕𡼕熘桕𢁅槩㛈𢉼𢏗𢏺𢜪𢡱𢥏苽𢥧𢦓𢫕覥𢫨辠𢬎鞸𢬿顇骽𢱌"
  ],
  [
    "9b62",
    "𢲈𢲷𥯨𢴈𢴒𢶷𢶕𢹂𢽴𢿌𣀳𣁦𣌟𣏞徱晈暿𧩹𣕧𣗳爁𤦺矗𣘚𣜖纇𠍆墵朎"
  ],
  [
    "9ba1",
    "椘𣪧𧙗𥿢𣸑𣺹𧗾𢂚䣐䪸𤄙𨪚𤋮𤌍𤀻𤌴𤎖𤩅𠗊凒𠘑妟𡺨㮾𣳿𤐄𤓖垈𤙴㦛𤜯𨗨𩧉㝢𢇃譞𨭎駖𤠒𤣻𤨕爉𤫀𠱸奥𤺥𤾆𠝹軚𥀬劏圿煱𥊙𥐙𣽊𤪧喼𥑆𥑮𦭒釔㑳𥔿𧘲𥕞䜘𥕢𥕦𥟇𤤿𥡝偦㓻𣏌惞𥤃䝼𨥈𥪮𥮉𥰆𡶐垡煑澶𦄂𧰒遖𦆲𤾚譢𦐂𦑊"
  ],
  [
    "9c40",
    "嵛𦯷輶𦒄𡤜諪𤧶𦒈𣿯𦔒䯀𦖿𦚵𢜛鑥𥟡憕娧晉侻嚹𤔡𦛼乪𤤴陖涏𦲽㘘襷𦞙𦡮𦐑𦡞營𦣇筂𩃀𠨑𦤦鄄𦤹穅鷰𦧺騦𦨭㙟𦑩𠀡禃𦨴𦭛崬𣔙菏𦮝䛐𦲤画补𦶮墶"
  ],
  [
    "9ca1",
    "㜜𢖍𧁋𧇍㱔𧊀𧊅銁𢅺𧊋錰𧋦𤧐氹钟𧑐𠻸蠧裵𢤦𨑳𡞱溸𤨪𡠠㦤㚹尐秣䔿暶𩲭𩢤襃𧟌𧡘囖䃟𡘊㦡𣜯𨃨𡏅熭荦𧧝𩆨婧䲷𧂯𨦫𧧽𧨊𧬋𧵦𤅺筃祾𨀉澵𪋟樃𨌘厢𦸇鎿栶靝𨅯𨀣𦦵𡏭𣈯𨁈嶅𨰰𨂃圕頣𨥉嶫𤦈斾槕叒𤪥𣾁㰑朶𨂐𨃴𨄮𡾡𨅏"
  ],
  [
    "9d40",
    "𨆉𨆯𨈚𨌆𨌯𨎊㗊𨑨𨚪䣺揦𨥖砈鉕𨦸䏲𨧧䏟𨧨𨭆𨯔姸𨰉輋𨿅𩃬筑𩄐𩄼㷷𩅞𤫊运犏嚋𩓧𩗩𩖰𩖸𩜲𩣑𩥉𩥪𩧃𩨨𩬎𩵚𩶛纟𩻸𩼣䲤镇𪊓熢𪋿䶑递𪗋䶜𠲜达嗁"
  ],
  [
    "9da1",
    "辺𢒰边𤪓䔉繿潖檱仪㓤𨬬𧢝㜺躀𡟵𨀤𨭬𨮙𧨾𦚯㷫𧙕𣲷𥘵𥥖亚𥺁𦉘嚿𠹭踎孭𣺈𤲞揞拐𡟶𡡻攰嘭𥱊吚𥌑㷆𩶘䱽嘢嘞罉𥻘奵𣵀蝰东𠿪𠵉𣚺脗鵞贘瘻鱅癎瞹鍅吲腈苷嘥脲萘肽嗪祢噃吖𠺝㗎嘅嗱曱𨋢㘭甴嗰喺咗啲𠱁𠲖廐𥅈𠹶𢱢"
  ],
  [
    "9e40",
    "𠺢麫絚嗞𡁵抝靭咔賍燶酶揼掹揾啩𢭃鱲𢺳冚㓟𠶧冧呍唞唓癦踭𦢊疱肶蠄螆裇膶萜𡃁䓬猄𤜆宐茋𦢓噻𢛴𧴯𤆣𧵳𦻐𧊶酰𡇙鈈𣳼𪚩𠺬𠻹牦𡲢䝎𤿂𧿹𠿫䃺"
  ],
  [
    "9ea1",
    "鱝攟𢶠䣳𤟠𩵼𠿬𠸊恢𧖣𠿭"
  ],
  [
    "9ead",
    "𦁈𡆇熣纎鵐业丄㕷嬍沲卧㚬㧜卽㚥𤘘墚𤭮舭呋垪𥪕𠥹"
  ],
  [
    "9ec5",
    "㩒𢑥獴𩺬䴉鯭𣳾𩼰䱛𤾩𩖞𩿞葜𣶶𧊲𦞳𣜠挮紥𣻷𣸬㨪逈勌㹴㙺䗩𠒎癀嫰𠺶硺𧼮墧䂿噼鮋嵴癔𪐴麅䳡痹㟻愙𣃚𤏲"
  ],
  [
    "9ef5",
    "噝𡊩垧𤥣𩸆刴𧂮㖭汊鵼"
  ],
  [
    "9f40",
    "籖鬹埞𡝬屓擓𩓐𦌵𧅤蚭𠴨𦴢𤫢𠵱"
  ],
  [
    "9f4f",
    "凾𡼏嶎霃𡷑麁遌笟鬂峑箣扨挵髿篏鬪籾鬮籂粆鰕篼鬉鼗鰛𤤾齚啳寃俽麘俲剠㸆勑坧偖妷帒韈鶫轜呩鞴饀鞺匬愰"
  ],
  [
    "9fa1",
    "椬叚鰊鴂䰻陁榀傦畆𡝭駚剳"
  ],
  [
    "9fae",
    "酙隁酜"
  ],
  [
    "9fb2",
    "酑𨺗捿𦴣櫊嘑醎畺抅𠏼獏籰𥰡𣳽"
  ],
  [
    "9fc1",
    "𤤙盖鮝个𠳔莾衂"
  ],
  [
    "9fc9",
    "届槀僭坺刟巵从氱𠇲伹咜哚劚趂㗾弌㗳"
  ],
  [
    "9fdb",
    "歒酼龥鮗頮颴骺麨麄煺笔"
  ],
  [
    "9fe7",
    "毺蠘罸"
  ],
  [
    "9feb",
    "嘠𪙊蹷齓"
  ],
  [
    "9ff0",
    "跔蹏鸜踁抂𨍽踨蹵竓𤩷稾磘泪詧瘇"
  ],
  [
    "a040",
    "𨩚鼦泎蟖痃𪊲硓咢贌狢獱謭猂瓱賫𤪻蘯徺袠䒷"
  ],
  [
    "a055",
    "𡠻𦸅"
  ],
  [
    "a058",
    "詾𢔛"
  ],
  [
    "a05b",
    "惽癧髗鵄鍮鮏蟵"
  ],
  [
    "a063",
    "蠏賷猬霡鮰㗖犲䰇籑饊𦅙慙䰄麖慽"
  ],
  [
    "a073",
    "坟慯抦戹拎㩜懢厪𣏵捤栂㗒"
  ],
  [
    "a0a1",
    "嵗𨯂迚𨸹"
  ],
  [
    "a0a6",
    "僙𡵆礆匲阸𠼻䁥"
  ],
  [
    "a0ae",
    "矾"
  ],
  [
    "a0b0",
    "糂𥼚糚稭聦聣絍甅瓲覔舚朌聢𧒆聛瓰脃眤覉𦟌畓𦻑螩蟎臈螌詉貭譃眫瓸蓚㘵榲趦"
  ],
  [
    "a0d4",
    "覩瑨涹蟁𤀑瓧㷛煶悤憜㳑煢恷"
  ],
  [
    "a0e2",
    "罱𨬭牐惩䭾删㰘𣳇𥻗𧙖𥔱𡥄𡋾𩤃𦷜𧂭峁𦆭𨨏𣙷𠃮𦡆𤼎䕢嬟𦍌齐麦𦉫"
  ],
  [
    "a3c0",
    "␀",
    31,
    "␡"
  ],
  [
    "c6a1",
    "①",
    9,
    "⑴",
    9,
    "ⅰ",
    9,
    "丶丿亅亠冂冖冫勹匸卩厶夊宀巛⼳广廴彐彡攴无疒癶辵隶¨ˆヽヾゝゞ〃仝々〆〇ー［］✽ぁ",
    23
  ],
  [
    "c740",
    "す",
    58,
    "ァアィイ"
  ],
  [
    "c7a1",
    "ゥ",
    81,
    "А",
    5,
    "ЁЖ",
    4
  ],
  [
    "c840",
    "Л",
    26,
    "ёж",
    25,
    "⇧↸↹㇏𠃌乚𠂊刂䒑"
  ],
  [
    "c8a1",
    "龰冈龱𧘇"
  ],
  [
    "c8cd",
    "￢￤＇＂㈱№℡゛゜⺀⺄⺆⺇⺈⺊⺌⺍⺕⺜⺝⺥⺧⺪⺬⺮⺶⺼⺾⻆⻊⻌⻍⻏⻖⻗⻞⻣"
  ],
  [
    "c8f5",
    "ʃɐɛɔɵœøŋʊɪ"
  ],
  [
    "f9fe",
    "￭"
  ],
  [
    "fa40",
    "𠕇鋛𠗟𣿅蕌䊵珯况㙉𤥂𨧤鍄𡧛苮𣳈砼杄拟𤤳𨦪𠊠𦮳𡌅侫𢓭倈𦴩𧪄𣘀𤪱𢔓倩𠍾徤𠎀𠍇滛𠐟偽儁㑺儎顬㝃萖𤦤𠒇兠𣎴兪𠯿𢃼𠋥𢔰𠖎𣈳𡦃宂蝽𠖳𣲙冲冸"
  ],
  [
    "faa1",
    "鴴凉减凑㳜凓𤪦决凢卂凭菍椾𣜭彻刋刦刼劵剗劔効勅簕蕂勠蘍𦬓包𨫞啉滙𣾀𠥔𣿬匳卄𠯢泋𡜦栛珕恊㺪㣌𡛨燝䒢卭却𨚫卾卿𡖖𡘓矦厓𨪛厠厫厮玧𥝲㽙玜叁叅汉义埾叙㪫𠮏叠𣿫𢶣叶𠱷吓灹唫晗浛呭𦭓𠵴啝咏咤䞦𡜍𠻝㶴𠵍"
  ],
  [
    "fb40",
    "𨦼𢚘啇䳭启琗喆喩嘅𡣗𤀺䕒𤐵暳𡂴嘷曍𣊊暤暭噍噏磱囱鞇叾圀囯园𨭦㘣𡉏坆𤆥汮炋坂㚱𦱾埦𡐖堃𡑔𤍣堦𤯵塜墪㕡壠壜𡈼壻寿坃𪅐𤉸鏓㖡够梦㛃湙"
  ],
  [
    "fba1",
    "𡘾娤啓𡚒蔅姉𠵎𦲁𦴪𡟜姙𡟻𡞲𦶦浱𡠨𡛕姹𦹅媫婣㛦𤦩婷㜈媖瑥嫓𦾡𢕔㶅𡤑㜲𡚸広勐孶斈孼𧨎䀄䡝𠈄寕慠𡨴𥧌𠖥寳宝䴐尅𡭄尓珎尔𡲥𦬨屉䣝岅峩峯嶋𡷹𡸷崐崘嵆𡺤岺巗苼㠭𤤁𢁉𢅳芇㠶㯂帮檊幵幺𤒼𠳓厦亷廐厨𡝱帉廴𨒂"
  ],
  [
    "fc40",
    "廹廻㢠廼栾鐛弍𠇁弢㫞䢮𡌺强𦢈𢏐彘𢑱彣鞽𦹮彲鍀𨨶徧嶶㵟𥉐𡽪𧃸𢙨釖𠊞𨨩怱暅𡡷㥣㷇㘹垐𢞴祱㹀悞悤悳𤦂𤦏𧩓璤僡媠慤萤慂慈𦻒憁凴𠙖憇宪𣾷"
  ],
  [
    "fca1",
    "𢡟懓𨮝𩥝懐㤲𢦀𢣁怣慜攞掋𠄘担𡝰拕𢸍捬𤧟㨗搸揸𡎎𡟼撐澊𢸶頔𤂌𥜝擡擥鑻㩦携㩗敍漖𤨨𤨣斅敭敟𣁾斵𤥀䬷旑䃘𡠩无旣忟𣐀昘𣇷𣇸晄𣆤𣆥晋𠹵晧𥇦晳晴𡸽𣈱𨗴𣇈𥌓矅𢣷馤朂𤎜𤨡㬫槺𣟂杞杧杢𤇍𩃭柗䓩栢湐鈼栁𣏦𦶠桝"
  ],
  [
    "fd40",
    "𣑯槡樋𨫟楳棃𣗍椁椀㴲㨁𣘼㮀枬楡𨩊䋼椶榘㮡𠏉荣傐槹𣙙𢄪橅𣜃檝㯳枱櫈𩆜㰍欝𠤣惞欵歴𢟍溵𣫛𠎵𡥘㝀吡𣭚毡𣻼毜氷𢒋𤣱𦭑汚舦汹𣶼䓅𣶽𤆤𤤌𤤀"
  ],
  [
    "fda1",
    "𣳉㛥㳫𠴲鮃𣇹𢒑羏样𦴥𦶡𦷫涖浜湼漄𤥿𤂅𦹲蔳𦽴凇沜渝萮𨬡港𣸯瑓𣾂秌湏媑𣁋濸㜍澝𣸰滺𡒗𤀽䕕鏰潄潜㵎潴𩅰㴻澟𤅄濓𤂑𤅕𤀹𣿰𣾴𤄿凟𤅖𤅗𤅀𦇝灋灾炧炁烌烕烖烟䄄㷨熴熖𤉷焫煅媈煊煮岜𤍥煏鍢𤋁焬𤑚𤨧𤨢熺𨯨炽爎"
  ],
  [
    "fe40",
    "鑂爕夑鑃爤鍁𥘅爮牀𤥴梽牕牗㹕𣁄栍漽犂猪猫𤠣𨠫䣭𨠄猨献珏玪𠰺𦨮珉瑉𤇢𡛧𤨤昣㛅𤦷𤦍𤧻珷琕椃𤨦琹𠗃㻗瑜𢢭瑠𨺲瑇珤瑶莹瑬㜰瑴鏱樬璂䥓𤪌"
  ],
  [
    "fea1",
    "𤅟𤩹𨮏孆𨰃𡢞瓈𡦈甎瓩甞𨻙𡩋寗𨺬鎅畍畊畧畮𤾂㼄𤴓疎瑝疞疴瘂瘬癑癏癯癶𦏵皐臯㟸𦤑𦤎皡皥皷盌𦾟葢𥂝𥅽𡸜眞眦着撯𥈠睘𣊬瞯𨥤𨥨𡛁矴砉𡍶𤨒棊碯磇磓隥礮𥗠磗礴碱𧘌辸袄𨬫𦂃𢘜禆褀椂禀𥡗禝𧬹礼禩渪𧄦㺨秆𩄍秔"
  ]
];
var Iv, TT;
function mz() {
  return TT || (TT = 1, Iv = {
    // == Japanese/ShiftJIS ====================================================
    // All japanese encodings are based on JIS X set of standards:
    // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF.
    // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. 
    //              Has several variations in 1978, 1983, 1990 and 1997.
    // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead.
    // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233.
    //              2 planes, first is superset of 0208, second - revised 0212.
    //              Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx)
    // Byte encodings are:
    //  * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte
    //               encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC.
    //               Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI.
    //  * EUC-JP:    Up to 3 bytes per character. Used mostly on *nixes.
    //               0x00-0x7F       - lower part of 0201
    //               0x8E, 0xA1-0xDF - upper part of 0201
    //               (0xA1-0xFE)x2   - 0208 plane (94x94).
    //               0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94).
    //  * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon.
    //               Used as-is in ISO2022 family.
    //  * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, 
    //                0201-1976 Roman, 0208-1978, 0208-1983.
    //  * ISO2022-JP-1: Adds esc seq for 0212-1990.
    //  * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7.
    //  * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2.
    //  * ISO2022-JP-2004: Adds 0213-2004 Plane 1.
    //
    // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes.
    //
    // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html
    shiftjis: {
      type: "_dbcs",
      table: function() {
        return cz;
      },
      encodeAdd: { "¥": 92, "‾": 126 },
      encodeSkipVals: [{ from: 60736, to: 63808 }]
    },
    csshiftjis: "shiftjis",
    mskanji: "shiftjis",
    sjis: "shiftjis",
    windows31j: "shiftjis",
    ms31j: "shiftjis",
    xsjis: "shiftjis",
    windows932: "shiftjis",
    ms932: "shiftjis",
    932: "shiftjis",
    cp932: "shiftjis",
    eucjp: {
      type: "_dbcs",
      table: function() {
        return uz;
      },
      encodeAdd: { "¥": 92, "‾": 126 }
    },
    // TODO: KDDI extension to Shift_JIS
    // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes.
    // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars.
    // == Chinese/GBK ==========================================================
    // http://en.wikipedia.org/wiki/GBK
    // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder
    // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936
    gb2312: "cp936",
    gb231280: "cp936",
    gb23121980: "cp936",
    csgb2312: "cp936",
    csiso58gb231280: "cp936",
    euccn: "cp936",
    // Microsoft's CP936 is a subset and approximation of GBK.
    windows936: "cp936",
    ms936: "cp936",
    936: "cp936",
    cp936: {
      type: "_dbcs",
      table: function() {
        return Av;
      }
    },
    // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other.
    gbk: {
      type: "_dbcs",
      table: function() {
        return Av.concat(IT);
      }
    },
    xgbk: "gbk",
    isoir58: "gbk",
    // GB18030 is an algorithmic extension of GBK.
    // Main source: https://www.w3.org/TR/encoding/#gbk-encoder
    // http://icu-project.org/docs/papers/gb18030.html
    // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml
    // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0
    gb18030: {
      type: "_dbcs",
      table: function() {
        return Av.concat(IT);
      },
      gb18030: function() {
        return dz;
      },
      encodeSkipVals: [128],
      encodeAdd: { "€": 41699 }
    },
    chinese: "gb18030",
    // == Korean ===============================================================
    // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same.
    windows949: "cp949",
    ms949: "cp949",
    949: "cp949",
    cp949: {
      type: "_dbcs",
      table: function() {
        return fz;
      }
    },
    cseuckr: "cp949",
    csksc56011987: "cp949",
    euckr: "cp949",
    isoir149: "cp949",
    korean: "cp949",
    ksc56011987: "cp949",
    ksc56011989: "cp949",
    ksc5601: "cp949",
    // == Big5/Taiwan/Hong Kong ================================================
    // There are lots of tables for Big5 and cp950. Please see the following links for history:
    // http://moztw.org/docs/big5/  http://www.haible.de/bruno/charsets/conversion-tables/Big5.html
    // Variations, in roughly number of defined chars:
    //  * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT
    //  * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/
    //  * Big5-2003 (Taiwan standard) almost superset of cp950.
    //  * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers.
    //  * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. 
    //    many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years.
    //    Plus, it has 4 combining sequences.
    //    Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299
    //    because big5-hkscs is the only encoding to include astral characters in non-algorithmic way.
    //    Implementations are not consistent within browsers; sometimes labeled as just big5.
    //    MS Internet Explorer switches from big5 to big5-hkscs when a patch applied.
    //    Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31
    //    In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s.
    //    Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt
    //                   http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt
    // 
    // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder
    // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong.
    windows950: "cp950",
    ms950: "cp950",
    950: "cp950",
    cp950: {
      type: "_dbcs",
      table: function() {
        return CT;
      }
    },
    // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus.
    big5: "big5hkscs",
    big5hkscs: {
      type: "_dbcs",
      table: function() {
        return CT.concat(hz);
      },
      encodeSkipVals: [41676]
    },
    cnbig5: "big5hkscs",
    csbig5: "big5hkscs",
    xxbig5: "big5hkscs"
  }), Iv;
}
var kT;
function gz() {
  return kT || (kT = 1, (function(t) {
    for (var e = [
      ez(),
      tz(),
      nz(),
      rz(),
      iz(),
      oz(),
      sz(),
      az(),
      mz()
    ], n = 0; n < e.length; n++) {
      var r = e[n];
      for (var i in r)
        Object.prototype.hasOwnProperty.call(r, i) && (t[i] = r[i]);
    }
  })(bv)), bv;
}
const yz = {}, vz = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  default: yz
}, Symbol.toStringTag, { value: "Module" })), NT = /* @__PURE__ */ NO(vz);
var PT;
function bz() {
  return PT || (PT = 1, (function(t) {
    var e = gc().Buffer, n = ZW(), r = t.exports;
    r.encodings = null, r.defaultCharUnicode = "�", r.defaultCharSingleByte = "?", r.encode = function(a, c, u) {
      a = "" + (a || "");
      var l = r.getEncoder(c, u), d = l.write(a), f = l.end();
      return f && f.length > 0 ? e.concat([d, f]) : d;
    }, r.decode = function(a, c, u) {
      typeof a == "string" && (r.skipDecodeWarning || (console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding"), r.skipDecodeWarning = !0), a = e.from("" + (a || ""), "binary"));
      var l = r.getDecoder(c, u), d = l.write(a), f = l.end();
      return f ? d + f : d;
    }, r.encodingExists = function(a) {
      try {
        return r.getCodec(a), !0;
      } catch {
        return !1;
      }
    }, r.toEncoding = r.encode, r.fromEncoding = r.decode, r._codecDataCache = {}, r.getCodec = function(a) {
      r.encodings || (r.encodings = gz());
      for (var c = r._canonicalizeEncoding(a), u = {}; ; ) {
        var l = r._codecDataCache[c];
        if (l)
          return l;
        var d = r.encodings[c];
        switch (typeof d) {
          case "string":
            c = d;
            break;
          case "object":
            for (var f in d)
              u[f] = d[f];
            u.encodingName || (u.encodingName = c), c = d.type;
            break;
          case "function":
            return u.encodingName || (u.encodingName = c), l = new d(u, r), r._codecDataCache[u.encodingName] = l, l;
          default:
            throw new Error("Encoding not recognized: '" + a + "' (searched as: '" + c + "')");
        }
      }
    }, r._canonicalizeEncoding = function(s) {
      return ("" + s).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, "");
    }, r.getEncoder = function(a, c) {
      var u = r.getCodec(a), l = new u.encoder(c, u);
      return u.bomAware && c && c.addBOM && (l = new n.PrependBOM(l, c)), l;
    }, r.getDecoder = function(a, c) {
      var u = r.getCodec(a), l = new u.decoder(c, u);
      return u.bomAware && !(c && c.stripBOM === !1) && (l = new n.StripBOM(l, c)), l;
    };
    var i = typeof process < "u" && process.versions && process.versions.node;
    if (i) {
      var o = i.split(".").map(Number);
      (o[0] > 0 || o[1] >= 10) && NT(r), NT(r);
    }
  })(yv)), yv.exports;
}
var Cv, DT;
function xz() {
  if (DT) return Cv;
  DT = 1;
  const t = JW(), e = ir, n = XW(), r = pi();
  let i;
  const o = Symbol("ZipUncompressStream#yauzlCallback"), s = Symbol("ZipUncompressStream#stripName"), a = { lazyEntries: !0, decodeStrings: !1 };
  function c(l) {
    const d = l.externalFileAttributes >> 16 || 33188;
    return [
      448,
      56,
      7
      /* S_IRWXO */
    ].map((f) => d & f).reduce(
      (f, m) => f + m,
      d & 61440
      /* S_IFMT */
    );
  }
  class u extends n {
    constructor(d) {
      d = d || {}, super(d), this._chunks = [], this._strip = Number(d.strip) || 0, this._zipFileNameEncoding = d.zipFileNameEncoding || "utf8", this._zipFileNameEncoding === "utf-8" && (this._zipFileNameEncoding = "utf8"), this[o] = this[o].bind(this);
      const f = r.sourceType(d.source), m = this._yauzlOpts = Object.assign({}, a, d.yauzl);
      if (f === "file") {
        t.open(d.source, m, this[o]);
        return;
      }
      if (f === "buffer") {
        t.fromBuffer(d.source, m, this[o]);
        return;
      }
      if (f === "stream") {
        r.streamToBuffer(d.source).then((h) => t.fromBuffer(h, m, this[o])).catch((h) => this.emit("error", h));
        return;
      }
      this.on("pipe", (h) => {
        h.unpipe(h), r.streamToBuffer(h).then((y) => {
          this._chunks.push(y), y = Buffer.concat(this._chunks), t.fromBuffer(y, m, this[o]);
        }).catch((y) => this.emit("error", y));
      });
    }
    _write(d) {
      this._chunks.push(d);
    }
    [o](d, f) {
      if (d) return this.emit("error", d);
      f.readEntry(), f.on("entry", (h) => {
        const y = c(h);
        Buffer.isBuffer(h.fileName) && (this._zipFileNameEncoding === "utf8" ? h.fileName = h.fileName.toString() : (i || (i = bz()), h.fileName = i.decode(h.fileName, this._zipFileNameEncoding)));
        const x = /[\\\/]$/.test(h.fileName) ? "directory" : "file", v = { name: h.fileName = this[s](h.fileName, x), type: x, yauzl: h, mode: y };
        if (x === "file")
          f.openReadStream(h, (S, E) => {
            if (S) return this.emit("error", S);
            this.emit("entry", v, E, m);
          });
        else {
          const S = new e.Readable({ read() {
          } });
          this.emit("entry", v, S, m), setImmediate(() => S.emit("end"));
        }
      }).on("end", () => this.emit("finish")).on("error", (h) => this.emit("error", h));
      function m() {
        f.readEntry();
      }
    }
    [s](d, f) {
      return r.stripFileName(this._strip, d, f);
    }
  }
  return Cv = u, Cv;
}
var FT;
function wz() {
  if (FT) return Go;
  FT = 1;
  const t = pi(), e = zW(), n = KW(), r = xz();
  return Go.Stream = e, Go.FileStream = n, Go.UncompressStream = r, Go.compressDir = t.makeCompressDirFn(e), Go.compressFile = t.makeFileProcessFn(n), Go.uncompress = t.makeUncompressFn(r), Go.decompress = t.makeUncompressFn(r), Go;
}
var ka = {}, Tv = {}, OT;
function Vg() {
  if (OT) return Tv;
  OT = 1;
  var t = _n, e = ir;
  Tv.createReadStream = function(r, i) {
    return new n(r, i);
  };
  var n = function(r, i) {
    r instanceof Buffer || typeof r == "string" ? (i = i || {}, e.Readable.call(this, {
      highWaterMark: i.highWaterMark,
      encoding: i.encoding
    })) : e.Readable.call(this, { objectMode: !0 }), this._object = r;
  };
  return t.inherits(n, e.Readable), n.prototype._read = function() {
    this.push(this._object), this._object = null;
  }, Tv;
}
var kv, MT;
function Sz() {
  if (MT) return kv;
  MT = 1;
  const t = de, e = qu, n = pi(), r = Vg();
  class i extends e.Gzip {
    constructor(s) {
      s = s || {}, super(s.zlib);
      const a = n.sourceType(s.source);
      if (a === "file") {
        const c = t.createReadStream(s.source, s.fs);
        c.on("error", (u) => this.emit("error", u)), c.pipe(this);
        return;
      }
      if (a === "buffer") {
        const c = r.createReadStream(s.source, s.streamifier);
        c.on("error", (u) => this.emit("error", u)), c.pipe(this);
        return;
      }
      a === "stream" && (s.source.on("error", (c) => this.emit("error", c)), s.source.pipe(this));
    }
  }
  return kv = i, kv;
}
var Nv, RT;
function _z() {
  if (RT) return Nv;
  RT = 1;
  const t = de, e = qu, n = pi(), r = Vg();
  class i extends e.Unzip {
    constructor(s) {
      s = s || {}, super(s.zlib);
      const a = n.sourceType(s.source);
      if (a === "file") {
        const c = t.createReadStream(s.source, s.fs);
        c.on("error", (u) => this.emit("error", u)), c.pipe(this);
        return;
      }
      if (a === "buffer") {
        const c = r.createReadStream(s.source, s.streamifier);
        c.on("error", (u) => this.emit("error", u)), c.pipe(this);
        return;
      }
      a === "stream" && (s.source.on("error", (c) => this.emit("error", c)), s.source.pipe(this));
    }
  }
  return Nv = i, Nv;
}
var BT;
function Yg() {
  if (BT) return ka;
  BT = 1;
  const t = pi(), e = Sz(), n = _z();
  return ka.FileStream = e, ka.UncompressStream = n, ka.compressFile = t.makeFileProcessFn(e), ka.uncompress = t.makeFileProcessFn(n), ka.decompress = t.makeFileProcessFn(n), ka;
}
var Ho = {}, Pv, UT;
function Ez() {
  if (UT) return Pv;
  UT = 1;
  const t = de, e = be, n = ir, r = AE(), i = pi(), o = Kg();
  class s extends n.Transform {
    constructor(c) {
      super(c);
      const u = r.pack();
      u.on("data", (d) => this.push(d)), u.on("end", () => this.ready(!0));
      const l = i.sourceType(c.source);
      if (l === "file")
        t.stat(c.source, (d, f) => {
          if (d) return this.emit("error", d);
          this.entry = u.entry({ name: c.relativePath || e.basename(c.source), size: f.size, mode: f.mode & 511 }, (h) => {
            if (h) return this.emit("error", h);
            u.finalize();
          });
          const m = t.createReadStream(c.source, c.fs);
          m.on("error", (h) => this.emit("error", h)), m.pipe(this);
        });
      else if (l === "buffer") {
        if (!c.relativePath) return this.emit("error", "opts.relativePath is required if opts.source is a buffer");
        u.entry({ name: c.relativePath }, c.source), u.finalize(), this.end();
      } else {
        if (!c.relativePath) return process.nextTick(() => this.emit("error", "opts.relativePath is required"));
        if (c.size)
          this.entry = u.entry({ name: c.relativePath, size: c.size }, (d) => {
            if (d) return this.emit("error", d);
            u.finalize();
          });
        else {
          c.suppressSizeWarning || console.warn("You should specify the size of streamming data by opts.size to prevent all streaming data from loading into memory. If you are sure about memory cost, pass opts.suppressSizeWarning: true to suppress this warning");
          const d = [];
          this.entry = new n.Writable({
            write(f, m, h) {
              d.push(f), h();
            }
          }), this.entry.on("finish", () => {
            u.entry({ name: c.relativePath }, Buffer.concat(d)), u.finalize();
          });
        }
        l === "stream" && (c.source.on("error", (d) => this.emit("error", d)), c.source.pipe(this));
      }
    }
    _transform(c, u, l) {
      this.entry && this.entry.write(c, u, l);
    }
    _flush(c) {
      this.entry && this.entry.end(), this.ready(c);
    }
  }
  return o.mixin(s.prototype), Pv = s, Pv;
}
var Dv, LT;
function Az() {
  if (LT) return Dv;
  LT = 1;
  const t = de, e = AE(), n = pi(), r = Vg();
  class i extends e.extract {
    constructor(s) {
      s = s || {}, super(s);
      const a = n.sourceType(s.source);
      if (a === "file") {
        const c = t.createReadStream(s.source, s.fs);
        c.on("error", (u) => this.emit("error", u)), c.pipe(this);
        return;
      }
      if (a === "buffer") {
        const c = r.createReadStream(s.source, s.streamifier);
        c.on("error", (u) => this.emit("error", u)), c.pipe(this);
        return;
      }
      a === "stream" && (s.source.on("error", (c) => this.emit("error", c)), s.source.pipe(this));
    }
  }
  return Dv = i, Dv;
}
var jT;
function Jg() {
  if (jT) return Ho;
  jT = 1;
  const t = pi(), e = _8(), n = Ez(), r = Az();
  return Ho.Stream = e, Ho.FileStream = n, Ho.UncompressStream = r, Ho.compressDir = t.makeCompressDirFn(e), Ho.compressFile = t.makeFileProcessFn(n), Ho.uncompress = t.makeUncompressFn(r), Ho.decompress = t.makeUncompressFn(r), Ho;
}
var Wo = {}, Fv, QT;
function Iz() {
  if (QT) return Fv;
  QT = 1;
  const t = Jg(), e = Yg(), n = S8();
  class r extends n {
    constructor(o) {
      super(o);
      const s = this._tarStream = new t.Stream();
      s.on("error", (c) => this.emit("error", c));
      const a = new e.FileStream();
      a.on("end", () => this.push(null)), a.on("data", (c) => this.push(c)), a.on("error", (c) => this.emit("error", c)), s.pipe(a);
    }
    addEntry(o, s) {
      this._tarStream.addEntry(o, s);
    }
  }
  return Fv = r, Fv;
}
var Ov, $T;
function Cz() {
  if ($T) return Ov;
  $T = 1;
  const t = Jg(), e = Yg(), n = pi(), r = ir, i = e8(), o = Kg();
  class s extends r.Transform {
    constructor(c) {
      c = c || {}, super(c);
      const u = this._sourceType = n.sourceType(c.source), l = this._tarStream = new t.FileStream(c);
      c = n.clone(c), delete c.source;
      const d = new e.FileStream(c);
      d.on("data", (f) => {
        this.push(f);
      }), d.on("end", () => this.ready(!0)), i(l, d, (f) => {
        f && this.emit("error", f);
      }), u !== "stream" && u !== void 0 && this.end();
    }
    _transform(c, u, l) {
      this._tarStream.write(c, u, l);
    }
    _flush(c) {
      (this._sourceType === "stream" || this._sourceType === void 0) && this._tarStream.end(), this.ready(c);
    }
  }
  return o.mixin(s.prototype), Ov = s, Ov;
}
var Mv, GT;
function Tz() {
  if (GT) return Mv;
  GT = 1;
  var t = xs.EventEmitter, e = ir.Writable, n = _n;
  function r(i) {
    e.call(this, i);
  }
  return n.inherits(r, e), r.prototype.emit = function(i) {
    if (i === "finish" && this._flush && !e.prototype._flush)
      this._flush(function(s) {
        s ? t.prototype.emit.call(this, "error", s) : t.prototype.emit.call(this, "finish");
      }.bind(this));
    else {
      var o = Array.prototype.slice.call(arguments);
      t.prototype.emit.apply(this, o);
    }
  }, Mv = r, Mv;
}
var Rv, qT;
function kz() {
  if (qT) return Rv;
  qT = 1;
  const t = de, e = pi(), n = Kg(), r = Vg(), i = Tz(), o = Yg().UncompressStream, s = Jg().UncompressStream;
  class a extends i {
    constructor(u) {
      u = u || {}, super(u);
      const l = e.clone(u);
      l.source = void 0, this._gzipStream = new o(l).on("error", (m) => this.emit("error", m));
      const d = new s(l).on("finish", () => this.ready(!0)).on("entry", this.emit.bind(this, "entry")).on("error", (m) => this.emit("error", m));
      this._gzipStream.pipe(d);
      const f = e.sourceType(u.source);
      if (f === "file") {
        const m = t.createReadStream(u.source, u.fs);
        m.on("error", (h) => this.emit("error", h)), m.pipe(this);
        return;
      }
      if (f === "buffer") {
        const m = r.createReadStream(u.source, u.streamifier);
        m.on("error", (h) => this.emit("error", h)), m.pipe(this);
        return;
      }
      f === "stream" && (u.source.on("error", (m) => this.emit("error", m)), u.source.pipe(this));
    }
    _write(u, l, d) {
      this._gzipStream.write(u, l, d);
    }
    _flush(u) {
      this._gzipStream.end(), this.ready(u);
    }
  }
  return n.mixin(a.prototype), Rv = a, Rv;
}
var HT;
function Nz() {
  if (HT) return Wo;
  HT = 1;
  const t = pi(), e = Iz(), n = Cz(), r = kz();
  return Wo.Stream = e, Wo.FileStream = n, Wo.UncompressStream = r, Wo.compressDir = t.makeCompressDirFn(e), Wo.compressFile = t.makeFileProcessFn(n), Wo.uncompress = t.makeUncompressFn(r), Wo.decompress = t.makeUncompressFn(r), Wo;
}
var WT;
function Pz() {
  return WT || (WT = 1, Fc.zip = wz(), Fc.gzip = Yg(), Fc.tar = Jg(), Fc.tgz = Nz()), Fc;
}
var E8 = Pz();
const zu = /* @__PURE__ */ Bo(E8), zo = "https://github.com/NapNeko/ffmpeg-build/releases/download/v1.0.0/ffmpeg-7.1.1-win64.zip", Dz = [
  "https://j.1win.ggff.net/" + zo,
  "https://git.yylx.win/" + zo,
  "https://ghfile.geekertao.top/" + zo,
  "https://gh-proxy.net/" + zo,
  "https://ghm.078465.xyz/" + zo,
  "https://gitproxy.127731.xyz/" + zo,
  "https://jiashu.1win.eu.org/" + zo,
  "https://github.tbedu.top/" + zo,
  zo
];
async function Fz(t) {
  return new Promise((e) => {
    const n = W_.get(t, { timeout: 5e3 }, (r) => {
      const i = r.statusCode || 0;
      i >= 200 && i < 300 ? (n.destroy(), e(!0)) : (n.destroy(), e(!1));
    });
    n.on("error", () => {
      e(!1);
    }), n.on("timeout", () => {
      n.destroy(), e(!1);
    });
  });
}
async function Oz() {
  for (const t of Dz)
    try {
      if (await Fz(t))
        return t;
    } catch {
    }
  return null;
}
async function Mz(t, e, n) {
  return new Promise((r) => {
    const i = Ae.createWriteStream(e);
    W_.get(t, (s) => {
      const a = s.statusCode || 0;
      if (a >= 200 && a < 300) {
        const c = parseInt(s.headers["content-length"] || "0", 10);
        let u = 0, l = -1, d = 0;
        c > 0 && n && (n(0), d = Date.now(), s.on("data", (f) => {
          u += f.length;
          const m = Math.floor(u / c * 100), h = Date.now();
          m !== l && (m - l >= 1 || m === 100) && (h - d >= 1e3 || m === 100) && (n(m), l = m, d = h);
        })), V_(s, i).then(() => {
          n && l !== 100 && n(100), r(!0);
        }).catch(() => r(!1));
      } else
        i.close(), Ae.unlink(e, () => {
        }), r(!1);
    }).on("error", () => {
      i.close(), Ae.unlink(e, () => {
      }), r(!1);
    });
  });
}
async function Rz(t, e) {
  Ae.existsSync(e) || Ae.mkdirSync(e, { recursive: !0 });
  const n = new E8.zip.UncompressStream({ source: t });
  return new Promise((r, i) => {
    n.on("entry", (o, s, a) => {
      const c = o.name;
      if (c.includes("/bin/") && c.endsWith(".exe")) {
        const u = Ze.basename(c), l = Ze.join(e, u), d = Ae.createWriteStream(l);
        s.pipe(d), d.on("finish", () => {
          a();
        }), d.on("error", () => {
          a();
        });
      } else
        s.resume(), a();
    }), n.on("error", (o) => {
      i(o);
    }), n.on("finish", () => {
      r();
    });
  });
}
async function Bz(t, e, n) {
  if (Vs.platform() !== "win32")
    return null;
  const r = t || Ze.join(Vs.tmpdir(), "ffmpeg"), i = e || Vs.tmpdir(), o = Ze.join(i, "ffmpeg.zip"), s = Ze.join(r, "ffmpeg.exe");
  if (Ae.existsSync(r) || Ae.mkdirSync(r, { recursive: !0 }), Ae.existsSync(i) || Ae.mkdirSync(i, { recursive: !0 }), Ae.existsSync(s))
    return n && n(100, "已找到FFmpeg"), s;
  n && n(0, "查找可用下载源");
  const a = await Oz();
  if (!a || (n && n(5, "开始下载FFmpeg"), !await Mz(
    a,
    o,
    (u) => {
      n && n(5 + Math.floor(u * 0.7), "下载FFmpeg");
    }
  )))
    return null;
  try {
    n && n(75, "解压FFmpeg"), await Rz(o, r), n && n(95, "清理临时文件");
    try {
      Ae.unlinkSync(o);
    } catch {
    }
    return Ae.existsSync(s) ? (n && n(100, "FFmpeg安装完成"), s) : null;
  } catch {
    return null;
  }
}
function zT(t) {
  if (Vs.platform() !== "win32") return null;
  const n = (process.env.PATH || "").split(";");
  for (const r of n)
    if (r)
      try {
        const i = Ze.join(r, t);
        if (Ae.existsSync(i))
          return i;
      } catch {
        continue;
      }
  return null;
}
async function Uz(t) {
  if (Vs.platform() !== "win32")
    return {
      path: null,
      reset: !1
    };
  const e = zT("ffmpeg.exe"), n = zT("ffprobe.exe");
  if (e && n)
    return {
      path: Ze.dirname(e),
      reset: !0
    };
  const r = Ze.dirname(hc(import.meta.url)), i = Ae.existsSync(Ze.join(r, "ffmpeg", "ffmpeg.exe")), o = Ae.existsSync(Ze.join(r, "ffmpeg", "ffprobe.exe"));
  return !i || !o ? await Bz(Ze.join(r, "ffmpeg"), Ze.join(r, "cache"), (a, c) => {
    t.log(`[FFmpeg] [Download] ${a}% - ${c}`);
  }) ? {
    path: Ze.join(r, "ffmpeg"),
    reset: !0
  } : (t.log("[FFmpeg] [Error] 下载FFmpeg失败"), {
    path: null,
    reset: !1
  }) : {
    path: Ze.join(r, "ffmpeg"),
    reset: !0
  };
}
const Mc = FL(PL);
function Bv(t) {
  const e = $u(t);
  Vc(e) || nL(e, { recursive: !0 });
}
class KT {
  constructor(e = "ffmpeg", n = "ffprobe", r, i) {
    this.ffmpegPath = e, this.ffprobePath = n, this.binaryPath = r, this.logger = i;
  }
  name = "FFmpegExec";
  downloadAttempted = !1;
  /**
     * 检查 FFmpeg 是否可用，如果不可用则尝试下载
     */
  async isAvailable() {
    try {
      return await Mc(this.ffmpegPath, ["-version"]), !0;
    } catch {
      if (!this.downloadAttempted && this.binaryPath && this.logger) {
        if (this.downloadAttempted = !0, process.env.NAPCAT_DISABLE_FFMPEG_DOWNLOAD)
          return !1;
        this.logger.log("[FFmpeg] 未找到可用的 FFmpeg，尝试自动下载...");
        const e = await Uz(this.logger);
        if (e.path && e.reset && process.platform === "win32") {
          this.ffmpegPath = gm(e.path, "ffmpeg.exe"), this.ffprobePath = gm(e.path, "ffprobe.exe"), this.logger.log("[FFmpeg] 已更新路径:", this.ffmpegPath);
          try {
            return await Mc(this.ffmpegPath, ["-version"]), !0;
          } catch {
            return !1;
          }
        }
      }
      return !1;
    }
  }
  /**
     * 设置 FFmpeg 路径
     */
  setFFmpegPath(e) {
    this.ffmpegPath = e;
  }
  /**
     * 设置 FFprobe 路径
     */
  setFFprobePath(e) {
    this.ffprobePath = e;
  }
  /**
     * 获取视频信息
     */
  async getVideoInfo(e) {
    const [n, r] = await Promise.all([
      Cd(e).catch(() => null),
      this.getDuration(e).catch(() => 60)
    ]), i = `${e}.thumbnail.bmp`;
    let o = 100, s = 100, a;
    try {
      await this.extractThumbnail(e, i);
      const c = await wE(i);
      o = c.width ?? 100, s = c.height ?? 100, Vc(i) && (a = XU(i));
    } catch {
    }
    return {
      width: o,
      height: s,
      duration: r,
      format: n?.ext ?? "mp4",
      thumbnail: a
    };
  }
  /**
   * 获取时长
   */
  async getDuration(e) {
    const { stdout: n } = await Mc(this.ffprobePath, [
      "-v",
      "error",
      "-show_entries",
      "format=duration",
      "-of",
      "default=noprint_wrappers=1:nokey=1",
      e
    ]), r = parseFloat(n.trim());
    if (isNaN(r))
      throw new Error(`ffprobe 返回了无效的时长值: "${n.trim()}"`);
    return r;
  }
  /**
   * 判断是否为 Silk 格式
   */
  async isSilk(e) {
    try {
      const n = ZU(e, "r"), r = Buffer.alloc(10);
      eL(n, r, 0, 10, 0), tL(n);
      const i = r.toString();
      return i.includes("#!SILK") || i.includes("#!SILK");
    } catch {
      return !1;
    }
  }
  /**
     * 转换为 PCM
     */
  async convertToPCM(e, n) {
    try {
      if (Bv(n), await Mc(this.ffmpegPath, [
        "-y",
        "-i",
        e,
        "-ar",
        "24000",
        "-ac",
        "1",
        "-f",
        "s16le",
        n
      ]), !Vc(n))
        throw new Error("转换PCM失败，输出文件不存在");
      return { result: !0, sampleRate: 24e3 };
    } catch (r) {
      throw new Error(`FFmpeg处理转换出错: ${r.message}`);
    }
  }
  /**
     * 转换文件
     */
  async convertFile(e, n, r) {
    try {
      Bv(n);
      const i = r === "amr" ? [
        "-f",
        "s16le",
        "-ar",
        "24000",
        "-ac",
        "1",
        "-i",
        e,
        "-ar",
        "8000",
        "-b:a",
        "12.2k",
        "-y",
        n
      ] : [
        "-f",
        "s16le",
        "-ar",
        "24000",
        "-ac",
        "1",
        "-i",
        e,
        "-y",
        n
      ];
      if (await Mc(this.ffmpegPath, i), !Vc(n))
        throw new Error("转换失败,输出文件不存在");
    } catch (i) {
      throw console.error("Error converting file:", i), new Error(`文件转换失败: ${i.message}`);
    }
  }
  /**
     * 提取缩略图
     */
  async extractThumbnail(e, n) {
    try {
      Bv(n);
      const { stderr: r } = await Mc(this.ffmpegPath, [
        "-i",
        e,
        "-ss",
        "00:00:01.000",
        "-vframes",
        "1",
        "-y",
        // 覆盖输出文件
        n
      ]);
      if (!Vc(n))
        throw new Error(`提取缩略图失败，输出文件不存在: ${r}`);
    } catch (r) {
      throw console.error("Error extracting thumbnail:", r), new Error(`提取缩略图失败: ${r.message}`);
    }
  }
  async convertToNTSilkTct(e, n) {
    throw new Error("convertToNTSilkTct is not implemented in FFmpegExecAdapter");
  }
}
class VT {
  static instance = null;
  static initPromise = null;
  /**
     * 初始化并获取最佳的 FFmpeg 适配器
     * @param logger 日志记录器
     * @param ffmpegPath FFmpeg 可执行文件路径(用于 Exec 适配器)
     * @param ffprobePath FFprobe 可执行文件路径(用于 Exec 适配器)
     * @param binaryPath 二进制文件路径(来自 pathWrapper.binaryPath,用于 Addon 适配器)
     */
  static async getAdapter(e, n = "ffmpeg", r = "ffprobe", i) {
    if (this.instance)
      return this.instance;
    if (this.initPromise)
      return this.initPromise;
    this.initPromise = this.initialize(e, n, r, i);
    try {
      return this.instance = await this.initPromise, this.instance;
    } finally {
      this.initPromise = null;
    }
  }
  /**
     * 初始化适配器
     */
  static async initialize(e, n, r, i) {
    if (i) {
      const s = new WH(i);
      if (e.log("[FFmpeg] 检查 Native Addon 可用性..."), await s.isAvailable())
        return e.log("[FFmpeg] ✓ 使用 Native Addon 适配器"), s;
      e.log("[FFmpeg] Native Addon 不可用，尝试使用命令行工具");
    } else
      e.log("[FFmpeg] 未提供 binaryPath，跳过 Native Addon 检测");
    const o = new KT(n, r, i, e);
    return e.log(`[FFmpeg] 检查命令行工具可用性: ${n}`), await o.isAvailable() ? (e.log("[FFmpeg] 使用命令行工具适配器 ✓"), o) : (e.logError("[FFmpeg] 警告: FFmpeg 不可用，将使用命令行适配器但可能失败"), o);
  }
  /**
     * 重置适配器(用于测试或重新初始化)
     */
  static reset() {
    this.instance = null, this.initPromise = null;
  }
  /**
     * 更新 FFmpeg 路径并重新初始化
     * @param logger 日志记录器
     * @param ffmpegPath FFmpeg 可执行文件路径
     * @param ffprobePath FFprobe 可执行文件路径
     */
  static async updateFFmpegPath(e, n, r) {
    this.instance && this.instance instanceof KT && (e.log(`[FFmpeg] 更新 FFmpeg 路径: ${n}`), this.instance.setFFmpegPath(n), this.instance.setFFprobePath(r), await this.instance.isAvailable() ? e.log("[FFmpeg] 新路径验证成功 ✓") : e.logError("[FFmpeg] 警告: 新 FFmpeg 路径不可用"));
  }
  /**
     * 获取当前适配器(不初始化)
     */
  static getCurrentAdapter() {
    return this.instance;
  }
}
const YT = (t, e) => {
  if (process.platform === "win32" && e) {
    const n = `${t}.exe`, r = be.join(e, "ffmpeg", n);
    return Vc(r) ? r : n;
  }
  return t;
};
let Ol = "ffmpeg", Ml = "ffprobe";
class ns {
  static adapter = null;
  static initialized = !1;
  /**
     * 初始化 FFmpeg 服务
     * @param binaryPath 二进制文件路径(来自 pathWrapper.binaryPath)
     * @param logger 日志记录器
     */
  static async init(e, n) {
    this.initialized || (Ol = YT("ffmpeg", e), Ml = YT("ffprobe", e), this.adapter = await VT.getAdapter(
      n,
      Ol,
      Ml,
      e
    ), this.initialized = !0);
  }
  static getAdapterName() {
    if (!this.adapter)
      throw new Error("FFmpeg service not initialized. Please call FFmpegService.init() first.");
    return this.adapter.name;
  }
  /**
     * 获取 FFmpeg 适配器
     */
  static async getAdapter() {
    if (!this.adapter)
      throw new Error("FFmpeg service not initialized. Please call FFmpegService.init() first.");
    return this.adapter;
  }
  static async convertToNTSilkTct(e, n) {
    await (await this.getAdapter()).convertToNTSilkTct(e, n);
  }
  /**
     * 设置 FFmpeg 路径并更新适配器
     * @deprecated 建议使用 init() 方法初始化
     */
  static async setFfmpegPath(e, n) {
    pO() === "win32" && (Ol = be.join(e, "ffmpeg.exe"), Ml = be.join(e, "ffprobe.exe"), n.log("[Check] ffmpeg:", Ol), n.log("[Check] ffprobe:", Ml), await VT.updateFFmpegPath(n, Ol, Ml));
  }
  /**
     * 提取视频缩略图
     */
  static async extractThumbnail(e, n) {
    await (await this.getAdapter()).extractThumbnail(e, n);
  }
  /**
     * 转换音频文件
     */
  static async convertAudioFmt(e, n, r) {
    await (await this.getAdapter()).convertFile(e, n, r);
  }
  /**
   * 获取音频时长
   */
  static async getDuration(e) {
    return (await this.getAdapter()).getDuration(e);
  }
  /**
   * 判断是否为 Silk 格式
   */
  static async isSilk(e) {
    return (await this.getAdapter()).isSilk(e);
  }
  /**
     * 转换为 PCM 格式
     */
  static async convert(e, n) {
    return (await this.getAdapter()).convertToPCM(e, n);
  }
  /**
     * 获取视频信息
     */
  static async getVideoInfo(e, n) {
    const r = await this.getAdapter();
    try {
      const i = $2(e).size, o = await r.getVideoInfo(e);
      return n && o.thumbnail && rL(n, o.thumbnail), {
        width: o.width,
        height: o.height,
        time: o.duration,
        format: o.format,
        size: i,
        filePath: e
      };
    } catch {
      const o = await Cd(e).catch(() => null), s = $2(e).size;
      return {
        width: 100,
        height: 100,
        time: 60,
        format: o?.ext ?? "mp4",
        size: s,
        filePath: e
      };
    }
  }
}
const A8 = " ", Cn = 1024 * 1024;
class Lz {
  napcore;
  client;
  sig;
  logger;
  hwClient;
  cachedPrepareReq = null;
  constructor(e, n, r) {
    this.napcore = e, this.client = r, this.sig = {
      uin: String(this.napcore.basicInfo.uin),
      uid: this.napcore.basicInfo.uid,
      sigSession: null,
      sessionKey: null,
      serverAddr: []
    }, this.logger = n, this.hwClient = new Qq(this.sig, this.logger);
  }
  async checkAvailable() {
    (this.sig.sigSession === null || this.sig.sessionKey === null) && (this.cachedPrepareReq === null && (this.cachedPrepareReq = this.prepareUpload().finally(() => {
      this.cachedPrepareReq = null;
    })), await this.cachedPrepareReq);
  }
  async prepareUpload() {
    this.logger.debug("[Highway] on prepareUpload!");
    const e = rC.build(), n = await this.client.sendOidbPacket(e, !0), r = rC.parse(n);
    this.sig.sigSession = r.httpConn.sigSession, this.sig.sessionKey = r.httpConn.sessionKey;
    for (const i of r.httpConn.serverInfos)
      if (i.serviceType === 1)
        for (const o of i.serverAddrs)
          this.logger.debug(`[Highway PrepareUpload] server addr add: ${nm(o.ip)}:${o.port}`), this.sig.serverAddr.push({
            ip: nm(o.ip),
            port: o.port
          }), this.hwClient.changeServer(nm(o.ip), o.port);
    this.sig.serverAddr.length === 0 && this.logger.warn("[Highway PrepareUpload] server addr is empty!");
  }
  async uploadImage(e, n) {
    if (await this.checkAvailable(), e.chatType === Ne.KCHATTYPEGROUP)
      await this.uploadGroupImage(+e.peerUid, n);
    else if (e.chatType === Ne.KCHATTYPEC2C)
      await this.uploadC2CImage(e.peerUid, n);
    else
      throw new Error(`[Highway] unsupported chatType: ${e.chatType}`);
  }
  async uploadVideo(e, n) {
    if (await this.checkAvailable(), +(n.fileSize ?? 0) > 1024 * 1024 * 100)
      throw new Error(`[Highway] 视频文件过大: ${(+(n.fileSize ?? 0) / (1024 * 1024)).toFixed(2)} MB > 100 MB，请使用文件上传！`);
    let r = null, i = !1;
    if (n.thumbPath)
      try {
        await de.promises.access(n.thumbPath, de.constants.F_OK), i = !0;
      } catch {
        i = !1;
      }
    (!n.thumbPath || !i) && (r = await this.ensureVideoThumb(n));
    try {
      if (e.chatType === Ne.KCHATTYPEGROUP)
        await this.uploadGroupVideo(+e.peerUid, n);
      else if (e.chatType === Ne.KCHATTYPEC2C)
        await this.uploadC2CVideo(e.peerUid, n);
      else
        throw new Error(`[Highway] unsupported chatType: ${e.chatType}`);
    } finally {
      if (r) {
        const o = r;
        de.promises.unlink(o).then(() => this.logger.debug(`[Highway] Cleaned up temp thumbnail: ${o}`)).catch((s) => {
          s.code !== "ENOENT" && this.logger.warn(`[Highway] Failed to clean up temp thumbnail: ${o}, reason: ${s instanceof Error ? s.message : s}`);
        });
      }
    }
  }
  /**
   * 确保视频缩略图存在，如果不存在则自动生成
   * @returns 生成的临时缩略图路径，用于后续清理
   */
  async ensureVideoThumb(e) {
    if (!e.filePath)
      throw new Error("video.filePath is empty, cannot generate thumbnail");
    const n = be.dirname(e.filePath), r = be.basename(e.filePath, be.extname(e.filePath)), i = be.join(n, `${r}_thumb.png`);
    this.logger.debug(`[Highway] Video thumb missing, generating at: ${i}`);
    try {
      await ns.extractThumbnail(e.filePath, i);
      try {
        await de.promises.access(i, de.constants.F_OK), this.logger.debug("[Highway] Video thumbnail generated successfully using FFmpeg");
      } catch {
        throw new Error("FFmpeg failed to generate thumbnail");
      }
    } catch (s) {
      this.logger.warn(`[Highway] Failed to extract thumbnail, using default. Reason: ${s instanceof Error ? s.message : s}`), await de.promises.writeFile(i, Buffer.from(A8, "base64"));
    }
    e.thumbPath = i;
    const o = await de.promises.stat(i);
    return e.thumbSize = o.size, e.thumbMd5 = await Lg(i), e.thumbWidth || (e.thumbWidth = 240), e.thumbHeight || (e.thumbHeight = 383), this.logger.debug(`[Highway] Video thumb info set: path=${i}, size=${e.thumbSize}, md5=${e.thumbMd5}`), i;
  }
  async uploadPtt(e, n) {
    if (await this.checkAvailable(), e.chatType === Ne.KCHATTYPEGROUP)
      await this.uploadGroupPtt(+e.peerUid, n);
    else if (e.chatType === Ne.KCHATTYPEC2C)
      await this.uploadC2CPtt(e.peerUid, n);
    else
      throw new Error(`[Highway] unsupported chatType: ${e.chatType}`);
  }
  async uploadFile(e, n) {
    if (await this.checkAvailable(), e.chatType === Ne.KCHATTYPEGROUP)
      await this.uploadGroupFile(+e.peerUid, n);
    else if (e.chatType === Ne.KCHATTYPEC2C)
      await this.uploadC2CFile(e.peerUid, n);
    else
      throw new Error(`[Highway] unsupported chatType: ${e.chatType}`);
  }
  async uploadGroupImage(e, n) {
    n.sha1 = Buffer.from(await Eo(n.path)).toString("hex");
    const r = oC.build(e, n), i = await this.client.sendOidbPacket(r, !0), o = oC.parse(i), s = o.upload.uKey;
    if (s && s !== "") {
      this.logger.debug(`[Highway] uploadGroupImageReq get upload ukey: ${s}, need upload!`);
      const a = o.upload.msgInfo.msgInfoBody[0].index, c = Buffer.from(a.info.fileSha1, "hex"), u = Buffer.from(a.info.fileHash, "hex"), l = new fe(Fs).encode({
        fileUuid: a.fileUuid,
        uKey: s,
        network: {
          ipv4S: Os(o.upload.ipv4S)
        },
        msgInfoBody: o.upload.msgInfo.msgInfoBody,
        blockSize: Cn,
        hash: {
          fileSha1: [c]
        }
      });
      await this.hwClient.upload(
        1004,
        de.createReadStream(n.path, { highWaterMark: Cn }),
        n.size,
        u,
        l
      );
    } else
      this.logger.debug(`[Highway] uploadGroupImageReq get upload invalid ukey ${s}, don't need upload!`);
    n.msgInfo = o.upload.msgInfo;
  }
  async uploadC2CImage(e, n) {
    n.sha1 = Buffer.from(await Eo(n.path)).toString("hex");
    const r = xC.build(e, n), i = await this.client.sendOidbPacket(r, !0), o = xC.parse(i), s = o.upload.uKey;
    if (s && s !== "") {
      this.logger.debug(`[Highway] uploadC2CImageReq get upload ukey: ${s}, need upload!`);
      const a = o.upload.msgInfo.msgInfoBody[0].index, c = Buffer.from(a.info.fileSha1, "hex"), u = Buffer.from(a.info.fileHash, "hex"), l = new fe(Fs).encode({
        fileUuid: a.fileUuid,
        uKey: s,
        network: {
          ipv4S: Os(o.upload.ipv4S)
        },
        msgInfoBody: o.upload.msgInfo.msgInfoBody,
        blockSize: Cn,
        hash: {
          fileSha1: [c]
        }
      });
      await this.hwClient.upload(
        1003,
        de.createReadStream(n.path, { highWaterMark: Cn }),
        n.size,
        u,
        l
      );
    } else
      this.logger.debug(`[Highway] uploadC2CImageReq get upload invalid ukey ${s}, don't need upload!`);
    n.msgInfo = o.upload.msgInfo;
  }
  async uploadGroupVideo(e, n) {
    if (!n.filePath || !n.thumbPath) throw new Error("video.filePath or video.thumbPath is empty");
    n.fileSha1 = Buffer.from(await Eo(n.filePath)).toString("hex"), n.thumbSha1 = Buffer.from(await Eo(n.thumbPath)).toString("hex");
    const r = vC.build(e, n), i = await this.client.sendOidbPacket(r, !0), o = vC.parse(i), s = o.upload.uKey;
    if (s && s !== "") {
      this.logger.debug(`[Highway] uploadGroupVideoReq get upload video ukey: ${s}, need upload!`);
      const c = o.upload.msgInfo.msgInfoBody[0].index, u = Buffer.from(c.info.fileHash, "hex"), l = new fe(Fs).encode({
        fileUuid: c.fileUuid,
        uKey: s,
        network: {
          ipv4S: Os(o.upload.ipv4S)
        },
        msgInfoBody: o.upload.msgInfo.msgInfoBody,
        blockSize: Cn,
        hash: {
          fileSha1: await iC(n.filePath)
        }
      });
      await this.hwClient.upload(
        1005,
        de.createReadStream(n.filePath, { highWaterMark: Cn }),
        +n.fileSize,
        u,
        l
      );
    } else
      this.logger.debug(`[Highway] uploadGroupVideoReq get upload invalid ukey ${s}, don't need upload!`);
    const a = o.upload.subFileInfos[0];
    if (a.uKey && a.uKey !== "") {
      this.logger.debug(`[Highway] uploadGroupVideoReq get upload video thumb ukey: ${a.uKey}, need upload!`);
      const c = o.upload.msgInfo.msgInfoBody[1].index, u = Buffer.from(c.info.fileHash, "hex"), l = Buffer.from(c.info.fileSha1, "hex"), d = new fe(Fs).encode({
        fileUuid: c.fileUuid,
        uKey: a.uKey,
        network: {
          ipv4S: Os(a.ipv4S)
        },
        msgInfoBody: o.upload.msgInfo.msgInfoBody,
        blockSize: Cn,
        hash: {
          fileSha1: [l]
        }
      });
      await this.hwClient.upload(
        1006,
        de.createReadStream(n.thumbPath, { highWaterMark: Cn }),
        +n.thumbSize,
        u,
        d
      );
    } else
      this.logger.debug(`[Highway] uploadGroupVideoReq get upload invalid thumb ukey ${a.uKey}, don't need upload!`);
    n.msgInfo = o.upload.msgInfo;
  }
  async uploadC2CVideo(e, n) {
    if (!n.filePath || !n.thumbPath) throw new Error("video.filePath or video.thumbPath is empty");
    n.fileSha1 = Buffer.from(await Eo(n.filePath)).toString("hex"), n.thumbSha1 = Buffer.from(await Eo(n.thumbPath)).toString("hex");
    const r = SC.build(e, n), i = await this.client.sendOidbPacket(r, !0), o = SC.parse(i), s = o.upload.uKey;
    if (s && s !== "") {
      this.logger.debug(`[Highway] uploadC2CVideoReq get upload video ukey: ${s}, need upload!`);
      const c = o.upload.msgInfo.msgInfoBody[0].index, u = Buffer.from(c.info.fileHash, "hex"), l = new fe(Fs).encode({
        fileUuid: c.fileUuid,
        uKey: s,
        network: {
          ipv4S: Os(o.upload.ipv4S)
        },
        msgInfoBody: o.upload.msgInfo.msgInfoBody,
        blockSize: Cn,
        hash: {
          fileSha1: await iC(n.filePath)
        }
      });
      await this.hwClient.upload(
        1001,
        de.createReadStream(n.filePath, { highWaterMark: Cn }),
        +n.fileSize,
        u,
        l
      );
    } else
      this.logger.debug(`[Highway] uploadC2CVideoReq get upload invalid ukey ${s}, don't need upload!`);
    const a = o.upload.subFileInfos[0];
    if (a.uKey && a.uKey !== "") {
      this.logger.debug(`[Highway] uploadC2CVideoReq get upload video thumb ukey: ${a.uKey}, need upload!`);
      const c = o.upload.msgInfo.msgInfoBody[1].index, u = Buffer.from(c.info.fileHash, "hex"), l = Buffer.from(c.info.fileSha1, "hex"), d = new fe(Fs).encode({
        fileUuid: c.fileUuid,
        uKey: a.uKey,
        network: {
          ipv4S: Os(a.ipv4S)
        },
        msgInfoBody: o.upload.msgInfo.msgInfoBody,
        blockSize: Cn,
        hash: {
          fileSha1: [l]
        }
      });
      await this.hwClient.upload(
        1002,
        de.createReadStream(n.thumbPath, { highWaterMark: Cn }),
        +n.thumbSize,
        u,
        d
      );
    } else
      this.logger.debug(`[Highway] uploadC2CVideoReq get upload invalid thumb ukey ${a.uKey}, don't need upload!`);
    n.msgInfo = o.upload.msgInfo;
  }
  async uploadGroupPtt(e, n) {
    n.fileSha1 = Buffer.from(await Eo(n.filePath)).toString("hex");
    const r = yC.build(e, n), i = await this.client.sendOidbPacket(r, !0), o = yC.parse(i), s = o.upload.uKey;
    if (s && s !== "") {
      this.logger.debug(`[Highway] uploadGroupPttReq get upload ptt ukey: ${s}, need upload!`);
      const a = o.upload.msgInfo.msgInfoBody[0].index, c = Buffer.from(a.info.fileHash, "hex"), u = Buffer.from(a.info.fileSha1, "hex"), l = new fe(Fs).encode({
        fileUuid: a.fileUuid,
        uKey: s,
        network: {
          ipv4S: Os(o.upload.ipv4S)
        },
        msgInfoBody: o.upload.msgInfo.msgInfoBody,
        blockSize: Cn,
        hash: {
          fileSha1: [u]
        }
      });
      await this.hwClient.upload(
        1008,
        de.createReadStream(n.filePath, { highWaterMark: Cn }),
        n.fileSize,
        c,
        l
      );
    } else
      this.logger.debug(`[Highway] uploadGroupPttReq get upload invalid ukey ${s}, don't need upload!`);
    n.msgInfo = o.upload.msgInfo;
  }
  async uploadC2CPtt(e, n) {
    n.fileSha1 = Buffer.from(await Eo(n.filePath)).toString("hex");
    const r = wC.build(e, n), i = await this.client.sendOidbPacket(r, !0), o = wC.parse(i), s = o.upload.uKey;
    if (s && s !== "") {
      this.logger.debug(`[Highway] uploadC2CPttReq get upload ptt ukey: ${s}, need upload!`);
      const a = o.upload.msgInfo.msgInfoBody[0].index, c = Buffer.from(a.info.fileHash, "hex"), u = Buffer.from(a.info.fileSha1, "hex"), l = new fe(Fs).encode({
        fileUuid: a.fileUuid,
        uKey: s,
        network: {
          ipv4S: Os(o.upload.ipv4S)
        },
        msgInfoBody: o.upload.msgInfo.msgInfoBody,
        blockSize: Cn,
        hash: {
          fileSha1: [u]
        }
      });
      await this.hwClient.upload(
        1007,
        de.createReadStream(n.filePath, { highWaterMark: Cn }),
        n.fileSize,
        c,
        l
      );
    } else
      this.logger.debug(`[Highway] uploadC2CPttReq get upload invalid ukey ${s}, don't need upload!`);
    n.msgInfo = o.upload.msgInfo;
  }
  async uploadGroupFile(e, n) {
    n.isGroupFile = !0, n.fileMd5 = await Ww(n.filePath), n.fileSha1 = await Eo(n.filePath);
    const r = gC.build(e, n), i = await this.client.sendOidbPacket(r, !0), o = gC.parse(i);
    if (o?.upload?.boolFileExist)
      this.logger.debug("[Highway] uploadGroupFileReq file exist, don't need upload!");
    else {
      this.logger.debug("[Highway] uploadGroupFileReq file not exist, need upload!");
      const s = new fe(JI).encode({
        unknown1: 100,
        unknown2: 1,
        entry: {
          busiBuff: {
            senderUin: BigInt(this.sig.uin),
            receiverUin: BigInt(e),
            groupCode: BigInt(e)
          },
          fileEntry: {
            fileSize: BigInt(n.fileSize),
            md5: n.fileMd5,
            md5S2: n.fileMd5,
            checkKey: o.upload.checkKey,
            fileId: o.upload.fileId,
            uploadKey: o.upload.fileKey
          },
          clientInfo: {
            clientType: 3,
            appId: "100",
            terminalType: 3,
            clientVer: "1.1.1",
            unknown: 4
          },
          fileNameInfo: {
            fileName: n.fileName
          },
          host: {
            hosts: [
              {
                url: {
                  host: o.upload.uploadIp,
                  unknown: 1
                },
                port: o.upload.uploadPort
              }
            ]
          }
        },
        unknown200: 0
      });
      await this.hwClient.upload(
        71,
        de.createReadStream(n.filePath, { highWaterMark: Cn }),
        n.fileSize,
        n.fileMd5,
        s
      );
    }
    n.fileUuid = o.upload.fileId;
  }
  async uploadC2CFile(e, n) {
    n.isGroupFile = !1, n.fileMd5 = await Ww(n.filePath), n.fileSha1 = await Eo(n.filePath);
    const r = await bC.build(this.sig.uid, e, n), i = await this.client.sendOidbPacket(r, !0), o = bC.parse(i);
    if (!o.upload?.boolFileExist) {
      this.logger.debug("[Highway] uploadC2CFileReq file not exist, need upload!");
      const c = new fe(JI).encode({
        unknown1: 100,
        unknown2: 1,
        entry: {
          busiBuff: {
            senderUin: BigInt(this.sig.uin)
          },
          fileEntry: {
            fileSize: BigInt(n.fileSize),
            md5: n.fileMd5,
            md5S2: n.fileMd5,
            checkKey: n.fileSha1,
            fileId: o.upload?.uuid,
            uploadKey: o.upload?.mediaPlatformUploadKey
          },
          clientInfo: {
            clientType: 3,
            appId: "100",
            terminalType: 3,
            clientVer: "1.1.1",
            unknown: 4
          },
          fileNameInfo: {
            fileName: n.fileName
          },
          host: {
            hosts: [
              {
                url: {
                  host: o.upload?.uploadIp,
                  unknown: 1
                },
                port: o.upload?.uploadPort
              }
            ]
          }
        },
        unknown200: 1,
        unknown3: 0
      });
      await this.hwClient.upload(
        95,
        de.createReadStream(n.filePath, { highWaterMark: Cn }),
        n.fileSize,
        n.fileMd5,
        c
      );
    }
    n.fileUuid = o.upload?.uuid, n.fileHash = o.upload?.fileAddon;
    const s = hC.build(n.fileUuid, n.fileHash, this.sig.uid, e), a = await this.client.sendOidbPacket(s, !0);
    n._e37_800_rsp = hC.parse(a), n._private_send_uid = this.sig.uid, n._private_recv_uid = e;
  }
}
var Uv = {}, Kf = {}, Lv, JT;
function di() {
  if (JT) return Lv;
  JT = 1;
  function t(h) {
    "@babel/helpers - typeof";
    return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(y) {
      return typeof y;
    } : function(y) {
      return y && typeof Symbol == "function" && y.constructor === Symbol && y !== Symbol.prototype ? "symbol" : typeof y;
    }, t(h);
  }
  function e(h, y, x) {
    return Object.defineProperty(h, "prototype", { writable: !1 }), h;
  }
  function n(h, y) {
    if (!(h instanceof y)) throw new TypeError("Cannot call a class as a function");
  }
  function r(h, y, x) {
    return y = f(y), i(h, u() ? Reflect.construct(y, x || [], f(h).constructor) : y.apply(h, x));
  }
  function i(h, y) {
    if (y && (t(y) == "object" || typeof y == "function")) return y;
    if (y !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
    return o(h);
  }
  function o(h) {
    if (h === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    return h;
  }
  function s(h, y) {
    if (typeof y != "function" && y !== null) throw new TypeError("Super expression must either be null or a function");
    h.prototype = Object.create(y && y.prototype, { constructor: { value: h, writable: !0, configurable: !0 } }), Object.defineProperty(h, "prototype", { writable: !1 }), y && d(h, y);
  }
  function a(h) {
    var y = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
    return a = function(g) {
      if (g === null || !l(g)) return g;
      if (typeof g != "function") throw new TypeError("Super expression must either be null or a function");
      if (y !== void 0) {
        if (y.has(g)) return y.get(g);
        y.set(g, v);
      }
      function v() {
        return c(g, arguments, f(this).constructor);
      }
      return v.prototype = Object.create(g.prototype, { constructor: { value: v, enumerable: !1, writable: !0, configurable: !0 } }), d(v, g);
    }, a(h);
  }
  function c(h, y, x) {
    if (u()) return Reflect.construct.apply(null, arguments);
    var g = [null];
    g.push.apply(g, y);
    var v = new (h.bind.apply(h, g))();
    return x && d(v, x.prototype), v;
  }
  function u() {
    try {
      var h = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
    } catch {
    }
    return (u = function() {
      return !!h;
    })();
  }
  function l(h) {
    try {
      return Function.toString.call(h).indexOf("[native code]") !== -1;
    } catch {
      return typeof h == "function";
    }
  }
  function d(h, y) {
    return d = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(x, g) {
      return x.__proto__ = g, x;
    }, d(h, y);
  }
  function f(h) {
    return f = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(y) {
      return y.__proto__ || Object.getPrototypeOf(y);
    }, f(h);
  }
  var m = /* @__PURE__ */ (function(h) {
    function y(x) {
      var g;
      return n(this, y), g = r(this, y, [`Format functions must be synchronous taking a two arguments: (info, opts)
Found: `.concat(x.toString().split(`
`)[0], `
`)]), Error.captureStackTrace(g, y), g;
    }
    return s(y, h), e(y);
  })(/* @__PURE__ */ a(Error));
  return Lv = function(h) {
    if (h.length > 2)
      throw new m(h);
    function y() {
      var g = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
      this.options = g;
    }
    y.prototype.transform = h;
    function x(g) {
      return new y(g);
    }
    return x.Format = y, x;
  }, Lv;
}
var Rl = { exports: {} }, jv = { exports: {} }, Qv = { exports: {} }, $v = { exports: {} }, XT;
function jz() {
  return XT || (XT = 1, (function(t) {
    var e = {};
    t.exports = e;
    var n = {
      reset: [0, 0],
      bold: [1, 22],
      dim: [2, 22],
      italic: [3, 23],
      underline: [4, 24],
      inverse: [7, 27],
      hidden: [8, 28],
      strikethrough: [9, 29],
      black: [30, 39],
      red: [31, 39],
      green: [32, 39],
      yellow: [33, 39],
      blue: [34, 39],
      magenta: [35, 39],
      cyan: [36, 39],
      white: [37, 39],
      gray: [90, 39],
      grey: [90, 39],
      brightRed: [91, 39],
      brightGreen: [92, 39],
      brightYellow: [93, 39],
      brightBlue: [94, 39],
      brightMagenta: [95, 39],
      brightCyan: [96, 39],
      brightWhite: [97, 39],
      bgBlack: [40, 49],
      bgRed: [41, 49],
      bgGreen: [42, 49],
      bgYellow: [43, 49],
      bgBlue: [44, 49],
      bgMagenta: [45, 49],
      bgCyan: [46, 49],
      bgWhite: [47, 49],
      bgGray: [100, 49],
      bgGrey: [100, 49],
      bgBrightRed: [101, 49],
      bgBrightGreen: [102, 49],
      bgBrightYellow: [103, 49],
      bgBrightBlue: [104, 49],
      bgBrightMagenta: [105, 49],
      bgBrightCyan: [106, 49],
      bgBrightWhite: [107, 49],
      // legacy styles for colors pre v1.0.0
      blackBG: [40, 49],
      redBG: [41, 49],
      greenBG: [42, 49],
      yellowBG: [43, 49],
      blueBG: [44, 49],
      magentaBG: [45, 49],
      cyanBG: [46, 49],
      whiteBG: [47, 49]
    };
    Object.keys(n).forEach(function(r) {
      var i = n[r], o = e[r] = [];
      o.open = "\x1B[" + i[0] + "m", o.close = "\x1B[" + i[1] + "m";
    });
  })($v)), $v.exports;
}
var Gv, ZT;
function Qz() {
  return ZT || (ZT = 1, Gv = function(t, e) {
    e = e || process.argv || [];
    var n = e.indexOf("--"), r = /^-{1,2}/.test(t) ? "" : "--", i = e.indexOf(r + t);
    return i !== -1 && (n === -1 ? !0 : i < n);
  }), Gv;
}
var qv, ek;
function $z() {
  if (ek) return qv;
  ek = 1;
  var t = Pn, e = Qz(), n = process.env, r = void 0;
  e("no-color") || e("no-colors") || e("color=false") ? r = !1 : (e("color") || e("colors") || e("color=true") || e("color=always")) && (r = !0), "FORCE_COLOR" in n && (r = n.FORCE_COLOR.length === 0 || parseInt(n.FORCE_COLOR, 10) !== 0);
  function i(a) {
    return a === 0 ? !1 : {
      level: a,
      hasBasic: !0,
      has256: a >= 2,
      has16m: a >= 3
    };
  }
  function o(a) {
    if (r === !1)
      return 0;
    if (e("color=16m") || e("color=full") || e("color=truecolor"))
      return 3;
    if (e("color=256"))
      return 2;
    if (a && !a.isTTY && r !== !0)
      return 0;
    var c = r ? 1 : 0;
    if (process.platform === "win32") {
      var u = t.release().split(".");
      return Number(process.versions.node.split(".")[0]) >= 8 && Number(u[0]) >= 10 && Number(u[2]) >= 10586 ? Number(u[2]) >= 14931 ? 3 : 2 : 1;
    }
    if ("CI" in n)
      return ["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some(function(d) {
        return d in n;
      }) || n.CI_NAME === "codeship" ? 1 : c;
    if ("TEAMCITY_VERSION" in n)
      return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(n.TEAMCITY_VERSION) ? 1 : 0;
    if ("TERM_PROGRAM" in n) {
      var l = parseInt((n.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
      switch (n.TERM_PROGRAM) {
        case "iTerm.app":
          return l >= 3 ? 3 : 2;
        case "Hyper":
          return 3;
        case "Apple_Terminal":
          return 2;
      }
    }
    return /-256(color)?$/i.test(n.TERM) ? 2 : /^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(n.TERM) || "COLORTERM" in n ? 1 : (n.TERM === "dumb", c);
  }
  function s(a) {
    var c = o(a);
    return i(c);
  }
  return qv = {
    supportsColor: s,
    stdout: s(process.stdout),
    stderr: s(process.stderr)
  }, qv;
}
var Hv = { exports: {} }, tk;
function Gz() {
  return tk || (tk = 1, (function(t) {
    t.exports = function(n, r) {
      var i = "";
      n = n || "Run the trap, drop the bass", n = n.split("");
      var o = {
        a: ["@", "Ą", "Ⱥ", "Ʌ", "Δ", "Λ", "Д"],
        b: ["ß", "Ɓ", "Ƀ", "ɮ", "β", "฿"],
        c: ["©", "Ȼ", "Ͼ"],
        d: ["Ð", "Ɗ", "Ԁ", "ԁ", "Ԃ", "ԃ"],
        e: [
          "Ë",
          "ĕ",
          "Ǝ",
          "ɘ",
          "Σ",
          "ξ",
          "Ҽ",
          "੬"
        ],
        f: ["Ӻ"],
        g: ["ɢ"],
        h: ["Ħ", "ƕ", "Ң", "Һ", "Ӈ", "Ԋ"],
        i: ["༏"],
        j: ["Ĵ"],
        k: ["ĸ", "Ҡ", "Ӄ", "Ԟ"],
        l: ["Ĺ"],
        m: ["ʍ", "Ӎ", "ӎ", "Ԡ", "ԡ", "൩"],
        n: ["Ñ", "ŋ", "Ɲ", "Ͷ", "Π", "Ҋ"],
        o: [
          "Ø",
          "õ",
          "ø",
          "Ǿ",
          "ʘ",
          "Ѻ",
          "ם",
          "۝",
          "๏"
        ],
        p: ["Ƿ", "Ҏ"],
        q: ["্"],
        r: ["®", "Ʀ", "Ȑ", "Ɍ", "ʀ", "Я"],
        s: ["§", "Ϟ", "ϟ", "Ϩ"],
        t: ["Ł", "Ŧ", "ͳ"],
        u: ["Ʊ", "Ս"],
        v: ["ט"],
        w: ["Ш", "Ѡ", "Ѽ", "൰"],
        x: ["Ҳ", "Ӿ", "Ӽ", "ӽ"],
        y: ["¥", "Ұ", "Ӌ"],
        z: ["Ƶ", "ɀ"]
      };
      return n.forEach(function(s) {
        s = s.toLowerCase();
        var a = o[s] || [" "], c = Math.floor(Math.random() * a.length);
        typeof o[s] < "u" ? i += o[s][c] : i += s;
      }), i;
    };
  })(Hv)), Hv.exports;
}
var Wv = { exports: {} }, nk;
function qz() {
  return nk || (nk = 1, (function(t) {
    t.exports = function(n, r) {
      n = n || "   he is here   ";
      var i = {
        up: [
          "̍",
          "̎",
          "̄",
          "̅",
          "̿",
          "̑",
          "̆",
          "̐",
          "͒",
          "͗",
          "͑",
          "̇",
          "̈",
          "̊",
          "͂",
          "̓",
          "̈",
          "͊",
          "͋",
          "͌",
          "̃",
          "̂",
          "̌",
          "͐",
          "̀",
          "́",
          "̋",
          "̏",
          "̒",
          "̓",
          "̔",
          "̽",
          "̉",
          "ͣ",
          "ͤ",
          "ͥ",
          "ͦ",
          "ͧ",
          "ͨ",
          "ͩ",
          "ͪ",
          "ͫ",
          "ͬ",
          "ͭ",
          "ͮ",
          "ͯ",
          "̾",
          "͛",
          "͆",
          "̚"
        ],
        down: [
          "̖",
          "̗",
          "̘",
          "̙",
          "̜",
          "̝",
          "̞",
          "̟",
          "̠",
          "̤",
          "̥",
          "̦",
          "̩",
          "̪",
          "̫",
          "̬",
          "̭",
          "̮",
          "̯",
          "̰",
          "̱",
          "̲",
          "̳",
          "̹",
          "̺",
          "̻",
          "̼",
          "ͅ",
          "͇",
          "͈",
          "͉",
          "͍",
          "͎",
          "͓",
          "͔",
          "͕",
          "͖",
          "͙",
          "͚",
          "̣"
        ],
        mid: [
          "̕",
          "̛",
          "̀",
          "́",
          "͘",
          "̡",
          "̢",
          "̧",
          "̨",
          "̴",
          "̵",
          "̶",
          "͜",
          "͝",
          "͞",
          "͟",
          "͠",
          "͢",
          "̸",
          "̷",
          "͡",
          " ҉"
        ]
      }, o = [].concat(i.up, i.down, i.mid);
      function s(u) {
        var l = Math.floor(Math.random() * u);
        return l;
      }
      function a(u) {
        var l = !1;
        return o.filter(function(d) {
          l = d === u;
        }), l;
      }
      function c(u, l) {
        var d = "", f, m;
        l = l || {}, l.up = typeof l.up < "u" ? l.up : !0, l.mid = typeof l.mid < "u" ? l.mid : !0, l.down = typeof l.down < "u" ? l.down : !0, l.size = typeof l.size < "u" ? l.size : "maxi", u = u.split("");
        for (m in u)
          if (!a(m)) {
            switch (d = d + u[m], f = { up: 0, down: 0, mid: 0 }, l.size) {
              case "mini":
                f.up = s(8), f.mid = s(2), f.down = s(8);
                break;
              case "maxi":
                f.up = s(16) + 3, f.mid = s(4) + 1, f.down = s(64) + 3;
                break;
              default:
                f.up = s(8) + 1, f.mid = s(6) / 2, f.down = s(8) + 1;
                break;
            }
            var h = ["up", "mid", "down"];
            for (var y in h)
              for (var x = h[y], g = 0; g <= f[x]; g++)
                l[x] && (d = d + i[x][s(i[x].length)]);
          }
        return d;
      }
      return c(n, r);
    };
  })(Wv)), Wv.exports;
}
var zv = { exports: {} }, rk;
function Hz() {
  return rk || (rk = 1, (function(t) {
    t.exports = function(e) {
      return function(n, r, i) {
        if (n === " ") return n;
        switch (r % 3) {
          case 0:
            return e.red(n);
          case 1:
            return e.white(n);
          case 2:
            return e.blue(n);
        }
      };
    };
  })(zv)), zv.exports;
}
var Kv = { exports: {} }, ik;
function Wz() {
  return ik || (ik = 1, (function(t) {
    t.exports = function(e) {
      return function(n, r, i) {
        return r % 2 === 0 ? n : e.inverse(n);
      };
    };
  })(Kv)), Kv.exports;
}
var Vv = { exports: {} }, ok;
function zz() {
  return ok || (ok = 1, (function(t) {
    t.exports = function(e) {
      var n = ["red", "yellow", "green", "blue", "magenta"];
      return function(r, i, o) {
        return r === " " ? r : e[n[i++ % n.length]](r);
      };
    };
  })(Vv)), Vv.exports;
}
var Yv = { exports: {} }, sk;
function Kz() {
  return sk || (sk = 1, (function(t) {
    t.exports = function(e) {
      var n = [
        "underline",
        "inverse",
        "grey",
        "yellow",
        "red",
        "green",
        "blue",
        "white",
        "cyan",
        "magenta",
        "brightYellow",
        "brightRed",
        "brightGreen",
        "brightBlue",
        "brightWhite",
        "brightCyan",
        "brightMagenta"
      ];
      return function(r, i, o) {
        return r === " " ? r : e[n[Math.round(Math.random() * (n.length - 2))]](r);
      };
    };
  })(Yv)), Yv.exports;
}
var ak;
function Vz() {
  return ak || (ak = 1, (function(t) {
    var e = {};
    t.exports = e, e.themes = {};
    var n = _n, r = e.styles = jz(), i = Object.defineProperties, o = new RegExp(/[\r\n]+/g);
    e.supportsColor = $z().supportsColor, typeof e.enabled > "u" && (e.enabled = e.supportsColor() !== !1), e.enable = function() {
      e.enabled = !0;
    }, e.disable = function() {
      e.enabled = !1;
    }, e.stripColors = e.strip = function(y) {
      return ("" + y).replace(/\x1B\[\d+m/g, "");
    }, e.stylize = function(x, g) {
      if (!e.enabled)
        return x + "";
      var v = r[g];
      return !v && g in e ? e[g](x) : v.open + x + v.close;
    };
    var s = /[|\\{}()[\]^$+*?.]/g, a = function(y) {
      if (typeof y != "string")
        throw new TypeError("Expected a string");
      return y.replace(s, "\\$&");
    };
    function c(y) {
      var x = function g() {
        return d.apply(g, arguments);
      };
      return x._styles = y, x.__proto__ = l, x;
    }
    var u = (function() {
      var y = {};
      return r.grey = r.gray, Object.keys(r).forEach(function(x) {
        r[x].closeRe = new RegExp(a(r[x].close), "g"), y[x] = {
          get: function() {
            return c(this._styles.concat(x));
          }
        };
      }), y;
    })(), l = i(function() {
    }, u);
    function d() {
      var y = Array.prototype.slice.call(arguments), x = y.map(function(T) {
        return T != null && T.constructor === String ? T : n.inspect(T);
      }).join(" ");
      if (!e.enabled || !x)
        return x;
      for (var g = x.indexOf(`
`) != -1, v = this._styles, S = v.length; S--; ) {
        var E = r[v[S]];
        x = E.open + x.replace(E.closeRe, E.open) + E.close, g && (x = x.replace(o, function(T) {
          return E.close + T + E.open;
        }));
      }
      return x;
    }
    e.setTheme = function(y) {
      if (typeof y == "string") {
        console.log("colors.setTheme now only accepts an object, not a string.  If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file.  The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");
        return;
      }
      for (var x in y)
        (function(g) {
          e[g] = function(v) {
            if (typeof y[g] == "object") {
              var S = v;
              for (var E in y[g])
                S = e[y[g][E]](S);
              return S;
            }
            return e[y[g]](v);
          };
        })(x);
    };
    function f() {
      var y = {};
      return Object.keys(u).forEach(function(x) {
        y[x] = {
          get: function() {
            return c([x]);
          }
        };
      }), y;
    }
    var m = function(x, g) {
      var v = g.split("");
      return v = v.map(x), v.join("");
    };
    e.trap = Gz(), e.zalgo = qz(), e.maps = {}, e.maps.america = Hz()(e), e.maps.zebra = Wz()(e), e.maps.rainbow = zz()(e), e.maps.random = Kz()(e);
    for (var h in e.maps)
      (function(y) {
        e[y] = function(x) {
          return m(e.maps[y], x);
        };
      })(h);
    i(e, f());
  })(Qv)), Qv.exports;
}
var ck;
function I8() {
  return ck || (ck = 1, (function(t) {
    var e = Vz();
    t.exports = e;
  })(jv)), jv.exports;
}
var Jv = {}, Xv = {}, Vf = {}, uk;
function Yz() {
  return uk || (uk = 1, Vf.levels = {
    error: 0,
    warn: 1,
    help: 2,
    data: 3,
    info: 4,
    debug: 5,
    prompt: 6,
    verbose: 7,
    input: 8,
    silly: 9
  }, Vf.colors = {
    error: "red",
    warn: "yellow",
    help: "cyan",
    data: "grey",
    info: "green",
    debug: "blue",
    prompt: "grey",
    verbose: "cyan",
    input: "grey",
    silly: "magenta"
  }), Vf;
}
var Yf = {}, lk;
function Jz() {
  return lk || (lk = 1, Yf.levels = {
    error: 0,
    warn: 1,
    info: 2,
    http: 3,
    verbose: 4,
    debug: 5,
    silly: 6
  }, Yf.colors = {
    error: "red",
    warn: "yellow",
    info: "green",
    http: "green",
    verbose: "cyan",
    debug: "blue",
    silly: "magenta"
  }), Yf;
}
var Jf = {}, pk;
function Xz() {
  return pk || (pk = 1, Jf.levels = {
    emerg: 0,
    alert: 1,
    crit: 2,
    error: 3,
    warning: 4,
    notice: 5,
    info: 6,
    debug: 7
  }, Jf.colors = {
    emerg: "red",
    alert: "yellow",
    crit: "red",
    error: "red",
    warning: "red",
    notice: "yellow",
    info: "green",
    debug: "blue"
  }), Jf;
}
var dk;
function Zz() {
  return dk || (dk = 1, (function(t) {
    Object.defineProperty(t, "cli", {
      value: Yz()
    }), Object.defineProperty(t, "npm", {
      value: Jz()
    }), Object.defineProperty(t, "syslog", {
      value: Xz()
    });
  })(Xv)), Xv;
}
var fk;
function on() {
  return fk || (fk = 1, (function(t) {
    Object.defineProperty(t, "LEVEL", {
      value: Symbol.for("level")
    }), Object.defineProperty(t, "MESSAGE", {
      value: Symbol.for("message")
    }), Object.defineProperty(t, "SPLAT", {
      value: Symbol.for("splat")
    }), Object.defineProperty(t, "configs", {
      value: Zz()
    });
  })(Jv)), Jv;
}
var hk;
function IE() {
  if (hk) return Rl.exports;
  hk = 1;
  function t(f) {
    "@babel/helpers - typeof";
    return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(m) {
      return typeof m;
    } : function(m) {
      return m && typeof Symbol == "function" && m.constructor === Symbol && m !== Symbol.prototype ? "symbol" : typeof m;
    }, t(f);
  }
  function e(f, m) {
    if (!(f instanceof m)) throw new TypeError("Cannot call a class as a function");
  }
  function n(f, m) {
    for (var h = 0; h < m.length; h++) {
      var y = m[h];
      y.enumerable = y.enumerable || !1, y.configurable = !0, "value" in y && (y.writable = !0), Object.defineProperty(f, i(y.key), y);
    }
  }
  function r(f, m, h) {
    return m && n(f.prototype, m), h && n(f, h), Object.defineProperty(f, "prototype", { writable: !1 }), f;
  }
  function i(f) {
    var m = o(f, "string");
    return t(m) == "symbol" ? m : m + "";
  }
  function o(f, m) {
    if (t(f) != "object" || !f) return f;
    var h = f[Symbol.toPrimitive];
    if (h !== void 0) {
      var y = h.call(f, m);
      if (t(y) != "object") return y;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(f);
  }
  var s = I8(), a = on(), c = a.LEVEL, u = a.MESSAGE;
  s.enabled = !0;
  var l = /\s+/, d = /* @__PURE__ */ (function() {
    function f() {
      var m = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
      e(this, f), m.colors && this.addColors(m.colors), this.options = m;
    }
    return r(f, [{
      key: "addColors",
      value: (
        /*
         * Adds the colors Object to the set of allColors
         * known by the Colorizer
         *
         * @param {Object} colors Set of color mappings to add.
         */
        function(h) {
          return f.addColors(h);
        }
      )
      /*
       * function colorize (lookup, level, message)
       * Performs multi-step colorization using @colors/colors/safe
       */
    }, {
      key: "colorize",
      value: function(h, y, x) {
        if (typeof x > "u" && (x = y), !Array.isArray(f.allColors[h]))
          return s[f.allColors[h]](x);
        for (var g = 0, v = f.allColors[h].length; g < v; g++)
          x = s[f.allColors[h][g]](x);
        return x;
      }
      /*
       * function transform (info, opts)
       * Attempts to colorize the { level, message } of the given
       * `logform` info object.
       */
    }, {
      key: "transform",
      value: function(h, y) {
        return y.all && typeof h[u] == "string" && (h[u] = this.colorize(h[c], h.level, h[u])), (y.level || y.all || !y.message) && (h.level = this.colorize(h[c], h.level)), (y.all || y.message) && (h.message = this.colorize(h[c], h.level, h.message)), h;
      }
    }], [{
      key: "addColors",
      value: function(h) {
        var y = Object.keys(h).reduce(function(x, g) {
          return x[g] = l.test(h[g]) ? h[g].split(l) : h[g], x;
        }, {});
        return f.allColors = Object.assign({}, f.allColors || {}, y), f.allColors;
      }
    }]);
  })();
  return Rl.exports = function(f) {
    return new d(f);
  }, Rl.exports.Colorizer = Rl.exports.Format = d, Rl.exports;
}
var Zv, mk;
function eK() {
  if (mk) return Zv;
  mk = 1;
  var t = IE(), e = t.Colorizer;
  return Zv = function(n) {
    return e.addColors(n.colors || n), n;
  }, Zv;
}
var eb, gk;
function tK() {
  if (gk) return eb;
  gk = 1;
  var t = di();
  return eb = t(function(e) {
    return e.message = "	".concat(e.message), e;
  }), eb;
}
var Xf = { exports: {} }, Bl = { exports: {} }, yk;
function C8() {
  if (yk) return Bl.exports;
  yk = 1;
  function t(g) {
    "@babel/helpers - typeof";
    return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(v) {
      return typeof v;
    } : function(v) {
      return v && typeof Symbol == "function" && v.constructor === Symbol && v !== Symbol.prototype ? "symbol" : typeof v;
    }, t(g);
  }
  function e(g) {
    return o(g) || i(g) || r(g) || n();
  }
  function n() {
    throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
  }
  function r(g, v) {
    if (g) {
      if (typeof g == "string") return s(g, v);
      var S = {}.toString.call(g).slice(8, -1);
      return S === "Object" && g.constructor && (S = g.constructor.name), S === "Map" || S === "Set" ? Array.from(g) : S === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(S) ? s(g, v) : void 0;
    }
  }
  function i(g) {
    if (typeof Symbol < "u" && g[Symbol.iterator] != null || g["@@iterator"] != null) return Array.from(g);
  }
  function o(g) {
    if (Array.isArray(g)) return s(g);
  }
  function s(g, v) {
    (v == null || v > g.length) && (v = g.length);
    for (var S = 0, E = Array(v); S < v; S++) E[S] = g[S];
    return E;
  }
  function a(g, v) {
    if (!(g instanceof v)) throw new TypeError("Cannot call a class as a function");
  }
  function c(g, v) {
    for (var S = 0; S < v.length; S++) {
      var E = v[S];
      E.enumerable = E.enumerable || !1, E.configurable = !0, "value" in E && (E.writable = !0), Object.defineProperty(g, l(E.key), E);
    }
  }
  function u(g, v, S) {
    return v && c(g.prototype, v), S && c(g, S), Object.defineProperty(g, "prototype", { writable: !1 }), g;
  }
  function l(g) {
    var v = d(g, "string");
    return t(v) == "symbol" ? v : v + "";
  }
  function d(g, v) {
    if (t(g) != "object" || !g) return g;
    var S = g[Symbol.toPrimitive];
    if (S !== void 0) {
      var E = S.call(g, v);
      if (t(E) != "object") return E;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(g);
  }
  var f = on(), m = f.configs, h = f.LEVEL, y = f.MESSAGE, x = /* @__PURE__ */ (function() {
    function g() {
      var v = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
        levels: m.npm.levels
      };
      a(this, g), this.paddings = g.paddingForLevels(v.levels, v.filler), this.options = v;
    }
    return u(g, [{
      key: "transform",
      value: (
        /**
         * Prepends the padding onto the `message` based on the `LEVEL` of
         * the `info`. This is based on the behavior of `winston@2` which also
         * prepended the level onto the message.
         *
         * See: https://github.com/winstonjs/winston/blob/2.x/lib/winston/logger.js#L198-L201
         *
         * @param  {Info} info Logform info object
         * @param  {Object} opts Options passed along to this instance.
         * @returns {Info} Modified logform info object.
         */
        function(S, E) {
          return S.message = "".concat(this.paddings[S[h]]).concat(S.message), S[y] && (S[y] = "".concat(this.paddings[S[h]]).concat(S[y])), S;
        }
      )
    }], [{
      key: "getLongestLevel",
      value: function(S) {
        var E = Object.keys(S).map(function(T) {
          return T.length;
        });
        return Math.max.apply(Math, e(E));
      }
      /**
       * Returns the padding for the specified `level` assuming that the
       * maximum length of all levels it's associated with is `maxLength`.
       * @param  {String} level Level to calculate padding for.
       * @param  {String} filler Repeatable text to use for padding.
       * @param  {Number} maxLength Length of the longest level
       * @returns {String} Padding string for the `level`
       */
    }, {
      key: "paddingForLevel",
      value: function(S, E, T) {
        var j = T + 1 - S.length, q = Math.floor(j / E.length), Y = "".concat(E).concat(E.repeat(q));
        return Y.slice(0, j);
      }
      /**
       * Returns an object with the string paddings for the given `levels`
       * using the specified `filler`.
       * @param  {Object} levels Set of all levels to calculate padding for.
       * @param  {String} filler Repeatable text to use for padding.
       * @returns {Object} Mapping of level to desired padding.
       */
    }, {
      key: "paddingForLevels",
      value: function(S) {
        var E = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : " ", T = g.getLongestLevel(S);
        return Object.keys(S).reduce(function(j, q) {
          return j[q] = g.paddingForLevel(q, E, T), j;
        }, {});
      }
    }]);
  })();
  return Bl.exports = function(g) {
    return new x(g);
  }, Bl.exports.Padder = Bl.exports.Format = x, Bl.exports;
}
var vk;
function nK() {
  if (vk) return Xf.exports;
  vk = 1;
  function t(h) {
    "@babel/helpers - typeof";
    return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(y) {
      return typeof y;
    } : function(y) {
      return y && typeof Symbol == "function" && y.constructor === Symbol && y !== Symbol.prototype ? "symbol" : typeof y;
    }, t(h);
  }
  function e(h, y) {
    if (!(h instanceof y)) throw new TypeError("Cannot call a class as a function");
  }
  function n(h, y) {
    for (var x = 0; x < y.length; x++) {
      var g = y[x];
      g.enumerable = g.enumerable || !1, g.configurable = !0, "value" in g && (g.writable = !0), Object.defineProperty(h, i(g.key), g);
    }
  }
  function r(h, y, x) {
    return y && n(h.prototype, y), Object.defineProperty(h, "prototype", { writable: !1 }), h;
  }
  function i(h) {
    var y = o(h, "string");
    return t(y) == "symbol" ? y : y + "";
  }
  function o(h, y) {
    if (t(h) != "object" || !h) return h;
    var x = h[Symbol.toPrimitive];
    if (x !== void 0) {
      var g = x.call(h, y);
      if (t(g) != "object") return g;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(h);
  }
  var s = IE(), a = s.Colorizer, c = C8(), u = c.Padder, l = on(), d = l.configs, f = l.MESSAGE, m = /* @__PURE__ */ (function() {
    function h() {
      var y = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
      e(this, h), y.levels || (y.levels = d.cli.levels), this.colorizer = new a(y), this.padder = new u(y), this.options = y;
    }
    return r(h, [{
      key: "transform",
      value: function(x, g) {
        return this.colorizer.transform(this.padder.transform(x, g), g), x[f] = "".concat(x.level, ":").concat(x.message), x;
      }
    }]);
  })();
  return Xf.exports = function(h) {
    return new m(h);
  }, Xf.exports.Format = m, Xf.exports;
}
var Zf = { exports: {} }, bk;
function rK() {
  if (bk) return Zf.exports;
  bk = 1;
  var t = di();
  function e(r) {
    if (r.every(n))
      return function(i) {
        for (var o = i, s = 0; s < r.length; s++)
          if (o = r[s].transform(o, r[s].options), !o)
            return !1;
        return o;
      };
  }
  function n(r) {
    if (typeof r.transform != "function")
      throw new Error(["No transform function found on format. Did you create a format instance?", "const myFormat = format(formatFn);", "const instance = myFormat();"].join(`
`));
    return !0;
  }
  return Zf.exports = function() {
    for (var r = arguments.length, i = new Array(r), o = 0; o < r; o++)
      i[o] = arguments[o];
    var s = t(e(i)), a = s();
    return a.Format = s.Format, a;
  }, Zf.exports.cascade = e, Zf.exports;
}
var tb, xk;
function iK() {
  if (xk) return tb;
  xk = 1;
  function t(c) {
    "@babel/helpers - typeof";
    return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(u) {
      return typeof u;
    } : function(u) {
      return u && typeof Symbol == "function" && u.constructor === Symbol && u !== Symbol.prototype ? "symbol" : typeof u;
    }, t(c);
  }
  function e(c, u, l) {
    return (u = n(u)) in c ? Object.defineProperty(c, u, { value: l, enumerable: !0, configurable: !0, writable: !0 }) : c[u] = l, c;
  }
  function n(c) {
    var u = r(c, "string");
    return t(u) == "symbol" ? u : u + "";
  }
  function r(c, u) {
    if (t(c) != "object" || !c) return c;
    var l = c[Symbol.toPrimitive];
    if (l !== void 0) {
      var d = l.call(c, u);
      if (t(d) != "object") return d;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (u === "string" ? String : Number)(c);
  }
  var i = di(), o = on(), s = o.LEVEL, a = o.MESSAGE;
  return tb = i(function(c, u) {
    var l = u.stack, d = u.cause;
    if (c instanceof Error) {
      var f = Object.assign({}, c, e(e(e({
        level: c.level
      }, s, c[s] || c.level), "message", c.message), a, c[a] || c.message));
      return l && (f.stack = c.stack), d && (f.cause = c.cause), f;
    }
    if (!(c.message instanceof Error)) return c;
    var m = c.message;
    return Object.assign(c, m), c.message = m.message, c[a] = m.message, l && (c.stack = m.stack), d && (c.cause = m.cause), c;
  }), tb;
}
var eh = { exports: {} }, wk;
function Dd() {
  return wk || (wk = 1, (function(t, e) {
    const { hasOwnProperty: n } = Object.prototype, r = g();
    r.configure = g, r.stringify = r, r.default = r, e.stringify = r, e.configure = g, t.exports = r;
    const i = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;
    function o(v) {
      return v.length < 5e3 && !i.test(v) ? `"${v}"` : JSON.stringify(v);
    }
    function s(v, S) {
      if (v.length > 200 || S)
        return v.sort(S);
      for (let E = 1; E < v.length; E++) {
        const T = v[E];
        let j = E;
        for (; j !== 0 && v[j - 1] > T; )
          v[j] = v[j - 1], j--;
        v[j] = T;
      }
      return v;
    }
    const a = Object.getOwnPropertyDescriptor(
      Object.getPrototypeOf(
        Object.getPrototypeOf(
          new Int8Array()
        )
      ),
      Symbol.toStringTag
    ).get;
    function c(v) {
      return a.call(v) !== void 0 && v.length !== 0;
    }
    function u(v, S, E) {
      v.length < E && (E = v.length);
      const T = S === "," ? "" : " ";
      let j = `"0":${T}${v[0]}`;
      for (let q = 1; q < E; q++)
        j += `${S}"${q}":${T}${v[q]}`;
      return j;
    }
    function l(v) {
      if (n.call(v, "circularValue")) {
        const S = v.circularValue;
        if (typeof S == "string")
          return `"${S}"`;
        if (S == null)
          return S;
        if (S === Error || S === TypeError)
          return {
            toString() {
              throw new TypeError("Converting circular structure to JSON");
            }
          };
        throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined');
      }
      return '"[Circular]"';
    }
    function d(v) {
      let S;
      if (n.call(v, "deterministic") && (S = v.deterministic, typeof S != "boolean" && typeof S != "function"))
        throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');
      return S === void 0 ? !0 : S;
    }
    function f(v, S) {
      let E;
      if (n.call(v, S) && (E = v[S], typeof E != "boolean"))
        throw new TypeError(`The "${S}" argument must be of type boolean`);
      return E === void 0 ? !0 : E;
    }
    function m(v, S) {
      let E;
      if (n.call(v, S)) {
        if (E = v[S], typeof E != "number")
          throw new TypeError(`The "${S}" argument must be of type number`);
        if (!Number.isInteger(E))
          throw new TypeError(`The "${S}" argument must be an integer`);
        if (E < 1)
          throw new RangeError(`The "${S}" argument must be >= 1`);
      }
      return E === void 0 ? 1 / 0 : E;
    }
    function h(v) {
      return v === 1 ? "1 item" : `${v} items`;
    }
    function y(v) {
      const S = /* @__PURE__ */ new Set();
      for (const E of v)
        (typeof E == "string" || typeof E == "number") && S.add(String(E));
      return S;
    }
    function x(v) {
      if (n.call(v, "strict")) {
        const S = v.strict;
        if (typeof S != "boolean")
          throw new TypeError('The "strict" argument must be of type boolean');
        if (S)
          return (E) => {
            let T = `Object can not safely be stringified. Received type ${typeof E}`;
            throw typeof E != "function" && (T += ` (${E.toString()})`), new Error(T);
          };
      }
    }
    function g(v) {
      v = { ...v };
      const S = x(v);
      S && (v.bigint === void 0 && (v.bigint = !1), "circularValue" in v || (v.circularValue = Error));
      const E = l(v), T = f(v, "bigint"), j = d(v), q = typeof j == "function" ? j : void 0, Y = m(v, "maximumDepth"), W = m(v, "maximumBreadth");
      function G(V, K, $, _, I, N) {
        let U = K[V];
        switch (typeof U == "object" && U !== null && typeof U.toJSON == "function" && (U = U.toJSON(V)), U = _.call(K, V, U), typeof U) {
          case "string":
            return o(U);
          case "object": {
            if (U === null)
              return "null";
            if ($.indexOf(U) !== -1)
              return E;
            let C = "", L = ",";
            const k = N;
            if (Array.isArray(U)) {
              if (U.length === 0)
                return "[]";
              if (Y < $.length + 1)
                return '"[Array]"';
              $.push(U), I !== "" && (N += I, C += `
${N}`, L = `,
${N}`);
              const ee = Math.min(U.length, W);
              let P = 0;
              for (; P < ee - 1; P++) {
                const z = G(String(P), U, $, _, I, N);
                C += z !== void 0 ? z : "null", C += L;
              }
              const Q = G(String(P), U, $, _, I, N);
              if (C += Q !== void 0 ? Q : "null", U.length - 1 > W) {
                const z = U.length - W - 1;
                C += `${L}"... ${h(z)} not stringified"`;
              }
              return I !== "" && (C += `
${k}`), $.pop(), `[${C}]`;
            }
            let M = Object.keys(U);
            const F = M.length;
            if (F === 0)
              return "{}";
            if (Y < $.length + 1)
              return '"[Object]"';
            let A = "", O = "";
            I !== "" && (N += I, L = `,
${N}`, A = " ");
            const Z = Math.min(F, W);
            j && !c(U) && (M = s(M, q)), $.push(U);
            for (let ee = 0; ee < Z; ee++) {
              const P = M[ee], Q = G(P, U, $, _, I, N);
              Q !== void 0 && (C += `${O}${o(P)}:${A}${Q}`, O = L);
            }
            if (F > W) {
              const ee = F - W;
              C += `${O}"...":${A}"${h(ee)} not stringified"`, O = L;
            }
            return I !== "" && O.length > 1 && (C = `
${N}${C}
${k}`), $.pop(), `{${C}}`;
          }
          case "number":
            return isFinite(U) ? String(U) : S ? S(U) : "null";
          case "boolean":
            return U === !0 ? "true" : "false";
          case "undefined":
            return;
          case "bigint":
            if (T)
              return String(U);
          // fallthrough
          default:
            return S ? S(U) : void 0;
        }
      }
      function J(V, K, $, _, I, N) {
        switch (typeof K == "object" && K !== null && typeof K.toJSON == "function" && (K = K.toJSON(V)), typeof K) {
          case "string":
            return o(K);
          case "object": {
            if (K === null)
              return "null";
            if ($.indexOf(K) !== -1)
              return E;
            const U = N;
            let C = "", L = ",";
            if (Array.isArray(K)) {
              if (K.length === 0)
                return "[]";
              if (Y < $.length + 1)
                return '"[Array]"';
              $.push(K), I !== "" && (N += I, C += `
${N}`, L = `,
${N}`);
              const F = Math.min(K.length, W);
              let A = 0;
              for (; A < F - 1; A++) {
                const Z = J(String(A), K[A], $, _, I, N);
                C += Z !== void 0 ? Z : "null", C += L;
              }
              const O = J(String(A), K[A], $, _, I, N);
              if (C += O !== void 0 ? O : "null", K.length - 1 > W) {
                const Z = K.length - W - 1;
                C += `${L}"... ${h(Z)} not stringified"`;
              }
              return I !== "" && (C += `
${U}`), $.pop(), `[${C}]`;
            }
            $.push(K);
            let k = "";
            I !== "" && (N += I, L = `,
${N}`, k = " ");
            let M = "";
            for (const F of _) {
              const A = J(F, K[F], $, _, I, N);
              A !== void 0 && (C += `${M}${o(F)}:${k}${A}`, M = L);
            }
            return I !== "" && M.length > 1 && (C = `
${N}${C}
${U}`), $.pop(), `{${C}}`;
          }
          case "number":
            return isFinite(K) ? String(K) : S ? S(K) : "null";
          case "boolean":
            return K === !0 ? "true" : "false";
          case "undefined":
            return;
          case "bigint":
            if (T)
              return String(K);
          // fallthrough
          default:
            return S ? S(K) : void 0;
        }
      }
      function B(V, K, $, _, I) {
        switch (typeof K) {
          case "string":
            return o(K);
          case "object": {
            if (K === null)
              return "null";
            if (typeof K.toJSON == "function") {
              if (K = K.toJSON(V), typeof K != "object")
                return B(V, K, $, _, I);
              if (K === null)
                return "null";
            }
            if ($.indexOf(K) !== -1)
              return E;
            const N = I;
            if (Array.isArray(K)) {
              if (K.length === 0)
                return "[]";
              if (Y < $.length + 1)
                return '"[Array]"';
              $.push(K), I += _;
              let A = `
${I}`;
              const O = `,
${I}`, Z = Math.min(K.length, W);
              let ee = 0;
              for (; ee < Z - 1; ee++) {
                const Q = B(String(ee), K[ee], $, _, I);
                A += Q !== void 0 ? Q : "null", A += O;
              }
              const P = B(String(ee), K[ee], $, _, I);
              if (A += P !== void 0 ? P : "null", K.length - 1 > W) {
                const Q = K.length - W - 1;
                A += `${O}"... ${h(Q)} not stringified"`;
              }
              return A += `
${N}`, $.pop(), `[${A}]`;
            }
            let U = Object.keys(K);
            const C = U.length;
            if (C === 0)
              return "{}";
            if (Y < $.length + 1)
              return '"[Object]"';
            I += _;
            const L = `,
${I}`;
            let k = "", M = "", F = Math.min(C, W);
            c(K) && (k += u(K, L, W), U = U.slice(K.length), F -= K.length, M = L), j && (U = s(U, q)), $.push(K);
            for (let A = 0; A < F; A++) {
              const O = U[A], Z = B(O, K[O], $, _, I);
              Z !== void 0 && (k += `${M}${o(O)}: ${Z}`, M = L);
            }
            if (C > W) {
              const A = C - W;
              k += `${M}"...": "${h(A)} not stringified"`, M = L;
            }
            return M !== "" && (k = `
${I}${k}
${N}`), $.pop(), `{${k}}`;
          }
          case "number":
            return isFinite(K) ? String(K) : S ? S(K) : "null";
          case "boolean":
            return K === !0 ? "true" : "false";
          case "undefined":
            return;
          case "bigint":
            if (T)
              return String(K);
          // fallthrough
          default:
            return S ? S(K) : void 0;
        }
      }
      function D(V, K, $) {
        switch (typeof K) {
          case "string":
            return o(K);
          case "object": {
            if (K === null)
              return "null";
            if (typeof K.toJSON == "function") {
              if (K = K.toJSON(V), typeof K != "object")
                return D(V, K, $);
              if (K === null)
                return "null";
            }
            if ($.indexOf(K) !== -1)
              return E;
            let _ = "";
            const I = K.length !== void 0;
            if (I && Array.isArray(K)) {
              if (K.length === 0)
                return "[]";
              if (Y < $.length + 1)
                return '"[Array]"';
              $.push(K);
              const k = Math.min(K.length, W);
              let M = 0;
              for (; M < k - 1; M++) {
                const A = D(String(M), K[M], $);
                _ += A !== void 0 ? A : "null", _ += ",";
              }
              const F = D(String(M), K[M], $);
              if (_ += F !== void 0 ? F : "null", K.length - 1 > W) {
                const A = K.length - W - 1;
                _ += `,"... ${h(A)} not stringified"`;
              }
              return $.pop(), `[${_}]`;
            }
            let N = Object.keys(K);
            const U = N.length;
            if (U === 0)
              return "{}";
            if (Y < $.length + 1)
              return '"[Object]"';
            let C = "", L = Math.min(U, W);
            I && c(K) && (_ += u(K, ",", W), N = N.slice(K.length), L -= K.length, C = ","), j && (N = s(N, q)), $.push(K);
            for (let k = 0; k < L; k++) {
              const M = N[k], F = D(M, K[M], $);
              F !== void 0 && (_ += `${C}${o(M)}:${F}`, C = ",");
            }
            if (U > W) {
              const k = U - W;
              _ += `${C}"...":"${h(k)} not stringified"`;
            }
            return $.pop(), `{${_}}`;
          }
          case "number":
            return isFinite(K) ? String(K) : S ? S(K) : "null";
          case "boolean":
            return K === !0 ? "true" : "false";
          case "undefined":
            return;
          case "bigint":
            if (T)
              return String(K);
          // fallthrough
          default:
            return S ? S(K) : void 0;
        }
      }
      function X(V, K, $) {
        if (arguments.length > 1) {
          let _ = "";
          if (typeof $ == "number" ? _ = " ".repeat(Math.min($, 10)) : typeof $ == "string" && (_ = $.slice(0, 10)), K != null) {
            if (typeof K == "function")
              return G("", { "": V }, [], K, _, "");
            if (Array.isArray(K))
              return J("", V, [], y(K), _, "");
          }
          if (_.length !== 0)
            return B("", V, [], _, "");
        }
        return D("", V, []);
      }
      return X;
    }
  })(eh, eh.exports)), eh.exports;
}
var nb, Sk;
function oK() {
  if (Sk) return nb;
  Sk = 1;
  var t = di(), e = on(), n = e.MESSAGE, r = Dd();
  function i(o, s) {
    return typeof s == "bigint" ? s.toString() : s;
  }
  return nb = t(function(o, s) {
    var a = r.configure(s);
    return o[n] = a(o, s.replacer || i, s.space), o;
  }), nb;
}
var rb, _k;
function sK() {
  if (_k) return rb;
  _k = 1;
  var t = di();
  return rb = t(function(e, n) {
    return n.message ? (e.message = "[".concat(n.label, "] ").concat(e.message), e) : (e.label = n.label, e);
  }), rb;
}
var ib, Ek;
function aK() {
  if (Ek) return ib;
  Ek = 1;
  var t = di(), e = on(), n = e.MESSAGE, r = Dd();
  return ib = t(function(i) {
    var o = {};
    return i.message && (o["@message"] = i.message, delete i.message), i.timestamp && (o["@timestamp"] = i.timestamp, delete i.timestamp), o["@fields"] = i, i[n] = r(o), i;
  }), ib;
}
var ob, Ak;
function cK() {
  if (Ak) return ob;
  Ak = 1;
  function t(a) {
    "@babel/helpers - typeof";
    return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(c) {
      return typeof c;
    } : function(c) {
      return c && typeof Symbol == "function" && c.constructor === Symbol && c !== Symbol.prototype ? "symbol" : typeof c;
    }, t(a);
  }
  function e(a, c, u) {
    return (c = n(c)) in a ? Object.defineProperty(a, c, { value: u, enumerable: !0, configurable: !0, writable: !0 }) : a[c] = u, a;
  }
  function n(a) {
    var c = r(a, "string");
    return t(c) == "symbol" ? c : c + "";
  }
  function r(a, c) {
    if (t(a) != "object" || !a) return a;
    var u = a[Symbol.toPrimitive];
    if (u !== void 0) {
      var l = u.call(a, c);
      if (t(l) != "object") return l;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (c === "string" ? String : Number)(a);
  }
  var i = di();
  function o(a, c, u) {
    var l = c.reduce(function(f, m) {
      return f[m] = a[m], delete a[m], f;
    }, {}), d = Object.keys(a).reduce(function(f, m) {
      return f[m] = a[m], delete a[m], f;
    }, {});
    return Object.assign(a, l, e({}, u, d)), a;
  }
  function s(a, c, u) {
    return a[u] = c.reduce(function(l, d) {
      return l[d] = a[d], delete a[d], l;
    }, {}), a;
  }
  return ob = i(function(a) {
    var c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = "metadata";
    c.key && (u = c.key);
    var l = [];
    return !c.fillExcept && !c.fillWith && (l.push("level"), l.push("message")), c.fillExcept && (l = c.fillExcept), l.length > 0 ? o(a, l, u) : c.fillWith ? s(a, c.fillWith, u) : a;
  }), ob;
}
var sb, Ik;
function uK() {
  if (Ik) return sb;
  Ik = 1;
  var t = void 0, e = di(), n = x6();
  return sb = e(function(r) {
    var i = +/* @__PURE__ */ new Date();
    return t.diff = i - (t.prevTime || i), t.prevTime = i, r.ms = "+".concat(n(t.diff)), r;
  }), sb;
}
var ab, Ck;
function lK() {
  if (Ck) return ab;
  Ck = 1;
  var t = _n.inspect, e = di(), n = on(), r = n.LEVEL, i = n.MESSAGE, o = n.SPLAT;
  return ab = e(function(s) {
    var a = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, c = Object.assign({}, s);
    return delete c[r], delete c[i], delete c[o], s[i] = t(c, !1, a.depth || null, a.colorize), s;
  }), ab;
}
var Ul = { exports: {} }, Tk;
function pK() {
  if (Tk) return Ul.exports;
  Tk = 1;
  function t(u) {
    "@babel/helpers - typeof";
    return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(l) {
      return typeof l;
    } : function(l) {
      return l && typeof Symbol == "function" && l.constructor === Symbol && l !== Symbol.prototype ? "symbol" : typeof l;
    }, t(u);
  }
  function e(u, l) {
    if (!(u instanceof l)) throw new TypeError("Cannot call a class as a function");
  }
  function n(u, l) {
    for (var d = 0; d < l.length; d++) {
      var f = l[d];
      f.enumerable = f.enumerable || !1, f.configurable = !0, "value" in f && (f.writable = !0), Object.defineProperty(u, i(f.key), f);
    }
  }
  function r(u, l, d) {
    return l && n(u.prototype, l), Object.defineProperty(u, "prototype", { writable: !1 }), u;
  }
  function i(u) {
    var l = o(u, "string");
    return t(l) == "symbol" ? l : l + "";
  }
  function o(u, l) {
    if (t(u) != "object" || !u) return u;
    var d = u[Symbol.toPrimitive];
    if (d !== void 0) {
      var f = d.call(u, l);
      if (t(f) != "object") return f;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(u);
  }
  var s = on(), a = s.MESSAGE, c = /* @__PURE__ */ (function() {
    function u(l) {
      e(this, u), this.template = l;
    }
    return r(u, [{
      key: "transform",
      value: function(d) {
        return d[a] = this.template(d), d;
      }
    }]);
  })();
  return Ul.exports = function(u) {
    return new c(u);
  }, Ul.exports.Printf = Ul.exports.Format = c, Ul.exports;
}
var cb, kk;
function dK() {
  if (kk) return cb;
  kk = 1;
  var t = di(), e = on(), n = e.MESSAGE, r = Dd();
  return cb = t(function(i) {
    var o = r(Object.assign({}, i, {
      level: void 0,
      message: void 0,
      splat: void 0
    })), s = i.padding && i.padding[i.level] || "";
    return o !== "{}" ? i[n] = "".concat(i.level, ":").concat(s, " ").concat(i.message, " ").concat(o) : i[n] = "".concat(i.level, ":").concat(s, " ").concat(i.message), i;
  }), cb;
}
var ub, Nk;
function fK() {
  if (Nk) return ub;
  Nk = 1;
  function t(v) {
    "@babel/helpers - typeof";
    return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(S) {
      return typeof S;
    } : function(S) {
      return S && typeof Symbol == "function" && S.constructor === Symbol && S !== Symbol.prototype ? "symbol" : typeof S;
    }, t(v);
  }
  function e(v) {
    return o(v) || i(v) || r(v) || n();
  }
  function n() {
    throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
  }
  function r(v, S) {
    if (v) {
      if (typeof v == "string") return s(v, S);
      var E = {}.toString.call(v).slice(8, -1);
      return E === "Object" && v.constructor && (E = v.constructor.name), E === "Map" || E === "Set" ? Array.from(v) : E === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(E) ? s(v, S) : void 0;
    }
  }
  function i(v) {
    if (typeof Symbol < "u" && v[Symbol.iterator] != null || v["@@iterator"] != null) return Array.from(v);
  }
  function o(v) {
    if (Array.isArray(v)) return s(v);
  }
  function s(v, S) {
    (S == null || S > v.length) && (S = v.length);
    for (var E = 0, T = Array(S); E < S; E++) T[E] = v[E];
    return T;
  }
  function a(v, S) {
    if (!(v instanceof S)) throw new TypeError("Cannot call a class as a function");
  }
  function c(v, S) {
    for (var E = 0; E < S.length; E++) {
      var T = S[E];
      T.enumerable = T.enumerable || !1, T.configurable = !0, "value" in T && (T.writable = !0), Object.defineProperty(v, l(T.key), T);
    }
  }
  function u(v, S, E) {
    return S && c(v.prototype, S), Object.defineProperty(v, "prototype", { writable: !1 }), v;
  }
  function l(v) {
    var S = d(v, "string");
    return t(S) == "symbol" ? S : S + "";
  }
  function d(v, S) {
    if (t(v) != "object" || !v) return v;
    var E = v[Symbol.toPrimitive];
    if (E !== void 0) {
      var T = E.call(v, S);
      if (t(T) != "object") return T;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(v);
  }
  var f = _n, m = on(), h = m.SPLAT, y = /%[scdjifoO%]/g, x = /%%/g, g = /* @__PURE__ */ (function() {
    function v(S) {
      a(this, v), this.options = S;
    }
    return u(v, [{
      key: "_splat",
      value: function(E, T) {
        var j = E.message, q = E[h] || E.splat || [], Y = j.match(x), W = Y && Y.length || 0, G = T.length - W, J = G - q.length, B = J < 0 ? q.splice(J, -1 * J) : [], D = B.length;
        if (D)
          for (var X = 0; X < D; X++)
            Object.assign(E, B[X]);
        return E.message = f.format.apply(f, [j].concat(e(q))), E;
      }
      /**
        * Transforms the `info` message by using `util.format` to complete
        * any `info.message` provided it has string interpolation tokens.
        * If no tokens exist then `info` is immutable.
        *
        * @param  {Info} info Logform info message.
        * @param  {Object} opts Options for this instance.
        * @returns {Info} Modified info message
        */
    }, {
      key: "transform",
      value: function(E) {
        var T = E.message, j = E[h] || E.splat;
        if (!j || !j.length)
          return E;
        var q = T && T.match && T.match(y);
        if (!q && (j || j.length)) {
          var Y = j.length > 1 ? j.splice(0) : j, W = Y.length;
          if (W)
            for (var G = 0; G < W; G++)
              Object.assign(E, Y[G]);
          return E;
        }
        return q ? this._splat(E, q) : E;
      }
    }]);
  })();
  return ub = function(v) {
    return new g(v);
  }, ub;
}
var T8 = /d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g, Us = "\\d\\d?", Ms = "\\d\\d", hK = "\\d{3}", mK = "\\d{4}", Op = "[^\\s]+", k8 = /\[([^]*?)\]/gm;
function N8(t, e) {
  for (var n = [], r = 0, i = t.length; r < i; r++)
    n.push(t[r].substr(0, e));
  return n;
}
var Pk = function(t) {
  return function(e, n) {
    var r = n[t].map(function(o) {
      return o.toLowerCase();
    }), i = r.indexOf(e.toLowerCase());
    return i > -1 ? i : null;
  };
};
function ta(t) {
  for (var e = [], n = 1; n < arguments.length; n++)
    e[n - 1] = arguments[n];
  for (var r = 0, i = e; r < i.length; r++) {
    var o = i[r];
    for (var s in o)
      t[s] = o[s];
  }
  return t;
}
var P8 = [
  "Sunday",
  "Monday",
  "Tuesday",
  "Wednesday",
  "Thursday",
  "Friday",
  "Saturday"
], D8 = [
  "January",
  "February",
  "March",
  "April",
  "May",
  "June",
  "July",
  "August",
  "September",
  "October",
  "November",
  "December"
], gK = N8(D8, 3), yK = N8(P8, 3), CE = {
  dayNamesShort: yK,
  dayNames: P8,
  monthNamesShort: gK,
  monthNames: D8,
  amPm: ["am", "pm"],
  DoFn: function(t) {
    return t + ["th", "st", "nd", "rd"][t % 10 > 3 ? 0 : (t - t % 10 !== 10 ? 1 : 0) * t % 10];
  }
}, Nm = ta({}, CE), F8 = function(t) {
  return Nm = ta(Nm, t);
}, Dk = function(t) {
  return t.replace(/[|\\{()[^$+*?.-]/g, "\\$&");
}, Dr = function(t, e) {
  for (e === void 0 && (e = 2), t = String(t); t.length < e; )
    t = "0" + t;
  return t;
}, vK = {
  D: function(t) {
    return String(t.getDate());
  },
  DD: function(t) {
    return Dr(t.getDate());
  },
  Do: function(t, e) {
    return e.DoFn(t.getDate());
  },
  d: function(t) {
    return String(t.getDay());
  },
  dd: function(t) {
    return Dr(t.getDay());
  },
  ddd: function(t, e) {
    return e.dayNamesShort[t.getDay()];
  },
  dddd: function(t, e) {
    return e.dayNames[t.getDay()];
  },
  M: function(t) {
    return String(t.getMonth() + 1);
  },
  MM: function(t) {
    return Dr(t.getMonth() + 1);
  },
  MMM: function(t, e) {
    return e.monthNamesShort[t.getMonth()];
  },
  MMMM: function(t, e) {
    return e.monthNames[t.getMonth()];
  },
  YY: function(t) {
    return Dr(String(t.getFullYear()), 4).substr(2);
  },
  YYYY: function(t) {
    return Dr(t.getFullYear(), 4);
  },
  h: function(t) {
    return String(t.getHours() % 12 || 12);
  },
  hh: function(t) {
    return Dr(t.getHours() % 12 || 12);
  },
  H: function(t) {
    return String(t.getHours());
  },
  HH: function(t) {
    return Dr(t.getHours());
  },
  m: function(t) {
    return String(t.getMinutes());
  },
  mm: function(t) {
    return Dr(t.getMinutes());
  },
  s: function(t) {
    return String(t.getSeconds());
  },
  ss: function(t) {
    return Dr(t.getSeconds());
  },
  S: function(t) {
    return String(Math.round(t.getMilliseconds() / 100));
  },
  SS: function(t) {
    return Dr(Math.round(t.getMilliseconds() / 10), 2);
  },
  SSS: function(t) {
    return Dr(t.getMilliseconds(), 3);
  },
  a: function(t, e) {
    return t.getHours() < 12 ? e.amPm[0] : e.amPm[1];
  },
  A: function(t, e) {
    return t.getHours() < 12 ? e.amPm[0].toUpperCase() : e.amPm[1].toUpperCase();
  },
  ZZ: function(t) {
    var e = t.getTimezoneOffset();
    return (e > 0 ? "-" : "+") + Dr(Math.floor(Math.abs(e) / 60) * 100 + Math.abs(e) % 60, 4);
  },
  Z: function(t) {
    var e = t.getTimezoneOffset();
    return (e > 0 ? "-" : "+") + Dr(Math.floor(Math.abs(e) / 60), 2) + ":" + Dr(Math.abs(e) % 60, 2);
  }
}, Fk = function(t) {
  return +t - 1;
}, Ok = [null, Us], Mk = [null, Op], Rk = [
  "isPm",
  Op,
  function(t, e) {
    var n = t.toLowerCase();
    return n === e.amPm[0] ? 0 : n === e.amPm[1] ? 1 : null;
  }
], Bk = [
  "timezoneOffset",
  "[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",
  function(t) {
    var e = (t + "").match(/([+-]|\d\d)/gi);
    if (e) {
      var n = +e[1] * 60 + parseInt(e[2], 10);
      return e[0] === "+" ? n : -n;
    }
    return 0;
  }
], bK = {
  D: ["day", Us],
  DD: ["day", Ms],
  Do: ["day", Us + Op, function(t) {
    return parseInt(t, 10);
  }],
  M: ["month", Us, Fk],
  MM: ["month", Ms, Fk],
  YY: [
    "year",
    Ms,
    function(t) {
      var e = /* @__PURE__ */ new Date(), n = +("" + e.getFullYear()).substr(0, 2);
      return +("" + (+t > 68 ? n - 1 : n) + t);
    }
  ],
  h: ["hour", Us, void 0, "isPm"],
  hh: ["hour", Ms, void 0, "isPm"],
  H: ["hour", Us],
  HH: ["hour", Ms],
  m: ["minute", Us],
  mm: ["minute", Ms],
  s: ["second", Us],
  ss: ["second", Ms],
  YYYY: ["year", mK],
  S: ["millisecond", "\\d", function(t) {
    return +t * 100;
  }],
  SS: ["millisecond", Ms, function(t) {
    return +t * 10;
  }],
  SSS: ["millisecond", hK],
  d: Ok,
  dd: Ok,
  ddd: Mk,
  dddd: Mk,
  MMM: ["month", Op, Pk("monthNamesShort")],
  MMMM: ["month", Op, Pk("monthNames")],
  a: Rk,
  A: Rk,
  ZZ: Bk,
  Z: Bk
}, Pm = {
  default: "ddd MMM DD YYYY HH:mm:ss",
  shortDate: "M/D/YY",
  mediumDate: "MMM D, YYYY",
  longDate: "MMMM D, YYYY",
  fullDate: "dddd, MMMM D, YYYY",
  isoDate: "YYYY-MM-DD",
  isoDateTime: "YYYY-MM-DDTHH:mm:ssZ",
  shortTime: "HH:mm",
  mediumTime: "HH:mm:ss",
  longTime: "HH:mm:ss.SSS"
}, O8 = function(t) {
  return ta(Pm, t);
}, M8 = function(t, e, n) {
  if (e === void 0 && (e = Pm.default), n === void 0 && (n = {}), typeof t == "number" && (t = new Date(t)), Object.prototype.toString.call(t) !== "[object Date]" || isNaN(t.getTime()))
    throw new Error("Invalid Date pass to format");
  e = Pm[e] || e;
  var r = [];
  e = e.replace(k8, function(o, s) {
    return r.push(s), "@@@";
  });
  var i = ta(ta({}, Nm), n);
  return e = e.replace(T8, function(o) {
    return vK[o](t, i);
  }), e.replace(/@@@/g, function() {
    return r.shift();
  });
};
function R8(t, e, n) {
  if (n === void 0 && (n = {}), typeof e != "string")
    throw new Error("Invalid format in fecha parse");
  if (e = Pm[e] || e, t.length > 1e3)
    return null;
  var r = /* @__PURE__ */ new Date(), i = {
    year: r.getFullYear(),
    month: 0,
    day: 1,
    hour: 0,
    minute: 0,
    second: 0,
    millisecond: 0,
    isPm: null,
    timezoneOffset: null
  }, o = [], s = [], a = e.replace(k8, function(E, T) {
    return s.push(Dk(T)), "@@@";
  }), c = {}, u = {};
  a = Dk(a).replace(T8, function(E) {
    var T = bK[E], j = T[0], q = T[1], Y = T[3];
    if (c[j])
      throw new Error("Invalid format. " + j + " specified twice in format");
    return c[j] = !0, Y && (u[Y] = !0), o.push(T), "(" + q + ")";
  }), Object.keys(u).forEach(function(E) {
    if (!c[E])
      throw new Error("Invalid format. " + E + " is required in specified format");
  }), a = a.replace(/@@@/g, function() {
    return s.shift();
  });
  var l = t.match(new RegExp(a, "i"));
  if (!l)
    return null;
  for (var d = ta(ta({}, Nm), n), f = 1; f < l.length; f++) {
    var m = o[f - 1], h = m[0], y = m[2], x = y ? y(l[f], d) : +l[f];
    if (x == null)
      return null;
    i[h] = x;
  }
  i.isPm === 1 && i.hour != null && +i.hour != 12 ? i.hour = +i.hour + 12 : i.isPm === 0 && +i.hour == 12 && (i.hour = 0);
  var g;
  if (i.timezoneOffset == null) {
    g = new Date(i.year, i.month, i.day, i.hour, i.minute, i.second, i.millisecond);
    for (var v = [
      ["month", "getMonth"],
      ["day", "getDate"],
      ["hour", "getHours"],
      ["minute", "getMinutes"],
      ["second", "getSeconds"]
    ], f = 0, S = v.length; f < S; f++)
      if (c[v[f][0]] && i[v[f][0]] !== g[v[f][1]]())
        return null;
  } else if (g = new Date(Date.UTC(i.year, i.month, i.day, i.hour, i.minute - i.timezoneOffset, i.second, i.millisecond)), i.month > 11 || i.month < 0 || i.day > 31 || i.day < 1 || i.hour > 23 || i.hour < 0 || i.minute > 59 || i.minute < 0 || i.second > 59 || i.second < 0)
    return null;
  return g;
}
var xK = {
  format: M8,
  parse: R8,
  defaultI18n: CE,
  setGlobalDateI18n: F8,
  setGlobalDateMasks: O8
};
const wK = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  assign: ta,
  default: xK,
  defaultI18n: CE,
  format: M8,
  parse: R8,
  setGlobalDateI18n: F8,
  setGlobalDateMasks: O8
}, Symbol.toStringTag, { value: "Module" })), SK = /* @__PURE__ */ NO(wK);
var lb, Uk;
function _K() {
  if (Uk) return lb;
  Uk = 1;
  var t = SK, e = di();
  return lb = e(function(n) {
    var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    return r.format && (n.timestamp = typeof r.format == "function" ? r.format() : t.format(/* @__PURE__ */ new Date(), r.format)), n.timestamp || (n.timestamp = (/* @__PURE__ */ new Date()).toISOString()), r.alias && (n[r.alias] = n.timestamp), n;
  }), lb;
}
var pb, Lk;
function EK() {
  if (Lk) return pb;
  Lk = 1;
  var t = I8(), e = di(), n = on(), r = n.MESSAGE;
  return pb = e(function(i, o) {
    return o.level !== !1 && (i.level = t.strip(i.level)), o.message !== !1 && (i.message = t.strip(String(i.message))), o.raw !== !1 && i[r] && (i[r] = t.strip(String(i[r]))), i;
  }), pb;
}
var jk;
function B8() {
  if (jk) return Kf;
  jk = 1;
  var t = Kf.format = di();
  return Kf.levels = eK(), Object.defineProperty(t, "align", {
    value: tK()
  }), Object.defineProperty(t, "cli", {
    value: nK()
  }), Object.defineProperty(t, "colorize", {
    value: IE()
  }), Object.defineProperty(t, "combine", {
    value: rK()
  }), Object.defineProperty(t, "errors", {
    value: iK()
  }), Object.defineProperty(t, "json", {
    value: oK()
  }), Object.defineProperty(t, "label", {
    value: sK()
  }), Object.defineProperty(t, "logstash", {
    value: aK()
  }), Object.defineProperty(t, "metadata", {
    value: cK()
  }), Object.defineProperty(t, "ms", {
    value: uK()
  }), Object.defineProperty(t, "padLevels", {
    value: C8()
  }), Object.defineProperty(t, "prettyPrint", {
    value: lK()
  }), Object.defineProperty(t, "printf", {
    value: pK()
  }), Object.defineProperty(t, "simple", {
    value: dK()
  }), Object.defineProperty(t, "splat", {
    value: fK()
  }), Object.defineProperty(t, "timestamp", {
    value: _K()
  }), Object.defineProperty(t, "uncolorize", {
    value: EK()
  }), Kf;
}
var db = {}, Qk;
function U8() {
  return Qk || (Qk = 1, (function(t) {
    var e = _n, n = e.format;
    t.warn = {
      deprecated: function(i) {
        return function() {
          throw new Error(n("{ %s } was removed in winston@3.0.0.", i));
        };
      },
      useFormat: function(i) {
        return function() {
          throw new Error([n("{ %s } was removed in winston@3.0.0.", i), "Use a custom winston.format = winston.format(function) instead."].join(`
`));
        };
      },
      forFunctions: function(i, o, s) {
        s.forEach(function(a) {
          i[a] = t.warn[o](a);
        });
      },
      forProperties: function(i, o, s) {
        s.forEach(function(a) {
          var c = t.warn[o](a);
          Object.defineProperty(i, a, {
            get: c,
            set: c
          });
        });
      }
    };
  })(db)), db;
}
const AK = "3.18.3", IK = {
  version: AK
};
var fb = {}, th = { exports: {} }, hb = { exports: {} }, mb, $k;
function L8() {
  return $k || ($k = 1, mb = xs.EventEmitter), mb;
}
var gb, Gk;
function j8() {
  if (Gk) return gb;
  Gk = 1;
  function t(s, a) {
    var c = this, u = this._readableState && this._readableState.destroyed, l = this._writableState && this._writableState.destroyed;
    return u || l ? (a ? a(s) : s && (this._writableState ? this._writableState.errorEmitted || (this._writableState.errorEmitted = !0, process.nextTick(i, this, s)) : process.nextTick(i, this, s)), this) : (this._readableState && (this._readableState.destroyed = !0), this._writableState && (this._writableState.destroyed = !0), this._destroy(s || null, function(d) {
      !a && d ? c._writableState ? c._writableState.errorEmitted ? process.nextTick(n, c) : (c._writableState.errorEmitted = !0, process.nextTick(e, c, d)) : process.nextTick(e, c, d) : a ? (process.nextTick(n, c), a(d)) : process.nextTick(n, c);
    }), this);
  }
  function e(s, a) {
    i(s, a), n(s);
  }
  function n(s) {
    s._writableState && !s._writableState.emitClose || s._readableState && !s._readableState.emitClose || s.emit("close");
  }
  function r() {
    this._readableState && (this._readableState.destroyed = !1, this._readableState.reading = !1, this._readableState.ended = !1, this._readableState.endEmitted = !1), this._writableState && (this._writableState.destroyed = !1, this._writableState.ended = !1, this._writableState.ending = !1, this._writableState.finalCalled = !1, this._writableState.prefinished = !1, this._writableState.finished = !1, this._writableState.errorEmitted = !1);
  }
  function i(s, a) {
    s.emit("error", a);
  }
  function o(s, a) {
    var c = s._readableState, u = s._writableState;
    c && c.autoDestroy || u && u.autoDestroy ? s.destroy(a) : s.emit("error", a);
  }
  return gb = {
    destroy: t,
    undestroy: r,
    errorOrDestroy: o
  }, gb;
}
var yb = {}, qk;
function Ku() {
  if (qk) return yb;
  qk = 1;
  function t(a, c) {
    a.prototype = Object.create(c.prototype), a.prototype.constructor = a, a.__proto__ = c;
  }
  var e = {};
  function n(a, c, u) {
    u || (u = Error);
    function l(f, m, h) {
      return typeof c == "string" ? c : c(f, m, h);
    }
    var d = /* @__PURE__ */ (function(f) {
      t(m, f);
      function m(h, y, x) {
        return f.call(this, l(h, y, x)) || this;
      }
      return m;
    })(u);
    d.prototype.name = u.name, d.prototype.code = a, e[a] = d;
  }
  function r(a, c) {
    if (Array.isArray(a)) {
      var u = a.length;
      return a = a.map(function(l) {
        return String(l);
      }), u > 2 ? "one of ".concat(c, " ").concat(a.slice(0, u - 1).join(", "), ", or ") + a[u - 1] : u === 2 ? "one of ".concat(c, " ").concat(a[0], " or ").concat(a[1]) : "of ".concat(c, " ").concat(a[0]);
    } else
      return "of ".concat(c, " ").concat(String(a));
  }
  function i(a, c, u) {
    return a.substr(0, c.length) === c;
  }
  function o(a, c, u) {
    return (u === void 0 || u > a.length) && (u = a.length), a.substring(u - c.length, u) === c;
  }
  function s(a, c, u) {
    return typeof u != "number" && (u = 0), u + c.length > a.length ? !1 : a.indexOf(c, u) !== -1;
  }
  return n("ERR_INVALID_OPT_VALUE", function(a, c) {
    return 'The value "' + c + '" is invalid for option "' + a + '"';
  }, TypeError), n("ERR_INVALID_ARG_TYPE", function(a, c, u) {
    var l;
    typeof c == "string" && i(c, "not ") ? (l = "must not be", c = c.replace(/^not /, "")) : l = "must be";
    var d;
    if (o(a, " argument"))
      d = "The ".concat(a, " ").concat(l, " ").concat(r(c, "type"));
    else {
      var f = s(a, ".") ? "property" : "argument";
      d = 'The "'.concat(a, '" ').concat(f, " ").concat(l, " ").concat(r(c, "type"));
    }
    return d += ". Received type ".concat(typeof u), d;
  }, TypeError), n("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF"), n("ERR_METHOD_NOT_IMPLEMENTED", function(a) {
    return "The " + a + " method is not implemented";
  }), n("ERR_STREAM_PREMATURE_CLOSE", "Premature close"), n("ERR_STREAM_DESTROYED", function(a) {
    return "Cannot call " + a + " after a stream was destroyed";
  }), n("ERR_MULTIPLE_CALLBACK", "Callback called multiple times"), n("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable"), n("ERR_STREAM_WRITE_AFTER_END", "write after end"), n("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError), n("ERR_UNKNOWN_ENCODING", function(a) {
    return "Unknown encoding: " + a;
  }, TypeError), n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event"), yb.codes = e, yb;
}
var vb, Hk;
function Q8() {
  if (Hk) return vb;
  Hk = 1;
  var t = Ku().codes.ERR_INVALID_OPT_VALUE;
  function e(r, i, o) {
    return r.highWaterMark != null ? r.highWaterMark : i ? r[o] : null;
  }
  function n(r, i, o, s) {
    var a = e(i, s, o);
    if (a != null) {
      if (!(isFinite(a) && Math.floor(a) === a) || a < 0) {
        var c = s ? o : "highWaterMark";
        throw new t(c, a);
      }
      return Math.floor(a);
    }
    return r.objectMode ? 16 : 16 * 1024;
  }
  return vb = {
    getHighWaterMark: n
  }, vb;
}
var bb, Wk;
function CK() {
  if (Wk) return bb;
  Wk = 1;
  function t(h, y) {
    var x = Object.keys(h);
    if (Object.getOwnPropertySymbols) {
      var g = Object.getOwnPropertySymbols(h);
      y && (g = g.filter(function(v) {
        return Object.getOwnPropertyDescriptor(h, v).enumerable;
      })), x.push.apply(x, g);
    }
    return x;
  }
  function e(h) {
    for (var y = 1; y < arguments.length; y++) {
      var x = arguments[y] != null ? arguments[y] : {};
      y % 2 ? t(Object(x), !0).forEach(function(g) {
        n(h, g, x[g]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(h, Object.getOwnPropertyDescriptors(x)) : t(Object(x)).forEach(function(g) {
        Object.defineProperty(h, g, Object.getOwnPropertyDescriptor(x, g));
      });
    }
    return h;
  }
  function n(h, y, x) {
    return y = s(y), y in h ? Object.defineProperty(h, y, { value: x, enumerable: !0, configurable: !0, writable: !0 }) : h[y] = x, h;
  }
  function r(h, y) {
    if (!(h instanceof y))
      throw new TypeError("Cannot call a class as a function");
  }
  function i(h, y) {
    for (var x = 0; x < y.length; x++) {
      var g = y[x];
      g.enumerable = g.enumerable || !1, g.configurable = !0, "value" in g && (g.writable = !0), Object.defineProperty(h, s(g.key), g);
    }
  }
  function o(h, y, x) {
    return y && i(h.prototype, y), Object.defineProperty(h, "prototype", { writable: !1 }), h;
  }
  function s(h) {
    var y = a(h, "string");
    return typeof y == "symbol" ? y : String(y);
  }
  function a(h, y) {
    if (typeof h != "object" || h === null) return h;
    var x = h[Symbol.toPrimitive];
    if (x !== void 0) {
      var g = x.call(h, y);
      if (typeof g != "object") return g;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(h);
  }
  var c = pa, u = c.Buffer, l = _n, d = l.inspect, f = d && d.custom || "inspect";
  function m(h, y, x) {
    u.prototype.copy.call(h, y, x);
  }
  return bb = /* @__PURE__ */ (function() {
    function h() {
      r(this, h), this.head = null, this.tail = null, this.length = 0;
    }
    return o(h, [{
      key: "push",
      value: function(x) {
        var g = {
          data: x,
          next: null
        };
        this.length > 0 ? this.tail.next = g : this.head = g, this.tail = g, ++this.length;
      }
    }, {
      key: "unshift",
      value: function(x) {
        var g = {
          data: x,
          next: this.head
        };
        this.length === 0 && (this.tail = g), this.head = g, ++this.length;
      }
    }, {
      key: "shift",
      value: function() {
        if (this.length !== 0) {
          var x = this.head.data;
          return this.length === 1 ? this.head = this.tail = null : this.head = this.head.next, --this.length, x;
        }
      }
    }, {
      key: "clear",
      value: function() {
        this.head = this.tail = null, this.length = 0;
      }
    }, {
      key: "join",
      value: function(x) {
        if (this.length === 0) return "";
        for (var g = this.head, v = "" + g.data; g = g.next; ) v += x + g.data;
        return v;
      }
    }, {
      key: "concat",
      value: function(x) {
        if (this.length === 0) return u.alloc(0);
        for (var g = u.allocUnsafe(x >>> 0), v = this.head, S = 0; v; )
          m(v.data, g, S), S += v.data.length, v = v.next;
        return g;
      }
      // Consumes a specified amount of bytes or characters from the buffered data.
    }, {
      key: "consume",
      value: function(x, g) {
        var v;
        return x < this.head.data.length ? (v = this.head.data.slice(0, x), this.head.data = this.head.data.slice(x)) : x === this.head.data.length ? v = this.shift() : v = g ? this._getString(x) : this._getBuffer(x), v;
      }
    }, {
      key: "first",
      value: function() {
        return this.head.data;
      }
      // Consumes a specified amount of characters from the buffered data.
    }, {
      key: "_getString",
      value: function(x) {
        var g = this.head, v = 1, S = g.data;
        for (x -= S.length; g = g.next; ) {
          var E = g.data, T = x > E.length ? E.length : x;
          if (T === E.length ? S += E : S += E.slice(0, x), x -= T, x === 0) {
            T === E.length ? (++v, g.next ? this.head = g.next : this.head = this.tail = null) : (this.head = g, g.data = E.slice(T));
            break;
          }
          ++v;
        }
        return this.length -= v, S;
      }
      // Consumes a specified amount of bytes from the buffered data.
    }, {
      key: "_getBuffer",
      value: function(x) {
        var g = u.allocUnsafe(x), v = this.head, S = 1;
        for (v.data.copy(g), x -= v.data.length; v = v.next; ) {
          var E = v.data, T = x > E.length ? E.length : x;
          if (E.copy(g, g.length - x, 0, T), x -= T, x === 0) {
            T === E.length ? (++S, v.next ? this.head = v.next : this.head = this.tail = null) : (this.head = v, v.data = E.slice(T));
            break;
          }
          ++S;
        }
        return this.length -= S, g;
      }
      // Make sure the linked list only shows the minimal necessary information.
    }, {
      key: f,
      value: function(x, g) {
        return d(this, e(e({}, g), {}, {
          // Only inspect one level.
          depth: 0,
          // It should not recurse.
          customInspect: !1
        }));
      }
    }]), h;
  })(), bb;
}
var xb = {}, zk;
function Kk() {
  if (zk) return xb;
  zk = 1;
  var t = Wg().Buffer, e = t.isEncoding || function(g) {
    switch (g = "" + g, g && g.toLowerCase()) {
      case "hex":
      case "utf8":
      case "utf-8":
      case "ascii":
      case "binary":
      case "base64":
      case "ucs2":
      case "ucs-2":
      case "utf16le":
      case "utf-16le":
      case "raw":
        return !0;
      default:
        return !1;
    }
  };
  function n(g) {
    if (!g) return "utf8";
    for (var v; ; )
      switch (g) {
        case "utf8":
        case "utf-8":
          return "utf8";
        case "ucs2":
        case "ucs-2":
        case "utf16le":
        case "utf-16le":
          return "utf16le";
        case "latin1":
        case "binary":
          return "latin1";
        case "base64":
        case "ascii":
        case "hex":
          return g;
        default:
          if (v) return;
          g = ("" + g).toLowerCase(), v = !0;
      }
  }
  function r(g) {
    var v = n(g);
    if (typeof v != "string" && (t.isEncoding === e || !e(g))) throw new Error("Unknown encoding: " + g);
    return v || g;
  }
  xb.StringDecoder = i;
  function i(g) {
    this.encoding = r(g);
    var v;
    switch (this.encoding) {
      case "utf16le":
        this.text = d, this.end = f, v = 4;
        break;
      case "utf8":
        this.fillLast = c, v = 4;
        break;
      case "base64":
        this.text = m, this.end = h, v = 3;
        break;
      default:
        this.write = y, this.end = x;
        return;
    }
    this.lastNeed = 0, this.lastTotal = 0, this.lastChar = t.allocUnsafe(v);
  }
  i.prototype.write = function(g) {
    if (g.length === 0) return "";
    var v, S;
    if (this.lastNeed) {
      if (v = this.fillLast(g), v === void 0) return "";
      S = this.lastNeed, this.lastNeed = 0;
    } else
      S = 0;
    return S < g.length ? v ? v + this.text(g, S) : this.text(g, S) : v || "";
  }, i.prototype.end = l, i.prototype.text = u, i.prototype.fillLast = function(g) {
    if (this.lastNeed <= g.length)
      return g.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal);
    g.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, g.length), this.lastNeed -= g.length;
  };
  function o(g) {
    return g <= 127 ? 0 : g >> 5 === 6 ? 2 : g >> 4 === 14 ? 3 : g >> 3 === 30 ? 4 : g >> 6 === 2 ? -1 : -2;
  }
  function s(g, v, S) {
    var E = v.length - 1;
    if (E < S) return 0;
    var T = o(v[E]);
    return T >= 0 ? (T > 0 && (g.lastNeed = T - 1), T) : --E < S || T === -2 ? 0 : (T = o(v[E]), T >= 0 ? (T > 0 && (g.lastNeed = T - 2), T) : --E < S || T === -2 ? 0 : (T = o(v[E]), T >= 0 ? (T > 0 && (T === 2 ? T = 0 : g.lastNeed = T - 3), T) : 0));
  }
  function a(g, v, S) {
    if ((v[0] & 192) !== 128)
      return g.lastNeed = 0, "�";
    if (g.lastNeed > 1 && v.length > 1) {
      if ((v[1] & 192) !== 128)
        return g.lastNeed = 1, "�";
      if (g.lastNeed > 2 && v.length > 2 && (v[2] & 192) !== 128)
        return g.lastNeed = 2, "�";
    }
  }
  function c(g) {
    var v = this.lastTotal - this.lastNeed, S = a(this, g);
    if (S !== void 0) return S;
    if (this.lastNeed <= g.length)
      return g.copy(this.lastChar, v, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal);
    g.copy(this.lastChar, v, 0, g.length), this.lastNeed -= g.length;
  }
  function u(g, v) {
    var S = s(this, g, v);
    if (!this.lastNeed) return g.toString("utf8", v);
    this.lastTotal = S;
    var E = g.length - (S - this.lastNeed);
    return g.copy(this.lastChar, 0, E), g.toString("utf8", v, E);
  }
  function l(g) {
    var v = g && g.length ? this.write(g) : "";
    return this.lastNeed ? v + "�" : v;
  }
  function d(g, v) {
    if ((g.length - v) % 2 === 0) {
      var S = g.toString("utf16le", v);
      if (S) {
        var E = S.charCodeAt(S.length - 1);
        if (E >= 55296 && E <= 56319)
          return this.lastNeed = 2, this.lastTotal = 4, this.lastChar[0] = g[g.length - 2], this.lastChar[1] = g[g.length - 1], S.slice(0, -1);
      }
      return S;
    }
    return this.lastNeed = 1, this.lastTotal = 2, this.lastChar[0] = g[g.length - 1], g.toString("utf16le", v, g.length - 1);
  }
  function f(g) {
    var v = g && g.length ? this.write(g) : "";
    if (this.lastNeed) {
      var S = this.lastTotal - this.lastNeed;
      return v + this.lastChar.toString("utf16le", 0, S);
    }
    return v;
  }
  function m(g, v) {
    var S = (g.length - v) % 3;
    return S === 0 ? g.toString("base64", v) : (this.lastNeed = 3 - S, this.lastTotal = 3, S === 1 ? this.lastChar[0] = g[g.length - 1] : (this.lastChar[0] = g[g.length - 2], this.lastChar[1] = g[g.length - 1]), g.toString("base64", v, g.length - S));
  }
  function h(g) {
    var v = g && g.length ? this.write(g) : "";
    return this.lastNeed ? v + this.lastChar.toString("base64", 0, 3 - this.lastNeed) : v;
  }
  function y(g) {
    return g.toString(this.encoding);
  }
  function x(g) {
    return g && g.length ? this.write(g) : "";
  }
  return xb;
}
var wb, Vk;
function TE() {
  if (Vk) return wb;
  Vk = 1;
  var t = Ku().codes.ERR_STREAM_PREMATURE_CLOSE;
  function e(o) {
    var s = !1;
    return function() {
      if (!s) {
        s = !0;
        for (var a = arguments.length, c = new Array(a), u = 0; u < a; u++)
          c[u] = arguments[u];
        o.apply(this, c);
      }
    };
  }
  function n() {
  }
  function r(o) {
    return o.setHeader && typeof o.abort == "function";
  }
  function i(o, s, a) {
    if (typeof s == "function") return i(o, null, s);
    s || (s = {}), a = e(a || n);
    var c = s.readable || s.readable !== !1 && o.readable, u = s.writable || s.writable !== !1 && o.writable, l = function() {
      o.writable || f();
    }, d = o._writableState && o._writableState.finished, f = function() {
      u = !1, d = !0, c || a.call(o);
    }, m = o._readableState && o._readableState.endEmitted, h = function() {
      c = !1, m = !0, u || a.call(o);
    }, y = function(S) {
      a.call(o, S);
    }, x = function() {
      var S;
      if (c && !m)
        return (!o._readableState || !o._readableState.ended) && (S = new t()), a.call(o, S);
      if (u && !d)
        return (!o._writableState || !o._writableState.ended) && (S = new t()), a.call(o, S);
    }, g = function() {
      o.req.on("finish", f);
    };
    return r(o) ? (o.on("complete", f), o.on("abort", x), o.req ? g() : o.on("request", g)) : u && !o._writableState && (o.on("end", l), o.on("close", l)), o.on("end", h), o.on("finish", f), s.error !== !1 && o.on("error", y), o.on("close", x), function() {
      o.removeListener("complete", f), o.removeListener("abort", x), o.removeListener("request", g), o.req && o.req.removeListener("finish", f), o.removeListener("end", l), o.removeListener("close", l), o.removeListener("finish", f), o.removeListener("end", h), o.removeListener("error", y), o.removeListener("close", x);
    };
  }
  return wb = i, wb;
}
var Sb, Yk;
function TK() {
  if (Yk) return Sb;
  Yk = 1;
  var t;
  function e(S, E, T) {
    return E = n(E), E in S ? Object.defineProperty(S, E, { value: T, enumerable: !0, configurable: !0, writable: !0 }) : S[E] = T, S;
  }
  function n(S) {
    var E = r(S, "string");
    return typeof E == "symbol" ? E : String(E);
  }
  function r(S, E) {
    if (typeof S != "object" || S === null) return S;
    var T = S[Symbol.toPrimitive];
    if (T !== void 0) {
      var j = T.call(S, E);
      if (typeof j != "object") return j;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (E === "string" ? String : Number)(S);
  }
  var i = TE(), o = Symbol("lastResolve"), s = Symbol("lastReject"), a = Symbol("error"), c = Symbol("ended"), u = Symbol("lastPromise"), l = Symbol("handlePromise"), d = Symbol("stream");
  function f(S, E) {
    return {
      value: S,
      done: E
    };
  }
  function m(S) {
    var E = S[o];
    if (E !== null) {
      var T = S[d].read();
      T !== null && (S[u] = null, S[o] = null, S[s] = null, E(f(T, !1)));
    }
  }
  function h(S) {
    process.nextTick(m, S);
  }
  function y(S, E) {
    return function(T, j) {
      S.then(function() {
        if (E[c]) {
          T(f(void 0, !0));
          return;
        }
        E[l](T, j);
      }, j);
    };
  }
  var x = Object.getPrototypeOf(function() {
  }), g = Object.setPrototypeOf((t = {
    get stream() {
      return this[d];
    },
    next: function() {
      var E = this, T = this[a];
      if (T !== null)
        return Promise.reject(T);
      if (this[c])
        return Promise.resolve(f(void 0, !0));
      if (this[d].destroyed)
        return new Promise(function(W, G) {
          process.nextTick(function() {
            E[a] ? G(E[a]) : W(f(void 0, !0));
          });
        });
      var j = this[u], q;
      if (j)
        q = new Promise(y(j, this));
      else {
        var Y = this[d].read();
        if (Y !== null)
          return Promise.resolve(f(Y, !1));
        q = new Promise(this[l]);
      }
      return this[u] = q, q;
    }
  }, e(t, Symbol.asyncIterator, function() {
    return this;
  }), e(t, "return", function() {
    var E = this;
    return new Promise(function(T, j) {
      E[d].destroy(null, function(q) {
        if (q) {
          j(q);
          return;
        }
        T(f(void 0, !0));
      });
    });
  }), t), x), v = function(E) {
    var T, j = Object.create(g, (T = {}, e(T, d, {
      value: E,
      writable: !0
    }), e(T, o, {
      value: null,
      writable: !0
    }), e(T, s, {
      value: null,
      writable: !0
    }), e(T, a, {
      value: null,
      writable: !0
    }), e(T, c, {
      value: E._readableState.endEmitted,
      writable: !0
    }), e(T, l, {
      value: function(Y, W) {
        var G = j[d].read();
        G ? (j[u] = null, j[o] = null, j[s] = null, Y(f(G, !1))) : (j[o] = Y, j[s] = W);
      },
      writable: !0
    }), T));
    return j[u] = null, i(E, function(q) {
      if (q && q.code !== "ERR_STREAM_PREMATURE_CLOSE") {
        var Y = j[s];
        Y !== null && (j[u] = null, j[o] = null, j[s] = null, Y(q)), j[a] = q;
        return;
      }
      var W = j[o];
      W !== null && (j[u] = null, j[o] = null, j[s] = null, W(f(void 0, !0))), j[c] = !0;
    }), E.on("readable", h.bind(null, j)), j;
  };
  return Sb = v, Sb;
}
var _b, Jk;
function kK() {
  return Jk || (Jk = 1, _b = function() {
    throw new Error("Readable.from is not available in the browser");
  }), _b;
}
var Eb, Xk;
function $8() {
  if (Xk) return Eb;
  Xk = 1, Eb = W;
  var t;
  W.ReadableState = Y, xs.EventEmitter;
  var e = function(Q, z) {
    return Q.listeners(z).length;
  }, n = L8(), r = pa.Buffer, i = (typeof On < "u" ? On : typeof window < "u" ? window : typeof self < "u" ? self : {}).Uint8Array || function() {
  };
  function o(P) {
    return r.from(P);
  }
  function s(P) {
    return r.isBuffer(P) || P instanceof i;
  }
  var a = _n, c;
  a && a.debuglog ? c = a.debuglog("stream") : c = function() {
  };
  var u = CK(), l = j8(), d = Q8(), f = d.getHighWaterMark, m = Ku().codes, h = m.ERR_INVALID_ARG_TYPE, y = m.ERR_STREAM_PUSH_AFTER_EOF, x = m.ERR_METHOD_NOT_IMPLEMENTED, g = m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT, v, S, E;
  fo()(W, n);
  var T = l.errorOrDestroy, j = ["error", "close", "destroy", "pause", "resume"];
  function q(P, Q, z) {
    if (typeof P.prependListener == "function") return P.prependListener(Q, z);
    !P._events || !P._events[Q] ? P.on(Q, z) : Array.isArray(P._events[Q]) ? P._events[Q].unshift(z) : P._events[Q] = [z, P._events[Q]];
  }
  function Y(P, Q, z) {
    t = t || fu(), P = P || {}, typeof z != "boolean" && (z = Q instanceof t), this.objectMode = !!P.objectMode, z && (this.objectMode = this.objectMode || !!P.readableObjectMode), this.highWaterMark = f(this, P, "readableHighWaterMark", z), this.buffer = new u(), this.length = 0, this.pipes = null, this.pipesCount = 0, this.flowing = null, this.ended = !1, this.endEmitted = !1, this.reading = !1, this.sync = !0, this.needReadable = !1, this.emittedReadable = !1, this.readableListening = !1, this.resumeScheduled = !1, this.paused = !0, this.emitClose = P.emitClose !== !1, this.autoDestroy = !!P.autoDestroy, this.destroyed = !1, this.defaultEncoding = P.defaultEncoding || "utf8", this.awaitDrain = 0, this.readingMore = !1, this.decoder = null, this.encoding = null, P.encoding && (v || (v = Kk().StringDecoder), this.decoder = new v(P.encoding), this.encoding = P.encoding);
  }
  function W(P) {
    if (t = t || fu(), !(this instanceof W)) return new W(P);
    var Q = this instanceof t;
    this._readableState = new Y(P, this, Q), this.readable = !0, P && (typeof P.read == "function" && (this._read = P.read), typeof P.destroy == "function" && (this._destroy = P.destroy)), n.call(this);
  }
  Object.defineProperty(W.prototype, "destroyed", {
    // making it explicit this property is not enumerable
    // because otherwise some prototype manipulation in
    // userland will fail
    enumerable: !1,
    get: function() {
      return this._readableState === void 0 ? !1 : this._readableState.destroyed;
    },
    set: function(Q) {
      this._readableState && (this._readableState.destroyed = Q);
    }
  }), W.prototype.destroy = l.destroy, W.prototype._undestroy = l.undestroy, W.prototype._destroy = function(P, Q) {
    Q(P);
  }, W.prototype.push = function(P, Q) {
    var z = this._readableState, se;
    return z.objectMode ? se = !0 : typeof P == "string" && (Q = Q || z.defaultEncoding, Q !== z.encoding && (P = r.from(P, Q), Q = ""), se = !0), G(this, P, Q, !1, se);
  }, W.prototype.unshift = function(P) {
    return G(this, P, null, !0, !1);
  };
  function G(P, Q, z, se, ae) {
    c("readableAddChunk", Q);
    var ie = P._readableState;
    if (Q === null)
      ie.reading = !1, K(P, ie);
    else {
      var we;
      if (ae || (we = B(ie, Q)), we)
        T(P, we);
      else if (ie.objectMode || Q && Q.length > 0)
        if (typeof Q != "string" && !ie.objectMode && Object.getPrototypeOf(Q) !== r.prototype && (Q = o(Q)), se)
          ie.endEmitted ? T(P, new g()) : J(P, ie, Q, !0);
        else if (ie.ended)
          T(P, new y());
        else {
          if (ie.destroyed)
            return !1;
          ie.reading = !1, ie.decoder && !z ? (Q = ie.decoder.write(Q), ie.objectMode || Q.length !== 0 ? J(P, ie, Q, !1) : I(P, ie)) : J(P, ie, Q, !1);
        }
      else se || (ie.reading = !1, I(P, ie));
    }
    return !ie.ended && (ie.length < ie.highWaterMark || ie.length === 0);
  }
  function J(P, Q, z, se) {
    Q.flowing && Q.length === 0 && !Q.sync ? (Q.awaitDrain = 0, P.emit("data", z)) : (Q.length += Q.objectMode ? 1 : z.length, se ? Q.buffer.unshift(z) : Q.buffer.push(z), Q.needReadable && $(P)), I(P, Q);
  }
  function B(P, Q) {
    var z;
    return !s(Q) && typeof Q != "string" && Q !== void 0 && !P.objectMode && (z = new h("chunk", ["string", "Buffer", "Uint8Array"], Q)), z;
  }
  W.prototype.isPaused = function() {
    return this._readableState.flowing === !1;
  }, W.prototype.setEncoding = function(P) {
    v || (v = Kk().StringDecoder);
    var Q = new v(P);
    this._readableState.decoder = Q, this._readableState.encoding = this._readableState.decoder.encoding;
    for (var z = this._readableState.buffer.head, se = ""; z !== null; )
      se += Q.write(z.data), z = z.next;
    return this._readableState.buffer.clear(), se !== "" && this._readableState.buffer.push(se), this._readableState.length = se.length, this;
  };
  var D = 1073741824;
  function X(P) {
    return P >= D ? P = D : (P--, P |= P >>> 1, P |= P >>> 2, P |= P >>> 4, P |= P >>> 8, P |= P >>> 16, P++), P;
  }
  function V(P, Q) {
    return P <= 0 || Q.length === 0 && Q.ended ? 0 : Q.objectMode ? 1 : P !== P ? Q.flowing && Q.length ? Q.buffer.head.data.length : Q.length : (P > Q.highWaterMark && (Q.highWaterMark = X(P)), P <= Q.length ? P : Q.ended ? Q.length : (Q.needReadable = !0, 0));
  }
  W.prototype.read = function(P) {
    c("read", P), P = parseInt(P, 10);
    var Q = this._readableState, z = P;
    if (P !== 0 && (Q.emittedReadable = !1), P === 0 && Q.needReadable && ((Q.highWaterMark !== 0 ? Q.length >= Q.highWaterMark : Q.length > 0) || Q.ended))
      return c("read: emitReadable", Q.length, Q.ended), Q.length === 0 && Q.ended ? O(this) : $(this), null;
    if (P = V(P, Q), P === 0 && Q.ended)
      return Q.length === 0 && O(this), null;
    var se = Q.needReadable;
    c("need readable", se), (Q.length === 0 || Q.length - P < Q.highWaterMark) && (se = !0, c("length less than watermark", se)), Q.ended || Q.reading ? (se = !1, c("reading or ended", se)) : se && (c("do read"), Q.reading = !0, Q.sync = !0, Q.length === 0 && (Q.needReadable = !0), this._read(Q.highWaterMark), Q.sync = !1, Q.reading || (P = V(z, Q)));
    var ae;
    return P > 0 ? ae = A(P, Q) : ae = null, ae === null ? (Q.needReadable = Q.length <= Q.highWaterMark, P = 0) : (Q.length -= P, Q.awaitDrain = 0), Q.length === 0 && (Q.ended || (Q.needReadable = !0), z !== P && Q.ended && O(this)), ae !== null && this.emit("data", ae), ae;
  };
  function K(P, Q) {
    if (c("onEofChunk"), !Q.ended) {
      if (Q.decoder) {
        var z = Q.decoder.end();
        z && z.length && (Q.buffer.push(z), Q.length += Q.objectMode ? 1 : z.length);
      }
      Q.ended = !0, Q.sync ? $(P) : (Q.needReadable = !1, Q.emittedReadable || (Q.emittedReadable = !0, _(P)));
    }
  }
  function $(P) {
    var Q = P._readableState;
    c("emitReadable", Q.needReadable, Q.emittedReadable), Q.needReadable = !1, Q.emittedReadable || (c("emitReadable", Q.flowing), Q.emittedReadable = !0, process.nextTick(_, P));
  }
  function _(P) {
    var Q = P._readableState;
    c("emitReadable_", Q.destroyed, Q.length, Q.ended), !Q.destroyed && (Q.length || Q.ended) && (P.emit("readable"), Q.emittedReadable = !1), Q.needReadable = !Q.flowing && !Q.ended && Q.length <= Q.highWaterMark, F(P);
  }
  function I(P, Q) {
    Q.readingMore || (Q.readingMore = !0, process.nextTick(N, P, Q));
  }
  function N(P, Q) {
    for (; !Q.reading && !Q.ended && (Q.length < Q.highWaterMark || Q.flowing && Q.length === 0); ) {
      var z = Q.length;
      if (c("maybeReadMore read 0"), P.read(0), z === Q.length)
        break;
    }
    Q.readingMore = !1;
  }
  W.prototype._read = function(P) {
    T(this, new x("_read()"));
  }, W.prototype.pipe = function(P, Q) {
    var z = this, se = this._readableState;
    switch (se.pipesCount) {
      case 0:
        se.pipes = P;
        break;
      case 1:
        se.pipes = [se.pipes, P];
        break;
      default:
        se.pipes.push(P);
        break;
    }
    se.pipesCount += 1, c("pipe count=%d opts=%j", se.pipesCount, Q);
    var ae = (!Q || Q.end !== !1) && P !== process.stdout && P !== process.stderr, ie = ae ? Oe : Er;
    se.endEmitted ? process.nextTick(ie) : z.once("end", ie), P.on("unpipe", we);
    function we(st, Zn) {
      c("onunpipe"), st === z && Zn && Zn.hasUnpiped === !1 && (Zn.hasUnpiped = !0, Ye());
    }
    function Oe() {
      c("onend"), P.end();
    }
    var He = U(z);
    P.on("drain", He);
    var We = !1;
    function Ye() {
      c("cleanup"), P.removeListener("close", qe), P.removeListener("finish", Nt), P.removeListener("drain", He), P.removeListener("error", nt), P.removeListener("unpipe", we), z.removeListener("end", Oe), z.removeListener("end", Er), z.removeListener("data", Ke), We = !0, se.awaitDrain && (!P._writableState || P._writableState.needDrain) && He();
    }
    z.on("data", Ke);
    function Ke(st) {
      c("ondata");
      var Zn = P.write(st);
      c("dest.write", Zn), Zn === !1 && ((se.pipesCount === 1 && se.pipes === P || se.pipesCount > 1 && ee(se.pipes, P) !== -1) && !We && (c("false write response, pause", se.awaitDrain), se.awaitDrain++), z.pause());
    }
    function nt(st) {
      c("onerror", st), Er(), P.removeListener("error", nt), e(P, "error") === 0 && T(P, st);
    }
    q(P, "error", nt);
    function qe() {
      P.removeListener("finish", Nt), Er();
    }
    P.once("close", qe);
    function Nt() {
      c("onfinish"), P.removeListener("close", qe), Er();
    }
    P.once("finish", Nt);
    function Er() {
      c("unpipe"), z.unpipe(P);
    }
    return P.emit("pipe", z), se.flowing || (c("pipe resume"), z.resume()), P;
  };
  function U(P) {
    return function() {
      var z = P._readableState;
      c("pipeOnDrain", z.awaitDrain), z.awaitDrain && z.awaitDrain--, z.awaitDrain === 0 && e(P, "data") && (z.flowing = !0, F(P));
    };
  }
  W.prototype.unpipe = function(P) {
    var Q = this._readableState, z = {
      hasUnpiped: !1
    };
    if (Q.pipesCount === 0) return this;
    if (Q.pipesCount === 1)
      return P && P !== Q.pipes ? this : (P || (P = Q.pipes), Q.pipes = null, Q.pipesCount = 0, Q.flowing = !1, P && P.emit("unpipe", this, z), this);
    if (!P) {
      var se = Q.pipes, ae = Q.pipesCount;
      Q.pipes = null, Q.pipesCount = 0, Q.flowing = !1;
      for (var ie = 0; ie < ae; ie++) se[ie].emit("unpipe", this, {
        hasUnpiped: !1
      });
      return this;
    }
    var we = ee(Q.pipes, P);
    return we === -1 ? this : (Q.pipes.splice(we, 1), Q.pipesCount -= 1, Q.pipesCount === 1 && (Q.pipes = Q.pipes[0]), P.emit("unpipe", this, z), this);
  }, W.prototype.on = function(P, Q) {
    var z = n.prototype.on.call(this, P, Q), se = this._readableState;
    return P === "data" ? (se.readableListening = this.listenerCount("readable") > 0, se.flowing !== !1 && this.resume()) : P === "readable" && !se.endEmitted && !se.readableListening && (se.readableListening = se.needReadable = !0, se.flowing = !1, se.emittedReadable = !1, c("on readable", se.length, se.reading), se.length ? $(this) : se.reading || process.nextTick(L, this)), z;
  }, W.prototype.addListener = W.prototype.on, W.prototype.removeListener = function(P, Q) {
    var z = n.prototype.removeListener.call(this, P, Q);
    return P === "readable" && process.nextTick(C, this), z;
  }, W.prototype.removeAllListeners = function(P) {
    var Q = n.prototype.removeAllListeners.apply(this, arguments);
    return (P === "readable" || P === void 0) && process.nextTick(C, this), Q;
  };
  function C(P) {
    var Q = P._readableState;
    Q.readableListening = P.listenerCount("readable") > 0, Q.resumeScheduled && !Q.paused ? Q.flowing = !0 : P.listenerCount("data") > 0 && P.resume();
  }
  function L(P) {
    c("readable nexttick read 0"), P.read(0);
  }
  W.prototype.resume = function() {
    var P = this._readableState;
    return P.flowing || (c("resume"), P.flowing = !P.readableListening, k(this, P)), P.paused = !1, this;
  };
  function k(P, Q) {
    Q.resumeScheduled || (Q.resumeScheduled = !0, process.nextTick(M, P, Q));
  }
  function M(P, Q) {
    c("resume", Q.reading), Q.reading || P.read(0), Q.resumeScheduled = !1, P.emit("resume"), F(P), Q.flowing && !Q.reading && P.read(0);
  }
  W.prototype.pause = function() {
    return c("call pause flowing=%j", this._readableState.flowing), this._readableState.flowing !== !1 && (c("pause"), this._readableState.flowing = !1, this.emit("pause")), this._readableState.paused = !0, this;
  };
  function F(P) {
    var Q = P._readableState;
    for (c("flow", Q.flowing); Q.flowing && P.read() !== null; ) ;
  }
  W.prototype.wrap = function(P) {
    var Q = this, z = this._readableState, se = !1;
    P.on("end", function() {
      if (c("wrapped end"), z.decoder && !z.ended) {
        var we = z.decoder.end();
        we && we.length && Q.push(we);
      }
      Q.push(null);
    }), P.on("data", function(we) {
      if (c("wrapped data"), z.decoder && (we = z.decoder.write(we)), !(z.objectMode && we == null) && !(!z.objectMode && (!we || !we.length))) {
        var Oe = Q.push(we);
        Oe || (se = !0, P.pause());
      }
    });
    for (var ae in P)
      this[ae] === void 0 && typeof P[ae] == "function" && (this[ae] = /* @__PURE__ */ (function(Oe) {
        return function() {
          return P[Oe].apply(P, arguments);
        };
      })(ae));
    for (var ie = 0; ie < j.length; ie++)
      P.on(j[ie], this.emit.bind(this, j[ie]));
    return this._read = function(we) {
      c("wrapped _read", we), se && (se = !1, P.resume());
    }, this;
  }, typeof Symbol == "function" && (W.prototype[Symbol.asyncIterator] = function() {
    return S === void 0 && (S = TK()), S(this);
  }), Object.defineProperty(W.prototype, "readableHighWaterMark", {
    // making it explicit this property is not enumerable
    // because otherwise some prototype manipulation in
    // userland will fail
    enumerable: !1,
    get: function() {
      return this._readableState.highWaterMark;
    }
  }), Object.defineProperty(W.prototype, "readableBuffer", {
    // making it explicit this property is not enumerable
    // because otherwise some prototype manipulation in
    // userland will fail
    enumerable: !1,
    get: function() {
      return this._readableState && this._readableState.buffer;
    }
  }), Object.defineProperty(W.prototype, "readableFlowing", {
    // making it explicit this property is not enumerable
    // because otherwise some prototype manipulation in
    // userland will fail
    enumerable: !1,
    get: function() {
      return this._readableState.flowing;
    },
    set: function(Q) {
      this._readableState && (this._readableState.flowing = Q);
    }
  }), W._fromList = A, Object.defineProperty(W.prototype, "readableLength", {
    // making it explicit this property is not enumerable
    // because otherwise some prototype manipulation in
    // userland will fail
    enumerable: !1,
    get: function() {
      return this._readableState.length;
    }
  });
  function A(P, Q) {
    if (Q.length === 0) return null;
    var z;
    return Q.objectMode ? z = Q.buffer.shift() : !P || P >= Q.length ? (Q.decoder ? z = Q.buffer.join("") : Q.buffer.length === 1 ? z = Q.buffer.first() : z = Q.buffer.concat(Q.length), Q.buffer.clear()) : z = Q.buffer.consume(P, Q.decoder), z;
  }
  function O(P) {
    var Q = P._readableState;
    c("endReadable", Q.endEmitted), Q.endEmitted || (Q.ended = !0, process.nextTick(Z, Q, P));
  }
  function Z(P, Q) {
    if (c("endReadableNT", P.endEmitted, P.length), !P.endEmitted && P.length === 0 && (P.endEmitted = !0, Q.readable = !1, Q.emit("end"), P.autoDestroy)) {
      var z = Q._writableState;
      (!z || z.autoDestroy && z.finished) && Q.destroy();
    }
  }
  typeof Symbol == "function" && (W.from = function(P, Q) {
    return E === void 0 && (E = kK()), E(W, P, Q);
  });
  function ee(P, Q) {
    for (var z = 0, se = P.length; z < se; z++)
      if (P[z] === Q) return z;
    return -1;
  }
  return Eb;
}
var Ab, Zk;
function fu() {
  if (Zk) return Ab;
  Zk = 1;
  var t = Object.keys || function(u) {
    var l = [];
    for (var d in u) l.push(d);
    return l;
  };
  Ab = s;
  var e = $8(), n = Xg();
  fo()(s, e);
  for (var r = t(n.prototype), i = 0; i < r.length; i++) {
    var o = r[i];
    s.prototype[o] || (s.prototype[o] = n.prototype[o]);
  }
  function s(u) {
    if (!(this instanceof s)) return new s(u);
    e.call(this, u), n.call(this, u), this.allowHalfOpen = !0, u && (u.readable === !1 && (this.readable = !1), u.writable === !1 && (this.writable = !1), u.allowHalfOpen === !1 && (this.allowHalfOpen = !1, this.once("end", a)));
  }
  Object.defineProperty(s.prototype, "writableHighWaterMark", {
    // making it explicit this property is not enumerable
    // because otherwise some prototype manipulation in
    // userland will fail
    enumerable: !1,
    get: function() {
      return this._writableState.highWaterMark;
    }
  }), Object.defineProperty(s.prototype, "writableBuffer", {
    // making it explicit this property is not enumerable
    // because otherwise some prototype manipulation in
    // userland will fail
    enumerable: !1,
    get: function() {
      return this._writableState && this._writableState.getBuffer();
    }
  }), Object.defineProperty(s.prototype, "writableLength", {
    // making it explicit this property is not enumerable
    // because otherwise some prototype manipulation in
    // userland will fail
    enumerable: !1,
    get: function() {
      return this._writableState.length;
    }
  });
  function a() {
    this._writableState.ended || process.nextTick(c, this);
  }
  function c(u) {
    u.end();
  }
  return Object.defineProperty(s.prototype, "destroyed", {
    // making it explicit this property is not enumerable
    // because otherwise some prototype manipulation in
    // userland will fail
    enumerable: !1,
    get: function() {
      return this._readableState === void 0 || this._writableState === void 0 ? !1 : this._readableState.destroyed && this._writableState.destroyed;
    },
    set: function(l) {
      this._readableState === void 0 || this._writableState === void 0 || (this._readableState.destroyed = l, this._writableState.destroyed = l);
    }
  }), Ab;
}
var Ib, e4;
function Xg() {
  if (e4) return Ib;
  e4 = 1, Ib = Y;
  function t(F) {
    var A = this;
    this.next = null, this.entry = null, this.finish = function() {
      M(A, F);
    };
  }
  var e;
  Y.WritableState = j;
  var n = {
    deprecate: s8()
  }, r = L8(), i = pa.Buffer, o = (typeof On < "u" ? On : typeof window < "u" ? window : typeof self < "u" ? self : {}).Uint8Array || function() {
  };
  function s(F) {
    return i.from(F);
  }
  function a(F) {
    return i.isBuffer(F) || F instanceof o;
  }
  var c = j8(), u = Q8(), l = u.getHighWaterMark, d = Ku().codes, f = d.ERR_INVALID_ARG_TYPE, m = d.ERR_METHOD_NOT_IMPLEMENTED, h = d.ERR_MULTIPLE_CALLBACK, y = d.ERR_STREAM_CANNOT_PIPE, x = d.ERR_STREAM_DESTROYED, g = d.ERR_STREAM_NULL_VALUES, v = d.ERR_STREAM_WRITE_AFTER_END, S = d.ERR_UNKNOWN_ENCODING, E = c.errorOrDestroy;
  fo()(Y, r);
  function T() {
  }
  function j(F, A, O) {
    e = e || fu(), F = F || {}, typeof O != "boolean" && (O = A instanceof e), this.objectMode = !!F.objectMode, O && (this.objectMode = this.objectMode || !!F.writableObjectMode), this.highWaterMark = l(this, F, "writableHighWaterMark", O), this.finalCalled = !1, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1, this.destroyed = !1;
    var Z = F.decodeStrings === !1;
    this.decodeStrings = !Z, this.defaultEncoding = F.defaultEncoding || "utf8", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = function(ee) {
      K(A, ee);
    }, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = !1, this.errorEmitted = !1, this.emitClose = F.emitClose !== !1, this.autoDestroy = !!F.autoDestroy, this.bufferedRequestCount = 0, this.corkedRequestsFree = new t(this);
  }
  j.prototype.getBuffer = function() {
    for (var A = this.bufferedRequest, O = []; A; )
      O.push(A), A = A.next;
    return O;
  }, (function() {
    try {
      Object.defineProperty(j.prototype, "buffer", {
        get: n.deprecate(function() {
          return this.getBuffer();
        }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003")
      });
    } catch {
    }
  })();
  var q;
  typeof Symbol == "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] == "function" ? (q = Function.prototype[Symbol.hasInstance], Object.defineProperty(Y, Symbol.hasInstance, {
    value: function(A) {
      return q.call(this, A) ? !0 : this !== Y ? !1 : A && A._writableState instanceof j;
    }
  })) : q = function(A) {
    return A instanceof this;
  };
  function Y(F) {
    e = e || fu();
    var A = this instanceof e;
    if (!A && !q.call(Y, this)) return new Y(F);
    this._writableState = new j(F, this, A), this.writable = !0, F && (typeof F.write == "function" && (this._write = F.write), typeof F.writev == "function" && (this._writev = F.writev), typeof F.destroy == "function" && (this._destroy = F.destroy), typeof F.final == "function" && (this._final = F.final)), r.call(this);
  }
  Y.prototype.pipe = function() {
    E(this, new y());
  };
  function W(F, A) {
    var O = new v();
    E(F, O), process.nextTick(A, O);
  }
  function G(F, A, O, Z) {
    var ee;
    return O === null ? ee = new g() : typeof O != "string" && !A.objectMode && (ee = new f("chunk", ["string", "Buffer"], O)), ee ? (E(F, ee), process.nextTick(Z, ee), !1) : !0;
  }
  Y.prototype.write = function(F, A, O) {
    var Z = this._writableState, ee = !1, P = !Z.objectMode && a(F);
    return P && !i.isBuffer(F) && (F = s(F)), typeof A == "function" && (O = A, A = null), P ? A = "buffer" : A || (A = Z.defaultEncoding), typeof O != "function" && (O = T), Z.ending ? W(this, O) : (P || G(this, Z, F, O)) && (Z.pendingcb++, ee = B(this, Z, P, F, A, O)), ee;
  }, Y.prototype.cork = function() {
    this._writableState.corked++;
  }, Y.prototype.uncork = function() {
    var F = this._writableState;
    F.corked && (F.corked--, !F.writing && !F.corked && !F.bufferProcessing && F.bufferedRequest && I(this, F));
  }, Y.prototype.setDefaultEncoding = function(A) {
    if (typeof A == "string" && (A = A.toLowerCase()), !(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((A + "").toLowerCase()) > -1)) throw new S(A);
    return this._writableState.defaultEncoding = A, this;
  }, Object.defineProperty(Y.prototype, "writableBuffer", {
    // making it explicit this property is not enumerable
    // because otherwise some prototype manipulation in
    // userland will fail
    enumerable: !1,
    get: function() {
      return this._writableState && this._writableState.getBuffer();
    }
  });
  function J(F, A, O) {
    return !F.objectMode && F.decodeStrings !== !1 && typeof A == "string" && (A = i.from(A, O)), A;
  }
  Object.defineProperty(Y.prototype, "writableHighWaterMark", {
    // making it explicit this property is not enumerable
    // because otherwise some prototype manipulation in
    // userland will fail
    enumerable: !1,
    get: function() {
      return this._writableState.highWaterMark;
    }
  });
  function B(F, A, O, Z, ee, P) {
    if (!O) {
      var Q = J(A, Z, ee);
      Z !== Q && (O = !0, ee = "buffer", Z = Q);
    }
    var z = A.objectMode ? 1 : Z.length;
    A.length += z;
    var se = A.length < A.highWaterMark;
    if (se || (A.needDrain = !0), A.writing || A.corked) {
      var ae = A.lastBufferedRequest;
      A.lastBufferedRequest = {
        chunk: Z,
        encoding: ee,
        isBuf: O,
        callback: P,
        next: null
      }, ae ? ae.next = A.lastBufferedRequest : A.bufferedRequest = A.lastBufferedRequest, A.bufferedRequestCount += 1;
    } else
      D(F, A, !1, z, Z, ee, P);
    return se;
  }
  function D(F, A, O, Z, ee, P, Q) {
    A.writelen = Z, A.writecb = Q, A.writing = !0, A.sync = !0, A.destroyed ? A.onwrite(new x("write")) : O ? F._writev(ee, A.onwrite) : F._write(ee, P, A.onwrite), A.sync = !1;
  }
  function X(F, A, O, Z, ee) {
    --A.pendingcb, O ? (process.nextTick(ee, Z), process.nextTick(L, F, A), F._writableState.errorEmitted = !0, E(F, Z)) : (ee(Z), F._writableState.errorEmitted = !0, E(F, Z), L(F, A));
  }
  function V(F) {
    F.writing = !1, F.writecb = null, F.length -= F.writelen, F.writelen = 0;
  }
  function K(F, A) {
    var O = F._writableState, Z = O.sync, ee = O.writecb;
    if (typeof ee != "function") throw new h();
    if (V(O), A) X(F, O, Z, A, ee);
    else {
      var P = N(O) || F.destroyed;
      !P && !O.corked && !O.bufferProcessing && O.bufferedRequest && I(F, O), Z ? process.nextTick($, F, O, P, ee) : $(F, O, P, ee);
    }
  }
  function $(F, A, O, Z) {
    O || _(F, A), A.pendingcb--, Z(), L(F, A);
  }
  function _(F, A) {
    A.length === 0 && A.needDrain && (A.needDrain = !1, F.emit("drain"));
  }
  function I(F, A) {
    A.bufferProcessing = !0;
    var O = A.bufferedRequest;
    if (F._writev && O && O.next) {
      var Z = A.bufferedRequestCount, ee = new Array(Z), P = A.corkedRequestsFree;
      P.entry = O;
      for (var Q = 0, z = !0; O; )
        ee[Q] = O, O.isBuf || (z = !1), O = O.next, Q += 1;
      ee.allBuffers = z, D(F, A, !0, A.length, ee, "", P.finish), A.pendingcb++, A.lastBufferedRequest = null, P.next ? (A.corkedRequestsFree = P.next, P.next = null) : A.corkedRequestsFree = new t(A), A.bufferedRequestCount = 0;
    } else {
      for (; O; ) {
        var se = O.chunk, ae = O.encoding, ie = O.callback, we = A.objectMode ? 1 : se.length;
        if (D(F, A, !1, we, se, ae, ie), O = O.next, A.bufferedRequestCount--, A.writing)
          break;
      }
      O === null && (A.lastBufferedRequest = null);
    }
    A.bufferedRequest = O, A.bufferProcessing = !1;
  }
  Y.prototype._write = function(F, A, O) {
    O(new m("_write()"));
  }, Y.prototype._writev = null, Y.prototype.end = function(F, A, O) {
    var Z = this._writableState;
    return typeof F == "function" ? (O = F, F = null, A = null) : typeof A == "function" && (O = A, A = null), F != null && this.write(F, A), Z.corked && (Z.corked = 1, this.uncork()), Z.ending || k(this, Z, O), this;
  }, Object.defineProperty(Y.prototype, "writableLength", {
    // making it explicit this property is not enumerable
    // because otherwise some prototype manipulation in
    // userland will fail
    enumerable: !1,
    get: function() {
      return this._writableState.length;
    }
  });
  function N(F) {
    return F.ending && F.length === 0 && F.bufferedRequest === null && !F.finished && !F.writing;
  }
  function U(F, A) {
    F._final(function(O) {
      A.pendingcb--, O && E(F, O), A.prefinished = !0, F.emit("prefinish"), L(F, A);
    });
  }
  function C(F, A) {
    !A.prefinished && !A.finalCalled && (typeof F._final == "function" && !A.destroyed ? (A.pendingcb++, A.finalCalled = !0, process.nextTick(U, F, A)) : (A.prefinished = !0, F.emit("prefinish")));
  }
  function L(F, A) {
    var O = N(A);
    if (O && (C(F, A), A.pendingcb === 0 && (A.finished = !0, F.emit("finish"), A.autoDestroy))) {
      var Z = F._readableState;
      (!Z || Z.autoDestroy && Z.endEmitted) && F.destroy();
    }
    return O;
  }
  function k(F, A, O) {
    A.ending = !0, L(F, A), O && (A.finished ? process.nextTick(O) : F.once("finish", O)), A.ended = !0, F.writable = !1;
  }
  function M(F, A, O) {
    var Z = F.entry;
    for (F.entry = null; Z; ) {
      var ee = Z.callback;
      A.pendingcb--, ee(O), Z = Z.next;
    }
    A.corkedRequestsFree.next = F;
  }
  return Object.defineProperty(Y.prototype, "destroyed", {
    // making it explicit this property is not enumerable
    // because otherwise some prototype manipulation in
    // userland will fail
    enumerable: !1,
    get: function() {
      return this._writableState === void 0 ? !1 : this._writableState.destroyed;
    },
    set: function(A) {
      this._writableState && (this._writableState.destroyed = A);
    }
  }), Y.prototype.destroy = c.destroy, Y.prototype._undestroy = c.undestroy, Y.prototype._destroy = function(F, A) {
    A(F);
  }, Ib;
}
var t4;
function G8() {
  if (t4) return hb.exports;
  t4 = 1;
  var t = _n, e = Xg(), n = on(), r = n.LEVEL, i = hb.exports = function() {
    var s = this, a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    e.call(this, { objectMode: !0, highWaterMark: a.highWaterMark }), this.format = a.format, this.level = a.level, this.handleExceptions = a.handleExceptions, this.handleRejections = a.handleRejections, this.silent = a.silent, a.log && (this.log = a.log), a.logv && (this.logv = a.logv), a.close && (this.close = a.close), this.once("pipe", function(c) {
      s.levels = c.levels, s.parent = c;
    }), this.once("unpipe", function(c) {
      c === s.parent && (s.parent = null, s.close && s.close());
    });
  };
  return t.inherits(i, e), i.prototype._write = function(s, a, c) {
    if (this.silent || s.exception === !0 && !this.handleExceptions)
      return c(null);
    var u = this.level || this.parent && this.parent.level;
    if (!u || this.levels[u] >= this.levels[s[r]]) {
      if (s && !this.format)
        return this.log(s, c);
      var l = void 0, d = void 0;
      try {
        d = this.format.transform(Object.assign({}, s), this.format.options);
      } catch (f) {
        l = f;
      }
      if (l || !d) {
        if (c(), l) throw l;
        return;
      }
      return this.log(d, c);
    }
    return this._writableState.sync = !1, c(null);
  }, i.prototype._writev = function(s, a) {
    if (this.logv) {
      var c = s.filter(this._accept, this);
      return c.length ? this.logv(c, a) : a(null);
    }
    for (var u = 0; u < s.length; u++)
      if (this._accept(s[u])) {
        if (s[u].chunk && !this.format) {
          this.log(s[u].chunk, s[u].callback);
          continue;
        }
        var l = void 0, d = void 0;
        try {
          d = this.format.transform(Object.assign({}, s[u].chunk), this.format.options);
        } catch (f) {
          l = f;
        }
        if (l || !d) {
          if (s[u].callback(), l)
            throw a(null), l;
        } else
          this.log(d, s[u].callback);
      }
    return a(null);
  }, i.prototype._accept = function(s) {
    var a = s.chunk;
    if (this.silent)
      return !1;
    var c = this.level || this.parent && this.parent.level;
    return !!((a.exception === !0 || !c || this.levels[c] >= this.levels[a[r]]) && (this.handleExceptions || a.exception !== !0));
  }, i.prototype._nop = function() {
  }, hb.exports;
}
var Cb = { exports: {} }, n4;
function NK() {
  if (n4) return Cb.exports;
  n4 = 1;
  var t = _n, e = on(), n = e.LEVEL, r = G8(), i = Cb.exports = function() {
    var s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    if (r.call(this, s), !s.transport || typeof s.transport.log != "function")
      throw new Error("Invalid transport, must be an object with a log method.");
    this.transport = s.transport, this.level = this.level || s.transport.level, this.handleExceptions = this.handleExceptions || s.transport.handleExceptions, this._deprecated();
    function a(c) {
      this.emit("error", c, this.transport);
    }
    this.transport.__winstonError || (this.transport.__winstonError = a.bind(this), this.transport.on("error", this.transport.__winstonError));
  };
  return t.inherits(i, r), i.prototype._write = function(s, a, c) {
    if (this.silent || s.exception === !0 && !this.handleExceptions)
      return c(null);
    (!this.level || this.levels[this.level] >= this.levels[s[n]]) && this.transport.log(s[n], s.message, s, this._nop), c(null);
  }, i.prototype._writev = function(s, a) {
    for (var c = 0; c < s.length; c++)
      this._accept(s[c]) && (this.transport.log(s[c].chunk[n], s[c].chunk.message, s[c].chunk, this._nop), s[c].callback());
    return a(null);
  }, i.prototype._deprecated = function() {
    console.error([this.transport.name + " is a legacy winston transport. Consider upgrading: ", "- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md"].join(`
`));
  }, i.prototype.close = function() {
    this.transport.close && this.transport.close(), this.transport.__winstonError && (this.transport.removeListener("error", this.transport.__winstonError), this.transport.__winstonError = null);
  }, Cb.exports;
}
var r4;
function Fd() {
  return r4 || (r4 = 1, th.exports = G8(), th.exports.LegacyTransportStream = NK()), th.exports;
}
var Tb, i4;
function PK() {
  if (i4) return Tb;
  i4 = 1;
  function t(v) {
    "@babel/helpers - typeof";
    return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(S) {
      return typeof S;
    } : function(S) {
      return S && typeof Symbol == "function" && S.constructor === Symbol && S !== Symbol.prototype ? "symbol" : typeof S;
    }, t(v);
  }
  function e(v, S) {
    if (!(v instanceof S)) throw new TypeError("Cannot call a class as a function");
  }
  function n(v, S) {
    for (var E = 0; E < S.length; E++) {
      var T = S[E];
      T.enumerable = T.enumerable || !1, T.configurable = !0, "value" in T && (T.writable = !0), Object.defineProperty(v, i(T.key), T);
    }
  }
  function r(v, S, E) {
    return S && n(v.prototype, S), Object.defineProperty(v, "prototype", { writable: !1 }), v;
  }
  function i(v) {
    var S = o(v, "string");
    return t(S) == "symbol" ? S : S + "";
  }
  function o(v, S) {
    if (t(v) != "object" || !v) return v;
    var E = v[Symbol.toPrimitive];
    if (E !== void 0) {
      var T = E.call(v, S);
      if (t(T) != "object") return T;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(v);
  }
  function s(v, S, E) {
    return S = l(S), a(v, u() ? Reflect.construct(S, E || [], l(v).constructor) : S.apply(v, E));
  }
  function a(v, S) {
    if (S && (t(S) == "object" || typeof S == "function")) return S;
    if (S !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
    return c(v);
  }
  function c(v) {
    if (v === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    return v;
  }
  function u() {
    try {
      var v = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
    } catch {
    }
    return (u = function() {
      return !!v;
    })();
  }
  function l(v) {
    return l = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(S) {
      return S.__proto__ || Object.getPrototypeOf(S);
    }, l(v);
  }
  function d(v, S) {
    if (typeof S != "function" && S !== null) throw new TypeError("Super expression must either be null or a function");
    v.prototype = Object.create(S && S.prototype, { constructor: { value: v, writable: !0, configurable: !0 } }), Object.defineProperty(v, "prototype", { writable: !1 }), S && f(v, S);
  }
  function f(v, S) {
    return f = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(E, T) {
      return E.__proto__ = T, E;
    }, f(v, S);
  }
  var m = Pn, h = on(), y = h.LEVEL, x = h.MESSAGE, g = Fd();
  return Tb = /* @__PURE__ */ (function(v) {
    function S() {
      var E, T = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
      return e(this, S), E = s(this, S, [T]), E.name = T.name || "console", E.stderrLevels = E._stringArrayToSet(T.stderrLevels), E.consoleWarnLevels = E._stringArrayToSet(T.consoleWarnLevels), E.eol = typeof T.eol == "string" ? T.eol : m.EOL, E.forceConsole = T.forceConsole || !1, E._consoleLog = console.log.bind(console), E._consoleWarn = console.warn.bind(console), E._consoleError = console.error.bind(console), E.setMaxListeners(30), E;
    }
    return d(S, v), r(S, [{
      key: "log",
      value: function(T, j) {
        var q = this;
        if (setImmediate(function() {
          return q.emit("logged", T);
        }), this.stderrLevels[T[y]]) {
          console._stderr && !this.forceConsole ? console._stderr.write("".concat(T[x]).concat(this.eol)) : this._consoleError(T[x]), j && j();
          return;
        } else if (this.consoleWarnLevels[T[y]]) {
          console._stderr && !this.forceConsole ? console._stderr.write("".concat(T[x]).concat(this.eol)) : this._consoleWarn(T[x]), j && j();
          return;
        }
        console._stdout && !this.forceConsole ? console._stdout.write("".concat(T[x]).concat(this.eol)) : this._consoleLog(T[x]), j && j();
      }
      /**
       * Returns a Set-like object with strArray's elements as keys (each with the
       * value true).
       * @param {Array} strArray - Array of Set-elements as strings.
       * @param {?string} [errMsg] - Custom error message thrown on invalid input.
       * @returns {Object} - TODO: add return description.
       * @private
       */
    }, {
      key: "_stringArrayToSet",
      value: function(T, j) {
        if (!T) return {};
        if (j = j || "Cannot make set from type other than Array of string elements", !Array.isArray(T))
          throw new Error(j);
        return T.reduce(function(q, Y) {
          if (typeof Y != "string")
            throw new Error(j);
          return q[Y] = !0, q;
        }, {});
      }
    }]);
  })(g), Tb;
}
var nh = { exports: {} }, rh = { exports: {} }, ih = { exports: {} }, o4;
function kE() {
  return o4 || (o4 = 1, (function(t, e) {
    Object.defineProperty(e, "__esModule", {
      value: !0
    }), e.default = n;
    function n(r) {
      return r && typeof r.length == "number" && r.length >= 0 && r.length % 1 === 0;
    }
    t.exports = e.default;
  })(ih, ih.exports)), ih.exports;
}
var Ao = {}, oh = { exports: {} }, sh = { exports: {} }, s4;
function DK() {
  return s4 || (s4 = 1, (function(t, e) {
    Object.defineProperty(e, "__esModule", {
      value: !0
    }), e.default = function(n) {
      return function(...r) {
        var i = r.pop();
        return n.call(this, r, i);
      };
    }, t.exports = e.default;
  })(sh, sh.exports)), sh.exports;
}
var Ko = {}, a4;
function FK() {
  if (a4) return Ko;
  a4 = 1, Object.defineProperty(Ko, "__esModule", {
    value: !0
  }), Ko.fallback = r, Ko.wrap = i;
  var t = Ko.hasQueueMicrotask = typeof queueMicrotask == "function" && queueMicrotask, e = Ko.hasSetImmediate = typeof setImmediate == "function" && setImmediate, n = Ko.hasNextTick = typeof process == "object" && typeof process.nextTick == "function";
  function r(s) {
    setTimeout(s, 0);
  }
  function i(s) {
    return (a, ...c) => s(() => a(...c));
  }
  var o;
  return t ? o = queueMicrotask : e ? o = setImmediate : n ? o = process.nextTick : o = r, Ko.default = i(o), Ko;
}
var c4;
function OK() {
  return c4 || (c4 = 1, (function(t, e) {
    Object.defineProperty(e, "__esModule", {
      value: !0
    }), e.default = c;
    var n = DK(), r = a(n), i = FK(), o = a(i), s = Vu();
    function a(d) {
      return d && d.__esModule ? d : { default: d };
    }
    function c(d) {
      return (0, s.isAsync)(d) ? function(...f) {
        const m = f.pop(), h = d.apply(this, f);
        return u(h, m);
      } : (0, r.default)(function(f, m) {
        var h;
        try {
          h = d.apply(this, f);
        } catch (y) {
          return m(y);
        }
        if (h && typeof h.then == "function")
          return u(h, m);
        m(null, h);
      });
    }
    function u(d, f) {
      return d.then((m) => {
        l(f, null, m);
      }, (m) => {
        l(f, m && (m instanceof Error || m.message) ? m : new Error(m));
      });
    }
    function l(d, f, m) {
      try {
        d(f, m);
      } catch (h) {
        (0, o.default)((y) => {
          throw y;
        }, h);
      }
    }
    t.exports = e.default;
  })(oh, oh.exports)), oh.exports;
}
var u4;
function Vu() {
  if (u4) return Ao;
  u4 = 1, Object.defineProperty(Ao, "__esModule", {
    value: !0
  }), Ao.isAsyncIterable = Ao.isAsyncGenerator = Ao.isAsync = void 0;
  var t = OK(), e = n(t);
  function n(a) {
    return a && a.__esModule ? a : { default: a };
  }
  function r(a) {
    return a[Symbol.toStringTag] === "AsyncFunction";
  }
  function i(a) {
    return a[Symbol.toStringTag] === "AsyncGenerator";
  }
  function o(a) {
    return typeof a[Symbol.asyncIterator] == "function";
  }
  function s(a) {
    if (typeof a != "function") throw new Error("expected a function");
    return r(a) ? (0, e.default)(a) : a;
  }
  return Ao.default = s, Ao.isAsync = r, Ao.isAsyncGenerator = i, Ao.isAsyncIterable = o, Ao;
}
var ah = { exports: {} }, l4;
function Od() {
  return l4 || (l4 = 1, (function(t, e) {
    Object.defineProperty(e, "__esModule", {
      value: !0
    }), e.default = n;
    function n(r, i) {
      if (i || (i = r.length), !i) throw new Error("arity is undefined");
      function o(...s) {
        return typeof s[i - 1] == "function" ? r.apply(this, s) : new Promise((a, c) => {
          s[i - 1] = (u, ...l) => {
            if (u) return c(u);
            a(l.length > 1 ? l : l[0]);
          }, r.apply(this, s);
        });
      }
      return o;
    }
    t.exports = e.default;
  })(ah, ah.exports)), ah.exports;
}
var p4;
function MK() {
  return p4 || (p4 = 1, (function(t, e) {
    Object.defineProperty(e, "__esModule", {
      value: !0
    });
    var n = kE(), r = c(n), i = Vu(), o = c(i), s = Od(), a = c(s);
    function c(u) {
      return u && u.__esModule ? u : { default: u };
    }
    e.default = (0, a.default)((u, l, d) => {
      var f = (0, r.default)(l) ? [] : {};
      u(l, (m, h, y) => {
        (0, o.default)(m)((x, ...g) => {
          g.length < 2 && ([g] = g), f[h] = g, y(x);
        });
      }, (m) => d(m, f));
    }, 3), t.exports = e.default;
  })(rh, rh.exports)), rh.exports;
}
var ch = { exports: {} }, uh = { exports: {} }, lh = { exports: {} }, ph = { exports: {} }, d4;
function q8() {
  return d4 || (d4 = 1, (function(t, e) {
    Object.defineProperty(e, "__esModule", {
      value: !0
    }), e.default = n;
    function n(r) {
      function i(...o) {
        if (r !== null) {
          var s = r;
          r = null, s.apply(this, o);
        }
      }
      return Object.assign(i, r), i;
    }
    t.exports = e.default;
  })(ph, ph.exports)), ph.exports;
}
var dh = { exports: {} }, fh = { exports: {} }, f4;
function RK() {
  return f4 || (f4 = 1, (function(t, e) {
    Object.defineProperty(e, "__esModule", {
      value: !0
    }), e.default = function(n) {
      return n[Symbol.iterator] && n[Symbol.iterator]();
    }, t.exports = e.default;
  })(fh, fh.exports)), fh.exports;
}
var h4;
function BK() {
  return h4 || (h4 = 1, (function(t, e) {
    Object.defineProperty(e, "__esModule", {
      value: !0
    }), e.default = l;
    var n = kE(), r = s(n), i = RK(), o = s(i);
    function s(d) {
      return d && d.__esModule ? d : { default: d };
    }
    function a(d) {
      var f = -1, m = d.length;
      return function() {
        return ++f < m ? { value: d[f], key: f } : null;
      };
    }
    function c(d) {
      var f = -1;
      return function() {
        var h = d.next();
        return h.done ? null : (f++, { value: h.value, key: f });
      };
    }
    function u(d) {
      var f = d ? Object.keys(d) : [], m = -1, h = f.length;
      return function y() {
        var x = f[++m];
        return x === "__proto__" ? y() : m < h ? { value: d[x], key: x } : null;
      };
    }
    function l(d) {
      if ((0, r.default)(d))
        return a(d);
      var f = (0, o.default)(d);
      return f ? c(f) : u(d);
    }
    t.exports = e.default;
  })(dh, dh.exports)), dh.exports;
}
var hh = { exports: {} }, m4;
function H8() {
  return m4 || (m4 = 1, (function(t, e) {
    Object.defineProperty(e, "__esModule", {
      value: !0
    }), e.default = n;
    function n(r) {
      return function(...i) {
        if (r === null) throw new Error("Callback was already called.");
        var o = r;
        r = null, o.apply(this, i);
      };
    }
    t.exports = e.default;
  })(hh, hh.exports)), hh.exports;
}
var mh = { exports: {} }, gh = { exports: {} }, g4;
function NE() {
  return g4 || (g4 = 1, (function(t, e) {
    Object.defineProperty(e, "__esModule", {
      value: !0
    });
    const n = {};
    e.default = n, t.exports = e.default;
  })(gh, gh.exports)), gh.exports;
}
var y4;
function UK() {
  return y4 || (y4 = 1, (function(t, e) {
    Object.defineProperty(e, "__esModule", {
      value: !0
    }), e.default = o;
    var n = NE(), r = i(n);
    function i(s) {
      return s && s.__esModule ? s : { default: s };
    }
    function o(s, a, c, u) {
      let l = !1, d = !1, f = !1, m = 0, h = 0;
      function y() {
        m >= a || f || l || (f = !0, s.next().then(({ value: v, done: S }) => {
          if (!(d || l)) {
            if (f = !1, S) {
              l = !0, m <= 0 && u(null);
              return;
            }
            m++, c(v, h, x), h++, y();
          }
        }).catch(g));
      }
      function x(v, S) {
        if (m -= 1, !d) {
          if (v) return g(v);
          if (v === !1) {
            l = !0, d = !0;
            return;
          }
          if (S === r.default || l && m <= 0)
            return l = !0, u(null);
          y();
        }
      }
      function g(v) {
        d || (f = !1, l = !0, u(v));
      }
      y();
    }
    t.exports = e.default;
  })(mh, mh.exports)), mh.exports;
}
var v4;
function LK() {
  return v4 || (v4 = 1, (function(t, e) {
    Object.defineProperty(e, "__esModule", {
      value: !0
    });
    var n = q8(), r = m(n), i = BK(), o = m(i), s = H8(), a = m(s), c = Vu(), u = UK(), l = m(u), d = NE(), f = m(d);
    function m(h) {
      return h && h.__esModule ? h : { default: h };
    }
    e.default = (h) => (y, x, g) => {
      if (g = (0, r.default)(g), h <= 0)
        throw new RangeError("concurrency limit cannot be less than 1");
      if (!y)
        return g(null);
      if ((0, c.isAsyncGenerator)(y))
        return (0, l.default)(y, h, x, g);
      if ((0, c.isAsyncIterable)(y))
        return (0, l.default)(y[Symbol.asyncIterator](), h, x, g);
      var v = (0, o.default)(y), S = !1, E = !1, T = 0, j = !1;
      function q(W, G) {
        if (!E)
          if (T -= 1, W)
            S = !0, g(W);
          else if (W === !1)
            S = !0, E = !0;
          else {
            if (G === f.default || S && T <= 0)
              return S = !0, g(null);
            j || Y();
          }
      }
      function Y() {
        for (j = !0; T < h && !S; ) {
          var W = v();
          if (W === null) {
            S = !0, T <= 0 && g(null);
            return;
          }
          T += 1, x(W.value, W.key, (0, a.default)(q));
        }
        j = !1;
      }
      Y();
    }, t.exports = e.default;
  })(lh, lh.exports)), lh.exports;
}
var b4;
function W8() {
  return b4 || (b4 = 1, (function(t, e) {
    Object.defineProperty(e, "__esModule", {
      value: !0
    });
    var n = LK(), r = c(n), i = Vu(), o = c(i), s = Od(), a = c(s);
    function c(l) {
      return l && l.__esModule ? l : { default: l };
    }
    function u(l, d, f, m) {
      return (0, r.default)(d)(l, (0, o.default)(f), m);
    }
    e.default = (0, a.default)(u, 4), t.exports = e.default;
  })(uh, uh.exports)), uh.exports;
}
var x4;
function jK() {
  return x4 || (x4 = 1, (function(t, e) {
    Object.defineProperty(e, "__esModule", {
      value: !0
    });
    var n = W8(), r = s(n), i = Od(), o = s(i);
    function s(c) {
      return c && c.__esModule ? c : { default: c };
    }
    function a(c, u, l) {
      return (0, r.default)(c, 1, u, l);
    }
    e.default = (0, o.default)(a, 3), t.exports = e.default;
  })(ch, ch.exports)), ch.exports;
}
var w4;
function QK() {
  return w4 || (w4 = 1, (function(t, e) {
    Object.defineProperty(e, "__esModule", {
      value: !0
    }), e.default = a;
    var n = MK(), r = s(n), i = jK(), o = s(i);
    function s(c) {
      return c && c.__esModule ? c : { default: c };
    }
    function a(c, u) {
      return (0, r.default)(o.default, c, u);
    }
    t.exports = e.default;
  })(nh, nh.exports)), nh.exports;
}
var yh = { exports: {} }, kb, S4;
function z8() {
  if (S4) return kb;
  S4 = 1, kb = a;
  var t = Ku().codes, e = t.ERR_METHOD_NOT_IMPLEMENTED, n = t.ERR_MULTIPLE_CALLBACK, r = t.ERR_TRANSFORM_ALREADY_TRANSFORMING, i = t.ERR_TRANSFORM_WITH_LENGTH_0, o = fu();
  fo()(a, o);
  function s(l, d) {
    var f = this._transformState;
    f.transforming = !1;
    var m = f.writecb;
    if (m === null)
      return this.emit("error", new n());
    f.writechunk = null, f.writecb = null, d != null && this.push(d), m(l);
    var h = this._readableState;
    h.reading = !1, (h.needReadable || h.length < h.highWaterMark) && this._read(h.highWaterMark);
  }
  function a(l) {
    if (!(this instanceof a)) return new a(l);
    o.call(this, l), this._transformState = {
      afterTransform: s.bind(this),
      needTransform: !1,
      transforming: !1,
      writecb: null,
      writechunk: null,
      writeencoding: null
    }, this._readableState.needReadable = !0, this._readableState.sync = !1, l && (typeof l.transform == "function" && (this._transform = l.transform), typeof l.flush == "function" && (this._flush = l.flush)), this.on("prefinish", c);
  }
  function c() {
    var l = this;
    typeof this._flush == "function" && !this._readableState.destroyed ? this._flush(function(d, f) {
      u(l, d, f);
    }) : u(this, null, null);
  }
  a.prototype.push = function(l, d) {
    return this._transformState.needTransform = !1, o.prototype.push.call(this, l, d);
  }, a.prototype._transform = function(l, d, f) {
    f(new e("_transform()"));
  }, a.prototype._write = function(l, d, f) {
    var m = this._transformState;
    if (m.writecb = f, m.writechunk = l, m.writeencoding = d, !m.transforming) {
      var h = this._readableState;
      (m.needTransform || h.needReadable || h.length < h.highWaterMark) && this._read(h.highWaterMark);
    }
  }, a.prototype._read = function(l) {
    var d = this._transformState;
    d.writechunk !== null && !d.transforming ? (d.transforming = !0, this._transform(d.writechunk, d.writeencoding, d.afterTransform)) : d.needTransform = !0;
  }, a.prototype._destroy = function(l, d) {
    o.prototype._destroy.call(this, l, function(f) {
      d(f);
    });
  };
  function u(l, d, f) {
    if (d) return l.emit("error", d);
    if (f != null && l.push(f), l._writableState.length) throw new i();
    if (l._transformState.transforming) throw new r();
    return l.push(null);
  }
  return kb;
}
var Nb, _4;
function $K() {
  if (_4) return Nb;
  _4 = 1, Nb = e;
  var t = z8();
  fo()(e, t);
  function e(n) {
    if (!(this instanceof e)) return new e(n);
    t.call(this, n);
  }
  return e.prototype._transform = function(n, r, i) {
    i(null, n);
  }, Nb;
}
var Pb, E4;
function GK() {
  if (E4) return Pb;
  E4 = 1;
  var t;
  function e(f) {
    var m = !1;
    return function() {
      m || (m = !0, f.apply(void 0, arguments));
    };
  }
  var n = Ku().codes, r = n.ERR_MISSING_ARGS, i = n.ERR_STREAM_DESTROYED;
  function o(f) {
    if (f) throw f;
  }
  function s(f) {
    return f.setHeader && typeof f.abort == "function";
  }
  function a(f, m, h, y) {
    y = e(y);
    var x = !1;
    f.on("close", function() {
      x = !0;
    }), t === void 0 && (t = TE()), t(f, {
      readable: m,
      writable: h
    }, function(v) {
      if (v) return y(v);
      x = !0, y();
    });
    var g = !1;
    return function(v) {
      if (!x && !g) {
        if (g = !0, s(f)) return f.abort();
        if (typeof f.destroy == "function") return f.destroy();
        y(v || new i("pipe"));
      }
    };
  }
  function c(f) {
    f();
  }
  function u(f, m) {
    return f.pipe(m);
  }
  function l(f) {
    return !f.length || typeof f[f.length - 1] != "function" ? o : f.pop();
  }
  function d() {
    for (var f = arguments.length, m = new Array(f), h = 0; h < f; h++)
      m[h] = arguments[h];
    var y = l(m);
    if (Array.isArray(m[0]) && (m = m[0]), m.length < 2)
      throw new r("streams");
    var x, g = m.map(function(v, S) {
      var E = S < m.length - 1, T = S > 0;
      return a(v, E, T, function(j) {
        x || (x = j), j && g.forEach(c), !E && (g.forEach(c), y(x));
      });
    });
    return m.reduce(u);
  }
  return Pb = d, Pb;
}
var A4;
function yc() {
  return A4 || (A4 = 1, (function(t, e) {
    e = t.exports = $8(), e.Stream = e, e.Readable = e, e.Writable = Xg(), e.Duplex = fu(), e.Transform = z8(), e.PassThrough = $K(), e.finished = TE(), e.pipeline = GK();
  })(yh, yh.exports)), yh.exports;
}
var vh = { exports: {} }, Db, I4;
function K8() {
  if (I4) return Db;
  I4 = 1;
  var t = [], e = [], n = function() {
  };
  function r(f) {
    return ~t.indexOf(f) ? !1 : (t.push(f), !0);
  }
  function i(f) {
    n = f;
  }
  function o(f) {
    for (var m = [], h = 0; h < t.length; h++) {
      if (t[h].async) {
        m.push(t[h]);
        continue;
      }
      if (t[h](f)) return !0;
    }
    return m.length ? new Promise(function(x) {
      Promise.all(
        m.map(function(v) {
          return v(f);
        })
      ).then(function(v) {
        x(v.some(Boolean));
      });
    }) : !1;
  }
  function s(f) {
    return ~e.indexOf(f) ? !1 : (e.push(f), !0);
  }
  function a() {
    n.apply(n, arguments);
  }
  function c(f) {
    for (var m = 0; m < e.length; m++)
      f = e[m].apply(e[m], arguments);
    return f;
  }
  function u(f, m) {
    var h = Object.prototype.hasOwnProperty;
    for (var y in m)
      h.call(m, y) && (f[y] = m[y]);
    return f;
  }
  function l(f) {
    return f.enabled = !1, f.modify = s, f.set = i, f.use = r, u(function() {
      return !1;
    }, f);
  }
  function d(f) {
    function m() {
      var h = Array.prototype.slice.call(arguments, 0);
      return a.call(a, f, c(h, f)), !0;
    }
    return f.enabled = !0, f.modify = s, f.set = i, f.use = r, u(m, f);
  }
  return Db = function(m) {
    return m.introduce = u, m.enabled = o, m.process = c, m.modify = s, m.write = a, m.nope = l, m.yep = d, m.set = i, m.use = r, m;
  }, Db;
}
var Fb, C4;
function qK() {
  if (C4) return Fb;
  C4 = 1;
  var t = K8(), e = t(function n(r, i) {
    return i = i || {}, i.namespace = r, i.prod = !0, i.dev = !1, i.force || n.force ? n.yep(i) : n.nope(i);
  });
  return Fb = e, Fb;
}
var Ob, T4;
function HK() {
  if (T4) return Ob;
  T4 = 1;
  var t = {
    aliceblue: [240, 248, 255],
    antiquewhite: [250, 235, 215],
    aqua: [0, 255, 255],
    aquamarine: [127, 255, 212],
    azure: [240, 255, 255],
    beige: [245, 245, 220],
    bisque: [255, 228, 196],
    black: [0, 0, 0],
    blanchedalmond: [255, 235, 205],
    blue: [0, 0, 255],
    blueviolet: [138, 43, 226],
    brown: [165, 42, 42],
    burlywood: [222, 184, 135],
    cadetblue: [95, 158, 160],
    chartreuse: [127, 255, 0],
    chocolate: [210, 105, 30],
    coral: [255, 127, 80],
    cornflowerblue: [100, 149, 237],
    cornsilk: [255, 248, 220],
    crimson: [220, 20, 60],
    cyan: [0, 255, 255],
    darkblue: [0, 0, 139],
    darkcyan: [0, 139, 139],
    darkgoldenrod: [184, 134, 11],
    darkgray: [169, 169, 169],
    darkgreen: [0, 100, 0],
    darkgrey: [169, 169, 169],
    darkkhaki: [189, 183, 107],
    darkmagenta: [139, 0, 139],
    darkolivegreen: [85, 107, 47],
    darkorange: [255, 140, 0],
    darkorchid: [153, 50, 204],
    darkred: [139, 0, 0],
    darksalmon: [233, 150, 122],
    darkseagreen: [143, 188, 143],
    darkslateblue: [72, 61, 139],
    darkslategray: [47, 79, 79],
    darkslategrey: [47, 79, 79],
    darkturquoise: [0, 206, 209],
    darkviolet: [148, 0, 211],
    deeppink: [255, 20, 147],
    deepskyblue: [0, 191, 255],
    dimgray: [105, 105, 105],
    dimgrey: [105, 105, 105],
    dodgerblue: [30, 144, 255],
    firebrick: [178, 34, 34],
    floralwhite: [255, 250, 240],
    forestgreen: [34, 139, 34],
    fuchsia: [255, 0, 255],
    gainsboro: [220, 220, 220],
    ghostwhite: [248, 248, 255],
    gold: [255, 215, 0],
    goldenrod: [218, 165, 32],
    gray: [128, 128, 128],
    green: [0, 128, 0],
    greenyellow: [173, 255, 47],
    grey: [128, 128, 128],
    honeydew: [240, 255, 240],
    hotpink: [255, 105, 180],
    indianred: [205, 92, 92],
    indigo: [75, 0, 130],
    ivory: [255, 255, 240],
    khaki: [240, 230, 140],
    lavender: [230, 230, 250],
    lavenderblush: [255, 240, 245],
    lawngreen: [124, 252, 0],
    lemonchiffon: [255, 250, 205],
    lightblue: [173, 216, 230],
    lightcoral: [240, 128, 128],
    lightcyan: [224, 255, 255],
    lightgoldenrodyellow: [250, 250, 210],
    lightgray: [211, 211, 211],
    lightgreen: [144, 238, 144],
    lightgrey: [211, 211, 211],
    lightpink: [255, 182, 193],
    lightsalmon: [255, 160, 122],
    lightseagreen: [32, 178, 170],
    lightskyblue: [135, 206, 250],
    lightslategray: [119, 136, 153],
    lightslategrey: [119, 136, 153],
    lightsteelblue: [176, 196, 222],
    lightyellow: [255, 255, 224],
    lime: [0, 255, 0],
    limegreen: [50, 205, 50],
    linen: [250, 240, 230],
    magenta: [255, 0, 255],
    maroon: [128, 0, 0],
    mediumaquamarine: [102, 205, 170],
    mediumblue: [0, 0, 205],
    mediumorchid: [186, 85, 211],
    mediumpurple: [147, 112, 219],
    mediumseagreen: [60, 179, 113],
    mediumslateblue: [123, 104, 238],
    mediumspringgreen: [0, 250, 154],
    mediumturquoise: [72, 209, 204],
    mediumvioletred: [199, 21, 133],
    midnightblue: [25, 25, 112],
    mintcream: [245, 255, 250],
    mistyrose: [255, 228, 225],
    moccasin: [255, 228, 181],
    navajowhite: [255, 222, 173],
    navy: [0, 0, 128],
    oldlace: [253, 245, 230],
    olive: [128, 128, 0],
    olivedrab: [107, 142, 35],
    orange: [255, 165, 0],
    orangered: [255, 69, 0],
    orchid: [218, 112, 214],
    palegoldenrod: [238, 232, 170],
    palegreen: [152, 251, 152],
    paleturquoise: [175, 238, 238],
    palevioletred: [219, 112, 147],
    papayawhip: [255, 239, 213],
    peachpuff: [255, 218, 185],
    peru: [205, 133, 63],
    pink: [255, 192, 203],
    plum: [221, 160, 221],
    powderblue: [176, 224, 230],
    purple: [128, 0, 128],
    rebeccapurple: [102, 51, 153],
    red: [255, 0, 0],
    rosybrown: [188, 143, 143],
    royalblue: [65, 105, 225],
    saddlebrown: [139, 69, 19],
    salmon: [250, 128, 114],
    sandybrown: [244, 164, 96],
    seagreen: [46, 139, 87],
    seashell: [255, 245, 238],
    sienna: [160, 82, 45],
    silver: [192, 192, 192],
    skyblue: [135, 206, 235],
    slateblue: [106, 90, 205],
    slategray: [112, 128, 144],
    slategrey: [112, 128, 144],
    snow: [255, 250, 250],
    springgreen: [0, 255, 127],
    steelblue: [70, 130, 180],
    tan: [210, 180, 140],
    teal: [0, 128, 128],
    thistle: [216, 191, 216],
    tomato: [255, 99, 71],
    turquoise: [64, 224, 208],
    violet: [238, 130, 238],
    wheat: [245, 222, 179],
    white: [255, 255, 255],
    whitesmoke: [245, 245, 245],
    yellow: [255, 255, 0],
    yellowgreen: [154, 205, 50]
  };
  const e = /* @__PURE__ */ Object.create(null);
  for (const _ in t)
    Object.hasOwn(t, _) && (e[t[_]] = _);
  const n = {
    to: {},
    get: {}
  };
  n.get = function(_) {
    const I = _.slice(0, 3).toLowerCase();
    let N, U;
    switch (I) {
      case "hsl": {
        N = n.get.hsl(_), U = "hsl";
        break;
      }
      case "hwb": {
        N = n.get.hwb(_), U = "hwb";
        break;
      }
      default: {
        N = n.get.rgb(_), U = "rgb";
        break;
      }
    }
    return N ? { model: U, value: N } : null;
  }, n.get.rgb = function(_) {
    if (!_)
      return null;
    const I = /^#([a-f\d]{3,4})$/i, N = /^#([a-f\d]{6})([a-f\d]{2})?$/i, U = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/, C = /^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/, L = /^(\w+)$/;
    let k = [0, 0, 0, 1], M, F, A;
    if (M = _.match(N)) {
      for (A = M[2], M = M[1], F = 0; F < 3; F++) {
        const O = F * 2;
        k[F] = Number.parseInt(M.slice(O, O + 2), 16);
      }
      A && (k[3] = Number.parseInt(A, 16) / 255);
    } else if (M = _.match(I)) {
      for (M = M[1], A = M[3], F = 0; F < 3; F++)
        k[F] = Number.parseInt(M[F] + M[F], 16);
      A && (k[3] = Number.parseInt(A + A, 16) / 255);
    } else if (M = _.match(U)) {
      for (F = 0; F < 3; F++)
        k[F] = Number.parseInt(M[F + 1], 10);
      M[4] && (k[3] = M[5] ? Number.parseFloat(M[4]) * 0.01 : Number.parseFloat(M[4]));
    } else if (M = _.match(C)) {
      for (F = 0; F < 3; F++)
        k[F] = Math.round(Number.parseFloat(M[F + 1]) * 2.55);
      M[4] && (k[3] = M[5] ? Number.parseFloat(M[4]) * 0.01 : Number.parseFloat(M[4]));
    } else return (M = _.match(L)) ? M[1] === "transparent" ? [0, 0, 0, 0] : Object.hasOwn(t, M[1]) ? (k = t[M[1]], k[3] = 1, k) : null : null;
    for (F = 0; F < 3; F++)
      k[F] = r(k[F], 0, 255);
    return k[3] = r(k[3], 0, 1), k;
  }, n.get.hsl = function(_) {
    if (!_)
      return null;
    const I = /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/, N = _.match(I);
    if (N) {
      const U = Number.parseFloat(N[4]), C = (Number.parseFloat(N[1]) % 360 + 360) % 360, L = r(Number.parseFloat(N[2]), 0, 100), k = r(Number.parseFloat(N[3]), 0, 100), M = r(Number.isNaN(U) ? 1 : U, 0, 1);
      return [C, L, k, M];
    }
    return null;
  }, n.get.hwb = function(_) {
    if (!_)
      return null;
    const I = /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/, N = _.match(I);
    if (N) {
      const U = Number.parseFloat(N[4]), C = (Number.parseFloat(N[1]) % 360 + 360) % 360, L = r(Number.parseFloat(N[2]), 0, 100), k = r(Number.parseFloat(N[3]), 0, 100), M = r(Number.isNaN(U) ? 1 : U, 0, 1);
      return [C, L, k, M];
    }
    return null;
  }, n.to.hex = function(..._) {
    return "#" + i(_[0]) + i(_[1]) + i(_[2]) + (_[3] < 1 ? i(Math.round(_[3] * 255)) : "");
  }, n.to.rgb = function(..._) {
    return _.length < 4 || _[3] === 1 ? "rgb(" + Math.round(_[0]) + ", " + Math.round(_[1]) + ", " + Math.round(_[2]) + ")" : "rgba(" + Math.round(_[0]) + ", " + Math.round(_[1]) + ", " + Math.round(_[2]) + ", " + _[3] + ")";
  }, n.to.rgb.percent = function(..._) {
    const I = Math.round(_[0] / 255 * 100), N = Math.round(_[1] / 255 * 100), U = Math.round(_[2] / 255 * 100);
    return _.length < 4 || _[3] === 1 ? "rgb(" + I + "%, " + N + "%, " + U + "%)" : "rgba(" + I + "%, " + N + "%, " + U + "%, " + _[3] + ")";
  }, n.to.hsl = function(..._) {
    return _.length < 4 || _[3] === 1 ? "hsl(" + _[0] + ", " + _[1] + "%, " + _[2] + "%)" : "hsla(" + _[0] + ", " + _[1] + "%, " + _[2] + "%, " + _[3] + ")";
  }, n.to.hwb = function(..._) {
    let I = "";
    return _.length >= 4 && _[3] !== 1 && (I = ", " + _[3]), "hwb(" + _[0] + ", " + _[1] + "%, " + _[2] + "%" + I + ")";
  }, n.to.keyword = function(..._) {
    return e[_.slice(0, 3)];
  };
  function r(_, I, N) {
    return Math.min(Math.max(I, _), N);
  }
  function i(_) {
    const I = Math.round(_).toString(16).toUpperCase();
    return I.length < 2 ? "0" + I : I;
  }
  const o = {};
  for (const _ of Object.keys(t))
    o[t[_]] = _;
  const s = {
    rgb: { channels: 3, labels: "rgb" },
    hsl: { channels: 3, labels: "hsl" },
    hsv: { channels: 3, labels: "hsv" },
    hwb: { channels: 3, labels: "hwb" },
    cmyk: { channels: 4, labels: "cmyk" },
    xyz: { channels: 3, labels: "xyz" },
    lab: { channels: 3, labels: "lab" },
    oklab: { channels: 3, labels: ["okl", "oka", "okb"] },
    lch: { channels: 3, labels: "lch" },
    oklch: { channels: 3, labels: ["okl", "okc", "okh"] },
    hex: { channels: 1, labels: ["hex"] },
    keyword: { channels: 1, labels: ["keyword"] },
    ansi16: { channels: 1, labels: ["ansi16"] },
    ansi256: { channels: 1, labels: ["ansi256"] },
    hcg: { channels: 3, labels: ["h", "c", "g"] },
    apple: { channels: 3, labels: ["r16", "g16", "b16"] },
    gray: { channels: 1, labels: ["gray"] }
  }, a = (6 / 29) ** 3;
  function c(_) {
    const I = _ > 31308e-7 ? 1.055 * _ ** 0.4166666666666667 - 0.055 : _ * 12.92;
    return Math.min(Math.max(0, I), 1);
  }
  function u(_) {
    return _ > 0.04045 ? ((_ + 0.055) / 1.055) ** 2.4 : _ / 12.92;
  }
  for (const _ of Object.keys(s)) {
    if (!("channels" in s[_]))
      throw new Error("missing channels property: " + _);
    if (!("labels" in s[_]))
      throw new Error("missing channel labels property: " + _);
    if (s[_].labels.length !== s[_].channels)
      throw new Error("channel and label counts mismatch: " + _);
    const { channels: I, labels: N } = s[_];
    delete s[_].channels, delete s[_].labels, Object.defineProperty(s[_], "channels", { value: I }), Object.defineProperty(s[_], "labels", { value: N });
  }
  s.rgb.hsl = function(_) {
    const I = _[0] / 255, N = _[1] / 255, U = _[2] / 255, C = Math.min(I, N, U), L = Math.max(I, N, U), k = L - C;
    let M, F;
    switch (L) {
      case C: {
        M = 0;
        break;
      }
      case I: {
        M = (N - U) / k;
        break;
      }
      case N: {
        M = 2 + (U - I) / k;
        break;
      }
      case U: {
        M = 4 + (I - N) / k;
        break;
      }
    }
    M = Math.min(M * 60, 360), M < 0 && (M += 360);
    const A = (C + L) / 2;
    return L === C ? F = 0 : A <= 0.5 ? F = k / (L + C) : F = k / (2 - L - C), [M, F * 100, A * 100];
  }, s.rgb.hsv = function(_) {
    let I, N, U, C, L;
    const k = _[0] / 255, M = _[1] / 255, F = _[2] / 255, A = Math.max(k, M, F), O = A - Math.min(k, M, F), Z = function(ee) {
      return (A - ee) / 6 / O + 1 / 2;
    };
    if (O === 0)
      C = 0, L = 0;
    else {
      switch (L = O / A, I = Z(k), N = Z(M), U = Z(F), A) {
        case k: {
          C = U - N;
          break;
        }
        case M: {
          C = 1 / 3 + I - U;
          break;
        }
        case F: {
          C = 2 / 3 + N - I;
          break;
        }
      }
      C < 0 ? C += 1 : C > 1 && (C -= 1);
    }
    return [
      C * 360,
      L * 100,
      A * 100
    ];
  }, s.rgb.hwb = function(_) {
    const I = _[0], N = _[1];
    let U = _[2];
    const C = s.rgb.hsl(_)[0], L = 1 / 255 * Math.min(I, Math.min(N, U));
    return U = 1 - 1 / 255 * Math.max(I, Math.max(N, U)), [C, L * 100, U * 100];
  }, s.rgb.oklab = function(_) {
    const I = u(_[0] / 255), N = u(_[1] / 255), U = u(_[2] / 255), C = Math.cbrt(0.4122214708 * I + 0.5363325363 * N + 0.0514459929 * U), L = Math.cbrt(0.2119034982 * I + 0.6806995451 * N + 0.1073969566 * U), k = Math.cbrt(0.0883024619 * I + 0.2817188376 * N + 0.6299787005 * U), M = 0.2104542553 * C + 0.793617785 * L - 0.0040720468 * k, F = 1.9779984951 * C - 2.428592205 * L + 0.4505937099 * k, A = 0.0259040371 * C + 0.7827717662 * L - 0.808675766 * k;
    return [M * 100, F * 100, A * 100];
  }, s.rgb.cmyk = function(_) {
    const I = _[0] / 255, N = _[1] / 255, U = _[2] / 255, C = Math.min(1 - I, 1 - N, 1 - U), L = (1 - I - C) / (1 - C) || 0, k = (1 - N - C) / (1 - C) || 0, M = (1 - U - C) / (1 - C) || 0;
    return [L * 100, k * 100, M * 100, C * 100];
  };
  function l(_, I) {
    return (_[0] - I[0]) ** 2 + (_[1] - I[1]) ** 2 + (_[2] - I[2]) ** 2;
  }
  s.rgb.keyword = function(_) {
    const I = o[_];
    if (I)
      return I;
    let N = Number.POSITIVE_INFINITY, U;
    for (const C of Object.keys(t)) {
      const L = t[C], k = l(_, L);
      k < N && (N = k, U = C);
    }
    return U;
  }, s.keyword.rgb = function(_) {
    return t[_];
  }, s.rgb.xyz = function(_) {
    const I = u(_[0] / 255), N = u(_[1] / 255), U = u(_[2] / 255), C = I * 0.4124564 + N * 0.3575761 + U * 0.1804375, L = I * 0.2126729 + N * 0.7151522 + U * 0.072175, k = I * 0.0193339 + N * 0.119192 + U * 0.9503041;
    return [C * 100, L * 100, k * 100];
  }, s.rgb.lab = function(_) {
    const I = s.rgb.xyz(_);
    let N = I[0], U = I[1], C = I[2];
    N /= 95.047, U /= 100, C /= 108.883, N = N > a ? N ** (1 / 3) : 7.787 * N + 16 / 116, U = U > a ? U ** (1 / 3) : 7.787 * U + 16 / 116, C = C > a ? C ** (1 / 3) : 7.787 * C + 16 / 116;
    const L = 116 * U - 16, k = 500 * (N - U), M = 200 * (U - C);
    return [L, k, M];
  }, s.hsl.rgb = function(_) {
    const I = _[0] / 360, N = _[1] / 100, U = _[2] / 100;
    let C, L;
    if (N === 0)
      return L = U * 255, [L, L, L];
    const k = U < 0.5 ? U * (1 + N) : U + N - U * N, M = 2 * U - k, F = [0, 0, 0];
    for (let A = 0; A < 3; A++)
      C = I + 1 / 3 * -(A - 1), C < 0 && C++, C > 1 && C--, 6 * C < 1 ? L = M + (k - M) * 6 * C : 2 * C < 1 ? L = k : 3 * C < 2 ? L = M + (k - M) * (2 / 3 - C) * 6 : L = M, F[A] = L * 255;
    return F;
  }, s.hsl.hsv = function(_) {
    const I = _[0];
    let N = _[1] / 100, U = _[2] / 100, C = N;
    const L = Math.max(U, 0.01);
    U *= 2, N *= U <= 1 ? U : 2 - U, C *= L <= 1 ? L : 2 - L;
    const k = (U + N) / 2, M = U === 0 ? 2 * C / (L + C) : 2 * N / (U + N);
    return [I, M * 100, k * 100];
  }, s.hsv.rgb = function(_) {
    const I = _[0] / 60, N = _[1] / 100;
    let U = _[2] / 100;
    const C = Math.floor(I) % 6, L = I - Math.floor(I), k = 255 * U * (1 - N), M = 255 * U * (1 - N * L), F = 255 * U * (1 - N * (1 - L));
    switch (U *= 255, C) {
      case 0:
        return [U, F, k];
      case 1:
        return [M, U, k];
      case 2:
        return [k, U, F];
      case 3:
        return [k, M, U];
      case 4:
        return [F, k, U];
      case 5:
        return [U, k, M];
    }
  }, s.hsv.hsl = function(_) {
    const I = _[0], N = _[1] / 100, U = _[2] / 100, C = Math.max(U, 0.01);
    let L, k;
    k = (2 - N) * U;
    const M = (2 - N) * C;
    return L = N * C, L /= M <= 1 ? M : 2 - M, L = L || 0, k /= 2, [I, L * 100, k * 100];
  }, s.hwb.rgb = function(_) {
    const I = _[0] / 360;
    let N = _[1] / 100, U = _[2] / 100;
    const C = N + U;
    let L;
    C > 1 && (N /= C, U /= C);
    const k = Math.floor(6 * I), M = 1 - U;
    L = 6 * I - k, (k & 1) !== 0 && (L = 1 - L);
    const F = N + L * (M - N);
    let A, O, Z;
    switch (k) {
      default:
      case 6:
      case 0: {
        A = M, O = F, Z = N;
        break;
      }
      case 1: {
        A = F, O = M, Z = N;
        break;
      }
      case 2: {
        A = N, O = M, Z = F;
        break;
      }
      case 3: {
        A = N, O = F, Z = M;
        break;
      }
      case 4: {
        A = F, O = N, Z = M;
        break;
      }
      case 5: {
        A = M, O = N, Z = F;
        break;
      }
    }
    return [A * 255, O * 255, Z * 255];
  }, s.cmyk.rgb = function(_) {
    const I = _[0] / 100, N = _[1] / 100, U = _[2] / 100, C = _[3] / 100, L = 1 - Math.min(1, I * (1 - C) + C), k = 1 - Math.min(1, N * (1 - C) + C), M = 1 - Math.min(1, U * (1 - C) + C);
    return [L * 255, k * 255, M * 255];
  }, s.xyz.rgb = function(_) {
    const I = _[0] / 100, N = _[1] / 100, U = _[2] / 100;
    let C, L, k;
    return C = I * 3.2404542 + N * -1.5371385 + U * -0.4985314, L = I * -0.969266 + N * 1.8760108 + U * 0.041556, k = I * 0.0556434 + N * -0.2040259 + U * 1.0572252, C = c(C), L = c(L), k = c(k), [C * 255, L * 255, k * 255];
  }, s.xyz.lab = function(_) {
    let I = _[0], N = _[1], U = _[2];
    I /= 95.047, N /= 100, U /= 108.883, I = I > a ? I ** (1 / 3) : 7.787 * I + 16 / 116, N = N > a ? N ** (1 / 3) : 7.787 * N + 16 / 116, U = U > a ? U ** (1 / 3) : 7.787 * U + 16 / 116;
    const C = 116 * N - 16, L = 500 * (I - N), k = 200 * (N - U);
    return [C, L, k];
  }, s.xyz.oklab = function(_) {
    const I = _[0] / 100, N = _[1] / 100, U = _[2] / 100, C = Math.cbrt(0.8189330101 * I + 0.3618667424 * N - 0.1288597137 * U), L = Math.cbrt(0.0329845436 * I + 0.9293118715 * N + 0.0361456387 * U), k = Math.cbrt(0.0482003018 * I + 0.2643662691 * N + 0.633851707 * U), M = 0.2104542553 * C + 0.793617785 * L - 0.0040720468 * k, F = 1.9779984951 * C - 2.428592205 * L + 0.4505937099 * k, A = 0.0259040371 * C + 0.7827717662 * L - 0.808675766 * k;
    return [M * 100, F * 100, A * 100];
  }, s.oklab.oklch = function(_) {
    return s.lab.lch(_);
  }, s.oklab.xyz = function(_) {
    const I = _[0] / 100, N = _[1] / 100, U = _[2] / 100, C = (0.999999998 * I + 0.396337792 * N + 0.215803758 * U) ** 3, L = (1.000000008 * I - 0.105561342 * N - 0.063854175 * U) ** 3, k = (1.000000055 * I - 0.089484182 * N - 1.291485538 * U) ** 3, M = 1.227013851 * C - 0.55779998 * L + 0.281256149 * k, F = -0.040580178 * C + 1.11225687 * L - 0.071676679 * k, A = -0.076381285 * C - 0.421481978 * L + 1.58616322 * k;
    return [M * 100, F * 100, A * 100];
  }, s.oklab.rgb = function(_) {
    const I = _[0] / 100, N = _[1] / 100, U = _[2] / 100, C = (I + 0.3963377774 * N + 0.2158037573 * U) ** 3, L = (I - 0.1055613458 * N - 0.0638541728 * U) ** 3, k = (I - 0.0894841775 * N - 1.291485548 * U) ** 3, M = c(4.0767416621 * C - 3.3077115913 * L + 0.2309699292 * k), F = c(-1.2684380046 * C + 2.6097574011 * L - 0.3413193965 * k), A = c(-0.0041960863 * C - 0.7034186147 * L + 1.707614701 * k);
    return [M * 255, F * 255, A * 255];
  }, s.oklch.oklab = function(_) {
    return s.lch.lab(_);
  }, s.lab.xyz = function(_) {
    const I = _[0], N = _[1], U = _[2];
    let C, L, k;
    L = (I + 16) / 116, C = N / 500 + L, k = L - U / 200;
    const M = L ** 3, F = C ** 3, A = k ** 3;
    return L = M > a ? M : (L - 16 / 116) / 7.787, C = F > a ? F : (C - 16 / 116) / 7.787, k = A > a ? A : (k - 16 / 116) / 7.787, C *= 95.047, L *= 100, k *= 108.883, [C, L, k];
  }, s.lab.lch = function(_) {
    const I = _[0], N = _[1], U = _[2];
    let C;
    C = Math.atan2(U, N) * 360 / 2 / Math.PI, C < 0 && (C += 360);
    const k = Math.sqrt(N * N + U * U);
    return [I, k, C];
  }, s.lch.lab = function(_) {
    const I = _[0], N = _[1], C = _[2] / 360 * 2 * Math.PI, L = N * Math.cos(C), k = N * Math.sin(C);
    return [I, L, k];
  }, s.rgb.ansi16 = function(_, I = null) {
    const [N, U, C] = _;
    let L = I === null ? s.rgb.hsv(_)[2] : I;
    if (L = Math.round(L / 50), L === 0)
      return 30;
    let k = 30 + (Math.round(C / 255) << 2 | Math.round(U / 255) << 1 | Math.round(N / 255));
    return L === 2 && (k += 60), k;
  }, s.hsv.ansi16 = function(_) {
    return s.rgb.ansi16(s.hsv.rgb(_), _[2]);
  }, s.rgb.ansi256 = function(_) {
    const I = _[0], N = _[1], U = _[2];
    return I >> 4 === N >> 4 && N >> 4 === U >> 4 ? I < 8 ? 16 : I > 248 ? 231 : Math.round((I - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(I / 255 * 5) + 6 * Math.round(N / 255 * 5) + Math.round(U / 255 * 5);
  }, s.ansi16.rgb = function(_) {
    _ = _[0];
    let I = _ % 10;
    if (I === 0 || I === 7)
      return _ > 50 && (I += 3.5), I = I / 10.5 * 255, [I, I, I];
    const N = (Math.trunc(_ > 50) + 1) * 0.5, U = (I & 1) * N * 255, C = (I >> 1 & 1) * N * 255, L = (I >> 2 & 1) * N * 255;
    return [U, C, L];
  }, s.ansi256.rgb = function(_) {
    if (_ = _[0], _ >= 232) {
      const L = (_ - 232) * 10 + 8;
      return [L, L, L];
    }
    _ -= 16;
    let I;
    const N = Math.floor(_ / 36) / 5 * 255, U = Math.floor((I = _ % 36) / 6) / 5 * 255, C = I % 6 / 5 * 255;
    return [N, U, C];
  }, s.rgb.hex = function(_) {
    const N = (((Math.round(_[0]) & 255) << 16) + ((Math.round(_[1]) & 255) << 8) + (Math.round(_[2]) & 255)).toString(16).toUpperCase();
    return "000000".slice(N.length) + N;
  }, s.hex.rgb = function(_) {
    const I = _.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);
    if (!I)
      return [0, 0, 0];
    let N = I[0];
    I[0].length === 3 && (N = [...N].map((M) => M + M).join(""));
    const U = Number.parseInt(N, 16), C = U >> 16 & 255, L = U >> 8 & 255, k = U & 255;
    return [C, L, k];
  }, s.rgb.hcg = function(_) {
    const I = _[0] / 255, N = _[1] / 255, U = _[2] / 255, C = Math.max(Math.max(I, N), U), L = Math.min(Math.min(I, N), U), k = C - L;
    let M;
    const F = k < 1 ? L / (1 - k) : 0;
    return k <= 0 ? M = 0 : C === I ? M = (N - U) / k % 6 : C === N ? M = 2 + (U - I) / k : M = 4 + (I - N) / k, M /= 6, M %= 1, [M * 360, k * 100, F * 100];
  }, s.hsl.hcg = function(_) {
    const I = _[1] / 100, N = _[2] / 100, U = N < 0.5 ? 2 * I * N : 2 * I * (1 - N);
    let C = 0;
    return U < 1 && (C = (N - 0.5 * U) / (1 - U)), [_[0], U * 100, C * 100];
  }, s.hsv.hcg = function(_) {
    const I = _[1] / 100, N = _[2] / 100, U = I * N;
    let C = 0;
    return U < 1 && (C = (N - U) / (1 - U)), [_[0], U * 100, C * 100];
  }, s.hcg.rgb = function(_) {
    const I = _[0] / 360, N = _[1] / 100, U = _[2] / 100;
    if (N === 0)
      return [U * 255, U * 255, U * 255];
    const C = [0, 0, 0], L = I % 1 * 6, k = L % 1, M = 1 - k;
    let F = 0;
    switch (Math.floor(L)) {
      case 0: {
        C[0] = 1, C[1] = k, C[2] = 0;
        break;
      }
      case 1: {
        C[0] = M, C[1] = 1, C[2] = 0;
        break;
      }
      case 2: {
        C[0] = 0, C[1] = 1, C[2] = k;
        break;
      }
      case 3: {
        C[0] = 0, C[1] = M, C[2] = 1;
        break;
      }
      case 4: {
        C[0] = k, C[1] = 0, C[2] = 1;
        break;
      }
      default:
        C[0] = 1, C[1] = 0, C[2] = M;
    }
    return F = (1 - N) * U, [
      (N * C[0] + F) * 255,
      (N * C[1] + F) * 255,
      (N * C[2] + F) * 255
    ];
  }, s.hcg.hsv = function(_) {
    const I = _[1] / 100, N = _[2] / 100, U = I + N * (1 - I);
    let C = 0;
    return U > 0 && (C = I / U), [_[0], C * 100, U * 100];
  }, s.hcg.hsl = function(_) {
    const I = _[1] / 100, U = _[2] / 100 * (1 - I) + 0.5 * I;
    let C = 0;
    return U > 0 && U < 0.5 ? C = I / (2 * U) : U >= 0.5 && U < 1 && (C = I / (2 * (1 - U))), [_[0], C * 100, U * 100];
  }, s.hcg.hwb = function(_) {
    const I = _[1] / 100, N = _[2] / 100, U = I + N * (1 - I);
    return [_[0], (U - I) * 100, (1 - U) * 100];
  }, s.hwb.hcg = function(_) {
    const I = _[1] / 100, U = 1 - _[2] / 100, C = U - I;
    let L = 0;
    return C < 1 && (L = (U - C) / (1 - C)), [_[0], C * 100, L * 100];
  }, s.apple.rgb = function(_) {
    return [_[0] / 65535 * 255, _[1] / 65535 * 255, _[2] / 65535 * 255];
  }, s.rgb.apple = function(_) {
    return [_[0] / 255 * 65535, _[1] / 255 * 65535, _[2] / 255 * 65535];
  }, s.gray.rgb = function(_) {
    return [_[0] / 100 * 255, _[0] / 100 * 255, _[0] / 100 * 255];
  }, s.gray.hsl = function(_) {
    return [0, 0, _[0]];
  }, s.gray.hsv = s.gray.hsl, s.gray.hwb = function(_) {
    return [0, 100, _[0]];
  }, s.gray.cmyk = function(_) {
    return [0, 0, 0, _[0]];
  }, s.gray.lab = function(_) {
    return [_[0], 0, 0];
  }, s.gray.hex = function(_) {
    const I = Math.round(_[0] / 100 * 255) & 255, U = ((I << 16) + (I << 8) + I).toString(16).toUpperCase();
    return "000000".slice(U.length) + U;
  }, s.rgb.gray = function(_) {
    return [(_[0] + _[1] + _[2]) / 3 / 255 * 100];
  };
  function d() {
    const _ = {}, I = Object.keys(s);
    for (let { length: N } = I, U = 0; U < N; U++)
      _[I[U]] = {
        // http://jsperf.com/1-vs-infinity
        // micro-opt, but this is simple.
        distance: -1,
        parent: null
      };
    return _;
  }
  function f(_) {
    const I = d(), N = [_];
    for (I[_].distance = 0; N.length > 0; ) {
      const U = N.pop(), C = Object.keys(s[U]);
      for (let { length: L } = C, k = 0; k < L; k++) {
        const M = C[k], F = I[M];
        F.distance === -1 && (F.distance = I[U].distance + 1, F.parent = U, N.unshift(M));
      }
    }
    return I;
  }
  function m(_, I) {
    return function(N) {
      return I(_(N));
    };
  }
  function h(_, I) {
    const N = [I[_].parent, _];
    let U = s[I[_].parent][_], C = I[_].parent;
    for (; I[C].parent; )
      N.unshift(I[C].parent), U = m(s[I[C].parent][C], U), C = I[C].parent;
    return U.conversion = N, U;
  }
  function y(_) {
    const I = f(_), N = {}, U = Object.keys(I);
    for (let { length: C } = U, L = 0; L < C; L++) {
      const k = U[L];
      I[k].parent !== null && (N[k] = h(k, I));
    }
    return N;
  }
  const x = {}, g = Object.keys(s);
  function v(_) {
    const I = function(...N) {
      const U = N[0];
      return U == null ? U : (U.length > 1 && (N = U), _(N));
    };
    return "conversion" in _ && (I.conversion = _.conversion), I;
  }
  function S(_) {
    const I = function(...N) {
      const U = N[0];
      if (U == null)
        return U;
      U.length > 1 && (N = U);
      const C = _(N);
      if (typeof C == "object")
        for (let { length: L } = C, k = 0; k < L; k++)
          C[k] = Math.round(C[k]);
      return C;
    };
    return "conversion" in _ && (I.conversion = _.conversion), I;
  }
  for (const _ of g) {
    x[_] = {}, Object.defineProperty(x[_], "channels", { value: s[_].channels }), Object.defineProperty(x[_], "labels", { value: s[_].labels });
    const I = y(_), N = Object.keys(I);
    for (const U of N) {
      const C = I[U];
      x[_][U] = S(C), x[_][U].raw = v(C);
    }
  }
  const E = [
    // To be honest, I don't really feel like keyword belongs in color convert, but eh.
    "keyword",
    // Gray conflicts with some method names, and has its own method defined.
    "gray",
    // Shouldn't really be in color-convert either...
    "hex"
  ], T = {};
  for (const _ of Object.keys(x))
    T[[...x[_].labels].sort().join("")] = _;
  const j = {};
  function q(_, I) {
    if (!(this instanceof q))
      return new q(_, I);
    if (I && I in E && (I = null), I && !(I in x))
      throw new Error("Unknown model: " + I);
    let N, U;
    if (_ == null)
      this.model = "rgb", this.color = [0, 0, 0], this.valpha = 1;
    else if (_ instanceof q)
      this.model = _.model, this.color = [..._.color], this.valpha = _.valpha;
    else if (typeof _ == "string") {
      const C = n.get(_);
      if (C === null)
        throw new Error("Unable to parse color from string: " + _);
      this.model = C.model, U = x[this.model].channels, this.color = C.value.slice(0, U), this.valpha = typeof C.value[U] == "number" ? C.value[U] : 1;
    } else if (_.length > 0) {
      this.model = I || "rgb", U = x[this.model].channels;
      const C = Array.prototype.slice.call(_, 0, U);
      this.color = D(C, U), this.valpha = typeof _[U] == "number" ? _[U] : 1;
    } else if (typeof _ == "number")
      this.model = "rgb", this.color = [
        _ >> 16 & 255,
        _ >> 8 & 255,
        _ & 255
      ], this.valpha = 1;
    else {
      this.valpha = 1;
      const C = Object.keys(_);
      "alpha" in _ && (C.splice(C.indexOf("alpha"), 1), this.valpha = typeof _.alpha == "number" ? _.alpha : 0);
      const L = C.sort().join("");
      if (!(L in T))
        throw new Error("Unable to parse color from object: " + JSON.stringify(_));
      this.model = T[L];
      const { labels: k } = x[this.model], M = [];
      for (N = 0; N < k.length; N++)
        M.push(_[k[N]]);
      this.color = D(M);
    }
    if (j[this.model])
      for (U = x[this.model].channels, N = 0; N < U; N++) {
        const C = j[this.model][N];
        C && (this.color[N] = C(this.color[N]));
      }
    this.valpha = Math.max(0, Math.min(1, this.valpha)), Object.freeze && Object.freeze(this);
  }
  q.prototype = {
    toString() {
      return this.string();
    },
    toJSON() {
      return this[this.model]();
    },
    string(_) {
      let I = this.model in n.to ? this : this.rgb();
      I = I.round(typeof _ == "number" ? _ : 1);
      const N = I.valpha === 1 ? I.color : [...I.color, this.valpha];
      return n.to[I.model](...N);
    },
    percentString(_) {
      const I = this.rgb().round(typeof _ == "number" ? _ : 1), N = I.valpha === 1 ? I.color : [...I.color, this.valpha];
      return n.to.rgb.percent(...N);
    },
    array() {
      return this.valpha === 1 ? [...this.color] : [...this.color, this.valpha];
    },
    object() {
      const _ = {}, { channels: I } = x[this.model], { labels: N } = x[this.model];
      for (let U = 0; U < I; U++)
        _[N[U]] = this.color[U];
      return this.valpha !== 1 && (_.alpha = this.valpha), _;
    },
    unitArray() {
      const _ = this.rgb().color;
      return _[0] /= 255, _[1] /= 255, _[2] /= 255, this.valpha !== 1 && _.push(this.valpha), _;
    },
    unitObject() {
      const _ = this.rgb().object();
      return _.r /= 255, _.g /= 255, _.b /= 255, this.valpha !== 1 && (_.alpha = this.valpha), _;
    },
    round(_) {
      return _ = Math.max(_ || 0, 0), new q([...this.color.map(W(_)), this.valpha], this.model);
    },
    alpha(_) {
      return _ !== void 0 ? new q([...this.color, Math.max(0, Math.min(1, _))], this.model) : this.valpha;
    },
    // Rgb
    red: G("rgb", 0, J(255)),
    green: G("rgb", 1, J(255)),
    blue: G("rgb", 2, J(255)),
    hue: G(["hsl", "hsv", "hsl", "hwb", "hcg"], 0, (_) => (_ % 360 + 360) % 360),
    saturationl: G("hsl", 1, J(100)),
    lightness: G("hsl", 2, J(100)),
    saturationv: G("hsv", 1, J(100)),
    value: G("hsv", 2, J(100)),
    chroma: G("hcg", 1, J(100)),
    gray: G("hcg", 2, J(100)),
    white: G("hwb", 1, J(100)),
    wblack: G("hwb", 2, J(100)),
    cyan: G("cmyk", 0, J(100)),
    magenta: G("cmyk", 1, J(100)),
    yellow: G("cmyk", 2, J(100)),
    black: G("cmyk", 3, J(100)),
    x: G("xyz", 0, J(95.047)),
    y: G("xyz", 1, J(100)),
    z: G("xyz", 2, J(108.833)),
    l: G("lab", 0, J(100)),
    a: G("lab", 1),
    b: G("lab", 2),
    keyword(_) {
      return _ !== void 0 ? new q(_) : x[this.model].keyword(this.color);
    },
    hex(_) {
      return _ !== void 0 ? new q(_) : n.to.hex(...this.rgb().round().color);
    },
    hexa(_) {
      if (_ !== void 0)
        return new q(_);
      const I = this.rgb().round().color;
      let N = Math.round(this.valpha * 255).toString(16).toUpperCase();
      return N.length === 1 && (N = "0" + N), n.to.hex(...I) + N;
    },
    rgbNumber() {
      const _ = this.rgb().color;
      return (_[0] & 255) << 16 | (_[1] & 255) << 8 | _[2] & 255;
    },
    luminosity() {
      const _ = this.rgb().color, I = [];
      for (const [N, U] of _.entries()) {
        const C = U / 255;
        I[N] = C <= 0.04045 ? C / 12.92 : ((C + 0.055) / 1.055) ** 2.4;
      }
      return 0.2126 * I[0] + 0.7152 * I[1] + 0.0722 * I[2];
    },
    contrast(_) {
      const I = this.luminosity(), N = _.luminosity();
      return I > N ? (I + 0.05) / (N + 0.05) : (N + 0.05) / (I + 0.05);
    },
    level(_) {
      const I = this.contrast(_);
      return I >= 7 ? "AAA" : I >= 4.5 ? "AA" : "";
    },
    isDark() {
      const _ = this.rgb().color;
      return (_[0] * 2126 + _[1] * 7152 + _[2] * 722) / 1e4 < 128;
    },
    isLight() {
      return !this.isDark();
    },
    negate() {
      const _ = this.rgb();
      for (let I = 0; I < 3; I++)
        _.color[I] = 255 - _.color[I];
      return _;
    },
    lighten(_) {
      const I = this.hsl();
      return I.color[2] += I.color[2] * _, I;
    },
    darken(_) {
      const I = this.hsl();
      return I.color[2] -= I.color[2] * _, I;
    },
    saturate(_) {
      const I = this.hsl();
      return I.color[1] += I.color[1] * _, I;
    },
    desaturate(_) {
      const I = this.hsl();
      return I.color[1] -= I.color[1] * _, I;
    },
    whiten(_) {
      const I = this.hwb();
      return I.color[1] += I.color[1] * _, I;
    },
    blacken(_) {
      const I = this.hwb();
      return I.color[2] += I.color[2] * _, I;
    },
    grayscale() {
      const _ = this.rgb().color, I = _[0] * 0.3 + _[1] * 0.59 + _[2] * 0.11;
      return q.rgb(I, I, I);
    },
    fade(_) {
      return this.alpha(this.valpha - this.valpha * _);
    },
    opaquer(_) {
      return this.alpha(this.valpha + this.valpha * _);
    },
    rotate(_) {
      const I = this.hsl();
      let N = I.color[0];
      return N = (N + _) % 360, N = N < 0 ? 360 + N : N, I.color[0] = N, I;
    },
    mix(_, I) {
      if (!_ || !_.rgb)
        throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof _);
      const N = _.rgb(), U = this.rgb(), C = I === void 0 ? 0.5 : I, L = 2 * C - 1, k = N.alpha() - U.alpha(), M = ((L * k === -1 ? L : (L + k) / (1 + L * k)) + 1) / 2, F = 1 - M;
      return q.rgb(
        M * N.red() + F * U.red(),
        M * N.green() + F * U.green(),
        M * N.blue() + F * U.blue(),
        N.alpha() * C + U.alpha() * (1 - C)
      );
    }
  };
  for (const _ of Object.keys(x)) {
    if (E.includes(_))
      continue;
    const { channels: I } = x[_];
    q.prototype[_] = function(...N) {
      return this.model === _ ? new q(this) : N.length > 0 ? new q(N, _) : new q([...B(x[this.model][_].raw(this.color)), this.valpha], _);
    }, q[_] = function(...N) {
      let U = N[0];
      return typeof U == "number" && (U = D(N, I)), new q(U, _);
    };
  }
  function Y(_, I) {
    return Number(_.toFixed(I));
  }
  function W(_) {
    return function(I) {
      return Y(I, _);
    };
  }
  function G(_, I, N) {
    _ = Array.isArray(_) ? _ : [_];
    for (const U of _)
      (j[U] ||= [])[I] = N;
    return _ = _[0], function(U) {
      let C;
      return U !== void 0 ? (N && (U = N(U)), C = this[_](), C.color[I] = U, C) : (C = this[_]().color[I], N && (C = N(C)), C);
    };
  }
  function J(_) {
    return function(I) {
      return Math.max(0, Math.min(_, I));
    };
  }
  function B(_) {
    return Array.isArray(_) ? _ : [_];
  }
  function D(_, I) {
    for (let N = 0; N < I; N++)
      typeof _[N] != "number" && (_[N] = 0);
    return _;
  }
  function X(_) {
    return _ && _.__esModule && Object.prototype.hasOwnProperty.call(_, "default") ? _.default : _;
  }
  var V = function(I) {
    for (var N = 0, U = 0; N < I.length; U = I.charCodeAt(N++) + ((U << 5) - U)) ;
    var C = Math.floor(
      Math.abs(
        Math.sin(U) * 1e4 % 1 * 16777216
      )
    ).toString(16);
    return "#" + Array(6 - C.length + 1).join("0") + C;
  }, K = /* @__PURE__ */ X(V);
  function $(_, I) {
    const N = _.split(I || ":");
    let U = K(N[0]);
    if (!N.length) return U;
    for (let C = 0, L = N.length - 1; C < L; C++)
      U = q(U).mix(q(K(N[C + 1]))).saturate(1).hex();
    return U;
  }
  return Ob = $, Ob;
}
var Mb, k4;
function WK() {
  if (k4) return Mb;
  k4 = 1;
  var t = HK();
  return Mb = function(n, r) {
    var i = r.namespace;
    if (r.colors === !1)
      return n[0] = i + ": " + n[0], n;
    var o = t(i);
    return n[0] = "%c" + i + ":%c " + n[0], n.splice(1, 0, "color:" + o, "color:inherit"), n;
  }, Mb;
}
var Rb, N4;
function zK() {
  return N4 || (N4 = 1, Rb = function(e, n) {
    if (!n) return !1;
    for (var r = n.split(/[\s,]+/), i = 0; i < r.length; i++) {
      if (n = r[i].replace("*", ".*?"), n.charAt(0) === "-") {
        if (new RegExp("^" + n.substr(1) + "$").test(e))
          return !1;
        continue;
      }
      if (new RegExp("^" + n + "$").test(e))
        return !0;
    }
    return !1;
  }), Rb;
}
var Bb, P4;
function V8() {
  if (P4) return Bb;
  P4 = 1;
  var t = zK();
  return Bb = function(n) {
    return function(i) {
      try {
        return t(i, n());
      } catch {
      }
      return !1;
    };
  }, Bb;
}
var Ub, D4;
function KK() {
  if (D4) return Ub;
  D4 = 1;
  var t = V8();
  return Ub = t(function() {
    return localStorage.getItem("debug") || localStorage.getItem("diagnostics");
  }), Ub;
}
var Lb, F4;
function VK() {
  if (F4) return Lb;
  F4 = 1;
  var t = V8();
  return Lb = t(function() {
    return /(debug|diagnostics)=([^&]+)/i.exec(window.location.hash)[2];
  }), Lb;
}
var jb, O4;
function YK() {
  return O4 || (O4 = 1, jb = function(t, e) {
    try {
      Function.prototype.apply.call(console.log, console, e);
    } catch {
    }
  }), jb;
}
var Qb, M4;
function JK() {
  if (M4) return Qb;
  M4 = 1;
  var t = K8(), e = t(function n(r, i) {
    return i = i || {}, i.namespace = r, i.prod = !1, i.dev = !0, !n.enabled(r) && !(i.force || n.force) ? n.nope(i) : n.yep(i);
  });
  return e.modify(WK()), e.use(KK()), e.use(VK()), e.set(YK()), Qb = e, Qb;
}
var R4;
function Zg() {
  return R4 || (R4 = 1, process.env.NODE_ENV === "production" ? vh.exports = qK() : vh.exports = JK()), vh.exports;
}
var $b, B4;
function XK() {
  if (B4) return $b;
  B4 = 1;
  var t = de, e = K_, n = e.StringDecoder, r = yc(), i = r.Stream;
  function o() {
  }
  return $b = function(s, a) {
    var c = Buffer.alloc(65536), u = new n("utf8"), l = new i(), d = "", f = 0, m = 0;
    return s.start === -1 && delete s.start, l.readable = !0, l.destroy = function() {
      l.destroyed = !0, l.emit("end"), l.emit("close");
    }, t.open(s.file, "a+", "0644", function(h, y) {
      if (h) {
        a ? a(h) : l.emit("error", h), l.destroy();
        return;
      }
      (function x() {
        if (l.destroyed) {
          t.close(y, o);
          return;
        }
        return t.read(y, c, 0, c.length, f, function(g, v) {
          if (g) {
            a ? a(g) : l.emit("error", g), l.destroy();
            return;
          }
          if (!v)
            return d && ((s.start == null || m > s.start) && (a ? a(null, d) : l.emit("line", d)), m++, d = ""), setTimeout(x, 1e3);
          var S = u.write(c.slice(0, v));
          a || l.emit("data", S), S = (d + S).split(/\n+/);
          for (var E = S.length - 1, T = 0; T < E; T++)
            (s.start == null || m > s.start) && (a ? a(null, S[T]) : l.emit("line", S[T])), m++;
          return d = S[E], f += v, x();
        });
      })();
    }), a ? l.destroy : l;
  }, $b;
}
var Gb, U4;
function ZK() {
  if (U4) return Gb;
  U4 = 1;
  function t(G) {
    "@babel/helpers - typeof";
    return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(J) {
      return typeof J;
    } : function(J) {
      return J && typeof Symbol == "function" && J.constructor === Symbol && J !== Symbol.prototype ? "symbol" : typeof J;
    }, t(G);
  }
  function e(G, J) {
    if (!(G instanceof J)) throw new TypeError("Cannot call a class as a function");
  }
  function n(G, J) {
    for (var B = 0; B < J.length; B++) {
      var D = J[B];
      D.enumerable = D.enumerable || !1, D.configurable = !0, "value" in D && (D.writable = !0), Object.defineProperty(G, i(D.key), D);
    }
  }
  function r(G, J, B) {
    return J && n(G.prototype, J), Object.defineProperty(G, "prototype", { writable: !1 }), G;
  }
  function i(G) {
    var J = o(G, "string");
    return t(J) == "symbol" ? J : J + "";
  }
  function o(G, J) {
    if (t(G) != "object" || !G) return G;
    var B = G[Symbol.toPrimitive];
    if (B !== void 0) {
      var D = B.call(G, J);
      if (t(D) != "object") return D;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(G);
  }
  function s(G, J, B) {
    return J = l(J), a(G, u() ? Reflect.construct(J, B || [], l(G).constructor) : J.apply(G, B));
  }
  function a(G, J) {
    if (J && (t(J) == "object" || typeof J == "function")) return J;
    if (J !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
    return c(G);
  }
  function c(G) {
    if (G === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    return G;
  }
  function u() {
    try {
      var G = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
    } catch {
    }
    return (u = function() {
      return !!G;
    })();
  }
  function l(G) {
    return l = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(J) {
      return J.__proto__ || Object.getPrototypeOf(J);
    }, l(G);
  }
  function d(G, J) {
    if (typeof J != "function" && J !== null) throw new TypeError("Super expression must either be null or a function");
    G.prototype = Object.create(J && J.prototype, { constructor: { value: G, writable: !0, configurable: !0 } }), Object.defineProperty(G, "prototype", { writable: !1 }), J && f(G, J);
  }
  function f(G, J) {
    return f = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(B, D) {
      return B.__proto__ = D, B;
    }, f(G, J);
  }
  var m = de, h = be, y = QK(), x = qu, g = on(), v = g.MESSAGE, S = yc(), E = S.Stream, T = S.PassThrough, j = Fd(), q = Zg()("winston:file"), Y = Pn, W = XK();
  return Gb = /* @__PURE__ */ (function(G) {
    function J() {
      var B, D = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
      e(this, J), B = s(this, J, [D]), B.name = D.name || "file";
      function X(V) {
        for (var K = arguments.length, $ = new Array(K > 1 ? K - 1 : 0), _ = 1; _ < K; _++)
          $[_ - 1] = arguments[_];
        $.slice(1).forEach(function(I) {
          if (D[I])
            throw new Error("Cannot set ".concat(I, " and ").concat(V, " together"));
        });
      }
      if (B._stream = new T(), B._stream.setMaxListeners(30), B._onError = B._onError.bind(B), D.filename || D.dirname)
        X("filename or dirname", "stream"), B._basename = B.filename = D.filename ? h.basename(D.filename) : "winston.log", B.dirname = D.dirname || h.dirname(D.filename), B.options = D.options || {
          flags: "a"
        };
      else if (D.stream)
        console.warn("options.stream will be removed in winston@4. Use winston.transports.Stream"), X("stream", "filename", "maxsize"), B._dest = B._stream.pipe(B._setupStream(D.stream)), B.dirname = h.dirname(B._dest.path);
      else
        throw new Error("Cannot log to file without filename or stream.");
      return B.maxsize = D.maxsize || null, B.rotationFormat = D.rotationFormat || !1, B.zippedArchive = D.zippedArchive || !1, B.maxFiles = D.maxFiles || null, B.eol = typeof D.eol == "string" ? D.eol : Y.EOL, B.tailable = D.tailable || !1, B.lazy = D.lazy || !1, B._size = 0, B._pendingSize = 0, B._created = 0, B._drain = !1, B._opening = !1, B._ending = !1, B._fileExist = !1, B.dirname && B._createLogDirIfNotExist(B.dirname), B.lazy || B.open(), B;
    }
    return d(J, G), r(J, [{
      key: "finishIfEnding",
      value: function() {
        var D = this;
        this._ending && (this._opening ? this.once("open", function() {
          D._stream.once("finish", function() {
            return D.emit("finish");
          }), setImmediate(function() {
            return D._stream.end();
          });
        }) : (this._stream.once("finish", function() {
          return D.emit("finish");
        }), setImmediate(function() {
          return D._stream.end();
        })));
      }
      /**
       * Core logging method exposed to Winston. Metadata is optional.
       * @param {Object} info - TODO: add param description.
       * @param {Function} callback - TODO: add param description.
       * @returns {undefined}
       */
    }, {
      key: "log",
      value: function(D) {
        var X = this, V = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : function() {
        };
        if (this.silent)
          return V(), !0;
        if (this._drain) {
          this._stream.once("drain", function() {
            X._drain = !1, X.log(D, V);
          });
          return;
        }
        if (this._rotate) {
          this._stream.once("rotate", function() {
            X._rotate = !1, X.log(D, V);
          });
          return;
        }
        if (this.lazy) {
          if (!this._fileExist) {
            this._opening || this.open(), this.once("open", function() {
              X._fileExist = !0, X.log(D, V);
            });
            return;
          }
          if (this._needsNewFile(this._pendingSize)) {
            this._dest.once("close", function() {
              X._opening || X.open(), X.once("open", function() {
                X.log(D, V);
              });
            });
            return;
          }
        }
        var K = "".concat(D[v]).concat(this.eol), $ = Buffer.byteLength(K);
        function _() {
          var N = this;
          if (this._size += $, this._pendingSize -= $, q("logged %s %s", this._size, K), this.emit("logged", D), !this._rotate && !this._opening && this._needsNewFile()) {
            if (this.lazy) {
              this._endStream(function() {
                N.emit("fileclosed");
              });
              return;
            }
            this._rotate = !0, this._endStream(function() {
              return N._rotateFile();
            });
          }
        }
        this._pendingSize += $, this._opening && !this.rotatedWhileOpening && this._needsNewFile(this._size + this._pendingSize) && (this.rotatedWhileOpening = !0);
        var I = this._stream.write(K, _.bind(this));
        return I ? V() : (this._drain = !0, this._stream.once("drain", function() {
          X._drain = !1, V();
        })), q("written", I, this._drain), this.finishIfEnding(), I;
      }
      /**
       * Query the transport. Options object is optional.
       * @param {Object} options - Loggly-like query options for this instance.
       * @param {function} callback - Continuation to respond to when complete.
       * TODO: Refactor me.
       */
    }, {
      key: "query",
      value: function(D, X) {
        typeof D == "function" && (X = D, D = {}), D = L(D);
        var V = h.join(this.dirname, this.filename), K = "", $ = [], _ = 0, I = m.createReadStream(V, {
          encoding: "utf8"
        });
        I.on("error", function(k) {
          if (I.readable && I.destroy(), !!X)
            return k.code !== "ENOENT" ? X(k) : X(null, $);
        }), I.on("data", function(k) {
          k = (K + k).split(/\n+/);
          for (var M = k.length - 1, F = 0; F < M; F++)
            (!D.start || _ >= D.start) && N(k[F]), _++;
          K = k[M];
        }), I.on("close", function() {
          K && N(K, !0), D.order === "desc" && ($ = $.reverse()), X && X(null, $);
        });
        function N(k, M) {
          try {
            var F = JSON.parse(k);
            C(F) && U(F);
          } catch (A) {
            M || I.emit("error", A);
          }
        }
        function U(k) {
          if (D.rows && $.length >= D.rows && D.order !== "desc") {
            I.readable && I.destroy();
            return;
          }
          D.fields && (k = D.fields.reduce(function(M, F) {
            return M[F] = k[F], M;
          }, {})), D.order === "desc" && $.length >= D.rows && $.shift(), $.push(k);
        }
        function C(k) {
          if (k && t(k) === "object") {
            var M = new Date(k.timestamp);
            if (!(D.from && M < D.from || D.until && M > D.until || D.level && D.level !== k.level))
              return !0;
          }
        }
        function L(k) {
          return k = k || {}, k.rows = k.rows || k.limit || 10, k.start = k.start || 0, k.until = k.until || /* @__PURE__ */ new Date(), t(k.until) !== "object" && (k.until = new Date(k.until)), k.from = k.from || k.until - 1440 * 60 * 1e3, t(k.from) !== "object" && (k.from = new Date(k.from)), k.order = k.order || "desc", k;
        }
      }
      /**
       * Returns a log stream for this transport. Options object is optional.
       * @param {Object} options - Stream options for this instance.
       * @returns {Stream} - TODO: add return description.
       * TODO: Refactor me.
       */
    }, {
      key: "stream",
      value: function() {
        var D = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, X = h.join(this.dirname, this.filename), V = new E(), K = {
          file: X,
          start: D.start
        };
        return V.destroy = W(K, function($, _) {
          if ($)
            return V.emit("error", $);
          try {
            V.emit("data", _), _ = JSON.parse(_), V.emit("log", _);
          } catch (I) {
            V.emit("error", I);
          }
        }), V;
      }
      /**
       * Checks to see the filesize of.
       * @returns {undefined}
       */
    }, {
      key: "open",
      value: function() {
        var D = this;
        this.filename && (this._opening || (this._opening = !0, this.stat(function(X, V) {
          if (X)
            return D.emit("error", X);
          q("stat done: %s { size: %s }", D.filename, V), D._size = V, D._dest = D._createStream(D._stream), D._opening = !1, D.once("open", function() {
            D._stream.emit("rotate") || (D._rotate = !1);
          });
        })));
      }
      /**
       * Stat the file and assess information in order to create the proper stream.
       * @param {function} callback - TODO: add param description.
       * @returns {undefined}
       */
    }, {
      key: "stat",
      value: function(D) {
        var X = this, V = this._getFile(), K = h.join(this.dirname, V);
        m.stat(K, function($, _) {
          if ($ && $.code === "ENOENT")
            return q("ENOENT ok", K), X.filename = V, D(null, 0);
          if ($)
            return q("err ".concat($.code, " ").concat(K)), D($);
          if (!_ || X._needsNewFile(_.size))
            return X._incFile(function() {
              return X.stat(D);
            });
          X.filename = V, D(null, _.size);
        });
      }
      /**
       * Closes the stream associated with this instance.
       * @param {function} cb - TODO: add param description.
       * @returns {undefined}
       */
    }, {
      key: "close",
      value: function(D) {
        var X = this;
        this._stream && this._stream.end(function() {
          D && D(), X.emit("flush"), X.emit("closed");
        });
      }
      /**
       * TODO: add method description.
       * @param {number} size - TODO: add param description.
       * @returns {undefined}
       */
    }, {
      key: "_needsNewFile",
      value: function(D) {
        return D = D || this._size, this.maxsize && D >= this.maxsize;
      }
      /**
       * TODO: add method description.
       * @param {Error} err - TODO: add param description.
       * @returns {undefined}
       */
    }, {
      key: "_onError",
      value: function(D) {
        this.emit("error", D);
      }
      /**
       * TODO: add method description.
       * @param {Stream} stream - TODO: add param description.
       * @returns {mixed} - TODO: add return description.
       */
    }, {
      key: "_setupStream",
      value: function(D) {
        return D.on("error", this._onError), D;
      }
      /**
       * TODO: add method description.
       * @param {Stream} stream - TODO: add param description.
       * @returns {mixed} - TODO: add return description.
       */
    }, {
      key: "_cleanupStream",
      value: function(D) {
        return D.removeListener("error", this._onError), D.destroy(), D;
      }
      /**
       * TODO: add method description.
       */
    }, {
      key: "_rotateFile",
      value: function() {
        var D = this;
        this._incFile(function() {
          return D.open();
        });
      }
      /**
       * Unpipe from the stream that has been marked as full and end it so it
       * flushes to disk.
       *
       * @param {function} callback - Callback for when the current file has closed.
       * @private
       */
    }, {
      key: "_endStream",
      value: function() {
        var D = this, X = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function() {
        };
        this._dest ? (this._stream.unpipe(this._dest), this._dest.end(function() {
          D._cleanupStream(D._dest), X();
        })) : X();
      }
      /**
       * Returns the WritableStream for the active file on this instance. If we
       * should gzip the file then a zlib stream is returned.
       *
       * @param {ReadableStream} source –PassThrough to pipe to the file when open.
       * @returns {WritableStream} Stream that writes to disk for the active file.
       */
    }, {
      key: "_createStream",
      value: function(D) {
        var X = this, V = h.join(this.dirname, this.filename);
        q("create stream start", V, this.options);
        var K = m.createWriteStream(V, this.options).on("error", function($) {
          return q($);
        }).on("close", function() {
          return q("close", K.path, K.bytesWritten);
        }).on("open", function() {
          q("file open ok", V), X.emit("open", V), D.pipe(K), X.rotatedWhileOpening && (X._stream = new T(), X._stream.setMaxListeners(30), X._rotateFile(), X.rotatedWhileOpening = !1, X._cleanupStream(K), D.end());
        });
        return q("create stream ok", V), K;
      }
      /**
       * TODO: add method description.
       * @param {function} callback - TODO: add param description.
       * @returns {undefined}
       */
    }, {
      key: "_incFile",
      value: function(D) {
        q("_incFile", this.filename);
        var X = h.extname(this._basename), V = h.basename(this._basename, X), K = [];
        this.zippedArchive && K.push(function($) {
          var _ = this._created > 0 && !this.tailable ? this._created : "";
          this._compressFile(h.join(this.dirname, "".concat(V).concat(_).concat(X)), h.join(this.dirname, "".concat(V).concat(_).concat(X, ".gz")), $);
        }.bind(this)), K.push(function($) {
          this.tailable ? this._checkMaxFilesTailable(X, V, $) : (this._created += 1, this._checkMaxFilesIncrementing(X, V, $));
        }.bind(this)), y(K, D);
      }
      /**
       * Gets the next filename to use for this instance in the case that log
       * filesizes are being capped.
       * @returns {string} - TODO: add return description.
       * @private
       */
    }, {
      key: "_getFile",
      value: function() {
        var D = h.extname(this._basename), X = h.basename(this._basename, D), V = this.rotationFormat ? this.rotationFormat() : this._created;
        return !this.tailable && this._created ? "".concat(X).concat(V).concat(D) : "".concat(X).concat(D);
      }
      /**
       * Increment the number of files created or checked by this instance.
       * @param {mixed} ext - TODO: add param description.
       * @param {mixed} basename - TODO: add param description.
       * @param {mixed} callback - TODO: add param description.
       * @returns {undefined}
       * @private
       */
    }, {
      key: "_checkMaxFilesIncrementing",
      value: function(D, X, V) {
        if (!this.maxFiles || this._created < this.maxFiles)
          return setImmediate(V);
        var K = this._created - this.maxFiles, $ = K !== 0 ? K : "", _ = this.zippedArchive ? ".gz" : "", I = "".concat(X).concat($).concat(D).concat(_), N = h.join(this.dirname, I);
        m.unlink(N, V);
      }
      /**
       * Roll files forward based on integer, up to maxFiles. e.g. if base if
       * file.log and it becomes oversized, roll to file1.log, and allow file.log
       * to be re-used. If file is oversized again, roll file1.log to file2.log,
       * roll file.log to file1.log, and so on.
       * @param {mixed} ext - TODO: add param description.
       * @param {mixed} basename - TODO: add param description.
       * @param {mixed} callback - TODO: add param description.
       * @returns {undefined}
       * @private
       */
    }, {
      key: "_checkMaxFilesTailable",
      value: function(D, X, V) {
        var K = this, $ = [];
        if (this.maxFiles) {
          for (var _ = this.zippedArchive ? ".gz" : "", I = this.maxFiles - 1; I > 1; I--)
            $.push(function(N, U) {
              var C = this, L = "".concat(X).concat(N - 1).concat(D).concat(_), k = h.join(this.dirname, L);
              m.exists(k, function(M) {
                if (!M)
                  return U(null);
                L = "".concat(X).concat(N).concat(D).concat(_), m.rename(k, h.join(C.dirname, L), U);
              });
            }.bind(this, I));
          y($, function() {
            m.rename(h.join(K.dirname, "".concat(X).concat(D).concat(_)), h.join(K.dirname, "".concat(X, "1").concat(D).concat(_)), V);
          });
        }
      }
      /**
       * Compresses src to dest with gzip and unlinks src
       * @param {string} src - path to source file.
       * @param {string} dest - path to zipped destination file.
       * @param {Function} callback - callback called after file has been compressed.
       * @returns {undefined}
       * @private
       */
    }, {
      key: "_compressFile",
      value: function(D, X, V) {
        m.access(D, m.F_OK, function(K) {
          if (K)
            return V();
          var $ = x.createGzip(), _ = m.createReadStream(D), I = m.createWriteStream(X);
          I.on("finish", function() {
            m.unlink(D, V);
          }), _.pipe($).pipe(I);
        });
      }
    }, {
      key: "_createLogDirIfNotExist",
      value: function(D) {
        m.existsSync(D) || m.mkdirSync(D, {
          recursive: !0
        });
      }
    }]);
  })(j), Gb;
}
var qb, L4;
function eV() {
  if (L4) return qb;
  L4 = 1;
  function t(q) {
    "@babel/helpers - typeof";
    return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(Y) {
      return typeof Y;
    } : function(Y) {
      return Y && typeof Symbol == "function" && Y.constructor === Symbol && Y !== Symbol.prototype ? "symbol" : typeof Y;
    }, t(q);
  }
  function e(q, Y) {
    var W = Object.keys(q);
    if (Object.getOwnPropertySymbols) {
      var G = Object.getOwnPropertySymbols(q);
      Y && (G = G.filter(function(J) {
        return Object.getOwnPropertyDescriptor(q, J).enumerable;
      })), W.push.apply(W, G);
    }
    return W;
  }
  function n(q) {
    for (var Y = 1; Y < arguments.length; Y++) {
      var W = arguments[Y] != null ? arguments[Y] : {};
      Y % 2 ? e(Object(W), !0).forEach(function(G) {
        r(q, G, W[G]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(q, Object.getOwnPropertyDescriptors(W)) : e(Object(W)).forEach(function(G) {
        Object.defineProperty(q, G, Object.getOwnPropertyDescriptor(W, G));
      });
    }
    return q;
  }
  function r(q, Y, W) {
    return (Y = a(Y)) in q ? Object.defineProperty(q, Y, { value: W, enumerable: !0, configurable: !0, writable: !0 }) : q[Y] = W, q;
  }
  function i(q, Y) {
    if (!(q instanceof Y)) throw new TypeError("Cannot call a class as a function");
  }
  function o(q, Y) {
    for (var W = 0; W < Y.length; W++) {
      var G = Y[W];
      G.enumerable = G.enumerable || !1, G.configurable = !0, "value" in G && (G.writable = !0), Object.defineProperty(q, a(G.key), G);
    }
  }
  function s(q, Y, W) {
    return Y && o(q.prototype, Y), Object.defineProperty(q, "prototype", { writable: !1 }), q;
  }
  function a(q) {
    var Y = c(q, "string");
    return t(Y) == "symbol" ? Y : Y + "";
  }
  function c(q, Y) {
    if (t(q) != "object" || !q) return q;
    var W = q[Symbol.toPrimitive];
    if (W !== void 0) {
      var G = W.call(q, Y);
      if (t(G) != "object") return G;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(q);
  }
  function u(q, Y, W) {
    return Y = m(Y), l(q, f() ? Reflect.construct(Y, W || [], m(q).constructor) : Y.apply(q, W));
  }
  function l(q, Y) {
    if (Y && (t(Y) == "object" || typeof Y == "function")) return Y;
    if (Y !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
    return d(q);
  }
  function d(q) {
    if (q === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    return q;
  }
  function f() {
    try {
      var q = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
    } catch {
    }
    return (f = function() {
      return !!q;
    })();
  }
  function m(q) {
    return m = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(Y) {
      return Y.__proto__ || Object.getPrototypeOf(Y);
    }, m(q);
  }
  function h(q, Y) {
    if (typeof Y != "function" && Y !== null) throw new TypeError("Super expression must either be null or a function");
    q.prototype = Object.create(Y && Y.prototype, { constructor: { value: q, writable: !0, configurable: !0 } }), Object.defineProperty(q, "prototype", { writable: !1 }), Y && y(q, Y);
  }
  function y(q, Y) {
    return y = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(W, G) {
      return W.__proto__ = G, W;
    }, y(q, Y);
  }
  var x = fc, g = Gu, v = yc(), S = v.Stream, E = Fd(), T = Dd(), j = T.configure;
  return qb = /* @__PURE__ */ (function(q) {
    function Y() {
      var W, G = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
      return i(this, Y), W = u(this, Y, [G]), W.options = G, W.name = G.name || "http", W.ssl = !!G.ssl, W.host = G.host || "localhost", W.port = G.port, W.auth = G.auth, W.path = G.path || "", W.maximumDepth = G.maximumDepth, W.agent = G.agent, W.headers = G.headers || {}, W.headers["content-type"] = "application/json", W.batch = G.batch || !1, W.batchInterval = G.batchInterval || 5e3, W.batchCount = G.batchCount || 10, W.batchOptions = [], W.batchTimeoutID = -1, W.batchCallback = {}, W.port || (W.port = W.ssl ? 443 : 80), W;
    }
    return h(Y, q), s(Y, [{
      key: "log",
      value: function(G, J) {
        var B = this;
        this._request(G, null, null, function(D, X) {
          X && X.statusCode !== 200 && (D = new Error("Invalid HTTP Status Code: ".concat(X.statusCode))), D ? B.emit("warn", D) : B.emit("logged", G);
        }), J && setImmediate(J);
      }
      /**
       * Query the transport. Options object is optional.
       * @param {Object} options -  Loggly-like query options for this instance.
       * @param {function} callback - Continuation to respond to when complete.
       * @returns {undefined}
       */
    }, {
      key: "query",
      value: function(G, J) {
        typeof G == "function" && (J = G, G = {}), G = {
          method: "query",
          params: this.normalizeQuery(G)
        };
        var B = G.params.auth || null;
        delete G.params.auth;
        var D = G.params.path || null;
        delete G.params.path, this._request(G, B, D, function(X, V, K) {
          if (V && V.statusCode !== 200 && (X = new Error("Invalid HTTP Status Code: ".concat(V.statusCode))), X)
            return J(X);
          if (typeof K == "string")
            try {
              K = JSON.parse(K);
            } catch ($) {
              return J($);
            }
          J(null, K);
        });
      }
      /**
       * Returns a log stream for this transport. Options object is optional.
       * @param {Object} options - Stream options for this instance.
       * @returns {Stream} - TODO: add return description
       */
    }, {
      key: "stream",
      value: function() {
        var G = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, J = new S();
        G = {
          method: "stream",
          params: G
        };
        var B = G.params.path || null;
        delete G.params.path;
        var D = G.params.auth || null;
        delete G.params.auth;
        var X = "", V = this._request(G, D, B);
        return J.destroy = function() {
          return V.destroy();
        }, V.on("data", function(K) {
          K = (X + K).split(/\n+/);
          for (var $ = K.length - 1, _ = 0; _ < $; _++)
            try {
              J.emit("log", JSON.parse(K[_]));
            } catch (I) {
              J.emit("error", I);
            }
          X = K[$];
        }), V.on("error", function(K) {
          return J.emit("error", K);
        }), J;
      }
      /**
       * Make a request to a winstond server or any http server which can
       * handle json-rpc.
       * @param {function} options - Options to sent the request.
       * @param {Object?} auth - authentication options
       * @param {string} path - request path
       * @param {function} callback - Continuation to respond to when complete.
       */
    }, {
      key: "_request",
      value: function(G, J, B, D) {
        G = G || {}, J = J || this.auth, B = B || this.path || "", this.batch ? this._doBatch(G, D, J, B) : this._doRequest(G, D, J, B);
      }
      /**
       * Send or memorize the options according to batch configuration
       * @param {function} options - Options to sent the request.
       * @param {function} callback - Continuation to respond to when complete.
       * @param {Object?} auth - authentication options
       * @param {string} path - request path
       */
    }, {
      key: "_doBatch",
      value: function(G, J, B, D) {
        if (this.batchOptions.push(G), this.batchOptions.length === 1) {
          var X = this;
          this.batchCallback = J, this.batchTimeoutID = setTimeout(function() {
            X.batchTimeoutID = -1, X._doBatchRequest(X.batchCallback, B, D);
          }, this.batchInterval);
        }
        this.batchOptions.length === this.batchCount && this._doBatchRequest(this.batchCallback, B, D);
      }
      /**
       * Initiate a request with the memorized batch options, stop the batch timeout
       * @param {function} callback - Continuation to respond to when complete.
       * @param {Object?} auth - authentication options
       * @param {string} path - request path
       */
    }, {
      key: "_doBatchRequest",
      value: function(G, J, B) {
        this.batchTimeoutID > 0 && (clearTimeout(this.batchTimeoutID), this.batchTimeoutID = -1);
        var D = this.batchOptions.slice();
        this.batchOptions = [], this._doRequest(D, G, J, B);
      }
      /**
       * Make a request to a winstond server or any http server which can
       * handle json-rpc.
       * @param {function} options - Options to sent the request.
       * @param {function} callback - Continuation to respond to when complete.
       * @param {Object?} auth - authentication options
       * @param {string} path - request path
       */
    }, {
      key: "_doRequest",
      value: function(G, J, B, D) {
        var X = Object.assign({}, this.headers);
        B && B.bearer && (X.Authorization = "Bearer ".concat(B.bearer));
        var V = (this.ssl ? g : x).request(n(n({}, this.options), {}, {
          method: "POST",
          host: this.host,
          port: this.port,
          path: "/".concat(D.replace(/^\//, "")),
          headers: X,
          auth: B && B.username && B.password ? "".concat(B.username, ":").concat(B.password) : "",
          agent: this.agent
        }));
        V.on("error", J), V.on("response", function($) {
          return $.on("end", function() {
            return J(null, $);
          }).resume();
        });
        var K = j(n({}, this.maximumDepth && {
          maximumDepth: this.maximumDepth
        }));
        V.end(Buffer.from(K(G, this.options.replacer), "utf8"));
      }
    }]);
  })(E), qb;
}
var Hb, j4;
function Y8() {
  if (j4) return Hb;
  j4 = 1;
  const t = (e) => e !== null && typeof e == "object" && typeof e.pipe == "function";
  return t.writable = (e) => t(e) && e.writable !== !1 && typeof e._write == "function" && typeof e._writableState == "object", t.readable = (e) => t(e) && e.readable !== !1 && typeof e._read == "function" && typeof e._readableState == "object", t.duplex = (e) => t.writable(e) && t.readable(e), t.transform = (e) => t.duplex(e) && typeof e._transform == "function", Hb = t, Hb;
}
var Wb, Q4;
function tV() {
  if (Q4) return Wb;
  Q4 = 1;
  function t(v) {
    "@babel/helpers - typeof";
    return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(S) {
      return typeof S;
    } : function(S) {
      return S && typeof Symbol == "function" && S.constructor === Symbol && S !== Symbol.prototype ? "symbol" : typeof S;
    }, t(v);
  }
  function e(v, S) {
    if (!(v instanceof S)) throw new TypeError("Cannot call a class as a function");
  }
  function n(v, S) {
    for (var E = 0; E < S.length; E++) {
      var T = S[E];
      T.enumerable = T.enumerable || !1, T.configurable = !0, "value" in T && (T.writable = !0), Object.defineProperty(v, i(T.key), T);
    }
  }
  function r(v, S, E) {
    return S && n(v.prototype, S), Object.defineProperty(v, "prototype", { writable: !1 }), v;
  }
  function i(v) {
    var S = o(v, "string");
    return t(S) == "symbol" ? S : S + "";
  }
  function o(v, S) {
    if (t(v) != "object" || !v) return v;
    var E = v[Symbol.toPrimitive];
    if (E !== void 0) {
      var T = E.call(v, S);
      if (t(T) != "object") return T;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(v);
  }
  function s(v, S, E) {
    return S = l(S), a(v, u() ? Reflect.construct(S, E || [], l(v).constructor) : S.apply(v, E));
  }
  function a(v, S) {
    if (S && (t(S) == "object" || typeof S == "function")) return S;
    if (S !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
    return c(v);
  }
  function c(v) {
    if (v === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    return v;
  }
  function u() {
    try {
      var v = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
    } catch {
    }
    return (u = function() {
      return !!v;
    })();
  }
  function l(v) {
    return l = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(S) {
      return S.__proto__ || Object.getPrototypeOf(S);
    }, l(v);
  }
  function d(v, S) {
    if (typeof S != "function" && S !== null) throw new TypeError("Super expression must either be null or a function");
    v.prototype = Object.create(S && S.prototype, { constructor: { value: v, writable: !0, configurable: !0 } }), Object.defineProperty(v, "prototype", { writable: !1 }), S && f(v, S);
  }
  function f(v, S) {
    return f = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(E, T) {
      return E.__proto__ = T, E;
    }, f(v, S);
  }
  var m = Y8(), h = on(), y = h.MESSAGE, x = Pn, g = Fd();
  return Wb = /* @__PURE__ */ (function(v) {
    function S() {
      var E, T = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
      if (e(this, S), E = s(this, S, [T]), !T.stream || !m(T.stream))
        throw new Error("options.stream is required.");
      return E._stream = T.stream, E._stream.setMaxListeners(1 / 0), E.isObjectMode = T.stream._writableState.objectMode, E.eol = typeof T.eol == "string" ? T.eol : x.EOL, E;
    }
    return d(S, v), r(S, [{
      key: "log",
      value: function(T, j) {
        var q = this;
        if (setImmediate(function() {
          return q.emit("logged", T);
        }), this.isObjectMode) {
          this._stream.write(T), j && j();
          return;
        }
        this._stream.write("".concat(T[y]).concat(this.eol)), j && j();
      }
    }]);
  })(g), Wb;
}
var $4;
function nV() {
  return $4 || ($4 = 1, (function(t) {
    Object.defineProperty(t, "Console", {
      configurable: !0,
      enumerable: !0,
      get: function() {
        return PK();
      }
    }), Object.defineProperty(t, "File", {
      configurable: !0,
      enumerable: !0,
      get: function() {
        return ZK();
      }
    }), Object.defineProperty(t, "Http", {
      configurable: !0,
      enumerable: !0,
      get: function() {
        return eV();
      }
    }), Object.defineProperty(t, "Stream", {
      configurable: !0,
      enumerable: !0,
      get: function() {
        return tV();
      }
    });
  })(fb)), fb;
}
var Rc = {}, G4;
function PE() {
  if (G4) return Rc;
  G4 = 1;
  var t = B8(), e = on(), n = e.configs;
  return Rc.cli = t.levels(n.cli), Rc.npm = t.levels(n.npm), Rc.syslog = t.levels(n.syslog), Rc.addColors = t.levels, Rc;
}
var bh = { exports: {} }, xh = { exports: {} }, q4;
function rV() {
  return q4 || (q4 = 1, (function(t, e) {
    Object.defineProperty(e, "__esModule", {
      value: !0
    });
    var n = kE(), r = x(n), i = NE(), o = x(i), s = W8(), a = x(s), c = q8(), u = x(c), l = H8(), d = x(l), f = Vu(), m = x(f), h = Od(), y = x(h);
    function x(E) {
      return E && E.__esModule ? E : { default: E };
    }
    function g(E, T, j) {
      j = (0, u.default)(j);
      var q = 0, Y = 0, { length: W } = E, G = !1;
      W === 0 && j(null);
      function J(B, D) {
        B === !1 && (G = !0), G !== !0 && (B ? j(B) : (++Y === W || D === o.default) && j(null));
      }
      for (; q < W; q++)
        T(E[q], q, (0, d.default)(J));
    }
    function v(E, T, j) {
      return (0, a.default)(E, 1 / 0, T, j);
    }
    function S(E, T, j) {
      var q = (0, r.default)(E) ? g : v;
      return q(E, (0, m.default)(T), j);
    }
    e.default = (0, y.default)(S, 3), t.exports = e.default;
  })(xh, xh.exports)), xh.exports;
}
var wh = { exports: {} }, H4;
function iV() {
  return H4 || (H4 = 1, (function(t, e) {
    Object.defineProperty(e, "__esModule", {
      value: !0
    }), e.default = n;
    function n(r) {
      return (i, o, s) => r(i, s);
    }
    t.exports = e.default;
  })(wh, wh.exports)), wh.exports;
}
var W4;
function DE() {
  return W4 || (W4 = 1, (function(t, e) {
    Object.defineProperty(e, "__esModule", {
      value: !0
    });
    var n = rV(), r = l(n), i = iV(), o = l(i), s = Vu(), a = l(s), c = Od(), u = l(c);
    function l(f) {
      return f && f.__esModule ? f : { default: f };
    }
    function d(f, m, h) {
      return (0, r.default)(f, (0, o.default)((0, a.default)(m)), h);
    }
    e.default = (0, u.default)(d, 3), t.exports = e.default;
  })(bh, bh.exports)), bh.exports;
}
var zb, z4;
function oV() {
  if (z4) return zb;
  z4 = 1;
  var t = Object.prototype.toString;
  return zb = function(n) {
    if (typeof n.displayName == "string" && n.constructor.name)
      return n.displayName;
    if (typeof n.name == "string" && n.name)
      return n.name;
    if (typeof n == "object" && n.constructor && typeof n.constructor.name == "string") return n.constructor.name;
    var r = n.toString(), i = t.call(n).slice(8, -1);
    return i === "Function" ? r = r.substring(r.indexOf("(") + 1, r.indexOf(")")) : r = i, r || "anonymous";
  }, zb;
}
var Kb, K4;
function J8() {
  if (K4) return Kb;
  K4 = 1;
  var t = oV();
  return Kb = function(n) {
    var r = 0, i;
    function o() {
      return r || (r = 1, i = n.apply(this, arguments), n = null), i;
    }
    return o.displayName = t(n), o;
  }, Kb;
}
var Vb = {}, V4;
function X8() {
  return V4 || (V4 = 1, (function(t) {
    t.get = function(i) {
      var o = Error.stackTraceLimit;
      Error.stackTraceLimit = 1 / 0;
      var s = {}, a = Error.prepareStackTrace;
      Error.prepareStackTrace = function(u, l) {
        return l;
      }, Error.captureStackTrace(s, i || t.get);
      var c = s.stack;
      return Error.prepareStackTrace = a, Error.stackTraceLimit = o, c;
    }, t.parse = function(i) {
      if (!i.stack)
        return [];
      var o = this, s = i.stack.split(`
`).slice(1);
      return s.map(function(a) {
        if (a.match(/^\s*[-]{4,}$/))
          return o._createParsedCallSite({
            fileName: a,
            lineNumber: null,
            functionName: null,
            typeName: null,
            methodName: null,
            columnNumber: null,
            native: null
          });
        var c = a.match(/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/);
        if (c) {
          var u = null, l = null, d = null, f = null, m = null, h = c[5] === "native";
          if (c[1]) {
            d = c[1];
            var y = d.lastIndexOf(".");
            if (d[y - 1] == "." && y--, y > 0) {
              u = d.substr(0, y), l = d.substr(y + 1);
              var x = u.indexOf(".Module");
              x > 0 && (d = d.substr(x + 1), u = u.substr(0, x));
            }
            f = null;
          }
          l && (f = u, m = l), l === "<anonymous>" && (m = null, d = null);
          var g = {
            fileName: c[2] || null,
            lineNumber: parseInt(c[3], 10) || null,
            functionName: d,
            typeName: f,
            methodName: m,
            columnNumber: parseInt(c[4], 10) || null,
            native: h
          };
          return o._createParsedCallSite(g);
        }
      }).filter(function(a) {
        return !!a;
      });
    };
    function e(i) {
      for (var o in i)
        this[o] = i[o];
    }
    var n = [
      "this",
      "typeName",
      "functionName",
      "methodName",
      "fileName",
      "lineNumber",
      "columnNumber",
      "function",
      "evalOrigin"
    ], r = [
      "topLevel",
      "eval",
      "native",
      "constructor"
    ];
    n.forEach(function(i) {
      e.prototype[i] = null, e.prototype["get" + i[0].toUpperCase() + i.substr(1)] = function() {
        return this[i];
      };
    }), r.forEach(function(i) {
      e.prototype[i] = !1, e.prototype["is" + i[0].toUpperCase() + i.substr(1)] = function() {
        return this[i];
      };
    }), t._createParsedCallSite = function(i) {
      return new e(i);
    };
  })(Vb)), Vb;
}
var Yb, Y4;
function sV() {
  if (Y4) return Yb;
  Y4 = 1;
  function t(y) {
    "@babel/helpers - typeof";
    return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(x) {
      return typeof x;
    } : function(x) {
      return x && typeof Symbol == "function" && x.constructor === Symbol && x !== Symbol.prototype ? "symbol" : typeof x;
    }, t(y);
  }
  function e(y, x) {
    if (!(y instanceof x)) throw new TypeError("Cannot call a class as a function");
  }
  function n(y, x) {
    for (var g = 0; g < x.length; g++) {
      var v = x[g];
      v.enumerable = v.enumerable || !1, v.configurable = !0, "value" in v && (v.writable = !0), Object.defineProperty(y, i(v.key), v);
    }
  }
  function r(y, x, g) {
    return x && n(y.prototype, x), Object.defineProperty(y, "prototype", { writable: !1 }), y;
  }
  function i(y) {
    var x = o(y, "string");
    return t(x) == "symbol" ? x : x + "";
  }
  function o(y, x) {
    if (t(y) != "object" || !y) return y;
    var g = y[Symbol.toPrimitive];
    if (g !== void 0) {
      var v = g.call(y, x);
      if (t(v) != "object") return v;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(y);
  }
  function s(y, x, g) {
    return x = l(x), a(y, u() ? Reflect.construct(x, g || [], l(y).constructor) : x.apply(y, g));
  }
  function a(y, x) {
    if (x && (t(x) == "object" || typeof x == "function")) return x;
    if (x !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
    return c(y);
  }
  function c(y) {
    if (y === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    return y;
  }
  function u() {
    try {
      var y = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
    } catch {
    }
    return (u = function() {
      return !!y;
    })();
  }
  function l(y) {
    return l = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(x) {
      return x.__proto__ || Object.getPrototypeOf(x);
    }, l(y);
  }
  function d(y, x) {
    if (typeof x != "function" && x !== null) throw new TypeError("Super expression must either be null or a function");
    y.prototype = Object.create(x && x.prototype, { constructor: { value: y, writable: !0, configurable: !0 } }), Object.defineProperty(y, "prototype", { writable: !1 }), x && f(y, x);
  }
  function f(y, x) {
    return f = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(g, v) {
      return g.__proto__ = v, g;
    }, f(y, x);
  }
  var m = yc(), h = m.Writable;
  return Yb = /* @__PURE__ */ (function(y) {
    function x(g) {
      var v;
      if (e(this, x), v = s(this, x, [{
        objectMode: !0
      }]), !g)
        throw new Error("ExceptionStream requires a TransportStream instance.");
      return v.handleExceptions = !0, v.transport = g, v;
    }
    return d(x, y), r(x, [{
      key: "_write",
      value: function(v, S, E) {
        return v.exception ? this.transport.log(v, E) : (E(), !0);
      }
    }]);
  })(h), Yb;
}
var Jb, J4;
function Z8() {
  if (J4) return Jb;
  J4 = 1;
  function t(f) {
    "@babel/helpers - typeof";
    return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(m) {
      return typeof m;
    } : function(m) {
      return m && typeof Symbol == "function" && m.constructor === Symbol && m !== Symbol.prototype ? "symbol" : typeof m;
    }, t(f);
  }
  function e(f, m) {
    if (!(f instanceof m)) throw new TypeError("Cannot call a class as a function");
  }
  function n(f, m) {
    for (var h = 0; h < m.length; h++) {
      var y = m[h];
      y.enumerable = y.enumerable || !1, y.configurable = !0, "value" in y && (y.writable = !0), Object.defineProperty(f, i(y.key), y);
    }
  }
  function r(f, m, h) {
    return m && n(f.prototype, m), Object.defineProperty(f, "prototype", { writable: !1 }), f;
  }
  function i(f) {
    var m = o(f, "string");
    return t(m) == "symbol" ? m : m + "";
  }
  function o(f, m) {
    if (t(f) != "object" || !f) return f;
    var h = f[Symbol.toPrimitive];
    if (h !== void 0) {
      var y = h.call(f, m);
      if (t(y) != "object") return y;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(f);
  }
  var s = Pn, a = DE(), c = Zg()("winston:exception"), u = J8(), l = X8(), d = sV();
  return Jb = /* @__PURE__ */ (function() {
    function f(m) {
      if (e(this, f), !m)
        throw new Error("Logger is required to handle exceptions");
      this.logger = m, this.handlers = /* @__PURE__ */ new Map();
    }
    return r(f, [{
      key: "handle",
      value: function() {
        for (var h = this, y = arguments.length, x = new Array(y), g = 0; g < y; g++)
          x[g] = arguments[g];
        x.forEach(function(v) {
          if (Array.isArray(v))
            return v.forEach(function(S) {
              return h._addHandler(S);
            });
          h._addHandler(v);
        }), this.catcher || (this.catcher = this._uncaughtException.bind(this), process.on("uncaughtException", this.catcher));
      }
      /**
       * Removes any handlers to `uncaughtException` events for the current
       * process. This does not modify the state of the `this.handlers` set.
       * @returns {undefined}
       */
    }, {
      key: "unhandle",
      value: function() {
        var h = this;
        this.catcher && (process.removeListener("uncaughtException", this.catcher), this.catcher = !1, Array.from(this.handlers.values()).forEach(function(y) {
          return h.logger.unpipe(y);
        }));
      }
      /**
       * TODO: add method description
       * @param {Error} err - Error to get information about.
       * @returns {mixed} - TODO: add return description.
       */
    }, {
      key: "getAllInfo",
      value: function(h) {
        var y = null;
        return h && (y = typeof h == "string" ? h : h.message), {
          error: h,
          // TODO (indexzero): how do we configure this?
          level: "error",
          message: ["uncaughtException: ".concat(y || "(no error message)"), h && h.stack || "  No stack trace"].join(`
`),
          stack: h && h.stack,
          exception: !0,
          date: (/* @__PURE__ */ new Date()).toString(),
          process: this.getProcessInfo(),
          os: this.getOsInfo(),
          trace: this.getTrace(h)
        };
      }
      /**
       * Gets all relevant process information for the currently running process.
       * @returns {mixed} - TODO: add return description.
       */
    }, {
      key: "getProcessInfo",
      value: function() {
        return {
          pid: process.pid,
          uid: process.getuid ? process.getuid() : null,
          gid: process.getgid ? process.getgid() : null,
          cwd: process.cwd(),
          execPath: process.execPath,
          version: process.version,
          argv: process.argv,
          memoryUsage: process.memoryUsage()
        };
      }
      /**
       * Gets all relevant OS information for the currently running process.
       * @returns {mixed} - TODO: add return description.
       */
    }, {
      key: "getOsInfo",
      value: function() {
        return {
          loadavg: s.loadavg(),
          uptime: s.uptime()
        };
      }
      /**
       * Gets a stack trace for the specified error.
       * @param {mixed} err - TODO: add param description.
       * @returns {mixed} - TODO: add return description.
       */
    }, {
      key: "getTrace",
      value: function(h) {
        var y = h ? l.parse(h) : l.get();
        return y.map(function(x) {
          return {
            column: x.getColumnNumber(),
            file: x.getFileName(),
            function: x.getFunctionName(),
            line: x.getLineNumber(),
            method: x.getMethodName(),
            native: x.isNative()
          };
        });
      }
      /**
       * Helper method to add a transport as an exception handler.
       * @param {Transport} handler - The transport to add as an exception handler.
       * @returns {void}
       */
    }, {
      key: "_addHandler",
      value: function(h) {
        if (!this.handlers.has(h)) {
          h.handleExceptions = !0;
          var y = new d(h);
          this.handlers.set(h, y), this.logger.pipe(y);
        }
      }
      /**
       * Logs all relevant information around the `err` and exits the current
       * process.
       * @param {Error} err - Error to handle
       * @returns {mixed} - TODO: add return description.
       * @private
       */
    }, {
      key: "_uncaughtException",
      value: function(h) {
        var y = this.getAllInfo(h), x = this._getExceptionHandlers(), g = typeof this.logger.exitOnError == "function" ? this.logger.exitOnError(h) : this.logger.exitOnError, v;
        !x.length && g && (console.warn("winston: exitOnError cannot be true with no exception handlers."), console.warn("winston: not exiting process."), g = !1);
        function S() {
          c("doExit", g), c("process._exiting", process._exiting), g && !process._exiting && (v && clearTimeout(v), process.exit(1));
        }
        if (!x || x.length === 0)
          return process.nextTick(S);
        a(x, function(E, T) {
          var j = u(T), q = E.transport || E;
          function Y(W) {
            return function() {
              c(W), j();
            };
          }
          q._ending = !0, q.once("finish", Y("finished")), q.once("error", Y("error"));
        }, function() {
          return g && S();
        }), this.logger.log(y), g && (v = setTimeout(S, 3e3));
      }
      /**
       * Returns the list of transports and exceptionHandlers for this instance.
       * @returns {Array} - List of transports and exceptionHandlers for this
       * instance.
       * @private
       */
    }, {
      key: "_getExceptionHandlers",
      value: function() {
        return this.logger.transports.filter(function(h) {
          var y = h.transport || h;
          return y.handleExceptions;
        });
      }
    }]);
  })(), Jb;
}
var Xb, X4;
function aV() {
  if (X4) return Xb;
  X4 = 1;
  function t(y) {
    "@babel/helpers - typeof";
    return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(x) {
      return typeof x;
    } : function(x) {
      return x && typeof Symbol == "function" && x.constructor === Symbol && x !== Symbol.prototype ? "symbol" : typeof x;
    }, t(y);
  }
  function e(y, x) {
    if (!(y instanceof x)) throw new TypeError("Cannot call a class as a function");
  }
  function n(y, x) {
    for (var g = 0; g < x.length; g++) {
      var v = x[g];
      v.enumerable = v.enumerable || !1, v.configurable = !0, "value" in v && (v.writable = !0), Object.defineProperty(y, i(v.key), v);
    }
  }
  function r(y, x, g) {
    return x && n(y.prototype, x), Object.defineProperty(y, "prototype", { writable: !1 }), y;
  }
  function i(y) {
    var x = o(y, "string");
    return t(x) == "symbol" ? x : x + "";
  }
  function o(y, x) {
    if (t(y) != "object" || !y) return y;
    var g = y[Symbol.toPrimitive];
    if (g !== void 0) {
      var v = g.call(y, x);
      if (t(v) != "object") return v;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(y);
  }
  function s(y, x, g) {
    return x = l(x), a(y, u() ? Reflect.construct(x, g || [], l(y).constructor) : x.apply(y, g));
  }
  function a(y, x) {
    if (x && (t(x) == "object" || typeof x == "function")) return x;
    if (x !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
    return c(y);
  }
  function c(y) {
    if (y === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    return y;
  }
  function u() {
    try {
      var y = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
    } catch {
    }
    return (u = function() {
      return !!y;
    })();
  }
  function l(y) {
    return l = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(x) {
      return x.__proto__ || Object.getPrototypeOf(x);
    }, l(y);
  }
  function d(y, x) {
    if (typeof x != "function" && x !== null) throw new TypeError("Super expression must either be null or a function");
    y.prototype = Object.create(x && x.prototype, { constructor: { value: y, writable: !0, configurable: !0 } }), Object.defineProperty(y, "prototype", { writable: !1 }), x && f(y, x);
  }
  function f(y, x) {
    return f = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(g, v) {
      return g.__proto__ = v, g;
    }, f(y, x);
  }
  var m = yc(), h = m.Writable;
  return Xb = /* @__PURE__ */ (function(y) {
    function x(g) {
      var v;
      if (e(this, x), v = s(this, x, [{
        objectMode: !0
      }]), !g)
        throw new Error("RejectionStream requires a TransportStream instance.");
      return v.handleRejections = !0, v.transport = g, v;
    }
    return d(x, y), r(x, [{
      key: "_write",
      value: function(v, S, E) {
        return v.rejection ? this.transport.log(v, E) : (E(), !0);
      }
    }]);
  })(h), Xb;
}
var Zb, Z4;
function eM() {
  if (Z4) return Zb;
  Z4 = 1;
  function t(f) {
    "@babel/helpers - typeof";
    return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(m) {
      return typeof m;
    } : function(m) {
      return m && typeof Symbol == "function" && m.constructor === Symbol && m !== Symbol.prototype ? "symbol" : typeof m;
    }, t(f);
  }
  function e(f, m) {
    if (!(f instanceof m)) throw new TypeError("Cannot call a class as a function");
  }
  function n(f, m) {
    for (var h = 0; h < m.length; h++) {
      var y = m[h];
      y.enumerable = y.enumerable || !1, y.configurable = !0, "value" in y && (y.writable = !0), Object.defineProperty(f, i(y.key), y);
    }
  }
  function r(f, m, h) {
    return m && n(f.prototype, m), Object.defineProperty(f, "prototype", { writable: !1 }), f;
  }
  function i(f) {
    var m = o(f, "string");
    return t(m) == "symbol" ? m : m + "";
  }
  function o(f, m) {
    if (t(f) != "object" || !f) return f;
    var h = f[Symbol.toPrimitive];
    if (h !== void 0) {
      var y = h.call(f, m);
      if (t(y) != "object") return y;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(f);
  }
  var s = Pn, a = DE(), c = Zg()("winston:rejection"), u = J8(), l = X8(), d = aV();
  return Zb = /* @__PURE__ */ (function() {
    function f(m) {
      if (e(this, f), !m)
        throw new Error("Logger is required to handle rejections");
      this.logger = m, this.handlers = /* @__PURE__ */ new Map();
    }
    return r(f, [{
      key: "handle",
      value: function() {
        for (var h = this, y = arguments.length, x = new Array(y), g = 0; g < y; g++)
          x[g] = arguments[g];
        x.forEach(function(v) {
          if (Array.isArray(v))
            return v.forEach(function(S) {
              return h._addHandler(S);
            });
          h._addHandler(v);
        }), this.catcher || (this.catcher = this._unhandledRejection.bind(this), process.on("unhandledRejection", this.catcher));
      }
      /**
       * Removes any handlers to `unhandledRejection` events for the current
       * process. This does not modify the state of the `this.handlers` set.
       * @returns {undefined}
       */
    }, {
      key: "unhandle",
      value: function() {
        var h = this;
        this.catcher && (process.removeListener("unhandledRejection", this.catcher), this.catcher = !1, Array.from(this.handlers.values()).forEach(function(y) {
          return h.logger.unpipe(y);
        }));
      }
      /**
       * TODO: add method description
       * @param {Error} err - Error to get information about.
       * @returns {mixed} - TODO: add return description.
       */
    }, {
      key: "getAllInfo",
      value: function(h) {
        var y = null;
        return h && (y = typeof h == "string" ? h : h.message), {
          error: h,
          // TODO (indexzero): how do we configure this?
          level: "error",
          message: ["unhandledRejection: ".concat(y || "(no error message)"), h && h.stack || "  No stack trace"].join(`
`),
          stack: h && h.stack,
          rejection: !0,
          date: (/* @__PURE__ */ new Date()).toString(),
          process: this.getProcessInfo(),
          os: this.getOsInfo(),
          trace: this.getTrace(h)
        };
      }
      /**
       * Gets all relevant process information for the currently running process.
       * @returns {mixed} - TODO: add return description.
       */
    }, {
      key: "getProcessInfo",
      value: function() {
        return {
          pid: process.pid,
          uid: process.getuid ? process.getuid() : null,
          gid: process.getgid ? process.getgid() : null,
          cwd: process.cwd(),
          execPath: process.execPath,
          version: process.version,
          argv: process.argv,
          memoryUsage: process.memoryUsage()
        };
      }
      /**
       * Gets all relevant OS information for the currently running process.
       * @returns {mixed} - TODO: add return description.
       */
    }, {
      key: "getOsInfo",
      value: function() {
        return {
          loadavg: s.loadavg(),
          uptime: s.uptime()
        };
      }
      /**
       * Gets a stack trace for the specified error.
       * @param {mixed} err - TODO: add param description.
       * @returns {mixed} - TODO: add return description.
       */
    }, {
      key: "getTrace",
      value: function(h) {
        var y = h ? l.parse(h) : l.get();
        return y.map(function(x) {
          return {
            column: x.getColumnNumber(),
            file: x.getFileName(),
            function: x.getFunctionName(),
            line: x.getLineNumber(),
            method: x.getMethodName(),
            native: x.isNative()
          };
        });
      }
      /**
       * Helper method to add a transport as an exception handler.
       * @param {Transport} handler - The transport to add as an exception handler.
       * @returns {void}
       */
    }, {
      key: "_addHandler",
      value: function(h) {
        if (!this.handlers.has(h)) {
          h.handleRejections = !0;
          var y = new d(h);
          this.handlers.set(h, y), this.logger.pipe(y);
        }
      }
      /**
       * Logs all relevant information around the `err` and exits the current
       * process.
       * @param {Error} err - Error to handle
       * @returns {mixed} - TODO: add return description.
       * @private
       */
    }, {
      key: "_unhandledRejection",
      value: function(h) {
        var y = this.getAllInfo(h), x = this._getRejectionHandlers(), g = typeof this.logger.exitOnError == "function" ? this.logger.exitOnError(h) : this.logger.exitOnError, v;
        !x.length && g && (console.warn("winston: exitOnError cannot be true with no rejection handlers."), console.warn("winston: not exiting process."), g = !1);
        function S() {
          c("doExit", g), c("process._exiting", process._exiting), g && !process._exiting && (v && clearTimeout(v), process.exit(1));
        }
        if (!x || x.length === 0)
          return process.nextTick(S);
        a(x, function(E, T) {
          var j = u(T), q = E.transport || E;
          function Y(W) {
            return function() {
              c(W), j();
            };
          }
          q._ending = !0, q.once("finish", Y("finished")), q.once("error", Y("error"));
        }, function() {
          return g && S();
        }), this.logger.log(y), g && (v = setTimeout(S, 3e3));
      }
      /**
       * Returns the list of transports and exceptionHandlers for this instance.
       * @returns {Array} - List of transports and exceptionHandlers for this
       * instance.
       * @private
       */
    }, {
      key: "_getRejectionHandlers",
      value: function() {
        return this.logger.transports.filter(function(h) {
          var y = h.transport || h;
          return y.handleRejections;
        });
      }
    }]);
  })(), Zb;
}
var ex = { exports: {} }, tx = { exports: {} }, eN;
function cV() {
  if (eN) return tx.exports;
  eN = 1;
  const t = _n, e = Xg(), { LEVEL: n } = on(), r = tx.exports = function(o = {}) {
    e.call(this, { objectMode: !0, highWaterMark: o.highWaterMark }), this.format = o.format, this.level = o.level, this.handleExceptions = o.handleExceptions, this.handleRejections = o.handleRejections, this.silent = o.silent, o.log && (this.log = o.log), o.logv && (this.logv = o.logv), o.close && (this.close = o.close), this.once("pipe", (s) => {
      this.levels = s.levels, this.parent = s;
    }), this.once("unpipe", (s) => {
      s === this.parent && (this.parent = null, this.close && this.close());
    });
  };
  return t.inherits(r, e), r.prototype._write = function(o, s, a) {
    if (this.silent || o.exception === !0 && !this.handleExceptions)
      return a(null);
    const c = this.level || this.parent && this.parent.level;
    if (!c || this.levels[c] >= this.levels[o[n]]) {
      if (o && !this.format)
        return this.log(o, a);
      let u, l;
      try {
        l = this.format.transform(Object.assign({}, o), this.format.options);
      } catch (d) {
        u = d;
      }
      if (u || !l) {
        if (a(), u) throw u;
        return;
      }
      return this.log(l, a);
    }
    return this._writableState.sync = !1, a(null);
  }, r.prototype._writev = function(o, s) {
    if (this.logv) {
      const a = o.filter(this._accept, this);
      return a.length ? this.logv(a, s) : s(null);
    }
    for (let a = 0; a < o.length; a++) {
      if (!this._accept(o[a])) continue;
      if (o[a].chunk && !this.format) {
        this.log(o[a].chunk, o[a].callback);
        continue;
      }
      let c, u;
      try {
        u = this.format.transform(
          Object.assign({}, o[a].chunk),
          this.format.options
        );
      } catch (l) {
        c = l;
      }
      if (c || !u) {
        if (o[a].callback(), c)
          throw s(null), c;
      } else
        this.log(u, o[a].callback);
    }
    return s(null);
  }, r.prototype._accept = function(o) {
    const s = o.chunk;
    if (this.silent)
      return !1;
    const a = this.level || this.parent && this.parent.level;
    return !!((s.exception === !0 || !a || this.levels[a] >= this.levels[s[n]]) && (this.handleExceptions || s.exception !== !0));
  }, r.prototype._nop = function() {
  }, tx.exports;
}
var tN;
function uV() {
  if (tN) return ex.exports;
  tN = 1;
  const t = _n, { LEVEL: e } = on(), n = cV(), r = ex.exports = function(o = {}) {
    if (n.call(this, o), !o.transport || typeof o.transport.log != "function")
      throw new Error("Invalid transport, must be an object with a log method.");
    this.transport = o.transport, this.level = this.level || o.transport.level, this.handleExceptions = this.handleExceptions || o.transport.handleExceptions, this._deprecated();
    function s(a) {
      this.emit("error", a, this.transport);
    }
    this.transport.__winstonError || (this.transport.__winstonError = s.bind(this), this.transport.on("error", this.transport.__winstonError));
  };
  return t.inherits(r, n), r.prototype._write = function(o, s, a) {
    if (this.silent || o.exception === !0 && !this.handleExceptions)
      return a(null);
    (!this.level || this.levels[this.level] >= this.levels[o[e]]) && this.transport.log(o[e], o.message, o, this._nop), a(null);
  }, r.prototype._writev = function(o, s) {
    for (let a = 0; a < o.length; a++)
      this._accept(o[a]) && (this.transport.log(
        o[a].chunk[e],
        o[a].chunk.message,
        o[a].chunk,
        this._nop
      ), o[a].callback());
    return s(null);
  }, r.prototype._deprecated = function() {
    console.error([
      `${this.transport.name} is a legacy winston transport. Consider upgrading: `,
      "- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md"
    ].join(`
`));
  }, r.prototype.close = function() {
    this.transport.close && this.transport.close(), this.transport.__winstonError && (this.transport.removeListener("error", this.transport.__winstonError), this.transport.__winstonError = null);
  }, ex.exports;
}
var nx, nN;
function lV() {
  if (nN) return nx;
  nN = 1;
  function t(a) {
    "@babel/helpers - typeof";
    return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(c) {
      return typeof c;
    } : function(c) {
      return c && typeof Symbol == "function" && c.constructor === Symbol && c !== Symbol.prototype ? "symbol" : typeof c;
    }, t(a);
  }
  function e(a, c) {
    if (!(a instanceof c)) throw new TypeError("Cannot call a class as a function");
  }
  function n(a, c) {
    for (var u = 0; u < c.length; u++) {
      var l = c[u];
      l.enumerable = l.enumerable || !1, l.configurable = !0, "value" in l && (l.writable = !0), Object.defineProperty(a, i(l.key), l);
    }
  }
  function r(a, c, u) {
    return c && n(a.prototype, c), Object.defineProperty(a, "prototype", { writable: !1 }), a;
  }
  function i(a) {
    var c = o(a, "string");
    return t(c) == "symbol" ? c : c + "";
  }
  function o(a, c) {
    if (t(a) != "object" || !a) return a;
    var u = a[Symbol.toPrimitive];
    if (u !== void 0) {
      var l = u.call(a, c);
      if (t(l) != "object") return l;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(a);
  }
  var s = /* @__PURE__ */ (function() {
    function a(c) {
      e(this, a);
      var u = FE();
      if (t(c) !== "object" || Array.isArray(c) || !(c instanceof u))
        throw new Error("Logger is required for profiling");
      this.logger = c, this.start = Date.now();
    }
    return r(a, [{
      key: "done",
      value: function() {
        for (var u = arguments.length, l = new Array(u), d = 0; d < u; d++)
          l[d] = arguments[d];
        typeof l[l.length - 1] == "function" && (console.warn("Callback function no longer supported as of winston@3.0.0"), l.pop());
        var f = t(l[l.length - 1]) === "object" ? l.pop() : {};
        return f.level = f.level || "info", f.durationMs = Date.now() - this.start, this.logger.write(f);
      }
    }]);
  })();
  return nx = s, nx;
}
var rx, rN;
function pV() {
  if (rN) return rx;
  rN = 1;
  class t extends Error {
    constructor(n) {
      super(`Format functions must be synchronous taking a two arguments: (info, opts)
Found: ${n.toString().split(`
`)[0]}
`), Error.captureStackTrace(this, t);
    }
  }
  return rx = (e) => {
    if (e.length > 2)
      throw new t(e);
    function n(i = {}) {
      this.options = i;
    }
    n.prototype.transform = e;
    function r(i) {
      return new n(i);
    }
    return r.Format = n, r;
  }, rx;
}
var ix, iN;
function dV() {
  if (iN) return ix;
  iN = 1;
  const t = pV(), { MESSAGE: e } = on(), n = Dd();
  function r(i, o) {
    return typeof o == "bigint" ? o.toString() : o;
  }
  return ix = t((i, o) => {
    const s = n.configure(o);
    return i[e] = s(i, o.replacer || r, o.space), i;
  }), ix;
}
var ox, oN;
function FE() {
  if (oN) return ox;
  oN = 1;
  function t(K, $, _) {
    return ($ = o($)) in K ? Object.defineProperty(K, $, { value: _, enumerable: !0, configurable: !0, writable: !0 }) : K[$] = _, K;
  }
  function e(K) {
    "@babel/helpers - typeof";
    return e = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function($) {
      return typeof $;
    } : function($) {
      return $ && typeof Symbol == "function" && $.constructor === Symbol && $ !== Symbol.prototype ? "symbol" : typeof $;
    }, e(K);
  }
  function n(K, $) {
    if (!(K instanceof $)) throw new TypeError("Cannot call a class as a function");
  }
  function r(K, $) {
    for (var _ = 0; _ < $.length; _++) {
      var I = $[_];
      I.enumerable = I.enumerable || !1, I.configurable = !0, "value" in I && (I.writable = !0), Object.defineProperty(K, o(I.key), I);
    }
  }
  function i(K, $, _) {
    return $ && r(K.prototype, $), Object.defineProperty(K, "prototype", { writable: !1 }), K;
  }
  function o(K) {
    var $ = s(K, "string");
    return e($) == "symbol" ? $ : $ + "";
  }
  function s(K, $) {
    if (e(K) != "object" || !K) return K;
    var _ = K[Symbol.toPrimitive];
    if (_ !== void 0) {
      var I = _.call(K, $);
      if (e(I) != "object") return I;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(K);
  }
  function a(K, $, _) {
    return $ = d($), c(K, l() ? Reflect.construct($, _ || [], d(K).constructor) : $.apply(K, _));
  }
  function c(K, $) {
    if ($ && (e($) == "object" || typeof $ == "function")) return $;
    if ($ !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
    return u(K);
  }
  function u(K) {
    if (K === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    return K;
  }
  function l() {
    try {
      var K = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
    } catch {
    }
    return (l = function() {
      return !!K;
    })();
  }
  function d(K) {
    return d = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function($) {
      return $.__proto__ || Object.getPrototypeOf($);
    }, d(K);
  }
  function f(K, $) {
    if (typeof $ != "function" && $ !== null) throw new TypeError("Super expression must either be null or a function");
    K.prototype = Object.create($ && $.prototype, { constructor: { value: K, writable: !0, configurable: !0 } }), Object.defineProperty(K, "prototype", { writable: !1 }), $ && m(K, $);
  }
  function m(K, $) {
    return m = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(_, I) {
      return _.__proto__ = I, _;
    }, m(K, $);
  }
  var h = yc(), y = h.Stream, x = h.Transform, g = DE(), v = on(), S = v.LEVEL, E = v.SPLAT, T = Y8(), j = Z8(), q = eM(), Y = uV(), W = lV(), G = U8(), J = G.warn, B = PE(), D = /%[scdjifoO%]/g, X = /* @__PURE__ */ (function(K) {
    function $(_) {
      var I;
      return n(this, $), I = a(this, $, [{
        objectMode: !0
      }]), I.configure(_), I;
    }
    return f($, K), i($, [{
      key: "child",
      value: function(I) {
        var N = this;
        return Object.create(N, {
          write: {
            value: function(C) {
              var L = Object.assign({}, I, C);
              C instanceof Error && (L.stack = C.stack, L.message = C.message), N.write(L);
            }
          }
        });
      }
      /**
       * This will wholesale reconfigure this instance by:
       * 1. Resetting all transports. Older transports will be removed implicitly.
       * 2. Set all other options including levels, colors, rewriters, filters,
       *    exceptionHandlers, etc.
       * @param {!Object} options - TODO: add param description.
       * @returns {undefined}
       */
    }, {
      key: "configure",
      value: function() {
        var I = this, N = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, U = N.silent, C = N.format, L = N.defaultMeta, k = N.levels, M = N.level, F = M === void 0 ? "info" : M, A = N.exitOnError, O = A === void 0 ? !0 : A, Z = N.transports, ee = N.colors, P = N.emitErrs, Q = N.formatters, z = N.padLevels, se = N.rewriters, ae = N.stripColors, ie = N.exceptionHandlers, we = N.rejectionHandlers;
        if (this.transports.length && this.clear(), this.silent = U, this.format = C || this.format || dV()(), this.defaultMeta = L || null, this.levels = k || this.levels || B.npm.levels, this.level = F, this.exceptions && this.exceptions.unhandle(), this.rejections && this.rejections.unhandle(), this.exceptions = new j(this), this.rejections = new q(this), this.profilers = {}, this.exitOnError = O, Z && (Z = Array.isArray(Z) ? Z : [Z], Z.forEach(function(Oe) {
          return I.add(Oe);
        })), ee || P || Q || z || se || ae)
          throw new Error(["{ colors, emitErrs, formatters, padLevels, rewriters, stripColors } were removed in winston@3.0.0.", "Use a custom winston.format(function) instead.", "See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join(`
`));
        ie && this.exceptions.handle(ie), we && this.rejections.handle(we);
      }
      /* eslint-disable valid-jsdoc */
      /**
       * Helper method to get the highest logging level associated with a logger
       *
       * @returns { number | null } - The highest configured logging level, null
       * for invalid configuration
       */
    }, {
      key: "getHighestLogLevel",
      value: function() {
        var I = this, N = V(this.levels, this.level);
        return !this.transports || this.transports.length === 0 ? N : this.transports.reduce(function(U, C) {
          var L = V(I.levels, C.level);
          return L !== null && L > U ? L : U;
        }, N);
      }
    }, {
      key: "isLevelEnabled",
      value: function(I) {
        var N = this, U = V(this.levels, I);
        if (U === null)
          return !1;
        var C = V(this.levels, this.level);
        if (C === null)
          return !1;
        if (!this.transports || this.transports.length === 0)
          return C >= U;
        var L = this.transports.findIndex(function(k) {
          var M = V(N.levels, k.level);
          return M === null && (M = C), M >= U;
        });
        return L !== -1;
      }
      /* eslint-disable valid-jsdoc */
      /**
       * Ensure backwards compatibility with a `log` method
       * @param {mixed} level - Level the log message is written at.
       * @param {mixed} msg - TODO: add param description.
       * @param {mixed} meta - TODO: add param description.
       * @returns {Logger} - TODO: add return description.
       *
       * @example
       *    // Supports the existing API:
       *    logger.log('info', 'Hello world', { custom: true });
       *    logger.log('info', new Error('Yo, it\'s on fire'));
       *
       *    // Requires winston.format.splat()
       *    logger.log('info', '%s %d%%', 'A string', 50, { thisIsMeta: true });
       *
       *    // And the new API with a single JSON literal:
       *    logger.log({ level: 'info', message: 'Hello world', custom: true });
       *    logger.log({ level: 'info', message: new Error('Yo, it\'s on fire') });
       *
       *    // Also requires winston.format.splat()
       *    logger.log({
       *      level: 'info',
       *      message: '%s %d%%',
       *      [SPLAT]: ['A string', 50],
       *      meta: { thisIsMeta: true }
       *    });
       *
       */
      /* eslint-enable valid-jsdoc */
    }, {
      key: "log",
      value: function(I, N) {
        for (var U = arguments.length, C = new Array(U > 2 ? U - 2 : 0), L = 2; L < U; L++)
          C[L - 2] = arguments[L];
        if (arguments.length === 1)
          return I[S] = I.level, this._addDefaultMeta(I), this.write(I), this;
        if (arguments.length === 2)
          return N && e(N) === "object" ? (N[S] = N.level = I, this._addDefaultMeta(N), this.write(N), this) : (N = t(t(t({}, S, I), "level", I), "message", N), this._addDefaultMeta(N), this.write(N), this);
        var k = C[0];
        if (e(k) === "object" && k !== null) {
          var M = N && N.match && N.match(D);
          if (!M) {
            var F = Object.assign({}, this.defaultMeta, k, t(t(t(t({}, S, I), E, C), "level", I), "message", N));
            return k.message && (F.message = "".concat(F.message, " ").concat(k.message)), k.stack && (F.stack = k.stack), k.cause && (F.cause = k.cause), this.write(F), this;
          }
        }
        return this.write(Object.assign({}, this.defaultMeta, t(t(t(t({}, S, I), E, C), "level", I), "message", N))), this;
      }
      /**
       * Pushes data so that it can be picked up by all of our pipe targets.
       * @param {mixed} info - TODO: add param description.
       * @param {mixed} enc - TODO: add param description.
       * @param {mixed} callback - Continues stream processing.
       * @returns {undefined}
       * @private
       */
    }, {
      key: "_transform",
      value: function(I, N, U) {
        if (this.silent)
          return U();
        I[S] || (I[S] = I.level), !this.levels[I[S]] && this.levels[I[S]] !== 0 && console.error("[winston] Unknown logger level: %s", I[S]), this._readableState.pipes || console.error("[winston] Attempt to write logs with no transports, which can increase memory usage: %j", I);
        try {
          this.push(this.format.transform(I, this.format.options));
        } finally {
          this._writableState.sync = !1, U();
        }
      }
      /**
       * Delays the 'finish' event until all transport pipe targets have
       * also emitted 'finish' or are already finished.
       * @param {mixed} callback - Continues stream processing.
       */
    }, {
      key: "_final",
      value: function(I) {
        var N = this.transports.slice();
        g(N, function(U, C) {
          if (!U || U.finished) return setImmediate(C);
          U.once("finish", C), U.end();
        }, I);
      }
      /**
       * Adds the transport to this logger instance by piping to it.
       * @param {mixed} transport - TODO: add param description.
       * @returns {Logger} - TODO: add return description.
       */
    }, {
      key: "add",
      value: function(I) {
        var N = !T(I) || I.log.length > 2 ? new Y({
          transport: I
        }) : I;
        if (!N._writableState || !N._writableState.objectMode)
          throw new Error("Transports must WritableStreams in objectMode. Set { objectMode: true }.");
        return this._onEvent("error", N), this._onEvent("warn", N), this.pipe(N), I.handleExceptions && this.exceptions.handle(), I.handleRejections && this.rejections.handle(), this;
      }
      /**
       * Removes the transport from this logger instance by unpiping from it.
       * @param {mixed} transport - TODO: add param description.
       * @returns {Logger} - TODO: add return description.
       */
    }, {
      key: "remove",
      value: function(I) {
        if (!I) return this;
        var N = I;
        return (!T(I) || I.log.length > 2) && (N = this.transports.filter(function(U) {
          return U.transport === I;
        })[0]), N && this.unpipe(N), this;
      }
      /**
       * Removes all transports from this logger instance.
       * @returns {Logger} - TODO: add return description.
       */
    }, {
      key: "clear",
      value: function() {
        return this.unpipe(), this;
      }
      /**
       * Cleans up resources (streams, event listeners) for all transports
       * associated with this instance (if necessary).
       * @returns {Logger} - TODO: add return description.
       */
    }, {
      key: "close",
      value: function() {
        return this.exceptions.unhandle(), this.rejections.unhandle(), this.clear(), this.emit("close"), this;
      }
      /**
       * Sets the `target` levels specified on this instance.
       * @param {Object} Target levels to use on this instance.
       */
    }, {
      key: "setLevels",
      value: function() {
        J.deprecated("setLevels");
      }
      /**
       * Queries the all transports for this instance with the specified `options`.
       * This will aggregate each transport's results into one object containing
       * a property per transport.
       * @param {Object} options - Query options for this instance.
       * @param {function} callback - Continuation to respond to when complete.
       */
    }, {
      key: "query",
      value: function(I, N) {
        typeof I == "function" && (N = I, I = {}), I = I || {};
        var U = {}, C = Object.assign({}, I.query || {});
        function L(M, F) {
          I.query && typeof M.formatQuery == "function" && (I.query = M.formatQuery(C)), M.query(I, function(A, O) {
            if (A)
              return F(A);
            typeof M.formatResults == "function" && (O = M.formatResults(O, I.format)), F(null, O);
          });
        }
        function k(M, F) {
          L(M, function(A, O) {
            F && (O = A || O, O && (U[M.name] = O), F()), F = null;
          });
        }
        g(this.transports.filter(function(M) {
          return !!M.query;
        }), k, function() {
          return N(null, U);
        });
      }
      /**
       * Returns a log stream for all transports. Options object is optional.
       * @param{Object} options={} - Stream options for this instance.
       * @returns {Stream} - TODO: add return description.
       */
    }, {
      key: "stream",
      value: function() {
        var I = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, N = new y(), U = [];
        return N._streams = U, N.destroy = function() {
          for (var C = U.length; C--; )
            U[C].destroy();
        }, this.transports.filter(function(C) {
          return !!C.stream;
        }).forEach(function(C) {
          var L = C.stream(I);
          L && (U.push(L), L.on("log", function(k) {
            k.transport = k.transport || [], k.transport.push(C.name), N.emit("log", k);
          }), L.on("error", function(k) {
            k.transport = k.transport || [], k.transport.push(C.name), N.emit("error", k);
          }));
        }), N;
      }
      /**
       * Returns an object corresponding to a specific timing. When done is called
       * the timer will finish and log the duration. e.g.:
       * @returns {Profile} - TODO: add return description.
       * @example
       *    const timer = winston.startTimer()
       *    setTimeout(() => {
       *      timer.done({
       *        message: 'Logging message'
       *      });
       *    }, 1000);
       */
    }, {
      key: "startTimer",
      value: function() {
        return new W(this);
      }
      /**
       * Tracks the time inbetween subsequent calls to this method with the same
       * `id` parameter. The second call to this method will log the difference in
       * milliseconds along with the message.
       * @param {string} id Unique id of the profiler
       * @returns {Logger} - TODO: add return description.
       */
    }, {
      key: "profile",
      value: function(I) {
        var N = Date.now();
        if (this.profilers[I]) {
          var U = this.profilers[I];
          delete this.profilers[I];
          for (var C = arguments.length, L = new Array(C > 1 ? C - 1 : 0), k = 1; k < C; k++)
            L[k - 1] = arguments[k];
          typeof L[L.length - 2] == "function" && (console.warn("Callback function no longer supported as of winston@3.0.0"), L.pop());
          var M = e(L[L.length - 1]) === "object" ? L.pop() : {};
          return M.level = M.level || "info", M.durationMs = N - U, M.message = M.message || I, this.write(M);
        }
        return this.profilers[I] = N, this;
      }
      /**
       * Backwards compatibility to `exceptions.handle` in winston < 3.0.0.
       * @returns {undefined}
       * @deprecated
       */
    }, {
      key: "handleExceptions",
      value: function() {
        var I;
        console.warn("Deprecated: .handleExceptions() will be removed in winston@4. Use .exceptions.handle()"), (I = this.exceptions).handle.apply(I, arguments);
      }
      /**
       * Backwards compatibility to `exceptions.handle` in winston < 3.0.0.
       * @returns {undefined}
       * @deprecated
       */
    }, {
      key: "unhandleExceptions",
      value: function() {
        var I;
        console.warn("Deprecated: .unhandleExceptions() will be removed in winston@4. Use .exceptions.unhandle()"), (I = this.exceptions).unhandle.apply(I, arguments);
      }
      /**
       * Throw a more meaningful deprecation notice
       * @throws {Error} - TODO: add throws description.
       */
    }, {
      key: "cli",
      value: function() {
        throw new Error(["Logger.cli() was removed in winston@3.0.0", "Use a custom winston.formats.cli() instead.", "See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join(`
`));
      }
      /**
       * Bubbles the `event` that occured on the specified `transport` up
       * from this instance.
       * @param {string} event - The event that occured
       * @param {Object} transport - Transport on which the event occured
       * @private
       */
    }, {
      key: "_onEvent",
      value: function(I, N) {
        function U(C) {
          I === "error" && !this.transports.includes(N) && this.add(N), this.emit(I, C, N);
        }
        N["__winston" + I] || (N["__winston" + I] = U.bind(this), N.on(I, N["__winston" + I]));
      }
    }, {
      key: "_addDefaultMeta",
      value: function(I) {
        this.defaultMeta && Object.assign(I, this.defaultMeta);
      }
    }]);
  })(x);
  function V(K, $) {
    var _ = K[$];
    return !_ && _ !== 0 ? null : _;
  }
  return Object.defineProperty(X.prototype, "transports", {
    configurable: !1,
    enumerable: !0,
    get: function() {
      var $ = this._readableState.pipes;
      return Array.isArray($) ? $ : [$].filter(Boolean);
    }
  }), ox = X, ox;
}
var sx, sN;
function tM() {
  if (sN) return sx;
  sN = 1;
  function t(x) {
    "@babel/helpers - typeof";
    return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(g) {
      return typeof g;
    } : function(g) {
      return g && typeof Symbol == "function" && g.constructor === Symbol && g !== Symbol.prototype ? "symbol" : typeof g;
    }, t(x);
  }
  function e(x, g, v) {
    return Object.defineProperty(x, "prototype", { writable: !1 }), x;
  }
  function n(x, g) {
    if (!(x instanceof g)) throw new TypeError("Cannot call a class as a function");
  }
  function r(x, g, v) {
    return g = a(g), i(x, s() ? Reflect.construct(g, v || [], a(x).constructor) : g.apply(x, v));
  }
  function i(x, g) {
    if (g && (t(g) == "object" || typeof g == "function")) return g;
    if (g !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
    return o(x);
  }
  function o(x) {
    if (x === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    return x;
  }
  function s() {
    try {
      var x = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
    } catch {
    }
    return (s = function() {
      return !!x;
    })();
  }
  function a(x) {
    return a = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(g) {
      return g.__proto__ || Object.getPrototypeOf(g);
    }, a(x);
  }
  function c(x, g) {
    if (typeof g != "function" && g !== null) throw new TypeError("Super expression must either be null or a function");
    x.prototype = Object.create(g && g.prototype, { constructor: { value: x, writable: !0, configurable: !0 } }), Object.defineProperty(x, "prototype", { writable: !1 }), g && u(x, g);
  }
  function u(x, g) {
    return u = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(v, S) {
      return v.__proto__ = S, v;
    }, u(x, g);
  }
  var l = on(), d = l.LEVEL, f = PE(), m = FE(), h = Zg()("winston:create-logger");
  function y(x) {
    return "is" + x.charAt(0).toUpperCase() + x.slice(1) + "Enabled";
  }
  return sx = function() {
    var x = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    x.levels = x.levels || f.npm.levels;
    var g = /* @__PURE__ */ (function(S) {
      function E(T) {
        return n(this, E), r(this, E, [T]);
      }
      return c(E, S), e(E);
    })(m), v = new g(x);
    return Object.keys(x.levels).forEach(function(S) {
      if (h('Define prototype method for "%s"', S), S === "log") {
        console.warn('Level "log" not defined: conflicts with the method "log". Use a different level name.');
        return;
      }
      g.prototype[S] = function() {
        for (var E = this || v, T = arguments.length, j = new Array(T), q = 0; q < T; q++)
          j[q] = arguments[q];
        if (j.length === 1) {
          var Y = j[0], W = Y && Y.message && Y || {
            message: Y
          };
          return W.level = W[d] = S, E._addDefaultMeta(W), E.write(W), this || v;
        }
        return j.length === 0 ? (E.log(S, ""), E) : E.log.apply(E, [S].concat(j));
      }, g.prototype[y(S)] = function() {
        return (this || v).isLevelEnabled(S);
      };
    }), v;
  }, sx;
}
var ax, aN;
function fV() {
  if (aN) return ax;
  aN = 1;
  function t(a) {
    "@babel/helpers - typeof";
    return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(c) {
      return typeof c;
    } : function(c) {
      return c && typeof Symbol == "function" && c.constructor === Symbol && c !== Symbol.prototype ? "symbol" : typeof c;
    }, t(a);
  }
  function e(a, c) {
    if (!(a instanceof c)) throw new TypeError("Cannot call a class as a function");
  }
  function n(a, c) {
    for (var u = 0; u < c.length; u++) {
      var l = c[u];
      l.enumerable = l.enumerable || !1, l.configurable = !0, "value" in l && (l.writable = !0), Object.defineProperty(a, i(l.key), l);
    }
  }
  function r(a, c, u) {
    return c && n(a.prototype, c), Object.defineProperty(a, "prototype", { writable: !1 }), a;
  }
  function i(a) {
    var c = o(a, "string");
    return t(c) == "symbol" ? c : c + "";
  }
  function o(a, c) {
    if (t(a) != "object" || !a) return a;
    var u = a[Symbol.toPrimitive];
    if (u !== void 0) {
      var l = u.call(a, c);
      if (t(l) != "object") return l;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(a);
  }
  var s = tM();
  return ax = /* @__PURE__ */ (function() {
    function a() {
      var c = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
      e(this, a), this.loggers = /* @__PURE__ */ new Map(), this.options = c;
    }
    return r(a, [{
      key: "add",
      value: function(u, l) {
        var d = this;
        if (!this.loggers.has(u)) {
          l = Object.assign({}, l || this.options);
          var f = l.transports || this.options.transports;
          f ? l.transports = Array.isArray(f) ? f.slice() : [f] : l.transports = [];
          var m = s(l);
          m.on("close", function() {
            return d._delete(u);
          }), this.loggers.set(u, m);
        }
        return this.loggers.get(u);
      }
      /**
       * Retreives a `winston.Logger` instance for the specified `id`. If
       * an instance does not exist, one is created.
       * @param {!string} id - The id of the Logger to get.
       * @param {?Object} [options] - Options for the Logger instance.
       * @returns {Logger} - A configured Logger instance with a specified id.
       */
    }, {
      key: "get",
      value: function(u, l) {
        return this.add(u, l);
      }
      /**
       * Check if the container has a logger with the id.
       * @param {?string} id - The id of the Logger instance to find.
       * @returns {boolean} - Boolean value indicating if this instance has a
       * logger with the specified `id`.
       */
    }, {
      key: "has",
      value: function(u) {
        return !!this.loggers.has(u);
      }
      /**
       * Closes a `Logger` instance with the specified `id` if it exists.
       * If no `id` is supplied then all Loggers are closed.
       * @param {?string} id - The id of the Logger instance to close.
       * @returns {undefined}
       */
    }, {
      key: "close",
      value: function(u) {
        var l = this;
        if (u)
          return this._removeLogger(u);
        this.loggers.forEach(function(d, f) {
          return l._removeLogger(f);
        });
      }
      /**
       * Remove a logger based on the id.
       * @param {!string} id - The id of the logger to remove.
       * @returns {undefined}
       * @private
       */
    }, {
      key: "_removeLogger",
      value: function(u) {
        if (this.loggers.has(u)) {
          var l = this.loggers.get(u);
          l.close(), this._delete(u);
        }
      }
      /**
       * Deletes a `Logger` instance with the specified `id`.
       * @param {!string} id - The id of the Logger instance to delete from
       * container.
       * @returns {undefined}
       * @private
       */
    }, {
      key: "_delete",
      value: function(u) {
        this.loggers.delete(u);
      }
    }]);
  })(), ax;
}
var cN;
function hV() {
  return cN || (cN = 1, (function(t) {
    var e = B8(), n = U8(), r = n.warn;
    t.version = IK.version, t.transports = nV(), t.config = PE(), t.addColors = e.levels, t.format = e.format, t.createLogger = tM(), t.Logger = FE(), t.ExceptionHandler = Z8(), t.RejectionHandler = eM(), t.Container = fV(), t.Transport = Fd(), t.loggers = new t.Container();
    var i = t.createLogger();
    Object.keys(t.config.npm.levels).concat(["log", "query", "stream", "add", "remove", "clear", "profile", "startTimer", "handleExceptions", "unhandleExceptions", "handleRejections", "unhandleRejections", "configure", "child"]).forEach(function(o) {
      return t[o] = function() {
        return i[o].apply(i, arguments);
      };
    }), Object.defineProperty(t, "level", {
      get: function() {
        return i.level;
      },
      set: function(s) {
        i.level = s;
      }
    }), Object.defineProperty(t, "exceptions", {
      get: function() {
        return i.exceptions;
      }
    }), Object.defineProperty(t, "rejections", {
      get: function() {
        return i.rejections;
      }
    }), ["exitOnError"].forEach(function(o) {
      Object.defineProperty(t, o, {
        get: function() {
          return i[o];
        },
        set: function(a) {
          i[o] = a;
        }
      });
    }), Object.defineProperty(t, "default", {
      get: function() {
        return {
          exceptionHandlers: i.exceptionHandlers,
          rejectionHandlers: i.rejectionHandlers,
          transports: i.transports
        };
      }
    }), r.deprecated(t, "setLevels"), r.forFunctions(t, "useFormat", ["cli"]), r.forProperties(t, "useFormat", ["padLevels", "stripColors"]), r.forFunctions(t, "deprecated", ["addRewriter", "addFilter", "clone", "extend"]), r.forProperties(t, "deprecated", ["emitErrs", "levelLength"]);
  })(Uv)), Uv;
}
var Jr = hV();
const mV = /* @__PURE__ */ Bo(Jr);
var Qc = /* @__PURE__ */ ((t) => (t.DEBUG = "debug", t.INFO = "info", t.WARN = "warn", t.ERROR = "error", t.FATAL = "fatal", t))(Qc || {});
function gV() {
  const t = /* @__PURE__ */ new Date(), e = t.getFullYear(), n = (t.getMonth() + 1).toString().padStart(2, "0"), r = t.getDate().toString().padStart(2, "0"), i = t.getHours().toString().padStart(2, "0"), o = t.getMinutes().toString().padStart(2, "0"), s = t.getSeconds().toString().padStart(2, "0"), a = t.getMilliseconds().toString().padStart(3, "0");
  return `${e}-${n}-${r}_${i}-${o}-${s}.${a}`;
}
const cx = new wO();
class Ra {
  static MAX_HISTORY = 100;
  static history = [];
  subscribe(e) {
    for (const n of Ra.history)
      try {
        e(n);
      } catch {
      }
    cx.on("log", e);
  }
  unsubscribe(e) {
    cx.off("log", e);
  }
  notify(e) {
    cx.emit("log", e), Ra.history.length >= Ra.MAX_HISTORY && Ra.history.shift(), Ra.history.push(e);
  }
}
const nM = new Ra();
class rM {
  fileLogEnabled = !1;
  consoleLogEnabled = !0;
  logger;
  logPath;
  fileTransportAdded = !1;
  fileLogLevel = "debug";
  constructor(e) {
    const n = `${gV()}.log`;
    this.logPath = xe.join(e, n), this.logger = mV.createLogger({
      level: "debug",
      format: Jr.format.combine(
        Jr.format.timestamp({ format: "MM-DD HH:mm:ss" }),
        Jr.format.printf(({ timestamp: r, level: i, message: o, ...s }) => {
          const a = s.userInfo ? `${s.userInfo} | ` : "";
          return `${r} [${i}] ${a}${o}`;
        })
      ),
      transports: [
        new Jr.transports.Console({
          format: Jr.format.combine(
            Jr.format.colorize(),
            Jr.format.printf(({ timestamp: r, level: i, message: o, ...s }) => {
              const a = s.userInfo ? `${s.userInfo} | ` : "";
              return `${r} [${i}] ${a}${o}`;
            })
          )
        })
      ]
    }), this.setLogSelfInfo({ nick: "", uid: "" }), this.cleanOldLogs(e);
  }
  cleanOldLogs(e) {
    const n = Date.now() - 6048e5;
    Un.readdir(e).then((r) => {
      r.forEach((i) => {
        const o = xe.join(e, i);
        this.deleteOldLogFile(o, n);
      });
    }).catch((r) => {
      this.logError("Failed to read log directory", r);
    });
  }
  deleteOldLogFile(e, n) {
    Un.stat(e).then((r) => {
      r.mtime.getTime() < n && Un.unlink(e).catch((i) => {
        i ? i.code === "ENOENT" ? this.logWarn(`File already deleted: ${e}`) : this.logError("Failed to delete old log file", i) : this.log(`Deleted old log file: ${e}`);
      });
    }).catch((r) => {
      this.logError("Failed to get file stats", r);
    });
  }
  setFileAndConsoleLogLevel(e, n) {
    this.fileLogLevel = e, this.logger.transports.forEach((r) => {
      r instanceof Jr.transports.File ? r.level = e : r instanceof Jr.transports.Console && (r.level = n);
    });
  }
  setLogSelfInfo(e) {
    const n = `${e.nick}`;
    this.logger.defaultMeta = { userInfo: n };
  }
  setFileLogEnabled(e) {
    this.fileLogEnabled = e, e && !this.fileTransportAdded && (this.fileTransportAdded = !0, this.logger.add(new Jr.transports.File({
      filename: this.logPath,
      level: this.fileLogLevel,
      maxsize: 5 * 1024 * 1024,
      // 5MB
      maxFiles: 5
    }))), this.logger.transports.forEach((n) => {
      n instanceof Jr.transports.File && (n.silent = !e);
    });
  }
  setConsoleLogEnabled(e) {
    this.consoleLogEnabled = e, this.logger.transports.forEach((n) => {
      n instanceof Jr.transports.Console && (n.silent = !e);
    });
  }
  formatMsg(e) {
    return e.map((n) => n instanceof Error ? n.stack : typeof n == "object" ? JSON.stringify(T6(JSON.parse(JSON.stringify(n, null, 2)))) : n).join(" ");
  }
  _log(e, ...n) {
    if (this.consoleLogEnabled || this.fileLogEnabled) {
      const r = this.formatMsg(n);
      this.consoleLogEnabled && this.fileLogEnabled ? this.logger.log(e, r) : this.consoleLogEnabled ? this.logger.log(e, r) : this.fileLogEnabled && this.logger.log(e, r.replace(/\x1B[@-_][0-?]*[ -/]*[@-~]/g, "")), nM.notify(JSON.stringify({ level: e, message: r }));
    }
  }
  log(...e) {
    this._log("info", ...e);
  }
  logDebug(...e) {
    this._log("debug", ...e);
  }
  logError(...e) {
    this._log("error", ...e);
  }
  logWarn(...e) {
    this._log("warn", ...e);
  }
  logFatal(...e) {
    this._log("fatal", ...e);
  }
  logMessage(e, n) {
    const r = e.senderUin === n.uin;
    e.elements[0]?.elementType !== _e.GreyTip && this.log(`${r ? "发送 ->" : "接收 <-"} ${iM(e)}`);
  }
}
function iM(t, e = 0) {
  if (e > 2)
    return "...";
  const n = [];
  t.chatType === Ne.KCHATTYPEC2C ? n.push(`私聊 (${t.peerUin})`) : t.chatType === Ne.KCHATTYPEGROUP ? (e < 1 && n.push(`群聊 [${t.peerName}(${t.peerUin})]`), t.senderUin !== "0" && n.push(`[${t.sendMemberName || t.sendRemarkName || t.sendNickName}(${t.senderUin})]`)) : t.chatType === Ne.KCHATTYPEDATALINE ? n.push("移动设备") : n.push(`临时消息 (${t.peerUin})`);
  for (const r of t.elements)
    n.push(yV(r, t, e));
  return n.join(" ");
}
function yV(t, e, n) {
  if (t.textElement)
    return vV(t.textElement);
  if (t.replyElement)
    return bV(t.replyElement, e, n);
  if (t.picElement)
    return "[图片]";
  if (t.fileElement) {
    if (t.fileElement.fileUuid)
      return `[文件 ${t.fileElement.fileName}]`;
    if (t.elementType === _e.TOFURECORD)
      return `[在线文件 ${t.fileElement.fileName}]`;
    if (t.elementType === _e.ONLINEFOLDER)
      return `[在线文件夹 ${t.fileElement.fileName}/]`;
  }
  return t.videoElement ? "[视频]" : t.pttElement ? `[语音 ${t.pttElement.duration}s]` : t.arkElement ? "[卡片消息]" : t.faceElement ? `[表情 ${t.faceElement.faceText ?? ""}]` : t.marketFaceElement ? t.marketFaceElement.faceName : t.markdownElement ? t.markdownElement?.mdSummary ? t.markdownElement.mdSummary : "[Markdown 消息]" : t.multiForwardMsgElement ? "[转发消息]" : t.elementType === _e.GreyTip ? "[灰条消息]" : t.elementType === _e.FILE ? "[文件发送中]" : `[未实现 (ElementType = ${t.elementType})]`;
}
function vV(t) {
  if (t.atType === Mr.ATTYPEUNKNOWN) {
    const e = t.content.split(`
`);
    return `${e[0]}${e.length > 1 ? " ..." : ""}`;
  } else {
    if (t.atType === Mr.ATTYPEALL)
      return "@全体成员";
    if (t.atType === Mr.ATTYPEONE)
      return `${t.content} (${t.atUid})`;
  }
  return "";
}
function bV(t, e, n) {
  const r = e.records.find((i) => t.sourceMsgIdInRecords === i.msgId);
  return `[回复消息 ${r && r.peerUin !== "284840486" && r.peerUin !== "1094950020" ? iM(r, n + 1) : `未找到消息记录 (MsgId = ${t.sourceMsgIdInRecords})`}]`;
}
class xV {
  napLogger;
  constructor(e) {
    this.napLogger = e.logger;
  }
  _log(e, ...n) {
    this.napLogger._log(e, "[Core] [Packet] " + n);
  }
  debug(...e) {
    this._log(Qc.DEBUG, e);
  }
  info(...e) {
    this._log(Qc.INFO, e);
  }
  warn(...e) {
    this._log(Qc.WARN, e);
  }
  error(...e) {
    this._log(Qc.ERROR, e);
  }
  fatal(...e) {
    this._log(Qc.FATAL, e);
  }
}
class wV {
  core;
  constructor(e) {
    this.core = e;
  }
  get logger() {
    return this.core.context.logger;
  }
  get basicInfo() {
    return {
      requireMinNTQQBuild: (e) => this.core.context.basicInfoWrapper.requireMinNTQQBuild(e),
      uin: +this.core.selfInfo.uin,
      uid: this.core.selfInfo.uid,
      uin2uid: (e) => this.core.apis.UserApi.getUidByUinV2(String(e)).then((n) => n ?? ""),
      uid2uin: (e) => this.core.apis.UserApi.getUinByUidV2(e).then((n) => +n)
    };
  }
  get config() {
    return this.core.configLoader.configData;
  }
  get napi2nativeLoader() {
    return this.core.context.napi2nativeLoader;
  }
  sendSsoCmdReqByContend = (e, n) => this.core.context.session.getMsgService().sendSsoCmdReqByContend(e, n);
}
class SV {
  napcore;
  logger;
  cb = /* @__PURE__ */ new Map();
  // hash-type callback
  napi2nativeLoader;
  logStack;
  available = !1;
  constructor(e, n, r, i) {
    this.napcore = e, this.logger = n, this.logStack = r, this.napi2nativeLoader = i;
  }
  check() {
    return this.napi2nativeLoader.loaded ? !0 : (this.logStack.pushLogWarn("NativePacketClient: Napi2NativeLoader 未成功加载"), !1);
  }
  async init(e, n, r) {
    if (!this.napcore.basicInfo.requireMinNTQQBuild("40824")) {
      this.logStack.pushLogWarn("[PacketClient] 当前 QQ 版本低于 NativePacketClient 要求，跳过 Hook 初始化");
      return;
    }
    if (this.napi2nativeLoader.initHook(r, n)) {
      this.available = !0, this.logStack.pushLogInfo(`[PacketClient] NativePacketClient Hook 初始化成功 platform=${process.platform}.${process.arch}`);
      return;
    }
    this.logStack.pushLogError(`[PacketClient] NativePacketClient Hook 初始化失败 platform=${process.platform}.${process.arch} send=${r} recv=${n}`);
  }
  async sendPacket(e, n, r = !1, i = 5e3) {
    if (!r)
      return this.napcore.sendSsoCmdReqByContend(e, n).catch(
        (a) => this.logger.error(
          `[PacketClient] sendPacket 无响应命令发送失败 cmd=${e} err=${a}`
        )
      ), { seq: 0, cmd: e, data: Buffer.alloc(0) };
    const o = this.napcore.sendSsoCmdReqByContend(e, n).then((a) => ({
      seq: 0,
      cmd: e,
      data: a.rspbuffer
    })), s = new Promise((a, c) => {
      setTimeout(
        () => c(
          new Error(
            `[PacketClient] sendPacket 超时 cmd=${e} timeout=${i}ms`
          )
        ),
        i
      );
    });
    return Promise.race([o, s]);
  }
  async sendOidbPacket(e, n = !1, r = 5e3) {
    return await this.sendPacket(e.cmd, e.data, n, r);
  }
}
class _V {
  stack = [];
  logger;
  constructor(e) {
    this.logger = e;
  }
  push(e) {
    this.stack.push(e);
  }
  pushLogInfo(e) {
    this.logger.info(e), this.stack.push(`${(/* @__PURE__ */ new Date()).toISOString()} [INFO] ${e}`);
  }
  pushLogWarn(e) {
    this.logger.warn(e), this.stack.push(`${(/* @__PURE__ */ new Date()).toISOString()} [WARN] ${e}`);
  }
  pushLogError(e) {
    this.logger.error(e), this.stack.push(`${(/* @__PURE__ */ new Date()).toISOString()} [ERROR] ${e}`);
  }
  clear() {
    this.stack = [];
  }
  content() {
    return this.stack.join(`
`);
  }
}
class EV {
  napCore;
  logger;
  logStack;
  napi2nativeLoader;
  _client;
  constructor(e, n, r) {
    this.napCore = e, this.logger = n, this.logStack = new _V(n), this.napi2nativeLoader = r, this._client = this.newClient();
  }
  get available() {
    return this._client.available;
  }
  get clientLogStack() {
    return this._client.logStack.content();
  }
  async init(e, n, r) {
    await this._client.init(e, n, r);
  }
  async sendOidbPacket(e, n, r) {
    return (await this._client.sendOidbPacket(e, n, r)).data;
  }
  newClient() {
    this.logger.info("使用 NativePacketClient 作为后端");
    const e = new SV(this.napCore, this.logger, this.logStack, this.napi2nativeLoader);
    if (!e.check())
      throw new Error("[Core] [Packet] NativePacketClient 不可用，NapCat.Packet将不会加载！");
    return e;
  }
}
const AV = [
  _e.TEXT,
  _e.PIC,
  _e.REPLY,
  _e.FACE,
  _e.MFACE,
  _e.VIDEO,
  _e.FILE,
  _e.PTT,
  _e.ARK,
  _e.MARKDOWN,
  _e.MULTIFORWARD
];
class oM {
  isValidElementType(e) {
    return AV.includes(e);
  }
  rawToPacketMsgConverters = {
    [_e.TEXT]: (e) => e.textElement?.atType ? new nC(e) : new Tm(e),
    [_e.PIC]: (e) => new Hw(e),
    [_e.REPLY]: (e) => new qw(e),
    [_e.FACE]: (e) => new $q(e),
    [_e.MFACE]: (e) => new Gq(e),
    [_e.VIDEO]: (e) => new K6(e),
    [_e.FILE]: (e) => new Y6(e),
    [_e.PTT]: (e) => new V6(e),
    [_e.ARK]: (e) => new qq(e),
    [_e.MARKDOWN]: (e) => new Hq(e),
    [_e.MULTIFORWARD]: (e) => new Wq(e)
  };
  rawMsgWithSendMsgToPacketMsg(e) {
    return {
      senderUid: e.senderUid ?? "",
      senderUin: e.senderUin,
      senderName: e.senderName,
      groupId: e.groupId,
      time: e.time,
      msg: e.msg.map((n) => this.isValidElementType(n.elementType) ? this.rawToPacketMsgConverters[n.elementType](n) : null).filter((n) => n !== null)
    };
  }
  rawMsgToPacketMsg(e, n) {
    return {
      seq: +e.msgSeq,
      groupId: n.chatType === Ne.KCHATTYPEGROUP ? +e.peerUid : void 0,
      senderUid: e.senderUid,
      senderUin: +e.senderUin,
      senderName: e.sendMemberName && e.sendMemberName !== "" ? e.sendMemberName : e.sendNickName && e.sendNickName !== "" ? e.sendNickName : "QQ用户",
      time: +e.msgTime,
      msg: e.elements.map((r) => this.isValidElementType(r.elementType) ? this.rawToPacketMsgConverters[r.elementType](r) : null).filter((r) => r !== null)
    };
  }
  packetMsgToRaw(e) {
    const n = [
      Tm.parseElement,
      nC.parseElement,
      qw.parseElement,
      Hw.parseElement
    ];
    return e.map((r) => {
      for (const i of n) {
        const o = i(r);
        if (o) return o;
      }
      return null;
    }).filter((r) => r !== null);
  }
}
class IV {
  context;
  constructor(e) {
    this.context = e;
  }
  async sendPacket(e, n) {
    return await this.context.client.sendOidbPacket(e, n);
  }
  async SendPoke(e, n, r) {
    const i = aH.build(e, n, r ?? n);
    await this.context.client.sendOidbPacket(i);
  }
  async SetGroupTodo(e, n) {
    const r = vH.build(e, n);
    await this.context.client.sendOidbPacket(r, !0);
  }
  async CompleteGroupTodo(e, n) {
    const r = hH.build(e, n);
    await this.context.client.sendOidbPacket(r, !0);
  }
  async CancelGroupTodo(e, n) {
    const r = gH.build(e, n);
    await this.context.client.sendOidbPacket(r, !0);
  }
  async FetchRkey(e = 1e4) {
    const n = CC.build(), r = await this.context.client.sendOidbPacket(n, !0, e);
    return CC.parse(r).data.rkeyList;
  }
  async GroupSign(e) {
    const n = iH.build(this.context.napcore.basicInfo.uin, e);
    await this.context.client.sendOidbPacket(n);
  }
  async GetStrangerStatus(e) {
    let n = 0;
    try {
      const r = uC.build(e), i = await this.context.client.sendOidbPacket(r, !0), o = uC.parse(i), s = BigInt(o.data.status.value);
      return s <= 10n ? { status: Number(s) * 10, ext_status: 0 } : (n = Number((s & 0xff00n) + (s >> 16n & 0xffn)), { status: 10, ext_status: n });
    } catch {
      return;
    }
  }
  async SetGroupSpecialTitle(e, n, r) {
    const i = uH.build(e, n, r);
    await this.context.client.sendOidbPacket(i);
  }
  async UploadResources(e, n = 0) {
    const r = n ? Ne.KCHATTYPEGROUP : Ne.KCHATTYPEC2C, i = n ? String(n) : this.context.napcore.basicInfo.uid, o = e.flatMap(
      (c) => c.msg.map((u) => u instanceof Hw ? this.context.highway.uploadImage({ chatType: r, peerUid: i }, u) : u instanceof K6 ? this.context.highway.uploadVideo({ chatType: r, peerUid: i }, u) : u instanceof V6 ? this.context.highway.uploadPtt({ chatType: r, peerUid: i }, u) : u instanceof Y6 ? this.context.highway.uploadFile({ chatType: r, peerUid: i }, u) : null).filter(Boolean)
    ), s = await Promise.allSettled(o), a = s.filter((c) => c.status === "rejected").length;
    a > 0 && (this.context.logger.warn(`上传资源${s.length}个，失败${a}个`), s.forEach((c, u) => {
      c.status === "rejected" && this.context.logger.error(`上传第${u + 1}个资源失败：${c.reason.stack}`);
    }));
  }
  async UploadImage(e) {
    await this.context.highway.uploadImage(
      {
        chatType: Ne.KCHATTYPEC2C,
        peerUid: this.context.napcore.basicInfo.uid
      },
      e
    );
    const n = e.msgInfo?.msgInfoBody?.at(0)?.index;
    if (!n)
      throw new Error("img.msgInfo?.msgInfoBody![0].index! is undefined");
    return await this.GetImageUrl(this.context.napcore.basicInfo.uid, n);
  }
  async GetImageUrl(e, n) {
    const r = Dl.build(e, n), i = await this.context.client.sendOidbPacket(r, !0), o = Dl.parse(i);
    return `https://${o.download.info.domain}${o.download.info.urlPath}${o.download.rKeyParam}`;
  }
  async GetPttUrl(e, n, r) {
    const i = EC.build(e, n), o = await this.context.client.sendOidbPacket(i, !0, r), s = EC.parse(o);
    return `https://${s.download.info.domain}${s.download.info.urlPath}${s.download.rKeyParam}`;
  }
  async GetVideoUrl(e, n, r) {
    const i = _C.build(e, n), o = await this.context.client.sendOidbPacket(i, !0, r), s = _C.parse(o);
    return `https://${s.download.info.domain}${s.download.info.urlPath}${s.download.rKeyParam}`;
  }
  async GetGroupImageUrl(e, n, r) {
    const i = FH.build(e, n), o = await this.context.client.sendOidbPacket(i, !0, r), s = Dl.parse(o);
    return `https://${s.download.info.domain}${s.download.info.urlPath}${s.download.rKeyParam}`;
  }
  async GetGroupPttUrl(e, n, r) {
    const i = wH.build(e, n), o = await this.context.client.sendOidbPacket(i, !0, r), s = Dl.parse(o);
    return `https://${s.download.info.domain}${s.download.info.urlPath}${s.download.rKeyParam}`;
  }
  async GetGroupVideoUrl(e, n, r = 2e4) {
    const i = RH.build(e, n), o = await this.context.client.sendOidbPacket(i, !0, r), s = Dl.parse(o);
    return `https://${s.download.info.domain}${s.download.info.urlPath}${s.download.rKeyParam}`;
  }
  async ImageOCR(e) {
    const n = lC.build(e), r = await this.context.client.sendOidbPacket(n, !0), i = lC.parse(r);
    return {
      texts: i.ocrRspBody.textDetections.map((o) => ({
        text: o.detectedText,
        confidence: o.confidence,
        coordinates: o.polygon.coordinates.map((s) => ({
          x: s.x,
          y: s.y
        }))
      })),
      language: i.ocrRspBody.language
    };
  }
  async SendPreprocess(e, n = 0) {
    const r = e.map((i) => i.msg.map(async (o) => {
      if (o instanceof qw && !o.targetElems) {
        this.context.logger.debug("Cannot find reply element's targetElems, prepare to fetch it..."), o.targetPeer?.peerUid || this.context.logger.error("targetPeer is undefined!");
        let s;
        o.isGroupReply ? s = await this.FetchGroupMessage(+(o.targetPeer?.peerUid ?? 0), o.targetMessageSeq, o.targetMessageSeq) : s = await this.FetchC2CMessage(await this.context.napcore.basicInfo.uin2uid(o.targetUin), o.targetMessageSeq, o.targetMessageSeq), o.targetElems = s.at(0)?.body?.richText?.elems, o.targetSourceMsg = s.at(0);
      }
    })).flat();
    await Promise.all(r), await this.UploadResources(e, n);
  }
  async FetchGroupMessage(e, n, r) {
    const i = AC.build(e, n, r), o = await this.context.client.sendOidbPacket(i, !0);
    return AC.parse(o).body.messages;
  }
  async FetchC2CMessage(e, n, r) {
    const i = IC.build(e, n, r), o = await this.context.client.sendOidbPacket(i, !0);
    return IC.parse(o).messages;
  }
  async UploadForwardMsg(e, n = 0) {
    await this.SendPreprocess(e, n);
    const r = Gy.build(this.context.napcore.basicInfo.uid, e, n), i = await this.context.client.sendOidbPacket(r, !0);
    return Gy.parse(i).result.resId;
  }
  async UploadForwardMsgV2(e, n = 0) {
    await Promise.allSettled(e.filter((s) => s.actionMsg).map(async (s) => await this.SendPreprocess(s.actionMsg, n)));
    const r = GH.build(this.context.napcore.basicInfo.uid, e, n), i = await this.context.client.sendOidbPacket(r, !0);
    return Gy.parse(i).result.resId;
  }
  async MoveGroupFile(e, n, r, i) {
    const o = pC.build(e, n, r, i), s = await this.context.client.sendOidbPacket(o, !0);
    return pC.parse(s).move.retCode;
  }
  async RenameGroupFile(e, n, r, i) {
    const o = dC.build(e, n, r, i), s = await this.context.client.sendOidbPacket(o, !0);
    return dC.parse(s).rename.retCode;
  }
  async GetGroupFileUrl(e, n, r) {
    const i = fC.build(e, n), o = await this.context.client.sendOidbPacket(i, !0, r), s = fC.parse(o);
    return `https://${s.download.downloadDns}/ftn_handler/${Buffer.from(s.download.downloadUrl).toString("hex")}/?fname=`;
  }
  async GetPrivateFileUrl(e, n, r, i) {
    const o = mC.build(e, n, r), s = await this.context.client.sendOidbPacket(o, !0, i), a = mC.parse(s);
    return `http://${a.body?.result?.server}:${a.body?.result?.port}${a.body?.result?.url?.slice(8)}&isthumb=0`;
  }
  async GetMiniAppAdaptShareInfo(e) {
    const n = cC.build(e), r = await this.context.client.sendOidbPacket(n, !0), i = cC.parse(r);
    return JSON.parse(i.content.jsonContent);
  }
  async FetchAiVoiceList(e, n) {
    const r = sC.build(e, n), i = await this.context.client.sendOidbPacket(r, !0), o = sC.parse(i);
    return o.content ? o.content.map((s) => ({
      category: s.category,
      voices: s.voices
    })) : null;
  }
  async GetAiVoice(e, n, r, i) {
    let o = 0;
    const s = 30, a = Ng.randomBytes(4).readUInt32BE(0);
    for (; ; ) {
      if (o >= s)
        throw new Error(`sendAiVoiceChatReq failed after ${s} times`);
      o++;
      const c = aC.build(e, n, r, a, i), u = await this.context.client.sendOidbPacket(c, !0), l = aC.parse(u);
      if (l.msgInfo)
        return l.msgInfo;
    }
  }
  async FetchForwardMsgRaw(e) {
    const n = Rf.build(this.context.napcore.basicInfo.uid, e), r = await this.context.client.sendOidbPacket(n, !0), i = Rf.parse(r), o = V2(i.result.payload);
    return new fe(Cm).decode(o).action;
  }
  async FetchForwardMsg(e) {
    const n = Rf.build(this.context.napcore.basicInfo.uid, e), r = await this.context.client.sendOidbPacket(n, !0), i = Rf.parse(r), o = V2(i.result.payload), a = new fe(Cm).decode(o).action.find((u) => u.actionCommand === "MultiMsg");
    if (!a?.actionData.msgBody)
      throw new Error("msgBody is empty");
    this.context.logger.debug("rawChains ", o.toString("hex"));
    const c = a.actionData.msgBody.map(async (u) => {
      if (!u?.body?.richText?.elems)
        throw new Error("msg.body.richText.elems is empty");
      const l = new oM().packetMsgToRaw(u?.body?.richText?.elems), d = await Promise.all(
        l.map(async ([x, g]) => {
          if (x.picElement && g?.commonElem?.pbElem) {
            const S = new fe(ea).decode(g.commonElem.pbElem)?.msgInfoBody[0]?.index;
            if (u?.responseHead.grp !== void 0) {
              const E = u?.responseHead.grp?.groupUin ?? 0;
              x.picElement = {
                ...x.picElement,
                originImageUrl: await this.GetGroupImageUrl(E, S)
              };
            } else
              x.picElement = {
                ...x.picElement,
                originImageUrl: await this.GetImageUrl(this.context.napcore.basicInfo.uid, S)
              };
            return x;
          }
          return x;
        })
      ), f = u?.responseHead.grp !== void 0, m = String(f ? u?.responseHead.grp?.groupUin ?? 0 : u?.responseHead.fromUin ?? 0), h = String(f ? u?.responseHead.grp?.groupUin ?? 0 : u?.responseHead.fromUid ?? ""), y = f ? u?.responseHead.grp?.memberName ?? "" : u?.responseHead.forward?.friendName ?? "";
      return {
        chatType: f ? Ne.KCHATTYPEGROUP : Ne.KCHATTYPEC2C,
        elements: d,
        guildId: "",
        isOnlineMsg: !1,
        msgId: "7467703692092974645",
        // TODO: no necessary
        msgRandom: "0",
        msgSeq: String(u.contentHead.sequence ?? 0),
        msgTime: String(u.contentHead.timeStamp ?? 0),
        msgType: Gs.KMSGTYPEMIX,
        parentMsgIdList: [],
        parentMsgPeer: {
          chatType: f ? Ne.KCHATTYPEGROUP : Ne.KCHATTYPEC2C,
          peerUid: h
        },
        peerName: "",
        peerUid: h,
        peerUin: m,
        recallTime: "0",
        records: [],
        sendNickName: y,
        sendRemarkName: y,
        senderUid: u?.responseHead.fromUid ?? "",
        senderUin: String(u?.responseHead.fromUin ?? 0),
        sourceType: iE.K_DOWN_SOURCETYPE_UNKNOWN,
        subMsgType: 1
      };
    });
    return await Promise.all(c);
  }
}
class CV {
  msgConverter;
  napcore;
  logger;
  client;
  highway;
  operation;
  constructor(e) {
    this.msgConverter = new oM(), this.napcore = new wV(e), this.logger = new xV(this.napcore), this.client = new EV(this.napcore, this.logger, this.napcore.napi2nativeLoader), this.highway = new Lz(this.napcore, this.logger, this.client), this.operation = new IV(this);
  }
}
class TV {
  context;
  constructor(e) {
    this.context = new CV(e);
  }
  init(e, n, r) {
    return this.context.client.init(e, n, r);
  }
  get clientLogStack() {
    return this.context.client.clientLogStack;
  }
  get available() {
    return this.context.client.available;
  }
  get operation() {
    return this.context.operation;
  }
  // TODO: global message element adapter (?
  get msgConverter() {
    return this.context.msgConverter;
  }
}
const kV = xQ;
class NV {
  context;
  core;
  logger;
  qqVersion;
  pkt;
  errStack = [];
  packetStatus = !1;
  constructor(e, n) {
    this.context = e, this.core = n, this.logger = n.context.logger;
  }
  async initApi() {
    this.packetStatus = await this.InitSendPacket(this.context.basicInfoWrapper.getFullQQVersion()).then((e) => e).catch((e) => (this.logger.logError(e), this.pushError(e), !1)) && this.pkt?.available;
  }
  get available() {
    return this.pkt?.available ?? !1;
  }
  get clientLogStack() {
    return [this.pkt?.clientLogStack, ...this.errStack].filter(Boolean).join(`
`);
  }
  pushError(e) {
    if (e instanceof Error) {
      this.errStack.push(e.stack || e.message);
      return;
    }
    this.errStack.push(String(e));
  }
  async InitSendPacket(e) {
    this.qqVersion = e;
    const n = kV[e + "-" + Vs.arch()];
    if (!n) {
      const r = `[Core] [Packet] PacketBackend 不支持当前QQ版本架构：${e}-${Vs.arch()}，
            请参照 https://github.com/NapNeko/NapCatQQ/releases/tag/v${Hu} 配置正确的QQ版本！`;
      return this.logger.logError(r), this.errStack.push(r), !1;
    }
    if (this.core.configLoader.configData.packetBackend === "disable") {
      const r = "[Core] [Packet] 已禁用PacketBackend，NapCat.Packet将不会加载！";
      return this.logger.logError(r), this.errStack.push(r), !1;
    }
    if (this.pkt = new TV(this.core), await this.pkt.init(process.pid, n.recv, n.send), !this.pkt.available) {
      const r = "[Core] [Packet] NativePacketClient 初始化失败，PacketBackend 发包能力不可用！";
      return this.logger.logError(r), this.errStack.push(r), !1;
    }
    try {
      await this.pkt.operation.FetchRkey(3e3);
    } catch (r) {
      return this.logger.logError("测试Packet状态异常", r), this.pushError(r), !1;
    }
    return !0;
  }
}
var Ma = /* @__PURE__ */ ((t) => (t[t.OK = 0] = "OK", t[t.ERROR = -1] = "ERROR", t))(Ma || {});
const Sh = (t) => Tw.normalize(t).toLowerCase();
class PV {
  context;
  core;
  constructor(e, n) {
    this.context = e, this.core = n;
  }
  /**
   * 这里不等待node返回，因为the fuck wrapper.node 根本不返回（会卡死不知道为什么）！！！  只能手动查询判断死活
   * @param peer
   * @param filePath
   * @param fileName
   */
  async sendOnlineFile(e, n, r) {
    if (!Af.existsSync(n))
      throw new Error(`[NapCat] 文件不存在: ${n}`);
    const i = r || Tw.basename(n), o = Af.statSync(n).size.toString(), s = [{
      elementType: 23,
      elementId: "",
      fileElement: {
        fileName: i,
        filePath: n,
        fileSize: o
      }
    }], a = this.context.session.getMsgService(), c = Math.floor(Date.now() / 1e3) - 2;
    a.sendMsg("0", e, s, /* @__PURE__ */ new Map()).catch((d) => {
    });
    const u = 10;
    let l = 0;
    for (; l < u; ) {
      await Kp(1e3), l++;
      try {
        const m = ((await a.getOnlineFileMsgs(e))?.msgList || []).find((h) => parseInt(h.msgTime) < c ? !1 : !!h.elements.find((x) => {
          if (x.elementType !== 23 || !x.fileElement) return !1;
          const g = x.fileElement.fileName === i, v = Sh(x.fileElement.filePath) === Sh(n);
          return g && v;
        }));
        if (m) {
          const h = m.elements.find((y) => y.elementType === 23);
          return this.context.logger.log("[OnlineFile] 在线文件发送成功！"), {
            result: Ma.OK,
            errMsg: "",
            msgId: m.msgId,
            elementId: h?.elementId || ""
          };
        }
      } catch {
      }
    }
    return this.context.logger.logError("[OnlineFile] 在线文件发送失败！！！"), {
      result: Ma.ERROR,
      errMsg: "[NapCat] Send Online File Timeout: Message not found in history."
    };
  }
  /**
   * 发送在线文件夹
   * @param peer
   * @param folderPath
   * @param folderName
   */
  async sendOnlineFolder(e, n, r) {
    const i = r || Tw.basename(n);
    if (!Af.existsSync(n))
      return { result: Ma.ERROR, errMsg: `Folder not found: ${n}` };
    if (!Af.statSync(n).isDirectory())
      return { result: Ma.ERROR, errMsg: `Path is not a directory: ${n}` };
    const o = {
      elementType: 30,
      elementId: "",
      fileElement: {
        fileName: i,
        filePath: n,
        fileSize: ""
      }
    }, s = this.context.session.getMsgService(), a = Math.floor(Date.now() / 1e3) - 2;
    s.sendMsg("0", e, [o], /* @__PURE__ */ new Map()).catch((l) => {
    });
    const c = 10;
    let u = 0;
    for (; u < c; ) {
      await Kp(1e3), u++;
      try {
        const f = ((await s.getOnlineFileMsgs(e))?.msgList || []).find((m) => parseInt(m.msgTime) < a ? !1 : !!m.elements.find((y) => {
          if (y.elementType !== 30 || !y.fileElement) return !1;
          const x = y.fileElement.fileName === i, g = Sh(y.fileElement.filePath) === Sh(n);
          return x && g;
        }));
        if (f) {
          const m = f.elements.find((h) => h.elementType === 30);
          return this.context.logger.log("[OnlineFile] 在线文件夹发送成功！"), {
            result: Ma.OK,
            errMsg: "",
            msgId: f.msgId,
            elementId: m?.elementId || ""
          };
        }
      } catch {
      }
    }
    return this.context.logger.logError("[OnlineFile] 在线文件发送失败!!!"), {
      result: Ma.ERROR,
      errMsg: "[NapCat] Send Online Folder Timeout: Message not found in history."
    };
  }
  /**
   * 获取好友的在线文件消息
   * @param peer
   */
  async getOnlineFileMsg(e) {
    return await this.context.session.getMsgService().getOnlineFileMsgs(e);
  }
  /**
   * 取消在线文件的发送
   * @param peer
   * @param msgId
   */
  async cancelMyOnlineFileMsg(e, n) {
    await this.context.session.getMsgService().cancelSendMsg(e, n);
  }
  /**
   * 拒绝接收在线文件
   * @param peer
   * @param msgId
   * @param elementId
   */
  async refuseOnlineFileMsg(e, n, r) {
    const i = this.context.session.getMsgService(), o = {
      msgId: n,
      peerUid: e.peerUid,
      chatType: 1,
      elementId: r,
      downloadType: 1,
      downSourceType: 1
    };
    await i.refuseGetRichMediaElement(o);
  }
  /**
   * 接收在线文件/文件夹
   * @param peer
   * @param msgId
   * @param elementId
   * @constructor
   */
  async receiveOnlineFileOrFolder(e, n, r) {
    const i = this.context.session.getMsgService(), o = {
      msgId: n,
      peerUid: e.peerUid,
      chatType: 1,
      elementId: r,
      downSourceType: 1,
      downloadType: 1
    };
    return await i.getRichMediaElement(o);
  }
  /**
   * 在线文件/文件夹转离线
   * @param peer
   * @param msgId
   */
  async switchFileToOffline(e, n) {
    await this.context.session.getMsgService().switchToOfflineSendMsg(e, n);
  }
}
var sM = /* @__PURE__ */ ((t) => (t[t.KUPLOADSCENEUNKNOWN = 0] = "KUPLOADSCENEUNKNOWN", t[t.KUPLOADSCENEFLOATWINDOWRIGHTCLICKMENU = 1] = "KUPLOADSCENEFLOATWINDOWRIGHTCLICKMENU", t[t.KUPLOADSCENEFLOATWINDOWDRAG = 2] = "KUPLOADSCENEFLOATWINDOWDRAG", t[t.KUPLOADSCENEFLOATWINDOWFILESELECTOR = 3] = "KUPLOADSCENEFLOATWINDOWFILESELECTOR", t[t.KUPLOADSCENEFLOATWINDOWSHORTCUTKEYCTRLCV = 4] = "KUPLOADSCENEFLOATWINDOWSHORTCUTKEYCTRLCV", t[t.KUPLOADSCENEH5LAUNCHCLIENTRIGHTCLICKMENU = 5] = "KUPLOADSCENEH5LAUNCHCLIENTRIGHTCLICKMENU", t[t.KUPLOADSCENEH5LAUNCHCLIENTDRAG = 6] = "KUPLOADSCENEH5LAUNCHCLIENTDRAG", t[t.KUPLOADSCENEH5LAUNCHCLIENTFILESELECTOR = 7] = "KUPLOADSCENEH5LAUNCHCLIENTFILESELECTOR", t[t.KUPLOADSCENEH5LAUNCHCLIENTSHORTCUTKEYCTRLCV = 8] = "KUPLOADSCENEH5LAUNCHCLIENTSHORTCUTKEYCTRLCV", t[t.KUPLOADSCENEAIODRAG = 9] = "KUPLOADSCENEAIODRAG", t[t.KUPLOADSCENEAIOFILESELECTOR = 10] = "KUPLOADSCENEAIOFILESELECTOR", t[t.KUPLOADSCENEAIOSHORTCUTKEYCTRLCV = 11] = "KUPLOADSCENEAIOSHORTCUTKEYCTRLCV", t))(sM || {});
class DV {
  context;
  core;
  constructor(e, n) {
    this.context = e, this.core = n;
  }
  /**
   * 发起闪传上传任务
   * @param fileListToUpload 上传文件绝对路径的列表，可以是文件夹！！
   * @param thumbnailPath
   * @param filesetName
   */
  async createFlashTransferUploadTask(e, n, r) {
    const i = this.context.session.getFlashTransferService(), o = Date.now(), s = this.core.selfInfo, a = {
      screen: 1,
      // 1
      name: r,
      uploaders: [{
        uin: s.uin,
        uid: s.uid,
        sendEntrance: "",
        nickname: s.nick
      }],
      coverPath: n,
      paths: e,
      excludePaths: [],
      expireLeftTime: 0,
      isNeedDelDeviceInfo: !1,
      isNeedDelLocation: !1,
      coverOriginalInfos: [
        {
          path: e[0] || "",
          thumbnailPath: n
        }
      ],
      uploadSceneType: sM.KUPLOADSCENEAIOFILESELECTOR,
      // 不知道怎么枚举 先硬编码吧 (PC QQ 10)
      detectPrivacyInfoResult: {
        exists: !1,
        allDetectResults: /* @__PURE__ */ new Map()
      }
    }, c = await i.createFlashTransferUploadTask(o, a);
    return c.result === 0 ? (this.context.logger.log("[Flash] 发起闪传任务成功"), c) : (this.context.logger.logError("[Flash] 发起闪传上传任务失败！！"), c);
  }
  /**
   * 下载闪传文件集
   * @param fileSetId
   */
  async downloadFileSetBySetId(e) {
    const r = await this.context.session.getFlashTransferService().startFileSetDownload(e, 1, { isIncludeCompressInnerFiles: !1 });
    return r.result === 0 ? this.context.logger.log("[Flash] 成功开始下载文件集") : this.context.logger.logError("[Flash] 尝试下载文件集失败！"), r;
  }
  /**
   * 获取闪传的外链分享
   * @param fileSetId
   */
  async getShareLinkBySetId(e) {
    const r = await this.context.session.getFlashTransferService().getShareLinkReq(e);
    return r.result === 0 ? this.context.logger.log("[Flash] 获取闪传外链分享成功:", r.shareLink) : this.context.logger.logError("[Flash] 获取闪传外链失败！！"), r;
  }
  /**
   * 从分享外链获取文件集id
   * @param shareCode
   */
  async fromShareLinkFindSetId(e) {
    const r = await this.context.session.getFlashTransferService().getFileSetIdByCode(e);
    return r.result === 0 ? this.context.logger.log("[Flash] 获取shareCode的文件集Id成功！") : this.context.logger.logError("[Flash] 获取文件集ID失败！！"), r;
  }
  /**
   * 获取fileSet的文件结构信息  （未来可能需要深度遍历）
   * == 注意返回结构和其它的不同，没有GeneralCallResult!!! ==
   * @param fileSetId
   */
  async getFileListBySetId(e) {
    const n = this.context.session.getFlashTransferService(), r = {
      seq: 0,
      fileSetId: e,
      isUseCache: !1,
      sceneType: 1,
      // 硬编码
      reqInfos: [
        {
          count: 18,
          // 18 ??
          paginationInfo: {},
          parentId: "",
          reqIndexPath: "",
          reqDepth: 1,
          filterCondition: {
            fileCategory: 0,
            filterType: 0
          },
          sortConditions: [
            {
              sortField: 0,
              sortOrder: 0
            }
          ],
          isNeedPhysicalInfoReady: !1
        }
      ]
    }, i = await n.getFileList(r);
    return i.rsp.result === 0 ? (this.context.logger.log("[Flash] 获取fileSet文件信息成功！"), i.rsp) : (this.context.logger.logError(`[Flash] 获取文件信息失败：ErrMsg: ${i.rsp.errMs}`), i.rsp);
  }
  /**
   * 获取闪传文件集合信息
   * @param fileSetId
   */
  async getFileSetIndoBySetId(e) {
    const n = this.context.session.getFlashTransferService(), r = {
      fileSetId: e
    }, i = await n.getFileSet(r);
    return i.result === 0 ? this.context.logger.log("[Flash] 获取闪传文件集信息成功！") : this.context.logger.logError("[Flash] 获取闪传文件信息失败！！"), i;
  }
  /**
   * 发送闪传消息（私聊/群聊）
   * @param fileSetId
   * @param peer
   */
  async sendFlashMessage(e, n) {
    const r = this.context.session.getFlashTransferService(), i = {
      destUid: n.peerUid,
      destType: n.chatType
      // destUin: peer.peerUin,
    }, o = {
      fileSetId: e,
      targets: [i]
    }, s = await r.sendFlashTransferMsg(o);
    return s.errCode === 0 ? this.context.logger.log("[Flash] 消息发送成功") : this.context.logger.logError(`[Flash] 消息发送失败！！原因：${s.errMsg}`), s;
  }
  /**
   * 获取闪传文件集中某个文件的下载URL（外链）
   * @param fileSetId
   * @param options
   */
  async getFileTransUrl(e, n) {
    const r = this.context.session.getFlashTransferService(), i = await this.getFileListBySetId(e), { fileName: o, fileIndex: s } = n;
    let a, c;
    const u = i.fileLists;
    e: for (const l of u) {
      const d = l.fileList;
      for (let f = 0; f < d.length; f++) {
        if (c = d[f], o !== void 0 && c.name === o) {
          a = c;
          break e;
        }
        if (s !== void 0 && f === s) {
          a = c;
          break e;
        }
      }
    }
    return a === void 0 ? (this.context.logger.logError("[Flash] 未找到对应文件！！"), {
      result: -1,
      errMsg: "未找到对应文件",
      transferUrl: ""
    }) : (this.context.logger.log("[Flash] 找到对应文件，准备尝试获取传输链接"), {
      result: 0,
      errMsg: "",
      transferUrl: (await r.startFileTransferUrl(a)).url
    });
  }
  async createFileThumbnail(e) {
    const r = this.context.session.getMsgService().getFileThumbSavePathForSend(750, !0), i = await this.core.util.createThumbnailImage(
      "flashtransfer",
      e,
      r,
      {
        width: 520,
        height: 520
      },
      "jpeg",
      null
    );
    return i.result === 0 && (this.context.logger.log("获取缩略图成功！！"), i.targetPath = r), i;
  }
}
const aM = 1024, Ls = 4096, uN = 16, lN = 32, FV = 16, OV = 48, MV = 4e3, RV = 2, BV = 58, UV = Buffer.from("SQLite header 3\0"), LV = Buffer.from("SQLite format 3\0");
function jV(t, e) {
  const n = K2(t, e, MV, lN, "sha512"), r = Buffer.alloc(e.length);
  for (let o = 0; o < e.length; o++)
    r[o] = e[o] ^ BV;
  const i = K2(n, r, RV, lN, "sha512");
  return { encKey: n, hmacKey: i };
}
function QV(t, e, n = 0) {
  const r = t.subarray(n), i = r.length - OV, o = r.subarray(0, i), s = r.subarray(i, i + FV), a = AL("aes-256-cbc", e, s);
  return a.setAutoPadding(!1), Buffer.concat([a.update(o), a.final()]);
}
function cM(t) {
  return t.length < aM + Ls ? !1 : t.subarray(0, 16).equals(UV);
}
function OE(t, e) {
  if (!cM(t)) return null;
  const n = t.subarray(aM), r = Math.floor(n.length / Ls);
  if (r === 0) return null;
  const i = n.subarray(0, uN), { encKey: o } = jV(e, i), s = Buffer.alloc(r * Ls);
  let a = 0;
  for (let c = 1; c <= r; c++) {
    const u = (c - 1) * Ls, l = n.subarray(u, u + Ls), f = QV(l, o, c === 1 ? uN : 0);
    c === 1 ? (LV.copy(s, 0), f.copy(s, 16), s.writeUInt16BE(Ls, 16), a = Ls) : (f.copy(s, a), a += Ls);
  }
  return s;
}
function ME(t, e, n) {
  const r = Ge.readFileSync(t), i = OE(r, e);
  if (!i) return null;
  if (!n) {
    const o = t.lastIndexOf(".");
    n = o > 0 ? t.substring(0, o) + "_decrypted" + t.substring(o) : t + "_decrypted";
  }
  return Ge.writeFileSync(n, i), n;
}
let Jc = null, pN = !1;
async function $V() {
  if (pN) return Jc;
  pN = !0;
  try {
    return Jc = (await import("node:sqlite")).DatabaseSync, Jc;
  } catch {
    return Jc = null, null;
  }
}
function uM() {
  if (!Jc)
    throw new Error(
      "node:sqlite 不可用。请使用 Node.js 22+ 并添加 --experimental-sqlite 标志，或调用 checkSqliteAvailable() 检查可用性。"
    );
  return Jc;
}
async function GV() {
  return await $V() !== null;
}
class rm {
  db;
  _closed = !1;
  filePath;
  readOnly;
  constructor(e, n = !1) {
    const r = uM();
    this.db = new r(e, { readOnly: n }), this.filePath = e, this.readOnly = n;
  }
  /** 数据库是否已关闭 */
  get closed() {
    return this._closed;
  }
  ensureOpen() {
    if (this._closed) throw new Error("数据库已关闭");
  }
  /**
   * 执行 SELECT 查询，返回所有结果行
   * @param sql    SQL 语句
   * @param params 绑定参数 (位置参数数组 或 命名参数对象)
   */
  query(e, n) {
    this.ensureOpen();
    const r = this.db.prepare(e);
    return n ? Array.isArray(n) ? r.all(...n) : r.all(n) : r.all();
  }
  /**
   * 执行 SELECT 查询，仅返回第一行
   * @param sql    SQL 语句
   * @param params 绑定参数
   */
  queryOne(e, n) {
    this.ensureOpen();
    const r = this.db.prepare(e);
    return n ? Array.isArray(n) ? r.get(...n) : r.get(n) : r.get();
  }
  /**
   * 执行非查询 SQL (INSERT/UPDATE/DELETE/CREATE 等)
   * @param sql    SQL 语句
   * @param params 绑定参数
   * @returns      受影响的行数信息
   */
  execute(e, n) {
    this.ensureOpen();
    const r = this.db.prepare(e);
    return n ? Array.isArray(n) ? r.run(...n) : r.run(n) : r.run();
  }
  /** 列出所有表的信息 */
  listTables() {
    return this.ensureOpen(), lM(this.db);
  }
  /** 获取指定表的列信息 */
  getTableColumns(e) {
    return this.ensureOpen(), this.db.prepare(`PRAGMA table_info([${e}])`).all().map((r) => ({
      cid: r.cid,
      name: r.name,
      type: r.type,
      notnull: r.notnull === 1,
      pk: r.pk === 1
    }));
  }
  /** 获取表的行数 */
  getRowCount(e) {
    return this.ensureOpen(), this.db.prepare(`SELECT count(*) as cnt FROM [${e}]`).get()?.cnt ?? 0;
  }
  /** 关闭数据库连接 */
  close() {
    this._closed || (this.db.close(), this._closed = !0);
  }
}
function qV(t, e = !0) {
  return new rm(t, e);
}
function HV(t, e, n, r = !0) {
  const i = xe.basename(t);
  if (n) {
    const c = xe.join(n, i);
    if (Ge.existsSync(c))
      return new rm(c, r);
    Ge.mkdirSync(n, { recursive: !0 });
    const u = ME(t, e, c);
    if (!u) throw new Error(`解密失败: ${t}`);
    return new rm(u, r);
  }
  const o = xe.join(dt.tmpdir(), `napcat_db_${Date.now()}_${Math.random().toString(36).slice(2)}.db`), s = Ge.readFileSync(t), a = OE(s, e);
  if (!a) throw new Error(`解密失败: ${t}`);
  return Ge.writeFileSync(o, a), new rm(o, r);
}
function lM(t) {
  const e = [], n = t.prepare(
    "SELECT name, type FROM sqlite_master WHERE type IN ('table', 'view') ORDER BY name"
  ).all();
  for (const { name: r, type: i } of n) {
    const o = [];
    try {
      const a = t.prepare(`PRAGMA table_info([${r}])`).all();
      for (const c of a)
        o.push({
          cid: c.cid,
          name: c.name,
          type: c.type,
          notnull: c.notnull === 1,
          pk: c.pk === 1
        });
    } catch {
    }
    let s = 0;
    try {
      s = t.prepare(`SELECT count(*) as cnt FROM [${r}]`).get()?.cnt ?? 0;
    } catch {
      s = -1;
    }
    e.push({
      name: r,
      type: i,
      rowCount: s,
      columns: o
    });
  }
  return e;
}
function zw(t) {
  const e = uM(), n = new e(t, { readOnly: !0 });
  try {
    return lM(n);
  } finally {
    n.close();
  }
}
function WV(t) {
  const e = xe.join(dt.tmpdir(), `napcat_db_${Date.now()}_${Math.random().toString(36).slice(2)}.db`);
  try {
    return Ge.writeFileSync(e, t), zw(e);
  } finally {
    try {
      Ge.unlinkSync(e);
    } catch {
    }
  }
}
function pM(t, e, n) {
  const r = xe.basename(t), i = {
    filename: r,
    sourcePath: t,
    success: !1,
    tables: []
  };
  try {
    if (n?.cacheDir) {
      const s = xe.join(n.cacheDir, r);
      if (i.cachePath = s, n?.skipExistingCache !== !1 && Ge.existsSync(s))
        return i.tables = zw(s), i.success = !0, i;
    }
    const o = Ge.readFileSync(t);
    if (!cM(o))
      return i.error = "Not an encrypted NTQQ database", i;
    if (n?.cacheDir) {
      Ge.mkdirSync(n.cacheDir, { recursive: !0 });
      const s = ME(t, e, i.cachePath);
      if (!s)
        return i.error = "Decryption failed", i;
      i.cachePath = s, i.tables = zw(s);
    } else {
      const s = OE(o, e);
      if (!s)
        return i.error = "Decryption returned null", i;
      i.tables = WV(s);
    }
    i.success = !0;
  } catch (o) {
    i.error = o instanceof Error ? o.message : String(o);
  }
  return i;
}
function zV(t, e, n) {
  const r = [];
  if (!Ge.existsSync(t)) return r;
  const i = Ge.readdirSync(t).filter((o) => o.endsWith(".db")).sort();
  for (const o of i) {
    const s = xe.join(t, o), a = pM(s, e, n);
    r.push(a);
  }
  return r;
}
function KV(t) {
  const e = [];
  let n = 0, r = 0;
  for (const i of t) {
    if (i.success) {
      r++;
      const o = i.cachePath ? ` → ${i.cachePath}` : "";
      e.push(`=== ${i.filename} (${i.tables.length} tables)${o} ===`);
      for (const s of i.tables) {
        n++;
        const a = s.columns.map((c) => `${c.name}:${c.type || "?"}`).join(", ");
        e.push(`  ${s.name}: ${s.rowCount} rows [${a}]`);
      }
    } else
      e.push(`=== ${i.filename}: SKIP (${i.error}) ===`);
    e.push("");
  }
  return e.push(`Summary: ${r}/${t.length} databases decrypted, ${n} total tables`), e.join(`
`);
}
class VV {
  context;
  core;
  constructor(e, n) {
    this.context = e, this.core = n;
  }
  /** node:sqlite 是否可用 */
  async isSqliteAvailable() {
    return GV();
  }
  /** 获取当前账号的 nt_db 目录 */
  getNtDbDir() {
    return xe.resolve(this.core.dataPath, this.core.selfInfo.uin, "nt_qq", "nt_db");
  }
  /**
   * 获取解密缓存目录
   * 默认: <NapCatDataPath>/db_<uin>/
   * 可通过 customDir 完全自定义
   */
  getDefaultCacheDir(e) {
    return e || xe.resolve(this.core.NapCatDataPath, `db_${this.core.selfInfo.uin}`);
  }
  /** 当前是否已获取到数据库 passphrase */
  hasPassphrase() {
    return !!this.core.dbPassphrase;
  }
  /** 获取 passphrase Buffer，未获取时返回 null */
  getPassphraseBuffer() {
    return this.core.dbPassphrase ? Buffer.from(this.core.dbPassphrase) : null;
  }
  // ======================== SQLite 数据库操作 ========================
  /**
   * 打开一个已解密的 SQLite 数据库文件
   * @param filePath  解密后 .db 文件路径
   * @param readOnly  是否只读 (默认 true)
   * @returns         DatabaseHandle 实例，使用完毕后需调用 .close()
   */
  openDecryptedDb(e, n = !0) {
    return qV(e, n);
  }
  /**
   * 解密并打开一个 NTQQ 加密数据库
   * @param dbName    数据库文件名 (如 'nt_msg.db') 或完整路径
   * @param readOnly  是否只读 (默认 true)
   * @param cacheDir  自定义缓存目录，默认 db_<uin>
   * @returns         DatabaseHandle 实例，使用完毕后需调用 .close()
   */
  openDatabase(e, n = !0, r) {
    const i = this.getPassphraseBuffer();
    if (!i) return null;
    const o = xe.isAbsolute(e) ? e : xe.resolve(this.getNtDbDir(), e), s = this.getDefaultCacheDir(r);
    return HV(o, i, s, n);
  }
  /**
   * 对加密数据库执行查询并自动关闭连接
   * @param dbName  数据库文件名或完整路径
   * @param sql     SQL 查询语句
   * @param params  绑定参数
   * @returns       查询结果行数组，passphrase 不可用时返回 null
   */
  query(e, n, r) {
    const i = this.openDatabase(e);
    if (!i) return null;
    try {
      return i.query(n, r);
    } finally {
      i.close();
    }
  }
  /**
   * 对加密数据库执行查询，仅返回第一行
   * @param dbName  数据库文件名或完整路径
   * @param sql     SQL 查询语句
   * @param params  绑定参数
   */
  queryOne(e, n, r) {
    const i = this.openDatabase(e);
    if (!i) return null;
    try {
      return i.queryOne(n, r);
    } finally {
      i.close();
    }
  }
  /**
   * 对加密数据库执行非查询 SQL (INSERT/UPDATE/DELETE 等) 并自动关闭
   * @param dbName  数据库文件名或完整路径
   * @param sql     SQL 语句
   * @param params  绑定参数
   */
  execute(e, n, r) {
    const i = this.openDatabase(e, !1);
    if (!i) return null;
    try {
      return i.execute(n, r);
    } finally {
      i.close();
    }
  }
  // ======================== 批量扫描 ========================
  /**
   * 读取单个加密数据库的表信息
   * @param dbName    数据库文件名 (如 'nt_msg.db')，或完整路径
   * @param cacheDir  自定义缓存目录，默认 db_<uin>
   * @param options   其他选项
   */
  readDatabase(e, n, r) {
    const i = this.getPassphraseBuffer();
    if (!i) return null;
    const o = xe.isAbsolute(e) ? e : xe.resolve(this.getNtDbDir(), e), s = this.getDefaultCacheDir(n);
    return pM(o, i, { cacheDir: s, ...r });
  }
  /**
   * 扫描所有加密数据库
   * @param cacheDir  自定义缓存目录，默认 db_<uin>
   * @param options   其他选项
   */
  scanDatabases(e, n) {
    const r = this.getPassphraseBuffer();
    if (!r) return [];
    const i = this.getDefaultCacheDir(e);
    return zV(this.getNtDbDir(), r, { cacheDir: i, ...n });
  }
  /**
   * 仅解密数据库文件（不读取表信息，不需要 node:sqlite）
   * @param dbName    数据库文件名或完整路径
   * @param outputPath  输出路径，默认保存到 db_<uin>/<dbName>
   */
  decryptDatabase(e, n) {
    const r = this.getPassphraseBuffer();
    if (!r) return null;
    const i = xe.isAbsolute(e) ? e : xe.resolve(this.getNtDbDir(), e), o = n ?? xe.resolve(this.getDefaultCacheDir(), xe.basename(e));
    return ME(i, r, o);
  }
  /** 格式化扫描结果为可读字符串 */
  formatResults(e) {
    return KV(e);
  }
}
class YV {
  context;
  core;
  constructor(e, n) {
    this.context = e, this.core = n;
  }
  async createCollection(e, n, r, i, o) {
    return this.context.session.getCollectionService().createNewCollectionItem({
      commInfo: {
        bid: 1,
        category: 2,
        author: {
          type: 1,
          numId: e,
          strId: r,
          groupId: "0",
          groupName: "",
          uid: n
        },
        customGroupId: "0",
        createTime: Date.now().toString(),
        sequence: Date.now().toString()
      },
      richMediaSummary: {
        originalUri: "",
        publisher: "",
        richMediaVersion: 0,
        subTitle: "",
        title: "",
        brief: i,
        picList: [],
        contentType: 1
      },
      richMediaContent: {
        rawData: o,
        bizDataList: [],
        picList: [],
        fileList: []
      },
      need_share_url: !1
    });
  }
  async getAllCollection(e = 0, n = 50) {
    return this.context.session.getCollectionService().getCollectionItemList({
      category: e,
      groupId: -1,
      forceSync: !0,
      forceFromDb: !1,
      timeStamp: "0",
      count: n,
      searchDown: !0
    });
  }
}
var rs = /* @__PURE__ */ ((t) => (t[t.KUNKNOWN = 0] = "KUNKNOWN", t[t.KANDROID = 1] = "KANDROID", t[t.KIOS = 2] = "KIOS", t[t.KWINDOWS = 3] = "KWINDOWS", t[t.KMAC = 4] = "KMAC", t[t.KLINUX = 5] = "KLINUX", t))(rs || {}), dM = /* @__PURE__ */ ((t) => (t[t.KNOSETONIOS = 0] = "KNOSETONIOS", t[t.KSUPPORTGOOGLEPUSH = 99] = "KSUPPORTGOOGLEPUSH", t[t.KSUPPORTHMS = 3] = "KSUPPORTHMS", t[t.KSUPPORTOPPOPUSH = 4] = "KSUPPORTOPPOPUSH", t[t.KSUPPORTTPNS = 2] = "KSUPPORTTPNS", t[t.KSUPPORTVIVOPUSH = 5] = "KSUPPORTVIVOPUSH", t[t.KUNSUPPORTANDROIDPUSH = 1] = "KUNSUPPORTANDROIDPUSH", t))(dM || {});
let Kw;
try {
  Kw = dt.hostname();
} catch {
  Kw = "NapCat";
}
const JV = dt.homedir(), dN = dt.platform();
dt.arch();
const Dm = dt.release(), fM = Kw;
xe.join(JV, "Downloads");
const fN = dt.type();
class XV {
  WrapperSession;
  // WrapperSession
  listenerManager = /* @__PURE__ */ new Map();
  // ListenerName-Unique -> Listener实例
  EventTask = /* @__PURE__ */ new Map();
  // tasks ListenerMainName -> ListenerSubName-> uuid -> {timeout,createtime,func}
  constructor(e) {
    this.WrapperSession = e;
  }
  createProxyDispatch(e) {
    const n = this.dispatcherListener.bind(this);
    return new Proxy(
      {},
      {
        get(r, i, o) {
          return typeof r[i] > "u" ? (...s) => {
            n(e, i, ...s).then();
          } : Reflect.get(r, i, o);
        }
      }
    );
  }
  createEventFunction(e) {
    const n = e.split("/");
    if (n.length > 1) {
      const r = "get" + (n[0]?.replace("NodeIKernel", "") ?? ""), i = n[1], o = this.WrapperSession[r]?.();
      if (!o || !i)
        return;
      let s = o[i];
      return s = s?.bind(o), s || void 0;
    }
  }
  createListenerFunction(e, n = "") {
    const r = this.listenerManager.get(e + n);
    if (!r) {
      const i = this.createProxyDispatch(e), o = /^NodeIKernel(.*?)Listener$/.exec(e)[1], s = `NodeIKernel${o}Service/addKernel${o}Listener`;
      return this.createEventFunction(s)(i), this.listenerManager.set(e + n, i), i;
    }
    return r;
  }
  // 统一回调清理事件
  async dispatcherListener(e, n, ...r) {
    this.EventTask.get(e)?.get(n)?.forEach((i, o) => {
      if (i.createtime + i.timeout < Date.now()) {
        this.EventTask.get(e)?.get(n)?.delete(o);
        return;
      }
      i?.checker?.(...r) && i.func(...r);
    });
  }
  async callNoListenerEvent(e, ...n) {
    return this.createEventFunction(e)(...n);
  }
  async registerListen(e, n, r = 1, i = 5e3) {
    return new Promise((o, s) => {
      const a = e.split("/"), c = a[0] ?? "", u = a[1] ?? "", l = Do();
      let d = 0, f;
      function m() {
        d === 0 ? s(new Error(" ListenerName:" + e + " timeout")) : o(f);
      }
      const h = setTimeout(m, i), y = {
        timeout: i,
        createtime: Date.now(),
        checker: n,
        func: (...x) => {
          d++, f = x, d >= r && (clearTimeout(h), m());
        }
      };
      this.EventTask.get(c) || this.EventTask.set(c, /* @__PURE__ */ new Map()), this.EventTask.get(c)?.get(u) || this.EventTask.get(c)?.set(u, /* @__PURE__ */ new Map()), this.EventTask.get(c)?.get(u)?.set(l, y), this.createListenerFunction(c);
    });
  }
  async callNormalEventV2(e, n, r, i = () => !0, o = () => !0, s = 1, a = 5e3) {
    const c = Do();
    let u = 0, l, d = {};
    function f(x, g) {
      u === 0 ? g(
        new Error(
          "Timeout: NTEvent serviceAndMethod:" + e + " ListenerName:" + n + ` EventRet:
` + JSON.stringify(d, null, 4) + `
`
        )
      ) : x([d, ...l]);
    }
    const m = n.split("/"), h = m[0] ?? "", y = m[1] ?? "";
    return new Promise(
      (x, g) => {
        const v = setTimeout(() => f(x, g), a), S = {
          timeout: a,
          createtime: Date.now(),
          checker: o,
          func: (...j) => {
            u++, l = j, u >= s && (clearTimeout(v), f(x, g));
          }
        };
        this.EventTask.get(h) || this.EventTask.set(h, /* @__PURE__ */ new Map()), this.EventTask.get(h)?.get(y) || this.EventTask.get(h)?.set(y, /* @__PURE__ */ new Map()), this.EventTask.get(h)?.get(y)?.set(c, S), this.createListenerFunction(h);
        const E = this.createEventFunction(e)(...r), T = (j) => {
          d = j, !i(d) && v.hasRef() && (clearTimeout(v), g(
            new Error(
              "EventChecker Failed: NTEvent serviceAndMethod:" + e + " ListenerName:" + n + ` EventRet:
` + JSON.stringify(d, null, 4) + `
`
            )
          ));
        };
        E instanceof Promise ? E.then((j) => {
          T(j);
        }).catch(g) : T(E);
      }
    );
  }
}
function ZV(t, e, n) {
  return new Proxy(e, {
    get(r, i, o) {
      const s = Reflect.get(r, i, o);
      if (typeof s != "function")
        return s;
      const a = i;
      return function(...c) {
        const u = `${t}/${a}`;
        try {
          const l = n.createEventFunction(u);
          if (l)
            return l(...c);
        } catch {
        }
        return s.apply(e, c);
      };
    }
  });
}
function eY(t, e) {
  const n = /* @__PURE__ */ new Map();
  return new Proxy(t, {
    get(r, i, o) {
      const s = i;
      if (typeof s == "string" && s.startsWith("get") && s.endsWith("Service")) {
        const c = `NodeIKernel${s.slice(3)}`;
        return function() {
          if (n.has(c))
            return n.get(c);
          const l = Reflect.get(r, i, o).call(r);
          if (tY(c)) {
            const d = ZV(
              c,
              l,
              e
            );
            return n.set(c, d), d;
          }
          return n.set(c, l), l;
        };
      }
      return Reflect.get(r, i, o);
    }
  });
}
function tY(t) {
  return [
    "NodeIKernelAvatarService",
    "NodeIKernelBuddyService",
    "NodeIKernelFileAssistantService",
    "NodeIKernelGroupService",
    "NodeIKernelLoginService",
    "NodeIKernelMsgService",
    "NodeIKernelOnlineStatusService",
    "NodeIKernelProfileLikeService",
    "NodeIKernelProfileService",
    "NodeIKernelTicketService",
    "NodeIKernelStorageCleanService",
    "NodeIKernelRobotService",
    "NodeIKernelRichMediaService",
    "NodeIKernelDbToolsService",
    "NodeIKernelTipOffService",
    "NodeIKernelSearchService",
    "NodeIKernelCollectionService"
  ].includes(t);
}
var nY = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/, rY = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/, iY = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/, ux = {
  Space_Separator: nY,
  ID_Start: rY,
  ID_Continue: iY
}, cn = {
  isSpaceSeparator(t) {
    return typeof t == "string" && ux.Space_Separator.test(t);
  },
  isIdStartChar(t) {
    return typeof t == "string" && (t >= "a" && t <= "z" || t >= "A" && t <= "Z" || t === "$" || t === "_" || ux.ID_Start.test(t));
  },
  isIdContinueChar(t) {
    return typeof t == "string" && (t >= "a" && t <= "z" || t >= "A" && t <= "Z" || t >= "0" && t <= "9" || t === "$" || t === "_" || t === "‌" || t === "‍" || ux.ID_Continue.test(t));
  },
  isDigit(t) {
    return typeof t == "string" && /[0-9]/.test(t);
  },
  isHexDigit(t) {
    return typeof t == "string" && /[0-9A-Fa-f]/.test(t);
  }
};
let Vw, Ar, es, Fm, na, Wi, Ln, RE, Mp;
var oY = function(e, n) {
  Vw = String(e), Ar = "start", es = [], Fm = 0, na = 1, Wi = 0, Ln = void 0, RE = void 0, Mp = void 0;
  do
    Ln = sY(), uY[Ar]();
  while (Ln.type !== "eof");
  return typeof n == "function" ? Yw({ "": Mp }, "", n) : Mp;
};
function Yw(t, e, n) {
  const r = t[e];
  if (r != null && typeof r == "object")
    if (Array.isArray(r))
      for (let i = 0; i < r.length; i++) {
        const o = String(i), s = Yw(r, o, n);
        s === void 0 ? delete r[o] : Object.defineProperty(r, o, {
          value: s,
          writable: !0,
          enumerable: !0,
          configurable: !0
        });
      }
    else
      for (const i in r) {
        const o = Yw(r, i, n);
        o === void 0 ? delete r[i] : Object.defineProperty(r, i, {
          value: o,
          writable: !0,
          enumerable: !0,
          configurable: !0
        });
      }
  return n.call(t, e, r);
}
let ct, it, Yl, Vo, xt;
function sY() {
  for (ct = "default", it = "", Yl = !1, Vo = 1; ; ) {
    xt = us();
    const t = hM[ct]();
    if (t)
      return t;
  }
}
function us() {
  if (Vw[Fm])
    return String.fromCodePoint(Vw.codePointAt(Fm));
}
function ye() {
  const t = us();
  return t === `
` ? (na++, Wi = 0) : t ? Wi += t.length : Wi++, t && (Fm += t.length), t;
}
const hM = {
  default() {
    switch (xt) {
      case "	":
      case "\v":
      case "\f":
      case " ":
      case " ":
      case "\uFEFF":
      case `
`:
      case "\r":
      case "\u2028":
      case "\u2029":
        ye();
        return;
      case "/":
        ye(), ct = "comment";
        return;
      case void 0:
        return ye(), qt("eof");
    }
    if (cn.isSpaceSeparator(xt)) {
      ye();
      return;
    }
    return hM[Ar]();
  },
  comment() {
    switch (xt) {
      case "*":
        ye(), ct = "multiLineComment";
        return;
      case "/":
        ye(), ct = "singleLineComment";
        return;
    }
    throw Ht(ye());
  },
  multiLineComment() {
    switch (xt) {
      case "*":
        ye(), ct = "multiLineCommentAsterisk";
        return;
      case void 0:
        throw Ht(ye());
    }
    ye();
  },
  multiLineCommentAsterisk() {
    switch (xt) {
      case "*":
        ye();
        return;
      case "/":
        ye(), ct = "default";
        return;
      case void 0:
        throw Ht(ye());
    }
    ye(), ct = "multiLineComment";
  },
  singleLineComment() {
    switch (xt) {
      case `
`:
      case "\r":
      case "\u2028":
      case "\u2029":
        ye(), ct = "default";
        return;
      case void 0:
        return ye(), qt("eof");
    }
    ye();
  },
  value() {
    switch (xt) {
      case "{":
      case "[":
        return qt("punctuator", ye());
      case "n":
        return ye(), Na("ull"), qt("null", null);
      case "t":
        return ye(), Na("rue"), qt("boolean", !0);
      case "f":
        return ye(), Na("alse"), qt("boolean", !1);
      case "-":
      case "+":
        ye() === "-" && (Vo = -1), ct = "sign";
        return;
      case ".":
        it = ye(), ct = "decimalPointLeading";
        return;
      case "0":
        it = ye(), ct = "zero";
        return;
      case "1":
      case "2":
      case "3":
      case "4":
      case "5":
      case "6":
      case "7":
      case "8":
      case "9":
        it = ye(), ct = "decimalInteger";
        return;
      case "I":
        return ye(), Na("nfinity"), qt("numeric", 1 / 0);
      case "N":
        return ye(), Na("aN"), qt("numeric", NaN);
      case '"':
      case "'":
        Yl = ye() === '"', it = "", ct = "string";
        return;
    }
    throw Ht(ye());
  },
  identifierNameStartEscape() {
    if (xt !== "u")
      throw Ht(ye());
    ye();
    const t = Jw();
    switch (t) {
      case "$":
      case "_":
        break;
      default:
        if (!cn.isIdStartChar(t))
          throw hN();
        break;
    }
    it += t, ct = "identifierName";
  },
  identifierName() {
    switch (xt) {
      case "$":
      case "_":
      case "‌":
      case "‍":
        it += ye();
        return;
      case "\\":
        ye(), ct = "identifierNameEscape";
        return;
    }
    if (cn.isIdContinueChar(xt)) {
      it += ye();
      return;
    }
    return qt("identifier", it);
  },
  identifierNameEscape() {
    if (xt !== "u")
      throw Ht(ye());
    ye();
    const t = Jw();
    switch (t) {
      case "$":
      case "_":
      case "‌":
      case "‍":
        break;
      default:
        if (!cn.isIdContinueChar(t))
          throw hN();
        break;
    }
    it += t, ct = "identifierName";
  },
  sign() {
    switch (xt) {
      case ".":
        it = ye(), ct = "decimalPointLeading";
        return;
      case "0":
        it = ye(), ct = "zero";
        return;
      case "1":
      case "2":
      case "3":
      case "4":
      case "5":
      case "6":
      case "7":
      case "8":
      case "9":
        it = ye(), ct = "decimalInteger";
        return;
      case "I":
        return ye(), Na("nfinity"), qt("numeric", Vo * (1 / 0));
      case "N":
        return ye(), Na("aN"), qt("numeric", NaN);
    }
    throw Ht(ye());
  },
  zero() {
    switch (xt) {
      case ".":
        it += ye(), ct = "decimalPoint";
        return;
      case "e":
      case "E":
        it += ye(), ct = "decimalExponent";
        return;
      case "x":
      case "X":
        it += ye(), ct = "hexadecimal";
        return;
    }
    return qt("numeric", Vo * 0);
  },
  decimalInteger() {
    switch (xt) {
      case ".":
        it += ye(), ct = "decimalPoint";
        return;
      case "e":
      case "E":
        it += ye(), ct = "decimalExponent";
        return;
    }
    if (cn.isDigit(xt)) {
      it += ye();
      return;
    }
    return qt("numeric", Vo * Number(it));
  },
  decimalPointLeading() {
    if (cn.isDigit(xt)) {
      it += ye(), ct = "decimalFraction";
      return;
    }
    throw Ht(ye());
  },
  decimalPoint() {
    switch (xt) {
      case "e":
      case "E":
        it += ye(), ct = "decimalExponent";
        return;
    }
    if (cn.isDigit(xt)) {
      it += ye(), ct = "decimalFraction";
      return;
    }
    return qt("numeric", Vo * Number(it));
  },
  decimalFraction() {
    switch (xt) {
      case "e":
      case "E":
        it += ye(), ct = "decimalExponent";
        return;
    }
    if (cn.isDigit(xt)) {
      it += ye();
      return;
    }
    return qt("numeric", Vo * Number(it));
  },
  decimalExponent() {
    switch (xt) {
      case "+":
      case "-":
        it += ye(), ct = "decimalExponentSign";
        return;
    }
    if (cn.isDigit(xt)) {
      it += ye(), ct = "decimalExponentInteger";
      return;
    }
    throw Ht(ye());
  },
  decimalExponentSign() {
    if (cn.isDigit(xt)) {
      it += ye(), ct = "decimalExponentInteger";
      return;
    }
    throw Ht(ye());
  },
  decimalExponentInteger() {
    if (cn.isDigit(xt)) {
      it += ye();
      return;
    }
    return qt("numeric", Vo * Number(it));
  },
  hexadecimal() {
    if (cn.isHexDigit(xt)) {
      it += ye(), ct = "hexadecimalInteger";
      return;
    }
    throw Ht(ye());
  },
  hexadecimalInteger() {
    if (cn.isHexDigit(xt)) {
      it += ye();
      return;
    }
    return qt("numeric", Vo * Number(it));
  },
  string() {
    switch (xt) {
      case "\\":
        ye(), it += aY();
        return;
      case '"':
        if (Yl)
          return ye(), qt("string", it);
        it += ye();
        return;
      case "'":
        if (!Yl)
          return ye(), qt("string", it);
        it += ye();
        return;
      case `
`:
      case "\r":
        throw Ht(ye());
      case "\u2028":
      case "\u2029":
        lY(xt);
        break;
      case void 0:
        throw Ht(ye());
    }
    it += ye();
  },
  start() {
    switch (xt) {
      case "{":
      case "[":
        return qt("punctuator", ye());
    }
    ct = "value";
  },
  beforePropertyName() {
    switch (xt) {
      case "$":
      case "_":
        it = ye(), ct = "identifierName";
        return;
      case "\\":
        ye(), ct = "identifierNameStartEscape";
        return;
      case "}":
        return qt("punctuator", ye());
      case '"':
      case "'":
        Yl = ye() === '"', ct = "string";
        return;
    }
    if (cn.isIdStartChar(xt)) {
      it += ye(), ct = "identifierName";
      return;
    }
    throw Ht(ye());
  },
  afterPropertyName() {
    if (xt === ":")
      return qt("punctuator", ye());
    throw Ht(ye());
  },
  beforePropertyValue() {
    ct = "value";
  },
  afterPropertyValue() {
    switch (xt) {
      case ",":
      case "}":
        return qt("punctuator", ye());
    }
    throw Ht(ye());
  },
  beforeArrayValue() {
    if (xt === "]")
      return qt("punctuator", ye());
    ct = "value";
  },
  afterArrayValue() {
    switch (xt) {
      case ",":
      case "]":
        return qt("punctuator", ye());
    }
    throw Ht(ye());
  },
  end() {
    throw Ht(ye());
  }
};
function qt(t, e) {
  return {
    type: t,
    value: e,
    line: na,
    column: Wi
  };
}
function Na(t) {
  for (const e of t) {
    if (us() !== e)
      throw Ht(ye());
    ye();
  }
}
function aY() {
  switch (us()) {
    case "b":
      return ye(), "\b";
    case "f":
      return ye(), "\f";
    case "n":
      return ye(), `
`;
    case "r":
      return ye(), "\r";
    case "t":
      return ye(), "	";
    case "v":
      return ye(), "\v";
    case "0":
      if (ye(), cn.isDigit(us()))
        throw Ht(ye());
      return "\0";
    case "x":
      return ye(), cY();
    case "u":
      return ye(), Jw();
    case `
`:
    case "\u2028":
    case "\u2029":
      return ye(), "";
    case "\r":
      return ye(), us() === `
` && ye(), "";
    case "1":
    case "2":
    case "3":
    case "4":
    case "5":
    case "6":
    case "7":
    case "8":
    case "9":
      throw Ht(ye());
    case void 0:
      throw Ht(ye());
  }
  return ye();
}
function cY() {
  let t = "", e = us();
  if (!cn.isHexDigit(e) || (t += ye(), e = us(), !cn.isHexDigit(e)))
    throw Ht(ye());
  return t += ye(), String.fromCodePoint(parseInt(t, 16));
}
function Jw() {
  let t = "", e = 4;
  for (; e-- > 0; ) {
    const n = us();
    if (!cn.isHexDigit(n))
      throw Ht(ye());
    t += ye();
  }
  return String.fromCodePoint(parseInt(t, 16));
}
const uY = {
  start() {
    if (Ln.type === "eof")
      throw Pa();
    lx();
  },
  beforePropertyName() {
    switch (Ln.type) {
      case "identifier":
      case "string":
        RE = Ln.value, Ar = "afterPropertyName";
        return;
      case "punctuator":
        _h();
        return;
      case "eof":
        throw Pa();
    }
  },
  afterPropertyName() {
    if (Ln.type === "eof")
      throw Pa();
    Ar = "beforePropertyValue";
  },
  beforePropertyValue() {
    if (Ln.type === "eof")
      throw Pa();
    lx();
  },
  beforeArrayValue() {
    if (Ln.type === "eof")
      throw Pa();
    if (Ln.type === "punctuator" && Ln.value === "]") {
      _h();
      return;
    }
    lx();
  },
  afterPropertyValue() {
    if (Ln.type === "eof")
      throw Pa();
    switch (Ln.value) {
      case ",":
        Ar = "beforePropertyName";
        return;
      case "}":
        _h();
    }
  },
  afterArrayValue() {
    if (Ln.type === "eof")
      throw Pa();
    switch (Ln.value) {
      case ",":
        Ar = "beforeArrayValue";
        return;
      case "]":
        _h();
    }
  },
  end() {
  }
};
function lx() {
  let t;
  switch (Ln.type) {
    case "punctuator":
      switch (Ln.value) {
        case "{":
          t = {};
          break;
        case "[":
          t = [];
          break;
      }
      break;
    case "null":
    case "boolean":
    case "numeric":
    case "string":
      t = Ln.value;
      break;
  }
  if (Mp === void 0)
    Mp = t;
  else {
    const e = es[es.length - 1];
    Array.isArray(e) ? e.push(t) : Object.defineProperty(e, RE, {
      value: t,
      writable: !0,
      enumerable: !0,
      configurable: !0
    });
  }
  if (t !== null && typeof t == "object")
    es.push(t), Array.isArray(t) ? Ar = "beforeArrayValue" : Ar = "beforePropertyName";
  else {
    const e = es[es.length - 1];
    e == null ? Ar = "end" : Array.isArray(e) ? Ar = "afterArrayValue" : Ar = "afterPropertyValue";
  }
}
function _h() {
  es.pop();
  const t = es[es.length - 1];
  t == null ? Ar = "end" : Array.isArray(t) ? Ar = "afterArrayValue" : Ar = "afterPropertyValue";
}
function Ht(t) {
  return Om(t === void 0 ? `JSON5: invalid end of input at ${na}:${Wi}` : `JSON5: invalid character '${mM(t)}' at ${na}:${Wi}`);
}
function Pa() {
  return Om(`JSON5: invalid end of input at ${na}:${Wi}`);
}
function hN() {
  return Wi -= 5, Om(`JSON5: invalid identifier character at ${na}:${Wi}`);
}
function lY(t) {
  console.warn(`JSON5: '${mM(t)}' in strings is not valid ECMAScript; consider escaping`);
}
function mM(t) {
  const e = {
    "'": "\\'",
    '"': '\\"',
    "\\": "\\\\",
    "\b": "\\b",
    "\f": "\\f",
    "\n": "\\n",
    "\r": "\\r",
    "	": "\\t",
    "\v": "\\v",
    "\0": "\\0",
    "\u2028": "\\u2028",
    "\u2029": "\\u2029"
  };
  if (e[t])
    return e[t];
  if (t < " ") {
    const n = t.charCodeAt(0).toString(16);
    return "\\x" + ("00" + n).substring(n.length);
  }
  return t;
}
function Om(t) {
  const e = new SyntaxError(t);
  return e.lineNumber = na, e.columnNumber = Wi, e;
}
var pY = function(e, n, r) {
  const i = [];
  let o = "", s, a, c = "", u;
  if (n != null && typeof n == "object" && !Array.isArray(n) && (r = n.space, u = n.quote, n = n.replacer), typeof n == "function")
    a = n;
  else if (Array.isArray(n)) {
    s = [];
    for (const y of n) {
      let x;
      typeof y == "string" ? x = y : (typeof y == "number" || y instanceof String || y instanceof Number) && (x = String(y)), x !== void 0 && s.indexOf(x) < 0 && s.push(x);
    }
  }
  return r instanceof Number ? r = Number(r) : r instanceof String && (r = String(r)), typeof r == "number" ? r > 0 && (r = Math.min(10, Math.floor(r)), c = "          ".substr(0, r)) : typeof r == "string" && (c = r.substr(0, 10)), l("", { "": e });
  function l(y, x) {
    let g = x[y];
    switch (g != null && (typeof g.toJSON5 == "function" ? g = g.toJSON5(y) : typeof g.toJSON == "function" && (g = g.toJSON(y))), a && (g = a.call(x, y, g)), g instanceof Number ? g = Number(g) : g instanceof String ? g = String(g) : g instanceof Boolean && (g = g.valueOf()), g) {
      case null:
        return "null";
      case !0:
        return "true";
      case !1:
        return "false";
    }
    if (typeof g == "string")
      return d(g);
    if (typeof g == "number")
      return String(g);
    if (typeof g == "object")
      return Array.isArray(g) ? h(g) : f(g);
  }
  function d(y) {
    const x = {
      "'": 0.1,
      '"': 0.2
    }, g = {
      "'": "\\'",
      '"': '\\"',
      "\\": "\\\\",
      "\b": "\\b",
      "\f": "\\f",
      "\n": "\\n",
      "\r": "\\r",
      "	": "\\t",
      "\v": "\\v",
      "\0": "\\0",
      "\u2028": "\\u2028",
      "\u2029": "\\u2029"
    };
    let v = "";
    for (let E = 0; E < y.length; E++) {
      const T = y[E];
      switch (T) {
        case "'":
        case '"':
          x[T]++, v += T;
          continue;
        case "\0":
          if (cn.isDigit(y[E + 1])) {
            v += "\\x00";
            continue;
          }
      }
      if (g[T]) {
        v += g[T];
        continue;
      }
      if (T < " ") {
        let j = T.charCodeAt(0).toString(16);
        v += "\\x" + ("00" + j).substring(j.length);
        continue;
      }
      v += T;
    }
    const S = u || Object.keys(x).reduce((E, T) => x[E] < x[T] ? E : T);
    return v = v.replace(new RegExp(S, "g"), g[S]), S + v + S;
  }
  function f(y) {
    if (i.indexOf(y) >= 0)
      throw TypeError("Converting circular structure to JSON5");
    i.push(y);
    let x = o;
    o = o + c;
    let g = s || Object.keys(y), v = [];
    for (const E of g) {
      const T = l(E, y);
      if (T !== void 0) {
        let j = m(E) + ":";
        c !== "" && (j += " "), j += T, v.push(j);
      }
    }
    let S;
    if (v.length === 0)
      S = "{}";
    else {
      let E;
      if (c === "")
        E = v.join(","), S = "{" + E + "}";
      else {
        let T = `,
` + o;
        E = v.join(T), S = `{
` + o + E + `,
` + x + "}";
      }
    }
    return i.pop(), o = x, S;
  }
  function m(y) {
    if (y.length === 0)
      return d(y);
    const x = String.fromCodePoint(y.codePointAt(0));
    if (!cn.isIdStartChar(x))
      return d(y);
    for (let g = x.length; g < y.length; g++)
      if (!cn.isIdContinueChar(String.fromCodePoint(y.codePointAt(g))))
        return d(y);
    return y;
  }
  function h(y) {
    if (i.indexOf(y) >= 0)
      throw TypeError("Converting circular structure to JSON5");
    i.push(y);
    let x = o;
    o = o + c;
    let g = [];
    for (let S = 0; S < y.length; S++) {
      const E = l(String(S), y);
      g.push(E !== void 0 ? E : "null");
    }
    let v;
    if (g.length === 0)
      v = "[]";
    else if (c === "")
      v = "[" + g.join(",") + "]";
    else {
      let S = `,
` + o, E = g.join(S);
      v = `[
` + o + E + `,
` + x + "]";
    }
    return i.pop(), o = x, v;
  }
};
const dY = {
  parse: oY,
  stringify: pY
};
var Ci = dY;
function gM(t) {
  return Pt(t) && globalThis.Symbol.asyncIterator in t;
}
function yM(t) {
  return Pt(t) && globalThis.Symbol.iterator in t;
}
function vM(t) {
  return t instanceof globalThis.Promise;
}
function Yu(t) {
  return t instanceof Date && globalThis.Number.isFinite(t.getTime());
}
function fY(t) {
  return t instanceof globalThis.Map;
}
function hY(t) {
  return t instanceof globalThis.Set;
}
function mY(t) {
  return globalThis.ArrayBuffer.isView(t);
}
function BE(t) {
  return t instanceof globalThis.Uint8Array;
}
function lt(t, e) {
  return e in t;
}
function Pt(t) {
  return t !== null && typeof t == "object";
}
function Lt(t) {
  return globalThis.Array.isArray(t) && !globalThis.ArrayBuffer.isView(t);
}
function zr(t) {
  return t === void 0;
}
function Md(t) {
  return t === null;
}
function Ju(t) {
  return typeof t == "boolean";
}
function Je(t) {
  return typeof t == "number";
}
function bM(t) {
  return globalThis.Number.isInteger(t);
}
function _i(t) {
  return typeof t == "bigint";
}
function Ut(t) {
  return typeof t == "string";
}
function e0(t) {
  return typeof t == "function";
}
function Rd(t) {
  return typeof t == "symbol";
}
function UE(t) {
  return _i(t) || Ju(t) || Md(t) || Je(t) || Ut(t) || Rd(t) || zr(t);
}
var bn;
(function(t) {
  t.InstanceMode = "default", t.ExactOptionalPropertyTypes = !1, t.AllowArrayObject = !1, t.AllowNaN = !1, t.AllowNullVoid = !1;
  function e(s, a) {
    return t.ExactOptionalPropertyTypes ? a in s : s[a] !== void 0;
  }
  t.IsExactOptionalProperty = e;
  function n(s) {
    const a = Pt(s);
    return t.AllowArrayObject ? a : a && !Lt(s);
  }
  t.IsObjectLike = n;
  function r(s) {
    return n(s) && !(s instanceof Date) && !(s instanceof Uint8Array);
  }
  t.IsRecordLike = r;
  function i(s) {
    return t.AllowNaN ? Je(s) : Number.isFinite(s);
  }
  t.IsNumberLike = i;
  function o(s) {
    const a = zr(s);
    return t.AllowNullVoid ? a || s === null : a;
  }
  t.IsVoidLike = o;
})(bn || (bn = {}));
const xM = /* @__PURE__ */ new Map();
function LE(t) {
  return xM.has(t);
}
function jE(t) {
  return xM.get(t);
}
const wM = /* @__PURE__ */ new Map();
function hu(t) {
  return wM.has(t);
}
function QE(t) {
  return wM.get(t);
}
function gY(t) {
  return Sn(t) && !Kr(t) && !Ud(t) && Symbol.asyncIterator in t;
}
function Kr(t) {
  return Array.isArray(t);
}
function SM(t) {
  return typeof t == "bigint";
}
function Bd(t) {
  return typeof t == "boolean";
}
function $E(t) {
  return t instanceof globalThis.Date;
}
function yY(t) {
  return typeof t == "function";
}
function vY(t) {
  return Sn(t) && !Kr(t) && !Ud(t) && Symbol.iterator in t;
}
function bY(t) {
  return t === null;
}
function Oo(t) {
  return typeof t == "number";
}
function Sn(t) {
  return typeof t == "object" && t !== null;
}
function _M(t) {
  return t instanceof globalThis.RegExp;
}
function hn(t) {
  return typeof t == "string";
}
function xY(t) {
  return typeof t == "symbol";
}
function Ud(t) {
  return t instanceof globalThis.Uint8Array;
}
function gn(t) {
  return t === void 0;
}
function wY(t) {
  return globalThis.Object.freeze(t).map((e) => Mm(e));
}
function SY(t) {
  const e = {};
  for (const n of Object.getOwnPropertyNames(t))
    e[n] = Mm(t[n]);
  for (const n of Object.getOwnPropertySymbols(t))
    e[n] = Mm(t[n]);
  return globalThis.Object.freeze(e);
}
function Mm(t) {
  return Kr(t) ? wY(t) : $E(t) ? t : Ud(t) ? t : _M(t) ? t : Sn(t) ? SY(t) : t;
}
function _Y(t) {
  return t.map((e) => Rm(e));
}
function EY(t) {
  return new Date(t.getTime());
}
function AY(t) {
  return new Uint8Array(t);
}
function IY(t) {
  return new RegExp(t.source, t.flags);
}
function CY(t) {
  const e = {};
  for (const n of Object.getOwnPropertyNames(t))
    e[n] = Rm(t[n]);
  for (const n of Object.getOwnPropertySymbols(t))
    e[n] = Rm(t[n]);
  return e;
}
function Rm(t) {
  return Kr(t) ? _Y(t) : $E(t) ? EY(t) : Ud(t) ? AY(t) : _M(t) ? IY(t) : Sn(t) ? CY(t) : t;
}
function si(t) {
  return Rm(t);
}
function ke(t, e) {
  const n = e !== void 0 ? { ...e, ...t } : t;
  switch (bn.InstanceMode) {
    case "freeze":
      return Mm(n);
    case "clone":
      return si(n);
    default:
      return n;
  }
}
const Ur = Symbol.for("TypeBox.Transform"), Ld = Symbol.for("TypeBox.Readonly"), ws = Symbol.for("TypeBox.Optional"), t0 = Symbol.for("TypeBox.Hint"), Ee = Symbol.for("TypeBox.Kind");
function TY(t = {}) {
  return ke({ [Ee]: t[Ee] ?? "Unsafe" }, t);
}
class mn extends Error {
  constructor(e) {
    super(e);
  }
}
function pr(t) {
  return ke({
    [Ee]: "MappedResult",
    properties: t
  });
}
function kY(t, e) {
  const { [e]: n, ...r } = t;
  return r;
}
function ai(t, e) {
  return e.reduce((n, r) => kY(n, r), t);
}
function GE(t, e) {
  return ke({ [Ee]: "Array", type: "array", items: t }, e);
}
function qE(t, e) {
  return ke({ [Ee]: "AsyncIterator", type: "AsyncIterator", items: t }, e);
}
function HE(t, e, n) {
  return ke({ [Ee]: "Constructor", type: "Constructor", parameters: t, returns: e }, n);
}
function jd(t, e, n) {
  return ke({ [Ee]: "Function", type: "Function", parameters: t, returns: e }, n);
}
function Fn(t, e, n) {
  return ke({ [Ee]: "Computed", target: t, parameters: e }, n);
}
function en(t) {
  return ke({ [Ee]: "Never", not: {} }, t);
}
function WE(t) {
  return Sn(t) && t[Ld] === "Readonly";
}
function ha(t) {
  return Sn(t) && t[ws] === "Optional";
}
function EM(t) {
  return wt(t, "Any");
}
function AM(t) {
  return wt(t, "Argument");
}
function Xu(t) {
  return wt(t, "Array");
}
function n0(t) {
  return wt(t, "AsyncIterator");
}
function r0(t) {
  return wt(t, "BigInt");
}
function Qd(t) {
  return wt(t, "Boolean");
}
function Zu(t) {
  return wt(t, "Computed");
}
function el(t) {
  return wt(t, "Constructor");
}
function NY(t) {
  return wt(t, "Date");
}
function tl(t) {
  return wt(t, "Function");
}
function nl(t) {
  return wt(t, "Integer");
}
function Fi(t) {
  return wt(t, "Intersect");
}
function i0(t) {
  return wt(t, "Iterator");
}
function wt(t, e) {
  return Sn(t) && Ee in t && t[Ee] === e;
}
function IM(t) {
  return Bd(t) || Oo(t) || hn(t);
}
function vc(t) {
  return wt(t, "Literal");
}
function bc(t) {
  return wt(t, "MappedKey");
}
function fi(t) {
  return wt(t, "MappedResult");
}
function $d(t) {
  return wt(t, "Never");
}
function PY(t) {
  return wt(t, "Not");
}
function zE(t) {
  return wt(t, "Null");
}
function rl(t) {
  return wt(t, "Number");
}
function ho(t) {
  return wt(t, "Object");
}
function o0(t) {
  return wt(t, "Promise");
}
function s0(t) {
  return wt(t, "Record");
}
function Gr(t) {
  return wt(t, "Ref");
}
function CM(t) {
  return wt(t, "RegExp");
}
function Gd(t) {
  return wt(t, "String");
}
function KE(t) {
  return wt(t, "Symbol");
}
function xc(t) {
  return wt(t, "TemplateLiteral");
}
function DY(t) {
  return wt(t, "This");
}
function Qt(t) {
  return Sn(t) && Ur in t;
}
function wc(t) {
  return wt(t, "Tuple");
}
function qd(t) {
  return wt(t, "Undefined");
}
function Yn(t) {
  return wt(t, "Union");
}
function FY(t) {
  return wt(t, "Uint8Array");
}
function OY(t) {
  return wt(t, "Unknown");
}
function MY(t) {
  return wt(t, "Unsafe");
}
function RY(t) {
  return wt(t, "Void");
}
function il(t) {
  return Sn(t) && Ee in t && hn(t[Ee]);
}
function Ir(t) {
  return EM(t) || AM(t) || Xu(t) || Qd(t) || r0(t) || n0(t) || Zu(t) || el(t) || NY(t) || tl(t) || nl(t) || Fi(t) || i0(t) || vc(t) || bc(t) || fi(t) || $d(t) || PY(t) || zE(t) || rl(t) || ho(t) || o0(t) || s0(t) || Gr(t) || CM(t) || Gd(t) || KE(t) || xc(t) || DY(t) || wc(t) || qd(t) || Yn(t) || FY(t) || OY(t) || MY(t) || RY(t) || il(t);
}
function BY(t) {
  return ke(ai(t, [ws]));
}
function UY(t) {
  return ke({ ...t, [ws]: "Optional" });
}
function LY(t, e) {
  return e === !1 ? BY(t) : UY(t);
}
function ma(t, e) {
  const n = e ?? !0;
  return fi(t) ? $Y(t, n) : LY(t, n);
}
function jY(t, e) {
  const n = {};
  for (const r of globalThis.Object.getOwnPropertyNames(t))
    n[r] = ma(t[r], e);
  return n;
}
function QY(t, e) {
  return jY(t.properties, e);
}
function $Y(t, e) {
  const n = QY(t, e);
  return pr(n);
}
function Xw(t, e = {}) {
  const n = t.every((i) => ho(i)), r = Ir(e.unevaluatedProperties) ? { unevaluatedProperties: e.unevaluatedProperties } : {};
  return ke(e.unevaluatedProperties === !1 || Ir(e.unevaluatedProperties) || n ? { ...r, [Ee]: "Intersect", type: "object", allOf: t } : { ...r, [Ee]: "Intersect", allOf: t }, e);
}
function GY(t) {
  return t.every((e) => ha(e));
}
function qY(t) {
  return ai(t, [ws]);
}
function mN(t) {
  return t.map((e) => ha(e) ? qY(e) : e);
}
function HY(t, e) {
  return GY(t) ? ma(Xw(mN(t), e)) : Xw(mN(t), e);
}
function TM(t, e = {}) {
  if (t.length === 1)
    return ke(t[0], e);
  if (t.length === 0)
    return en(e);
  if (t.some((n) => Qt(n)))
    throw new Error("Cannot intersect transform types");
  return HY(t, e);
}
function ga(t, e) {
  if (t.length === 1)
    return ke(t[0], e);
  if (t.length === 0)
    return en(e);
  if (t.some((n) => Qt(n)))
    throw new Error("Cannot intersect transform types");
  return Xw(t, e);
}
function Zw(t, e) {
  return ke({ [Ee]: "Union", anyOf: t }, e);
}
function WY(t) {
  return t.some((e) => ha(e));
}
function gN(t) {
  return t.map((e) => ha(e) ? zY(e) : e);
}
function zY(t) {
  return ai(t, [ws]);
}
function KY(t, e) {
  return WY(t) ? ma(Zw(gN(t), e)) : Zw(gN(t), e);
}
function ol(t, e) {
  return t.length === 1 ? ke(t[0], e) : t.length === 0 ? en(e) : KY(t, e);
}
function dr(t, e) {
  return t.length === 0 ? en(e) : t.length === 1 ? ke(t[0], e) : Zw(t, e);
}
class yN extends mn {
}
function VY(t) {
  return t.replace(/\\\$/g, "$").replace(/\\\*/g, "*").replace(/\\\^/g, "^").replace(/\\\|/g, "|").replace(/\\\(/g, "(").replace(/\\\)/g, ")");
}
function VE(t, e, n) {
  return t[e] === n && t.charCodeAt(e - 1) !== 92;
}
function is(t, e) {
  return VE(t, e, "(");
}
function Vp(t, e) {
  return VE(t, e, ")");
}
function kM(t, e) {
  return VE(t, e, "|");
}
function YY(t) {
  if (!(is(t, 0) && Vp(t, t.length - 1)))
    return !1;
  let e = 0;
  for (let n = 0; n < t.length; n++)
    if (is(t, n) && (e += 1), Vp(t, n) && (e -= 1), e === 0 && n !== t.length - 1)
      return !1;
  return !0;
}
function JY(t) {
  return t.slice(1, t.length - 1);
}
function XY(t) {
  let e = 0;
  for (let n = 0; n < t.length; n++)
    if (is(t, n) && (e += 1), Vp(t, n) && (e -= 1), kM(t, n) && e === 0)
      return !0;
  return !1;
}
function ZY(t) {
  for (let e = 0; e < t.length; e++)
    if (is(t, e))
      return !0;
  return !1;
}
function eJ(t) {
  let [e, n] = [0, 0];
  const r = [];
  for (let o = 0; o < t.length; o++)
    if (is(t, o) && (e += 1), Vp(t, o) && (e -= 1), kM(t, o) && e === 0) {
      const s = t.slice(n, o);
      s.length > 0 && r.push(mu(s)), n = o + 1;
    }
  const i = t.slice(n);
  return i.length > 0 && r.push(mu(i)), r.length === 0 ? { type: "const", const: "" } : r.length === 1 ? r[0] : { type: "or", expr: r };
}
function tJ(t) {
  function e(i, o) {
    if (!is(i, o))
      throw new yN("TemplateLiteralParser: Index must point to open parens");
    let s = 0;
    for (let a = o; a < i.length; a++)
      if (is(i, a) && (s += 1), Vp(i, a) && (s -= 1), s === 0)
        return [o, a];
    throw new yN("TemplateLiteralParser: Unclosed group parens in expression");
  }
  function n(i, o) {
    for (let s = o; s < i.length; s++)
      if (is(i, s))
        return [o, s];
    return [o, i.length];
  }
  const r = [];
  for (let i = 0; i < t.length; i++)
    if (is(t, i)) {
      const [o, s] = e(t, i), a = t.slice(o, s + 1);
      r.push(mu(a)), i = s;
    } else {
      const [o, s] = n(t, i), a = t.slice(o, s);
      a.length > 0 && r.push(mu(a)), i = s - 1;
    }
  return r.length === 0 ? { type: "const", const: "" } : r.length === 1 ? r[0] : { type: "and", expr: r };
}
function mu(t) {
  return YY(t) ? mu(JY(t)) : XY(t) ? eJ(t) : ZY(t) ? tJ(t) : { type: "const", const: VY(t) };
}
function YE(t) {
  return mu(t.slice(1, t.length - 1));
}
class nJ extends mn {
}
function rJ(t) {
  return t.type === "or" && t.expr.length === 2 && t.expr[0].type === "const" && t.expr[0].const === "0" && t.expr[1].type === "const" && t.expr[1].const === "[1-9][0-9]*";
}
function iJ(t) {
  return t.type === "or" && t.expr.length === 2 && t.expr[0].type === "const" && t.expr[0].const === "true" && t.expr[1].type === "const" && t.expr[1].const === "false";
}
function oJ(t) {
  return t.type === "const" && t.const === ".*";
}
function Yp(t) {
  return rJ(t) || oJ(t) ? !1 : iJ(t) ? !0 : t.type === "and" ? t.expr.every((e) => Yp(e)) : t.type === "or" ? t.expr.every((e) => Yp(e)) : t.type === "const" ? !0 : (() => {
    throw new nJ("Unknown expression type");
  })();
}
function NM(t) {
  const e = YE(t.pattern);
  return Yp(e);
}
class sJ extends mn {
}
function* PM(t) {
  if (t.length === 1)
    return yield* t[0];
  for (const e of t[0])
    for (const n of PM(t.slice(1)))
      yield `${e}${n}`;
}
function* aJ(t) {
  return yield* PM(t.expr.map((e) => [...a0(e)]));
}
function* cJ(t) {
  for (const e of t.expr)
    yield* a0(e);
}
function* uJ(t) {
  return yield t.const;
}
function* a0(t) {
  return t.type === "and" ? yield* aJ(t) : t.type === "or" ? yield* cJ(t) : t.type === "const" ? yield* uJ(t) : (() => {
    throw new sJ("Unknown expression");
  })();
}
function JE(t) {
  const e = YE(t.pattern);
  return Yp(e) ? [...a0(e)] : [];
}
function xn(t, e) {
  return ke({
    [Ee]: "Literal",
    const: t,
    type: typeof t
  }, e);
}
function DM(t) {
  return ke({ [Ee]: "Boolean", type: "boolean" }, t);
}
function XE(t) {
  return ke({ [Ee]: "BigInt", type: "bigint" }, t);
}
function Sc(t) {
  return ke({ [Ee]: "Number", type: "number" }, t);
}
function Ja(t) {
  return ke({ [Ee]: "String", type: "string" }, t);
}
function* lJ(t) {
  const e = t.trim().replace(/"|'/g, "");
  return e === "boolean" ? yield DM() : e === "number" ? yield Sc() : e === "bigint" ? yield XE() : e === "string" ? yield Ja() : yield (() => {
    const n = e.split("|").map((r) => xn(r.trim()));
    return n.length === 0 ? en() : n.length === 1 ? n[0] : ol(n);
  })();
}
function* pJ(t) {
  if (t[1] !== "{") {
    const e = xn("$"), n = eS(t.slice(1));
    return yield* [e, ...n];
  }
  for (let e = 2; e < t.length; e++)
    if (t[e] === "}") {
      const n = lJ(t.slice(2, e)), r = eS(t.slice(e + 1));
      return yield* [...n, ...r];
    }
  yield xn(t);
}
function* eS(t) {
  for (let e = 0; e < t.length; e++)
    if (t[e] === "$") {
      const n = xn(t.slice(0, e)), r = pJ(t.slice(e));
      return yield* [n, ...r];
    }
  yield xn(t);
}
function dJ(t) {
  return [...eS(t)];
}
const fJ = "(true|false)", im = "(0|[1-9][0-9]*)", FM = "(.*)", hJ = "(?!.*)", gu = `^${im}$`, yu = `^${FM}$`, mJ = `^${hJ}$`;
class gJ extends mn {
}
function yJ(t) {
  return t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
function OM(t, e) {
  return xc(t) ? t.pattern.slice(1, t.pattern.length - 1) : Yn(t) ? `(${t.anyOf.map((n) => OM(n, e)).join("|")})` : rl(t) ? `${e}${im}` : nl(t) ? `${e}${im}` : r0(t) ? `${e}${im}` : Gd(t) ? `${e}${FM}` : vc(t) ? `${e}${yJ(t.const.toString())}` : Qd(t) ? `${e}${fJ}` : (() => {
    throw new gJ(`Unexpected Kind '${t[Ee]}'`);
  })();
}
function vN(t) {
  return `^${t.map((e) => OM(e, "")).join("")}$`;
}
function Bm(t) {
  const n = JE(t).map((r) => xn(r));
  return ol(n);
}
function MM(t, e) {
  const n = hn(t) ? vN(dJ(t)) : vN(t);
  return ke({ [Ee]: "TemplateLiteral", type: "string", pattern: n }, e);
}
function vJ(t) {
  return JE(t).map((n) => n.toString());
}
function bJ(t) {
  const e = [];
  for (const n of t)
    e.push(...ya(n));
  return e;
}
function xJ(t) {
  return [t.toString()];
}
function ya(t) {
  return [...new Set(xc(t) ? vJ(t) : Yn(t) ? bJ(t.anyOf) : vc(t) ? xJ(t.const) : rl(t) ? ["[number]"] : nl(t) ? ["[number]"] : [])];
}
function wJ(t, e, n) {
  const r = {};
  for (const i of Object.getOwnPropertyNames(e))
    r[i] = c0(t, ya(e[i]), n);
  return r;
}
function SJ(t, e, n) {
  return wJ(t, e.properties, n);
}
function _J(t, e, n) {
  const r = SJ(t, e, n);
  return pr(r);
}
function RM(t, e) {
  return t.map((n) => BM(n, e));
}
function EJ(t) {
  return t.filter((e) => !$d(e));
}
function AJ(t, e) {
  return TM(EJ(RM(t, e)));
}
function IJ(t) {
  return t.some((e) => $d(e)) ? [] : t;
}
function CJ(t, e) {
  return ol(IJ(RM(t, e)));
}
function TJ(t, e) {
  return e in t ? t[e] : e === "[number]" ? ol(t) : en();
}
function kJ(t, e) {
  return e === "[number]" ? t : en();
}
function NJ(t, e) {
  return e in t ? t[e] : en();
}
function BM(t, e) {
  return Fi(t) ? AJ(t.allOf, e) : Yn(t) ? CJ(t.anyOf, e) : wc(t) ? TJ(t.items ?? [], e) : Xu(t) ? kJ(t.items, e) : ho(t) ? NJ(t.properties, e) : en();
}
function ZE(t, e) {
  return e.map((n) => BM(t, n));
}
function bN(t, e) {
  return ol(ZE(t, e));
}
function c0(t, e, n) {
  if (Gr(t) || Gr(e)) {
    const r = "Index types using Ref parameters require both Type and Key to be of TSchema";
    if (!Ir(t) || !Ir(e))
      throw new mn(r);
    return Fn("Index", [t, e]);
  }
  return fi(e) ? _J(t, e, n) : bc(e) ? OJ(t, e, n) : ke(Ir(e) ? bN(t, ya(e)) : bN(t, e), n);
}
function PJ(t, e, n) {
  return { [e]: c0(t, [e], si(n)) };
}
function DJ(t, e, n) {
  return e.reduce((r, i) => ({ ...r, ...PJ(t, i, n) }), {});
}
function FJ(t, e, n) {
  return DJ(t, e.keys, n);
}
function OJ(t, e, n) {
  const r = FJ(t, e, n);
  return pr(r);
}
function eA(t, e) {
  return ke({ [Ee]: "Iterator", type: "Iterator", items: t }, e);
}
function MJ(t) {
  const e = [];
  for (let n in t)
    ha(t[n]) || e.push(n);
  return e;
}
function RJ(t, e) {
  const n = MJ(t), r = n.length > 0 ? { [Ee]: "Object", type: "object", properties: t, required: n } : { [Ee]: "Object", type: "object", properties: t };
  return ke(r, e);
}
var Kn = RJ;
function UM(t, e) {
  return ke({ [Ee]: "Promise", type: "Promise", item: t }, e);
}
function BJ(t) {
  return ke(ai(t, [Ld]));
}
function UJ(t) {
  return ke({ ...t, [Ld]: "Readonly" });
}
function LJ(t, e) {
  return e === !1 ? BJ(t) : UJ(t);
}
function va(t, e) {
  const n = e ?? !0;
  return fi(t) ? $J(t, n) : LJ(t, n);
}
function jJ(t, e) {
  const n = {};
  for (const r of globalThis.Object.getOwnPropertyNames(t))
    n[r] = va(t[r], e);
  return n;
}
function QJ(t, e) {
  return jJ(t.properties, e);
}
function $J(t, e) {
  const n = QJ(t, e);
  return pr(n);
}
function sl(t, e) {
  return ke(t.length > 0 ? { [Ee]: "Tuple", type: "array", items: t, additionalItems: !1, minItems: t.length, maxItems: t.length } : { [Ee]: "Tuple", type: "array", minItems: t.length, maxItems: t.length }, e);
}
function GJ(t, e) {
  return t.includes(e);
}
function qJ(t) {
  return [...new Set(t)];
}
function HJ(t, e) {
  return t.filter((n) => e.includes(n));
}
function WJ(t, e) {
  return t.reduce((n, r) => HJ(n, r), e);
}
function zJ(t) {
  return t.length === 1 ? t[0] : t.length > 1 ? WJ(t.slice(1), t[0]) : [];
}
function KJ(t) {
  const e = [];
  for (const n of t)
    e.push(...n);
  return e;
}
function LM(t, e) {
  return t in e ? xi(t, e[t]) : pr(e);
}
function VJ(t) {
  return { [t]: xn(t) };
}
function YJ(t) {
  const e = {};
  for (const n of t)
    e[n] = xn(n);
  return e;
}
function JJ(t, e) {
  return GJ(e, t) ? VJ(t) : YJ(e);
}
function XJ(t, e) {
  const n = JJ(t, e);
  return LM(t, n);
}
function Ll(t, e) {
  return e.map((n) => xi(t, n));
}
function ZJ(t, e) {
  const n = {};
  for (const r of globalThis.Object.getOwnPropertyNames(e))
    n[r] = xi(t, e[r]);
  return n;
}
function xi(t, e) {
  const n = { ...e };
  return (
    // unevaluated modifier types
    ha(e) ? ma(xi(t, ai(e, [ws]))) : WE(e) ? va(xi(t, ai(e, [Ld]))) : (
      // unevaluated mapped types
      fi(e) ? LM(t, e.properties) : bc(e) ? XJ(t, e.keys) : (
        // unevaluated types
        el(e) ? HE(Ll(t, e.parameters), xi(t, e.returns), n) : tl(e) ? jd(Ll(t, e.parameters), xi(t, e.returns), n) : n0(e) ? qE(xi(t, e.items), n) : i0(e) ? eA(xi(t, e.items), n) : Fi(e) ? ga(Ll(t, e.allOf), n) : Yn(e) ? dr(Ll(t, e.anyOf), n) : wc(e) ? sl(Ll(t, e.items ?? []), n) : ho(e) ? Kn(ZJ(t, e.properties), n) : Xu(e) ? GE(xi(t, e.items), n) : o0(e) ? UM(xi(t, e.item), n) : e
      )
    )
  );
}
function eX(t, e) {
  const n = {};
  for (const r of t)
    n[r] = xi(r, e);
  return n;
}
function tX(t, e, n) {
  const r = Ir(t) ? ya(t) : t, i = e({ [Ee]: "MappedKey", keys: r }), o = eX(r, i);
  return Kn(o, n);
}
function al(...t) {
  const [e, n] = typeof t[0] == "string" ? [t[0], t[1]] : [t[0].$id, t[1]];
  if (typeof e != "string")
    throw new mn("Ref: $ref must be a string");
  return ke({ [Ee]: "Ref", $ref: e }, n);
}
function jM(t) {
  const e = [];
  for (const n of t)
    e.push(ba(n));
  return e;
}
function nX(t) {
  const e = jM(t);
  return KJ(e);
}
function rX(t) {
  const e = jM(t);
  return zJ(e);
}
function iX(t) {
  return t.map((e, n) => n.toString());
}
function oX(t) {
  return ["[number]"];
}
function sX(t) {
  return globalThis.Object.getOwnPropertyNames(t);
}
function aX(t) {
  return tS ? globalThis.Object.getOwnPropertyNames(t).map((n) => n[0] === "^" && n[n.length - 1] === "$" ? n.slice(1, n.length - 1) : n) : [];
}
function ba(t) {
  return Fi(t) ? nX(t.allOf) : Yn(t) ? rX(t.anyOf) : wc(t) ? iX(t.items ?? []) : Xu(t) ? oX(t.items) : ho(t) ? sX(t.properties) : s0(t) ? aX(t.patternProperties) : [];
}
let tS = !1;
function vu(t) {
  tS = !0;
  const e = ba(t);
  return tS = !1, `^(${e.map((r) => `(${r})`).join("|")})$`;
}
function cX(t, e) {
  return Fn("KeyOf", [Fn(t, e)]);
}
function uX(t) {
  return Fn("KeyOf", [al(t)]);
}
function lX(t, e) {
  const n = ba(t), r = pX(n), i = ol(r);
  return ke(i, e);
}
function pX(t) {
  return t.map((e) => e === "[number]" ? Sc() : xn(e));
}
function tA(t, e) {
  return Zu(t) ? cX(t.target, t.parameters) : Gr(t) ? uX(t.$ref) : fi(t) ? hX(t, e) : lX(t, e);
}
function dX(t, e) {
  const n = {};
  for (const r of globalThis.Object.getOwnPropertyNames(t))
    n[r] = tA(t[r], si(e));
  return n;
}
function fX(t, e) {
  return dX(t.properties, e);
}
function hX(t, e) {
  const n = fX(t, e);
  return pr(n);
}
function QM(t) {
  const e = ba(t), n = ZE(t, e);
  return e.map((r, i) => [e[i], n[i]]);
}
function mX(t) {
  return t.allOf.every((e) => cl(e));
}
function gX(t) {
  return t.anyOf.some((e) => cl(e));
}
function yX(t) {
  return !cl(t.not);
}
function cl(t) {
  return t[Ee] === "Intersect" ? mX(t) : t[Ee] === "Union" ? gX(t) : t[Ee] === "Not" ? yX(t) : t[Ee] === "Undefined";
}
function vX(t) {
  switch (t.errorType) {
    case ue.ArrayContains:
      return "Expected array to contain at least one matching value";
    case ue.ArrayMaxContains:
      return `Expected array to contain no more than ${t.schema.maxContains} matching values`;
    case ue.ArrayMinContains:
      return `Expected array to contain at least ${t.schema.minContains} matching values`;
    case ue.ArrayMaxItems:
      return `Expected array length to be less or equal to ${t.schema.maxItems}`;
    case ue.ArrayMinItems:
      return `Expected array length to be greater or equal to ${t.schema.minItems}`;
    case ue.ArrayUniqueItems:
      return "Expected array elements to be unique";
    case ue.Array:
      return "Expected array";
    case ue.AsyncIterator:
      return "Expected AsyncIterator";
    case ue.BigIntExclusiveMaximum:
      return `Expected bigint to be less than ${t.schema.exclusiveMaximum}`;
    case ue.BigIntExclusiveMinimum:
      return `Expected bigint to be greater than ${t.schema.exclusiveMinimum}`;
    case ue.BigIntMaximum:
      return `Expected bigint to be less or equal to ${t.schema.maximum}`;
    case ue.BigIntMinimum:
      return `Expected bigint to be greater or equal to ${t.schema.minimum}`;
    case ue.BigIntMultipleOf:
      return `Expected bigint to be a multiple of ${t.schema.multipleOf}`;
    case ue.BigInt:
      return "Expected bigint";
    case ue.Boolean:
      return "Expected boolean";
    case ue.DateExclusiveMinimumTimestamp:
      return `Expected Date timestamp to be greater than ${t.schema.exclusiveMinimumTimestamp}`;
    case ue.DateExclusiveMaximumTimestamp:
      return `Expected Date timestamp to be less than ${t.schema.exclusiveMaximumTimestamp}`;
    case ue.DateMinimumTimestamp:
      return `Expected Date timestamp to be greater or equal to ${t.schema.minimumTimestamp}`;
    case ue.DateMaximumTimestamp:
      return `Expected Date timestamp to be less or equal to ${t.schema.maximumTimestamp}`;
    case ue.DateMultipleOfTimestamp:
      return `Expected Date timestamp to be a multiple of ${t.schema.multipleOfTimestamp}`;
    case ue.Date:
      return "Expected Date";
    case ue.Function:
      return "Expected function";
    case ue.IntegerExclusiveMaximum:
      return `Expected integer to be less than ${t.schema.exclusiveMaximum}`;
    case ue.IntegerExclusiveMinimum:
      return `Expected integer to be greater than ${t.schema.exclusiveMinimum}`;
    case ue.IntegerMaximum:
      return `Expected integer to be less or equal to ${t.schema.maximum}`;
    case ue.IntegerMinimum:
      return `Expected integer to be greater or equal to ${t.schema.minimum}`;
    case ue.IntegerMultipleOf:
      return `Expected integer to be a multiple of ${t.schema.multipleOf}`;
    case ue.Integer:
      return "Expected integer";
    case ue.IntersectUnevaluatedProperties:
      return "Unexpected property";
    case ue.Intersect:
      return "Expected all values to match";
    case ue.Iterator:
      return "Expected Iterator";
    case ue.Literal:
      return `Expected ${typeof t.schema.const == "string" ? `'${t.schema.const}'` : t.schema.const}`;
    case ue.Never:
      return "Never";
    case ue.Not:
      return "Value should not match";
    case ue.Null:
      return "Expected null";
    case ue.NumberExclusiveMaximum:
      return `Expected number to be less than ${t.schema.exclusiveMaximum}`;
    case ue.NumberExclusiveMinimum:
      return `Expected number to be greater than ${t.schema.exclusiveMinimum}`;
    case ue.NumberMaximum:
      return `Expected number to be less or equal to ${t.schema.maximum}`;
    case ue.NumberMinimum:
      return `Expected number to be greater or equal to ${t.schema.minimum}`;
    case ue.NumberMultipleOf:
      return `Expected number to be a multiple of ${t.schema.multipleOf}`;
    case ue.Number:
      return "Expected number";
    case ue.Object:
      return "Expected object";
    case ue.ObjectAdditionalProperties:
      return "Unexpected property";
    case ue.ObjectMaxProperties:
      return `Expected object to have no more than ${t.schema.maxProperties} properties`;
    case ue.ObjectMinProperties:
      return `Expected object to have at least ${t.schema.minProperties} properties`;
    case ue.ObjectRequiredProperty:
      return "Expected required property";
    case ue.Promise:
      return "Expected Promise";
    case ue.RegExp:
      return "Expected string to match regular expression";
    case ue.StringFormatUnknown:
      return `Unknown format '${t.schema.format}'`;
    case ue.StringFormat:
      return `Expected string to match '${t.schema.format}' format`;
    case ue.StringMaxLength:
      return `Expected string length less or equal to ${t.schema.maxLength}`;
    case ue.StringMinLength:
      return `Expected string length greater or equal to ${t.schema.minLength}`;
    case ue.StringPattern:
      return `Expected string to match '${t.schema.pattern}'`;
    case ue.String:
      return "Expected string";
    case ue.Symbol:
      return "Expected symbol";
    case ue.TupleLength:
      return `Expected tuple to have ${t.schema.maxItems || 0} elements`;
    case ue.Tuple:
      return "Expected tuple";
    case ue.Uint8ArrayMaxByteLength:
      return `Expected byte length less or equal to ${t.schema.maxByteLength}`;
    case ue.Uint8ArrayMinByteLength:
      return `Expected byte length greater or equal to ${t.schema.minByteLength}`;
    case ue.Uint8Array:
      return "Expected Uint8Array";
    case ue.Undefined:
      return "Expected undefined";
    case ue.Union:
      return "Expected union value";
    case ue.Void:
      return "Expected void";
    case ue.Kind:
      return `Expected kind '${t.schema[Ee]}'`;
    default:
      return "Unknown error type";
  }
}
let bX = vX;
function xX() {
  return bX;
}
class wX extends mn {
  constructor(e) {
    super(`Unable to dereference schema with $id '${e.$ref}'`), this.schema = e;
  }
}
function SX(t, e) {
  const n = e.find((r) => r.$id === t.$ref);
  if (n === void 0)
    throw new wX(t);
  return Vt(n, e);
}
function Ss(t, e) {
  return !Ut(t.$id) || e.some((n) => n.$id === t.$id) || e.push(t), e;
}
function Vt(t, e) {
  return t[Ee] === "This" || t[Ee] === "Ref" ? SX(t, e) : t;
}
class _X extends mn {
  constructor(e) {
    super("Unable to hash value"), this.value = e;
  }
}
var ci;
(function(t) {
  t[t.Undefined = 0] = "Undefined", t[t.Null = 1] = "Null", t[t.Boolean = 2] = "Boolean", t[t.Number = 3] = "Number", t[t.String = 4] = "String", t[t.Object = 5] = "Object", t[t.Array = 6] = "Array", t[t.Date = 7] = "Date", t[t.Uint8Array = 8] = "Uint8Array", t[t.Symbol = 9] = "Symbol", t[t.BigInt = 10] = "BigInt";
})(ci || (ci = {}));
let Xc = BigInt("14695981039346656037");
const [EX, AX] = [BigInt("1099511628211"), BigInt(
  "18446744073709551616"
  /* 2 ^ 64 */
)], IX = Array.from({ length: 256 }).map((t, e) => BigInt(e)), $M = new Float64Array(1), GM = new DataView($M.buffer), qM = new Uint8Array($M.buffer);
function* CX(t) {
  const e = t === 0 ? 1 : Math.ceil(Math.floor(Math.log2(t) + 1) / 8);
  for (let n = 0; n < e; n++)
    yield t >> 8 * (e - 1 - n) & 255;
}
function TX(t) {
  vr(ci.Array);
  for (const e of t)
    bu(e);
}
function kX(t) {
  vr(ci.Boolean), vr(t ? 1 : 0);
}
function NX(t) {
  vr(ci.BigInt), GM.setBigInt64(0, t);
  for (const e of qM)
    vr(e);
}
function PX(t) {
  vr(ci.Date), bu(t.getTime());
}
function DX(t) {
  vr(ci.Null);
}
function FX(t) {
  vr(ci.Number), GM.setFloat64(0, t);
  for (const e of qM)
    vr(e);
}
function OX(t) {
  vr(ci.Object);
  for (const e of globalThis.Object.getOwnPropertyNames(t).sort())
    bu(e), bu(t[e]);
}
function MX(t) {
  vr(ci.String);
  for (let e = 0; e < t.length; e++)
    for (const n of CX(t.charCodeAt(e)))
      vr(n);
}
function RX(t) {
  vr(ci.Symbol), bu(t.description);
}
function BX(t) {
  vr(ci.Uint8Array);
  for (let e = 0; e < t.length; e++)
    vr(t[e]);
}
function UX(t) {
  return vr(ci.Undefined);
}
function bu(t) {
  if (Lt(t))
    return TX(t);
  if (Ju(t))
    return kX(t);
  if (_i(t))
    return NX(t);
  if (Yu(t))
    return PX(t);
  if (Md(t))
    return DX();
  if (Je(t))
    return FX(t);
  if (Pt(t))
    return OX(t);
  if (Ut(t))
    return MX(t);
  if (Rd(t))
    return RX(t);
  if (BE(t))
    return BX(t);
  if (zr(t))
    return UX();
  throw new _X(t);
}
function vr(t) {
  Xc = Xc ^ IX[t], Xc = Xc * EX % AX;
}
function nA(t) {
  return Xc = BigInt("14695981039346656037"), bu(t), Xc;
}
function Jp(t) {
  return ke({ [Ee]: "Any" }, t);
}
function u0(t) {
  return ke({ [Ee]: "Unknown" }, t);
}
const LX = [
  "Argument",
  "Any",
  "Array",
  "AsyncIterator",
  "BigInt",
  "Boolean",
  "Computed",
  "Constructor",
  "Date",
  "Enum",
  "Function",
  "Integer",
  "Intersect",
  "Iterator",
  "Literal",
  "MappedKey",
  "MappedResult",
  "Not",
  "Null",
  "Number",
  "Object",
  "Promise",
  "Record",
  "Ref",
  "RegExp",
  "String",
  "Symbol",
  "TemplateLiteral",
  "This",
  "Tuple",
  "Undefined",
  "Union",
  "Uint8Array",
  "Unknown",
  "Void"
];
function HM(t) {
  try {
    return new RegExp(t), !0;
  } catch {
    return !1;
  }
}
function rA(t) {
  if (!hn(t))
    return !1;
  for (let e = 0; e < t.length; e++) {
    const n = t.charCodeAt(e);
    if (n >= 7 && n <= 13 || n === 27 || n === 127)
      return !1;
  }
  return !0;
}
function WM(t) {
  return iA(t) || Zt(t);
}
function jl(t) {
  return gn(t) || SM(t);
}
function Bt(t) {
  return gn(t) || Oo(t);
}
function iA(t) {
  return gn(t) || Bd(t);
}
function Ft(t) {
  return gn(t) || hn(t);
}
function jX(t) {
  return gn(t) || hn(t) && rA(t) && HM(t);
}
function QX(t) {
  return gn(t) || hn(t) && rA(t);
}
function zM(t) {
  return gn(t) || Zt(t);
}
function Um(t) {
  return Sn(t) && t[ws] === "Optional";
}
function Xi(t) {
  return St(t, "Any") && Ft(t.$id);
}
function $X(t) {
  return St(t, "Argument") && Oo(t.index);
}
function _c(t) {
  return St(t, "Array") && t.type === "array" && Ft(t.$id) && Zt(t.items) && Bt(t.minItems) && Bt(t.maxItems) && iA(t.uniqueItems) && zM(t.contains) && Bt(t.minContains) && Bt(t.maxContains);
}
function oA(t) {
  return St(t, "AsyncIterator") && t.type === "AsyncIterator" && Ft(t.$id) && Zt(t.items);
}
function l0(t) {
  return St(t, "BigInt") && t.type === "bigint" && Ft(t.$id) && jl(t.exclusiveMaximum) && jl(t.exclusiveMinimum) && jl(t.maximum) && jl(t.minimum) && jl(t.multipleOf);
}
function Ec(t) {
  return St(t, "Boolean") && t.type === "boolean" && Ft(t.$id);
}
function GX(t) {
  return St(t, "Computed") && hn(t.target) && Kr(t.parameters) && t.parameters.every((e) => Zt(e));
}
function p0(t) {
  return St(t, "Constructor") && t.type === "Constructor" && Ft(t.$id) && Kr(t.parameters) && t.parameters.every((e) => Zt(e)) && Zt(t.returns);
}
function d0(t) {
  return St(t, "Date") && t.type === "Date" && Ft(t.$id) && Bt(t.exclusiveMaximumTimestamp) && Bt(t.exclusiveMinimumTimestamp) && Bt(t.maximumTimestamp) && Bt(t.minimumTimestamp) && Bt(t.multipleOfTimestamp);
}
function f0(t) {
  return St(t, "Function") && t.type === "Function" && Ft(t.$id) && Kr(t.parameters) && t.parameters.every((e) => Zt(e)) && Zt(t.returns);
}
function _s(t) {
  return St(t, "Integer") && t.type === "integer" && Ft(t.$id) && Bt(t.exclusiveMaximum) && Bt(t.exclusiveMinimum) && Bt(t.maximum) && Bt(t.minimum) && Bt(t.multipleOf);
}
function KM(t) {
  return Sn(t) && Object.entries(t).every(([e, n]) => rA(e) && Zt(n));
}
function Ac(t) {
  return St(t, "Intersect") && !(hn(t.type) && t.type !== "object") && Kr(t.allOf) && t.allOf.every((e) => Zt(e) && !VX(e)) && Ft(t.type) && (iA(t.unevaluatedProperties) || zM(t.unevaluatedProperties)) && Ft(t.$id);
}
function sA(t) {
  return St(t, "Iterator") && t.type === "Iterator" && Ft(t.$id) && Zt(t.items);
}
function St(t, e) {
  return Sn(t) && Ee in t && t[Ee] === e;
}
function VM(t) {
  return xa(t) && hn(t.const);
}
function YM(t) {
  return xa(t) && Oo(t.const);
}
function JM(t) {
  return xa(t) && Bd(t.const);
}
function xa(t) {
  return St(t, "Literal") && Ft(t.$id) && qX(t.const);
}
function qX(t) {
  return Bd(t) || Oo(t) || hn(t);
}
function HX(t) {
  return St(t, "MappedKey") && Kr(t.keys) && t.keys.every((e) => Oo(e) || hn(e));
}
function WX(t) {
  return St(t, "MappedResult") && KM(t.properties);
}
function wa(t) {
  return St(t, "Never") && Sn(t.not) && Object.getOwnPropertyNames(t.not).length === 0;
}
function xu(t) {
  return St(t, "Not") && Zt(t.not);
}
function aA(t) {
  return St(t, "Null") && t.type === "null" && Ft(t.$id);
}
function Lr(t) {
  return St(t, "Number") && t.type === "number" && Ft(t.$id) && Bt(t.exclusiveMaximum) && Bt(t.exclusiveMinimum) && Bt(t.maximum) && Bt(t.minimum) && Bt(t.multipleOf);
}
function tn(t) {
  return St(t, "Object") && t.type === "object" && Ft(t.$id) && KM(t.properties) && WM(t.additionalProperties) && Bt(t.minProperties) && Bt(t.maxProperties);
}
function cA(t) {
  return St(t, "Promise") && t.type === "Promise" && Ft(t.$id) && Zt(t.item);
}
function ar(t) {
  return St(t, "Record") && t.type === "object" && Ft(t.$id) && WM(t.additionalProperties) && Sn(t.patternProperties) && ((e) => {
    const n = Object.getOwnPropertyNames(e.patternProperties);
    return n.length === 1 && HM(n[0]) && Sn(e.patternProperties) && Zt(e.patternProperties[n[0]]);
  })(t);
}
function zX(t) {
  return St(t, "Ref") && Ft(t.$id) && hn(t.$ref);
}
function Xp(t) {
  return St(t, "RegExp") && Ft(t.$id) && hn(t.source) && hn(t.flags) && Bt(t.maxLength) && Bt(t.minLength);
}
function Zi(t) {
  return St(t, "String") && t.type === "string" && Ft(t.$id) && Bt(t.minLength) && Bt(t.maxLength) && jX(t.pattern) && QX(t.format);
}
function Zp(t) {
  return St(t, "Symbol") && t.type === "symbol" && Ft(t.$id);
}
function ed(t) {
  return St(t, "TemplateLiteral") && t.type === "string" && hn(t.pattern) && t.pattern[0] === "^" && t.pattern[t.pattern.length - 1] === "$";
}
function KX(t) {
  return St(t, "This") && Ft(t.$id) && hn(t.$ref);
}
function VX(t) {
  return Sn(t) && Ur in t;
}
function h0(t) {
  return St(t, "Tuple") && t.type === "array" && Ft(t.$id) && Oo(t.minItems) && Oo(t.maxItems) && t.minItems === t.maxItems && // empty
  (gn(t.items) && gn(t.additionalItems) && t.minItems === 0 || Kr(t.items) && t.items.every((e) => Zt(e)));
}
function Xa(t) {
  return St(t, "Undefined") && t.type === "undefined" && Ft(t.$id);
}
function ps(t) {
  return St(t, "Union") && Ft(t.$id) && Sn(t) && Kr(t.anyOf) && t.anyOf.every((e) => Zt(e));
}
function Hd(t) {
  return St(t, "Uint8Array") && t.type === "Uint8Array" && Ft(t.$id) && Bt(t.minByteLength) && Bt(t.maxByteLength);
}
function eo(t) {
  return St(t, "Unknown") && Ft(t.$id);
}
function YX(t) {
  return St(t, "Unsafe");
}
function m0(t) {
  return St(t, "Void") && t.type === "void" && Ft(t.$id);
}
function JX(t) {
  return Sn(t) && Ee in t && hn(t[Ee]) && !LX.includes(t[Ee]);
}
function Zt(t) {
  return Sn(t) && (Xi(t) || $X(t) || _c(t) || Ec(t) || l0(t) || oA(t) || GX(t) || p0(t) || d0(t) || f0(t) || _s(t) || Ac(t) || sA(t) || xa(t) || HX(t) || WX(t) || wa(t) || xu(t) || aA(t) || Lr(t) || tn(t) || cA(t) || ar(t) || zX(t) || Xp(t) || Zi(t) || Zp(t) || ed(t) || KX(t) || h0(t) || Xa(t) || ps(t) || Hd(t) || eo(t) || YX(t) || m0(t) || JX(t));
}
class XX extends mn {
}
var pe;
(function(t) {
  t[t.Union = 0] = "Union", t[t.True = 1] = "True", t[t.False = 2] = "False";
})(pe || (pe = {}));
function Ti(t) {
  return t === pe.False ? t : pe.True;
}
function ul(t) {
  throw new XX(t);
}
function En(t) {
  return wa(t) || Ac(t) || ps(t) || eo(t) || Xi(t);
}
function An(t, e) {
  return wa(e) ? eR() : Ac(e) ? g0(t, e) : ps(e) ? lA(t, e) : eo(e) ? iR() : Xi(e) ? uA() : ul("StructuralRight");
}
function uA(t, e) {
  return pe.True;
}
function ZX(t, e) {
  return Ac(e) ? g0(t, e) : ps(e) && e.anyOf.some((n) => Xi(n) || eo(n)) ? pe.True : ps(e) ? pe.Union : eo(e) || Xi(e) ? pe.True : pe.Union;
}
function eZ(t, e) {
  return eo(t) ? pe.False : Xi(t) ? pe.Union : wa(t) ? pe.True : pe.False;
}
function tZ(t, e) {
  return tn(e) && y0(e) ? pe.True : En(e) ? An(t, e) : _c(e) ? Ti(Dt(t.items, e.items)) : pe.False;
}
function nZ(t, e) {
  return En(e) ? An(t, e) : oA(e) ? Ti(Dt(t.items, e.items)) : pe.False;
}
function rZ(t, e) {
  return En(e) ? An(t, e) : tn(e) ? wr(t, e) : ar(e) ? Oi(t, e) : l0(e) ? pe.True : pe.False;
}
function XM(t, e) {
  return JM(t) || Ec(t) ? pe.True : pe.False;
}
function iZ(t, e) {
  return En(e) ? An(t, e) : tn(e) ? wr(t, e) : ar(e) ? Oi(t, e) : Ec(e) ? pe.True : pe.False;
}
function oZ(t, e) {
  return En(e) ? An(t, e) : tn(e) ? wr(t, e) : p0(e) ? t.parameters.length > e.parameters.length ? pe.False : t.parameters.every((n, r) => Ti(Dt(e.parameters[r], n)) === pe.True) ? Ti(Dt(t.returns, e.returns)) : pe.False : pe.False;
}
function sZ(t, e) {
  return En(e) ? An(t, e) : tn(e) ? wr(t, e) : ar(e) ? Oi(t, e) : d0(e) ? pe.True : pe.False;
}
function aZ(t, e) {
  return En(e) ? An(t, e) : tn(e) ? wr(t, e) : f0(e) ? t.parameters.length > e.parameters.length ? pe.False : t.parameters.every((n, r) => Ti(Dt(e.parameters[r], n)) === pe.True) ? Ti(Dt(t.returns, e.returns)) : pe.False : pe.False;
}
function ZM(t, e) {
  return xa(t) && Oo(t.const) || Lr(t) || _s(t) ? pe.True : pe.False;
}
function cZ(t, e) {
  return _s(e) || Lr(e) ? pe.True : En(e) ? An(t, e) : tn(e) ? wr(t, e) : ar(e) ? Oi(t, e) : pe.False;
}
function g0(t, e) {
  return e.allOf.every((n) => Dt(t, n) === pe.True) ? pe.True : pe.False;
}
function uZ(t, e) {
  return t.allOf.some((n) => Dt(n, e) === pe.True) ? pe.True : pe.False;
}
function lZ(t, e) {
  return En(e) ? An(t, e) : sA(e) ? Ti(Dt(t.items, e.items)) : pe.False;
}
function pZ(t, e) {
  return xa(e) && e.const === t.const ? pe.True : En(e) ? An(t, e) : tn(e) ? wr(t, e) : ar(e) ? Oi(t, e) : Zi(e) ? rR(t) : Lr(e) ? tR(t) : _s(e) ? ZM(t) : Ec(e) ? XM(t) : pe.False;
}
function eR(t, e) {
  return pe.False;
}
function dZ(t, e) {
  return pe.True;
}
function xN(t) {
  let [e, n] = [t, 0];
  for (; xu(e); )
    e = e.not, n += 1;
  return n % 2 === 0 ? e : u0();
}
function fZ(t, e) {
  return xu(t) ? Dt(xN(t), e) : xu(e) ? Dt(t, xN(e)) : ul("Invalid fallthrough for Not");
}
function hZ(t, e) {
  return En(e) ? An(t, e) : tn(e) ? wr(t, e) : ar(e) ? Oi(t, e) : aA(e) ? pe.True : pe.False;
}
function tR(t, e) {
  return YM(t) || Lr(t) || _s(t) ? pe.True : pe.False;
}
function mZ(t, e) {
  return En(e) ? An(t, e) : tn(e) ? wr(t, e) : ar(e) ? Oi(t, e) : _s(e) || Lr(e) ? pe.True : pe.False;
}
function qr(t, e) {
  return Object.getOwnPropertyNames(t.properties).length === e;
}
function wN(t) {
  return y0(t);
}
function SN(t) {
  return qr(t, 0) || qr(t, 1) && "description" in t.properties && ps(t.properties.description) && t.properties.description.anyOf.length === 2 && (Zi(t.properties.description.anyOf[0]) && Xa(t.properties.description.anyOf[1]) || Zi(t.properties.description.anyOf[1]) && Xa(t.properties.description.anyOf[0]));
}
function px(t) {
  return qr(t, 0);
}
function _N(t) {
  return qr(t, 0);
}
function gZ(t) {
  return qr(t, 0);
}
function yZ(t) {
  return qr(t, 0);
}
function vZ(t) {
  return y0(t);
}
function bZ(t) {
  const e = Sc();
  return qr(t, 0) || qr(t, 1) && "length" in t.properties && Ti(Dt(t.properties.length, e)) === pe.True;
}
function xZ(t) {
  return qr(t, 0);
}
function y0(t) {
  const e = Sc();
  return qr(t, 0) || qr(t, 1) && "length" in t.properties && Ti(Dt(t.properties.length, e)) === pe.True;
}
function wZ(t) {
  const e = jd([Jp()], Jp());
  return qr(t, 0) || qr(t, 1) && "then" in t.properties && Ti(Dt(t.properties.then, e)) === pe.True;
}
function nR(t, e) {
  return Dt(t, e) === pe.False || Um(t) && !Um(e) ? pe.False : pe.True;
}
function wr(t, e) {
  return eo(t) ? pe.False : Xi(t) ? pe.Union : wa(t) || VM(t) && wN(e) || YM(t) && px(e) || JM(t) && _N(e) || Zp(t) && SN(e) || l0(t) && gZ(e) || Zi(t) && wN(e) || Zp(t) && SN(e) || Lr(t) && px(e) || _s(t) && px(e) || Ec(t) && _N(e) || Hd(t) && vZ(e) || d0(t) && yZ(e) || p0(t) && xZ(e) || f0(t) && bZ(e) ? pe.True : ar(t) && Zi(nS(t)) ? e[t0] === "Record" ? pe.True : pe.False : ar(t) && Lr(nS(t)) ? qr(e, 0) ? pe.True : pe.False : pe.False;
}
function SZ(t, e) {
  return En(e) ? An(t, e) : ar(e) ? Oi(t, e) : tn(e) ? (() => {
    for (const n of Object.getOwnPropertyNames(e.properties)) {
      if (!(n in t.properties) && !Um(e.properties[n]))
        return pe.False;
      if (Um(e.properties[n]))
        return pe.True;
      if (nR(t.properties[n], e.properties[n]) === pe.False)
        return pe.False;
    }
    return pe.True;
  })() : pe.False;
}
function _Z(t, e) {
  return En(e) ? An(t, e) : tn(e) && wZ(e) ? pe.True : cA(e) ? Ti(Dt(t.item, e.item)) : pe.False;
}
function nS(t) {
  return gu in t.patternProperties ? Sc() : yu in t.patternProperties ? Ja() : ul("Unknown record key pattern");
}
function rS(t) {
  return gu in t.patternProperties ? t.patternProperties[gu] : yu in t.patternProperties ? t.patternProperties[yu] : ul("Unable to get record value schema");
}
function Oi(t, e) {
  const [n, r] = [nS(e), rS(e)];
  return VM(t) && Lr(n) && Ti(Dt(t, r)) === pe.True ? pe.True : Hd(t) && Lr(n) || Zi(t) && Lr(n) || _c(t) && Lr(n) ? Dt(t, r) : tn(t) ? (() => {
    for (const i of Object.getOwnPropertyNames(t.properties))
      if (nR(r, t.properties[i]) === pe.False)
        return pe.False;
    return pe.True;
  })() : pe.False;
}
function EZ(t, e) {
  return En(e) ? An(t, e) : tn(e) ? wr(t, e) : ar(e) ? Dt(rS(t), rS(e)) : pe.False;
}
function AZ(t, e) {
  const n = Xp(t) ? Ja() : t, r = Xp(e) ? Ja() : e;
  return Dt(n, r);
}
function rR(t, e) {
  return xa(t) && hn(t.const) || Zi(t) ? pe.True : pe.False;
}
function IZ(t, e) {
  return En(e) ? An(t, e) : tn(e) ? wr(t, e) : ar(e) ? Oi(t, e) : Zi(e) ? pe.True : pe.False;
}
function CZ(t, e) {
  return En(e) ? An(t, e) : tn(e) ? wr(t, e) : ar(e) ? Oi(t, e) : Zp(e) ? pe.True : pe.False;
}
function TZ(t, e) {
  return ed(t) ? Dt(Bm(t), e) : ed(e) ? Dt(t, Bm(e)) : ul("Invalid fallthrough for TemplateLiteral");
}
function kZ(t, e) {
  return _c(e) && t.items !== void 0 && t.items.every((n) => Dt(n, e.items) === pe.True);
}
function NZ(t, e) {
  return wa(t) ? pe.True : eo(t) ? pe.False : Xi(t) ? pe.Union : pe.False;
}
function PZ(t, e) {
  return En(e) ? An(t, e) : tn(e) && y0(e) || _c(e) && kZ(t, e) ? pe.True : h0(e) ? gn(t.items) && !gn(e.items) || !gn(t.items) && gn(e.items) ? pe.False : gn(t.items) && !gn(e.items) || t.items.every((n, r) => Dt(n, e.items[r]) === pe.True) ? pe.True : pe.False : pe.False;
}
function DZ(t, e) {
  return En(e) ? An(t, e) : tn(e) ? wr(t, e) : ar(e) ? Oi(t, e) : Hd(e) ? pe.True : pe.False;
}
function FZ(t, e) {
  return En(e) ? An(t, e) : tn(e) ? wr(t, e) : ar(e) ? Oi(t, e) : m0(e) ? RZ(t) : Xa(e) ? pe.True : pe.False;
}
function lA(t, e) {
  return e.anyOf.some((n) => Dt(t, n) === pe.True) ? pe.True : pe.False;
}
function OZ(t, e) {
  return t.anyOf.every((n) => Dt(n, e) === pe.True) ? pe.True : pe.False;
}
function iR(t, e) {
  return pe.True;
}
function MZ(t, e) {
  return wa(e) ? eR() : Ac(e) ? g0(t, e) : ps(e) ? lA(t, e) : Xi(e) ? uA() : Zi(e) ? rR(t) : Lr(e) ? tR(t) : _s(e) ? ZM(t) : Ec(e) ? XM(t) : _c(e) ? eZ(t) : h0(e) ? NZ(t) : tn(e) ? wr(t, e) : eo(e) ? pe.True : pe.False;
}
function RZ(t, e) {
  return Xa(t) || Xa(t) ? pe.True : pe.False;
}
function BZ(t, e) {
  return Ac(e) ? g0(t, e) : ps(e) ? lA(t, e) : eo(e) ? iR() : Xi(e) ? uA() : tn(e) ? wr(t, e) : m0(e) ? pe.True : pe.False;
}
function Dt(t, e) {
  return (
    // resolvable
    ed(t) || ed(e) ? TZ(t, e) : Xp(t) || Xp(e) ? AZ(t, e) : xu(t) || xu(e) ? fZ(t, e) : (
      // standard
      Xi(t) ? ZX(t, e) : _c(t) ? tZ(t, e) : l0(t) ? rZ(t, e) : Ec(t) ? iZ(t, e) : oA(t) ? nZ(t, e) : p0(t) ? oZ(t, e) : d0(t) ? sZ(t, e) : f0(t) ? aZ(t, e) : _s(t) ? cZ(t, e) : Ac(t) ? uZ(t, e) : sA(t) ? lZ(t, e) : xa(t) ? pZ(t, e) : wa(t) ? dZ() : aA(t) ? hZ(t, e) : Lr(t) ? mZ(t, e) : tn(t) ? SZ(t, e) : ar(t) ? EZ(t, e) : Zi(t) ? IZ(t, e) : Zp(t) ? CZ(t, e) : h0(t) ? PZ(t, e) : cA(t) ? _Z(t, e) : Hd(t) ? DZ(t, e) : Xa(t) ? FZ(t, e) : ps(t) ? OZ(t, e) : eo(t) ? MZ(t, e) : m0(t) ? BZ(t, e) : ul(`Unknown left type operand '${t[Ee]}'`)
    )
  );
}
function Wd(t, e) {
  return Dt(t, e);
}
function UZ(t, e, n, r, i) {
  const o = {};
  for (const s of globalThis.Object.getOwnPropertyNames(t))
    o[s] = pA(t[s], e, n, r, si(i));
  return o;
}
function LZ(t, e, n, r, i) {
  return UZ(t.properties, e, n, r, i);
}
function jZ(t, e, n, r, i) {
  const o = LZ(t, e, n, r, i);
  return pr(o);
}
function QZ(t, e, n, r) {
  const i = Wd(t, e);
  return i === pe.Union ? dr([n, r]) : i === pe.True ? n : r;
}
function pA(t, e, n, r, i) {
  return fi(t) ? jZ(t, e, n, r, i) : bc(t) ? ke(HZ(t, e, n, r, i)) : ke(QZ(t, e, n, r), i);
}
function $Z(t, e, n, r, i) {
  return {
    [t]: pA(xn(t), e, n, r, si(i))
  };
}
function GZ(t, e, n, r, i) {
  return t.reduce((o, s) => ({ ...o, ...$Z(s, e, n, r, i) }), {});
}
function qZ(t, e, n, r, i) {
  return GZ(t.keys, e, n, r, i);
}
function HZ(t, e, n, r, i) {
  const o = qZ(t, e, n, r, i);
  return pr(o);
}
class WZ extends mn {
  constructor(e) {
    super("Unknown type"), this.schema = e;
  }
}
function zZ(t) {
  return t[Ee] === "Any" || t[Ee] === "Unknown";
}
function vt(t) {
  return t !== void 0;
}
function KZ(t, e, n) {
  return !0;
}
function VZ(t, e, n) {
  return !0;
}
function YZ(t, e, n) {
  if (!Lt(n) || vt(t.minItems) && !(n.length >= t.minItems) || vt(t.maxItems) && !(n.length <= t.maxItems) || !n.every((o) => Wn(t.items, e, o)) || t.uniqueItems === !0 && !(function() {
    const o = /* @__PURE__ */ new Set();
    for (const s of n) {
      const a = nA(s);
      if (o.has(a))
        return !1;
      o.add(a);
    }
    return !0;
  })())
    return !1;
  if (!(vt(t.contains) || Je(t.minContains) || Je(t.maxContains)))
    return !0;
  const r = vt(t.contains) ? t.contains : en(), i = n.reduce((o, s) => Wn(r, e, s) ? o + 1 : o, 0);
  return !(i === 0 || Je(t.minContains) && i < t.minContains || Je(t.maxContains) && i > t.maxContains);
}
function JZ(t, e, n) {
  return gM(n);
}
function XZ(t, e, n) {
  return !(!_i(n) || vt(t.exclusiveMaximum) && !(n < t.exclusiveMaximum) || vt(t.exclusiveMinimum) && !(n > t.exclusiveMinimum) || vt(t.maximum) && !(n <= t.maximum) || vt(t.minimum) && !(n >= t.minimum) || vt(t.multipleOf) && n % t.multipleOf !== BigInt(0));
}
function ZZ(t, e, n) {
  return Ju(n);
}
function eee(t, e, n) {
  return Wn(t.returns, e, n.prototype);
}
function tee(t, e, n) {
  return !(!Yu(n) || vt(t.exclusiveMaximumTimestamp) && !(n.getTime() < t.exclusiveMaximumTimestamp) || vt(t.exclusiveMinimumTimestamp) && !(n.getTime() > t.exclusiveMinimumTimestamp) || vt(t.maximumTimestamp) && !(n.getTime() <= t.maximumTimestamp) || vt(t.minimumTimestamp) && !(n.getTime() >= t.minimumTimestamp) || vt(t.multipleOfTimestamp) && n.getTime() % t.multipleOfTimestamp !== 0);
}
function nee(t, e, n) {
  return e0(n);
}
function ree(t, e, n) {
  const r = globalThis.Object.values(t.$defs), i = t.$defs[t.$ref];
  return Wn(i, [...e, ...r], n);
}
function iee(t, e, n) {
  return !(!bM(n) || vt(t.exclusiveMaximum) && !(n < t.exclusiveMaximum) || vt(t.exclusiveMinimum) && !(n > t.exclusiveMinimum) || vt(t.maximum) && !(n <= t.maximum) || vt(t.minimum) && !(n >= t.minimum) || vt(t.multipleOf) && n % t.multipleOf !== 0);
}
function oee(t, e, n) {
  const r = t.allOf.every((i) => Wn(i, e, n));
  if (t.unevaluatedProperties === !1) {
    const i = new RegExp(vu(t)), o = Object.getOwnPropertyNames(n).every((s) => i.test(s));
    return r && o;
  } else if (Ir(t.unevaluatedProperties)) {
    const i = new RegExp(vu(t)), o = Object.getOwnPropertyNames(n).every((s) => i.test(s) || Wn(t.unevaluatedProperties, e, n[s]));
    return r && o;
  } else
    return r;
}
function see(t, e, n) {
  return yM(n);
}
function aee(t, e, n) {
  return n === t.const;
}
function cee(t, e, n) {
  return !1;
}
function uee(t, e, n) {
  return !Wn(t.not, e, n);
}
function lee(t, e, n) {
  return Md(n);
}
function pee(t, e, n) {
  return !(!bn.IsNumberLike(n) || vt(t.exclusiveMaximum) && !(n < t.exclusiveMaximum) || vt(t.exclusiveMinimum) && !(n > t.exclusiveMinimum) || vt(t.minimum) && !(n >= t.minimum) || vt(t.maximum) && !(n <= t.maximum) || vt(t.multipleOf) && n % t.multipleOf !== 0);
}
function dee(t, e, n) {
  if (!bn.IsObjectLike(n) || vt(t.minProperties) && !(Object.getOwnPropertyNames(n).length >= t.minProperties) || vt(t.maxProperties) && !(Object.getOwnPropertyNames(n).length <= t.maxProperties))
    return !1;
  const r = Object.getOwnPropertyNames(t.properties);
  for (const i of r) {
    const o = t.properties[i];
    if (t.required && t.required.includes(i)) {
      if (!Wn(o, e, n[i]) || (cl(o) || zZ(o)) && !(i in n))
        return !1;
    } else if (bn.IsExactOptionalProperty(n, i) && !Wn(o, e, n[i]))
      return !1;
  }
  if (t.additionalProperties === !1) {
    const i = Object.getOwnPropertyNames(n);
    return t.required && t.required.length === r.length && i.length === r.length ? !0 : i.every((o) => r.includes(o));
  } else return typeof t.additionalProperties == "object" ? Object.getOwnPropertyNames(n).every((o) => r.includes(o) || Wn(t.additionalProperties, e, n[o])) : !0;
}
function fee(t, e, n) {
  return vM(n);
}
function hee(t, e, n) {
  if (!bn.IsRecordLike(n) || vt(t.minProperties) && !(Object.getOwnPropertyNames(n).length >= t.minProperties) || vt(t.maxProperties) && !(Object.getOwnPropertyNames(n).length <= t.maxProperties))
    return !1;
  const [r, i] = Object.entries(t.patternProperties)[0], o = new RegExp(r), s = Object.entries(n).every(([u, l]) => o.test(u) ? Wn(i, e, l) : !0), a = typeof t.additionalProperties == "object" ? Object.entries(n).every(([u, l]) => o.test(u) ? !0 : Wn(t.additionalProperties, e, l)) : !0, c = t.additionalProperties === !1 ? Object.getOwnPropertyNames(n).every((u) => o.test(u)) : !0;
  return s && a && c;
}
function mee(t, e, n) {
  return Wn(Vt(t, e), e, n);
}
function gee(t, e, n) {
  const r = new RegExp(t.source, t.flags);
  return vt(t.minLength) && !(n.length >= t.minLength) || vt(t.maxLength) && !(n.length <= t.maxLength) ? !1 : r.test(n);
}
function yee(t, e, n) {
  return !Ut(n) || vt(t.minLength) && !(n.length >= t.minLength) || vt(t.maxLength) && !(n.length <= t.maxLength) || vt(t.pattern) && !new RegExp(t.pattern).test(n) ? !1 : vt(t.format) ? LE(t.format) ? jE(t.format)(n) : !1 : !0;
}
function vee(t, e, n) {
  return Rd(n);
}
function bee(t, e, n) {
  return Ut(n) && new RegExp(t.pattern).test(n);
}
function xee(t, e, n) {
  return Wn(Vt(t, e), e, n);
}
function wee(t, e, n) {
  if (!Lt(n) || t.items === void 0 && n.length !== 0 || n.length !== t.maxItems)
    return !1;
  if (!t.items)
    return !0;
  for (let r = 0; r < t.items.length; r++)
    if (!Wn(t.items[r], e, n[r]))
      return !1;
  return !0;
}
function See(t, e, n) {
  return zr(n);
}
function _ee(t, e, n) {
  return t.anyOf.some((r) => Wn(r, e, n));
}
function Eee(t, e, n) {
  return !(!BE(n) || vt(t.maxByteLength) && !(n.length <= t.maxByteLength) || vt(t.minByteLength) && !(n.length >= t.minByteLength));
}
function Aee(t, e, n) {
  return !0;
}
function Iee(t, e, n) {
  return bn.IsVoidLike(n);
}
function Cee(t, e, n) {
  return hu(t[Ee]) ? QE(t[Ee])(t, n) : !1;
}
function Wn(t, e, n) {
  const r = vt(t.$id) ? Ss(t, e) : e, i = t;
  switch (i[Ee]) {
    case "Any":
      return KZ();
    case "Argument":
      return VZ();
    case "Array":
      return YZ(i, r, n);
    case "AsyncIterator":
      return JZ(i, r, n);
    case "BigInt":
      return XZ(i, r, n);
    case "Boolean":
      return ZZ(i, r, n);
    case "Constructor":
      return eee(i, r, n);
    case "Date":
      return tee(i, r, n);
    case "Function":
      return nee(i, r, n);
    case "Import":
      return ree(i, r, n);
    case "Integer":
      return iee(i, r, n);
    case "Intersect":
      return oee(i, r, n);
    case "Iterator":
      return see(i, r, n);
    case "Literal":
      return aee(i, r, n);
    case "Never":
      return cee();
    case "Not":
      return uee(i, r, n);
    case "Null":
      return lee(i, r, n);
    case "Number":
      return pee(i, r, n);
    case "Object":
      return dee(i, r, n);
    case "Promise":
      return fee(i, r, n);
    case "Record":
      return hee(i, r, n);
    case "Ref":
      return mee(i, r, n);
    case "RegExp":
      return gee(i, r, n);
    case "String":
      return yee(i, r, n);
    case "Symbol":
      return vee(i, r, n);
    case "TemplateLiteral":
      return bee(i, r, n);
    case "This":
      return xee(i, r, n);
    case "Tuple":
      return wee(i, r, n);
    case "Undefined":
      return See(i, r, n);
    case "Union":
      return _ee(i, r, n);
    case "Uint8Array":
      return Eee(i, r, n);
    case "Unknown":
      return Aee();
    case "Void":
      return Iee(i, r, n);
    default:
      if (!hu(i[Ee]))
        throw new WZ(i);
      return Cee(i, r, n);
  }
}
function $t(...t) {
  return t.length === 3 ? Wn(t[0], t[1], t[2]) : Wn(t[0], [], t[1]);
}
var ue;
(function(t) {
  t[t.ArrayContains = 0] = "ArrayContains", t[t.ArrayMaxContains = 1] = "ArrayMaxContains", t[t.ArrayMaxItems = 2] = "ArrayMaxItems", t[t.ArrayMinContains = 3] = "ArrayMinContains", t[t.ArrayMinItems = 4] = "ArrayMinItems", t[t.ArrayUniqueItems = 5] = "ArrayUniqueItems", t[t.Array = 6] = "Array", t[t.AsyncIterator = 7] = "AsyncIterator", t[t.BigIntExclusiveMaximum = 8] = "BigIntExclusiveMaximum", t[t.BigIntExclusiveMinimum = 9] = "BigIntExclusiveMinimum", t[t.BigIntMaximum = 10] = "BigIntMaximum", t[t.BigIntMinimum = 11] = "BigIntMinimum", t[t.BigIntMultipleOf = 12] = "BigIntMultipleOf", t[t.BigInt = 13] = "BigInt", t[t.Boolean = 14] = "Boolean", t[t.DateExclusiveMaximumTimestamp = 15] = "DateExclusiveMaximumTimestamp", t[t.DateExclusiveMinimumTimestamp = 16] = "DateExclusiveMinimumTimestamp", t[t.DateMaximumTimestamp = 17] = "DateMaximumTimestamp", t[t.DateMinimumTimestamp = 18] = "DateMinimumTimestamp", t[t.DateMultipleOfTimestamp = 19] = "DateMultipleOfTimestamp", t[t.Date = 20] = "Date", t[t.Function = 21] = "Function", t[t.IntegerExclusiveMaximum = 22] = "IntegerExclusiveMaximum", t[t.IntegerExclusiveMinimum = 23] = "IntegerExclusiveMinimum", t[t.IntegerMaximum = 24] = "IntegerMaximum", t[t.IntegerMinimum = 25] = "IntegerMinimum", t[t.IntegerMultipleOf = 26] = "IntegerMultipleOf", t[t.Integer = 27] = "Integer", t[t.IntersectUnevaluatedProperties = 28] = "IntersectUnevaluatedProperties", t[t.Intersect = 29] = "Intersect", t[t.Iterator = 30] = "Iterator", t[t.Kind = 31] = "Kind", t[t.Literal = 32] = "Literal", t[t.Never = 33] = "Never", t[t.Not = 34] = "Not", t[t.Null = 35] = "Null", t[t.NumberExclusiveMaximum = 36] = "NumberExclusiveMaximum", t[t.NumberExclusiveMinimum = 37] = "NumberExclusiveMinimum", t[t.NumberMaximum = 38] = "NumberMaximum", t[t.NumberMinimum = 39] = "NumberMinimum", t[t.NumberMultipleOf = 40] = "NumberMultipleOf", t[t.Number = 41] = "Number", t[t.ObjectAdditionalProperties = 42] = "ObjectAdditionalProperties", t[t.ObjectMaxProperties = 43] = "ObjectMaxProperties", t[t.ObjectMinProperties = 44] = "ObjectMinProperties", t[t.ObjectRequiredProperty = 45] = "ObjectRequiredProperty", t[t.Object = 46] = "Object", t[t.Promise = 47] = "Promise", t[t.RegExp = 48] = "RegExp", t[t.StringFormatUnknown = 49] = "StringFormatUnknown", t[t.StringFormat = 50] = "StringFormat", t[t.StringMaxLength = 51] = "StringMaxLength", t[t.StringMinLength = 52] = "StringMinLength", t[t.StringPattern = 53] = "StringPattern", t[t.String = 54] = "String", t[t.Symbol = 55] = "Symbol", t[t.TupleLength = 56] = "TupleLength", t[t.Tuple = 57] = "Tuple", t[t.Uint8ArrayMaxByteLength = 58] = "Uint8ArrayMaxByteLength", t[t.Uint8ArrayMinByteLength = 59] = "Uint8ArrayMinByteLength", t[t.Uint8Array = 60] = "Uint8Array", t[t.Undefined = 61] = "Undefined", t[t.Union = 62] = "Union", t[t.Void = 63] = "Void";
})(ue || (ue = {}));
class Tee extends mn {
  constructor(e) {
    super("Unknown type"), this.schema = e;
  }
}
function Jo(t) {
  return t.replace(/~/g, "~0").replace(/\//g, "~1");
}
function yt(t) {
  return t !== void 0;
}
class dA {
  constructor(e) {
    this.iterator = e;
  }
  [Symbol.iterator]() {
    return this.iterator;
  }
  /** Returns the first value error or undefined if no errors */
  First() {
    const e = this.iterator.next();
    return e.done ? void 0 : e.value;
  }
}
function Pe(t, e, n, r, i = []) {
  return {
    type: t,
    schema: e,
    path: n,
    value: r,
    message: xX()({ errorType: t, path: n, schema: e, value: r, errors: i }),
    errors: i
  };
}
function* kee(t, e, n, r) {
}
function* Nee(t, e, n, r) {
}
function* Pee(t, e, n, r) {
  if (!Lt(r))
    return yield Pe(ue.Array, t, n, r);
  yt(t.minItems) && !(r.length >= t.minItems) && (yield Pe(ue.ArrayMinItems, t, n, r)), yt(t.maxItems) && !(r.length <= t.maxItems) && (yield Pe(ue.ArrayMaxItems, t, n, r));
  for (let s = 0; s < r.length; s++)
    yield* zn(t.items, e, `${n}/${s}`, r[s]);
  if (t.uniqueItems === !0 && !(function() {
    const s = /* @__PURE__ */ new Set();
    for (const a of r) {
      const c = nA(a);
      if (s.has(c))
        return !1;
      s.add(c);
    }
    return !0;
  })() && (yield Pe(ue.ArrayUniqueItems, t, n, r)), !(yt(t.contains) || yt(t.minContains) || yt(t.maxContains)))
    return;
  const i = yt(t.contains) ? t.contains : en(), o = r.reduce((s, a, c) => zn(i, e, `${n}${c}`, a).next().done === !0 ? s + 1 : s, 0);
  o === 0 && (yield Pe(ue.ArrayContains, t, n, r)), Je(t.minContains) && o < t.minContains && (yield Pe(ue.ArrayMinContains, t, n, r)), Je(t.maxContains) && o > t.maxContains && (yield Pe(ue.ArrayMaxContains, t, n, r));
}
function* Dee(t, e, n, r) {
  gM(r) || (yield Pe(ue.AsyncIterator, t, n, r));
}
function* Fee(t, e, n, r) {
  if (!_i(r))
    return yield Pe(ue.BigInt, t, n, r);
  yt(t.exclusiveMaximum) && !(r < t.exclusiveMaximum) && (yield Pe(ue.BigIntExclusiveMaximum, t, n, r)), yt(t.exclusiveMinimum) && !(r > t.exclusiveMinimum) && (yield Pe(ue.BigIntExclusiveMinimum, t, n, r)), yt(t.maximum) && !(r <= t.maximum) && (yield Pe(ue.BigIntMaximum, t, n, r)), yt(t.minimum) && !(r >= t.minimum) && (yield Pe(ue.BigIntMinimum, t, n, r)), yt(t.multipleOf) && r % t.multipleOf !== BigInt(0) && (yield Pe(ue.BigIntMultipleOf, t, n, r));
}
function* Oee(t, e, n, r) {
  Ju(r) || (yield Pe(ue.Boolean, t, n, r));
}
function* Mee(t, e, n, r) {
  yield* zn(t.returns, e, n, r.prototype);
}
function* Ree(t, e, n, r) {
  if (!Yu(r))
    return yield Pe(ue.Date, t, n, r);
  yt(t.exclusiveMaximumTimestamp) && !(r.getTime() < t.exclusiveMaximumTimestamp) && (yield Pe(ue.DateExclusiveMaximumTimestamp, t, n, r)), yt(t.exclusiveMinimumTimestamp) && !(r.getTime() > t.exclusiveMinimumTimestamp) && (yield Pe(ue.DateExclusiveMinimumTimestamp, t, n, r)), yt(t.maximumTimestamp) && !(r.getTime() <= t.maximumTimestamp) && (yield Pe(ue.DateMaximumTimestamp, t, n, r)), yt(t.minimumTimestamp) && !(r.getTime() >= t.minimumTimestamp) && (yield Pe(ue.DateMinimumTimestamp, t, n, r)), yt(t.multipleOfTimestamp) && r.getTime() % t.multipleOfTimestamp !== 0 && (yield Pe(ue.DateMultipleOfTimestamp, t, n, r));
}
function* Bee(t, e, n, r) {
  e0(r) || (yield Pe(ue.Function, t, n, r));
}
function* Uee(t, e, n, r) {
  const i = globalThis.Object.values(t.$defs), o = t.$defs[t.$ref];
  yield* zn(o, [...e, ...i], n, r);
}
function* Lee(t, e, n, r) {
  if (!bM(r))
    return yield Pe(ue.Integer, t, n, r);
  yt(t.exclusiveMaximum) && !(r < t.exclusiveMaximum) && (yield Pe(ue.IntegerExclusiveMaximum, t, n, r)), yt(t.exclusiveMinimum) && !(r > t.exclusiveMinimum) && (yield Pe(ue.IntegerExclusiveMinimum, t, n, r)), yt(t.maximum) && !(r <= t.maximum) && (yield Pe(ue.IntegerMaximum, t, n, r)), yt(t.minimum) && !(r >= t.minimum) && (yield Pe(ue.IntegerMinimum, t, n, r)), yt(t.multipleOf) && r % t.multipleOf !== 0 && (yield Pe(ue.IntegerMultipleOf, t, n, r));
}
function* jee(t, e, n, r) {
  let i = !1;
  for (const o of t.allOf)
    for (const s of zn(o, e, n, r))
      i = !0, yield s;
  if (i)
    return yield Pe(ue.Intersect, t, n, r);
  if (t.unevaluatedProperties === !1) {
    const o = new RegExp(vu(t));
    for (const s of Object.getOwnPropertyNames(r))
      o.test(s) || (yield Pe(ue.IntersectUnevaluatedProperties, t, `${n}/${s}`, r));
  }
  if (typeof t.unevaluatedProperties == "object") {
    const o = new RegExp(vu(t));
    for (const s of Object.getOwnPropertyNames(r))
      if (!o.test(s)) {
        const a = zn(t.unevaluatedProperties, e, `${n}/${s}`, r[s]).next();
        a.done || (yield a.value);
      }
  }
}
function* Qee(t, e, n, r) {
  yM(r) || (yield Pe(ue.Iterator, t, n, r));
}
function* $ee(t, e, n, r) {
  r !== t.const && (yield Pe(ue.Literal, t, n, r));
}
function* Gee(t, e, n, r) {
  yield Pe(ue.Never, t, n, r);
}
function* qee(t, e, n, r) {
  zn(t.not, e, n, r).next().done === !0 && (yield Pe(ue.Not, t, n, r));
}
function* Hee(t, e, n, r) {
  Md(r) || (yield Pe(ue.Null, t, n, r));
}
function* Wee(t, e, n, r) {
  if (!bn.IsNumberLike(r))
    return yield Pe(ue.Number, t, n, r);
  yt(t.exclusiveMaximum) && !(r < t.exclusiveMaximum) && (yield Pe(ue.NumberExclusiveMaximum, t, n, r)), yt(t.exclusiveMinimum) && !(r > t.exclusiveMinimum) && (yield Pe(ue.NumberExclusiveMinimum, t, n, r)), yt(t.maximum) && !(r <= t.maximum) && (yield Pe(ue.NumberMaximum, t, n, r)), yt(t.minimum) && !(r >= t.minimum) && (yield Pe(ue.NumberMinimum, t, n, r)), yt(t.multipleOf) && r % t.multipleOf !== 0 && (yield Pe(ue.NumberMultipleOf, t, n, r));
}
function* zee(t, e, n, r) {
  if (!bn.IsObjectLike(r))
    return yield Pe(ue.Object, t, n, r);
  yt(t.minProperties) && !(Object.getOwnPropertyNames(r).length >= t.minProperties) && (yield Pe(ue.ObjectMinProperties, t, n, r)), yt(t.maxProperties) && !(Object.getOwnPropertyNames(r).length <= t.maxProperties) && (yield Pe(ue.ObjectMaxProperties, t, n, r));
  const i = Array.isArray(t.required) ? t.required : [], o = Object.getOwnPropertyNames(t.properties), s = Object.getOwnPropertyNames(r);
  for (const a of i)
    s.includes(a) || (yield Pe(ue.ObjectRequiredProperty, t.properties[a], `${n}/${Jo(a)}`, void 0));
  if (t.additionalProperties === !1)
    for (const a of s)
      o.includes(a) || (yield Pe(ue.ObjectAdditionalProperties, t, `${n}/${Jo(a)}`, r[a]));
  if (typeof t.additionalProperties == "object")
    for (const a of s)
      o.includes(a) || (yield* zn(t.additionalProperties, e, `${n}/${Jo(a)}`, r[a]));
  for (const a of o) {
    const c = t.properties[a];
    t.required && t.required.includes(a) ? (yield* zn(c, e, `${n}/${Jo(a)}`, r[a]), cl(t) && !(a in r) && (yield Pe(ue.ObjectRequiredProperty, c, `${n}/${Jo(a)}`, void 0))) : bn.IsExactOptionalProperty(r, a) && (yield* zn(c, e, `${n}/${Jo(a)}`, r[a]));
  }
}
function* Kee(t, e, n, r) {
  vM(r) || (yield Pe(ue.Promise, t, n, r));
}
function* Vee(t, e, n, r) {
  if (!bn.IsRecordLike(r))
    return yield Pe(ue.Object, t, n, r);
  yt(t.minProperties) && !(Object.getOwnPropertyNames(r).length >= t.minProperties) && (yield Pe(ue.ObjectMinProperties, t, n, r)), yt(t.maxProperties) && !(Object.getOwnPropertyNames(r).length <= t.maxProperties) && (yield Pe(ue.ObjectMaxProperties, t, n, r));
  const [i, o] = Object.entries(t.patternProperties)[0], s = new RegExp(i);
  for (const [a, c] of Object.entries(r))
    s.test(a) && (yield* zn(o, e, `${n}/${Jo(a)}`, c));
  if (typeof t.additionalProperties == "object")
    for (const [a, c] of Object.entries(r))
      s.test(a) || (yield* zn(t.additionalProperties, e, `${n}/${Jo(a)}`, c));
  if (t.additionalProperties === !1) {
    for (const [a, c] of Object.entries(r))
      if (!s.test(a))
        return yield Pe(ue.ObjectAdditionalProperties, t, `${n}/${Jo(a)}`, c);
  }
}
function* Yee(t, e, n, r) {
  yield* zn(Vt(t, e), e, n, r);
}
function* Jee(t, e, n, r) {
  if (!Ut(r))
    return yield Pe(ue.String, t, n, r);
  if (yt(t.minLength) && !(r.length >= t.minLength) && (yield Pe(ue.StringMinLength, t, n, r)), yt(t.maxLength) && !(r.length <= t.maxLength) && (yield Pe(ue.StringMaxLength, t, n, r)), !new RegExp(t.source, t.flags).test(r))
    return yield Pe(ue.RegExp, t, n, r);
}
function* Xee(t, e, n, r) {
  if (!Ut(r))
    return yield Pe(ue.String, t, n, r);
  yt(t.minLength) && !(r.length >= t.minLength) && (yield Pe(ue.StringMinLength, t, n, r)), yt(t.maxLength) && !(r.length <= t.maxLength) && (yield Pe(ue.StringMaxLength, t, n, r)), Ut(t.pattern) && (new RegExp(t.pattern).test(r) || (yield Pe(ue.StringPattern, t, n, r))), Ut(t.format) && (LE(t.format) ? jE(t.format)(r) || (yield Pe(ue.StringFormat, t, n, r)) : yield Pe(ue.StringFormatUnknown, t, n, r));
}
function* Zee(t, e, n, r) {
  Rd(r) || (yield Pe(ue.Symbol, t, n, r));
}
function* ete(t, e, n, r) {
  if (!Ut(r))
    return yield Pe(ue.String, t, n, r);
  new RegExp(t.pattern).test(r) || (yield Pe(ue.StringPattern, t, n, r));
}
function* tte(t, e, n, r) {
  yield* zn(Vt(t, e), e, n, r);
}
function* nte(t, e, n, r) {
  if (!Lt(r))
    return yield Pe(ue.Tuple, t, n, r);
  if (t.items === void 0 && r.length !== 0)
    return yield Pe(ue.TupleLength, t, n, r);
  if (r.length !== t.maxItems)
    return yield Pe(ue.TupleLength, t, n, r);
  if (t.items)
    for (let i = 0; i < t.items.length; i++)
      yield* zn(t.items[i], e, `${n}/${i}`, r[i]);
}
function* rte(t, e, n, r) {
  zr(r) || (yield Pe(ue.Undefined, t, n, r));
}
function* ite(t, e, n, r) {
  if ($t(t, e, r))
    return;
  const i = t.anyOf.map((o) => new dA(zn(o, e, n, r)));
  yield Pe(ue.Union, t, n, r, i);
}
function* ote(t, e, n, r) {
  if (!BE(r))
    return yield Pe(ue.Uint8Array, t, n, r);
  yt(t.maxByteLength) && !(r.length <= t.maxByteLength) && (yield Pe(ue.Uint8ArrayMaxByteLength, t, n, r)), yt(t.minByteLength) && !(r.length >= t.minByteLength) && (yield Pe(ue.Uint8ArrayMinByteLength, t, n, r));
}
function* ste(t, e, n, r) {
}
function* ate(t, e, n, r) {
  bn.IsVoidLike(r) || (yield Pe(ue.Void, t, n, r));
}
function* cte(t, e, n, r) {
  QE(t[Ee])(t, r) || (yield Pe(ue.Kind, t, n, r));
}
function* zn(t, e, n, r) {
  const i = yt(t.$id) ? [...e, t] : e, o = t;
  switch (o[Ee]) {
    case "Any":
      return yield* kee();
    case "Argument":
      return yield* Nee();
    case "Array":
      return yield* Pee(o, i, n, r);
    case "AsyncIterator":
      return yield* Dee(o, i, n, r);
    case "BigInt":
      return yield* Fee(o, i, n, r);
    case "Boolean":
      return yield* Oee(o, i, n, r);
    case "Constructor":
      return yield* Mee(o, i, n, r);
    case "Date":
      return yield* Ree(o, i, n, r);
    case "Function":
      return yield* Bee(o, i, n, r);
    case "Import":
      return yield* Uee(o, i, n, r);
    case "Integer":
      return yield* Lee(o, i, n, r);
    case "Intersect":
      return yield* jee(o, i, n, r);
    case "Iterator":
      return yield* Qee(o, i, n, r);
    case "Literal":
      return yield* $ee(o, i, n, r);
    case "Never":
      return yield* Gee(o, i, n, r);
    case "Not":
      return yield* qee(o, i, n, r);
    case "Null":
      return yield* Hee(o, i, n, r);
    case "Number":
      return yield* Wee(o, i, n, r);
    case "Object":
      return yield* zee(o, i, n, r);
    case "Promise":
      return yield* Kee(o, i, n, r);
    case "Record":
      return yield* Vee(o, i, n, r);
    case "Ref":
      return yield* Yee(o, i, n, r);
    case "RegExp":
      return yield* Jee(o, i, n, r);
    case "String":
      return yield* Xee(o, i, n, r);
    case "Symbol":
      return yield* Zee(o, i, n, r);
    case "TemplateLiteral":
      return yield* ete(o, i, n, r);
    case "This":
      return yield* tte(o, i, n, r);
    case "Tuple":
      return yield* nte(o, i, n, r);
    case "Undefined":
      return yield* rte(o, i, n, r);
    case "Union":
      return yield* ite(o, i, n, r);
    case "Uint8Array":
      return yield* ote(o, i, n, r);
    case "Unknown":
      return yield* ste();
    case "Void":
      return yield* ate(o, i, n, r);
    default:
      if (!hu(o[Ee]))
        throw new Tee(t);
      return yield* cte(o, i, n, r);
  }
}
function oR(...t) {
  const e = t.length === 3 ? zn(t[0], t[1], "", t[2]) : zn(t[0], [], "", t[1]);
  return new dA(e);
}
class ute extends mn {
  constructor(e, n, r) {
    super("Unable to decode value as it does not match the expected schema"), this.schema = e, this.value = n, this.error = r;
  }
}
class lte extends mn {
  constructor(e, n, r, i) {
    super(i instanceof Error ? i.message : "Unknown error"), this.schema = e, this.path = n, this.value = r, this.error = i;
  }
}
function Kt(t, e, n) {
  try {
    return Qt(t) ? t[Ur].Decode(n) : n;
  } catch (r) {
    throw new lte(t, e, n, r);
  }
}
function pte(t, e, n, r) {
  return Lt(r) ? Kt(t, n, r.map((i, o) => mo(t.items, e, `${n}/${o}`, i))) : Kt(t, n, r);
}
function dte(t, e, n, r) {
  if (!Pt(r) || UE(r))
    return Kt(t, n, r);
  const i = QM(t), o = i.map((l) => l[0]), s = { ...r };
  for (const [l, d] of i)
    l in s && (s[l] = mo(d, e, `${n}/${l}`, s[l]));
  if (!Qt(t.unevaluatedProperties))
    return Kt(t, n, s);
  const a = Object.getOwnPropertyNames(s), c = t.unevaluatedProperties, u = { ...s };
  for (const l of a)
    o.includes(l) || (u[l] = Kt(c, `${n}/${l}`, u[l]));
  return Kt(t, n, u);
}
function fte(t, e, n, r) {
  const i = globalThis.Object.values(t.$defs), o = t.$defs[t.$ref], s = mo(o, [...e, ...i], n, r);
  return Kt(t, n, s);
}
function hte(t, e, n, r) {
  return Kt(t, n, mo(t.not, e, n, r));
}
function mte(t, e, n, r) {
  if (!Pt(r))
    return Kt(t, n, r);
  const i = ba(t), o = { ...r };
  for (const u of i)
    lt(o, u) && (zr(o[u]) && (!qd(t.properties[u]) || bn.IsExactOptionalProperty(o, u)) || (o[u] = mo(t.properties[u], e, `${n}/${u}`, o[u])));
  if (!Ir(t.additionalProperties))
    return Kt(t, n, o);
  const s = Object.getOwnPropertyNames(o), a = t.additionalProperties, c = { ...o };
  for (const u of s)
    i.includes(u) || (c[u] = Kt(a, `${n}/${u}`, c[u]));
  return Kt(t, n, c);
}
function gte(t, e, n, r) {
  if (!Pt(r))
    return Kt(t, n, r);
  const i = Object.getOwnPropertyNames(t.patternProperties)[0], o = new RegExp(i), s = { ...r };
  for (const l of Object.getOwnPropertyNames(r))
    o.test(l) && (s[l] = mo(t.patternProperties[i], e, `${n}/${l}`, s[l]));
  if (!Ir(t.additionalProperties))
    return Kt(t, n, s);
  const a = Object.getOwnPropertyNames(s), c = t.additionalProperties, u = { ...s };
  for (const l of a)
    o.test(l) || (u[l] = Kt(c, `${n}/${l}`, u[l]));
  return Kt(t, n, u);
}
function yte(t, e, n, r) {
  const i = Vt(t, e);
  return Kt(t, n, mo(i, e, n, r));
}
function vte(t, e, n, r) {
  const i = Vt(t, e);
  return Kt(t, n, mo(i, e, n, r));
}
function bte(t, e, n, r) {
  return Lt(r) && Lt(t.items) ? Kt(t, n, t.items.map((i, o) => mo(i, e, `${n}/${o}`, r[o]))) : Kt(t, n, r);
}
function xte(t, e, n, r) {
  for (const i of t.anyOf) {
    if (!$t(i, e, r))
      continue;
    const o = mo(i, e, n, r);
    return Kt(t, n, o);
  }
  return Kt(t, n, r);
}
function mo(t, e, n, r) {
  const i = Ss(t, e), o = t;
  switch (t[Ee]) {
    case "Array":
      return pte(o, i, n, r);
    case "Import":
      return fte(o, i, n, r);
    case "Intersect":
      return dte(o, i, n, r);
    case "Not":
      return hte(o, i, n, r);
    case "Object":
      return mte(o, i, n, r);
    case "Record":
      return gte(o, i, n, r);
    case "Ref":
      return yte(o, i, n, r);
    case "Symbol":
      return Kt(o, n, r);
    case "This":
      return vte(o, i, n, r);
    case "Tuple":
      return bte(o, i, n, r);
    case "Union":
      return xte(o, i, n, r);
    default:
      return Kt(o, n, r);
  }
}
function sR(t, e, n) {
  return mo(t, e, "", n);
}
class wte extends mn {
  constructor(e, n, r) {
    super("The encoded value does not match the expected schema"), this.schema = e, this.value = n, this.error = r;
  }
}
class Ste extends mn {
  constructor(e, n, r, i) {
    super(`${i instanceof Error ? i.message : "Unknown error"}`), this.schema = e, this.path = n, this.value = r, this.error = i;
  }
}
function or(t, e, n) {
  try {
    return Qt(t) ? t[Ur].Encode(n) : n;
  } catch (r) {
    throw new Ste(t, e, n, r);
  }
}
function _te(t, e, n, r) {
  const i = or(t, n, r);
  return Lt(i) ? i.map((o, s) => to(t.items, e, `${n}/${s}`, o)) : i;
}
function Ete(t, e, n, r) {
  const i = globalThis.Object.values(t.$defs), o = t.$defs[t.$ref], s = or(t, n, r);
  return to(o, [...e, ...i], n, s);
}
function Ate(t, e, n, r) {
  const i = or(t, n, r);
  if (!Pt(r) || UE(r))
    return i;
  const o = QM(t), s = o.map((d) => d[0]), a = { ...i };
  for (const [d, f] of o)
    d in a && (a[d] = to(f, e, `${n}/${d}`, a[d]));
  if (!Qt(t.unevaluatedProperties))
    return a;
  const c = Object.getOwnPropertyNames(a), u = t.unevaluatedProperties, l = { ...a };
  for (const d of c)
    s.includes(d) || (l[d] = or(u, `${n}/${d}`, l[d]));
  return l;
}
function Ite(t, e, n, r) {
  return or(t.not, n, or(t, n, r));
}
function Cte(t, e, n, r) {
  const i = or(t, n, r);
  if (!Pt(i))
    return i;
  const o = ba(t), s = { ...i };
  for (const l of o)
    lt(s, l) && (zr(s[l]) && (!qd(t.properties[l]) || bn.IsExactOptionalProperty(s, l)) || (s[l] = to(t.properties[l], e, `${n}/${l}`, s[l])));
  if (!Ir(t.additionalProperties))
    return s;
  const a = Object.getOwnPropertyNames(s), c = t.additionalProperties, u = { ...s };
  for (const l of a)
    o.includes(l) || (u[l] = or(c, `${n}/${l}`, u[l]));
  return u;
}
function Tte(t, e, n, r) {
  const i = or(t, n, r);
  if (!Pt(r))
    return i;
  const o = Object.getOwnPropertyNames(t.patternProperties)[0], s = new RegExp(o), a = { ...i };
  for (const d of Object.getOwnPropertyNames(r))
    s.test(d) && (a[d] = to(t.patternProperties[o], e, `${n}/${d}`, a[d]));
  if (!Ir(t.additionalProperties))
    return a;
  const c = Object.getOwnPropertyNames(a), u = t.additionalProperties, l = { ...a };
  for (const d of c)
    s.test(d) || (l[d] = or(u, `${n}/${d}`, l[d]));
  return l;
}
function kte(t, e, n, r) {
  const i = Vt(t, e), o = to(i, e, n, r);
  return or(t, n, o);
}
function Nte(t, e, n, r) {
  const i = Vt(t, e), o = to(i, e, n, r);
  return or(t, n, o);
}
function Pte(t, e, n, r) {
  const i = or(t, n, r);
  return Lt(t.items) ? t.items.map((o, s) => to(o, e, `${n}/${s}`, i[s])) : [];
}
function Dte(t, e, n, r) {
  for (const i of t.anyOf) {
    if (!$t(i, e, r))
      continue;
    const o = to(i, e, n, r);
    return or(t, n, o);
  }
  for (const i of t.anyOf) {
    const o = to(i, e, n, r);
    if ($t(t, e, o))
      return or(t, n, o);
  }
  return or(t, n, r);
}
function to(t, e, n, r) {
  const i = Ss(t, e), o = t;
  switch (t[Ee]) {
    case "Array":
      return _te(o, i, n, r);
    case "Import":
      return Ete(o, i, n, r);
    case "Intersect":
      return Ate(o, i, n, r);
    case "Not":
      return Ite(o, i, n, r);
    case "Object":
      return Cte(o, i, n, r);
    case "Record":
      return Tte(o, i, n, r);
    case "Ref":
      return kte(o, i, n, r);
    case "This":
      return Nte(o, i, n, r);
    case "Tuple":
      return Pte(o, i, n, r);
    case "Union":
      return Dte(o, i, n, r);
    default:
      return or(o, n, r);
  }
}
function aR(t, e, n) {
  return to(t, e, "", n);
}
function Fte(t, e) {
  return Qt(t) || Mn(t.items, e);
}
function Ote(t, e) {
  return Qt(t) || Mn(t.items, e);
}
function Mte(t, e) {
  return Qt(t) || Mn(t.returns, e) || t.parameters.some((n) => Mn(n, e));
}
function Rte(t, e) {
  return Qt(t) || Mn(t.returns, e) || t.parameters.some((n) => Mn(n, e));
}
function Bte(t, e) {
  return Qt(t) || Qt(t.unevaluatedProperties) || t.allOf.some((n) => Mn(n, e));
}
function Ute(t, e) {
  const n = globalThis.Object.getOwnPropertyNames(t.$defs).reduce((i, o) => [...i, t.$defs[o]], []), r = t.$defs[t.$ref];
  return Qt(t) || Mn(r, [...n, ...e]);
}
function Lte(t, e) {
  return Qt(t) || Mn(t.items, e);
}
function jte(t, e) {
  return Qt(t) || Mn(t.not, e);
}
function Qte(t, e) {
  return Qt(t) || Object.values(t.properties).some((n) => Mn(n, e)) || Ir(t.additionalProperties) && Mn(t.additionalProperties, e);
}
function $te(t, e) {
  return Qt(t) || Mn(t.item, e);
}
function Gte(t, e) {
  const n = Object.getOwnPropertyNames(t.patternProperties)[0], r = t.patternProperties[n];
  return Qt(t) || Mn(r, e) || Ir(t.additionalProperties) && Qt(t.additionalProperties);
}
function qte(t, e) {
  return Qt(t) ? !0 : Mn(Vt(t, e), e);
}
function Hte(t, e) {
  return Qt(t) ? !0 : Mn(Vt(t, e), e);
}
function Wte(t, e) {
  return Qt(t) || !zr(t.items) && t.items.some((n) => Mn(n, e));
}
function zte(t, e) {
  return Qt(t) || t.anyOf.some((n) => Mn(n, e));
}
function Mn(t, e) {
  const n = Ss(t, e), r = t;
  if (t.$id && iS.has(t.$id))
    return !1;
  switch (t.$id && iS.add(t.$id), t[Ee]) {
    case "Array":
      return Fte(r, n);
    case "AsyncIterator":
      return Ote(r, n);
    case "Constructor":
      return Mte(r, n);
    case "Function":
      return Rte(r, n);
    case "Import":
      return Ute(r, n);
    case "Intersect":
      return Bte(r, n);
    case "Iterator":
      return Lte(r, n);
    case "Not":
      return jte(r, n);
    case "Object":
      return Qte(r, n);
    case "Promise":
      return $te(r, n);
    case "Record":
      return Gte(r, n);
    case "Ref":
      return qte(r, n);
    case "This":
      return Hte(r, n);
    case "Tuple":
      return Wte(r, n);
    case "Union":
      return zte(r, n);
    default:
      return Qt(t);
  }
}
const iS = /* @__PURE__ */ new Set();
function oS(t, e) {
  return iS.clear(), Mn(t, e);
}
class Kte {
  constructor(e, n, r, i) {
    this.schema = e, this.references = n, this.checkFunc = r, this.code = i, this.hasTransform = oS(e, n);
  }
  /** Returns the generated assertion code used to validate this type. */
  Code() {
    return this.code;
  }
  /** Returns the schema type used to validate */
  Schema() {
    return this.schema;
  }
  /** Returns reference types used to validate */
  References() {
    return this.references;
  }
  /** Returns an iterator for each error in this value. */
  Errors(e) {
    return oR(this.schema, this.references, e);
  }
  /** Returns true if the value matches the compiled type. */
  Check(e) {
    return this.checkFunc(e);
  }
  /** Decodes a value or throws if error */
  Decode(e) {
    if (!this.checkFunc(e))
      throw new ute(this.schema, e, this.Errors(e).First());
    return this.hasTransform ? sR(this.schema, this.references, e) : e;
  }
  /** Encodes a value or throws if error */
  Encode(e) {
    const n = this.hasTransform ? aR(this.schema, this.references, e) : e;
    if (!this.checkFunc(n))
      throw new wte(this.schema, e, this.Errors(e).First());
    return n;
  }
}
var ts;
(function(t) {
  function e(o) {
    return o === 36;
  }
  t.DollarSign = e;
  function n(o) {
    return o === 95;
  }
  t.IsUnderscore = n;
  function r(o) {
    return o >= 65 && o <= 90 || o >= 97 && o <= 122;
  }
  t.IsAlpha = r;
  function i(o) {
    return o >= 48 && o <= 57;
  }
  t.IsNumeric = i;
})(ts || (ts = {}));
var Lm;
(function(t) {
  function e(o) {
    return o.length === 0 ? !1 : ts.IsNumeric(o.charCodeAt(0));
  }
  function n(o) {
    if (e(o))
      return !1;
    for (let s = 0; s < o.length; s++) {
      const a = o.charCodeAt(s);
      if (!(ts.IsAlpha(a) || ts.IsNumeric(a) || ts.DollarSign(a) || ts.IsUnderscore(a)))
        return !1;
    }
    return !0;
  }
  function r(o) {
    return o.replace(/'/g, "\\'");
  }
  function i(o, s) {
    return n(s) ? `${o}.${s}` : `${o}['${r(s)}']`;
  }
  t.Encode = i;
})(Lm || (Lm = {}));
var sS;
(function(t) {
  function e(n) {
    const r = [];
    for (let i = 0; i < n.length; i++) {
      const o = n.charCodeAt(i);
      ts.IsNumeric(o) || ts.IsAlpha(o) ? r.push(n.charAt(i)) : r.push(`_${o}_`);
    }
    return r.join("").replace(/__/g, "_");
  }
  t.Encode = e;
})(sS || (sS = {}));
var aS;
(function(t) {
  function e(n) {
    return n.replace(/'/g, "\\'");
  }
  t.Escape = e;
})(aS || (aS = {}));
class Vte extends mn {
  constructor(e) {
    super("Unknown type"), this.schema = e;
  }
}
class EN extends mn {
  constructor(e) {
    super("Preflight validation check failed to guard for the given schema"), this.schema = e;
  }
}
var Ba;
(function(t) {
  function e(s, a, c) {
    return bn.ExactOptionalPropertyTypes ? `('${a}' in ${s} ? ${c} : true)` : `(${Lm.Encode(s, a)} !== undefined ? ${c} : true)`;
  }
  t.IsExactOptionalProperty = e;
  function n(s) {
    return bn.AllowArrayObject ? `(typeof ${s} === 'object' && ${s} !== null)` : `(typeof ${s} === 'object' && ${s} !== null && !Array.isArray(${s}))`;
  }
  t.IsObjectLike = n;
  function r(s) {
    return bn.AllowArrayObject ? `(typeof ${s} === 'object' && ${s} !== null && !(${s} instanceof Date) && !(${s} instanceof Uint8Array))` : `(typeof ${s} === 'object' && ${s} !== null && !Array.isArray(${s}) && !(${s} instanceof Date) && !(${s} instanceof Uint8Array))`;
  }
  t.IsRecordLike = r;
  function i(s) {
    return bn.AllowNaN ? `typeof ${s} === 'number'` : `Number.isFinite(${s})`;
  }
  t.IsNumberLike = i;
  function o(s) {
    return bn.AllowNullVoid ? `(${s} === undefined || ${s} === null)` : `${s} === undefined`;
  }
  t.IsVoidLike = o;
})(Ba || (Ba = {}));
var wu;
(function(t) {
  function e(P) {
    return P[Ee] === "Any" || P[Ee] === "Unknown";
  }
  function* n(P, Q, z) {
    yield "true";
  }
  function* r(P, Q, z) {
    yield "true";
  }
  function* i(P, Q, z) {
    yield `Array.isArray(${z})`;
    const [se, ae] = [F("value", "any"), F("acc", "number")];
    Je(P.maxItems) && (yield `${z}.length <= ${P.maxItems}`), Je(P.minItems) && (yield `${z}.length >= ${P.minItems}`);
    const ie = C(P.items, Q, "value");
    if (yield `${z}.every((${se}) => ${ie})`, Zt(P.contains) || Je(P.minContains) || Je(P.maxContains)) {
      const we = Zt(P.contains) ? P.contains : en(), Oe = C(we, Q, "value"), He = Je(P.minContains) ? [`(count >= ${P.minContains})`] : [], We = Je(P.maxContains) ? [`(count <= ${P.maxContains})`] : [], Ye = `const count = value.reduce((${ae}, ${se}) => ${Oe} ? acc + 1 : acc, 0)`, Ke = ["(count > 0)", ...He, ...We].join(" && ");
      yield `((${se}) => { ${Ye}; return ${Ke}})(${z})`;
    }
    P.uniqueItems === !0 && (yield `((${se}) => { const set = new Set(); for(const element of value) { const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true } )(${z})`);
  }
  function* o(P, Q, z) {
    yield `(typeof value === 'object' && Symbol.asyncIterator in ${z})`;
  }
  function* s(P, Q, z) {
    yield `(typeof ${z} === 'bigint')`, _i(P.exclusiveMaximum) && (yield `${z} < BigInt(${P.exclusiveMaximum})`), _i(P.exclusiveMinimum) && (yield `${z} > BigInt(${P.exclusiveMinimum})`), _i(P.maximum) && (yield `${z} <= BigInt(${P.maximum})`), _i(P.minimum) && (yield `${z} >= BigInt(${P.minimum})`), _i(P.multipleOf) && (yield `(${z} % BigInt(${P.multipleOf})) === 0`);
  }
  function* a(P, Q, z) {
    yield `(typeof ${z} === 'boolean')`;
  }
  function* c(P, Q, z) {
    yield* N(P.returns, Q, `${z}.prototype`);
  }
  function* u(P, Q, z) {
    yield `(${z} instanceof Date) && Number.isFinite(${z}.getTime())`, Je(P.exclusiveMaximumTimestamp) && (yield `${z}.getTime() < ${P.exclusiveMaximumTimestamp}`), Je(P.exclusiveMinimumTimestamp) && (yield `${z}.getTime() > ${P.exclusiveMinimumTimestamp}`), Je(P.maximumTimestamp) && (yield `${z}.getTime() <= ${P.maximumTimestamp}`), Je(P.minimumTimestamp) && (yield `${z}.getTime() >= ${P.minimumTimestamp}`), Je(P.multipleOfTimestamp) && (yield `(${z}.getTime() % ${P.multipleOfTimestamp}) === 0`);
  }
  function* l(P, Q, z) {
    yield `(typeof ${z} === 'function')`;
  }
  function* d(P, Q, z) {
    const se = globalThis.Object.getOwnPropertyNames(P.$defs).reduce((ae, ie) => [...ae, P.$defs[ie]], []);
    yield* N(al(P.$ref), [...Q, ...se], z);
  }
  function* f(P, Q, z) {
    yield `Number.isInteger(${z})`, Je(P.exclusiveMaximum) && (yield `${z} < ${P.exclusiveMaximum}`), Je(P.exclusiveMinimum) && (yield `${z} > ${P.exclusiveMinimum}`), Je(P.maximum) && (yield `${z} <= ${P.maximum}`), Je(P.minimum) && (yield `${z} >= ${P.minimum}`), Je(P.multipleOf) && (yield `(${z} % ${P.multipleOf}) === 0`);
  }
  function* m(P, Q, z) {
    const se = P.allOf.map((ae) => C(ae, Q, z)).join(" && ");
    if (P.unevaluatedProperties === !1) {
      const ae = k(`${new RegExp(vu(P))};`), ie = `Object.getOwnPropertyNames(${z}).every(key => ${ae}.test(key))`;
      yield `(${se} && ${ie})`;
    } else if (Zt(P.unevaluatedProperties)) {
      const ae = k(`${new RegExp(vu(P))};`), ie = `Object.getOwnPropertyNames(${z}).every(key => ${ae}.test(key) || ${C(P.unevaluatedProperties, Q, `${z}[key]`)})`;
      yield `(${se} && ${ie})`;
    } else
      yield `(${se})`;
  }
  function* h(P, Q, z) {
    yield `(typeof value === 'object' && Symbol.iterator in ${z})`;
  }
  function* y(P, Q, z) {
    typeof P.const == "number" || typeof P.const == "boolean" ? yield `(${z} === ${P.const})` : yield `(${z} === '${aS.Escape(P.const)}')`;
  }
  function* x(P, Q, z) {
    yield "false";
  }
  function* g(P, Q, z) {
    yield `(!${C(P.not, Q, z)})`;
  }
  function* v(P, Q, z) {
    yield `(${z} === null)`;
  }
  function* S(P, Q, z) {
    yield Ba.IsNumberLike(z), Je(P.exclusiveMaximum) && (yield `${z} < ${P.exclusiveMaximum}`), Je(P.exclusiveMinimum) && (yield `${z} > ${P.exclusiveMinimum}`), Je(P.maximum) && (yield `${z} <= ${P.maximum}`), Je(P.minimum) && (yield `${z} >= ${P.minimum}`), Je(P.multipleOf) && (yield `(${z} % ${P.multipleOf}) === 0`);
  }
  function* E(P, Q, z) {
    yield Ba.IsObjectLike(z), Je(P.minProperties) && (yield `Object.getOwnPropertyNames(${z}).length >= ${P.minProperties}`), Je(P.maxProperties) && (yield `Object.getOwnPropertyNames(${z}).length <= ${P.maxProperties}`);
    const se = Object.getOwnPropertyNames(P.properties);
    for (const ae of se) {
      const ie = Lm.Encode(z, ae), we = P.properties[ae];
      if (P.required && P.required.includes(ae))
        yield* N(we, Q, ie), (cl(we) || e(we)) && (yield `('${ae}' in ${z})`);
      else {
        const Oe = C(we, Q, ie);
        yield Ba.IsExactOptionalProperty(z, ae, Oe);
      }
    }
    if (P.additionalProperties === !1)
      if (P.required && P.required.length === se.length)
        yield `Object.getOwnPropertyNames(${z}).length === ${se.length}`;
      else {
        const ae = `[${se.map((ie) => `'${ie}'`).join(", ")}]`;
        yield `Object.getOwnPropertyNames(${z}).every(key => ${ae}.includes(key))`;
      }
    if (typeof P.additionalProperties == "object") {
      const ae = C(P.additionalProperties, Q, `${z}[key]`), ie = `[${se.map((we) => `'${we}'`).join(", ")}]`;
      yield `(Object.getOwnPropertyNames(${z}).every(key => ${ie}.includes(key) || ${ae}))`;
    }
  }
  function* T(P, Q, z) {
    yield `${z} instanceof Promise`;
  }
  function* j(P, Q, z) {
    yield Ba.IsRecordLike(z), Je(P.minProperties) && (yield `Object.getOwnPropertyNames(${z}).length >= ${P.minProperties}`), Je(P.maxProperties) && (yield `Object.getOwnPropertyNames(${z}).length <= ${P.maxProperties}`);
    const [se, ae] = Object.entries(P.patternProperties)[0], ie = k(`${new RegExp(se)}`), we = C(ae, Q, "value"), Oe = Zt(P.additionalProperties) ? C(P.additionalProperties, Q, z) : P.additionalProperties === !1 ? "false" : "true", He = `(${ie}.test(key) ? ${we} : ${Oe})`;
    yield `(Object.entries(${z}).every(([key, value]) => ${He}))`;
  }
  function* q(P, Q, z) {
    const se = Vt(P, Q);
    if (U.functions.has(P.$ref))
      return yield `${L(P.$ref)}(${z})`;
    yield* N(se, Q, z);
  }
  function* Y(P, Q, z) {
    const se = k(`${new RegExp(P.source, P.flags)};`);
    yield `(typeof ${z} === 'string')`, Je(P.maxLength) && (yield `${z}.length <= ${P.maxLength}`), Je(P.minLength) && (yield `${z}.length >= ${P.minLength}`), yield `${se}.test(${z})`;
  }
  function* W(P, Q, z) {
    yield `(typeof ${z} === 'string')`, Je(P.maxLength) && (yield `${z}.length <= ${P.maxLength}`), Je(P.minLength) && (yield `${z}.length >= ${P.minLength}`), P.pattern !== void 0 && (yield `${k(`${new RegExp(P.pattern)};`)}.test(${z})`), P.format !== void 0 && (yield `format('${P.format}', ${z})`);
  }
  function* G(P, Q, z) {
    yield `(typeof ${z} === 'symbol')`;
  }
  function* J(P, Q, z) {
    yield `(typeof ${z} === 'string')`, yield `${k(`${new RegExp(P.pattern)};`)}.test(${z})`;
  }
  function* B(P, Q, z) {
    yield `${L(P.$ref)}(${z})`;
  }
  function* D(P, Q, z) {
    if (yield `Array.isArray(${z})`, P.items === void 0)
      return yield `${z}.length === 0`;
    yield `(${z}.length === ${P.maxItems})`;
    for (let se = 0; se < P.items.length; se++)
      yield `${C(P.items[se], Q, `${z}[${se}]`)}`;
  }
  function* X(P, Q, z) {
    yield `${z} === undefined`;
  }
  function* V(P, Q, z) {
    yield `(${P.anyOf.map((ae) => C(ae, Q, z)).join(" || ")})`;
  }
  function* K(P, Q, z) {
    yield `${z} instanceof Uint8Array`, Je(P.maxByteLength) && (yield `(${z}.length <= ${P.maxByteLength})`), Je(P.minByteLength) && (yield `(${z}.length >= ${P.minByteLength})`);
  }
  function* $(P, Q, z) {
    yield "true";
  }
  function* _(P, Q, z) {
    yield Ba.IsVoidLike(z);
  }
  function* I(P, Q, z) {
    const se = U.instances.size;
    U.instances.set(se, P), yield `kind('${P[Ee]}', ${se}, ${z})`;
  }
  function* N(P, Q, z, se = !0) {
    const ae = Ut(P.$id) ? [...Q, P] : Q, ie = P;
    if (se && Ut(P.$id)) {
      const we = L(P.$id);
      if (U.functions.has(we))
        return yield `${we}(${z})`;
      {
        U.functions.set(we, "<deferred>");
        const Oe = M(we, P, Q, "value", !1);
        return U.functions.set(we, Oe), yield `${we}(${z})`;
      }
    }
    switch (ie[Ee]) {
      case "Any":
        return yield* n();
      case "Argument":
        return yield* r();
      case "Array":
        return yield* i(ie, ae, z);
      case "AsyncIterator":
        return yield* o(ie, ae, z);
      case "BigInt":
        return yield* s(ie, ae, z);
      case "Boolean":
        return yield* a(ie, ae, z);
      case "Constructor":
        return yield* c(ie, ae, z);
      case "Date":
        return yield* u(ie, ae, z);
      case "Function":
        return yield* l(ie, ae, z);
      case "Import":
        return yield* d(ie, ae, z);
      case "Integer":
        return yield* f(ie, ae, z);
      case "Intersect":
        return yield* m(ie, ae, z);
      case "Iterator":
        return yield* h(ie, ae, z);
      case "Literal":
        return yield* y(ie, ae, z);
      case "Never":
        return yield* x();
      case "Not":
        return yield* g(ie, ae, z);
      case "Null":
        return yield* v(ie, ae, z);
      case "Number":
        return yield* S(ie, ae, z);
      case "Object":
        return yield* E(ie, ae, z);
      case "Promise":
        return yield* T(ie, ae, z);
      case "Record":
        return yield* j(ie, ae, z);
      case "Ref":
        return yield* q(ie, ae, z);
      case "RegExp":
        return yield* Y(ie, ae, z);
      case "String":
        return yield* W(ie, ae, z);
      case "Symbol":
        return yield* G(ie, ae, z);
      case "TemplateLiteral":
        return yield* J(ie, ae, z);
      case "This":
        return yield* B(ie, ae, z);
      case "Tuple":
        return yield* D(ie, ae, z);
      case "Undefined":
        return yield* X(ie, ae, z);
      case "Union":
        return yield* V(ie, ae, z);
      case "Uint8Array":
        return yield* K(ie, ae, z);
      case "Unknown":
        return yield* $();
      case "Void":
        return yield* _(ie, ae, z);
      default:
        if (!hu(ie[Ee]))
          throw new Vte(P);
        return yield* I(ie, ae, z);
    }
  }
  const U = {
    language: "javascript",
    // target language
    functions: /* @__PURE__ */ new Map(),
    // local functions
    variables: /* @__PURE__ */ new Map(),
    // local variables
    instances: /* @__PURE__ */ new Map()
    // exterior kind instances
  };
  function C(P, Q, z, se = !0) {
    return `(${[...N(P, Q, z, se)].join(" && ")})`;
  }
  function L(P) {
    return `check_${sS.Encode(P)}`;
  }
  function k(P) {
    const Q = `local_${U.variables.size}`;
    return U.variables.set(Q, `const ${Q} = ${P}`), Q;
  }
  function M(P, Q, z, se, ae = !0) {
    const [ie, we] = [`
`, (Ye) => "".padStart(Ye, " ")], Oe = F("value", "any"), He = A("boolean"), We = [...N(Q, z, se, ae)].map((Ye) => `${we(4)}${Ye}`).join(` &&${ie}`);
    return `function ${P}(${Oe})${He} {${ie}${we(2)}return (${ie}${We}${ie}${we(2)})
}`;
  }
  function F(P, Q) {
    const z = U.language === "typescript" ? `: ${Q}` : "";
    return `${P}${z}`;
  }
  function A(P) {
    return U.language === "typescript" ? `: ${P}` : "";
  }
  function O(P, Q, z) {
    const se = M("check", P, Q, "value"), ae = F("value", "any"), ie = A("boolean"), we = [...U.functions.values()], Oe = [...U.variables.values()], He = Ut(P.$id) ? `return function check(${ae})${ie} {
  return ${L(P.$id)}(value)
}` : `return ${se}`;
    return [...Oe, ...we, He].join(`
`);
  }
  function Z(...P) {
    const Q = { language: "javascript" }, [z, se, ae] = P.length === 2 && Lt(P[1]) ? [P[0], P[1], Q] : P.length === 2 && !Lt(P[1]) ? [P[0], [], P[1]] : P.length === 3 ? [P[0], P[1], P[2]] : P.length === 1 ? [P[0], [], Q] : [null, [], Q];
    if (U.language = ae.language, U.variables.clear(), U.functions.clear(), U.instances.clear(), !Zt(z))
      throw new EN(z);
    for (const ie of se)
      if (!Zt(ie))
        throw new EN(ie);
    return O(z, se);
  }
  t.Code = Z;
  function ee(P, Q = []) {
    const z = Z(P, Q, { language: "javascript" }), se = globalThis.Function("kind", "format", "hash", z), ae = new Map(U.instances);
    function ie(We, Ye, Ke) {
      if (!hu(We) || !ae.has(Ye))
        return !1;
      const nt = QE(We), qe = ae.get(Ye);
      return nt(qe, Ke);
    }
    function we(We, Ye) {
      return LE(We) ? jE(We)(Ye) : !1;
    }
    function Oe(We) {
      return nA(We);
    }
    const He = se(ie, we, Oe);
    return new Kte(P, Q, He, z);
  }
  t.Compile = ee;
})(wu || (wu = {}));
var Yte = function(t, e, n, r, i) {
  if (r === "m") throw new TypeError("Private method is not writable");
  if (r === "a" && !i) throw new TypeError("Private accessor was defined without a setter");
  if (typeof e == "function" ? t !== e || !i : !e.has(t)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
  return r === "a" ? i.call(t, n) : i ? i.value = n : e.set(t, n), n;
}, cR = function(t, e, n, r) {
  if (n === "a" && !r) throw new TypeError("Private accessor was defined without a getter");
  if (typeof e == "function" ? t !== e || !r : !e.has(t)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
  return n === "m" ? r : n === "a" ? r.call(t) : r ? r.value : e.get(t);
}, cS, jm, uR;
class Jte extends mn {
  constructor(e) {
    const n = e.First();
    super(n === void 0 ? "Invalid Value" : n.message), cS.add(this), jm.set(this, void 0), Yte(this, jm, e, "f"), this.error = n;
  }
  /** Returns an iterator for each error in this value. */
  Errors() {
    return new dA(cR(this, cS, "m", uR).call(this));
  }
}
jm = /* @__PURE__ */ new WeakMap(), cS = /* @__PURE__ */ new WeakSet(), uR = function* () {
  this.error && (yield this.error), yield* cR(this, jm, "f");
};
function AN(t, e, n) {
  if (!$t(t, e, n))
    throw new Jte(oR(t, e, n));
}
function Xte(...t) {
  return t.length === 3 ? AN(t[0], t[1], t[2]) : AN(t[0], [], t[1]);
}
function Zte(t) {
  const e = {};
  for (const n of Object.getOwnPropertyNames(t))
    e[n] = Vn(t[n]);
  for (const n of Object.getOwnPropertySymbols(t))
    e[n] = Vn(t[n]);
  return e;
}
function ene(t) {
  return t.map((e) => Vn(e));
}
function tne(t) {
  return t.slice();
}
function nne(t) {
  return new Map(Vn([...t.entries()]));
}
function rne(t) {
  return new Set(Vn([...t.entries()]));
}
function ine(t) {
  return new Date(t.toISOString());
}
function Vn(t) {
  if (Lt(t))
    return ene(t);
  if (Yu(t))
    return ine(t);
  if (mY(t))
    return tne(t);
  if (fY(t))
    return nne(t);
  if (hY(t))
    return rne(t);
  if (Pt(t))
    return Zte(t);
  if (UE(t))
    return t;
  throw new Error("ValueClone: Unable to clone value");
}
class no extends mn {
  constructor(e, n) {
    super(n), this.schema = e;
  }
}
function _t(t) {
  return e0(t) ? t() : Vn(t);
}
function one(t, e) {
  return lt(t, "default") ? _t(t.default) : {};
}
function sne(t, e) {
  return {};
}
function ane(t, e) {
  if (t.uniqueItems === !0 && !lt(t, "default"))
    throw new no(t, "Array with the uniqueItems constraint requires a default value");
  if ("contains" in t && !lt(t, "default"))
    throw new no(t, "Array with the contains constraint requires a default value");
  return "default" in t ? _t(t.default) : t.minItems !== void 0 ? Array.from({ length: t.minItems }).map((n) => ui(t.items, e)) : [];
}
function cne(t, e) {
  return lt(t, "default") ? _t(t.default) : (async function* () {
  })();
}
function une(t, e) {
  return lt(t, "default") ? _t(t.default) : BigInt(0);
}
function lne(t, e) {
  return lt(t, "default") ? _t(t.default) : !1;
}
function pne(t, e) {
  if (lt(t, "default"))
    return _t(t.default);
  {
    const n = ui(t.returns, e);
    return typeof n == "object" && !Array.isArray(n) ? class {
      constructor() {
        for (const [r, i] of Object.entries(n)) {
          const o = this;
          o[r] = i;
        }
      }
    } : class {
    };
  }
}
function dne(t, e) {
  return lt(t, "default") ? _t(t.default) : t.minimumTimestamp !== void 0 ? new Date(t.minimumTimestamp) : /* @__PURE__ */ new Date();
}
function fne(t, e) {
  return lt(t, "default") ? _t(t.default) : () => ui(t.returns, e);
}
function hne(t, e) {
  const n = globalThis.Object.values(t.$defs), r = t.$defs[t.$ref];
  return ui(r, [...e, ...n]);
}
function mne(t, e) {
  return lt(t, "default") ? _t(t.default) : t.minimum !== void 0 ? t.minimum : 0;
}
function gne(t, e) {
  if (lt(t, "default"))
    return _t(t.default);
  {
    const n = t.allOf.reduce((r, i) => {
      const o = ui(i, e);
      return typeof o == "object" ? { ...r, ...o } : o;
    }, {});
    if (!$t(t, e, n))
      throw new no(t, "Intersect produced invalid value. Consider using a default value.");
    return n;
  }
}
function yne(t, e) {
  return lt(t, "default") ? _t(t.default) : (function* () {
  })();
}
function vne(t, e) {
  return lt(t, "default") ? _t(t.default) : t.const;
}
function bne(t, e) {
  if (lt(t, "default"))
    return _t(t.default);
  throw new no(t, "Never types cannot be created. Consider using a default value.");
}
function xne(t, e) {
  if (lt(t, "default"))
    return _t(t.default);
  throw new no(t, "Not types must have a default value");
}
function wne(t, e) {
  return lt(t, "default") ? _t(t.default) : null;
}
function Sne(t, e) {
  return lt(t, "default") ? _t(t.default) : t.minimum !== void 0 ? t.minimum : 0;
}
function _ne(t, e) {
  if (lt(t, "default"))
    return _t(t.default);
  {
    const n = new Set(t.required), r = {};
    for (const [i, o] of Object.entries(t.properties))
      n.has(i) && (r[i] = ui(o, e));
    return r;
  }
}
function Ene(t, e) {
  return lt(t, "default") ? _t(t.default) : Promise.resolve(ui(t.item, e));
}
function Ane(t, e) {
  return lt(t, "default") ? _t(t.default) : {};
}
function Ine(t, e) {
  return lt(t, "default") ? _t(t.default) : ui(Vt(t, e), e);
}
function Cne(t, e) {
  if (lt(t, "default"))
    return _t(t.default);
  throw new no(t, "RegExp types cannot be created. Consider using a default value.");
}
function Tne(t, e) {
  if (t.pattern !== void 0) {
    if (lt(t, "default"))
      return _t(t.default);
    throw new no(t, "String types with patterns must specify a default value");
  } else if (t.format !== void 0) {
    if (lt(t, "default"))
      return _t(t.default);
    throw new no(t, "String types with formats must specify a default value");
  } else
    return lt(t, "default") ? _t(t.default) : t.minLength !== void 0 ? Array.from({ length: t.minLength }).map(() => " ").join("") : "";
}
function kne(t, e) {
  return lt(t, "default") ? _t(t.default) : "value" in t ? Symbol.for(t.value) : Symbol();
}
function Nne(t, e) {
  if (lt(t, "default"))
    return _t(t.default);
  if (!NM(t))
    throw new no(t, "Can only create template literals that produce a finite variants. Consider using a default value.");
  return JE(t)[0];
}
function Pne(t, e) {
  if (lR++ > Lne)
    throw new no(t, "Cannot create recursive type as it appears possibly infinite. Consider using a default.");
  return lt(t, "default") ? _t(t.default) : ui(Vt(t, e), e);
}
function Dne(t, e) {
  return lt(t, "default") ? _t(t.default) : t.items === void 0 ? [] : Array.from({ length: t.minItems }).map((n, r) => ui(t.items[r], e));
}
function Fne(t, e) {
  if (lt(t, "default"))
    return _t(t.default);
}
function One(t, e) {
  if (lt(t, "default"))
    return _t(t.default);
  if (t.anyOf.length === 0)
    throw new Error("ValueCreate.Union: Cannot create Union with zero variants");
  return ui(t.anyOf[0], e);
}
function Mne(t, e) {
  return lt(t, "default") ? _t(t.default) : t.minByteLength !== void 0 ? new Uint8Array(t.minByteLength) : new Uint8Array(0);
}
function Rne(t, e) {
  return lt(t, "default") ? _t(t.default) : {};
}
function Bne(t, e) {
  if (lt(t, "default"))
    return _t(t.default);
}
function Une(t, e) {
  if (lt(t, "default"))
    return _t(t.default);
  throw new Error("User defined types must specify a default value");
}
function ui(t, e) {
  const n = Ss(t, e), r = t;
  switch (r[Ee]) {
    case "Any":
      return one(r);
    case "Argument":
      return sne();
    case "Array":
      return ane(r, n);
    case "AsyncIterator":
      return cne(r);
    case "BigInt":
      return une(r);
    case "Boolean":
      return lne(r);
    case "Constructor":
      return pne(r, n);
    case "Date":
      return dne(r);
    case "Function":
      return fne(r, n);
    case "Import":
      return hne(r, n);
    case "Integer":
      return mne(r);
    case "Intersect":
      return gne(r, n);
    case "Iterator":
      return yne(r);
    case "Literal":
      return vne(r);
    case "Never":
      return bne(r);
    case "Not":
      return xne(r);
    case "Null":
      return wne(r);
    case "Number":
      return Sne(r);
    case "Object":
      return _ne(r, n);
    case "Promise":
      return Ene(r, n);
    case "Record":
      return Ane(r);
    case "Ref":
      return Ine(r, n);
    case "RegExp":
      return Cne(r);
    case "String":
      return Tne(r);
    case "Symbol":
      return kne(r);
    case "TemplateLiteral":
      return Nne(r);
    case "This":
      return Pne(r, n);
    case "Tuple":
      return Dne(r, n);
    case "Undefined":
      return Fne(r);
    case "Union":
      return One(r, n);
    case "Uint8Array":
      return Mne(r);
    case "Unknown":
      return Rne(r);
    case "Void":
      return Bne(r);
    default:
      if (!hu(r[Ee]))
        throw new no(r, "Unknown type");
      return Une(r);
  }
}
const Lne = 512;
let lR = 0;
function Sa(...t) {
  return lR = 0, t.length === 2 ? ui(t[0], t[1]) : ui(t[0], []);
}
class pR extends mn {
  constructor(e, n) {
    super(n), this.schema = e;
  }
}
function dR(t, e, n) {
  if (t[Ee] === "Object" && typeof n == "object" && !Md(n)) {
    const r = t, i = Object.getOwnPropertyNames(n);
    return Object.entries(r.properties).reduce((s, [a, c]) => {
      const u = c[Ee] === "Literal" && c.const === n[a] ? 100 : 0, l = $t(c, e, n[a]) ? 10 : 0, d = i.includes(a) ? 1 : 0;
      return s + (u + l + d);
    }, 0);
  } else if (t[Ee] === "Union") {
    const i = t.anyOf.map((o) => Vt(o, e)).map((o) => dR(o, e, n));
    return Math.max(...i);
  } else
    return $t(t, e, n) ? 1 : 0;
}
function jne(t, e, n) {
  const r = t.anyOf.map((s) => Vt(s, e));
  let [i, o] = [r[0], 0];
  for (const s of r) {
    const a = dR(s, e, n);
    a > o && (i = s, o = a);
  }
  return i;
}
function Qne(t, e, n) {
  if ("default" in t)
    return typeof n == "function" ? t.default : Vn(t.default);
  {
    const r = jne(t, e, n);
    return hR(r, e, n);
  }
}
function $ne(t, e, n) {
  return $t(t, e, n) ? Vn(n) : Sa(t, e);
}
function Gne(t, e, n) {
  return $t(t, e, n) ? n : Sa(t, e);
}
function qne(t, e, n) {
  if ($t(t, e, n))
    return Vn(n);
  const r = Lt(n) ? Vn(n) : Sa(t, e), i = Je(t.minItems) && r.length < t.minItems ? [...r, ...Array.from({ length: t.minItems - r.length }, () => null)] : r, s = (Je(t.maxItems) && i.length > t.maxItems ? i.slice(0, t.maxItems) : i).map((c) => ro(t.items, e, c));
  if (t.uniqueItems !== !0)
    return s;
  const a = [...new Set(s)];
  if (!$t(t, e, a))
    throw new pR(t, "Array cast produced invalid data due to uniqueItems constraint");
  return a;
}
function Hne(t, e, n) {
  if ($t(t, e, n))
    return Sa(t, e);
  const r = new Set(t.returns.required || []), i = function() {
  };
  for (const [o, s] of Object.entries(t.returns.properties))
    !r.has(o) && n.prototype[o] === void 0 || (i.prototype[o] = ro(s, e, n.prototype[o]));
  return i;
}
function Wne(t, e, n) {
  const r = globalThis.Object.values(t.$defs), i = t.$defs[t.$ref];
  return ro(i, [...e, ...r], n);
}
function fR(t, e) {
  return Pt(t) && !Pt(e) || !Pt(t) && Pt(e) ? t : !Pt(t) || !Pt(e) ? e : globalThis.Object.getOwnPropertyNames(t).reduce((n, r) => {
    const i = r in e ? fR(t[r], e[r]) : t[r];
    return { ...n, [r]: i };
  }, {});
}
function zne(t, e, n) {
  if ($t(t, e, n))
    return n;
  const r = Sa(t, e), i = fR(r, n);
  return $t(t, e, i) ? i : r;
}
function Kne(t, e, n) {
  throw new pR(t, "Never types cannot be cast");
}
function Vne(t, e, n) {
  if ($t(t, e, n))
    return n;
  if (n === null || typeof n != "object")
    return Sa(t, e);
  const r = new Set(t.required || []), i = {};
  for (const [o, s] of Object.entries(t.properties))
    !r.has(o) && n[o] === void 0 || (i[o] = ro(s, e, n[o]));
  if (typeof t.additionalProperties == "object") {
    const o = Object.getOwnPropertyNames(t.properties);
    for (const s of Object.getOwnPropertyNames(n))
      o.includes(s) || (i[s] = ro(t.additionalProperties, e, n[s]));
  }
  return i;
}
function Yne(t, e, n) {
  if ($t(t, e, n))
    return Vn(n);
  if (n === null || typeof n != "object" || Array.isArray(n) || n instanceof Date)
    return Sa(t, e);
  const r = Object.getOwnPropertyNames(t.patternProperties)[0], i = t.patternProperties[r], o = {};
  for (const [s, a] of Object.entries(n))
    o[s] = ro(i, e, a);
  return o;
}
function Jne(t, e, n) {
  return ro(Vt(t, e), e, n);
}
function Xne(t, e, n) {
  return ro(Vt(t, e), e, n);
}
function Zne(t, e, n) {
  return $t(t, e, n) ? Vn(n) : Lt(n) ? t.items === void 0 ? [] : t.items.map((r, i) => ro(r, e, n[i])) : Sa(t, e);
}
function ere(t, e, n) {
  return $t(t, e, n) ? Vn(n) : Qne(t, e, n);
}
function ro(t, e, n) {
  const r = Ut(t.$id) ? Ss(t, e) : e, i = t;
  switch (t[Ee]) {
    // --------------------------------------------------------------
    // Structural
    // --------------------------------------------------------------
    case "Array":
      return qne(i, r, n);
    case "Constructor":
      return Hne(i, r, n);
    case "Import":
      return Wne(i, r, n);
    case "Intersect":
      return zne(i, r, n);
    case "Never":
      return Kne(i);
    case "Object":
      return Vne(i, r, n);
    case "Record":
      return Yne(i, r, n);
    case "Ref":
      return Jne(i, r, n);
    case "This":
      return Xne(i, r, n);
    case "Tuple":
      return Zne(i, r, n);
    case "Union":
      return ere(i, r, n);
    // --------------------------------------------------------------
    // DefaultClone
    // --------------------------------------------------------------
    case "Date":
    case "Symbol":
    case "Uint8Array":
      return $ne(t, e, n);
    // --------------------------------------------------------------
    // Default
    // --------------------------------------------------------------
    default:
      return Gne(i, r, n);
  }
}
function hR(...t) {
  return t.length === 3 ? ro(t[0], t[1], t[2]) : ro(t[0], [], t[1]);
}
function tre(t) {
  return il(t) && t[Ee] !== "Unsafe";
}
function nre(t, e, n) {
  return Lt(n) ? n.map((r) => Hr(t.items, e, r)) : n;
}
function rre(t, e, n) {
  const r = globalThis.Object.values(t.$defs), i = t.$defs[t.$ref];
  return Hr(i, [...e, ...r], n);
}
function ire(t, e, n) {
  const r = t.unevaluatedProperties, o = t.allOf.map((a) => Hr(a, e, Vn(n))).reduce((a, c) => Pt(c) ? { ...a, ...c } : c, {});
  if (!Pt(n) || !Pt(o) || !il(r))
    return o;
  const s = ba(t);
  for (const a of Object.getOwnPropertyNames(n))
    s.includes(a) || $t(r, e, n[a]) && (o[a] = Hr(r, e, n[a]));
  return o;
}
function ore(t, e, n) {
  if (!Pt(n) || Lt(n))
    return n;
  const r = t.additionalProperties;
  for (const i of Object.getOwnPropertyNames(n)) {
    if (lt(t.properties, i)) {
      n[i] = Hr(t.properties[i], e, n[i]);
      continue;
    }
    if (il(r) && $t(r, e, n[i])) {
      n[i] = Hr(r, e, n[i]);
      continue;
    }
    delete n[i];
  }
  return n;
}
function sre(t, e, n) {
  if (!Pt(n))
    return n;
  const r = t.additionalProperties, i = Object.getOwnPropertyNames(n), [o, s] = Object.entries(t.patternProperties)[0], a = new RegExp(o);
  for (const c of i) {
    if (a.test(c)) {
      n[c] = Hr(s, e, n[c]);
      continue;
    }
    if (il(r) && $t(r, e, n[c])) {
      n[c] = Hr(r, e, n[c]);
      continue;
    }
    delete n[c];
  }
  return n;
}
function are(t, e, n) {
  return Hr(Vt(t, e), e, n);
}
function cre(t, e, n) {
  return Hr(Vt(t, e), e, n);
}
function ure(t, e, n) {
  if (!Lt(n))
    return n;
  if (zr(t.items))
    return [];
  const r = Math.min(n.length, t.items.length);
  for (let i = 0; i < r; i++)
    n[i] = Hr(t.items[i], e, n[i]);
  return n.length > r ? n.slice(0, r) : n;
}
function lre(t, e, n) {
  for (const r of t.anyOf)
    if (tre(r) && $t(r, e, n))
      return Hr(r, e, n);
  return n;
}
function Hr(t, e, n) {
  const r = Ut(t.$id) ? Ss(t, e) : e, i = t;
  switch (i[Ee]) {
    case "Array":
      return nre(i, r, n);
    case "Import":
      return rre(i, r, n);
    case "Intersect":
      return ire(i, r, n);
    case "Object":
      return ore(i, r, n);
    case "Record":
      return sre(i, r, n);
    case "Ref":
      return are(i, r, n);
    case "This":
      return cre(i, r, n);
    case "Tuple":
      return ure(i, r, n);
    case "Union":
      return lre(i, r, n);
    default:
      return n;
  }
}
function pre(...t) {
  return t.length === 3 ? Hr(t[0], t[1], t[2]) : Hr(t[0], [], t[1]);
}
function v0(t) {
  return Ut(t) && !isNaN(t) && !isNaN(parseFloat(t));
}
function dre(t) {
  return _i(t) || Ju(t) || Je(t);
}
function zd(t) {
  return t === !0 || Je(t) && t === 1 || _i(t) && t === BigInt("1") || Ut(t) && (t.toLowerCase() === "true" || t === "1");
}
function Kd(t) {
  return t === !1 || Je(t) && (t === 0 || Object.is(t, -0)) || _i(t) && t === BigInt("0") || Ut(t) && (t.toLowerCase() === "false" || t === "0" || t === "-0");
}
function fre(t) {
  return Ut(t) && /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t);
}
function hre(t) {
  return Ut(t) && /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t);
}
function mre(t) {
  return Ut(t) && /^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t);
}
function gre(t) {
  return Ut(t) && /^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t);
}
function yre(t) {
  return Ut(t) && /^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(t);
}
function vre(t, e) {
  const n = gR(t);
  return n === e ? n : t;
}
function bre(t, e) {
  const n = yR(t);
  return n === e ? n : t;
}
function xre(t, e) {
  const n = mR(t);
  return n === e ? n : t;
}
function wre(t, e) {
  return Ut(t.const) ? vre(e, t.const) : Je(t.const) ? bre(e, t.const) : Ju(t.const) ? xre(e, t.const) : e;
}
function mR(t) {
  return zd(t) ? !0 : Kd(t) ? !1 : t;
}
function Sre(t) {
  const e = (n) => n.split(".")[0];
  return v0(t) ? BigInt(e(t)) : Je(t) ? BigInt(Math.trunc(t)) : Kd(t) ? BigInt(0) : zd(t) ? BigInt(1) : t;
}
function gR(t) {
  return Rd(t) && t.description !== void 0 ? t.description.toString() : dre(t) ? t.toString() : t;
}
function yR(t) {
  return v0(t) ? parseFloat(t) : zd(t) ? 1 : Kd(t) ? 0 : t;
}
function _re(t) {
  return v0(t) ? parseInt(t) : Je(t) ? Math.trunc(t) : zd(t) ? 1 : Kd(t) ? 0 : t;
}
function Ere(t) {
  return Ut(t) && t.toLowerCase() === "null" ? null : t;
}
function Are(t) {
  return Ut(t) && t === "undefined" ? void 0 : t;
}
function Ire(t) {
  return Yu(t) ? t : Je(t) ? new Date(t) : zd(t) ? /* @__PURE__ */ new Date(1) : Kd(t) ? /* @__PURE__ */ new Date(0) : v0(t) ? new Date(parseInt(t)) : hre(t) ? /* @__PURE__ */ new Date(`1970-01-01T${t}.000Z`) : fre(t) ? /* @__PURE__ */ new Date(`1970-01-01T${t}`) : gre(t) ? /* @__PURE__ */ new Date(`${t}.000Z`) : mre(t) ? new Date(t) : yre(t) ? /* @__PURE__ */ new Date(`${t}T00:00:00.000Z`) : t;
}
function Cre(t, e, n) {
  return (Lt(n) ? n : [n]).map((i) => io(t.items, e, i));
}
function Tre(t, e, n) {
  return Sre(n);
}
function kre(t, e, n) {
  return mR(n);
}
function Nre(t, e, n) {
  return Ire(n);
}
function Pre(t, e, n) {
  const r = globalThis.Object.values(t.$defs), i = t.$defs[t.$ref];
  return io(i, [...e, ...r], n);
}
function Dre(t, e, n) {
  return _re(n);
}
function Fre(t, e, n) {
  return t.allOf.reduce((r, i) => io(i, e, r), n);
}
function Ore(t, e, n) {
  return wre(t, n);
}
function Mre(t, e, n) {
  return Ere(n);
}
function Rre(t, e, n) {
  return yR(n);
}
function Bre(t, e, n) {
  if (!Pt(n) || Lt(n))
    return n;
  for (const r of Object.getOwnPropertyNames(t.properties))
    lt(n, r) && (n[r] = io(t.properties[r], e, n[r]));
  return n;
}
function Ure(t, e, n) {
  if (!(Pt(n) && !Lt(n)))
    return n;
  const i = Object.getOwnPropertyNames(t.patternProperties)[0], o = t.patternProperties[i];
  for (const [s, a] of Object.entries(n))
    n[s] = io(o, e, a);
  return n;
}
function Lre(t, e, n) {
  return io(Vt(t, e), e, n);
}
function jre(t, e, n) {
  return gR(n);
}
function Qre(t, e, n) {
  return Ut(n) || Je(n) ? Symbol(n) : n;
}
function $re(t, e, n) {
  return io(Vt(t, e), e, n);
}
function Gre(t, e, n) {
  return Lt(n) && !zr(t.items) ? n.map((i, o) => o < t.items.length ? io(t.items[o], e, i) : i) : n;
}
function qre(t, e, n) {
  return Are(n);
}
function Hre(t, e, n) {
  for (const r of t.anyOf)
    if ($t(r, e, n))
      return n;
  for (const r of t.anyOf) {
    const i = io(r, e, Vn(n));
    if ($t(r, e, i))
      return i;
  }
  return n;
}
function io(t, e, n) {
  const r = Ss(t, e), i = t;
  switch (t[Ee]) {
    case "Array":
      return Cre(i, r, n);
    case "BigInt":
      return Tre(i, r, n);
    case "Boolean":
      return kre(i, r, n);
    case "Date":
      return Nre(i, r, n);
    case "Import":
      return Pre(i, r, n);
    case "Integer":
      return Dre(i, r, n);
    case "Intersect":
      return Fre(i, r, n);
    case "Literal":
      return Ore(i, r, n);
    case "Null":
      return Mre(i, r, n);
    case "Number":
      return Rre(i, r, n);
    case "Object":
      return Bre(i, r, n);
    case "Record":
      return Ure(i, r, n);
    case "Ref":
      return Lre(i, r, n);
    case "String":
      return jre(i, r, n);
    case "Symbol":
      return Qre(i, r, n);
    case "This":
      return $re(i, r, n);
    case "Tuple":
      return Gre(i, r, n);
    case "Undefined":
      return qre(i, r, n);
    case "Union":
      return Hre(i, r, n);
    default:
      return n;
  }
}
function Wre(...t) {
  return t.length === 3 ? io(t[0], t[1], t[2]) : io(t[0], [], t[1]);
}
function Es(t, e) {
  const n = lt(t, "default") ? t.default : void 0, r = e0(n) ? n() : Vn(n);
  return zr(e) ? r : Pt(e) && Pt(r) ? Object.assign(r, e) : e;
}
function uS(t) {
  return il(t) && "default" in t;
}
function zre(t, e, n) {
  if (Lt(n)) {
    for (let i = 0; i < n.length; i++)
      n[i] = Cr(t.items, e, n[i]);
    return n;
  }
  const r = Es(t, n);
  if (!Lt(r))
    return r;
  for (let i = 0; i < r.length; i++)
    r[i] = Cr(t.items, e, r[i]);
  return r;
}
function Kre(t, e, n) {
  return Yu(n) ? n : Es(t, n);
}
function Vre(t, e, n) {
  const r = globalThis.Object.values(t.$defs), i = t.$defs[t.$ref];
  return Cr(i, [...e, ...r], n);
}
function Yre(t, e, n) {
  const r = Es(t, n);
  return t.allOf.reduce((i, o) => {
    const s = Cr(o, e, r);
    return Pt(s) ? { ...i, ...s } : s;
  }, {});
}
function Jre(t, e, n) {
  const r = Es(t, n);
  if (!Pt(r))
    return r;
  const i = Object.getOwnPropertyNames(t.properties);
  for (const o of i) {
    const s = Cr(t.properties[o], e, r[o]);
    zr(s) || (r[o] = Cr(t.properties[o], e, r[o]));
  }
  if (!uS(t.additionalProperties))
    return r;
  for (const o of Object.getOwnPropertyNames(r))
    i.includes(o) || (r[o] = Cr(t.additionalProperties, e, r[o]));
  return r;
}
function Xre(t, e, n) {
  const r = Es(t, n);
  if (!Pt(r))
    return r;
  const i = t.additionalProperties, [o, s] = Object.entries(t.patternProperties)[0], a = new RegExp(o);
  for (const c of Object.getOwnPropertyNames(r))
    a.test(c) && uS(s) && (r[c] = Cr(s, e, r[c]));
  if (!uS(i))
    return r;
  for (const c of Object.getOwnPropertyNames(r))
    a.test(c) || (r[c] = Cr(i, e, r[c]));
  return r;
}
function Zre(t, e, n) {
  return Cr(Vt(t, e), e, Es(t, n));
}
function eie(t, e, n) {
  return Cr(Vt(t, e), e, n);
}
function tie(t, e, n) {
  const r = Es(t, n);
  if (!Lt(r) || zr(t.items))
    return r;
  const [i, o] = [t.items, Math.max(t.items.length, r.length)];
  for (let s = 0; s < o; s++)
    s < i.length && (r[s] = Cr(i[s], e, r[s]));
  return r;
}
function nie(t, e, n) {
  const r = Es(t, n);
  for (const i of t.anyOf) {
    const o = Cr(i, e, Vn(r));
    if ($t(i, e, o))
      return o;
  }
  return r;
}
function Cr(t, e, n) {
  const r = Ss(t, e), i = t;
  switch (i[Ee]) {
    case "Array":
      return zre(i, r, n);
    case "Date":
      return Kre(i, r, n);
    case "Import":
      return Vre(i, r, n);
    case "Intersect":
      return Yre(i, r, n);
    case "Object":
      return Jre(i, r, n);
    case "Record":
      return Xre(i, r, n);
    case "Ref":
      return Zre(i, r, n);
    case "This":
      return eie(i, r, n);
    case "Tuple":
      return tie(i, r, n);
    case "Union":
      return nie(i, r, n);
    default:
      return Es(i, n);
  }
}
function rie(...t) {
  return t.length === 3 ? Cr(t[0], t[1], t[2]) : Cr(t[0], [], t[1]);
}
class vR extends mn {
  constructor(e) {
    super(e);
  }
}
var lS;
(function(t) {
  const e = /* @__PURE__ */ new Map([
    ["Assert", (o, s, a) => (Xte(o, s, a), a)],
    ["Cast", (o, s, a) => hR(o, s, a)],
    ["Clean", (o, s, a) => pre(o, s, a)],
    ["Clone", (o, s, a) => Vn(a)],
    ["Convert", (o, s, a) => Wre(o, s, a)],
    ["Decode", (o, s, a) => oS(o, s) ? sR(o, s, a) : a],
    ["Default", (o, s, a) => rie(o, s, a)],
    ["Encode", (o, s, a) => oS(o, s) ? aR(o, s, a) : a]
  ]);
  function n(o) {
    e.delete(o);
  }
  t.Delete = n;
  function r(o, s) {
    e.set(o, s);
  }
  t.Set = r;
  function i(o) {
    return e.get(o);
  }
  t.Get = i;
})(lS || (lS = {}));
const IN = [
  "Clone",
  "Clean",
  "Default",
  "Convert",
  "Assert",
  "Decode"
];
function iie(t, e, n, r) {
  return t.reduce((i, o) => {
    const s = lS.Get(o);
    if (zr(s))
      throw new vR(`Unable to find Parse operation '${o}'`);
    return s(e, n, i);
  }, r);
}
function Za(...t) {
  const [e, n, r, i] = t.length === 4 ? [t[0], t[1], t[2], t[3]] : t.length === 3 ? Lt(t[0]) ? [t[0], t[1], [], t[2]] : [IN, t[0], t[1], t[2]] : t.length === 2 ? [IN, t[0], [], t[1]] : (() => {
    throw new vR("Invalid Arguments");
  })();
  return iie(e, n, r, i);
}
class fA {
  name;
  core;
  configPath;
  configData = {};
  configSchema;
  validate;
  constructor(e, n, r, i) {
    this.name = e, this.core = n, this.configPath = r, this.configSchema = i, this.validate = wu.Compile(i), Ge.mkdirSync(this.configPath, { recursive: !0 }), this.read();
  }
  getConfigPath(e) {
    const n = e ? `${this.name}_${e}.json` : `${this.name}.json`;
    return xe.join(this.configPath, n);
  }
  read() {
    const e = this.getConfigPath(this.core.selfInfo.uin), n = this.getConfigPath();
    return Ge.existsSync(e) ? this.loadConfig(e) : (Ge.existsSync(n) && (this.configData = this.loadConfig(n)), this.save(), this.configData);
  }
  loadConfig(e) {
    try {
      let r = Ci.parse(Ge.readFileSync(e, "utf-8"));
      if (r = Za(this.configSchema, r), !this.validate.Check(r))
        throw new Error([...this.validate.Errors(r)].map((i) => i.message).join(", "));
      return this.configData = r, this.core.context.logger.logDebug(`[Core] [Config] 配置文件${e}加载`, this.configData), this.configData;
    } catch (n) {
      return this.handleError(n, "读取配置文件时发生错误"), {};
    }
  }
  save(e = this.configData) {
    const n = this.getConfigPath(this.core.selfInfo.uin);
    let r = e;
    if (r = Za(this.configSchema, r), !this.validate.Check(r))
      throw new Error([...this.validate.Errors(r)].map((i) => i.message).join(", "));
    this.configData = r;
    try {
      Ge.writeFileSync(n, JSON.stringify(this.configData, null, 2));
    } catch (i) {
      this.handleError(i, `保存配置文件 ${n} 时发生错误:`);
    }
  }
  handleError(e, n) {
    e instanceof SyntaxError ? this.core.context.logger.logError("[Core] [Config] 操作配置文件格式错误，请检查配置文件:", e.message) : this.core.context.logger.logError(`[Core] [Config] ${n}:`, e.message);
  }
}
function hA(t, e) {
  return si(e === void 0 ? t : { ...e, ...t });
}
function oie(t) {
  return ke({ [Ee]: "Argument", index: t });
}
function sie(t, e) {
  return Fn("Awaited", [Fn(t, e)]);
}
function aie(t) {
  return Fn("Awaited", [al(t)]);
}
function cie(t) {
  return ga(bR(t));
}
function uie(t) {
  return dr(bR(t));
}
function lie(t) {
  return b0(t);
}
function bR(t) {
  return t.map((e) => b0(e));
}
function b0(t, e) {
  return ke(Zu(t) ? sie(t.target, t.parameters) : Fi(t) ? cie(t.allOf) : Yn(t) ? uie(t.anyOf) : o0(t) ? lie(t.item) : Gr(t) ? aie(t.$ref) : t, e);
}
function pie(t) {
  const e = [];
  for (const n of t)
    e.push(...ba(n));
  return qJ(e);
}
function die(t) {
  return t.filter((e) => !$d(e));
}
function fie(t, e) {
  const n = [];
  for (const r of t)
    n.push(...ZE(r, [e]));
  return die(n);
}
function hie(t, e) {
  const n = {};
  for (const r of e)
    n[r] = TM(fie(t, r));
  return n;
}
function mie(t, e) {
  const n = pie(t), r = hie(t, n);
  return Kn(r, e);
}
function xR(t) {
  return ke({ [Ee]: "Date", type: "Date" }, t);
}
function wR(t) {
  return ke({ [Ee]: "Null", type: "null" }, t);
}
function SR(t) {
  return ke({ [Ee]: "Symbol", type: "symbol" }, t);
}
function _R(t) {
  return ke({ [Ee]: "Undefined", type: "undefined" }, t);
}
function ER(t) {
  return ke({ [Ee]: "Uint8Array", type: "Uint8Array" }, t);
}
function gie(t) {
  return t.map((e) => mA(e, !1));
}
function yie(t) {
  const e = {};
  for (const n of globalThis.Object.getOwnPropertyNames(t))
    e[n] = va(mA(t[n], !1));
  return e;
}
function Eh(t, e) {
  return e === !0 ? t : va(t);
}
function mA(t, e) {
  return gY(t) || vY(t) ? Eh(Jp(), e) : Kr(t) ? va(sl(gie(t))) : Ud(t) ? ER() : $E(t) ? xR() : Sn(t) ? Eh(Kn(yie(t)), e) : yY(t) ? Eh(jd([], u0()), e) : gn(t) ? _R() : bY(t) ? wR() : xY(t) ? SR() : SM(t) ? XE() : Oo(t) || Bd(t) || hn(t) ? xn(t) : Kn({});
}
function vie(t, e) {
  return ke(mA(t, !0), e);
}
function bie(t, e) {
  return el(t) ? sl(t.parameters, e) : en(e);
}
function xie(t, e) {
  if (gn(t))
    throw new Error("Enum undefined or empty");
  const n = globalThis.Object.getOwnPropertyNames(t).filter((o) => isNaN(o)).map((o) => t[o]), i = [...new Set(n)].map((o) => xn(o));
  return dr(i, { ...e, [t0]: "Enum" });
}
function wie(t, e) {
  return gA(Bm(t), e);
}
function Sie(t, e) {
  const n = t.filter((r) => Wd(r, e) === pe.False);
  return n.length === 1 ? n[0] : dr(n);
}
function gA(t, e, n = {}) {
  return xc(t) ? ke(wie(t, e), n) : fi(t) ? ke(Aie(t, e), n) : ke(Yn(t) ? Sie(t.anyOf, e) : Wd(t, e) !== pe.False ? en() : t, n);
}
function _ie(t, e) {
  const n = {};
  for (const r of globalThis.Object.getOwnPropertyNames(t))
    n[r] = gA(t[r], e);
  return n;
}
function Eie(t, e) {
  return _ie(t.properties, e);
}
function Aie(t, e) {
  const n = Eie(t, e);
  return pr(n);
}
function Iie(t, e) {
  return yA(Bm(t), e);
}
function Cie(t, e) {
  const n = t.filter((r) => Wd(r, e) !== pe.False);
  return n.length === 1 ? n[0] : dr(n);
}
function yA(t, e, n) {
  return xc(t) ? ke(Iie(t, e), n) : fi(t) ? ke(Nie(t, e), n) : ke(Yn(t) ? Cie(t.anyOf, e) : Wd(t, e) !== pe.False ? t : en(), n);
}
function Tie(t, e) {
  const n = {};
  for (const r of globalThis.Object.getOwnPropertyNames(t))
    n[r] = yA(t[r], e);
  return n;
}
function kie(t, e) {
  return Tie(t.properties, e);
}
function Nie(t, e) {
  const n = kie(t, e);
  return pr(n);
}
function Pie(t, e) {
  return el(t) ? ke(t.returns, e) : en(e);
}
function AR(t) {
  return va(ma(t));
}
function Ic(t, e, n) {
  return ke({ [Ee]: "Record", type: "object", patternProperties: { [t]: e } }, n);
}
function vA(t, e, n) {
  const r = {};
  for (const i of t)
    r[i] = e;
  return Kn(r, { ...n, [t0]: "Record" });
}
function Die(t, e, n) {
  return NM(t) ? vA(ya(t), e, n) : Ic(t.pattern, e, n);
}
function Fie(t, e, n) {
  return vA(ya(dr(t)), e, n);
}
function Oie(t, e, n) {
  return vA([t.toString()], e, n);
}
function Mie(t, e, n) {
  return Ic(t.source, e, n);
}
function Rie(t, e, n) {
  const r = gn(t.pattern) ? yu : t.pattern;
  return Ic(r, e, n);
}
function Bie(t, e, n) {
  return Ic(yu, e, n);
}
function Uie(t, e, n) {
  return Ic(mJ, e, n);
}
function Lie(t, e, n) {
  return Kn({ true: e, false: e }, n);
}
function jie(t, e, n) {
  return Ic(gu, e, n);
}
function Qie(t, e, n) {
  return Ic(gu, e, n);
}
function IR(t, e, n = {}) {
  return Yn(t) ? Fie(t.anyOf, e, n) : xc(t) ? Die(t, e, n) : vc(t) ? Oie(t.const, e, n) : Qd(t) ? Lie(t, e, n) : nl(t) ? jie(t, e, n) : rl(t) ? Qie(t, e, n) : CM(t) ? Mie(t, e, n) : Gd(t) ? Rie(t, e, n) : EM(t) ? Bie(t, e, n) : $d(t) ? Uie(t, e, n) : en(n);
}
function bA(t) {
  return globalThis.Object.getOwnPropertyNames(t.patternProperties)[0];
}
function $ie(t) {
  const e = bA(t);
  return e === yu ? Ja() : e === gu ? Sc() : Ja({ pattern: e });
}
function CR(t) {
  return t.patternProperties[bA(t)];
}
function Gie(t, e) {
  return e.parameters = Vd(t, e.parameters), e.returns = oo(t, e.returns), e;
}
function qie(t, e) {
  return e.parameters = Vd(t, e.parameters), e.returns = oo(t, e.returns), e;
}
function Hie(t, e) {
  return e.allOf = Vd(t, e.allOf), e;
}
function Wie(t, e) {
  return e.anyOf = Vd(t, e.anyOf), e;
}
function zie(t, e) {
  return gn(e.items) || (e.items = Vd(t, e.items)), e;
}
function Kie(t, e) {
  return e.items = oo(t, e.items), e;
}
function Vie(t, e) {
  return e.items = oo(t, e.items), e;
}
function Yie(t, e) {
  return e.items = oo(t, e.items), e;
}
function Jie(t, e) {
  return e.item = oo(t, e.item), e;
}
function Xie(t, e) {
  const n = noe(t, e.properties);
  return { ...e, ...Kn(n) };
}
function Zie(t, e) {
  const n = oo(t, $ie(e)), r = oo(t, CR(e)), i = IR(n, r);
  return { ...e, ...i };
}
function eoe(t, e) {
  return e.index in t ? t[e.index] : u0();
}
function toe(t, e) {
  const n = WE(e), r = ha(e), i = oo(t, e);
  return n && r ? AR(i) : n && !r ? va(i) : !n && r ? ma(i) : i;
}
function noe(t, e) {
  return globalThis.Object.getOwnPropertyNames(e).reduce((n, r) => ({ ...n, [r]: toe(t, e[r]) }), {});
}
function Vd(t, e) {
  return e.map((n) => oo(t, n));
}
function oo(t, e) {
  return el(e) ? Gie(t, e) : tl(e) ? qie(t, e) : Fi(e) ? Hie(t, e) : Yn(e) ? Wie(t, e) : wc(e) ? zie(t, e) : Xu(e) ? Kie(t, e) : n0(e) ? Vie(t, e) : i0(e) ? Yie(t, e) : o0(e) ? Jie(t, e) : ho(e) ? Xie(t, e) : s0(e) ? Zie(t, e) : AM(e) ? eoe(t, e) : e;
}
function roe(t, e) {
  return oo(e, hA(t));
}
function ioe(t) {
  return ke({ [Ee]: "Integer", type: "integer" }, t);
}
function ooe(t, e, n) {
  return {
    [t]: ll(xn(t), e, si(n))
  };
}
function soe(t, e, n) {
  return t.reduce((i, o) => ({ ...i, ...ooe(o, e, n) }), {});
}
function aoe(t, e, n) {
  return soe(t.keys, e, n);
}
function coe(t, e, n) {
  const r = aoe(t, e, n);
  return pr(r);
}
function uoe(t) {
  const [e, n] = [t.slice(0, 1), t.slice(1)];
  return [e.toLowerCase(), n].join("");
}
function loe(t) {
  const [e, n] = [t.slice(0, 1), t.slice(1)];
  return [e.toUpperCase(), n].join("");
}
function poe(t) {
  return t.toUpperCase();
}
function doe(t) {
  return t.toLowerCase();
}
function foe(t, e, n) {
  const r = YE(t.pattern);
  if (!Yp(r))
    return { ...t, pattern: TR(t.pattern, e) };
  const s = [...a0(r)].map((u) => xn(u)), a = kR(s, e), c = dr(a);
  return MM([c], n);
}
function TR(t, e) {
  return typeof t == "string" ? e === "Uncapitalize" ? uoe(t) : e === "Capitalize" ? loe(t) : e === "Uppercase" ? poe(t) : e === "Lowercase" ? doe(t) : t : t.toString();
}
function kR(t, e) {
  return t.map((n) => ll(n, e));
}
function ll(t, e, n = {}) {
  return (
    // Intrinsic-Mapped-Inference
    bc(t) ? coe(t, e, n) : (
      // Standard-Inference
      xc(t) ? foe(t, e, n) : Yn(t) ? dr(kR(t.anyOf, e), n) : vc(t) ? xn(TR(t.const, e), n) : (
        // Default Type
        ke(t, n)
      )
    )
  );
}
function hoe(t, e = {}) {
  return ll(t, "Capitalize", e);
}
function moe(t, e = {}) {
  return ll(t, "Lowercase", e);
}
function goe(t, e = {}) {
  return ll(t, "Uncapitalize", e);
}
function yoe(t, e = {}) {
  return ll(t, "Uppercase", e);
}
function voe(t, e, n) {
  const r = {};
  for (const i of globalThis.Object.getOwnPropertyNames(t))
    r[i] = x0(t[i], e, si(n));
  return r;
}
function boe(t, e, n) {
  return voe(t.properties, e, n);
}
function xoe(t, e, n) {
  const r = boe(t, e, n);
  return pr(r);
}
function woe(t, e) {
  return t.map((n) => xA(n, e));
}
function Soe(t, e) {
  return t.map((n) => xA(n, e));
}
function _oe(t, e) {
  const { [e]: n, ...r } = t;
  return r;
}
function Eoe(t, e) {
  return e.reduce((n, r) => _oe(n, r), t);
}
function Aoe(t, e) {
  const n = ai(t, [Ur, "$id", "required", "properties"]), r = Eoe(t.properties, e);
  return Kn(r, n);
}
function Ioe(t) {
  const e = t.reduce((n, r) => IM(r) ? [...n, xn(r)] : n, []);
  return dr(e);
}
function xA(t, e) {
  return Fi(t) ? ga(woe(t.allOf, e)) : Yn(t) ? dr(Soe(t.anyOf, e)) : ho(t) ? Aoe(t, e) : Kn({});
}
function x0(t, e, n) {
  const r = Kr(e) ? Ioe(e) : e, i = Ir(e) ? ya(e) : e, o = Gr(t), s = Gr(e);
  return fi(t) ? xoe(t, i, n) : bc(e) ? Noe(t, e, n) : o && s ? Fn("Omit", [t, r], n) : !o && s ? Fn("Omit", [t, r], n) : o && !s ? Fn("Omit", [t, r], n) : ke({ ...xA(t, i), ...n });
}
function Coe(t, e, n) {
  return { [e]: x0(t, [e], si(n)) };
}
function Toe(t, e, n) {
  return e.reduce((r, i) => ({ ...r, ...Coe(t, i, n) }), {});
}
function koe(t, e, n) {
  return Toe(t, e.keys, n);
}
function Noe(t, e, n) {
  const r = koe(t, e, n);
  return pr(r);
}
function Poe(t, e, n) {
  const r = {};
  for (const i of globalThis.Object.getOwnPropertyNames(t))
    r[i] = w0(t[i], e, si(n));
  return r;
}
function Doe(t, e, n) {
  return Poe(t.properties, e, n);
}
function Foe(t, e, n) {
  const r = Doe(t, e, n);
  return pr(r);
}
function Ooe(t, e) {
  return t.map((n) => wA(n, e));
}
function Moe(t, e) {
  return t.map((n) => wA(n, e));
}
function Roe(t, e) {
  const n = {};
  for (const r of e)
    r in t && (n[r] = t[r]);
  return n;
}
function Boe(t, e) {
  const n = ai(t, [Ur, "$id", "required", "properties"]), r = Roe(t.properties, e);
  return Kn(r, n);
}
function Uoe(t) {
  const e = t.reduce((n, r) => IM(r) ? [...n, xn(r)] : n, []);
  return dr(e);
}
function wA(t, e) {
  return Fi(t) ? ga(Ooe(t.allOf, e)) : Yn(t) ? dr(Moe(t.anyOf, e)) : ho(t) ? Boe(t, e) : Kn({});
}
function w0(t, e, n) {
  const r = Kr(e) ? Uoe(e) : e, i = Ir(e) ? ya(e) : e, o = Gr(t), s = Gr(e);
  return fi(t) ? Foe(t, i, n) : bc(e) ? $oe(t, e, n) : o && s ? Fn("Pick", [t, r], n) : !o && s ? Fn("Pick", [t, r], n) : o && !s ? Fn("Pick", [t, r], n) : ke({ ...wA(t, i), ...n });
}
function Loe(t, e, n) {
  return {
    [e]: w0(t, [e], si(n))
  };
}
function joe(t, e, n) {
  return e.reduce((r, i) => ({ ...r, ...Loe(t, i, n) }), {});
}
function Qoe(t, e, n) {
  return joe(t, e.keys, n);
}
function $oe(t, e, n) {
  const r = Qoe(t, e, n);
  return pr(r);
}
function Goe(t, e) {
  return Fn("Partial", [Fn(t, e)]);
}
function qoe(t) {
  return Fn("Partial", [al(t)]);
}
function Hoe(t) {
  const e = {};
  for (const n of globalThis.Object.getOwnPropertyNames(t))
    e[n] = ma(t[n]);
  return e;
}
function Woe(t) {
  const e = ai(t, [Ur, "$id", "required", "properties"]), n = Hoe(t.properties);
  return Kn(n, e);
}
function CN(t) {
  return t.map((e) => NR(e));
}
function NR(t) {
  return (
    // Mappable
    Zu(t) ? Goe(t.target, t.parameters) : Gr(t) ? qoe(t.$ref) : Fi(t) ? ga(CN(t.allOf)) : Yn(t) ? dr(CN(t.anyOf)) : ho(t) ? Woe(t) : (
      // Intrinsic
      r0(t) || Qd(t) || nl(t) || vc(t) || zE(t) || rl(t) || Gd(t) || KE(t) || qd(t) ? t : (
        // Passthrough
        Kn({})
      )
    )
  );
}
function SA(t, e) {
  return fi(t) ? Voe(t, e) : ke({ ...NR(t), ...e });
}
function zoe(t, e) {
  const n = {};
  for (const r of globalThis.Object.getOwnPropertyNames(t))
    n[r] = SA(t[r], si(e));
  return n;
}
function Koe(t, e) {
  return zoe(t.properties, e);
}
function Voe(t, e) {
  const n = Koe(t, e);
  return pr(n);
}
function Yoe(t, e) {
  return Fn("Required", [Fn(t, e)]);
}
function Joe(t) {
  return Fn("Required", [al(t)]);
}
function Xoe(t) {
  const e = {};
  for (const n of globalThis.Object.getOwnPropertyNames(t))
    e[n] = ai(t[n], [ws]);
  return e;
}
function Zoe(t) {
  const e = ai(t, [Ur, "$id", "required", "properties"]), n = Xoe(t.properties);
  return Kn(n, e);
}
function TN(t) {
  return t.map((e) => PR(e));
}
function PR(t) {
  return (
    // Mappable
    Zu(t) ? Yoe(t.target, t.parameters) : Gr(t) ? Joe(t.$ref) : Fi(t) ? ga(TN(t.allOf)) : Yn(t) ? dr(TN(t.anyOf)) : ho(t) ? Zoe(t) : (
      // Intrinsic
      r0(t) || Qd(t) || nl(t) || vc(t) || zE(t) || rl(t) || Gd(t) || KE(t) || qd(t) ? t : (
        // Passthrough
        Kn({})
      )
    )
  );
}
function _A(t, e) {
  return fi(t) ? nse(t, e) : ke({ ...PR(t), ...e });
}
function ese(t, e) {
  const n = {};
  for (const r of globalThis.Object.getOwnPropertyNames(t))
    n[r] = _A(t[r], e);
  return n;
}
function tse(t, e) {
  return ese(t.properties, e);
}
function nse(t, e) {
  const n = tse(t, e);
  return pr(n);
}
function rse(t, e) {
  return e.map((n) => Gr(n) ? EA(t, n.$ref) : li(t, n));
}
function EA(t, e) {
  return e in t ? Gr(t[e]) ? EA(t, t[e].$ref) : li(t, t[e]) : en();
}
function ise(t) {
  return b0(t[0]);
}
function ose(t) {
  return c0(t[0], t[1]);
}
function sse(t) {
  return tA(t[0]);
}
function ase(t) {
  return SA(t[0]);
}
function cse(t) {
  return x0(t[0], t[1]);
}
function use(t) {
  return w0(t[0], t[1]);
}
function lse(t) {
  return _A(t[0]);
}
function pse(t, e, n) {
  const r = rse(t, n);
  return e === "Awaited" ? ise(r) : e === "Index" ? ose(r) : e === "KeyOf" ? sse(r) : e === "Partial" ? ase(r) : e === "Omit" ? cse(r) : e === "Pick" ? use(r) : e === "Required" ? lse(r) : en();
}
function dse(t, e) {
  return GE(li(t, e));
}
function fse(t, e) {
  return qE(li(t, e));
}
function hse(t, e, n) {
  return HE(Yd(t, e), li(t, n));
}
function mse(t, e, n) {
  return jd(Yd(t, e), li(t, n));
}
function gse(t, e) {
  return ga(Yd(t, e));
}
function yse(t, e) {
  return eA(li(t, e));
}
function vse(t, e) {
  return Kn(globalThis.Object.keys(e).reduce((n, r) => ({ ...n, [r]: li(t, e[r]) }), {}));
}
function bse(t, e) {
  const [n, r] = [li(t, CR(e)), bA(e)], i = hA(e);
  return i.patternProperties[r] = n, i;
}
function xse(t, e) {
  return Gr(e) ? { ...EA(t, e.$ref), [Ur]: e[Ur] } : e;
}
function wse(t, e) {
  return sl(Yd(t, e));
}
function Sse(t, e) {
  return dr(Yd(t, e));
}
function Yd(t, e) {
  return e.map((n) => li(t, n));
}
function li(t, e) {
  return (
    // Modifiers
    ha(e) ? ke(li(t, ai(e, [ws])), e) : WE(e) ? ke(li(t, ai(e, [Ld])), e) : (
      // Transform
      Qt(e) ? ke(xse(t, e), e) : (
        // Types
        Xu(e) ? ke(dse(t, e.items), e) : n0(e) ? ke(fse(t, e.items), e) : Zu(e) ? ke(pse(t, e.target, e.parameters)) : el(e) ? ke(hse(t, e.parameters, e.returns), e) : tl(e) ? ke(mse(t, e.parameters, e.returns), e) : Fi(e) ? ke(gse(t, e.allOf), e) : i0(e) ? ke(yse(t, e.items), e) : ho(e) ? ke(vse(t, e.properties), e) : s0(e) ? ke(bse(t, e)) : wc(e) ? ke(wse(t, e.items || []), e) : Yn(e) ? ke(Sse(t, e.anyOf), e) : e
      )
    )
  );
}
function _se(t, e) {
  return e in t ? li(t, t[e]) : en();
}
function Ese(t) {
  return globalThis.Object.getOwnPropertyNames(t).reduce((e, n) => ({ ...e, [n]: _se(t, n) }), {});
}
class Ase {
  constructor(e) {
    const n = Ese(e), r = this.WithIdentifiers(n);
    this.$defs = r;
  }
  /** `[Json]` Imports a Type by Key. */
  Import(e, n) {
    const r = { ...this.$defs, [e]: ke(this.$defs[e], n) };
    return ke({ [Ee]: "Import", $defs: r, $ref: e });
  }
  // prettier-ignore
  WithIdentifiers(e) {
    return globalThis.Object.getOwnPropertyNames(e).reduce((n, r) => ({ ...n, [r]: { ...e[r], $id: r } }), {});
  }
}
function Ise(t) {
  return new Ase(t);
}
function Cse(t, e) {
  return ke({ [Ee]: "Not", not: t }, e);
}
function Tse(t, e) {
  return tl(t) ? sl(t.parameters, e) : en();
}
let kse = 0;
function Nse(t, e = {}) {
  gn(e.$id) && (e.$id = `T${kse++}`);
  const n = hA(t({ [Ee]: "This", $ref: `${e.$id}` }));
  return n.$id = e.$id, ke({ [t0]: "Recursive", ...n }, e);
}
function Pse(t, e) {
  const n = hn(t) ? new globalThis.RegExp(t) : t;
  return ke({ [Ee]: "RegExp", type: "RegExp", source: n.source, flags: n.flags }, e);
}
function Dse(t) {
  return Fi(t) ? t.allOf : Yn(t) ? t.anyOf : wc(t) ? t.items ?? [] : [];
}
function Fse(t) {
  return Dse(t);
}
function Ose(t, e) {
  return tl(t) ? ke(t.returns, e) : en(e);
}
class Mse {
  constructor(e) {
    this.schema = e;
  }
  Decode(e) {
    return new Rse(this.schema, e);
  }
}
class Rse {
  constructor(e, n) {
    this.schema = e, this.decode = n;
  }
  EncodeTransform(e, n) {
    const o = { Encode: (s) => n[Ur].Encode(e(s)), Decode: (s) => this.decode(n[Ur].Decode(s)) };
    return { ...n, [Ur]: o };
  }
  EncodeSchema(e, n) {
    const r = { Decode: this.decode, Encode: e };
    return { ...n, [Ur]: r };
  }
  Encode(e) {
    return Qt(this.schema) ? this.EncodeTransform(e, this.schema) : this.EncodeSchema(e, this.schema);
  }
}
function Bse(t) {
  return new Mse(t);
}
function Use(t) {
  return ke({ [Ee]: "Void", type: "void" }, t);
}
const Lse = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  Any: Jp,
  Argument: oie,
  Array: GE,
  AsyncIterator: qE,
  Awaited: b0,
  BigInt: XE,
  Boolean: DM,
  Capitalize: hoe,
  Composite: mie,
  Const: vie,
  Constructor: HE,
  ConstructorParameters: bie,
  Date: xR,
  Enum: xie,
  Exclude: gA,
  Extends: pA,
  Extract: yA,
  Function: jd,
  Index: c0,
  InstanceType: Pie,
  Instantiate: roe,
  Integer: ioe,
  Intersect: ga,
  Iterator: eA,
  KeyOf: tA,
  Literal: xn,
  Lowercase: moe,
  Mapped: tX,
  Module: Ise,
  Never: en,
  Not: Cse,
  Null: wR,
  Number: Sc,
  Object: Kn,
  Omit: x0,
  Optional: ma,
  Parameters: Tse,
  Partial: SA,
  Pick: w0,
  Promise: UM,
  Readonly: va,
  ReadonlyOptional: AR,
  Record: IR,
  Recursive: Nse,
  Ref: al,
  RegExp: Pse,
  Required: _A,
  Rest: Fse,
  ReturnType: Ose,
  String: Ja,
  Symbol: SR,
  TemplateLiteral: MM,
  Transform: Bse,
  Tuple: sl,
  Uint8Array: ER,
  Uncapitalize: goe,
  Undefined: _R,
  Union: dr,
  Unknown: u0,
  Unsafe: TY,
  Uppercase: yoe,
  Void: Use
}, Symbol.toStringTag, { value: "Module" })), p = Lse, jse = p.Object({
  hook: p.Boolean({ default: !0 }),
  window: p.Boolean({ default: !0 }),
  module: p.Boolean({ default: !0 }),
  process: p.Boolean({ default: !0 }),
  container: p.Boolean({ default: !0 }),
  js: p.Boolean({ default: !0 })
}), AA = p.Object({
  fileLog: p.Boolean({ default: !1 }),
  consoleLog: p.Boolean({ default: !0 }),
  fileLogLevel: p.String({ default: "debug" }),
  consoleLogLevel: p.String({ default: "info" }),
  packetBackend: p.String({ default: "auto" }),
  packetServer: p.String({ default: "" }),
  o3HookMode: p.Number({ default: 0 }),
  autoTimeSync: p.Boolean({ default: !0 }),
  bypass: p.Optional(jse)
});
function Qse(t) {
  let e = {};
  try {
    const n = xe.join(t, "napcat.json");
    Ge.existsSync(n) && (e = Ci.parse(Ge.readFileSync(n, "utf-8")));
  } catch {
  }
  return e = Za(AA, e), e;
}
class $se extends fA {
  constructor(e, n, r) {
    super("napcat", e, n, r);
  }
}
class Gse {
  onNTSessionCreate(e) {
  }
  onGProSessionCreate(e) {
  }
  onSessionInitComplete(e) {
  }
  onOpentelemetryInit(e) {
  }
  onUserOnlineResult(e) {
  }
  onGetSelfTinyId(e) {
  }
}
class qse {
  onLoginConnected() {
  }
  onLoginDisConnected(...e) {
  }
  onLoginConnecting(...e) {
  }
  onQRCodeGetPicture(e) {
  }
  onQRCodeLoginPollingStarted(...e) {
  }
  onQRCodeSessionUserScaned(...e) {
  }
  onQRCodeLoginSucceed(e) {
  }
  onQRCodeSessionFailed(...e) {
  }
  onLoginFailed(...e) {
  }
  onLogoutSucceed(...e) {
  }
  onLogoutFailed(...e) {
  }
  onUserLoggedIn(...e) {
  }
  onQRCodeSessionQuickLoginFailed(...e) {
  }
  onPasswordLoginFailed(...e) {
  }
  OnConfirmUnusualDeviceFailed(...e) {
  }
  onQQLoginNumLimited(...e) {
  }
  onLoginState(...e) {
  }
  onLoginRecordUpdate(...e) {
  }
}
class DR {
  onAddSendMsg(e) {
  }
  onBroadcastHelperDownloadComplete(e) {
  }
  onBroadcastHelperProgressUpdate(e) {
  }
  onChannelFreqLimitInfoUpdate(e, n, r) {
  }
  onContactUnreadCntUpdate(e) {
  }
  onCustomWithdrawConfigUpdate(e) {
  }
  onDraftUpdate(e, n, r) {
  }
  onEmojiDownloadComplete(e) {
  }
  onEmojiResourceUpdate(e) {
  }
  onFeedEventUpdate(e) {
  }
  onFileMsgCome(e) {
  }
  onFirstViewDirectMsgUpdate(e) {
  }
  onFirstViewGroupGuildMapping(e) {
  }
  onGrabPasswordRedBag(e, n, r, i, o) {
  }
  onGroupFileInfoAdd(e) {
  }
  onGroupFileInfoUpdate(e) {
  }
  onGroupGuildUpdate(e) {
  }
  onGroupTransferInfoAdd(e) {
  }
  onGroupTransferInfoUpdate(e) {
  }
  onGuildInteractiveUpdate(e) {
  }
  onGuildMsgAbFlagChanged(e) {
  }
  onGuildNotificationAbstractUpdate(e) {
  }
  onHitCsRelatedEmojiResult(e) {
  }
  onHitEmojiKeywordResult(e) {
  }
  onHitRelatedEmojiResult(e) {
  }
  onImportOldDbProgressUpdate(e) {
  }
  onInputStatusPush(e) {
  }
  onKickedOffLine(e) {
  }
  onLineDev(e) {
  }
  onLogLevelChanged(e) {
  }
  onMsgAbstractUpdate(e) {
  }
  onMsgBoxChanged(e) {
  }
  onMsgDelete(e, n) {
  }
  onMsgEventListUpdate(e) {
  }
  onMsgInfoListAdd(e) {
  }
  onMsgInfoListUpdate(e) {
  }
  onMsgQRCodeStatusChanged(e) {
  }
  onMsgRecall(e, n, r) {
  }
  onMsgSecurityNotify(e) {
  }
  onMsgSettingUpdate(e) {
  }
  onNtFirstViewMsgSyncEnd() {
  }
  onNtMsgSyncEnd() {
  }
  onNtMsgSyncStart() {
  }
  onReadFeedEventUpdate(e) {
  }
  onRecvGroupGuildFlag(e) {
  }
  onRecvMsg(e) {
  }
  onRecvMsgSvrRspTransInfo(e, n, r, i, o, s) {
  }
  onRecvOnlineFileMsg(e) {
  }
  onRecvS2CMsg(e) {
  }
  onRecvSysMsg(e) {
  }
  onRecvUDCFlag(e) {
  }
  onRichMediaDownloadComplete(e) {
  }
  onRichMediaProgerssUpdate(e) {
  }
  onRichMediaUploadComplete(e) {
  }
  onSearchGroupFileInfoUpdate(e) {
  }
  onSendMsgError(e, n, r, i) {
  }
  onSysMsgNotification(e, n, r, i) {
  }
  onTempChatInfoUpdate(e) {
  }
  onUnreadCntAfterFirstView(e) {
  }
  onUnreadCntUpdate(e) {
  }
  onUserChannelTabStatusChanged(e) {
  }
  onUserOnlineStatusChanged(e) {
  }
  onUserTabStatusChanged(e) {
  }
  onlineStatusBigIconDownloadPush(e, n, r) {
  }
  onlineStatusSmallIconDownloadPush(e, n, r) {
  }
  // 第一次发现于Linux
  onUserSecQualityChanged(...e) {
  }
  onMsgWithRichLinkInfoUpdate(...e) {
  }
  onRedTouchChanged(...e) {
  }
  // 第一次发现于Win 9.9.9-23159
  onBroadcastHelperProgerssUpdate(...e) {
  }
}
class Hse {
  onGroupListInited(e) {
  }
  // 发现于Win 9.9.9 23159
  onGroupMemberLevelInfoChange(...e) {
  }
  onGetGroupBulletinListResult(...e) {
  }
  onGroupAllInfoChange(...e) {
  }
  onGroupBulletinChange(...e) {
  }
  onGroupBulletinRemindNotify(...e) {
  }
  onGroupArkInviteStateResult(...e) {
  }
  onGroupBulletinRichMediaDownloadComplete(...e) {
  }
  onGroupConfMemberChange(...e) {
  }
  onGroupDetailInfoChange(e) {
  }
  onGroupExtListUpdate(...e) {
  }
  onGroupFirstBulletinNotify(...e) {
  }
  onGroupListUpdate(e, n) {
  }
  onGroupNotifiesUpdated(e, n) {
  }
  onGroupBulletinRichMediaProgressUpdate(...e) {
  }
  onGroupNotifiesUnreadCountUpdated(...e) {
  }
  onGroupSingleScreenNotifies(e, n, r) {
  }
  onGroupsMsgMaskResult(...e) {
  }
  onGroupStatisticInfoChange(...e) {
  }
  onJoinGroupNotify(...e) {
  }
  onJoinGroupNoVerifyFlag(...e) {
  }
  onMemberInfoChange(e, n, r) {
  }
  onMemberListChange(e) {
  }
  onSearchMemberChange(...e) {
  }
  onShutUpMemberListChanged(e, n) {
  }
}
class Wse {
  onBuddyListChangedV2(e) {
  }
  onAddBuddyNeedVerify(e) {
  }
  onAddMeSettingChanged(e) {
  }
  onAvatarUrlUpdated(e) {
  }
  onBlockChanged(e) {
  }
  onBuddyDetailInfoChange(e) {
  }
  onBuddyInfoChange(e) {
  }
  onBuddyListChange(e) {
  }
  onBuddyRemarkUpdated(e) {
  }
  onBuddyReqChange(e) {
  }
  onBuddyReqUnreadCntChange(e) {
  }
  onCheckBuddySettingResult(e) {
  }
  onDelBatchBuddyInfos(e) {
  }
  onDoubtBuddyReqChange(e) {
  }
  onDoubtBuddyReqUnreadNumChange(e) {
  }
  onNickUpdated(e) {
  }
  onSmartInfos(e) {
  }
  onSpacePermissionInfos(e) {
  }
}
class zse {
  onUserDetailInfoChanged(e) {
  }
  onProfileSimpleChanged(...e) {
  }
  onProfileDetailInfoChanged(e) {
  }
  onStatusUpdate(...e) {
  }
  onSelfStatusChanged(...e) {
  }
  onStrangerRemarkChanged(...e) {
  }
  onMemberListChange(...e) {
  }
  onMemberInfoChange(...e) {
  }
  onGroupListUpdate(...e) {
  }
  onGroupAllInfoChange(...e) {
  }
  onGroupDetailInfoChange(...e) {
  }
  onGroupConfMemberChange(...e) {
  }
  onGroupExtListUpdate(...e) {
  }
  onGroupNotifiesUpdated(...e) {
  }
  onGroupNotifiesUnreadCountUpdated(...e) {
  }
  onGroupMemberLevelInfoChange(...e) {
  }
  onGroupBulletinChange(...e) {
  }
}
function Kse(t) {
  return {
    get(e, n, r) {
      return typeof e[n] > "u" ? (...i) => {
        t.logDebug(`${e.constructor.name} has no method ${n}`);
      } : Reflect.get(e, n, r);
    }
  };
}
function su(t, e) {
  return new Proxy(t, Kse(e));
}
class IA {
  emitter = new LL();
  on(e, n) {
    return this.emitter.on(e, n), () => this.off(e, n);
  }
  once(e, n) {
    this.emitter.once(e, n);
  }
  off(e, n) {
    this.emitter.off(e, n);
  }
  emit(e, n) {
    this.emitter.emit(e, n);
  }
}
const Vse = new IA(), dx = Date.now.bind(Date);
function Yse(t) {
  const e = dx(), n = t(), r = dx(), i = parseInt(n, 10);
  if (isNaN(i) || i <= 0)
    return 0;
  const o = Math.round(i - (e + r) / 2);
  return Math.abs(o) > 5e3 && (Date.now = () => dx() + o), o;
}
const Jse = {
  "9.9.15-28060": { appid: 537246092, qua: "V1_WIN_NQ_9.9.15_28060_GW_B" },
  "9.9.15-28131": { appid: 537246092, qua: "V1_WIN_NQ_9.9.15_28131_GW_B" },
  "3.2.12-28060": { appid: 537246140, qua: "V1_LNX_NQ_3.2.12_28060_GW_B" },
  "3.2.12-28131": { appid: 537246140, qua: "V1_LNX_NQ_3.2.12_28131_GW_B" },
  "6.9.55-28131": { appid: 537246115, qua: "V1_MAC_NQ_6.9.55_28131_GW_B" },
  "9.9.15-28327": { appid: 537249321, qua: "V1_WIN_NQ_9.9.15_28327_GW_B" },
  "3.2.12-28327": { appid: 537249393, qua: "V1_LNX_NQ_3.2.12_28327_GW_B" },
  "9.9.15-28418": { appid: 537249321, qua: "V1_WIN_NQ_9.9.15_28418_GW_B" },
  "3.2.12-28418": { appid: 537249393, qua: "V1_LNX_NQ_3.2.12_28418_GW_B" },
  "6.9.56-28418": { appid: 537249367, qua: "V1_MAC_NQ_6.9.56_28418_GW_B" },
  "9.9.15-28498": { appid: 537249321, qua: "V1_WIN_NQ_9.9.15_28498_GW_B" },
  "3.2.13-28788": { appid: 537249787, qua: "V1_LNX_NQ_3.2.13_28788_GW_B" },
  "9.9.16-28788": { appid: 537249739, qua: "V1_WIN_NQ_9.9.16_28788_GW_B" },
  "9.9.16-28971": { appid: 537249775, qua: "V1_WIN_NQ_9.9.16_28971_GW_B" },
  "3.2.13-28971": { appid: 537249848, qua: "V1_LNX_NQ_3.2.13_28971_GW_B" },
  "6.9.58-28971": { appid: 537249826, qua: "V1_MAC_NQ_6.9.58_28971_GW_B" },
  "9.9.16-29271": { appid: 537249813, qua: "V1_WIN_NQ_9.9.16_29271_GW_B" },
  "3.2.13-29271": { appid: 537249913, qua: "V1_LNX_NQ_3.2.13_29271_GW_B" },
  "6.9.59-29271": { appid: 537249863, qua: "V1_MAC_NQ_6.9.59_29271_GW_B" },
  "9.9.16-29456": { appid: 537249875, qua: "V1_WIN_NQ_9.9.16_29456_GW_B" },
  "3.2.13-29456": { appid: 537249996, qua: "V1_LNX_NQ_3.2.13_29456_GW_B" },
  "6.9.59-29456": { appid: 537249961, qua: "V1_MAC_NQ_6.9.59_29456_GW_B" },
  "9.9.16-29927": { appid: 537255812, qua: "V1_WIN_NQ_9.9.16_29927_GW_B" },
  "3.2.13-29927": { appid: 537255847, qua: "V1_LNX_NQ_3.2.13_29927_GW_B" },
  "6.9.61-29927": { appid: 537255836, qua: "V1_MAC_NQ_6.9.61_29927_GW_B" },
  "9.9.17-30366": { appid: 537258389, qua: "V1_WIN_NQ_9.9.17_30366_GW_B" },
  "3.2.15-30366": { appid: 537258413, qua: "V1_LNX_NQ_3.2.15_30366_GW_B" },
  "6.9.62-30366": { appid: 537258401, qua: "V1_MAC_NQ_6.9.62_30366_GW_B" },
  "9.9.17-30483": { appid: 537258439, qua: "V1_WIN_NQ_9.9.17_30483_GW_B" },
  "6.9.62-30483": { appid: 537258463, qua: "V1_MAC_NQ_6.9.62_30483_GW_B" },
  "3.2.15-30483": { appid: 537258474, qua: "V1_LNX_NQ_3.2.15_30483_GW_B" },
  "9.9.17-30594": { appid: 537258439, qua: "V1_WIN_NQ_9.9.17_30594_GW_B" },
  "6.9.62-30594": { appid: 537258463, qua: "V1_MAC_NQ_6.9.62_30594_GW_B" },
  "3.2.15-30594": { appid: 537258474, qua: "V1_LNX_NQ_3.2.15_30594_GW_B" },
  "9.9.17-30851": { appid: 537263796, qua: "V1_WIN_NQ_9.9.17_30851_GW_B" },
  "3.2.15-30851": { appid: 537263831, qua: "V1_LNX_NQ_3.2.15_30851_GW_B" },
  "6.9.63-30851": { appid: 537263820, qua: "V1_MAC_NQ_6.9.63_30851_GW_B" },
  "9.9.17-30899": { appid: 537263796, qua: "V1_WIN_NQ_9.9.17_30899_GW_B" },
  "3.2.15-30899": { appid: 537263831, qua: "V1_LNX_NQ_3.2.15_30899_GW_B" },
  "6.9.63-30899": { appid: 537263820, qua: "V1_MAC_NQ_6.9.63_30899_GW_B" },
  "9.9.17-31219": { appid: 537266450, qua: "V1_WIN_NQ_9.9.17_31219_GW_B" },
  "9.9.17-31245": { appid: 537266450, qua: "V1_WIN_NQ_9.9.17_31245_GW_B" },
  "3.2.15-31245": { appid: 537266485, qua: "V1_LNX_NQ_3.2.15_31245_GW_B" },
  "6.9.63-31245": { appid: 537266474, qua: "V1_MAC_NQ_6.9.63_31245_GW_B" },
  "3.2.15-31363": { appid: 537266535, qua: "V1_LNX_NQ_3.2.15_31363_GW_B" },
  "6.9.65-31363": { appid: 537266524, qua: "V1_MAC_NQ_6.9.65_31363_GW_B" },
  "9.9.17-31363": { appid: 537266500, qua: "V1_WIN_NQ_9.9.17_31363_GW_B" },
  "3.2.16-32690": { appid: 537271229, qua: "V1_LNX_NQ_3.2.16_32690_GW_B" },
  "9.9.18-32690": { appid: 537271194, qua: "V1_WIN_NQ_9.9.18_32690_GW_B" },
  "6.9.66-32690": { appid: 537271218, qua: "V1_MAC_NQ_6.9.66_32690_GW_B" },
  "3.2.16-32721": { appid: 537271229, qua: "V1_LNX_NQ_3.2.16_32721_GW_B" },
  "9.9.18-32793": { appid: 537271244, qua: "V1_WIN_NQ_9.9.18_32793_GW_B" },
  "3.2.16-32793": { appid: 537271279, qua: "V1_LNX_NQ_3.2.16_32793_GW_B" },
  "3.2.16-32869": { appid: 537271329, qua: "V1_LNX_NQ_3.2.16_32869_GW_B" },
  "9.9.18-32869": { appid: 537271294, qua: "V1_WIN_NQ_9.9.18_32869_GW_B" },
  "3.2.16-33139": { appid: 537273909, qua: "V1_LNX_NQ_3.2.16_33139_GW_B" },
  "9.9.18-33139": { appid: 537273874, qua: "V1_WIN_NQ_9.9.18_33139_GW_B" },
  "9.9.18-33800": { appid: 537273974, qua: "V1_WIN_NQ_9.9.18_33800_GW_B" },
  "3.2.16-33800": { appid: 537274009, qua: "V1_LNX_NQ_3.2.16_33800_GW_B" },
  "9.9.19-34231": { appid: 537279209, qua: "V1_WIN_NQ_9.9.19_34231_GW_B" },
  "3.2.17-34231": { appid: 537279245, qua: "V1_LNX_NQ_3.2.17_34231_GW_B" },
  "9.9.19-34362": { appid: 537279260, qua: "V1_WIN_NQ_9.9.19_34362_GW_B" },
  "3.2.17-34362": { appid: 537279296, qua: "V1_LNX_NQ_3.2.17_34362_GW_B" },
  "9.9.19-34467": { appid: 537282256, qua: "V1_WIN_NQ_9.9.19_34467_GW_B" },
  "3.2.17-34467": { appid: 537282292, qua: "V1_LNX_NQ_3.2.17_34467_GW_B" },
  "9.9.19-34566": { appid: 537282307, qua: "V1_WIN_NQ_9.9.19_34566_GW_B" },
  "3.2.17-34566": { appid: 537282343, qua: "V1_LNX_NQ_3.2.17_34566_GW_B" },
  "3.2.17-34606": { appid: 537282343, qua: "V1_LNX_NQ_3.2.17_34606_GW_B" },
  "9.9.19-34606": { appid: 537282307, qua: "V1_WIN_NQ_9.9.19_34606_GW_B" },
  "9.9.19-34740": { appid: 537290691, qua: "V1_WIN_NQ_9.9.19_34740_GW_B" },
  "3.2.17-34740": { appid: 537290727, qua: "V1_LNX_NQ_3.2.17_34740_GW_B" },
  "9.9.19-34958": { appid: 537290742, qua: "V1_WIN_NQ_9.9.19_34958_GW_B" },
  "3.2.17-35184": { appid: 537291084, qua: "V1_LNX_NQ_3.2.17_35184_GW_B" },
  "9.9.19-35184": { appid: 537291048, qua: "V1_WIN_NQ_9.9.19_35184_GW_B" },
  "3.2.17-35341": { appid: 537291383, qua: "V1_LNX_NQ_3.2.17_35341_GW_B" },
  "9.9.19-35341": { appid: 537291347, qua: "V1_WIN_NQ_9.9.19_35341_GW_B" },
  "9.9.19-35469": { appid: 537291398, qua: "V1_WIN_NQ_9.9.19_35469_GW_B" },
  "3.2.18-35951": { appid: 537296013, qua: "V1_LNX_NQ_3.2.18_35951_GW_B" },
  "9.9.20-35951": { appid: 537295977, qua: "V1_WIN_NQ_9.9.20_35951_GW_B" },
  "3.2.18-36580": { appid: 537298509, qua: "V1_LNX_NQ_3.2.18_36580_GW_B" },
  "9.9.20-36580": { appid: 537298473, qua: "V1_WIN_NQ_9.9.20_36580_GW_B" },
  "9.9.20-37012": { appid: 537304071, qua: "V1_WIN_NQ_9.9.20_37012_GW_B" },
  "3.2.18-37012": { appid: 537304107, qua: "V1_LNX_NQ_3.2.18_37012_GW_B" },
  "3.2.18-37051": { appid: 537304158, qua: "V1_LNX_NQ_3.2.18_37051_GW_B" },
  "9.9.20-37051": { appid: 537304122, qua: "V1_WIN_NQ_9.9.20_37051_GW_B" },
  "9.9.20-37475": { appid: 537304173, qua: "V1_WIN_NQ_9.9.20_37475_GW_B" },
  "3.2.18-37475": { appid: 537304210, qua: "V1_LNX_NQ_3.2.18_37475_GW_B" },
  "9.9.20-37625": { appid: 537304224, qua: "V1_WIN_NQ_9.9.20_37625_GW_B" },
  "3.2.18-37625": { appid: 537304261, qua: "V1_LNX_NQ_3.2.18_37625_GW_B" },
  "9.9.21-38503": { appid: 537307604, qua: "V1_WIN_NQ_9.9.21_38503_GW_B" },
  "3.2.19-38503": { appid: 537307640, qua: "V1_LNX_NQ_3.2.19_38503_GW_B" },
  "3.2.19-38626": { appid: 537307691, qua: "V1_LNX_NQ_3.2.19_38626_GW_B" },
  "9.9.21-38711": { appid: 537307655, qua: "V1_WIN_NQ_9.9.21_38626_GW_B" },
  "9.9.21-38960": { appid: 537313855, qua: "V1_WIN_NQ_9.9.21_38960_GW_B" },
  "3.2.19-38960": { appid: 537313891, qua: "V1_LNX_NQ_3.2.19_38960_GW_B" },
  "3.2.19-39038": { appid: 537313942, qua: "V1_LNX_NQ_3.2.19_39038_GW_B" },
  "9.9.21-39038": { appid: 537313906, qua: "V1_WIN_NQ_9.9.21_39038_GW_B" },
  "9.9.22-40362": { appid: 537314212, qua: "V1_WIN_NQ_9.9.22_40362_GW_B" },
  "3.2.20-40768": { appid: 537319840, qua: "V1_LNX_NQ_3.2.20_40768_GW_B" },
  "9.9.22-40768": { appid: 537319804, qua: "V1_WIN_NQ_9.9.22_40768_GW_B" },
  "6.9.82-40768": { appid: 537319829, qua: "V1_MAC_NQ_6.9.82_40768_GW_B" },
  "3.2.20-40824": { appid: 537319840, qua: "V1_LNX_NQ_3.2.20_40824_GW_B" },
  "9.9.22-40824": { appid: 537319804, qua: "V1_WIN_NQ_9.9.22_40824_GW_B" },
  "6.9.82-40824": { appid: 537319829, qua: "V1_MAC_NQ_6.9.82_40824_GW_B" },
  "6.9.82-40990": { appid: 537319880, qua: "V1_MAC_NQ_6.9.82_40990_GW_B" },
  "9.9.22-40990": { appid: 537319855, qua: "V1_WIN_NQ_9.9.22.40990_GW_B" },
  "3.2.20-40990": { appid: 537319891, qua: "V1_LNX_NQ_3.2.20_40990_GW_B" },
  "9.9.23-41679": { appid: 537320110, qua: "V1_WIN_NQ_9.9.23_41679_GW_B" },
  "6.9.83-41679": { appid: 537320135, qua: "V1_MAC_NQ_6.9.83_41679_GW_B" },
  "9.9.23-41785": { appid: 537320110, qua: "V1_WIN_NQ_9.9.23_41785_GW_B" },
  "6.9.83-41785": { appid: 537320135, qua: "V1_MAC_NQ_6.9.83_41785_GW_B" },
  "9.9.23-41857": { appid: 537320161, qua: "V1_WIN_NQ_9.9.23_41857_GW_B" },
  "3.2.21-41857": { appid: 537320197, qua: "V1_LNX_NQ_3.2.21_41857_GW_B" },
  "6.9.83-41857": { appid: 537320186, qua: "V1_MAC_NQ_6.9.83_41857_GW_B" },
  "3.2.21-42086": { appid: 537320248, qua: "V1_LNX_NQ_3.2.21_42086_GW_B" },
  "9.9.23-42086": { appid: 537320212, qua: "V1_WIN_NQ_9.9.23_42086_GW_B" },
  "6.9.85-42086": { appid: 537320237, qua: "V1_MAC_NQ_6.9.85_42086_GW_B" },
  "9.9.23-42430": { appid: 537320212, qua: "V1_WIN_NQ_9.9.23_42430_GW_B" },
  "9.9.25-42744": { appid: 537328470, qua: "V1_WIN_NQ_9.9.23_42744_GW_B" },
  "6.9.86-42744": { appid: 537328495, qua: "V1_MAC_NQ_6.9.85_42744_GW_B" },
  "9.9.25-42905": { appid: 537328521, qua: "V1_WIN_NQ_9.9.25_42905_GW_B" },
  "6.9.86-42905": { appid: 537328546, qua: "V1_MAC_NQ_6.9.86_42905_GW_B" },
  "3.2.22-42941": { appid: 537328659, qua: "V1_LNX_NQ_3.2.22_42941_GW_B" },
  "9.9.25-42941": { appid: 537328623, qua: "V1_WIN_NQ_9.9.25_42941_GW_B" },
  "6.9.86-42941": { appid: 537328648, qua: "V1_MAC_NQ_6.9.86_42941_GW_B" },
  "9.9.26-44175": { appid: 537336450, qua: "V1_WIN_NQ_9.9.26_44175_GW_B" },
  "9.9.26-44343": { appid: 537336603, qua: "V1_WIN_NQ_9.9.26_44343_GW_B" },
  "3.2.23-44343": { appid: 537336639, qua: "V1_LNX_NQ_3.2.23_44343_GW_B" },
  "9.9.26-44498": { appid: 537337416, qua: "V1_WIN_NQ_9.9.26_44498_GW_B" },
  "9.9.26-44725": { appid: 537337569, qua: "V1_WIN_NQ_9.9.26_44725_GW_B" },
  "9.9.27-45627": { appid: 537340060, qua: "V1_WIN_NQ_9.9.27_45627_GW_B" },
  "6.9.88-44725": { appid: 537337594, qua: "V1_MAC_NQ_6.9.88_44725_GW_B" },
  "3.2.25-45758": { appid: 537340249, qua: "V1_LNX_NQ_3.2.25_45758_GW_B" },
  "9.9.27-45758": { appid: 537340213, qua: "V1_WIN_NQ_9.9.27_45758_GW_B" },
  "3.2.26-46494": { appid: 537345891, qua: "V1_LNX_NQ_3.2.26_46494_GW_B" },
  "9.9.28-46494": { appid: 537345855, qua: "V1_WIN_NQ_9.9.28_46494_GW_B" },
  "6.9.90-46494": { appid: 537345879, qua: "V1_MAC_NQ_6.9.90_46494_GW_B" },
  "3.2.26-46928": { appid: 537345994, qua: "V1_LNX_NQ_3.2.26_46928_GW_B" },
  "9.9.28-46928": { appid: 537345957, qua: "V1_WIN_NQ_9.9.28_46928_GW_B" },
  "3.2.27-47354": { appid: 537346908, qua: "V1_LNX_NQ_3.2.27_47354_GW_B" },
  "9.9.29-47354": { appid: 537346872, qua: "V1_WIN_NQ_9.9.29_47354_GW_B" },
  "6.9.93-47354": { appid: 537346896, qua: "V1_MAC_NQ_6.9.93_47354_GW_B" },
  "9.9.30-48517": { appid: 537352474, qua: "V1_WIN_NQ_9.9.30_48517_GW_B" },
  "3.2.28-48517": { appid: 537352510, qua: "V1_LNX_NQ_3.2.28_48517_GW_B" },
  "9.9.30-48762": { appid: 537352525, qua: "V1_WIN_NQ_9.9.30_48762_GW_B" },
  "9.9.31-49599": { appid: 537355779, qua: "V1_WIN_NQ_9.9.31_49599_GW_B" },
  "9.9.31-49738": { appid: 537355830, qua: "V1_WIN_NQ_9.9.31_49738_GW_B" },
  "3.2.29-49738": { appid: 537355867, qua: "V1_LNX_NQ_3.2.29_49738_GW_B" },
  "9.9.32-50828": { appid: 537358739, qua: "V1_WIN_NQ_9.9.32_50828_GW_B" },
  "3.2.30-50828": { appid: 537358775, qua: "V1_LNX_NQ_3.2.30_50828_GW_B" }
};
class Xse {
  QQMainPath;
  QQPackageInfoPath;
  QQVersionConfigPath;
  isQuickUpdate;
  QQVersionConfig;
  QQPackageInfo;
  QQVersionAppid;
  QQVersionQua;
  context;
  constructor(e) {
    this.context = e, this.QQMainPath = process.execPath, process.platform === "darwin" && xe.basename(this.QQMainPath) === "QQ Helper" && (this.QQMainPath = xe.resolve(xe.dirname(this.QQMainPath), "../../../../", "MacOS", "QQ")), this.QQVersionConfigPath = K7(this.QQMainPath), this.isQuickUpdate = !!this.QQVersionConfigPath, this.QQVersionConfig = this.isQuickUpdate ? JSON.parse(Ge.readFileSync(this.QQVersionConfigPath).toString()) : W7(), this.QQPackageInfoPath = z7(this.QQMainPath, this.QQVersionConfig?.curVersion), this.QQPackageInfo = JSON.parse(Ge.readFileSync(this.QQPackageInfoPath).toString());
    const { appid: n, qua: r } = this.getAppidV2();
    this.QQVersionAppid = n, this.QQVersionQua = r;
  }
  // 基础函数
  getQQBuildStr() {
    return this.QQVersionConfig?.curVersion.split("-")[1] ?? this.QQPackageInfo?.buildVersion;
  }
  getFullQQVersion() {
    const e = this.isQuickUpdate ? this.QQVersionConfig?.curVersion : this.QQPackageInfo?.version;
    if (!e) throw new Error("QQ版本获取失败");
    return e;
  }
  requireMinNTQQBuild(e) {
    const n = +(this.getQQBuildStr() ?? "0");
    if (n === 0) throw new Error("QQBuildStr获取失败");
    return n >= parseInt(e);
  }
  // 此方法不要直接使用
  getQUAFallback() {
    const e = {
      win32: `V1_WIN_${this.getFullQQVersion()}_${this.getQQBuildStr()}_GW_B`,
      darwin: `V1_MAC_${this.getFullQQVersion()}_${this.getQQBuildStr()}_GW_B`,
      linux: `V1_LNX_${this.getFullQQVersion()}_${this.getQQBuildStr()}_GW_B`
    };
    return e[dN] ?? e.win32;
  }
  getAppIdFallback() {
    return {
      win32: "537246092",
      darwin: "537246140",
      linux: "537246140"
    }[dN] ?? "537246092";
  }
  getAppidV2() {
    const e = Jse, n = this.getFullQQVersion();
    if (n) {
      const r = e[n];
      if (r)
        return r;
    }
    try {
      const r = this.getAppidV2ByMajor(n);
      if (r)
        return this.context.logger.log("[QQ版本兼容性检测] 当前版本Appid未内置 通过Major获取 为了更好的性能请尝试更新NapCat"), { appid: r, qua: this.getQUAFallback() };
    } catch {
      this.context.logger.log("[QQ版本兼容性检测] 通过Major 获取Appid异常 请检测NapCat/QQNT是否正常");
    }
    return this.context.logger.log("[QQ版本兼容性检测] 获取Appid异常 请检测NapCat/QQNT是否正常"), this.context.logger.log(`[QQ版本兼容性检测] ${n} 版本兼容性不佳，可能会导致一些功能无法正常使用`), { appid: this.getAppIdFallback(), qua: this.getQUAFallback() };
  }
  getAppidV2ByMajor(e) {
    if (!this.QQMainPath)
      throw new Error("QQMainPath未定义 无法通过Major获取Appid");
    const n = eae(this.QQMainPath, e), r = V7(n);
    return r || Y7(n);
  }
}
var CA = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.Shell = 1] = "Shell", t[t.Framework = 2] = "Framework", t))(CA || {});
function Zse(t, e) {
  if (process.env.NAPCAT_WRAPPER_PATH) {
    const o = process.env.NAPCAT_WRAPPER_PATH, s = { exports: {} };
    return process.dlopen(s, o), s.exports;
  }
  if (!t)
    throw new Error("无法加载Wrapper，execPath未定义");
  let n;
  dt.platform() === "darwin" ? n = xe.resolve(xe.dirname(t), "../Resources/app") : dt.platform() === "linux" ? n = xe.resolve(xe.dirname(t), "./resources/app") : n = xe.resolve(xe.dirname(t), `./versions/${e}/`);
  let r = xe.resolve(n, "wrapper.node");
  Ge.existsSync(r) || (r = xe.join(n, "./resources/app/wrapper.node")), Ge.existsSync(r) || (r = xe.join(xe.dirname(t), `./resources/app/versions/${e}/wrapper.node`));
  const i = { exports: {} };
  return process.dlopen(i, r), process.env.NAPCAT_WRAPPER_PATH = r, i.exports;
}
function eae(t, e) {
  let n;
  dt.platform() === "darwin" ? n = xe.resolve(xe.dirname(t), "../Resources/app") : dt.platform() === "linux" ? n = xe.resolve(xe.dirname(t), "./resources/app") : n = xe.resolve(xe.dirname(t), `./versions/${e}/`);
  let r = xe.resolve(n, "major.node");
  return Ge.existsSync(r) || (r = xe.join(n, "./resources/app/major.node")), Ge.existsSync(r) || (r = xe.join(xe.dirname(t), `./resources/app/versions/${e}/major.node`)), r;
}
class S0 {
  context;
  eventWrapper;
  event = Vse;
  NapCatDataPath = "";
  NapCatTempPath = "";
  apis;
  // runtime info, not readonly
  selfInfo;
  util;
  configLoader;
  /** 数据库 passphrase，由 OidbSvcTrpcTcp.0xcde_2 包获取 */
  dbPassphrase;
  // 通过构造器递过去的 runtime info 应该尽量少
  constructor(e, n) {
    if (this.selfInfo = n, this.eventWrapper = new XV(e.session), process.env.NAPCAT_SESSION_PROXY === "1") {
      const r = eY(e.session, this.eventWrapper);
      this.context = {
        ...e,
        session: r
      };
    } else
      this.context = e;
    this.util = this.context.wrapper.NodeQQNTWrapperUtil, this.configLoader = new $se(this, this.context.pathWrapper.configPath, AA), this.apis = {
      FileApi: new oQ(this.context, this),
      SystemApi: new bQ(this.context, this),
      CollectionApi: new YV(this.context, this),
      PacketApi: new NV(this.context, this),
      WebApi: new vQ(this.context, this),
      FriendApi: new aQ(this.context, this),
      MsgApi: new dQ(this.context, this),
      UserApi: new fQ(this.context, this),
      GroupApi: new pQ(this.context, this),
      FlashApi: new DV(this.context, this),
      OnlineApi: new PV(this.context, this),
      DatabaseApi: new VV(this.context, this)
    }, Zc.bind(S0).toConstantValue(this), Zc.bind(IA).toConstantValue(this.event), FR.forEach((r, i) => {
      Zc.bind(r).toSelf(), this.context.packetHandler.onCmd(i, ({ seq: o, hex_data: s }) => Zc.get(r).handler(o, s));
    });
  }
  async initCore() {
    if (this.NapCatDataPath = xe.join(this.dataPath, "NapCat"), Ge.mkdirSync(this.NapCatDataPath, { recursive: !0 }), this.NapCatTempPath = xe.join(this.NapCatDataPath, "temp"), Ge.existsSync(this.NapCatTempPath) || Ge.mkdirSync(this.NapCatTempPath, { recursive: !0 }), process.env.NAPCAT_DISABLE_TIME_SYNC === "1" || !this.configLoader.configData.autoTimeSync)
      this.context.logger.log("[ServerTime] 自动对时已禁用");
    else {
      const e = () => {
        try {
          const r = Yse(() => this.context.session.getMSFService().getServerTime());
          Math.abs(r) > 5e3 ? this.context.logger.logWarn(`[ServerTime] 本地时间与服务器时间偏差 ${(r / 1e3).toFixed(1)}s，已自动矫正`) : this.context.logger.log(`[ServerTime] 时间同步完成，偏差 ${r}ms`);
        } catch (r) {
          this.context.logger.logError("[ServerTime] 时间矫正失败", r);
        }
      };
      e(), setInterval(e, 36e5).unref();
    }
    for (const e in this.apis) {
      const n = this.apis[e];
      "initApi" in n && typeof n.initApi == "function" && await n.initApi();
    }
    this.initNapCatCoreListeners().then().catch((e) => this.context.logger.logError(e)), this.context.logger.setFileLogEnabled(
      this.configLoader.configData.fileLog
    ), this.context.logger.setConsoleLogEnabled(
      this.configLoader.configData.consoleLog
    ), this.context.logger.setFileAndConsoleLogLevel(
      this.configLoader.configData.fileLogLevel,
      this.configLoader.configData.consoleLogLevel
    );
  }
  get dataPath() {
    let e = this.context.wrapper.NodeQQNTWrapperUtil.getNTUserDataInfoConfig();
    return e || (e = xe.resolve(dt.homedir(), "./.config/QQ"), Ge.mkdirSync(e, { recursive: !0 })), e;
  }
  // Renamed from 'InitDataListener'
  async initNapCatCoreListeners() {
    const e = new DR();
    e.onRecvOnlineFileMsg = (r) => {
      r.forEach((i) => this.context.logger.logMessage(i, this.selfInfo));
    }, e.onKickedOffLine = (r) => {
      const i = `[KickedOffLine] [${r.tipsTitle}] ${r.tipsDesc}`;
      this.context.logger.logError(i), this.selfInfo.online = !1, this.event.emit("KickedOffLine", i);
    }, e.onRecvMsg = (r) => {
      r.forEach((i) => this.context.logger.logMessage(i, this.selfInfo));
    }, e.onAddSendMsg = (r) => {
      this.context.logger.logMessage(r, this.selfInfo);
    }, this.context.session.getMsgService().addKernelMsgListener(
      su(e, this.context.logger)
    );
    const n = new zse();
    n.onProfileDetailInfoChanged = (r) => {
      r.uid === this.selfInfo.uid && Object.assign(this.selfInfo, r);
    }, n.onSelfStatusChanged = (r) => {
      r.status === 20 ? (this.selfInfo.online = !1, this.context.logger.log("账号状态变更为离线")) : this.selfInfo.online = !0;
    }, this.context.session.getProfileService().addKernelProfileListener(
      su(n, this.context.logger)
    );
  }
}
async function tae(t, e, n, r, i, o) {
  const s = xe.join(o, "NapCat", "temp");
  Ge.mkdirSync(s, { recursive: !0 });
  const c = {
    win32: rs.KWINDOWS,
    darwin: rs.KMAC,
    linux: rs.KLINUX
  }[dt.platform()] ?? rs.KWINDOWS;
  return {
    selfUin: r,
    selfUid: i,
    desktopPathConfig: {
      account_path: o
      // 可以通过NodeQQNTWrapperUtil().getNTUserDataInfoConfig()获取
    },
    clientVer: n,
    a2: "",
    d2: "",
    d2Key: "",
    machineId: "",
    platform: c,
    // 3是Windows?
    platVer: Dm,
    // 系统版本号, 应该可以固定
    appid: e,
    rdeliveryConfig: {
      appKey: "",
      systemId: 0,
      appId: "",
      logicEnvironment: "",
      platform: c,
      language: "",
      sdkVersion: "",
      userId: "",
      appVersion: "",
      osVersion: "",
      bundleId: "",
      serverUrl: "",
      fixedAfterHitKeys: [""]
    },
    defaultFileDownloadPath: s,
    deviceInfo: {
      guid: t,
      buildVer: n,
      localId: 2052,
      devName: fM,
      devType: fN,
      vendorName: "",
      osVer: Dm,
      vendorOsName: fN,
      setMute: !1,
      vendorType: dM.KNOSETONIOS
    },
    deviceConfig: '{"appearance":{"isSplitViewMode":true},"msg":{}}'
  };
}
const Zc = new uj(), FR = /* @__PURE__ */ new Map();
class nae {
  get core() {
    return Zc.get(S0);
  }
  get event() {
    return Zc.get(IA);
  }
}
function rae(t) {
  return function(e) {
    return E9()(e), FR.set(t, e), e;
  };
}
var iae = Object.getOwnPropertyDescriptor, oae = (t, e, n, r) => {
  for (var i = r > 1 ? void 0 : r ? iae(e, n) : e, o = t.length - 1, s; o >= 0; o--)
    (s = t[o]) && (i = s(i) || i);
  return i;
};
let kN = class extends nae {
  async handler(t, e) {
    const n = new fe(U6).decode(Buffer.from(e, "hex"));
    if (n.message.contentHead.type === 732 && n.message.contentHead.subType === 16) {
      const r = n.message.body?.msgContent?.slice(7);
      if (!r)
        return;
      const i = new fe(L6).decode(r);
      if ((i.field13 ?? 0) === 35) {
        const o = i.groupUin?.toString() ?? "", s = i.groupReactionData?.data?.data?.groupReactionDataContent?.operatorUid ?? "", a = i.groupReactionData?.data?.data?.groupReactionDataContent?.type ?? 0, c = i.groupReactionData?.data?.data?.groupReactionTarget?.seq?.toString() ?? "", u = i.groupReactionData?.data?.data?.groupReactionDataContent?.code ?? "", l = i.groupReactionData?.data?.data?.groupReactionDataContent?.count ?? 0, d = await this.core.apis.UserApi.getUinByUidV2(s);
        this.event.emit("event:emoji_like", {
          groupId: o,
          senderUin: d,
          emojiId: u,
          msgSeq: c,
          isAdd: a === 1,
          count: l
        });
      }
    }
  }
};
kN = oae([
  rae("trpc.msg.olpush.OlPushService.MsgPush")
], kN);
const re = {
  TestAutoRegister01: "test_auto_register_01",
  TestAutoRegister02: "test_auto_register_02",
  // 所有 Normal Stream Api 表示并未流传输 表示与流传输有关
  CleanStreamTempFile: "clean_stream_temp_file",
  // 所有 Upload/Download Stream Api 应当 _stream 结尾
  TestDownloadStream: "test_download_stream",
  UploadFileStream: "upload_file_stream",
  DownloadFileStream: "download_file_stream",
  DownloadFileRecordStream: "download_file_record_stream",
  DownloadFileImageStream: "download_file_image_stream",
  DelGroupAlbumMedia: "del_group_album_media",
  SetGroupAlbumMediaLike: "set_group_album_media_like",
  CancelGroupAlbumMediaLike: "cancel_group_album_media_like",
  DoGroupAlbumComment: "do_group_album_comment",
  GetGroupAlbumMediaList: "get_group_album_media_list",
  UploadImageToQunAlbum: "upload_image_to_qun_album",
  GetQunAlbumList: "get_qun_album_list",
  SetGroupTodo: "set_group_todo",
  CompleteGroupTodo: "complete_group_todo",
  CancelGroupTodo: "cancel_group_todo",
  SetGroupKickMembers: "set_group_kick_members",
  SetGroupRobotAddOption: "set_group_robot_add_option",
  SetGroupAddOption: "set_group_add_option",
  SetGroupSearch: "set_group_search",
  // new extends 完全差异OneBot类别
  GetDoubtFriendsAddRequest: "get_doubt_friends_add_request",
  SetDoubtFriendsAddRequest: "set_doubt_friends_add_request",
  // napcat
  GetRkeyEx: "get_rkey",
  GetRkeyServer: "get_rkey_server",
  SetGroupRemark: "set_group_remark",
  NapCat_GetPrivateFileUrl: "get_private_file_url",
  ClickInlineKeyboardButton: "click_inline_keyboard_button",
  GetUnidirectionalFriendList: "get_unidirectional_friend_list",
  // onebot 11
  SendPrivateMsg: "send_private_msg",
  SendGroupMsg: "send_group_msg",
  SendMsg: "send_msg",
  DeleteMsg: "delete_msg",
  GetMsg: "get_msg",
  GoCQHTTP_GetForwardMsg: "get_forward_msg",
  SendLike: "send_like",
  SetGroupKick: "set_group_kick",
  SetGroupBan: "set_group_ban",
  // SetGroupAnoymousBan : 'set_group_anonymous_ban',
  SetGroupWholeBan: "set_group_whole_ban",
  SetGroupAdmin: "set_group_admin",
  // SetGroupAnoymous : 'set_group_anonymous',
  SetGroupCard: "set_group_card",
  SetGroupName: "set_group_name",
  SetGroupLeave: "set_group_leave",
  SetSpecialTitle: "set_group_special_title",
  SetFriendAddRequest: "set_friend_add_request",
  SetFriendRemark: "set_friend_remark",
  SetGroupAddRequest: "set_group_add_request",
  GetLoginInfo: "get_login_info",
  GoCQHTTP_GetStrangerInfo: "get_stranger_info",
  GetFriendList: "get_friend_list",
  GetGroupInfo: "get_group_info",
  GetGroupList: "get_group_list",
  GetGroupMemberInfo: "get_group_member_info",
  GetGroupMemberList: "get_group_member_list",
  GetGroupHonorInfo: "get_group_honor_info",
  GetCookies: "get_cookies",
  GetCSRF: "get_csrf_token",
  GetCredentials: "get_credentials",
  GetRecord: "get_record",
  GetImage: "get_image",
  CanSendImage: "can_send_image",
  CanSendRecord: "can_send_record",
  GetStatus: "get_status",
  GetVersionInfo: "get_version_info",
  Reboot: "set_restart",
  CleanCache: "clean_cache",
  Exit: "bot_exit",
  // go-cqhttp
  SetQQProfile: "set_qq_profile",
  // QidianGetAccountInfo : 'qidian_get_account_info',
  GoCQHTTP_GetModelShow: "_get_model_show",
  GoCQHTTP_SetModelShow: "_set_model_show",
  GetOnlineClient: "get_online_clients",
  // GetUnidirectionalFriendList : 'get_unidirectional_friend_list',
  GoCQHTTP_DeleteFriend: "delete_friend",
  // DeleteUnidirectionalFriendList : 'delete_unidirectional_friend',
  GoCQHTTP_MarkMsgAsRead: "mark_msg_as_read",
  GoCQHTTP_SendGroupForwardMsg: "send_group_forward_msg",
  GoCQHTTP_SendPrivateForwardMsg: "send_private_forward_msg",
  GoCQHTTP_GetGroupMsgHistory: "get_group_msg_history",
  OCRImage: "ocr_image",
  IOCRImage: ".ocr_image",
  GetGroupSystemMsg: "get_group_system_msg",
  GoCQHTTP_GetEssenceMsg: "get_essence_msg_list",
  GoCQHTTP_GetGroupAtAllRemain: "get_group_at_all_remain",
  SetGroupPortrait: "set_group_portrait",
  SetEssenceMsg: "set_essence_msg",
  DelEssenceMsg: "delete_essence_msg",
  GoCQHTTP_SendGroupNotice: "_send_group_notice",
  GoCQHTTP_GetGroupNotice: "_get_group_notice",
  GoCQHTTP_UploadGroupFile: "upload_group_file",
  GOCQHTTP_DeleteGroupFile: "delete_group_file",
  GoCQHTTP_CreateGroupFileFolder: "create_group_file_folder",
  GoCQHTTP_DeleteGroupFileFolder: "delete_group_folder",
  GoCQHTTP_GetGroupFileSystemInfo: "get_group_file_system_info",
  GoCQHTTP_GetGroupRootFiles: "get_group_root_files",
  GoCQHTTP_GetGroupFilesByFolder: "get_group_files_by_folder",
  GOCQHTTP_GetGroupFileUrl: "get_group_file_url",
  GOCQHTTP_UploadPrivateFile: "upload_private_file",
  // GOCQHTTP_ReloadEventFilter : 'reload_event_filter',
  GoCQHTTP_DownloadFile: "download_file",
  GoCQHTTP_CheckUrlSafely: "check_url_safely",
  GoCQHTTP_GetWordSlices: ".get_word_slices",
  GoCQHTTP_HandleQuickAction: ".handle_quick_operation",
  // 以下为扩展napcat扩展
  Unknown: "unknown",
  SetDiyOnlineStatus: "set_diy_online_status",
  SharePeer: "ArkSharePeer",
  // @deprecated
  ShareGroupEx: "ArkShareGroup",
  // @deprecated
  // 标准化接口
  SendGroupArkShare: "send_group_ark_share",
  SendArkShare: "send_ark_share",
  // RebootNormal : 'reboot_normal', //无快速登录重新启动
  GetRobotUinRange: "get_robot_uin_range",
  SetOnlineStatus: "set_online_status",
  GetFriendsWithCategory: "get_friends_with_category",
  SetQQAvatar: "set_qq_avatar",
  GetFile: "get_file",
  ForwardFriendSingleMsg: "forward_friend_single_msg",
  ForwardGroupSingleMsg: "forward_group_single_msg",
  TranslateEnWordToZn: "translate_en2zh",
  FetchPttText: "fetch_ptt_text",
  SetMsgEmojiLike: "set_msg_emoji_like",
  GoCQHTTP_SendForwardMsg: "send_forward_msg",
  MarkPrivateMsgAsRead: "mark_private_msg_as_read",
  MarkGroupMsgAsRead: "mark_group_msg_as_read",
  GetFriendMsgHistory: "get_friend_msg_history",
  CreateCollection: "create_collection",
  GetCollectionList: "get_collection_list",
  SetLongNick: "set_self_longnick",
  GetRecentContact: "get_recent_contact",
  _MarkAllMsgAsRead: "_mark_all_as_read",
  GetProfileLike: "get_profile_like",
  FetchCustomFace: "fetch_custom_face",
  FetchCustomFaceDetail: "fetch_custom_face_detail",
  AddCustomFace: "add_custom_face",
  DeleteCustomFace: "delete_custom_face",
  SetCustomFaceDesc: "set_custom_face_desc",
  FetchEmojiLike: "fetch_emoji_like",
  GetEmojiLikes: "get_emoji_likes",
  SetInputStatus: "set_input_status",
  GetGroupInfoEx: "get_group_info_ex",
  GetGroupDetailInfo: "get_group_detail_info",
  GetGroupIgnoreAddRequest: "get_group_ignore_add_request",
  DelGroupNotice: "_del_group_notice",
  FriendPoke: "friend_poke",
  GroupPoke: "group_poke",
  GetPacketStatus: "nc_get_packet_status",
  GetUserStatus: "nc_get_user_status",
  GetRkey: "nc_get_rkey",
  GetGroupShutList: "get_group_shut_list",
  MoveGroupFile: "move_group_file",
  TransGroupFile: "trans_group_file",
  RenameGroupFile: "rename_group_file",
  GetGuildList: "get_guild_list",
  GetGuildProfile: "get_guild_service_profile",
  GetGroupIgnoredNotifies: "get_group_ignored_notifies",
  SetGroupSign: "set_group_sign",
  SendGroupSign: "send_group_sign",
  SendPacket: "send_packet",
  GetMiniAppArk: "get_mini_app_ark",
  // UploadForwardMsg : "upload_forward_msg",
  GetAiRecord: "get_ai_record",
  GetAiCharacters: "get_ai_characters",
  SendGroupAiRecord: "send_group_ai_record",
  GetClientkey: "get_clientkey",
  SendPoke: "send_poke",
  // Flash (闪传) 扩展
  CreateFlashTask: "create_flash_task",
  SendFlashMsg: "send_flash_msg",
  // 因为不可能手动构造element，所以不走sendMsg
  GetShareLink: "get_share_link",
  DownloadFileset: "download_fileset",
  GetFilesetInfo: "get_fileset_info",
  GetFlashFileList: "get_flash_file_list",
  GetFlashFileUrl: "get_flash_file_url",
  GetFilesetId: "get_fileset_id",
  // Online File (在线文件) 扩展
  SendOnlineFile: "send_online_file",
  SendOnlineFolder: "send_online_folder",
  GetOnlineFileMessages: "get_online_file_msg",
  ReceiveOnlineFile: "receive_online_file",
  RefuseOnlineFile: "refuse_online_file",
  CancelOnlineFile: "cancel_online_file",
  GetGroupSignedList: "get_group_signed_list"
};
var jr = /* @__PURE__ */ ((t) => (t.Stream = "stream", t.Response = "response", t.Reset = "reset", t.Error = "error", t))(jr || {});
const sae = {
  Common: {
    errors: [
      { code: 1400, description: "请求参数错误或业务逻辑执行失败" },
      { code: 1401, description: "权限不足" },
      { code: 1404, description: "资源不存在" }
    ]
  }
};
class Rt {
  static createResponse(e, n, r, i = "", o = null, s = !1) {
    return {
      status: n,
      retcode: r,
      data: e,
      message: i,
      wording: i,
      echo: o,
      stream: s ? "stream-action" : "normal-action"
    };
  }
  static res(e, n, r, i = "", o = null, s = !1) {
    return this.createResponse(e, n, r, i, o, s);
  }
  static ok(e, n = null, r = !1) {
    return this.createResponse(e, "ok", 0, "", n, r);
  }
  static error(e, n, r = null, i = !1) {
    return this.createResponse(i ? { type: jr.Error, data_type: "error" } : null, "failed", n, e, r, i);
  }
}
class le {
  actionName = re.Unknown;
  core;
  validate = void 0;
  payloadSchema = void 0;
  returnSchema = void 0;
  payloadExample = void 0;
  returnExample = void 0;
  actionSummary = "";
  actionDescription = "";
  actionTags = [];
  obContext;
  useStream = !1;
  errorExamples = sae.Common.errors;
  constructor(e, n) {
    this.obContext = e, this.core = n;
  }
  async check(e) {
    if (!this.payloadSchema) return { valid: !0 };
    try {
      this.validate = wu.Compile(this.payloadSchema);
      let n = e;
      n = Za(this.payloadSchema, n), typeof e == "object" && e !== null && n !== null && Object.assign(e, n);
    } catch (n) {
      return { valid: !1, message: `Schema compilation error: ${n.message}` };
    }
    if (this.validate && !this.validate.Check(e)) {
      const r = [...this.validate.Errors(e)].map((i) => `Key: ${i.path.split("/").slice(1).join(".")}, Message: ${i.message}`);
      return {
        valid: !1,
        message: r.length > 0 ? r.join(`
`) : "未知错误"
      };
    }
    return { valid: !0 };
  }
  async handle(e, n, r, i = { send: async () => {
  } }, o) {
    const s = await this.check(e);
    if (!s.valid)
      return Rt.error(s.message, 400);
    try {
      const a = await this._handle(e, n, r, i);
      return Rt.ok(a, o, this.useStream);
    } catch (a) {
      return this.core.context.logger.logError("发生错误", a), Rt.error(a.message.toString() || a?.stack?.toString() || "未知错误，可能操作超时", 200, o, this.useStream);
    }
  }
  async websocketHandle(e, n, r, i, o = { send: async () => {
  } }) {
    const s = await this.check(e);
    if (!s.valid)
      return Rt.error(s.message, 1400, n, this.useStream);
    try {
      const a = await this._handle(e, r, i, o);
      return Rt.ok(a, n, this.useStream);
    } catch (a) {
      return this.core.context.logger.logError("发生错误", a), Rt.error((a.message.toString() || a.stack?.toString()) ?? "Error", 1200, n, this.useStream);
    }
  }
}
const OR = [];
function MR(t) {
  OR.push(t);
}
var aae = Object.getOwnPropertyDescriptor, cae = (t, e, n, r) => {
  for (var i = r > 1 ? void 0 : r ? aae(e, n) : e, o = t.length - 1, s; o >= 0; o--)
    (s = t[o]) && (i = s(i) || i);
  return i;
};
let NN = class extends le {
  actionName = re.TestAutoRegister01;
  payloadSchema = p.Object({});
  returnSchema = p.String({ description: "测试返回内容" });
  async _handle(t) {
    return "AutoRegister Router Test";
  }
};
NN = cae([
  MR
], NN);
var uae = Object.getOwnPropertyDescriptor, lae = (t, e, n, r) => {
  for (var i = r > 1 ? void 0 : r ? uae(e, n) : e, o = t.length - 1, s; o >= 0; o--)
    (s = t[o]) && (i = s(i) || i);
  return i;
};
let PN = class extends le {
  actionName = re.TestAutoRegister02;
  payloadSchema = p.Object({});
  returnSchema = p.String({ description: "测试返回内容" });
  async _handle(t) {
    return "AutoRegister Router Test";
  }
};
PN = lae([
  MR
], PN);
class pae {
  onMSFStatusChange(e, n) {
  }
  onMSFSsoError(e, n) {
  }
  getGroupCode(e) {
  }
  // onSendMsfReply (_seq: string, _cmd: string, _uk1: number, _uk2: string, _rsp: {
  //   ssoRetCode: 0,
  //   trpcRetCode: 0,
  //   trpcFuncCode: 0,
  //   errorMsg: '',
  //   pbBuffer: Uint8Array,
  //   transInfoMap: Map<unknown, unknown>;
  // }) {
  //   console.log('[NodeIDependsAdapter] onSendMsfReply', _seq, _cmd, _uk1, _uk2, Buffer.from(_rsp.pbBuffer).toString('hex'));
  // }
}
class dae {
  dispatchRequest(e) {
  }
  dispatchCall(e) {
  }
  dispatchCallWithJson(e) {
  }
}
class fae {
  onLog(...e) {
  }
  onGetSrvCalTime(...e) {
  }
  onShowErrUITips(...e) {
  }
  fixPicImgType(...e) {
  }
  getAppSetting(...e) {
  }
  onInstallFinished(...e) {
  }
  onUpdateGeneralFlag(...e) {
  }
  onGetOfflineMsg(...e) {
  }
}
class RR {
  binaryPath;
  logsPath;
  configPath;
  cachePath;
  staticPath;
  pluginPath;
  constructor(e = $u(hc(import.meta.url))) {
    this.binaryPath = e;
    let n;
    process.env.NAPCAT_WORKDIR ? n = process.env.NAPCAT_WORKDIR : Pn.platform() === "darwin" ? n = be.join(Pn.homedir(), "Library", "Application Support", "QQ", "NapCat") : n = this.binaryPath, this.logsPath = be.join(n, "logs"), this.configPath = be.join(n, "config"), this.pluginPath = be.join(n, "plugins"), this.cachePath = be.join(n, "cache"), this.staticPath = be.join(this.binaryPath, "static"), de.existsSync(this.logsPath) || de.mkdirSync(this.logsPath, { recursive: !0 }), de.existsSync(this.configPath) || de.mkdirSync(this.configPath, { recursive: !0 }), de.existsSync(this.cachePath) || de.mkdirSync(this.cachePath, { recursive: !0 });
  }
}
const hae = 1, mae = 2, BR = 4, gae = 8, vi = {
  MODE_NUMBER: hae,
  MODE_ALPHA_NUM: mae,
  MODE_8BIT_BYTE: BR,
  MODE_KANJI: gae
};
class yae {
  mode;
  data;
  constructor(e) {
    this.mode = BR, this.data = e;
  }
  getLength() {
    return this.data.length;
  }
  write(e) {
    for (let n = 0; n < this.data.length; n++)
      e.put(this.data.charCodeAt(n), 8);
  }
}
const Qn = {
  glog(t) {
    if (t < 1)
      throw new Error("glog(" + t + ")");
    return Qn.LOG_TABLE[t];
  },
  gexp(t) {
    for (; t < 0; )
      t += 255;
    for (; t >= 256; )
      t -= 255;
    return Qn.EXP_TABLE[t];
  },
  EXP_TABLE: new Array(256).fill(0),
  LOG_TABLE: new Array(256).fill(0)
};
for (let t = 0; t < 8; t++)
  Qn.EXP_TABLE[t] = 1 << t;
for (let t = 8; t < 256; t++)
  Qn.EXP_TABLE[t] = Qn.EXP_TABLE[t - 4] ^ Qn.EXP_TABLE[t - 5] ^ Qn.EXP_TABLE[t - 6] ^ Qn.EXP_TABLE[t - 8];
for (let t = 0; t < 255; t++)
  Qn.LOG_TABLE[Qn.EXP_TABLE[t]] = t;
class Su {
  num;
  constructor(e, n) {
    if (e.length === void 0)
      throw new Error(e.length + "/" + n);
    let r = 0;
    for (; r < e.length && e[r] === 0; )
      r++;
    this.num = new Array(e.length - r + n);
    for (let i = 0; i < e.length - r; i++)
      this.num[i] = e[i + r];
  }
  get(e) {
    return this.num[e];
  }
  getLength() {
    return this.num.length;
  }
  multiply(e) {
    const n = new Array(this.getLength() + e.getLength() - 1);
    for (let r = 0; r < this.getLength(); r++)
      for (let i = 0; i < e.getLength(); i++)
        n[r + i] ^= Qn.gexp(Qn.glog(this.get(r)) + Qn.glog(e.get(i)));
    return new Su(n, 0);
  }
  mod(e) {
    if (this.getLength() - e.getLength() < 0)
      return this;
    const n = Qn.glog(this.get(0)) - Qn.glog(e.get(0)), r = new Array(this.getLength());
    for (let i = 0; i < this.getLength(); i++)
      r[i] = this.get(i);
    for (let i = 0; i < e.getLength(); i++)
      r[i] ^= Qn.gexp(Qn.glog(e.get(i)) + n);
    return new Su(r, 0).mod(e);
  }
}
const Rs = {
  PATTERN000: 0,
  PATTERN001: 1,
  PATTERN010: 2,
  PATTERN011: 3,
  PATTERN100: 4,
  PATTERN101: 5,
  PATTERN110: 6,
  PATTERN111: 7
}, vae = [
  [],
  [6, 18],
  [6, 22],
  [6, 26],
  [6, 30],
  [6, 34],
  [6, 22, 38],
  [6, 24, 42],
  [6, 26, 46],
  [6, 28, 50],
  [6, 30, 54],
  [6, 32, 58],
  [6, 34, 62],
  [6, 26, 46, 66],
  [6, 26, 48, 70],
  [6, 26, 50, 74],
  [6, 30, 54, 78],
  [6, 30, 56, 82],
  [6, 30, 58, 86],
  [6, 34, 62, 90],
  [6, 28, 50, 72, 94],
  [6, 26, 50, 74, 98],
  [6, 30, 54, 78, 102],
  [6, 28, 54, 80, 106],
  [6, 32, 58, 84, 110],
  [6, 30, 58, 86, 114],
  [6, 34, 62, 90, 118],
  [6, 26, 50, 74, 98, 122],
  [6, 30, 54, 78, 102, 126],
  [6, 26, 52, 78, 104, 130],
  [6, 30, 56, 82, 108, 134],
  [6, 34, 60, 86, 112, 138],
  [6, 30, 58, 86, 114, 142],
  [6, 34, 62, 90, 118, 146],
  [6, 30, 54, 78, 102, 126, 150],
  [6, 24, 50, 76, 102, 128, 154],
  [6, 28, 54, 80, 106, 132, 158],
  [6, 32, 58, 84, 110, 136, 162],
  [6, 26, 54, 82, 110, 138, 166],
  [6, 30, 58, 86, 114, 142, 170]
], fx = 1335, hx = 7973, bae = 21522;
function xae(t) {
  let e = t << 10;
  for (; Hs(e) - Hs(fx) >= 0; )
    e ^= fx << Hs(e) - Hs(fx);
  return (t << 10 | e) ^ bae;
}
function wae(t) {
  let e = t << 12;
  for (; Hs(e) - Hs(hx) >= 0; )
    e ^= hx << Hs(e) - Hs(hx);
  return t << 12 | e;
}
function Hs(t) {
  let e = 0;
  for (; t !== 0; )
    e++, t >>>= 1;
  return e;
}
function Sae(t) {
  return vae[t - 1];
}
function _ae(t, e, n) {
  switch (t) {
    case Rs.PATTERN000:
      return (e + n) % 2 === 0;
    case Rs.PATTERN001:
      return e % 2 === 0;
    case Rs.PATTERN010:
      return n % 3 === 0;
    case Rs.PATTERN011:
      return (e + n) % 3 === 0;
    case Rs.PATTERN100:
      return (Math.floor(e / 2) + Math.floor(n / 3)) % 2 === 0;
    case Rs.PATTERN101:
      return e * n % 2 + e * n % 3 === 0;
    case Rs.PATTERN110:
      return (e * n % 2 + e * n % 3) % 2 === 0;
    case Rs.PATTERN111:
      return (e * n % 3 + (e + n) % 2) % 2 === 0;
    default:
      throw new Error("bad maskPattern:" + t);
  }
}
function Eae(t) {
  let e = new Su([1], 0);
  for (let n = 0; n < t; n++)
    e = e.multiply(new Su([1, Qn.gexp(n)], 0));
  return e;
}
function DN(t, e) {
  if (e >= 1 && e < 10)
    switch (t) {
      case vi.MODE_NUMBER:
        return 10;
      case vi.MODE_ALPHA_NUM:
        return 9;
      case vi.MODE_8BIT_BYTE:
        return 8;
      case vi.MODE_KANJI:
        return 8;
      default:
        throw new Error("mode:" + t);
    }
  else if (e < 27)
    switch (t) {
      case vi.MODE_NUMBER:
        return 12;
      case vi.MODE_ALPHA_NUM:
        return 11;
      case vi.MODE_8BIT_BYTE:
        return 16;
      case vi.MODE_KANJI:
        return 10;
      default:
        throw new Error("mode:" + t);
    }
  else if (e < 41)
    switch (t) {
      case vi.MODE_NUMBER:
        return 14;
      case vi.MODE_ALPHA_NUM:
        return 13;
      case vi.MODE_8BIT_BYTE:
        return 16;
      case vi.MODE_KANJI:
        return 12;
      default:
        throw new Error("mode:" + t);
    }
  else
    throw new Error("type:" + e);
}
function Aae(t) {
  const e = t.getModuleCount();
  let n = 0;
  for (let o = 0; o < e; o++)
    for (let s = 0; s < e; s++) {
      let a = 0;
      const c = t.isDark(o, s);
      for (let u = -1; u <= 1; u++)
        if (!(o + u < 0 || e <= o + u))
          for (let l = -1; l <= 1; l++)
            s + l < 0 || e <= s + l || u === 0 && l === 0 || c === t.isDark(o + u, s + l) && a++;
      a > 5 && (n += 3 + a - 5);
    }
  for (let o = 0; o < e - 1; o++)
    for (let s = 0; s < e - 1; s++) {
      let a = 0;
      t.isDark(o, s) && a++, t.isDark(o + 1, s) && a++, t.isDark(o, s + 1) && a++, t.isDark(o + 1, s + 1) && a++, (a === 0 || a === 4) && (n += 3);
    }
  for (let o = 0; o < e; o++)
    for (let s = 0; s < e - 6; s++)
      t.isDark(o, s) && !t.isDark(o, s + 1) && t.isDark(o, s + 2) && t.isDark(o, s + 3) && t.isDark(o, s + 4) && !t.isDark(o, s + 5) && t.isDark(o, s + 6) && (n += 40);
  for (let o = 0; o < e; o++)
    for (let s = 0; s < e - 6; s++)
      t.isDark(s, o) && !t.isDark(s + 1, o) && t.isDark(s + 2, o) && t.isDark(s + 3, o) && t.isDark(s + 4, o) && !t.isDark(s + 5, o) && t.isDark(s + 6, o) && (n += 40);
  let r = 0;
  for (let o = 0; o < e; o++)
    for (let s = 0; s < e; s++)
      t.isDark(s, o) && r++;
  const i = Math.abs(100 * r / e / e - 50) / 5;
  return n += i * 10, n;
}
const eu = {
  L: 1,
  M: 0,
  Q: 3,
  H: 2
};
class Jl {
  totalCount;
  dataCount;
  constructor(e, n) {
    this.totalCount = e, this.dataCount = n;
  }
  static RS_BLOCK_TABLE = [
    // L
    // M
    // Q
    // H
    // 1
    [1, 26, 19],
    [1, 26, 16],
    [1, 26, 13],
    [1, 26, 9],
    // 2
    [1, 44, 34],
    [1, 44, 28],
    [1, 44, 22],
    [1, 44, 16],
    // 3
    [1, 70, 55],
    [1, 70, 44],
    [2, 35, 17],
    [2, 35, 13],
    // 4
    [1, 100, 80],
    [2, 50, 32],
    [2, 50, 24],
    [4, 25, 9],
    // 5
    [1, 134, 108],
    [2, 67, 43],
    [2, 33, 15, 2, 34, 16],
    [2, 33, 11, 2, 34, 12],
    // 6
    [2, 86, 68],
    [4, 43, 27],
    [4, 43, 19],
    [4, 43, 15],
    // 7
    [2, 98, 78],
    [4, 49, 31],
    [2, 32, 14, 4, 33, 15],
    [4, 39, 13, 1, 40, 14],
    // 8
    [2, 121, 97],
    [2, 60, 38, 2, 61, 39],
    [4, 40, 18, 2, 41, 19],
    [4, 40, 14, 2, 41, 15],
    // 9
    [2, 146, 116],
    [3, 58, 36, 2, 59, 37],
    [4, 36, 16, 4, 37, 17],
    [4, 36, 12, 4, 37, 13],
    // 10
    [2, 86, 68, 2, 87, 69],
    [4, 69, 43, 1, 70, 44],
    [6, 43, 19, 2, 44, 20],
    [6, 43, 15, 2, 44, 16],
    // 11
    [4, 101, 81],
    [1, 80, 50, 4, 81, 51],
    [4, 50, 22, 4, 51, 23],
    [3, 36, 12, 8, 37, 13],
    // 12
    [2, 116, 92, 2, 117, 93],
    [6, 58, 36, 2, 59, 37],
    [4, 46, 20, 6, 47, 21],
    [7, 42, 14, 4, 43, 15],
    // 13
    [4, 133, 107],
    [8, 59, 37, 1, 60, 38],
    [8, 44, 20, 4, 45, 21],
    [12, 33, 11, 4, 34, 12],
    // 14
    [3, 145, 115, 1, 146, 116],
    [4, 64, 40, 5, 65, 41],
    [11, 36, 16, 5, 37, 17],
    [11, 36, 12, 5, 37, 13],
    // 15
    [5, 109, 87, 1, 110, 88],
    [5, 65, 41, 5, 66, 42],
    [5, 54, 24, 7, 55, 25],
    [11, 36, 12],
    // 16
    [5, 122, 98, 1, 123, 99],
    [7, 73, 45, 3, 74, 46],
    [15, 43, 19, 2, 44, 20],
    [3, 45, 15, 13, 46, 16],
    // 17
    [1, 135, 107, 5, 136, 108],
    [10, 74, 46, 1, 75, 47],
    [1, 50, 22, 15, 51, 23],
    [2, 42, 14, 17, 43, 15],
    // 18
    [5, 150, 120, 1, 151, 121],
    [9, 69, 43, 4, 70, 44],
    [17, 50, 22, 1, 51, 23],
    [2, 42, 14, 19, 43, 15],
    // 19
    [3, 141, 113, 4, 142, 114],
    [3, 70, 44, 11, 71, 45],
    [17, 47, 21, 4, 48, 22],
    [9, 39, 13, 16, 40, 14],
    // 20
    [3, 135, 107, 5, 136, 108],
    [3, 67, 41, 13, 68, 42],
    [15, 54, 24, 5, 55, 25],
    [15, 43, 15, 10, 44, 16],
    // 21
    [4, 144, 116, 4, 145, 117],
    [17, 68, 42],
    [17, 50, 22, 6, 51, 23],
    [19, 46, 16, 6, 47, 17],
    // 22
    [2, 139, 111, 7, 140, 112],
    [17, 74, 46],
    [7, 54, 24, 16, 55, 25],
    [34, 37, 13],
    // 23
    [4, 151, 121, 5, 152, 122],
    [4, 75, 47, 14, 76, 48],
    [11, 54, 24, 14, 55, 25],
    [16, 45, 15, 14, 46, 16],
    // 24
    [6, 147, 117, 4, 148, 118],
    [6, 73, 45, 14, 74, 46],
    [11, 54, 24, 16, 55, 25],
    [30, 46, 16, 2, 47, 17],
    // 25
    [8, 132, 106, 4, 133, 107],
    [8, 75, 47, 13, 76, 48],
    [7, 54, 24, 22, 55, 25],
    [22, 45, 15, 13, 46, 16],
    // 26
    [10, 142, 114, 2, 143, 115],
    [19, 74, 46, 4, 75, 47],
    [28, 50, 22, 6, 51, 23],
    [33, 46, 16, 4, 47, 17],
    // 27
    [8, 152, 122, 4, 153, 123],
    [22, 73, 45, 3, 74, 46],
    [8, 53, 23, 26, 54, 24],
    [12, 45, 15, 28, 46, 16],
    // 28
    [3, 147, 117, 10, 148, 118],
    [3, 73, 45, 23, 74, 46],
    [4, 54, 24, 31, 55, 25],
    [11, 45, 15, 31, 46, 16],
    // 29
    [7, 146, 116, 7, 147, 117],
    [21, 73, 45, 7, 74, 46],
    [1, 53, 23, 37, 54, 24],
    [19, 45, 15, 26, 46, 16],
    // 30
    [5, 145, 115, 10, 146, 116],
    [19, 75, 47, 10, 76, 48],
    [15, 54, 24, 25, 55, 25],
    [23, 45, 15, 25, 46, 16],
    // 31
    [13, 145, 115, 3, 146, 116],
    [2, 74, 46, 29, 75, 47],
    [42, 54, 24, 1, 55, 25],
    [23, 45, 15, 28, 46, 16],
    // 32
    [17, 145, 115],
    [10, 74, 46, 23, 75, 47],
    [10, 54, 24, 35, 55, 25],
    [19, 45, 15, 35, 46, 16],
    // 33
    [17, 145, 115, 1, 146, 116],
    [14, 74, 46, 21, 75, 47],
    [29, 54, 24, 19, 55, 25],
    [11, 45, 15, 46, 46, 16],
    // 34
    [13, 145, 115, 6, 146, 116],
    [14, 74, 46, 23, 75, 47],
    [44, 54, 24, 7, 55, 25],
    [59, 46, 16, 1, 47, 17],
    // 35
    [12, 151, 121, 7, 152, 122],
    [12, 75, 47, 26, 76, 48],
    [39, 54, 24, 14, 55, 25],
    [22, 45, 15, 41, 46, 16],
    // 36
    [6, 151, 121, 14, 152, 122],
    [6, 75, 47, 34, 76, 48],
    [46, 54, 24, 10, 55, 25],
    [2, 45, 15, 64, 46, 16],
    // 37
    [17, 152, 122, 4, 153, 123],
    [29, 74, 46, 14, 75, 47],
    [49, 54, 24, 10, 55, 25],
    [24, 45, 15, 46, 46, 16],
    // 38
    [4, 152, 122, 18, 153, 123],
    [13, 74, 46, 32, 75, 47],
    [48, 54, 24, 14, 55, 25],
    [42, 45, 15, 32, 46, 16],
    // 39
    [20, 147, 117, 4, 148, 118],
    [40, 75, 47, 7, 76, 48],
    [43, 54, 24, 22, 55, 25],
    [10, 45, 15, 67, 46, 16],
    // 40
    [19, 148, 118, 6, 149, 119],
    [18, 75, 47, 31, 76, 48],
    [34, 54, 24, 34, 55, 25],
    [20, 45, 15, 61, 46, 16]
  ];
}
function FN(t, e) {
  const n = Iae(t, e);
  if (n === void 0)
    throw new Error(`bad rs block @ typeNumber: ${t} / errorCorrectLevel: ${e}`);
  const r = n.length / 3, i = [];
  for (let o = 0; o < r; o++) {
    const s = n[o * 3 + 0], a = n[o * 3 + 1], c = n[o * 3 + 2];
    if (s === void 0)
      throw new Error(`count is undefined for typeNumber: ${t} / errorCorrectLevel: ${e}`);
    for (let u = 0; u < s; u++)
      i.push(new Jl(a, c));
  }
  return i;
}
function Iae(t, e) {
  switch (e) {
    case eu.L:
      return Jl.RS_BLOCK_TABLE[(t - 1) * 4 + 0];
    case eu.M:
      return Jl.RS_BLOCK_TABLE[(t - 1) * 4 + 1];
    case eu.Q:
      return Jl.RS_BLOCK_TABLE[(t - 1) * 4 + 2];
    case eu.H:
      return Jl.RS_BLOCK_TABLE[(t - 1) * 4 + 3];
    default:
      return;
  }
}
class ON {
  buffer;
  length;
  constructor() {
    this.buffer = [], this.length = 0;
  }
  get(e) {
    const n = Math.floor(e / 8);
    return (this.buffer[n] >>> 7 - e % 8 & 1) === 1;
  }
  put(e, n) {
    for (let r = 0; r < n; r++)
      this.putBit((e >>> n - r - 1 & 1) === 1);
  }
  getLengthInBits() {
    return this.length;
  }
  putBit(e) {
    const n = Math.floor(this.length / 8);
    this.buffer.length <= n && this.buffer.push(0), e && (this.buffer[n] |= 128 >>> this.length % 8), this.length++;
  }
}
class tu {
  typeNumber;
  errorCorrectLevel;
  modules;
  moduleCount;
  dataCache;
  dataList;
  static PAD0 = 236;
  static PAD1 = 17;
  constructor(e, n) {
    this.typeNumber = e, this.errorCorrectLevel = n, this.modules = null, this.moduleCount = 0, this.dataCache = null, this.dataList = [];
  }
  addData(e) {
    const n = new yae(e);
    this.dataList.push(n), this.dataCache = null;
  }
  isDark(e, n) {
    if (e < 0 || this.moduleCount <= e || n < 0 || this.moduleCount <= n)
      throw new Error(`${e},${n}`);
    if (this.modules === null || this.modules[e] === null || this.modules[e][n] === null)
      throw new Error(`Module at (${e},${n}) is null`);
    return this.modules[e][n];
  }
  getModuleCount() {
    return this.moduleCount;
  }
  make() {
    if (this.typeNumber < 1) {
      let e = 1;
      for (e = 1; e < 40; e++) {
        const n = FN(e, this.errorCorrectLevel), r = new ON();
        let i = 0;
        for (let o = 0; o < n.length; o++)
          i += n[o].dataCount;
        for (let o = 0; o < this.dataList.length; o++) {
          const s = this.dataList[o];
          r.put(s.mode, 4), r.put(s.getLength(), DN(s.mode, e)), s.write(r);
        }
        if (r.getLengthInBits() <= i * 8)
          break;
      }
      this.typeNumber = e;
    }
    this.makeImpl(!1, this.getBestMaskPattern());
  }
  makeImpl(e, n) {
    this.moduleCount = this.typeNumber * 4 + 17, this.modules = new Array(this.moduleCount);
    for (let r = 0; r < this.moduleCount; r++) {
      this.modules[r] = new Array(this.moduleCount);
      for (let i = 0; i < this.moduleCount; i++)
        this.modules[r][i] = null;
    }
    this.setupPositionProbePattern(0, 0), this.setupPositionProbePattern(this.moduleCount - 7, 0), this.setupPositionProbePattern(0, this.moduleCount - 7), this.setupPositionAdjustPattern(), this.setupTimingPattern(), this.setupTypeInfo(e, n), this.typeNumber >= 7 && this.setupTypeNumber(e), this.dataCache === null && (this.dataCache = tu.createData(this.typeNumber, this.errorCorrectLevel, this.dataList)), this.mapData(this.dataCache, n);
  }
  setupPositionProbePattern(e, n) {
    for (let r = -1; r <= 7; r++)
      if (!(e + r <= -1 || this.moduleCount <= e + r))
        for (let i = -1; i <= 7; i++)
          n + i <= -1 || this.moduleCount <= n + i || (r >= 0 && r <= 6 && (i === 0 || i === 6) || i >= 0 && i <= 6 && (r === 0 || r === 6) || r >= 2 && r <= 4 && i >= 2 && i <= 4 ? this.modules[e + r][n + i] = !0 : this.modules[e + r][n + i] = !1);
  }
  getBestMaskPattern() {
    let e = 0, n = 0;
    for (let r = 0; r < 8; r++) {
      this.makeImpl(!0, r);
      const i = Aae(this);
      (r === 0 || e > i) && (e = i, n = r);
    }
    return n;
  }
  createMovieClip(e, n, r) {
    const i = e.createEmptyMovieClip(n, r), o = 1;
    this.make();
    for (let s = 0; s < this.modules.length; s++) {
      const a = s * o;
      for (let c = 0; c < this.modules[s].length; c++) {
        const u = c * o;
        this.modules[s][c] && (i.beginFill(0, 100), i.moveTo(u, a), i.lineTo(u + o, a), i.lineTo(u + o, a + o), i.lineTo(u, a + o), i.endFill());
      }
    }
    return i;
  }
  setupTimingPattern() {
    for (let e = 8; e < this.moduleCount - 8; e++)
      this.modules[e][6] === null && (this.modules[e][6] = e % 2 === 0);
    for (let e = 8; e < this.moduleCount - 8; e++)
      this.modules[6][e] === null && (this.modules[6][e] = e % 2 === 0);
  }
  setupPositionAdjustPattern() {
    const e = Sae(this.typeNumber);
    for (let n = 0; n < e.length; n++)
      for (let r = 0; r < e.length; r++) {
        const i = e[n], o = e[r];
        if (this.modules[i][o] === null)
          for (let s = -2; s <= 2; s++)
            for (let a = -2; a <= 2; a++)
              Math.abs(s) === 2 || Math.abs(a) === 2 || s === 0 && a === 0 ? this.modules[i + s][o + a] = !0 : this.modules[i + s][o + a] = !1;
      }
  }
  setupTypeNumber(e) {
    const n = wae(this.typeNumber);
    let r;
    for (let i = 0; i < 18; i++)
      r = !e && (n >> i & 1) === 1, this.modules[Math.floor(i / 3)][i % 3 + this.moduleCount - 8 - 3] = r;
    for (let i = 0; i < 18; i++)
      r = !e && (n >> i & 1) === 1, this.modules[i % 3 + this.moduleCount - 8 - 3][Math.floor(i / 3)] = r;
  }
  setupTypeInfo(e, n) {
    const r = this.errorCorrectLevel << 3 | n, i = xae(r);
    let o;
    for (let s = 0; s < 15; s++)
      o = !e && (i >> s & 1) === 1, s < 6 ? this.modules[s][8] = o : s < 8 ? this.modules[s + 1][8] = o : this.modules[this.moduleCount - 15 + s][8] = o;
    for (let s = 0; s < 15; s++)
      o = !e && (i >> s & 1) === 1, s < 8 ? this.modules[8][this.moduleCount - s - 1] = o : s < 9 ? this.modules[8][15 - s - 1 + 1] = o : this.modules[8][15 - s - 1] = o;
    this.modules[this.moduleCount - 8][8] = !e;
  }
  mapData(e, n) {
    let r = -1, i = this.moduleCount - 1, o = 7, s = 0;
    for (let a = this.moduleCount - 1; a > 0; a -= 2)
      for (a === 6 && a--; ; ) {
        for (let c = 0; c < 2; c++)
          if (this.modules[i][a - c] === null) {
            let u = !1;
            s < e.length && (u = ((e[s] ?? 0) >>> o & 1) === 1), _ae(n, i, a - c) && (u = !u), this.modules[i][a - c] = u, o--, o === -1 && (s++, o = 7);
          }
        if (i += r, i < 0 || this.moduleCount <= i) {
          i -= r, r = -r;
          break;
        }
      }
  }
  static createData(e, n, r) {
    const i = FN(e, n), o = new ON();
    for (let a = 0; a < r.length; a++) {
      const c = r[a];
      o.put(c.mode, 4), o.put(c.getLength(), DN(c.mode, e)), c.write(o);
    }
    let s = 0;
    for (let a = 0; a < i.length; a++)
      s += i[a].dataCount;
    if (o.getLengthInBits() > s * 8)
      throw new Error(`code length overflow. (${o.getLengthInBits()} > ${s * 8})`);
    for (o.getLengthInBits() + 4 <= s * 8 && o.put(0, 4); o.getLengthInBits() % 8 !== 0; )
      o.putBit(!1);
    for (; !(o.getLengthInBits() >= s * 8 || (o.put(tu.PAD0, 8), o.getLengthInBits() >= s * 8)); )
      o.put(tu.PAD1, 8);
    return tu.createBytes(o, i);
  }
  static createBytes(e, n) {
    let r = 0, i = 0, o = 0;
    const s = new Array(n.length), a = new Array(n.length);
    for (let d = 0; d < n.length; d++) {
      const f = n[d].dataCount, m = n[d].totalCount - f;
      i = Math.max(i, f), o = Math.max(o, m), s[d] = new Array(f);
      for (let g = 0; g < s[d].length; g++)
        s[d][g] = 255 & e.buffer[g + r];
      r += f;
      const h = Eae(m), x = new Su(s[d], h.getLength() - 1).mod(h);
      a[d] = new Array(h.getLength() - 1);
      for (let g = 0; g < a[d].length; g++) {
        const v = g + x.getLength() - a[d].length;
        a[d][g] = v >= 0 ? x.get(v) : 0;
      }
    }
    let c = 0;
    for (let d = 0; d < n.length; d++)
      c += n[d].totalCount;
    const u = new Array(c);
    let l = 0;
    for (let d = 0; d < i; d++)
      for (let f = 0; f < n.length; f++)
        d < s[f].length && (u[l++] = s[f][d]);
    for (let d = 0; d < o; d++)
      for (let f = 0; f < n.length; f++)
        d < a[f].length && (u[l++] = a[f][d]);
    return u;
  }
}
const Cae = "\x1B[40m  \x1B[0m", om = "\x1B[47m  \x1B[0m", Tae = (t) => t ? Cae : om, mx = (t) => ({
  times: (e) => new Array(e + 1).join(t)
}), kae = (t, e) => {
  const n = new Array(t);
  for (let r = 0; r < t; r++)
    n[r] = e;
  return n;
}, Nae = {
  error: eu.L,
  generate(t, e, n) {
    typeof e == "function" && (n = e, e = {});
    const r = new tu(-1, this.error);
    r.addData(t), r.make();
    let i = "";
    if (e && e.small) {
      const a = r.getModuleCount(), c = r.modules ? r.modules.slice() : [], u = a % 2 === 1;
      u && c.push(kae(a, !1));
      const l = {
        WHITE_ALL: "█",
        WHITE_BLACK: "▀",
        BLACK_WHITE: "▄",
        BLACK_ALL: " "
      }, d = mx(l.BLACK_WHITE).times(a + 2), f = mx(l.WHITE_BLACK).times(a + 2);
      i += d + `
`;
      for (let m = 0; m < a; m += 2) {
        i += l.WHITE_ALL;
        for (let h = 0; h < a; h++)
          c[m]?.[h] === !1 && c[m + 1]?.[h] === !1 ? i += l.WHITE_ALL : c[m]?.[h] === !1 && c[m + 1]?.[h] === !0 ? i += l.WHITE_BLACK : c[m]?.[h] === !0 && c[m + 1]?.[h] === !1 ? i += l.BLACK_WHITE : i += l.BLACK_ALL;
        i += l.WHITE_ALL + `
`;
      }
      u || (i += f);
    } else {
      const o = mx(om).times(r.getModuleCount() + 2);
      i += o + `
`, r.modules && r.modules.forEach((s) => {
        i += om, i += s.map(Tae).join(""), i += om + `
`;
      }), i += o;
    }
    n ? n(i) : console.log(i);
  },
  setErrorLevel(t) {
    this.error = eu[t] || this.error;
  }
}, Pae = p.Object({
  name: p.String({ default: "http-server" }),
  enable: p.Boolean({ default: !1 }),
  port: p.Number({ default: 3e3 }),
  host: p.String({ default: "127.0.0.1" }),
  enableCors: p.Boolean({ default: !0 }),
  enableWebsocket: p.Boolean({ default: !1 }),
  messagePostFormat: p.String({ default: "array" }),
  token: p.String({ default: "" }),
  debug: p.Boolean({ default: !1 })
}), Dae = p.Object({
  name: p.String({ default: "http-sse-server" }),
  enable: p.Boolean({ default: !1 }),
  port: p.Number({ default: 3e3 }),
  host: p.String({ default: "127.0.0.1" }),
  enableCors: p.Boolean({ default: !0 }),
  enableWebsocket: p.Boolean({ default: !1 }),
  messagePostFormat: p.String({ default: "array" }),
  token: p.String({ default: "" }),
  debug: p.Boolean({ default: !1 }),
  reportSelfMessage: p.Boolean({ default: !1 })
}), Fae = p.Object({
  name: p.String({ default: "http-client" }),
  enable: p.Boolean({ default: !1 }),
  url: p.String({ default: "http://localhost:8080" }),
  messagePostFormat: p.String({ default: "array" }),
  reportSelfMessage: p.Boolean({ default: !1 }),
  token: p.String({ default: "" }),
  debug: p.Boolean({ default: !1 })
}), Oae = p.Object({
  name: p.String({ default: "websocket-server" }),
  enable: p.Boolean({ default: !1 }),
  host: p.String({ default: "127.0.0.1" }),
  port: p.Number({ default: 3001 }),
  messagePostFormat: p.String({ default: "array" }),
  reportSelfMessage: p.Boolean({ default: !1 }),
  token: p.String({ default: "" }),
  enableForcePushEvent: p.Boolean({ default: !0 }),
  debug: p.Boolean({ default: !1 }),
  heartInterval: p.Number({ default: 3e4 })
}), Mae = p.Object({
  name: p.String({ default: "websocket-client" }),
  enable: p.Boolean({ default: !1 }),
  url: p.String({ default: "ws://localhost:8082" }),
  messagePostFormat: p.String({ default: "array" }),
  reportSelfMessage: p.Boolean({ default: !1 }),
  reconnectInterval: p.Number({ default: 5e3 }),
  token: p.String({ default: "" }),
  debug: p.Boolean({ default: !1 }),
  heartInterval: p.Number({ default: 3e4 }),
  verifyCertificate: p.Optional(p.Boolean({ default: !0 }))
}), Rae = p.Object({
  name: p.String({ default: "plugin" }),
  enable: p.Boolean({ default: !1 }),
  messagePostFormat: p.String({ default: "array" }),
  reportSelfMessage: p.Boolean({ default: !1 }),
  debug: p.Boolean({ default: !1 })
}), Bae = p.Object({
  httpServers: p.Array(Pae, { default: [] }),
  httpSseServers: p.Array(Dae, { default: [] }),
  httpClients: p.Array(Fae, { default: [] }),
  websocketServers: p.Array(Oae, { default: [] }),
  websocketClients: p.Array(Mae, { default: [] }),
  plugins: p.Array(Rae, { default: [] })
}, { default: {} }), Uae = p.Object({
  baseTimeout: p.Number({ default: 1e4 }),
  uploadSpeedKBps: p.Number({ default: 256 }),
  downloadSpeedKBps: p.Number({ default: 256 }),
  maxTimeout: p.Number({ default: 18e5 })
}, { default: {} }), Lae = p.Object({
  network: Bae,
  musicSignUrl: p.String({ default: "" }),
  enableLocalFile2Url: p.Boolean({ default: !1 }),
  parseMultMsg: p.Boolean({ default: !1 }),
  imageDownloadProxy: p.String({ default: "" }),
  timeout: Uae
});
function TA(t, e, n) {
  return Math.min(
    t.baseTimeout + e / 1024 / Math.max(n, 1) * 1e3,
    t.maxTimeout
  );
}
function jae(t, e) {
  return Math.min(e, t.maxTimeout);
}
class Qae extends fA {
  constructor(e, n, r) {
    super("onebot11", e, n, r);
  }
}
function UR(t, e) {
  for (const n in e)
    if (Object.prototype.hasOwnProperty.call(e, n)) {
      if (e[n] === void 0)
        continue;
      t[n] !== void 0 && typeof t[n] == "object" && !Array.isArray(t[n]) && typeof e[n] == "object" && !Array.isArray(e[n]) ? t[n] = UR({ ...t[n] }, e[n]) : t[n] = e[n];
    }
  return t;
}
const $ae = p.Object(
  {
    dark: p.Record(p.String(), p.String()),
    light: p.Record(p.String(), p.String()),
    fontMode: p.String({ default: "system" })
  },
  {
    default: {
      fontMode: "system",
      dark: {
        "--heroui-background": "0 0% 0%",
        "--heroui-foreground-50": "240 5.88% 10%",
        "--heroui-foreground-100": "240 3.7% 15.88%",
        "--heroui-foreground-200": "240 5.26% 26.08%",
        "--heroui-foreground-300": "240 5.2% 33.92%",
        "--heroui-foreground-400": "240 3.83% 46.08%",
        "--heroui-foreground-500": "240 5.03% 64.9%",
        "--heroui-foreground-600": "240 4.88% 83.92%",
        "--heroui-foreground-700": "240 5.88% 90%",
        "--heroui-foreground-800": "240 4.76% 95.88%",
        "--heroui-foreground-900": "0 0% 98.04%",
        "--heroui-foreground": "210 5.56% 92.94%",
        "--heroui-focus": "212.01999999999998 100% 46.67%",
        "--heroui-overlay": "0 0% 0%",
        "--heroui-divider": "0 0% 100%",
        "--heroui-divider-opacity": "0.15",
        "--heroui-content1": "240 5.88% 10%",
        "--heroui-content1-foreground": "0 0% 98.04%",
        "--heroui-content2": "240 3.7% 15.88%",
        "--heroui-content2-foreground": "240 4.76% 95.88%",
        "--heroui-content3": "240 5.26% 26.08%",
        "--heroui-content3-foreground": "240 5.88% 90%",
        "--heroui-content4": "240 5.2% 33.92%",
        "--heroui-content4-foreground": "240 4.88% 83.92%",
        "--heroui-default-50": "240 5.88% 10%",
        "--heroui-default-100": "240 3.7% 15.88%",
        "--heroui-default-200": "240 5.26% 26.08%",
        "--heroui-default-300": "240 5.2% 33.92%",
        "--heroui-default-400": "240 3.83% 46.08%",
        "--heroui-default-500": "240 5.03% 64.9%",
        "--heroui-default-600": "240 4.88% 83.92%",
        "--heroui-default-700": "240 5.88% 90%",
        "--heroui-default-800": "240 4.76% 95.88%",
        "--heroui-default-900": "0 0% 98.04%",
        "--heroui-default-foreground": "0 0% 100%",
        "--heroui-default": "240 5.26% 26.08%",
        "--heroui-danger-50": "301.89 82.61% 22.55%",
        "--heroui-danger-100": "308.18 76.39% 28.24%",
        "--heroui-danger-200": "313.85 70.65% 36.08%",
        "--heroui-danger-300": "319.73 65.64% 44.51%",
        "--heroui-danger-400": "325.82 69.62% 53.53%",
        "--heroui-danger-500": "331.82 75% 65.49%",
        "--heroui-danger-600": "337.84 83.46% 73.92%",
        "--heroui-danger-700": "343.42 90.48% 83.53%",
        "--heroui-danger-800": "350.53 90.48% 91.76%",
        "--heroui-danger-900": "324 90.91% 95.69%",
        "--heroui-danger-foreground": "0 0% 100%",
        "--heroui-danger": "325.82 69.62% 53.53%",
        "--heroui-primary-50": "340 84.91% 10.39%",
        "--heroui-primary-100": "339.33 86.54% 20.39%",
        "--heroui-primary-200": "339.11 85.99% 30.78%",
        "--heroui-primary-300": "339 86.54% 40.78%",
        "--heroui-primary-400": "339.2 90.36% 51.18%",
        "--heroui-primary-500": "339 90% 60.78%",
        "--heroui-primary-600": "339.11 90.6% 70.78%",
        "--heroui-primary-700": "339.33 90% 80.39%",
        "--heroui-primary-800": "340 91.84% 90.39%",
        "--heroui-primary-900": "339.13 92% 95.1%",
        "--heroui-primary-foreground": "0 0% 100%",
        "--heroui-primary": "339.2 90.36% 51.18%",
        "--heroui-secondary-50": "270 66.67% 9.41%",
        "--heroui-secondary-100": "270 66.67% 18.82%",
        "--heroui-secondary-200": "270 66.67% 28.24%",
        "--heroui-secondary-300": "270 66.67% 37.65%",
        "--heroui-secondary-400": "270 66.67% 47.06%",
        "--heroui-secondary-500": "270 59.26% 57.65%",
        "--heroui-secondary-600": "270 59.26% 68.24%",
        "--heroui-secondary-700": "270 59.26% 78.82%",
        "--heroui-secondary-800": "270 59.26% 89.41%",
        "--heroui-secondary-900": "270 61.54% 94.9%",
        "--heroui-secondary-foreground": "0 0% 100%",
        "--heroui-secondary": "270 59.26% 57.65%",
        "--heroui-success-50": "145.71 77.78% 8.82%",
        "--heroui-success-100": "146.2 79.78% 17.45%",
        "--heroui-success-200": "145.79 79.26% 26.47%",
        "--heroui-success-300": "146.01 79.89% 35.1%",
        "--heroui-success-400": "145.96 79.46% 43.92%",
        "--heroui-success-500": "146.01 62.45% 55.1%",
        "--heroui-success-600": "145.79 62.57% 66.47%",
        "--heroui-success-700": "146.2 61.74% 77.45%",
        "--heroui-success-800": "145.71 61.4% 88.82%",
        "--heroui-success-900": "146.67 64.29% 94.51%",
        "--heroui-success-foreground": "0 0% 0%",
        "--heroui-success": "145.96 79.46% 43.92%",
        "--heroui-warning-50": "37.14 75% 10.98%",
        "--heroui-warning-100": "37.14 75% 21.96%",
        "--heroui-warning-200": "36.96 73.96% 33.14%",
        "--heroui-warning-300": "37.01 74.22% 44.12%",
        "--heroui-warning-400": "37.03 91.27% 55.1%",
        "--heroui-warning-500": "37.01 91.26% 64.12%",
        "--heroui-warning-600": "36.96 91.24% 73.14%",
        "--heroui-warning-700": "37.14 91.3% 81.96%",
        "--heroui-warning-800": "37.14 91.3% 90.98%",
        "--heroui-warning-900": "54.55 91.67% 95.29%",
        "--heroui-warning-foreground": "0 0% 0%",
        "--heroui-warning": "37.03 91.27% 55.1%",
        "--heroui-code-background": "240 5.56% 7.06%",
        "--heroui-strong": "190.14 94.67% 44.12%",
        "--heroui-code-mdx": "190.14 94.67% 44.12%",
        "--heroui-divider-weight": "1px",
        "--heroui-disabled-opacity": ".5",
        "--heroui-font-size-tiny": "0.75rem",
        "--heroui-font-size-small": "0.875rem",
        "--heroui-font-size-medium": "1rem",
        "--heroui-font-size-large": "1.125rem",
        "--heroui-line-height-tiny": "1rem",
        "--heroui-line-height-small": "1.25rem",
        "--heroui-line-height-medium": "1.5rem",
        "--heroui-line-height-large": "1.75rem",
        "--heroui-radius-small": "8px",
        "--heroui-radius-medium": "12px",
        "--heroui-radius-large": "14px",
        "--heroui-border-width-small": "1px",
        "--heroui-border-width-medium": "2px",
        "--heroui-border-width-large": "3px",
        "--heroui-box-shadow-small": "0px 0px 5px 0px rgba(0, 0, 0, .05), 0px 2px 10px 0px rgba(0, 0, 0, .2), inset 0px 0px 1px 0px hsla(0, 0%, 100%, .15)",
        "--heroui-box-shadow-medium": "0px 0px 15px 0px rgba(0, 0, 0, .06), 0px 2px 30px 0px rgba(0, 0, 0, .22), inset 0px 0px 1px 0px hsla(0, 0%, 100%, .15)",
        "--heroui-box-shadow-large": "0px 0px 30px 0px rgba(0, 0, 0, .07), 0px 30px 60px 0px rgba(0, 0, 0, .26), inset 0px 0px 1px 0px hsla(0, 0%, 100%, .15)",
        "--heroui-hover-opacity": ".9"
      },
      light: {
        "--heroui-background": "0 0% 100%",
        "--heroui-foreground-50": "240 5.88% 95%",
        "--heroui-foreground-100": "240 3.7% 90%",
        "--heroui-foreground-200": "240 5.26% 80%",
        "--heroui-foreground-300": "240 5.2% 70%",
        "--heroui-foreground-400": "240 3.83% 60%",
        "--heroui-foreground-500": "240 5.03% 50%",
        "--heroui-foreground-600": "240 4.88% 40%",
        "--heroui-foreground-700": "240 5.88% 30%",
        "--heroui-foreground-800": "240 4.76% 20%",
        "--heroui-foreground-900": "0 0% 10%",
        "--heroui-foreground": "210 5.56% 7.06%",
        "--heroui-focus": "212.01999999999998 100% 53.33%",
        "--heroui-overlay": "0 0% 100%",
        "--heroui-divider": "0 0% 0%",
        "--heroui-divider-opacity": "0.85",
        "--heroui-content1": "240 5.88% 95%",
        "--heroui-content1-foreground": "0 0% 10%",
        "--heroui-content2": "240 3.7% 90%",
        "--heroui-content2-foreground": "240 4.76% 20%",
        "--heroui-content3": "240 5.26% 80%",
        "--heroui-content3-foreground": "240 5.88% 30%",
        "--heroui-content4": "240 5.2% 70%",
        "--heroui-content4-foreground": "240 4.88% 40%",
        "--heroui-default-50": "240 5.88% 95%",
        "--heroui-default-100": "240 3.7% 90%",
        "--heroui-default-200": "240 5.26% 80%",
        "--heroui-default-300": "240 5.2% 70%",
        "--heroui-default-400": "240 3.83% 60%",
        "--heroui-default-500": "240 5.03% 50%",
        "--heroui-default-600": "240 4.88% 40%",
        "--heroui-default-700": "240 5.88% 30%",
        "--heroui-default-800": "240 4.76% 20%",
        "--heroui-default-900": "0 0% 10%",
        "--heroui-default-foreground": "0 0% 0%",
        "--heroui-default": "240 5.26% 80%",
        "--heroui-danger-50": "324 90.91% 95.69%",
        "--heroui-danger-100": "350.53 90.48% 91.76%",
        "--heroui-danger-200": "343.42 90.48% 83.53%",
        "--heroui-danger-300": "337.84 83.46% 73.92%",
        "--heroui-danger-400": "331.82 75% 65.49%",
        "--heroui-danger-500": "325.82 69.62% 53.53%",
        "--heroui-danger-600": "319.73 65.64% 44.51%",
        "--heroui-danger-700": "313.85 70.65% 36.08%",
        "--heroui-danger-800": "308.18 76.39% 28.24%",
        "--heroui-danger-900": "301.89 82.61% 22.55%",
        "--heroui-danger-foreground": "0 0% 100%",
        "--heroui-danger": "325.82 69.62% 53.53%",
        "--heroui-primary-50": "339.13 92% 95.1%",
        "--heroui-primary-100": "340 91.84% 90.39%",
        "--heroui-primary-200": "339.33 90% 80.39%",
        "--heroui-primary-300": "339.11 90.6% 70.78%",
        "--heroui-primary-400": "339 90% 60.78%",
        "--heroui-primary-500": "339.2 90.36% 51.18%",
        "--heroui-primary-600": "339 86.54% 40.78%",
        "--heroui-primary-700": "339.11 85.99% 30.78%",
        "--heroui-primary-800": "339.33 86.54% 20.39%",
        "--heroui-primary-900": "340 84.91% 10.39%",
        "--heroui-primary-foreground": "0 0% 100%",
        "--heroui-primary": "339.2 90.36% 51.18%",
        "--heroui-secondary-50": "270 61.54% 94.9%",
        "--heroui-secondary-100": "270 59.26% 89.41%",
        "--heroui-secondary-200": "270 59.26% 78.82%",
        "--heroui-secondary-300": "270 59.26% 68.24%",
        "--heroui-secondary-400": "270 59.26% 57.65%",
        "--heroui-secondary-500": "270 66.67% 47.06%",
        "--heroui-secondary-600": "270 66.67% 37.65%",
        "--heroui-secondary-700": "270 66.67% 28.24%",
        "--heroui-secondary-800": "270 66.67% 18.82%",
        "--heroui-secondary-900": "270 66.67% 9.41%",
        "--heroui-secondary-foreground": "0 0% 100%",
        "--heroui-secondary": "270 66.67% 47.06%",
        "--heroui-success-50": "146.67 64.29% 94.51%",
        "--heroui-success-100": "145.71 61.4% 88.82%",
        "--heroui-success-200": "146.2 61.74% 77.45%",
        "--heroui-success-300": "145.79 62.57% 66.47%",
        "--heroui-success-400": "146.01 62.45% 55.1%",
        "--heroui-success-500": "145.96 79.46% 43.92%",
        "--heroui-success-600": "146.01 79.89% 35.1%",
        "--heroui-success-700": "145.79 79.26% 26.47%",
        "--heroui-success-800": "146.2 79.78% 17.45%",
        "--heroui-success-900": "145.71 77.78% 8.82%",
        "--heroui-success-foreground": "0 0% 0%",
        "--heroui-success": "145.96 79.46% 43.92%",
        "--heroui-warning-50": "54.55 91.67% 95.29%",
        "--heroui-warning-100": "37.14 91.3% 90.98%",
        "--heroui-warning-200": "37.14 91.3% 81.96%",
        "--heroui-warning-300": "36.96 91.24% 73.14%",
        "--heroui-warning-400": "37.01 91.26% 64.12%",
        "--heroui-warning-500": "37.03 91.27% 55.1%",
        "--heroui-warning-600": "37.01 74.22% 44.12%",
        "--heroui-warning-700": "36.96 73.96% 33.14%",
        "--heroui-warning-800": "37.14 75% 21.96%",
        "--heroui-warning-900": "37.14 75% 10.98%",
        "--heroui-warning-foreground": "0 0% 0%",
        "--heroui-warning": "37.03 91.27% 55.1%",
        "--heroui-code-background": "221.25 17.39% 18.04%",
        "--heroui-strong": "316.95 100% 65.29%",
        "--heroui-code-mdx": "316.95 100% 65.29%",
        "--heroui-divider-weight": "1px",
        "--heroui-disabled-opacity": ".5",
        "--heroui-font-size-tiny": "0.75rem",
        "--heroui-font-size-small": "0.875rem",
        "--heroui-font-size-medium": "1rem",
        "--heroui-font-size-large": "1.125rem",
        "--heroui-line-height-tiny": "1rem",
        "--heroui-line-height-small": "1.25rem",
        "--heroui-line-height-medium": "1.5rem",
        "--heroui-line-height-large": "1.75rem",
        "--heroui-radius-small": "8px",
        "--heroui-radius-medium": "12px",
        "--heroui-radius-large": "14px",
        "--heroui-border-width-small": "1px",
        "--heroui-border-width-medium": "2px",
        "--heroui-border-width-large": "3px",
        "--heroui-box-shadow-small": "0px 0px 5px 0px rgba(0, 0, 0, .02), 0px 2px 10px 0px rgba(0, 0, 0, .06), 0px 0px 1px 0px rgba(0, 0, 0, .3)",
        "--heroui-box-shadow-medium": "0px 0px 15px 0px rgba(0, 0, 0, .03), 0px 2px 30px 0px rgba(0, 0, 0, .08), 0px 0px 1px 0px rgba(0, 0, 0, .3)",
        "--heroui-box-shadow-large": "0px 0px 30px 0px rgba(0, 0, 0, .04), 0px 30px 60px 0px rgba(0, 0, 0, .12), 0px 0px 1px 0px rgba(0, 0, 0, .3)",
        "--heroui-hover-opacity": ".8"
      }
    }
  }
), Gae = (t) => yO(t) === 6 ? `[${t}]` : t, MN = (t, e, n = "/", r, i = "http") => {
  const o = new URL(`${i}://${Gae(t)}`);
  if (o.port = e, o.pathname = n, r)
    for (const s in r)
      o.searchParams.set(s, r[s]);
  return decodeURIComponent(o.toString());
}, LR = (t = 8) => IL(36).toString("hex").slice(0, t), RN = p.Object({
  host: p.String({ default: "::" }),
  port: p.Number({ default: 6099 }),
  token: p.String({ default: LR(12) }),
  loginRate: p.Number({ default: 10 }),
  autoLoginAccount: p.String({ default: "" }),
  theme: $ae,
  // 是否关闭WebUI
  disableWebUI: p.Boolean({ default: !1 }),
  // 网络访问控制模式: 'none' | 'whitelist' | 'blacklist'
  accessControlMode: p.Union([
    p.Literal("none"),
    p.Literal("whitelist"),
    p.Literal("blacklist")
  ], { default: "none" }),
  // IP白名单列表
  ipWhitelist: p.Array(p.String(), { default: [] }),
  // IP黑名单列表
  ipBlacklist: p.Array(p.String(), { default: [] }),
  // 是否启用 X-Forwarded-For 获取真实IP
  enableXForwardedFor: p.Boolean({ default: !1 }),
  // 是否启用双因素认证（2FA）
  enable2FA: p.Boolean({ default: !1 }),
  // TOTP 密钥
  totpSecret: p.String({ default: "" })
});
class qae {
  WebUiConfigData = void 0;
  validateAndApplyDefaults(e) {
    let n = e;
    return n = Za(RN, n), wu.Compile(RN).Check(n), n;
  }
  async ensureConfigFileExists(e) {
    await Un.access(e, Ia.F_OK).then(() => !0).catch(() => !1) || await Un.writeFile(e, JSON.stringify(this.validateAndApplyDefaults({}), null, 4));
  }
  async readAndValidateConfig(e) {
    const n = await Un.readFile(e, "utf-8");
    return this.validateAndApplyDefaults(JSON.parse(n));
  }
  async writeConfig(e, n) {
    await Un.access(e, Ia.W_OK).then(() => !0).catch(() => !1) ? await Un.writeFile(e, JSON.stringify(n, null, 4)) : console.warn(`文件: ${e} 没有写入权限, 配置的更改部分可能会在重启后还原.`);
  }
  async GetWebUIConfig() {
    if (this.WebUiConfigData)
      return this.WebUiConfigData;
    try {
      const e = kn(at.configPath, "./webui.json");
      await this.ensureConfigFileExists(e);
      const n = await this.readAndValidateConfig(e);
      return this.WebUiConfigData = {
        ...n,
        // 首次读取内存中是没有token的，需要进行一层兜底
        token: ls() || n.token
      }, this.WebUiConfigData;
    } catch (e) {
      console.log("读取配置文件失败", e);
      const n = this.validateAndApplyDefaults({});
      return this.WebUiConfigData = {
        ...n,
        token: ls() || n.token
      }, this.WebUiConfigData;
    }
  }
  async UpdateWebUIConfig(e) {
    const n = kn(at.configPath, "./webui.json"), r = await this.GetRawWebUIConfig(), i = UR({ ...r }, e), o = this.validateAndApplyDefaults(i);
    await this.writeConfig(n, o), this.WebUiConfigData = o;
  }
  /**
     * 获取配置文件中实际存储的配置（不被内存token覆盖）
     * 主要用于配置更新和特殊场景
     */
  async GetRawWebUIConfig() {
    if (this.WebUiConfigData)
      return this.WebUiConfigData;
    try {
      const e = kn(at.configPath, "./webui.json");
      await this.ensureConfigFileExists(e);
      const n = await this.readAndValidateConfig(e);
      return this.WebUiConfigData = n, this.WebUiConfigData;
    } catch (e) {
      return console.log("读取配置文件失败", e), this.validateAndApplyDefaults({});
    }
  }
  async UpdateToken(e, n) {
    if ((ls() || (await this.GetWebUIConfig()).token) !== e)
      throw new Error("旧 token 不匹配");
    await this.UpdateWebUIConfig({ token: n });
  }
  // 获取日志文件夹路径
  async GetLogsPath() {
    return kn(at.logsPath);
  }
  // 获取日志列表
  async GetLogsList() {
    const e = kn(at.logsPath);
    return await Un.access(e, Ia.F_OK).then(() => !0).catch(() => !1) ? (await Un.readdir(e)).filter((r) => r.endsWith(".log")).map((r) => r.replace(".log", "")) : [];
  }
  // 获取指定日志文件内容
  async GetLogContent(e) {
    const n = kn(at.logsPath, `${e}.log`);
    return await Un.access(n, Ia.R_OK).then(() => !0).catch(() => !1) ? await Un.readFile(n, "utf-8") : "";
  }
  // 获取字体文件夹内的字体列表
  async GetFontList() {
    const e = kn(at.configPath, "./fonts");
    return await Un.access(e, Ia.F_OK).then(() => !0).catch(() => !1) ? (await Un.readdir(e)).filter((r) => r.endsWith(".ttf")) : [];
  }
  // 判断字体是否存在（支持多种格式）
  async CheckWebUIFontExist() {
    const e = await this.GetWebUIFontPath();
    return e ? await Un.access(e, Ia.F_OK).then(() => !0).catch(() => !1) : !1;
  }
  // 获取webui字体文件路径（支持多种格式）
  async GetWebUIFontPath() {
    const e = kn(at.configPath, "./fonts"), n = [".woff", ".woff2", ".ttf", ".otf"];
    for (const r of n) {
      const i = kn(e, `webui${r}`);
      if (await Un.access(i, Ia.F_OK).then(() => !0).catch(() => !1))
        return i;
    }
    return null;
  }
  // 同步版本，用于 multer 配置
  GetWebUIFontPathSync() {
    return kn(at.configPath, "./fonts/webui.woff");
  }
  getAutoLoginAccount() {
    return this.WebUiConfigData?.autoLoginAccount;
  }
  // 获取自动登录账号
  async GetAutoLoginAccount() {
    return (await this.GetWebUIConfig()).autoLoginAccount;
  }
  // 更新自动登录账号
  async UpdateAutoLoginAccount(e) {
    await this.UpdateWebUIConfig({ autoLoginAccount: e });
  }
  // 获取主题内容
  async GetTheme() {
    return (await this.GetWebUIConfig()).theme;
  }
  // 更新主题内容
  async UpdateTheme(e) {
    await this.UpdateWebUIConfig({ theme: e });
  }
  // 获取是否禁用WebUI
  async GetDisableWebUI() {
    return (await this.GetWebUIConfig()).disableWebUI;
  }
  // 更新是否禁用WebUI
  async UpdateDisableWebUI(e) {
    await this.UpdateWebUIConfig({ disableWebUI: e });
  }
  // 获取访问控制模式
  async GetAccessControlMode() {
    return (await this.GetWebUIConfig()).accessControlMode;
  }
  // 更新访问控制模式
  async UpdateAccessControlMode(e) {
    await this.UpdateWebUIConfig({ accessControlMode: e });
  }
  // 获取IP白名单
  async GetIpWhitelist() {
    return (await this.GetWebUIConfig()).ipWhitelist;
  }
  // 更新IP白名单
  async UpdateIpWhitelist(e) {
    await this.UpdateWebUIConfig({ ipWhitelist: e });
  }
  // 获取IP黑名单
  async GetIpBlacklist() {
    return (await this.GetWebUIConfig()).ipBlacklist;
  }
  // 更新IP黑名单
  async UpdateIpBlacklist(e) {
    await this.UpdateWebUIConfig({ ipBlacklist: e });
  }
  // 获取是否启用 X-Forwarded-For
  async GetEnableXForwardedFor() {
    return (await this.GetWebUIConfig()).enableXForwardedFor || !1;
  }
  // 更新是否启用 X-Forwarded-For
  async UpdateEnableXForwardedFor(e) {
    await this.UpdateWebUIConfig({ enableXForwardedFor: e });
  }
}
var Bc = { exports: {} }, Da = { exports: {} }, Ah = {};
/*!
 * media-typer
 * Copyright(c) 2014 Douglas Christopher Wilson
 * MIT Licensed
 */
var BN;
function Hae() {
  if (BN) return Ah;
  BN = 1;
  var t = /; *([!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) *= *("(?:[ !\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u0020-\u007e])*"|[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) */g, e = /^[\u0020-\u007e\u0080-\u00ff]+$/, n = /^[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+$/, r = /\\([\u0000-\u007f])/g, i = /([\\"])/g, o = /^[A-Za-z0-9][A-Za-z0-9!#$&^_.-]{0,126}$/, s = /^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}$/, a = /^ *([A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126})\/([A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}) *$/;
  Ah.format = c, Ah.parse = u;
  function c(m) {
    if (!m || typeof m != "object")
      throw new TypeError("argument obj is required");
    var h = m.parameters, y = m.subtype, x = m.suffix, g = m.type;
    if (!g || !s.test(g))
      throw new TypeError("invalid type");
    if (!y || !o.test(y))
      throw new TypeError("invalid subtype");
    var v = g + "/" + y;
    if (x) {
      if (!s.test(x))
        throw new TypeError("invalid suffix");
      v += "+" + x;
    }
    if (h && typeof h == "object")
      for (var S, E = Object.keys(h).sort(), T = 0; T < E.length; T++) {
        if (S = E[T], !n.test(S))
          throw new TypeError("invalid parameter name");
        v += "; " + S + "=" + d(h[S]);
      }
    return v;
  }
  function u(m) {
    if (!m)
      throw new TypeError("argument string is required");
    if (typeof m == "object" && (m = l(m)), typeof m != "string")
      throw new TypeError("argument string is required to be a string");
    var h = m.indexOf(";"), y = h !== -1 ? m.substr(0, h) : m, x, g, v = f(y), S = {}, E;
    for (t.lastIndex = h; g = t.exec(m); ) {
      if (g.index !== h)
        throw new TypeError("invalid parameter format");
      h += g[0].length, x = g[1].toLowerCase(), E = g[2], E[0] === '"' && (E = E.substr(1, E.length - 2).replace(r, "$1")), S[x] = E;
    }
    if (h !== -1 && h !== m.length)
      throw new TypeError("invalid parameter format");
    return v.parameters = S, v;
  }
  function l(m) {
    if (typeof m.getHeader == "function")
      return m.getHeader("content-type");
    if (typeof m.headers == "object")
      return m.headers && m.headers["content-type"];
  }
  function d(m) {
    var h = String(m);
    if (n.test(h))
      return h;
    if (h.length > 0 && !e.test(h))
      throw new TypeError("invalid parameter value");
    return '"' + h.replace(i, "\\$1") + '"';
  }
  function f(m) {
    var h = a.exec(m.toLowerCase());
    if (!h)
      throw new TypeError("invalid media type");
    var y = h[1], x = h[2], g, v = x.lastIndexOf("+");
    v !== -1 && (g = x.substr(v + 1), x = x.substr(0, v));
    var S = {
      type: y,
      subtype: x,
      suffix: g
    };
    return S;
  }
  return Ah;
}
var gx = {};
const Wae = {
  "application/1d-interleaved-parityfec": { source: "iana" },
  "application/3gpdash-qoe-report+xml": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/3gpp-ims+xml": { source: "iana", compressible: !0 },
  "application/3gpphal+json": { source: "iana", compressible: !0 },
  "application/3gpphalforms+json": { source: "iana", compressible: !0 },
  "application/a2l": { source: "iana" },
  "application/ace+cbor": { source: "iana" },
  "application/activemessage": { source: "iana" },
  "application/activity+json": { source: "iana", compressible: !0 },
  "application/alto-costmap+json": { source: "iana", compressible: !0 },
  "application/alto-costmapfilter+json": { source: "iana", compressible: !0 },
  "application/alto-directory+json": { source: "iana", compressible: !0 },
  "application/alto-endpointcost+json": { source: "iana", compressible: !0 },
  "application/alto-endpointcostparams+json": { source: "iana", compressible: !0 },
  "application/alto-endpointprop+json": { source: "iana", compressible: !0 },
  "application/alto-endpointpropparams+json": { source: "iana", compressible: !0 },
  "application/alto-error+json": { source: "iana", compressible: !0 },
  "application/alto-networkmap+json": { source: "iana", compressible: !0 },
  "application/alto-networkmapfilter+json": { source: "iana", compressible: !0 },
  "application/alto-updatestreamcontrol+json": { source: "iana", compressible: !0 },
  "application/alto-updatestreamparams+json": { source: "iana", compressible: !0 },
  "application/aml": { source: "iana" },
  "application/andrew-inset": { source: "iana", extensions: ["ez"] },
  "application/applefile": { source: "iana" },
  "application/applixware": { source: "apache", extensions: ["aw"] },
  "application/at+jwt": { source: "iana" },
  "application/atf": { source: "iana" },
  "application/atfx": { source: "iana" },
  "application/atom+xml": { source: "iana", compressible: !0, extensions: ["atom"] },
  "application/atomcat+xml": { source: "iana", compressible: !0, extensions: ["atomcat"] },
  "application/atomdeleted+xml": { source: "iana", compressible: !0, extensions: ["atomdeleted"] },
  "application/atomicmail": { source: "iana" },
  "application/atomsvc+xml": { source: "iana", compressible: !0, extensions: ["atomsvc"] },
  "application/atsc-dwd+xml": { source: "iana", compressible: !0, extensions: ["dwd"] },
  "application/atsc-dynamic-event-message": { source: "iana" },
  "application/atsc-held+xml": { source: "iana", compressible: !0, extensions: ["held"] },
  "application/atsc-rdt+json": { source: "iana", compressible: !0 },
  "application/atsc-rsat+xml": { source: "iana", compressible: !0, extensions: ["rsat"] },
  "application/atxml": { source: "iana" },
  "application/auth-policy+xml": { source: "iana", compressible: !0 },
  "application/bacnet-xdd+zip": { source: "iana", compressible: !1 },
  "application/batch-smtp": { source: "iana" },
  "application/bdoc": { compressible: !1, extensions: ["bdoc"] },
  "application/beep+xml": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/calendar+json": { source: "iana", compressible: !0 },
  "application/calendar+xml": { source: "iana", compressible: !0, extensions: ["xcs"] },
  "application/call-completion": { source: "iana" },
  "application/cals-1840": { source: "iana" },
  "application/captive+json": { source: "iana", compressible: !0 },
  "application/cbor": { source: "iana" },
  "application/cbor-seq": { source: "iana" },
  "application/cccex": { source: "iana" },
  "application/ccmp+xml": { source: "iana", compressible: !0 },
  "application/ccxml+xml": { source: "iana", compressible: !0, extensions: ["ccxml"] },
  "application/cdfx+xml": { source: "iana", compressible: !0, extensions: ["cdfx"] },
  "application/cdmi-capability": { source: "iana", extensions: ["cdmia"] },
  "application/cdmi-container": { source: "iana", extensions: ["cdmic"] },
  "application/cdmi-domain": { source: "iana", extensions: ["cdmid"] },
  "application/cdmi-object": { source: "iana", extensions: ["cdmio"] },
  "application/cdmi-queue": { source: "iana", extensions: ["cdmiq"] },
  "application/cdni": { source: "iana" },
  "application/cea": { source: "iana" },
  "application/cea-2018+xml": { source: "iana", compressible: !0 },
  "application/cellml+xml": { source: "iana", compressible: !0 },
  "application/cfw": { source: "iana" },
  "application/city+json": { source: "iana", compressible: !0 },
  "application/clr": { source: "iana" },
  "application/clue+xml": { source: "iana", compressible: !0 },
  "application/clue_info+xml": { source: "iana", compressible: !0 },
  "application/cms": { source: "iana" },
  "application/cnrp+xml": { source: "iana", compressible: !0 },
  "application/coap-group+json": { source: "iana", compressible: !0 },
  "application/coap-payload": { source: "iana" },
  "application/commonground": { source: "iana" },
  "application/conference-info+xml": { source: "iana", compressible: !0 },
  "application/cose": { source: "iana" },
  "application/cose-key": { source: "iana" },
  "application/cose-key-set": { source: "iana" },
  "application/cpl+xml": { source: "iana", compressible: !0, extensions: ["cpl"] },
  "application/csrattrs": { source: "iana" },
  "application/csta+xml": { source: "iana", compressible: !0 },
  "application/cstadata+xml": { source: "iana", compressible: !0 },
  "application/csvm+json": { source: "iana", compressible: !0 },
  "application/cu-seeme": { source: "apache", extensions: ["cu"] },
  "application/cwt": { source: "iana" },
  "application/cybercash": { source: "iana" },
  "application/dart": { compressible: !0 },
  "application/dash+xml": { source: "iana", compressible: !0, extensions: ["mpd"] },
  "application/dash-patch+xml": { source: "iana", compressible: !0, extensions: ["mpp"] },
  "application/dashdelta": { source: "iana" },
  "application/davmount+xml": { source: "iana", compressible: !0, extensions: ["davmount"] },
  "application/dca-rft": { source: "iana" },
  "application/dcd": { source: "iana" },
  "application/dec-dx": { source: "iana" },
  "application/dialog-info+xml": { source: "iana", compressible: !0 },
  "application/dicom": { source: "iana" },
  "application/dicom+json": { source: "iana", compressible: !0 },
  "application/dicom+xml": { source: "iana", compressible: !0 },
  "application/dii": { source: "iana" },
  "application/dit": { source: "iana" },
  "application/dns": { source: "iana" },
  "application/dns+json": { source: "iana", compressible: !0 },
  "application/dns-message": { source: "iana" },
  "application/docbook+xml": { source: "apache", compressible: !0, extensions: ["dbk"] },
  "application/dots+cbor": { source: "iana" },
  "application/dskpp+xml": { source: "iana", compressible: !0 },
  "application/dssc+der": { source: "iana", extensions: ["dssc"] },
  "application/dssc+xml": { source: "iana", compressible: !0, extensions: ["xdssc"] },
  "application/dvcs": { source: "iana" },
  "application/ecmascript": { source: "iana", compressible: !0, extensions: ["es", "ecma"] },
  "application/edi-consent": { source: "iana" },
  "application/edi-x12": { source: "iana", compressible: !1 },
  "application/edifact": { source: "iana", compressible: !1 },
  "application/efi": { source: "iana" },
  "application/elm+json": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/elm+xml": { source: "iana", compressible: !0 },
  "application/emergencycalldata.cap+xml": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/emergencycalldata.comment+xml": { source: "iana", compressible: !0 },
  "application/emergencycalldata.control+xml": { source: "iana", compressible: !0 },
  "application/emergencycalldata.deviceinfo+xml": { source: "iana", compressible: !0 },
  "application/emergencycalldata.ecall.msd": { source: "iana" },
  "application/emergencycalldata.providerinfo+xml": { source: "iana", compressible: !0 },
  "application/emergencycalldata.serviceinfo+xml": { source: "iana", compressible: !0 },
  "application/emergencycalldata.subscriberinfo+xml": { source: "iana", compressible: !0 },
  "application/emergencycalldata.veds+xml": { source: "iana", compressible: !0 },
  "application/emma+xml": { source: "iana", compressible: !0, extensions: ["emma"] },
  "application/emotionml+xml": { source: "iana", compressible: !0, extensions: ["emotionml"] },
  "application/encaprtp": { source: "iana" },
  "application/epp+xml": { source: "iana", compressible: !0 },
  "application/epub+zip": { source: "iana", compressible: !1, extensions: ["epub"] },
  "application/eshop": { source: "iana" },
  "application/exi": { source: "iana", extensions: ["exi"] },
  "application/expect-ct-report+json": { source: "iana", compressible: !0 },
  "application/express": { source: "iana", extensions: ["exp"] },
  "application/fastinfoset": { source: "iana" },
  "application/fastsoap": { source: "iana" },
  "application/fdt+xml": { source: "iana", compressible: !0, extensions: ["fdt"] },
  "application/fhir+json": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/fhir+xml": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/fido.trusted-apps+json": { compressible: !0 },
  "application/fits": { source: "iana" },
  "application/flexfec": { source: "iana" },
  "application/font-sfnt": { source: "iana" },
  "application/font-tdpfr": { source: "iana", extensions: ["pfr"] },
  "application/font-woff": { source: "iana", compressible: !1 },
  "application/framework-attributes+xml": { source: "iana", compressible: !0 },
  "application/geo+json": { source: "iana", compressible: !0, extensions: ["geojson"] },
  "application/geo+json-seq": { source: "iana" },
  "application/geopackage+sqlite3": { source: "iana" },
  "application/geoxacml+xml": { source: "iana", compressible: !0 },
  "application/gltf-buffer": { source: "iana" },
  "application/gml+xml": { source: "iana", compressible: !0, extensions: ["gml"] },
  "application/gpx+xml": { source: "apache", compressible: !0, extensions: ["gpx"] },
  "application/gxf": { source: "apache", extensions: ["gxf"] },
  "application/gzip": { source: "iana", compressible: !1, extensions: ["gz"] },
  "application/h224": { source: "iana" },
  "application/held+xml": { source: "iana", compressible: !0 },
  "application/hjson": { extensions: ["hjson"] },
  "application/http": { source: "iana" },
  "application/hyperstudio": { source: "iana", extensions: ["stk"] },
  "application/ibe-key-request+xml": { source: "iana", compressible: !0 },
  "application/ibe-pkg-reply+xml": { source: "iana", compressible: !0 },
  "application/ibe-pp-data": { source: "iana" },
  "application/iges": { source: "iana" },
  "application/im-iscomposing+xml": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/index": { source: "iana" },
  "application/index.cmd": { source: "iana" },
  "application/index.obj": { source: "iana" },
  "application/index.response": { source: "iana" },
  "application/index.vnd": { source: "iana" },
  "application/inkml+xml": { source: "iana", compressible: !0, extensions: ["ink", "inkml"] },
  "application/iotp": { source: "iana" },
  "application/ipfix": { source: "iana", extensions: ["ipfix"] },
  "application/ipp": { source: "iana" },
  "application/isup": { source: "iana" },
  "application/its+xml": { source: "iana", compressible: !0, extensions: ["its"] },
  "application/java-archive": { source: "apache", compressible: !1, extensions: ["jar", "war", "ear"] },
  "application/java-serialized-object": { source: "apache", compressible: !1, extensions: ["ser"] },
  "application/java-vm": { source: "apache", compressible: !1, extensions: ["class"] },
  "application/javascript": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["js", "mjs"] },
  "application/jf2feed+json": { source: "iana", compressible: !0 },
  "application/jose": { source: "iana" },
  "application/jose+json": { source: "iana", compressible: !0 },
  "application/jrd+json": { source: "iana", compressible: !0 },
  "application/jscalendar+json": { source: "iana", compressible: !0 },
  "application/json": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["json", "map"] },
  "application/json-patch+json": { source: "iana", compressible: !0 },
  "application/json-seq": { source: "iana" },
  "application/json5": { extensions: ["json5"] },
  "application/jsonml+json": { source: "apache", compressible: !0, extensions: ["jsonml"] },
  "application/jwk+json": { source: "iana", compressible: !0 },
  "application/jwk-set+json": { source: "iana", compressible: !0 },
  "application/jwt": { source: "iana" },
  "application/kpml-request+xml": { source: "iana", compressible: !0 },
  "application/kpml-response+xml": { source: "iana", compressible: !0 },
  "application/ld+json": { source: "iana", compressible: !0, extensions: ["jsonld"] },
  "application/lgr+xml": { source: "iana", compressible: !0, extensions: ["lgr"] },
  "application/link-format": { source: "iana" },
  "application/load-control+xml": { source: "iana", compressible: !0 },
  "application/lost+xml": { source: "iana", compressible: !0, extensions: ["lostxml"] },
  "application/lostsync+xml": { source: "iana", compressible: !0 },
  "application/lpf+zip": { source: "iana", compressible: !1 },
  "application/lxf": { source: "iana" },
  "application/mac-binhex40": { source: "iana", extensions: ["hqx"] },
  "application/mac-compactpro": { source: "apache", extensions: ["cpt"] },
  "application/macwriteii": { source: "iana" },
  "application/mads+xml": { source: "iana", compressible: !0, extensions: ["mads"] },
  "application/manifest+json": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["webmanifest"] },
  "application/marc": { source: "iana", extensions: ["mrc"] },
  "application/marcxml+xml": { source: "iana", compressible: !0, extensions: ["mrcx"] },
  "application/mathematica": { source: "iana", extensions: ["ma", "nb", "mb"] },
  "application/mathml+xml": { source: "iana", compressible: !0, extensions: ["mathml"] },
  "application/mathml-content+xml": { source: "iana", compressible: !0 },
  "application/mathml-presentation+xml": { source: "iana", compressible: !0 },
  "application/mbms-associated-procedure-description+xml": { source: "iana", compressible: !0 },
  "application/mbms-deregister+xml": { source: "iana", compressible: !0 },
  "application/mbms-envelope+xml": { source: "iana", compressible: !0 },
  "application/mbms-msk+xml": { source: "iana", compressible: !0 },
  "application/mbms-msk-response+xml": { source: "iana", compressible: !0 },
  "application/mbms-protection-description+xml": { source: "iana", compressible: !0 },
  "application/mbms-reception-report+xml": { source: "iana", compressible: !0 },
  "application/mbms-register+xml": { source: "iana", compressible: !0 },
  "application/mbms-register-response+xml": { source: "iana", compressible: !0 },
  "application/mbms-schedule+xml": { source: "iana", compressible: !0 },
  "application/mbms-user-service-description+xml": { source: "iana", compressible: !0 },
  "application/mbox": { source: "iana", extensions: ["mbox"] },
  "application/media-policy-dataset+xml": { source: "iana", compressible: !0, extensions: ["mpf"] },
  "application/media_control+xml": { source: "iana", compressible: !0 },
  "application/mediaservercontrol+xml": { source: "iana", compressible: !0, extensions: ["mscml"] },
  "application/merge-patch+json": { source: "iana", compressible: !0 },
  "application/metalink+xml": { source: "apache", compressible: !0, extensions: ["metalink"] },
  "application/metalink4+xml": { source: "iana", compressible: !0, extensions: ["meta4"] },
  "application/mets+xml": { source: "iana", compressible: !0, extensions: ["mets"] },
  "application/mf4": { source: "iana" },
  "application/mikey": { source: "iana" },
  "application/mipc": { source: "iana" },
  "application/missing-blocks+cbor-seq": { source: "iana" },
  "application/mmt-aei+xml": { source: "iana", compressible: !0, extensions: ["maei"] },
  "application/mmt-usd+xml": { source: "iana", compressible: !0, extensions: ["musd"] },
  "application/mods+xml": { source: "iana", compressible: !0, extensions: ["mods"] },
  "application/moss-keys": { source: "iana" },
  "application/moss-signature": { source: "iana" },
  "application/mosskey-data": { source: "iana" },
  "application/mosskey-request": { source: "iana" },
  "application/mp21": { source: "iana", extensions: ["m21", "mp21"] },
  "application/mp4": { source: "iana", extensions: ["mp4s", "m4p"] },
  "application/mpeg4-generic": { source: "iana" },
  "application/mpeg4-iod": { source: "iana" },
  "application/mpeg4-iod-xmt": { source: "iana" },
  "application/mrb-consumer+xml": { source: "iana", compressible: !0 },
  "application/mrb-publish+xml": { source: "iana", compressible: !0 },
  "application/msc-ivr+xml": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/msc-mixer+xml": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/msword": { source: "iana", compressible: !1, extensions: ["doc", "dot"] },
  "application/mud+json": { source: "iana", compressible: !0 },
  "application/multipart-core": { source: "iana" },
  "application/mxf": { source: "iana", extensions: ["mxf"] },
  "application/n-quads": { source: "iana", extensions: ["nq"] },
  "application/n-triples": { source: "iana", extensions: ["nt"] },
  "application/nasdata": { source: "iana" },
  "application/news-checkgroups": { source: "iana", charset: "US-ASCII" },
  "application/news-groupinfo": { source: "iana", charset: "US-ASCII" },
  "application/news-transmission": { source: "iana" },
  "application/nlsml+xml": { source: "iana", compressible: !0 },
  "application/node": { source: "iana", extensions: ["cjs"] },
  "application/nss": { source: "iana" },
  "application/oauth-authz-req+jwt": { source: "iana" },
  "application/oblivious-dns-message": { source: "iana" },
  "application/ocsp-request": { source: "iana" },
  "application/ocsp-response": { source: "iana" },
  "application/octet-stream": { source: "iana", compressible: !1, extensions: ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"] },
  "application/oda": { source: "iana", extensions: ["oda"] },
  "application/odm+xml": { source: "iana", compressible: !0 },
  "application/odx": { source: "iana" },
  "application/oebps-package+xml": { source: "iana", compressible: !0, extensions: ["opf"] },
  "application/ogg": { source: "iana", compressible: !1, extensions: ["ogx"] },
  "application/omdoc+xml": { source: "apache", compressible: !0, extensions: ["omdoc"] },
  "application/onenote": { source: "apache", extensions: ["onetoc", "onetoc2", "onetmp", "onepkg"] },
  "application/opc-nodeset+xml": { source: "iana", compressible: !0 },
  "application/oscore": { source: "iana" },
  "application/oxps": { source: "iana", extensions: ["oxps"] },
  "application/p21": { source: "iana" },
  "application/p21+zip": { source: "iana", compressible: !1 },
  "application/p2p-overlay+xml": { source: "iana", compressible: !0, extensions: ["relo"] },
  "application/parityfec": { source: "iana" },
  "application/passport": { source: "iana" },
  "application/patch-ops-error+xml": { source: "iana", compressible: !0, extensions: ["xer"] },
  "application/pdf": { source: "iana", compressible: !1, extensions: ["pdf"] },
  "application/pdx": { source: "iana" },
  "application/pem-certificate-chain": { source: "iana" },
  "application/pgp-encrypted": { source: "iana", compressible: !1, extensions: ["pgp"] },
  "application/pgp-keys": { source: "iana", extensions: ["asc"] },
  "application/pgp-signature": { source: "iana", extensions: ["asc", "sig"] },
  "application/pics-rules": { source: "apache", extensions: ["prf"] },
  "application/pidf+xml": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/pidf-diff+xml": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/pkcs10": { source: "iana", extensions: ["p10"] },
  "application/pkcs12": { source: "iana" },
  "application/pkcs7-mime": { source: "iana", extensions: ["p7m", "p7c"] },
  "application/pkcs7-signature": { source: "iana", extensions: ["p7s"] },
  "application/pkcs8": { source: "iana", extensions: ["p8"] },
  "application/pkcs8-encrypted": { source: "iana" },
  "application/pkix-attr-cert": { source: "iana", extensions: ["ac"] },
  "application/pkix-cert": { source: "iana", extensions: ["cer"] },
  "application/pkix-crl": { source: "iana", extensions: ["crl"] },
  "application/pkix-pkipath": { source: "iana", extensions: ["pkipath"] },
  "application/pkixcmp": { source: "iana", extensions: ["pki"] },
  "application/pls+xml": { source: "iana", compressible: !0, extensions: ["pls"] },
  "application/poc-settings+xml": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/postscript": { source: "iana", compressible: !0, extensions: ["ai", "eps", "ps"] },
  "application/ppsp-tracker+json": { source: "iana", compressible: !0 },
  "application/problem+json": { source: "iana", compressible: !0 },
  "application/problem+xml": { source: "iana", compressible: !0 },
  "application/provenance+xml": { source: "iana", compressible: !0, extensions: ["provx"] },
  "application/prs.alvestrand.titrax-sheet": { source: "iana" },
  "application/prs.cww": { source: "iana", extensions: ["cww"] },
  "application/prs.cyn": { source: "iana", charset: "7-BIT" },
  "application/prs.hpub+zip": { source: "iana", compressible: !1 },
  "application/prs.nprend": { source: "iana" },
  "application/prs.plucker": { source: "iana" },
  "application/prs.rdf-xml-crypt": { source: "iana" },
  "application/prs.xsf+xml": { source: "iana", compressible: !0 },
  "application/pskc+xml": { source: "iana", compressible: !0, extensions: ["pskcxml"] },
  "application/pvd+json": { source: "iana", compressible: !0 },
  "application/qsig": { source: "iana" },
  "application/raml+yaml": { compressible: !0, extensions: ["raml"] },
  "application/raptorfec": { source: "iana" },
  "application/rdap+json": { source: "iana", compressible: !0 },
  "application/rdf+xml": { source: "iana", compressible: !0, extensions: ["rdf", "owl"] },
  "application/reginfo+xml": { source: "iana", compressible: !0, extensions: ["rif"] },
  "application/relax-ng-compact-syntax": { source: "iana", extensions: ["rnc"] },
  "application/remote-printing": { source: "iana" },
  "application/reputon+json": { source: "iana", compressible: !0 },
  "application/resource-lists+xml": { source: "iana", compressible: !0, extensions: ["rl"] },
  "application/resource-lists-diff+xml": { source: "iana", compressible: !0, extensions: ["rld"] },
  "application/rfc+xml": { source: "iana", compressible: !0 },
  "application/riscos": { source: "iana" },
  "application/rlmi+xml": { source: "iana", compressible: !0 },
  "application/rls-services+xml": { source: "iana", compressible: !0, extensions: ["rs"] },
  "application/route-apd+xml": { source: "iana", compressible: !0, extensions: ["rapd"] },
  "application/route-s-tsid+xml": { source: "iana", compressible: !0, extensions: ["sls"] },
  "application/route-usd+xml": { source: "iana", compressible: !0, extensions: ["rusd"] },
  "application/rpki-ghostbusters": { source: "iana", extensions: ["gbr"] },
  "application/rpki-manifest": { source: "iana", extensions: ["mft"] },
  "application/rpki-publication": { source: "iana" },
  "application/rpki-roa": { source: "iana", extensions: ["roa"] },
  "application/rpki-updown": { source: "iana" },
  "application/rsd+xml": { source: "apache", compressible: !0, extensions: ["rsd"] },
  "application/rss+xml": { source: "apache", compressible: !0, extensions: ["rss"] },
  "application/rtf": { source: "iana", compressible: !0, extensions: ["rtf"] },
  "application/rtploopback": { source: "iana" },
  "application/rtx": { source: "iana" },
  "application/samlassertion+xml": { source: "iana", compressible: !0 },
  "application/samlmetadata+xml": { source: "iana", compressible: !0 },
  "application/sarif+json": { source: "iana", compressible: !0 },
  "application/sarif-external-properties+json": { source: "iana", compressible: !0 },
  "application/sbe": { source: "iana" },
  "application/sbml+xml": { source: "iana", compressible: !0, extensions: ["sbml"] },
  "application/scaip+xml": { source: "iana", compressible: !0 },
  "application/scim+json": { source: "iana", compressible: !0 },
  "application/scvp-cv-request": { source: "iana", extensions: ["scq"] },
  "application/scvp-cv-response": { source: "iana", extensions: ["scs"] },
  "application/scvp-vp-request": { source: "iana", extensions: ["spq"] },
  "application/scvp-vp-response": { source: "iana", extensions: ["spp"] },
  "application/sdp": { source: "iana", extensions: ["sdp"] },
  "application/secevent+jwt": { source: "iana" },
  "application/senml+cbor": { source: "iana" },
  "application/senml+json": { source: "iana", compressible: !0 },
  "application/senml+xml": { source: "iana", compressible: !0, extensions: ["senmlx"] },
  "application/senml-etch+cbor": { source: "iana" },
  "application/senml-etch+json": { source: "iana", compressible: !0 },
  "application/senml-exi": { source: "iana" },
  "application/sensml+cbor": { source: "iana" },
  "application/sensml+json": { source: "iana", compressible: !0 },
  "application/sensml+xml": { source: "iana", compressible: !0, extensions: ["sensmlx"] },
  "application/sensml-exi": { source: "iana" },
  "application/sep+xml": { source: "iana", compressible: !0 },
  "application/sep-exi": { source: "iana" },
  "application/session-info": { source: "iana" },
  "application/set-payment": { source: "iana" },
  "application/set-payment-initiation": { source: "iana", extensions: ["setpay"] },
  "application/set-registration": { source: "iana" },
  "application/set-registration-initiation": { source: "iana", extensions: ["setreg"] },
  "application/sgml": { source: "iana" },
  "application/sgml-open-catalog": { source: "iana" },
  "application/shf+xml": { source: "iana", compressible: !0, extensions: ["shf"] },
  "application/sieve": { source: "iana", extensions: ["siv", "sieve"] },
  "application/simple-filter+xml": { source: "iana", compressible: !0 },
  "application/simple-message-summary": { source: "iana" },
  "application/simplesymbolcontainer": { source: "iana" },
  "application/sipc": { source: "iana" },
  "application/slate": { source: "iana" },
  "application/smil": { source: "iana" },
  "application/smil+xml": { source: "iana", compressible: !0, extensions: ["smi", "smil"] },
  "application/smpte336m": { source: "iana" },
  "application/soap+fastinfoset": { source: "iana" },
  "application/soap+xml": { source: "iana", compressible: !0 },
  "application/sparql-query": { source: "iana", extensions: ["rq"] },
  "application/sparql-results+xml": { source: "iana", compressible: !0, extensions: ["srx"] },
  "application/spdx+json": { source: "iana", compressible: !0 },
  "application/spirits-event+xml": { source: "iana", compressible: !0 },
  "application/sql": { source: "iana" },
  "application/srgs": { source: "iana", extensions: ["gram"] },
  "application/srgs+xml": { source: "iana", compressible: !0, extensions: ["grxml"] },
  "application/sru+xml": { source: "iana", compressible: !0, extensions: ["sru"] },
  "application/ssdl+xml": { source: "apache", compressible: !0, extensions: ["ssdl"] },
  "application/ssml+xml": { source: "iana", compressible: !0, extensions: ["ssml"] },
  "application/stix+json": { source: "iana", compressible: !0 },
  "application/swid+xml": { source: "iana", compressible: !0, extensions: ["swidtag"] },
  "application/tamp-apex-update": { source: "iana" },
  "application/tamp-apex-update-confirm": { source: "iana" },
  "application/tamp-community-update": { source: "iana" },
  "application/tamp-community-update-confirm": { source: "iana" },
  "application/tamp-error": { source: "iana" },
  "application/tamp-sequence-adjust": { source: "iana" },
  "application/tamp-sequence-adjust-confirm": { source: "iana" },
  "application/tamp-status-query": { source: "iana" },
  "application/tamp-status-response": { source: "iana" },
  "application/tamp-update": { source: "iana" },
  "application/tamp-update-confirm": { source: "iana" },
  "application/tar": { compressible: !0 },
  "application/taxii+json": { source: "iana", compressible: !0 },
  "application/td+json": { source: "iana", compressible: !0 },
  "application/tei+xml": { source: "iana", compressible: !0, extensions: ["tei", "teicorpus"] },
  "application/tetra_isi": { source: "iana" },
  "application/thraud+xml": { source: "iana", compressible: !0, extensions: ["tfi"] },
  "application/timestamp-query": { source: "iana" },
  "application/timestamp-reply": { source: "iana" },
  "application/timestamped-data": { source: "iana", extensions: ["tsd"] },
  "application/tlsrpt+gzip": { source: "iana" },
  "application/tlsrpt+json": { source: "iana", compressible: !0 },
  "application/tnauthlist": { source: "iana" },
  "application/token-introspection+jwt": { source: "iana" },
  "application/toml": { compressible: !0, extensions: ["toml"] },
  "application/trickle-ice-sdpfrag": { source: "iana" },
  "application/trig": { source: "iana", extensions: ["trig"] },
  "application/ttml+xml": { source: "iana", compressible: !0, extensions: ["ttml"] },
  "application/tve-trigger": { source: "iana" },
  "application/tzif": { source: "iana" },
  "application/tzif-leap": { source: "iana" },
  "application/ubjson": { compressible: !1, extensions: ["ubj"] },
  "application/ulpfec": { source: "iana" },
  "application/urc-grpsheet+xml": { source: "iana", compressible: !0 },
  "application/urc-ressheet+xml": { source: "iana", compressible: !0, extensions: ["rsheet"] },
  "application/urc-targetdesc+xml": { source: "iana", compressible: !0, extensions: ["td"] },
  "application/urc-uisocketdesc+xml": { source: "iana", compressible: !0 },
  "application/vcard+json": { source: "iana", compressible: !0 },
  "application/vcard+xml": { source: "iana", compressible: !0 },
  "application/vemmi": { source: "iana" },
  "application/vividence.scriptfile": { source: "apache" },
  "application/vnd.1000minds.decision-model+xml": { source: "iana", compressible: !0, extensions: ["1km"] },
  "application/vnd.3gpp-prose+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp-prose-pc3ch+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp-v2x-local-service-information": { source: "iana" },
  "application/vnd.3gpp.5gnas": { source: "iana" },
  "application/vnd.3gpp.access-transfer-events+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.bsf+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.gmop+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.gtpc": { source: "iana" },
  "application/vnd.3gpp.interworking-data": { source: "iana" },
  "application/vnd.3gpp.lpp": { source: "iana" },
  "application/vnd.3gpp.mc-signalling-ear": { source: "iana" },
  "application/vnd.3gpp.mcdata-affiliation-command+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcdata-info+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcdata-payload": { source: "iana" },
  "application/vnd.3gpp.mcdata-service-config+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcdata-signalling": { source: "iana" },
  "application/vnd.3gpp.mcdata-ue-config+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcdata-user-profile+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcptt-affiliation-command+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcptt-floor-request+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcptt-info+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcptt-location-info+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcptt-mbms-usage-info+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcptt-service-config+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcptt-signed+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcptt-ue-config+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcptt-ue-init-config+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcptt-user-profile+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcvideo-affiliation-command+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcvideo-affiliation-info+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcvideo-info+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcvideo-location-info+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcvideo-mbms-usage-info+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcvideo-service-config+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcvideo-transmission-request+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcvideo-ue-config+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcvideo-user-profile+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mid-call+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.ngap": { source: "iana" },
  "application/vnd.3gpp.pfcp": { source: "iana" },
  "application/vnd.3gpp.pic-bw-large": { source: "iana", extensions: ["plb"] },
  "application/vnd.3gpp.pic-bw-small": { source: "iana", extensions: ["psb"] },
  "application/vnd.3gpp.pic-bw-var": { source: "iana", extensions: ["pvb"] },
  "application/vnd.3gpp.s1ap": { source: "iana" },
  "application/vnd.3gpp.sms": { source: "iana" },
  "application/vnd.3gpp.sms+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.srvcc-ext+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.srvcc-info+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.state-and-event-info+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.ussd+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp2.bcmcsinfo+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp2.sms": { source: "iana" },
  "application/vnd.3gpp2.tcap": { source: "iana", extensions: ["tcap"] },
  "application/vnd.3lightssoftware.imagescal": { source: "iana" },
  "application/vnd.3m.post-it-notes": { source: "iana", extensions: ["pwn"] },
  "application/vnd.accpac.simply.aso": { source: "iana", extensions: ["aso"] },
  "application/vnd.accpac.simply.imp": { source: "iana", extensions: ["imp"] },
  "application/vnd.acucobol": { source: "iana", extensions: ["acu"] },
  "application/vnd.acucorp": { source: "iana", extensions: ["atc", "acutc"] },
  "application/vnd.adobe.air-application-installer-package+zip": { source: "apache", compressible: !1, extensions: ["air"] },
  "application/vnd.adobe.flash.movie": { source: "iana" },
  "application/vnd.adobe.formscentral.fcdt": { source: "iana", extensions: ["fcdt"] },
  "application/vnd.adobe.fxp": { source: "iana", extensions: ["fxp", "fxpl"] },
  "application/vnd.adobe.partial-upload": { source: "iana" },
  "application/vnd.adobe.xdp+xml": { source: "iana", compressible: !0, extensions: ["xdp"] },
  "application/vnd.adobe.xfdf": { source: "iana", extensions: ["xfdf"] },
  "application/vnd.aether.imp": { source: "iana" },
  "application/vnd.afpc.afplinedata": { source: "iana" },
  "application/vnd.afpc.afplinedata-pagedef": { source: "iana" },
  "application/vnd.afpc.cmoca-cmresource": { source: "iana" },
  "application/vnd.afpc.foca-charset": { source: "iana" },
  "application/vnd.afpc.foca-codedfont": { source: "iana" },
  "application/vnd.afpc.foca-codepage": { source: "iana" },
  "application/vnd.afpc.modca": { source: "iana" },
  "application/vnd.afpc.modca-cmtable": { source: "iana" },
  "application/vnd.afpc.modca-formdef": { source: "iana" },
  "application/vnd.afpc.modca-mediummap": { source: "iana" },
  "application/vnd.afpc.modca-objectcontainer": { source: "iana" },
  "application/vnd.afpc.modca-overlay": { source: "iana" },
  "application/vnd.afpc.modca-pagesegment": { source: "iana" },
  "application/vnd.age": { source: "iana", extensions: ["age"] },
  "application/vnd.ah-barcode": { source: "iana" },
  "application/vnd.ahead.space": { source: "iana", extensions: ["ahead"] },
  "application/vnd.airzip.filesecure.azf": { source: "iana", extensions: ["azf"] },
  "application/vnd.airzip.filesecure.azs": { source: "iana", extensions: ["azs"] },
  "application/vnd.amadeus+json": { source: "iana", compressible: !0 },
  "application/vnd.amazon.ebook": { source: "apache", extensions: ["azw"] },
  "application/vnd.amazon.mobi8-ebook": { source: "iana" },
  "application/vnd.americandynamics.acc": { source: "iana", extensions: ["acc"] },
  "application/vnd.amiga.ami": { source: "iana", extensions: ["ami"] },
  "application/vnd.amundsen.maze+xml": { source: "iana", compressible: !0 },
  "application/vnd.android.ota": { source: "iana" },
  "application/vnd.android.package-archive": { source: "apache", compressible: !1, extensions: ["apk"] },
  "application/vnd.anki": { source: "iana" },
  "application/vnd.anser-web-certificate-issue-initiation": { source: "iana", extensions: ["cii"] },
  "application/vnd.anser-web-funds-transfer-initiation": { source: "apache", extensions: ["fti"] },
  "application/vnd.antix.game-component": { source: "iana", extensions: ["atx"] },
  "application/vnd.apache.arrow.file": { source: "iana" },
  "application/vnd.apache.arrow.stream": { source: "iana" },
  "application/vnd.apache.thrift.binary": { source: "iana" },
  "application/vnd.apache.thrift.compact": { source: "iana" },
  "application/vnd.apache.thrift.json": { source: "iana" },
  "application/vnd.api+json": { source: "iana", compressible: !0 },
  "application/vnd.aplextor.warrp+json": { source: "iana", compressible: !0 },
  "application/vnd.apothekende.reservation+json": { source: "iana", compressible: !0 },
  "application/vnd.apple.installer+xml": { source: "iana", compressible: !0, extensions: ["mpkg"] },
  "application/vnd.apple.keynote": { source: "iana", extensions: ["key"] },
  "application/vnd.apple.mpegurl": { source: "iana", extensions: ["m3u8"] },
  "application/vnd.apple.numbers": { source: "iana", extensions: ["numbers"] },
  "application/vnd.apple.pages": { source: "iana", extensions: ["pages"] },
  "application/vnd.apple.pkpass": { compressible: !1, extensions: ["pkpass"] },
  "application/vnd.arastra.swi": { source: "iana" },
  "application/vnd.aristanetworks.swi": { source: "iana", extensions: ["swi"] },
  "application/vnd.artisan+json": { source: "iana", compressible: !0 },
  "application/vnd.artsquare": { source: "iana" },
  "application/vnd.astraea-software.iota": { source: "iana", extensions: ["iota"] },
  "application/vnd.audiograph": { source: "iana", extensions: ["aep"] },
  "application/vnd.autopackage": { source: "iana" },
  "application/vnd.avalon+json": { source: "iana", compressible: !0 },
  "application/vnd.avistar+xml": { source: "iana", compressible: !0 },
  "application/vnd.balsamiq.bmml+xml": { source: "iana", compressible: !0, extensions: ["bmml"] },
  "application/vnd.balsamiq.bmpr": { source: "iana" },
  "application/vnd.banana-accounting": { source: "iana" },
  "application/vnd.bbf.usp.error": { source: "iana" },
  "application/vnd.bbf.usp.msg": { source: "iana" },
  "application/vnd.bbf.usp.msg+json": { source: "iana", compressible: !0 },
  "application/vnd.bekitzur-stech+json": { source: "iana", compressible: !0 },
  "application/vnd.bint.med-content": { source: "iana" },
  "application/vnd.biopax.rdf+xml": { source: "iana", compressible: !0 },
  "application/vnd.blink-idb-value-wrapper": { source: "iana" },
  "application/vnd.blueice.multipass": { source: "iana", extensions: ["mpm"] },
  "application/vnd.bluetooth.ep.oob": { source: "iana" },
  "application/vnd.bluetooth.le.oob": { source: "iana" },
  "application/vnd.bmi": { source: "iana", extensions: ["bmi"] },
  "application/vnd.bpf": { source: "iana" },
  "application/vnd.bpf3": { source: "iana" },
  "application/vnd.businessobjects": { source: "iana", extensions: ["rep"] },
  "application/vnd.byu.uapi+json": { source: "iana", compressible: !0 },
  "application/vnd.cab-jscript": { source: "iana" },
  "application/vnd.canon-cpdl": { source: "iana" },
  "application/vnd.canon-lips": { source: "iana" },
  "application/vnd.capasystems-pg+json": { source: "iana", compressible: !0 },
  "application/vnd.cendio.thinlinc.clientconf": { source: "iana" },
  "application/vnd.century-systems.tcp_stream": { source: "iana" },
  "application/vnd.chemdraw+xml": { source: "iana", compressible: !0, extensions: ["cdxml"] },
  "application/vnd.chess-pgn": { source: "iana" },
  "application/vnd.chipnuts.karaoke-mmd": { source: "iana", extensions: ["mmd"] },
  "application/vnd.ciedi": { source: "iana" },
  "application/vnd.cinderella": { source: "iana", extensions: ["cdy"] },
  "application/vnd.cirpack.isdn-ext": { source: "iana" },
  "application/vnd.citationstyles.style+xml": { source: "iana", compressible: !0, extensions: ["csl"] },
  "application/vnd.claymore": { source: "iana", extensions: ["cla"] },
  "application/vnd.cloanto.rp9": { source: "iana", extensions: ["rp9"] },
  "application/vnd.clonk.c4group": { source: "iana", extensions: ["c4g", "c4d", "c4f", "c4p", "c4u"] },
  "application/vnd.cluetrust.cartomobile-config": { source: "iana", extensions: ["c11amc"] },
  "application/vnd.cluetrust.cartomobile-config-pkg": { source: "iana", extensions: ["c11amz"] },
  "application/vnd.coffeescript": { source: "iana" },
  "application/vnd.collabio.xodocuments.document": { source: "iana" },
  "application/vnd.collabio.xodocuments.document-template": { source: "iana" },
  "application/vnd.collabio.xodocuments.presentation": { source: "iana" },
  "application/vnd.collabio.xodocuments.presentation-template": { source: "iana" },
  "application/vnd.collabio.xodocuments.spreadsheet": { source: "iana" },
  "application/vnd.collabio.xodocuments.spreadsheet-template": { source: "iana" },
  "application/vnd.collection+json": { source: "iana", compressible: !0 },
  "application/vnd.collection.doc+json": { source: "iana", compressible: !0 },
  "application/vnd.collection.next+json": { source: "iana", compressible: !0 },
  "application/vnd.comicbook+zip": { source: "iana", compressible: !1 },
  "application/vnd.comicbook-rar": { source: "iana" },
  "application/vnd.commerce-battelle": { source: "iana" },
  "application/vnd.commonspace": { source: "iana", extensions: ["csp"] },
  "application/vnd.contact.cmsg": { source: "iana", extensions: ["cdbcmsg"] },
  "application/vnd.coreos.ignition+json": { source: "iana", compressible: !0 },
  "application/vnd.cosmocaller": { source: "iana", extensions: ["cmc"] },
  "application/vnd.crick.clicker": { source: "iana", extensions: ["clkx"] },
  "application/vnd.crick.clicker.keyboard": { source: "iana", extensions: ["clkk"] },
  "application/vnd.crick.clicker.palette": { source: "iana", extensions: ["clkp"] },
  "application/vnd.crick.clicker.template": { source: "iana", extensions: ["clkt"] },
  "application/vnd.crick.clicker.wordbank": { source: "iana", extensions: ["clkw"] },
  "application/vnd.criticaltools.wbs+xml": { source: "iana", compressible: !0, extensions: ["wbs"] },
  "application/vnd.cryptii.pipe+json": { source: "iana", compressible: !0 },
  "application/vnd.crypto-shade-file": { source: "iana" },
  "application/vnd.cryptomator.encrypted": { source: "iana" },
  "application/vnd.cryptomator.vault": { source: "iana" },
  "application/vnd.ctc-posml": { source: "iana", extensions: ["pml"] },
  "application/vnd.ctct.ws+xml": { source: "iana", compressible: !0 },
  "application/vnd.cups-pdf": { source: "iana" },
  "application/vnd.cups-postscript": { source: "iana" },
  "application/vnd.cups-ppd": { source: "iana", extensions: ["ppd"] },
  "application/vnd.cups-raster": { source: "iana" },
  "application/vnd.cups-raw": { source: "iana" },
  "application/vnd.curl": { source: "iana" },
  "application/vnd.curl.car": { source: "apache", extensions: ["car"] },
  "application/vnd.curl.pcurl": { source: "apache", extensions: ["pcurl"] },
  "application/vnd.cyan.dean.root+xml": { source: "iana", compressible: !0 },
  "application/vnd.cybank": { source: "iana" },
  "application/vnd.cyclonedx+json": { source: "iana", compressible: !0 },
  "application/vnd.cyclonedx+xml": { source: "iana", compressible: !0 },
  "application/vnd.d2l.coursepackage1p0+zip": { source: "iana", compressible: !1 },
  "application/vnd.d3m-dataset": { source: "iana" },
  "application/vnd.d3m-problem": { source: "iana" },
  "application/vnd.dart": { source: "iana", compressible: !0, extensions: ["dart"] },
  "application/vnd.data-vision.rdz": { source: "iana", extensions: ["rdz"] },
  "application/vnd.datapackage+json": { source: "iana", compressible: !0 },
  "application/vnd.dataresource+json": { source: "iana", compressible: !0 },
  "application/vnd.dbf": { source: "iana", extensions: ["dbf"] },
  "application/vnd.debian.binary-package": { source: "iana" },
  "application/vnd.dece.data": { source: "iana", extensions: ["uvf", "uvvf", "uvd", "uvvd"] },
  "application/vnd.dece.ttml+xml": { source: "iana", compressible: !0, extensions: ["uvt", "uvvt"] },
  "application/vnd.dece.unspecified": { source: "iana", extensions: ["uvx", "uvvx"] },
  "application/vnd.dece.zip": { source: "iana", extensions: ["uvz", "uvvz"] },
  "application/vnd.denovo.fcselayout-link": { source: "iana", extensions: ["fe_launch"] },
  "application/vnd.desmume.movie": { source: "iana" },
  "application/vnd.dir-bi.plate-dl-nosuffix": { source: "iana" },
  "application/vnd.dm.delegation+xml": { source: "iana", compressible: !0 },
  "application/vnd.dna": { source: "iana", extensions: ["dna"] },
  "application/vnd.document+json": { source: "iana", compressible: !0 },
  "application/vnd.dolby.mlp": { source: "apache", extensions: ["mlp"] },
  "application/vnd.dolby.mobile.1": { source: "iana" },
  "application/vnd.dolby.mobile.2": { source: "iana" },
  "application/vnd.doremir.scorecloud-binary-document": { source: "iana" },
  "application/vnd.dpgraph": { source: "iana", extensions: ["dpg"] },
  "application/vnd.dreamfactory": { source: "iana", extensions: ["dfac"] },
  "application/vnd.drive+json": { source: "iana", compressible: !0 },
  "application/vnd.ds-keypoint": { source: "apache", extensions: ["kpxx"] },
  "application/vnd.dtg.local": { source: "iana" },
  "application/vnd.dtg.local.flash": { source: "iana" },
  "application/vnd.dtg.local.html": { source: "iana" },
  "application/vnd.dvb.ait": { source: "iana", extensions: ["ait"] },
  "application/vnd.dvb.dvbisl+xml": { source: "iana", compressible: !0 },
  "application/vnd.dvb.dvbj": { source: "iana" },
  "application/vnd.dvb.esgcontainer": { source: "iana" },
  "application/vnd.dvb.ipdcdftnotifaccess": { source: "iana" },
  "application/vnd.dvb.ipdcesgaccess": { source: "iana" },
  "application/vnd.dvb.ipdcesgaccess2": { source: "iana" },
  "application/vnd.dvb.ipdcesgpdd": { source: "iana" },
  "application/vnd.dvb.ipdcroaming": { source: "iana" },
  "application/vnd.dvb.iptv.alfec-base": { source: "iana" },
  "application/vnd.dvb.iptv.alfec-enhancement": { source: "iana" },
  "application/vnd.dvb.notif-aggregate-root+xml": { source: "iana", compressible: !0 },
  "application/vnd.dvb.notif-container+xml": { source: "iana", compressible: !0 },
  "application/vnd.dvb.notif-generic+xml": { source: "iana", compressible: !0 },
  "application/vnd.dvb.notif-ia-msglist+xml": { source: "iana", compressible: !0 },
  "application/vnd.dvb.notif-ia-registration-request+xml": { source: "iana", compressible: !0 },
  "application/vnd.dvb.notif-ia-registration-response+xml": { source: "iana", compressible: !0 },
  "application/vnd.dvb.notif-init+xml": { source: "iana", compressible: !0 },
  "application/vnd.dvb.pfr": { source: "iana" },
  "application/vnd.dvb.service": { source: "iana", extensions: ["svc"] },
  "application/vnd.dxr": { source: "iana" },
  "application/vnd.dynageo": { source: "iana", extensions: ["geo"] },
  "application/vnd.dzr": { source: "iana" },
  "application/vnd.easykaraoke.cdgdownload": { source: "iana" },
  "application/vnd.ecdis-update": { source: "iana" },
  "application/vnd.ecip.rlp": { source: "iana" },
  "application/vnd.eclipse.ditto+json": { source: "iana", compressible: !0 },
  "application/vnd.ecowin.chart": { source: "iana", extensions: ["mag"] },
  "application/vnd.ecowin.filerequest": { source: "iana" },
  "application/vnd.ecowin.fileupdate": { source: "iana" },
  "application/vnd.ecowin.series": { source: "iana" },
  "application/vnd.ecowin.seriesrequest": { source: "iana" },
  "application/vnd.ecowin.seriesupdate": { source: "iana" },
  "application/vnd.efi.img": { source: "iana" },
  "application/vnd.efi.iso": { source: "iana" },
  "application/vnd.emclient.accessrequest+xml": { source: "iana", compressible: !0 },
  "application/vnd.enliven": { source: "iana", extensions: ["nml"] },
  "application/vnd.enphase.envoy": { source: "iana" },
  "application/vnd.eprints.data+xml": { source: "iana", compressible: !0 },
  "application/vnd.epson.esf": { source: "iana", extensions: ["esf"] },
  "application/vnd.epson.msf": { source: "iana", extensions: ["msf"] },
  "application/vnd.epson.quickanime": { source: "iana", extensions: ["qam"] },
  "application/vnd.epson.salt": { source: "iana", extensions: ["slt"] },
  "application/vnd.epson.ssf": { source: "iana", extensions: ["ssf"] },
  "application/vnd.ericsson.quickcall": { source: "iana" },
  "application/vnd.espass-espass+zip": { source: "iana", compressible: !1 },
  "application/vnd.eszigno3+xml": { source: "iana", compressible: !0, extensions: ["es3", "et3"] },
  "application/vnd.etsi.aoc+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.asic-e+zip": { source: "iana", compressible: !1 },
  "application/vnd.etsi.asic-s+zip": { source: "iana", compressible: !1 },
  "application/vnd.etsi.cug+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.iptvcommand+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.iptvdiscovery+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.iptvprofile+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.iptvsad-bc+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.iptvsad-cod+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.iptvsad-npvr+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.iptvservice+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.iptvsync+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.iptvueprofile+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.mcid+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.mheg5": { source: "iana" },
  "application/vnd.etsi.overload-control-policy-dataset+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.pstn+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.sci+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.simservs+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.timestamp-token": { source: "iana" },
  "application/vnd.etsi.tsl+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.tsl.der": { source: "iana" },
  "application/vnd.eu.kasparian.car+json": { source: "iana", compressible: !0 },
  "application/vnd.eudora.data": { source: "iana" },
  "application/vnd.evolv.ecig.profile": { source: "iana" },
  "application/vnd.evolv.ecig.settings": { source: "iana" },
  "application/vnd.evolv.ecig.theme": { source: "iana" },
  "application/vnd.exstream-empower+zip": { source: "iana", compressible: !1 },
  "application/vnd.exstream-package": { source: "iana" },
  "application/vnd.ezpix-album": { source: "iana", extensions: ["ez2"] },
  "application/vnd.ezpix-package": { source: "iana", extensions: ["ez3"] },
  "application/vnd.f-secure.mobile": { source: "iana" },
  "application/vnd.familysearch.gedcom+zip": { source: "iana", compressible: !1 },
  "application/vnd.fastcopy-disk-image": { source: "iana" },
  "application/vnd.fdf": { source: "iana", extensions: ["fdf"] },
  "application/vnd.fdsn.mseed": { source: "iana", extensions: ["mseed"] },
  "application/vnd.fdsn.seed": { source: "iana", extensions: ["seed", "dataless"] },
  "application/vnd.ffsns": { source: "iana" },
  "application/vnd.ficlab.flb+zip": { source: "iana", compressible: !1 },
  "application/vnd.filmit.zfc": { source: "iana" },
  "application/vnd.fints": { source: "iana" },
  "application/vnd.firemonkeys.cloudcell": { source: "iana" },
  "application/vnd.flographit": { source: "iana", extensions: ["gph"] },
  "application/vnd.fluxtime.clip": { source: "iana", extensions: ["ftc"] },
  "application/vnd.font-fontforge-sfd": { source: "iana" },
  "application/vnd.framemaker": { source: "iana", extensions: ["fm", "frame", "maker", "book"] },
  "application/vnd.frogans.fnc": { source: "iana", extensions: ["fnc"] },
  "application/vnd.frogans.ltf": { source: "iana", extensions: ["ltf"] },
  "application/vnd.fsc.weblaunch": { source: "iana", extensions: ["fsc"] },
  "application/vnd.fujifilm.fb.docuworks": { source: "iana" },
  "application/vnd.fujifilm.fb.docuworks.binder": { source: "iana" },
  "application/vnd.fujifilm.fb.docuworks.container": { source: "iana" },
  "application/vnd.fujifilm.fb.jfi+xml": { source: "iana", compressible: !0 },
  "application/vnd.fujitsu.oasys": { source: "iana", extensions: ["oas"] },
  "application/vnd.fujitsu.oasys2": { source: "iana", extensions: ["oa2"] },
  "application/vnd.fujitsu.oasys3": { source: "iana", extensions: ["oa3"] },
  "application/vnd.fujitsu.oasysgp": { source: "iana", extensions: ["fg5"] },
  "application/vnd.fujitsu.oasysprs": { source: "iana", extensions: ["bh2"] },
  "application/vnd.fujixerox.art-ex": { source: "iana" },
  "application/vnd.fujixerox.art4": { source: "iana" },
  "application/vnd.fujixerox.ddd": { source: "iana", extensions: ["ddd"] },
  "application/vnd.fujixerox.docuworks": { source: "iana", extensions: ["xdw"] },
  "application/vnd.fujixerox.docuworks.binder": { source: "iana", extensions: ["xbd"] },
  "application/vnd.fujixerox.docuworks.container": { source: "iana" },
  "application/vnd.fujixerox.hbpl": { source: "iana" },
  "application/vnd.fut-misnet": { source: "iana" },
  "application/vnd.futoin+cbor": { source: "iana" },
  "application/vnd.futoin+json": { source: "iana", compressible: !0 },
  "application/vnd.fuzzysheet": { source: "iana", extensions: ["fzs"] },
  "application/vnd.genomatix.tuxedo": { source: "iana", extensions: ["txd"] },
  "application/vnd.gentics.grd+json": { source: "iana", compressible: !0 },
  "application/vnd.geo+json": { source: "iana", compressible: !0 },
  "application/vnd.geocube+xml": { source: "iana", compressible: !0 },
  "application/vnd.geogebra.file": { source: "iana", extensions: ["ggb"] },
  "application/vnd.geogebra.slides": { source: "iana" },
  "application/vnd.geogebra.tool": { source: "iana", extensions: ["ggt"] },
  "application/vnd.geometry-explorer": { source: "iana", extensions: ["gex", "gre"] },
  "application/vnd.geonext": { source: "iana", extensions: ["gxt"] },
  "application/vnd.geoplan": { source: "iana", extensions: ["g2w"] },
  "application/vnd.geospace": { source: "iana", extensions: ["g3w"] },
  "application/vnd.gerber": { source: "iana" },
  "application/vnd.globalplatform.card-content-mgt": { source: "iana" },
  "application/vnd.globalplatform.card-content-mgt-response": { source: "iana" },
  "application/vnd.gmx": { source: "iana", extensions: ["gmx"] },
  "application/vnd.google-apps.document": { compressible: !1, extensions: ["gdoc"] },
  "application/vnd.google-apps.presentation": { compressible: !1, extensions: ["gslides"] },
  "application/vnd.google-apps.spreadsheet": { compressible: !1, extensions: ["gsheet"] },
  "application/vnd.google-earth.kml+xml": { source: "iana", compressible: !0, extensions: ["kml"] },
  "application/vnd.google-earth.kmz": { source: "iana", compressible: !1, extensions: ["kmz"] },
  "application/vnd.gov.sk.e-form+xml": { source: "iana", compressible: !0 },
  "application/vnd.gov.sk.e-form+zip": { source: "iana", compressible: !1 },
  "application/vnd.gov.sk.xmldatacontainer+xml": { source: "iana", compressible: !0 },
  "application/vnd.grafeq": { source: "iana", extensions: ["gqf", "gqs"] },
  "application/vnd.gridmp": { source: "iana" },
  "application/vnd.groove-account": { source: "iana", extensions: ["gac"] },
  "application/vnd.groove-help": { source: "iana", extensions: ["ghf"] },
  "application/vnd.groove-identity-message": { source: "iana", extensions: ["gim"] },
  "application/vnd.groove-injector": { source: "iana", extensions: ["grv"] },
  "application/vnd.groove-tool-message": { source: "iana", extensions: ["gtm"] },
  "application/vnd.groove-tool-template": { source: "iana", extensions: ["tpl"] },
  "application/vnd.groove-vcard": { source: "iana", extensions: ["vcg"] },
  "application/vnd.hal+json": { source: "iana", compressible: !0 },
  "application/vnd.hal+xml": { source: "iana", compressible: !0, extensions: ["hal"] },
  "application/vnd.handheld-entertainment+xml": { source: "iana", compressible: !0, extensions: ["zmm"] },
  "application/vnd.hbci": { source: "iana", extensions: ["hbci"] },
  "application/vnd.hc+json": { source: "iana", compressible: !0 },
  "application/vnd.hcl-bireports": { source: "iana" },
  "application/vnd.hdt": { source: "iana" },
  "application/vnd.heroku+json": { source: "iana", compressible: !0 },
  "application/vnd.hhe.lesson-player": { source: "iana", extensions: ["les"] },
  "application/vnd.hl7cda+xml": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/vnd.hl7v2+xml": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/vnd.hp-hpgl": { source: "iana", extensions: ["hpgl"] },
  "application/vnd.hp-hpid": { source: "iana", extensions: ["hpid"] },
  "application/vnd.hp-hps": { source: "iana", extensions: ["hps"] },
  "application/vnd.hp-jlyt": { source: "iana", extensions: ["jlt"] },
  "application/vnd.hp-pcl": { source: "iana", extensions: ["pcl"] },
  "application/vnd.hp-pclxl": { source: "iana", extensions: ["pclxl"] },
  "application/vnd.httphone": { source: "iana" },
  "application/vnd.hydrostatix.sof-data": { source: "iana", extensions: ["sfd-hdstx"] },
  "application/vnd.hyper+json": { source: "iana", compressible: !0 },
  "application/vnd.hyper-item+json": { source: "iana", compressible: !0 },
  "application/vnd.hyperdrive+json": { source: "iana", compressible: !0 },
  "application/vnd.hzn-3d-crossword": { source: "iana" },
  "application/vnd.ibm.afplinedata": { source: "iana" },
  "application/vnd.ibm.electronic-media": { source: "iana" },
  "application/vnd.ibm.minipay": { source: "iana", extensions: ["mpy"] },
  "application/vnd.ibm.modcap": { source: "iana", extensions: ["afp", "listafp", "list3820"] },
  "application/vnd.ibm.rights-management": { source: "iana", extensions: ["irm"] },
  "application/vnd.ibm.secure-container": { source: "iana", extensions: ["sc"] },
  "application/vnd.iccprofile": { source: "iana", extensions: ["icc", "icm"] },
  "application/vnd.ieee.1905": { source: "iana" },
  "application/vnd.igloader": { source: "iana", extensions: ["igl"] },
  "application/vnd.imagemeter.folder+zip": { source: "iana", compressible: !1 },
  "application/vnd.imagemeter.image+zip": { source: "iana", compressible: !1 },
  "application/vnd.immervision-ivp": { source: "iana", extensions: ["ivp"] },
  "application/vnd.immervision-ivu": { source: "iana", extensions: ["ivu"] },
  "application/vnd.ims.imsccv1p1": { source: "iana" },
  "application/vnd.ims.imsccv1p2": { source: "iana" },
  "application/vnd.ims.imsccv1p3": { source: "iana" },
  "application/vnd.ims.lis.v2.result+json": { source: "iana", compressible: !0 },
  "application/vnd.ims.lti.v2.toolconsumerprofile+json": { source: "iana", compressible: !0 },
  "application/vnd.ims.lti.v2.toolproxy+json": { source: "iana", compressible: !0 },
  "application/vnd.ims.lti.v2.toolproxy.id+json": { source: "iana", compressible: !0 },
  "application/vnd.ims.lti.v2.toolsettings+json": { source: "iana", compressible: !0 },
  "application/vnd.ims.lti.v2.toolsettings.simple+json": { source: "iana", compressible: !0 },
  "application/vnd.informedcontrol.rms+xml": { source: "iana", compressible: !0 },
  "application/vnd.informix-visionary": { source: "iana" },
  "application/vnd.infotech.project": { source: "iana" },
  "application/vnd.infotech.project+xml": { source: "iana", compressible: !0 },
  "application/vnd.innopath.wamp.notification": { source: "iana" },
  "application/vnd.insors.igm": { source: "iana", extensions: ["igm"] },
  "application/vnd.intercon.formnet": { source: "iana", extensions: ["xpw", "xpx"] },
  "application/vnd.intergeo": { source: "iana", extensions: ["i2g"] },
  "application/vnd.intertrust.digibox": { source: "iana" },
  "application/vnd.intertrust.nncp": { source: "iana" },
  "application/vnd.intu.qbo": { source: "iana", extensions: ["qbo"] },
  "application/vnd.intu.qfx": { source: "iana", extensions: ["qfx"] },
  "application/vnd.iptc.g2.catalogitem+xml": { source: "iana", compressible: !0 },
  "application/vnd.iptc.g2.conceptitem+xml": { source: "iana", compressible: !0 },
  "application/vnd.iptc.g2.knowledgeitem+xml": { source: "iana", compressible: !0 },
  "application/vnd.iptc.g2.newsitem+xml": { source: "iana", compressible: !0 },
  "application/vnd.iptc.g2.newsmessage+xml": { source: "iana", compressible: !0 },
  "application/vnd.iptc.g2.packageitem+xml": { source: "iana", compressible: !0 },
  "application/vnd.iptc.g2.planningitem+xml": { source: "iana", compressible: !0 },
  "application/vnd.ipunplugged.rcprofile": { source: "iana", extensions: ["rcprofile"] },
  "application/vnd.irepository.package+xml": { source: "iana", compressible: !0, extensions: ["irp"] },
  "application/vnd.is-xpr": { source: "iana", extensions: ["xpr"] },
  "application/vnd.isac.fcs": { source: "iana", extensions: ["fcs"] },
  "application/vnd.iso11783-10+zip": { source: "iana", compressible: !1 },
  "application/vnd.jam": { source: "iana", extensions: ["jam"] },
  "application/vnd.japannet-directory-service": { source: "iana" },
  "application/vnd.japannet-jpnstore-wakeup": { source: "iana" },
  "application/vnd.japannet-payment-wakeup": { source: "iana" },
  "application/vnd.japannet-registration": { source: "iana" },
  "application/vnd.japannet-registration-wakeup": { source: "iana" },
  "application/vnd.japannet-setstore-wakeup": { source: "iana" },
  "application/vnd.japannet-verification": { source: "iana" },
  "application/vnd.japannet-verification-wakeup": { source: "iana" },
  "application/vnd.jcp.javame.midlet-rms": { source: "iana", extensions: ["rms"] },
  "application/vnd.jisp": { source: "iana", extensions: ["jisp"] },
  "application/vnd.joost.joda-archive": { source: "iana", extensions: ["joda"] },
  "application/vnd.jsk.isdn-ngn": { source: "iana" },
  "application/vnd.kahootz": { source: "iana", extensions: ["ktz", "ktr"] },
  "application/vnd.kde.karbon": { source: "iana", extensions: ["karbon"] },
  "application/vnd.kde.kchart": { source: "iana", extensions: ["chrt"] },
  "application/vnd.kde.kformula": { source: "iana", extensions: ["kfo"] },
  "application/vnd.kde.kivio": { source: "iana", extensions: ["flw"] },
  "application/vnd.kde.kontour": { source: "iana", extensions: ["kon"] },
  "application/vnd.kde.kpresenter": { source: "iana", extensions: ["kpr", "kpt"] },
  "application/vnd.kde.kspread": { source: "iana", extensions: ["ksp"] },
  "application/vnd.kde.kword": { source: "iana", extensions: ["kwd", "kwt"] },
  "application/vnd.kenameaapp": { source: "iana", extensions: ["htke"] },
  "application/vnd.kidspiration": { source: "iana", extensions: ["kia"] },
  "application/vnd.kinar": { source: "iana", extensions: ["kne", "knp"] },
  "application/vnd.koan": { source: "iana", extensions: ["skp", "skd", "skt", "skm"] },
  "application/vnd.kodak-descriptor": { source: "iana", extensions: ["sse"] },
  "application/vnd.las": { source: "iana" },
  "application/vnd.las.las+json": { source: "iana", compressible: !0 },
  "application/vnd.las.las+xml": { source: "iana", compressible: !0, extensions: ["lasxml"] },
  "application/vnd.laszip": { source: "iana" },
  "application/vnd.leap+json": { source: "iana", compressible: !0 },
  "application/vnd.liberty-request+xml": { source: "iana", compressible: !0 },
  "application/vnd.llamagraphics.life-balance.desktop": { source: "iana", extensions: ["lbd"] },
  "application/vnd.llamagraphics.life-balance.exchange+xml": { source: "iana", compressible: !0, extensions: ["lbe"] },
  "application/vnd.logipipe.circuit+zip": { source: "iana", compressible: !1 },
  "application/vnd.loom": { source: "iana" },
  "application/vnd.lotus-1-2-3": { source: "iana", extensions: ["123"] },
  "application/vnd.lotus-approach": { source: "iana", extensions: ["apr"] },
  "application/vnd.lotus-freelance": { source: "iana", extensions: ["pre"] },
  "application/vnd.lotus-notes": { source: "iana", extensions: ["nsf"] },
  "application/vnd.lotus-organizer": { source: "iana", extensions: ["org"] },
  "application/vnd.lotus-screencam": { source: "iana", extensions: ["scm"] },
  "application/vnd.lotus-wordpro": { source: "iana", extensions: ["lwp"] },
  "application/vnd.macports.portpkg": { source: "iana", extensions: ["portpkg"] },
  "application/vnd.mapbox-vector-tile": { source: "iana", extensions: ["mvt"] },
  "application/vnd.marlin.drm.actiontoken+xml": { source: "iana", compressible: !0 },
  "application/vnd.marlin.drm.conftoken+xml": { source: "iana", compressible: !0 },
  "application/vnd.marlin.drm.license+xml": { source: "iana", compressible: !0 },
  "application/vnd.marlin.drm.mdcf": { source: "iana" },
  "application/vnd.mason+json": { source: "iana", compressible: !0 },
  "application/vnd.maxar.archive.3tz+zip": { source: "iana", compressible: !1 },
  "application/vnd.maxmind.maxmind-db": { source: "iana" },
  "application/vnd.mcd": { source: "iana", extensions: ["mcd"] },
  "application/vnd.medcalcdata": { source: "iana", extensions: ["mc1"] },
  "application/vnd.mediastation.cdkey": { source: "iana", extensions: ["cdkey"] },
  "application/vnd.meridian-slingshot": { source: "iana" },
  "application/vnd.mfer": { source: "iana", extensions: ["mwf"] },
  "application/vnd.mfmp": { source: "iana", extensions: ["mfm"] },
  "application/vnd.micro+json": { source: "iana", compressible: !0 },
  "application/vnd.micrografx.flo": { source: "iana", extensions: ["flo"] },
  "application/vnd.micrografx.igx": { source: "iana", extensions: ["igx"] },
  "application/vnd.microsoft.portable-executable": { source: "iana" },
  "application/vnd.microsoft.windows.thumbnail-cache": { source: "iana" },
  "application/vnd.miele+json": { source: "iana", compressible: !0 },
  "application/vnd.mif": { source: "iana", extensions: ["mif"] },
  "application/vnd.minisoft-hp3000-save": { source: "iana" },
  "application/vnd.mitsubishi.misty-guard.trustweb": { source: "iana" },
  "application/vnd.mobius.daf": { source: "iana", extensions: ["daf"] },
  "application/vnd.mobius.dis": { source: "iana", extensions: ["dis"] },
  "application/vnd.mobius.mbk": { source: "iana", extensions: ["mbk"] },
  "application/vnd.mobius.mqy": { source: "iana", extensions: ["mqy"] },
  "application/vnd.mobius.msl": { source: "iana", extensions: ["msl"] },
  "application/vnd.mobius.plc": { source: "iana", extensions: ["plc"] },
  "application/vnd.mobius.txf": { source: "iana", extensions: ["txf"] },
  "application/vnd.mophun.application": { source: "iana", extensions: ["mpn"] },
  "application/vnd.mophun.certificate": { source: "iana", extensions: ["mpc"] },
  "application/vnd.motorola.flexsuite": { source: "iana" },
  "application/vnd.motorola.flexsuite.adsi": { source: "iana" },
  "application/vnd.motorola.flexsuite.fis": { source: "iana" },
  "application/vnd.motorola.flexsuite.gotap": { source: "iana" },
  "application/vnd.motorola.flexsuite.kmr": { source: "iana" },
  "application/vnd.motorola.flexsuite.ttc": { source: "iana" },
  "application/vnd.motorola.flexsuite.wem": { source: "iana" },
  "application/vnd.motorola.iprm": { source: "iana" },
  "application/vnd.mozilla.xul+xml": { source: "iana", compressible: !0, extensions: ["xul"] },
  "application/vnd.ms-3mfdocument": { source: "iana" },
  "application/vnd.ms-artgalry": { source: "iana", extensions: ["cil"] },
  "application/vnd.ms-asf": { source: "iana" },
  "application/vnd.ms-cab-compressed": { source: "iana", extensions: ["cab"] },
  "application/vnd.ms-color.iccprofile": { source: "apache" },
  "application/vnd.ms-excel": { source: "iana", compressible: !1, extensions: ["xls", "xlm", "xla", "xlc", "xlt", "xlw"] },
  "application/vnd.ms-excel.addin.macroenabled.12": { source: "iana", extensions: ["xlam"] },
  "application/vnd.ms-excel.sheet.binary.macroenabled.12": { source: "iana", extensions: ["xlsb"] },
  "application/vnd.ms-excel.sheet.macroenabled.12": { source: "iana", extensions: ["xlsm"] },
  "application/vnd.ms-excel.template.macroenabled.12": { source: "iana", extensions: ["xltm"] },
  "application/vnd.ms-fontobject": { source: "iana", compressible: !0, extensions: ["eot"] },
  "application/vnd.ms-htmlhelp": { source: "iana", extensions: ["chm"] },
  "application/vnd.ms-ims": { source: "iana", extensions: ["ims"] },
  "application/vnd.ms-lrm": { source: "iana", extensions: ["lrm"] },
  "application/vnd.ms-office.activex+xml": { source: "iana", compressible: !0 },
  "application/vnd.ms-officetheme": { source: "iana", extensions: ["thmx"] },
  "application/vnd.ms-opentype": { source: "apache", compressible: !0 },
  "application/vnd.ms-outlook": { compressible: !1, extensions: ["msg"] },
  "application/vnd.ms-package.obfuscated-opentype": { source: "apache" },
  "application/vnd.ms-pki.seccat": { source: "apache", extensions: ["cat"] },
  "application/vnd.ms-pki.stl": { source: "apache", extensions: ["stl"] },
  "application/vnd.ms-playready.initiator+xml": { source: "iana", compressible: !0 },
  "application/vnd.ms-powerpoint": { source: "iana", compressible: !1, extensions: ["ppt", "pps", "pot"] },
  "application/vnd.ms-powerpoint.addin.macroenabled.12": { source: "iana", extensions: ["ppam"] },
  "application/vnd.ms-powerpoint.presentation.macroenabled.12": { source: "iana", extensions: ["pptm"] },
  "application/vnd.ms-powerpoint.slide.macroenabled.12": { source: "iana", extensions: ["sldm"] },
  "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { source: "iana", extensions: ["ppsm"] },
  "application/vnd.ms-powerpoint.template.macroenabled.12": { source: "iana", extensions: ["potm"] },
  "application/vnd.ms-printdevicecapabilities+xml": { source: "iana", compressible: !0 },
  "application/vnd.ms-printing.printticket+xml": { source: "apache", compressible: !0 },
  "application/vnd.ms-printschematicket+xml": { source: "iana", compressible: !0 },
  "application/vnd.ms-project": { source: "iana", extensions: ["mpp", "mpt"] },
  "application/vnd.ms-tnef": { source: "iana" },
  "application/vnd.ms-windows.devicepairing": { source: "iana" },
  "application/vnd.ms-windows.nwprinting.oob": { source: "iana" },
  "application/vnd.ms-windows.printerpairing": { source: "iana" },
  "application/vnd.ms-windows.wsd.oob": { source: "iana" },
  "application/vnd.ms-wmdrm.lic-chlg-req": { source: "iana" },
  "application/vnd.ms-wmdrm.lic-resp": { source: "iana" },
  "application/vnd.ms-wmdrm.meter-chlg-req": { source: "iana" },
  "application/vnd.ms-wmdrm.meter-resp": { source: "iana" },
  "application/vnd.ms-word.document.macroenabled.12": { source: "iana", extensions: ["docm"] },
  "application/vnd.ms-word.template.macroenabled.12": { source: "iana", extensions: ["dotm"] },
  "application/vnd.ms-works": { source: "iana", extensions: ["wps", "wks", "wcm", "wdb"] },
  "application/vnd.ms-wpl": { source: "iana", extensions: ["wpl"] },
  "application/vnd.ms-xpsdocument": { source: "iana", compressible: !1, extensions: ["xps"] },
  "application/vnd.msa-disk-image": { source: "iana" },
  "application/vnd.mseq": { source: "iana", extensions: ["mseq"] },
  "application/vnd.msign": { source: "iana" },
  "application/vnd.multiad.creator": { source: "iana" },
  "application/vnd.multiad.creator.cif": { source: "iana" },
  "application/vnd.music-niff": { source: "iana" },
  "application/vnd.musician": { source: "iana", extensions: ["mus"] },
  "application/vnd.muvee.style": { source: "iana", extensions: ["msty"] },
  "application/vnd.mynfc": { source: "iana", extensions: ["taglet"] },
  "application/vnd.nacamar.ybrid+json": { source: "iana", compressible: !0 },
  "application/vnd.ncd.control": { source: "iana" },
  "application/vnd.ncd.reference": { source: "iana" },
  "application/vnd.nearst.inv+json": { source: "iana", compressible: !0 },
  "application/vnd.nebumind.line": { source: "iana" },
  "application/vnd.nervana": { source: "iana" },
  "application/vnd.netfpx": { source: "iana" },
  "application/vnd.neurolanguage.nlu": { source: "iana", extensions: ["nlu"] },
  "application/vnd.nimn": { source: "iana" },
  "application/vnd.nintendo.nitro.rom": { source: "iana" },
  "application/vnd.nintendo.snes.rom": { source: "iana" },
  "application/vnd.nitf": { source: "iana", extensions: ["ntf", "nitf"] },
  "application/vnd.noblenet-directory": { source: "iana", extensions: ["nnd"] },
  "application/vnd.noblenet-sealer": { source: "iana", extensions: ["nns"] },
  "application/vnd.noblenet-web": { source: "iana", extensions: ["nnw"] },
  "application/vnd.nokia.catalogs": { source: "iana" },
  "application/vnd.nokia.conml+wbxml": { source: "iana" },
  "application/vnd.nokia.conml+xml": { source: "iana", compressible: !0 },
  "application/vnd.nokia.iptv.config+xml": { source: "iana", compressible: !0 },
  "application/vnd.nokia.isds-radio-presets": { source: "iana" },
  "application/vnd.nokia.landmark+wbxml": { source: "iana" },
  "application/vnd.nokia.landmark+xml": { source: "iana", compressible: !0 },
  "application/vnd.nokia.landmarkcollection+xml": { source: "iana", compressible: !0 },
  "application/vnd.nokia.n-gage.ac+xml": { source: "iana", compressible: !0, extensions: ["ac"] },
  "application/vnd.nokia.n-gage.data": { source: "iana", extensions: ["ngdat"] },
  "application/vnd.nokia.n-gage.symbian.install": { source: "iana", extensions: ["n-gage"] },
  "application/vnd.nokia.ncd": { source: "iana" },
  "application/vnd.nokia.pcd+wbxml": { source: "iana" },
  "application/vnd.nokia.pcd+xml": { source: "iana", compressible: !0 },
  "application/vnd.nokia.radio-preset": { source: "iana", extensions: ["rpst"] },
  "application/vnd.nokia.radio-presets": { source: "iana", extensions: ["rpss"] },
  "application/vnd.novadigm.edm": { source: "iana", extensions: ["edm"] },
  "application/vnd.novadigm.edx": { source: "iana", extensions: ["edx"] },
  "application/vnd.novadigm.ext": { source: "iana", extensions: ["ext"] },
  "application/vnd.ntt-local.content-share": { source: "iana" },
  "application/vnd.ntt-local.file-transfer": { source: "iana" },
  "application/vnd.ntt-local.ogw_remote-access": { source: "iana" },
  "application/vnd.ntt-local.sip-ta_remote": { source: "iana" },
  "application/vnd.ntt-local.sip-ta_tcp_stream": { source: "iana" },
  "application/vnd.oasis.opendocument.chart": { source: "iana", extensions: ["odc"] },
  "application/vnd.oasis.opendocument.chart-template": { source: "iana", extensions: ["otc"] },
  "application/vnd.oasis.opendocument.database": { source: "iana", extensions: ["odb"] },
  "application/vnd.oasis.opendocument.formula": { source: "iana", extensions: ["odf"] },
  "application/vnd.oasis.opendocument.formula-template": { source: "iana", extensions: ["odft"] },
  "application/vnd.oasis.opendocument.graphics": { source: "iana", compressible: !1, extensions: ["odg"] },
  "application/vnd.oasis.opendocument.graphics-template": { source: "iana", extensions: ["otg"] },
  "application/vnd.oasis.opendocument.image": { source: "iana", extensions: ["odi"] },
  "application/vnd.oasis.opendocument.image-template": { source: "iana", extensions: ["oti"] },
  "application/vnd.oasis.opendocument.presentation": { source: "iana", compressible: !1, extensions: ["odp"] },
  "application/vnd.oasis.opendocument.presentation-template": { source: "iana", extensions: ["otp"] },
  "application/vnd.oasis.opendocument.spreadsheet": { source: "iana", compressible: !1, extensions: ["ods"] },
  "application/vnd.oasis.opendocument.spreadsheet-template": { source: "iana", extensions: ["ots"] },
  "application/vnd.oasis.opendocument.text": { source: "iana", compressible: !1, extensions: ["odt"] },
  "application/vnd.oasis.opendocument.text-master": { source: "iana", extensions: ["odm"] },
  "application/vnd.oasis.opendocument.text-template": { source: "iana", extensions: ["ott"] },
  "application/vnd.oasis.opendocument.text-web": { source: "iana", extensions: ["oth"] },
  "application/vnd.obn": { source: "iana" },
  "application/vnd.ocf+cbor": { source: "iana" },
  "application/vnd.oci.image.manifest.v1+json": { source: "iana", compressible: !0 },
  "application/vnd.oftn.l10n+json": { source: "iana", compressible: !0 },
  "application/vnd.oipf.contentaccessdownload+xml": { source: "iana", compressible: !0 },
  "application/vnd.oipf.contentaccessstreaming+xml": { source: "iana", compressible: !0 },
  "application/vnd.oipf.cspg-hexbinary": { source: "iana" },
  "application/vnd.oipf.dae.svg+xml": { source: "iana", compressible: !0 },
  "application/vnd.oipf.dae.xhtml+xml": { source: "iana", compressible: !0 },
  "application/vnd.oipf.mippvcontrolmessage+xml": { source: "iana", compressible: !0 },
  "application/vnd.oipf.pae.gem": { source: "iana" },
  "application/vnd.oipf.spdiscovery+xml": { source: "iana", compressible: !0 },
  "application/vnd.oipf.spdlist+xml": { source: "iana", compressible: !0 },
  "application/vnd.oipf.ueprofile+xml": { source: "iana", compressible: !0 },
  "application/vnd.oipf.userprofile+xml": { source: "iana", compressible: !0 },
  "application/vnd.olpc-sugar": { source: "iana", extensions: ["xo"] },
  "application/vnd.oma-scws-config": { source: "iana" },
  "application/vnd.oma-scws-http-request": { source: "iana" },
  "application/vnd.oma-scws-http-response": { source: "iana" },
  "application/vnd.oma.bcast.associated-procedure-parameter+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.bcast.drm-trigger+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.bcast.imd+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.bcast.ltkm": { source: "iana" },
  "application/vnd.oma.bcast.notification+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.bcast.provisioningtrigger": { source: "iana" },
  "application/vnd.oma.bcast.sgboot": { source: "iana" },
  "application/vnd.oma.bcast.sgdd+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.bcast.sgdu": { source: "iana" },
  "application/vnd.oma.bcast.simple-symbol-container": { source: "iana" },
  "application/vnd.oma.bcast.smartcard-trigger+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.bcast.sprov+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.bcast.stkm": { source: "iana" },
  "application/vnd.oma.cab-address-book+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.cab-feature-handler+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.cab-pcc+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.cab-subs-invite+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.cab-user-prefs+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.dcd": { source: "iana" },
  "application/vnd.oma.dcdc": { source: "iana" },
  "application/vnd.oma.dd2+xml": { source: "iana", compressible: !0, extensions: ["dd2"] },
  "application/vnd.oma.drm.risd+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.group-usage-list+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.lwm2m+cbor": { source: "iana" },
  "application/vnd.oma.lwm2m+json": { source: "iana", compressible: !0 },
  "application/vnd.oma.lwm2m+tlv": { source: "iana" },
  "application/vnd.oma.pal+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.poc.detailed-progress-report+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.poc.final-report+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.poc.groups+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.poc.invocation-descriptor+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.poc.optimized-progress-report+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.push": { source: "iana" },
  "application/vnd.oma.scidm.messages+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.xcap-directory+xml": { source: "iana", compressible: !0 },
  "application/vnd.omads-email+xml": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/vnd.omads-file+xml": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/vnd.omads-folder+xml": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/vnd.omaloc-supl-init": { source: "iana" },
  "application/vnd.onepager": { source: "iana" },
  "application/vnd.onepagertamp": { source: "iana" },
  "application/vnd.onepagertamx": { source: "iana" },
  "application/vnd.onepagertat": { source: "iana" },
  "application/vnd.onepagertatp": { source: "iana" },
  "application/vnd.onepagertatx": { source: "iana" },
  "application/vnd.openblox.game+xml": { source: "iana", compressible: !0, extensions: ["obgx"] },
  "application/vnd.openblox.game-binary": { source: "iana" },
  "application/vnd.openeye.oeb": { source: "iana" },
  "application/vnd.openofficeorg.extension": { source: "apache", extensions: ["oxt"] },
  "application/vnd.openstreetmap.data+xml": { source: "iana", compressible: !0, extensions: ["osm"] },
  "application/vnd.opentimestamps.ots": { source: "iana" },
  "application/vnd.openxmlformats-officedocument.custom-properties+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.drawing+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.extended-properties+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.presentationml.presentation": { source: "iana", compressible: !1, extensions: ["pptx"] },
  "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.presentationml.slide": { source: "iana", extensions: ["sldx"] },
  "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { source: "iana", extensions: ["ppsx"] },
  "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.presentationml.template": { source: "iana", extensions: ["potx"] },
  "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { source: "iana", compressible: !1, extensions: ["xlsx"] },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { source: "iana", extensions: ["xltx"] },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.theme+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.themeoverride+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.vmldrawing": { source: "iana" },
  "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { source: "iana", compressible: !1, extensions: ["docx"] },
  "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { source: "iana", extensions: ["dotx"] },
  "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-package.core-properties+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-package.relationships+xml": { source: "iana", compressible: !0 },
  "application/vnd.oracle.resource+json": { source: "iana", compressible: !0 },
  "application/vnd.orange.indata": { source: "iana" },
  "application/vnd.osa.netdeploy": { source: "iana" },
  "application/vnd.osgeo.mapguide.package": { source: "iana", extensions: ["mgp"] },
  "application/vnd.osgi.bundle": { source: "iana" },
  "application/vnd.osgi.dp": { source: "iana", extensions: ["dp"] },
  "application/vnd.osgi.subsystem": { source: "iana", extensions: ["esa"] },
  "application/vnd.otps.ct-kip+xml": { source: "iana", compressible: !0 },
  "application/vnd.oxli.countgraph": { source: "iana" },
  "application/vnd.pagerduty+json": { source: "iana", compressible: !0 },
  "application/vnd.palm": { source: "iana", extensions: ["pdb", "pqa", "oprc"] },
  "application/vnd.panoply": { source: "iana" },
  "application/vnd.paos.xml": { source: "iana" },
  "application/vnd.patentdive": { source: "iana" },
  "application/vnd.patientecommsdoc": { source: "iana" },
  "application/vnd.pawaafile": { source: "iana", extensions: ["paw"] },
  "application/vnd.pcos": { source: "iana" },
  "application/vnd.pg.format": { source: "iana", extensions: ["str"] },
  "application/vnd.pg.osasli": { source: "iana", extensions: ["ei6"] },
  "application/vnd.piaccess.application-licence": { source: "iana" },
  "application/vnd.picsel": { source: "iana", extensions: ["efif"] },
  "application/vnd.pmi.widget": { source: "iana", extensions: ["wg"] },
  "application/vnd.poc.group-advertisement+xml": { source: "iana", compressible: !0 },
  "application/vnd.pocketlearn": { source: "iana", extensions: ["plf"] },
  "application/vnd.powerbuilder6": { source: "iana", extensions: ["pbd"] },
  "application/vnd.powerbuilder6-s": { source: "iana" },
  "application/vnd.powerbuilder7": { source: "iana" },
  "application/vnd.powerbuilder7-s": { source: "iana" },
  "application/vnd.powerbuilder75": { source: "iana" },
  "application/vnd.powerbuilder75-s": { source: "iana" },
  "application/vnd.preminet": { source: "iana" },
  "application/vnd.previewsystems.box": { source: "iana", extensions: ["box"] },
  "application/vnd.proteus.magazine": { source: "iana", extensions: ["mgz"] },
  "application/vnd.psfs": { source: "iana" },
  "application/vnd.publishare-delta-tree": { source: "iana", extensions: ["qps"] },
  "application/vnd.pvi.ptid1": { source: "iana", extensions: ["ptid"] },
  "application/vnd.pwg-multiplexed": { source: "iana" },
  "application/vnd.pwg-xhtml-print+xml": { source: "iana", compressible: !0 },
  "application/vnd.qualcomm.brew-app-res": { source: "iana" },
  "application/vnd.quarantainenet": { source: "iana" },
  "application/vnd.quark.quarkxpress": { source: "iana", extensions: ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"] },
  "application/vnd.quobject-quoxdocument": { source: "iana" },
  "application/vnd.radisys.moml+xml": { source: "iana", compressible: !0 },
  "application/vnd.radisys.msml+xml": { source: "iana", compressible: !0 },
  "application/vnd.radisys.msml-audit+xml": { source: "iana", compressible: !0 },
  "application/vnd.radisys.msml-audit-conf+xml": { source: "iana", compressible: !0 },
  "application/vnd.radisys.msml-audit-conn+xml": { source: "iana", compressible: !0 },
  "application/vnd.radisys.msml-audit-dialog+xml": { source: "iana", compressible: !0 },
  "application/vnd.radisys.msml-audit-stream+xml": { source: "iana", compressible: !0 },
  "application/vnd.radisys.msml-conf+xml": { source: "iana", compressible: !0 },
  "application/vnd.radisys.msml-dialog+xml": { source: "iana", compressible: !0 },
  "application/vnd.radisys.msml-dialog-base+xml": { source: "iana", compressible: !0 },
  "application/vnd.radisys.msml-dialog-fax-detect+xml": { source: "iana", compressible: !0 },
  "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { source: "iana", compressible: !0 },
  "application/vnd.radisys.msml-dialog-group+xml": { source: "iana", compressible: !0 },
  "application/vnd.radisys.msml-dialog-speech+xml": { source: "iana", compressible: !0 },
  "application/vnd.radisys.msml-dialog-transform+xml": { source: "iana", compressible: !0 },
  "application/vnd.rainstor.data": { source: "iana" },
  "application/vnd.rapid": { source: "iana" },
  "application/vnd.rar": { source: "iana", extensions: ["rar"] },
  "application/vnd.realvnc.bed": { source: "iana", extensions: ["bed"] },
  "application/vnd.recordare.musicxml": { source: "iana", extensions: ["mxl"] },
  "application/vnd.recordare.musicxml+xml": { source: "iana", compressible: !0, extensions: ["musicxml"] },
  "application/vnd.renlearn.rlprint": { source: "iana" },
  "application/vnd.resilient.logic": { source: "iana" },
  "application/vnd.restful+json": { source: "iana", compressible: !0 },
  "application/vnd.rig.cryptonote": { source: "iana", extensions: ["cryptonote"] },
  "application/vnd.rim.cod": { source: "apache", extensions: ["cod"] },
  "application/vnd.rn-realmedia": { source: "apache", extensions: ["rm"] },
  "application/vnd.rn-realmedia-vbr": { source: "apache", extensions: ["rmvb"] },
  "application/vnd.route66.link66+xml": { source: "iana", compressible: !0, extensions: ["link66"] },
  "application/vnd.rs-274x": { source: "iana" },
  "application/vnd.ruckus.download": { source: "iana" },
  "application/vnd.s3sms": { source: "iana" },
  "application/vnd.sailingtracker.track": { source: "iana", extensions: ["st"] },
  "application/vnd.sar": { source: "iana" },
  "application/vnd.sbm.cid": { source: "iana" },
  "application/vnd.sbm.mid2": { source: "iana" },
  "application/vnd.scribus": { source: "iana" },
  "application/vnd.sealed.3df": { source: "iana" },
  "application/vnd.sealed.csf": { source: "iana" },
  "application/vnd.sealed.doc": { source: "iana" },
  "application/vnd.sealed.eml": { source: "iana" },
  "application/vnd.sealed.mht": { source: "iana" },
  "application/vnd.sealed.net": { source: "iana" },
  "application/vnd.sealed.ppt": { source: "iana" },
  "application/vnd.sealed.tiff": { source: "iana" },
  "application/vnd.sealed.xls": { source: "iana" },
  "application/vnd.sealedmedia.softseal.html": { source: "iana" },
  "application/vnd.sealedmedia.softseal.pdf": { source: "iana" },
  "application/vnd.seemail": { source: "iana", extensions: ["see"] },
  "application/vnd.seis+json": { source: "iana", compressible: !0 },
  "application/vnd.sema": { source: "iana", extensions: ["sema"] },
  "application/vnd.semd": { source: "iana", extensions: ["semd"] },
  "application/vnd.semf": { source: "iana", extensions: ["semf"] },
  "application/vnd.shade-save-file": { source: "iana" },
  "application/vnd.shana.informed.formdata": { source: "iana", extensions: ["ifm"] },
  "application/vnd.shana.informed.formtemplate": { source: "iana", extensions: ["itp"] },
  "application/vnd.shana.informed.interchange": { source: "iana", extensions: ["iif"] },
  "application/vnd.shana.informed.package": { source: "iana", extensions: ["ipk"] },
  "application/vnd.shootproof+json": { source: "iana", compressible: !0 },
  "application/vnd.shopkick+json": { source: "iana", compressible: !0 },
  "application/vnd.shp": { source: "iana" },
  "application/vnd.shx": { source: "iana" },
  "application/vnd.sigrok.session": { source: "iana" },
  "application/vnd.simtech-mindmapper": { source: "iana", extensions: ["twd", "twds"] },
  "application/vnd.siren+json": { source: "iana", compressible: !0 },
  "application/vnd.smaf": { source: "iana", extensions: ["mmf"] },
  "application/vnd.smart.notebook": { source: "iana" },
  "application/vnd.smart.teacher": { source: "iana", extensions: ["teacher"] },
  "application/vnd.snesdev-page-table": { source: "iana" },
  "application/vnd.software602.filler.form+xml": { source: "iana", compressible: !0, extensions: ["fo"] },
  "application/vnd.software602.filler.form-xml-zip": { source: "iana" },
  "application/vnd.solent.sdkm+xml": { source: "iana", compressible: !0, extensions: ["sdkm", "sdkd"] },
  "application/vnd.spotfire.dxp": { source: "iana", extensions: ["dxp"] },
  "application/vnd.spotfire.sfs": { source: "iana", extensions: ["sfs"] },
  "application/vnd.sqlite3": { source: "iana" },
  "application/vnd.sss-cod": { source: "iana" },
  "application/vnd.sss-dtf": { source: "iana" },
  "application/vnd.sss-ntf": { source: "iana" },
  "application/vnd.stardivision.calc": { source: "apache", extensions: ["sdc"] },
  "application/vnd.stardivision.draw": { source: "apache", extensions: ["sda"] },
  "application/vnd.stardivision.impress": { source: "apache", extensions: ["sdd"] },
  "application/vnd.stardivision.math": { source: "apache", extensions: ["smf"] },
  "application/vnd.stardivision.writer": { source: "apache", extensions: ["sdw", "vor"] },
  "application/vnd.stardivision.writer-global": { source: "apache", extensions: ["sgl"] },
  "application/vnd.stepmania.package": { source: "iana", extensions: ["smzip"] },
  "application/vnd.stepmania.stepchart": { source: "iana", extensions: ["sm"] },
  "application/vnd.street-stream": { source: "iana" },
  "application/vnd.sun.wadl+xml": { source: "iana", compressible: !0, extensions: ["wadl"] },
  "application/vnd.sun.xml.calc": { source: "apache", extensions: ["sxc"] },
  "application/vnd.sun.xml.calc.template": { source: "apache", extensions: ["stc"] },
  "application/vnd.sun.xml.draw": { source: "apache", extensions: ["sxd"] },
  "application/vnd.sun.xml.draw.template": { source: "apache", extensions: ["std"] },
  "application/vnd.sun.xml.impress": { source: "apache", extensions: ["sxi"] },
  "application/vnd.sun.xml.impress.template": { source: "apache", extensions: ["sti"] },
  "application/vnd.sun.xml.math": { source: "apache", extensions: ["sxm"] },
  "application/vnd.sun.xml.writer": { source: "apache", extensions: ["sxw"] },
  "application/vnd.sun.xml.writer.global": { source: "apache", extensions: ["sxg"] },
  "application/vnd.sun.xml.writer.template": { source: "apache", extensions: ["stw"] },
  "application/vnd.sus-calendar": { source: "iana", extensions: ["sus", "susp"] },
  "application/vnd.svd": { source: "iana", extensions: ["svd"] },
  "application/vnd.swiftview-ics": { source: "iana" },
  "application/vnd.sycle+xml": { source: "iana", compressible: !0 },
  "application/vnd.syft+json": { source: "iana", compressible: !0 },
  "application/vnd.symbian.install": { source: "apache", extensions: ["sis", "sisx"] },
  "application/vnd.syncml+xml": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["xsm"] },
  "application/vnd.syncml.dm+wbxml": { source: "iana", charset: "UTF-8", extensions: ["bdm"] },
  "application/vnd.syncml.dm+xml": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["xdm"] },
  "application/vnd.syncml.dm.notification": { source: "iana" },
  "application/vnd.syncml.dmddf+wbxml": { source: "iana" },
  "application/vnd.syncml.dmddf+xml": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["ddf"] },
  "application/vnd.syncml.dmtnds+wbxml": { source: "iana" },
  "application/vnd.syncml.dmtnds+xml": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/vnd.syncml.ds.notification": { source: "iana" },
  "application/vnd.tableschema+json": { source: "iana", compressible: !0 },
  "application/vnd.tao.intent-module-archive": { source: "iana", extensions: ["tao"] },
  "application/vnd.tcpdump.pcap": { source: "iana", extensions: ["pcap", "cap", "dmp"] },
  "application/vnd.think-cell.ppttc+json": { source: "iana", compressible: !0 },
  "application/vnd.tmd.mediaflex.api+xml": { source: "iana", compressible: !0 },
  "application/vnd.tml": { source: "iana" },
  "application/vnd.tmobile-livetv": { source: "iana", extensions: ["tmo"] },
  "application/vnd.tri.onesource": { source: "iana" },
  "application/vnd.trid.tpt": { source: "iana", extensions: ["tpt"] },
  "application/vnd.triscape.mxs": { source: "iana", extensions: ["mxs"] },
  "application/vnd.trueapp": { source: "iana", extensions: ["tra"] },
  "application/vnd.truedoc": { source: "iana" },
  "application/vnd.ubisoft.webplayer": { source: "iana" },
  "application/vnd.ufdl": { source: "iana", extensions: ["ufd", "ufdl"] },
  "application/vnd.uiq.theme": { source: "iana", extensions: ["utz"] },
  "application/vnd.umajin": { source: "iana", extensions: ["umj"] },
  "application/vnd.unity": { source: "iana", extensions: ["unityweb"] },
  "application/vnd.uoml+xml": { source: "iana", compressible: !0, extensions: ["uoml"] },
  "application/vnd.uplanet.alert": { source: "iana" },
  "application/vnd.uplanet.alert-wbxml": { source: "iana" },
  "application/vnd.uplanet.bearer-choice": { source: "iana" },
  "application/vnd.uplanet.bearer-choice-wbxml": { source: "iana" },
  "application/vnd.uplanet.cacheop": { source: "iana" },
  "application/vnd.uplanet.cacheop-wbxml": { source: "iana" },
  "application/vnd.uplanet.channel": { source: "iana" },
  "application/vnd.uplanet.channel-wbxml": { source: "iana" },
  "application/vnd.uplanet.list": { source: "iana" },
  "application/vnd.uplanet.list-wbxml": { source: "iana" },
  "application/vnd.uplanet.listcmd": { source: "iana" },
  "application/vnd.uplanet.listcmd-wbxml": { source: "iana" },
  "application/vnd.uplanet.signal": { source: "iana" },
  "application/vnd.uri-map": { source: "iana" },
  "application/vnd.valve.source.material": { source: "iana" },
  "application/vnd.vcx": { source: "iana", extensions: ["vcx"] },
  "application/vnd.vd-study": { source: "iana" },
  "application/vnd.vectorworks": { source: "iana" },
  "application/vnd.vel+json": { source: "iana", compressible: !0 },
  "application/vnd.verimatrix.vcas": { source: "iana" },
  "application/vnd.veritone.aion+json": { source: "iana", compressible: !0 },
  "application/vnd.veryant.thin": { source: "iana" },
  "application/vnd.ves.encrypted": { source: "iana" },
  "application/vnd.vidsoft.vidconference": { source: "iana" },
  "application/vnd.visio": { source: "iana", extensions: ["vsd", "vst", "vss", "vsw"] },
  "application/vnd.visionary": { source: "iana", extensions: ["vis"] },
  "application/vnd.vividence.scriptfile": { source: "iana" },
  "application/vnd.vsf": { source: "iana", extensions: ["vsf"] },
  "application/vnd.wap.sic": { source: "iana" },
  "application/vnd.wap.slc": { source: "iana" },
  "application/vnd.wap.wbxml": { source: "iana", charset: "UTF-8", extensions: ["wbxml"] },
  "application/vnd.wap.wmlc": { source: "iana", extensions: ["wmlc"] },
  "application/vnd.wap.wmlscriptc": { source: "iana", extensions: ["wmlsc"] },
  "application/vnd.webturbo": { source: "iana", extensions: ["wtb"] },
  "application/vnd.wfa.dpp": { source: "iana" },
  "application/vnd.wfa.p2p": { source: "iana" },
  "application/vnd.wfa.wsc": { source: "iana" },
  "application/vnd.windows.devicepairing": { source: "iana" },
  "application/vnd.wmc": { source: "iana" },
  "application/vnd.wmf.bootstrap": { source: "iana" },
  "application/vnd.wolfram.mathematica": { source: "iana" },
  "application/vnd.wolfram.mathematica.package": { source: "iana" },
  "application/vnd.wolfram.player": { source: "iana", extensions: ["nbp"] },
  "application/vnd.wordperfect": { source: "iana", extensions: ["wpd"] },
  "application/vnd.wqd": { source: "iana", extensions: ["wqd"] },
  "application/vnd.wrq-hp3000-labelled": { source: "iana" },
  "application/vnd.wt.stf": { source: "iana", extensions: ["stf"] },
  "application/vnd.wv.csp+wbxml": { source: "iana" },
  "application/vnd.wv.csp+xml": { source: "iana", compressible: !0 },
  "application/vnd.wv.ssp+xml": { source: "iana", compressible: !0 },
  "application/vnd.xacml+json": { source: "iana", compressible: !0 },
  "application/vnd.xara": { source: "iana", extensions: ["xar"] },
  "application/vnd.xfdl": { source: "iana", extensions: ["xfdl"] },
  "application/vnd.xfdl.webform": { source: "iana" },
  "application/vnd.xmi+xml": { source: "iana", compressible: !0 },
  "application/vnd.xmpie.cpkg": { source: "iana" },
  "application/vnd.xmpie.dpkg": { source: "iana" },
  "application/vnd.xmpie.plan": { source: "iana" },
  "application/vnd.xmpie.ppkg": { source: "iana" },
  "application/vnd.xmpie.xlim": { source: "iana" },
  "application/vnd.yamaha.hv-dic": { source: "iana", extensions: ["hvd"] },
  "application/vnd.yamaha.hv-script": { source: "iana", extensions: ["hvs"] },
  "application/vnd.yamaha.hv-voice": { source: "iana", extensions: ["hvp"] },
  "application/vnd.yamaha.openscoreformat": { source: "iana", extensions: ["osf"] },
  "application/vnd.yamaha.openscoreformat.osfpvg+xml": { source: "iana", compressible: !0, extensions: ["osfpvg"] },
  "application/vnd.yamaha.remote-setup": { source: "iana" },
  "application/vnd.yamaha.smaf-audio": { source: "iana", extensions: ["saf"] },
  "application/vnd.yamaha.smaf-phrase": { source: "iana", extensions: ["spf"] },
  "application/vnd.yamaha.through-ngn": { source: "iana" },
  "application/vnd.yamaha.tunnel-udpencap": { source: "iana" },
  "application/vnd.yaoweme": { source: "iana" },
  "application/vnd.yellowriver-custom-menu": { source: "iana", extensions: ["cmp"] },
  "application/vnd.youtube.yt": { source: "iana" },
  "application/vnd.zul": { source: "iana", extensions: ["zir", "zirz"] },
  "application/vnd.zzazz.deck+xml": { source: "iana", compressible: !0, extensions: ["zaz"] },
  "application/voicexml+xml": { source: "iana", compressible: !0, extensions: ["vxml"] },
  "application/voucher-cms+json": { source: "iana", compressible: !0 },
  "application/vq-rtcpxr": { source: "iana" },
  "application/wasm": { source: "iana", compressible: !0, extensions: ["wasm"] },
  "application/watcherinfo+xml": { source: "iana", compressible: !0, extensions: ["wif"] },
  "application/webpush-options+json": { source: "iana", compressible: !0 },
  "application/whoispp-query": { source: "iana" },
  "application/whoispp-response": { source: "iana" },
  "application/widget": { source: "iana", extensions: ["wgt"] },
  "application/winhlp": { source: "apache", extensions: ["hlp"] },
  "application/wita": { source: "iana" },
  "application/wordperfect5.1": { source: "iana" },
  "application/wsdl+xml": { source: "iana", compressible: !0, extensions: ["wsdl"] },
  "application/wspolicy+xml": { source: "iana", compressible: !0, extensions: ["wspolicy"] },
  "application/x-7z-compressed": { source: "apache", compressible: !1, extensions: ["7z"] },
  "application/x-abiword": { source: "apache", extensions: ["abw"] },
  "application/x-ace-compressed": { source: "apache", extensions: ["ace"] },
  "application/x-amf": { source: "apache" },
  "application/x-apple-diskimage": { source: "apache", extensions: ["dmg"] },
  "application/x-arj": { compressible: !1, extensions: ["arj"] },
  "application/x-authorware-bin": { source: "apache", extensions: ["aab", "x32", "u32", "vox"] },
  "application/x-authorware-map": { source: "apache", extensions: ["aam"] },
  "application/x-authorware-seg": { source: "apache", extensions: ["aas"] },
  "application/x-bcpio": { source: "apache", extensions: ["bcpio"] },
  "application/x-bdoc": { compressible: !1, extensions: ["bdoc"] },
  "application/x-bittorrent": { source: "apache", extensions: ["torrent"] },
  "application/x-blorb": { source: "apache", extensions: ["blb", "blorb"] },
  "application/x-bzip": { source: "apache", compressible: !1, extensions: ["bz"] },
  "application/x-bzip2": { source: "apache", compressible: !1, extensions: ["bz2", "boz"] },
  "application/x-cbr": { source: "apache", extensions: ["cbr", "cba", "cbt", "cbz", "cb7"] },
  "application/x-cdlink": { source: "apache", extensions: ["vcd"] },
  "application/x-cfs-compressed": { source: "apache", extensions: ["cfs"] },
  "application/x-chat": { source: "apache", extensions: ["chat"] },
  "application/x-chess-pgn": { source: "apache", extensions: ["pgn"] },
  "application/x-chrome-extension": { extensions: ["crx"] },
  "application/x-cocoa": { source: "nginx", extensions: ["cco"] },
  "application/x-compress": { source: "apache" },
  "application/x-conference": { source: "apache", extensions: ["nsc"] },
  "application/x-cpio": { source: "apache", extensions: ["cpio"] },
  "application/x-csh": { source: "apache", extensions: ["csh"] },
  "application/x-deb": { compressible: !1 },
  "application/x-debian-package": { source: "apache", extensions: ["deb", "udeb"] },
  "application/x-dgc-compressed": { source: "apache", extensions: ["dgc"] },
  "application/x-director": { source: "apache", extensions: ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"] },
  "application/x-doom": { source: "apache", extensions: ["wad"] },
  "application/x-dtbncx+xml": { source: "apache", compressible: !0, extensions: ["ncx"] },
  "application/x-dtbook+xml": { source: "apache", compressible: !0, extensions: ["dtb"] },
  "application/x-dtbresource+xml": { source: "apache", compressible: !0, extensions: ["res"] },
  "application/x-dvi": { source: "apache", compressible: !1, extensions: ["dvi"] },
  "application/x-envoy": { source: "apache", extensions: ["evy"] },
  "application/x-eva": { source: "apache", extensions: ["eva"] },
  "application/x-font-bdf": { source: "apache", extensions: ["bdf"] },
  "application/x-font-dos": { source: "apache" },
  "application/x-font-framemaker": { source: "apache" },
  "application/x-font-ghostscript": { source: "apache", extensions: ["gsf"] },
  "application/x-font-libgrx": { source: "apache" },
  "application/x-font-linux-psf": { source: "apache", extensions: ["psf"] },
  "application/x-font-pcf": { source: "apache", extensions: ["pcf"] },
  "application/x-font-snf": { source: "apache", extensions: ["snf"] },
  "application/x-font-speedo": { source: "apache" },
  "application/x-font-sunos-news": { source: "apache" },
  "application/x-font-type1": { source: "apache", extensions: ["pfa", "pfb", "pfm", "afm"] },
  "application/x-font-vfont": { source: "apache" },
  "application/x-freearc": { source: "apache", extensions: ["arc"] },
  "application/x-futuresplash": { source: "apache", extensions: ["spl"] },
  "application/x-gca-compressed": { source: "apache", extensions: ["gca"] },
  "application/x-glulx": { source: "apache", extensions: ["ulx"] },
  "application/x-gnumeric": { source: "apache", extensions: ["gnumeric"] },
  "application/x-gramps-xml": { source: "apache", extensions: ["gramps"] },
  "application/x-gtar": { source: "apache", extensions: ["gtar"] },
  "application/x-gzip": { source: "apache" },
  "application/x-hdf": { source: "apache", extensions: ["hdf"] },
  "application/x-httpd-php": { compressible: !0, extensions: ["php"] },
  "application/x-install-instructions": { source: "apache", extensions: ["install"] },
  "application/x-iso9660-image": { source: "apache", extensions: ["iso"] },
  "application/x-iwork-keynote-sffkey": { extensions: ["key"] },
  "application/x-iwork-numbers-sffnumbers": { extensions: ["numbers"] },
  "application/x-iwork-pages-sffpages": { extensions: ["pages"] },
  "application/x-java-archive-diff": { source: "nginx", extensions: ["jardiff"] },
  "application/x-java-jnlp-file": { source: "apache", compressible: !1, extensions: ["jnlp"] },
  "application/x-javascript": { compressible: !0 },
  "application/x-keepass2": { extensions: ["kdbx"] },
  "application/x-latex": { source: "apache", compressible: !1, extensions: ["latex"] },
  "application/x-lua-bytecode": { extensions: ["luac"] },
  "application/x-lzh-compressed": { source: "apache", extensions: ["lzh", "lha"] },
  "application/x-makeself": { source: "nginx", extensions: ["run"] },
  "application/x-mie": { source: "apache", extensions: ["mie"] },
  "application/x-mobipocket-ebook": { source: "apache", extensions: ["prc", "mobi"] },
  "application/x-mpegurl": { compressible: !1 },
  "application/x-ms-application": { source: "apache", extensions: ["application"] },
  "application/x-ms-shortcut": { source: "apache", extensions: ["lnk"] },
  "application/x-ms-wmd": { source: "apache", extensions: ["wmd"] },
  "application/x-ms-wmz": { source: "apache", extensions: ["wmz"] },
  "application/x-ms-xbap": { source: "apache", extensions: ["xbap"] },
  "application/x-msaccess": { source: "apache", extensions: ["mdb"] },
  "application/x-msbinder": { source: "apache", extensions: ["obd"] },
  "application/x-mscardfile": { source: "apache", extensions: ["crd"] },
  "application/x-msclip": { source: "apache", extensions: ["clp"] },
  "application/x-msdos-program": { extensions: ["exe"] },
  "application/x-msdownload": { source: "apache", extensions: ["exe", "dll", "com", "bat", "msi"] },
  "application/x-msmediaview": { source: "apache", extensions: ["mvb", "m13", "m14"] },
  "application/x-msmetafile": { source: "apache", extensions: ["wmf", "wmz", "emf", "emz"] },
  "application/x-msmoney": { source: "apache", extensions: ["mny"] },
  "application/x-mspublisher": { source: "apache", extensions: ["pub"] },
  "application/x-msschedule": { source: "apache", extensions: ["scd"] },
  "application/x-msterminal": { source: "apache", extensions: ["trm"] },
  "application/x-mswrite": { source: "apache", extensions: ["wri"] },
  "application/x-netcdf": { source: "apache", extensions: ["nc", "cdf"] },
  "application/x-ns-proxy-autoconfig": { compressible: !0, extensions: ["pac"] },
  "application/x-nzb": { source: "apache", extensions: ["nzb"] },
  "application/x-perl": { source: "nginx", extensions: ["pl", "pm"] },
  "application/x-pilot": { source: "nginx", extensions: ["prc", "pdb"] },
  "application/x-pkcs12": { source: "apache", compressible: !1, extensions: ["p12", "pfx"] },
  "application/x-pkcs7-certificates": { source: "apache", extensions: ["p7b", "spc"] },
  "application/x-pkcs7-certreqresp": { source: "apache", extensions: ["p7r"] },
  "application/x-pki-message": { source: "iana" },
  "application/x-rar-compressed": { source: "apache", compressible: !1, extensions: ["rar"] },
  "application/x-redhat-package-manager": { source: "nginx", extensions: ["rpm"] },
  "application/x-research-info-systems": { source: "apache", extensions: ["ris"] },
  "application/x-sea": { source: "nginx", extensions: ["sea"] },
  "application/x-sh": { source: "apache", compressible: !0, extensions: ["sh"] },
  "application/x-shar": { source: "apache", extensions: ["shar"] },
  "application/x-shockwave-flash": { source: "apache", compressible: !1, extensions: ["swf"] },
  "application/x-silverlight-app": { source: "apache", extensions: ["xap"] },
  "application/x-sql": { source: "apache", extensions: ["sql"] },
  "application/x-stuffit": { source: "apache", compressible: !1, extensions: ["sit"] },
  "application/x-stuffitx": { source: "apache", extensions: ["sitx"] },
  "application/x-subrip": { source: "apache", extensions: ["srt"] },
  "application/x-sv4cpio": { source: "apache", extensions: ["sv4cpio"] },
  "application/x-sv4crc": { source: "apache", extensions: ["sv4crc"] },
  "application/x-t3vm-image": { source: "apache", extensions: ["t3"] },
  "application/x-tads": { source: "apache", extensions: ["gam"] },
  "application/x-tar": { source: "apache", compressible: !0, extensions: ["tar"] },
  "application/x-tcl": { source: "apache", extensions: ["tcl", "tk"] },
  "application/x-tex": { source: "apache", extensions: ["tex"] },
  "application/x-tex-tfm": { source: "apache", extensions: ["tfm"] },
  "application/x-texinfo": { source: "apache", extensions: ["texinfo", "texi"] },
  "application/x-tgif": { source: "apache", extensions: ["obj"] },
  "application/x-ustar": { source: "apache", extensions: ["ustar"] },
  "application/x-virtualbox-hdd": { compressible: !0, extensions: ["hdd"] },
  "application/x-virtualbox-ova": { compressible: !0, extensions: ["ova"] },
  "application/x-virtualbox-ovf": { compressible: !0, extensions: ["ovf"] },
  "application/x-virtualbox-vbox": { compressible: !0, extensions: ["vbox"] },
  "application/x-virtualbox-vbox-extpack": { compressible: !1, extensions: ["vbox-extpack"] },
  "application/x-virtualbox-vdi": { compressible: !0, extensions: ["vdi"] },
  "application/x-virtualbox-vhd": { compressible: !0, extensions: ["vhd"] },
  "application/x-virtualbox-vmdk": { compressible: !0, extensions: ["vmdk"] },
  "application/x-wais-source": { source: "apache", extensions: ["src"] },
  "application/x-web-app-manifest+json": { compressible: !0, extensions: ["webapp"] },
  "application/x-www-form-urlencoded": { source: "iana", compressible: !0 },
  "application/x-x509-ca-cert": { source: "iana", extensions: ["der", "crt", "pem"] },
  "application/x-x509-ca-ra-cert": { source: "iana" },
  "application/x-x509-next-ca-cert": { source: "iana" },
  "application/x-xfig": { source: "apache", extensions: ["fig"] },
  "application/x-xliff+xml": { source: "apache", compressible: !0, extensions: ["xlf"] },
  "application/x-xpinstall": { source: "apache", compressible: !1, extensions: ["xpi"] },
  "application/x-xz": { source: "apache", extensions: ["xz"] },
  "application/x-zmachine": { source: "apache", extensions: ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"] },
  "application/x400-bp": { source: "iana" },
  "application/xacml+xml": { source: "iana", compressible: !0 },
  "application/xaml+xml": { source: "apache", compressible: !0, extensions: ["xaml"] },
  "application/xcap-att+xml": { source: "iana", compressible: !0, extensions: ["xav"] },
  "application/xcap-caps+xml": { source: "iana", compressible: !0, extensions: ["xca"] },
  "application/xcap-diff+xml": { source: "iana", compressible: !0, extensions: ["xdf"] },
  "application/xcap-el+xml": { source: "iana", compressible: !0, extensions: ["xel"] },
  "application/xcap-error+xml": { source: "iana", compressible: !0 },
  "application/xcap-ns+xml": { source: "iana", compressible: !0, extensions: ["xns"] },
  "application/xcon-conference-info+xml": { source: "iana", compressible: !0 },
  "application/xcon-conference-info-diff+xml": { source: "iana", compressible: !0 },
  "application/xenc+xml": { source: "iana", compressible: !0, extensions: ["xenc"] },
  "application/xhtml+xml": { source: "iana", compressible: !0, extensions: ["xhtml", "xht"] },
  "application/xhtml-voice+xml": { source: "apache", compressible: !0 },
  "application/xliff+xml": { source: "iana", compressible: !0, extensions: ["xlf"] },
  "application/xml": { source: "iana", compressible: !0, extensions: ["xml", "xsl", "xsd", "rng"] },
  "application/xml-dtd": { source: "iana", compressible: !0, extensions: ["dtd"] },
  "application/xml-external-parsed-entity": { source: "iana" },
  "application/xml-patch+xml": { source: "iana", compressible: !0 },
  "application/xmpp+xml": { source: "iana", compressible: !0 },
  "application/xop+xml": { source: "iana", compressible: !0, extensions: ["xop"] },
  "application/xproc+xml": { source: "apache", compressible: !0, extensions: ["xpl"] },
  "application/xslt+xml": { source: "iana", compressible: !0, extensions: ["xsl", "xslt"] },
  "application/xspf+xml": { source: "apache", compressible: !0, extensions: ["xspf"] },
  "application/xv+xml": { source: "iana", compressible: !0, extensions: ["mxml", "xhvml", "xvml", "xvm"] },
  "application/yang": { source: "iana", extensions: ["yang"] },
  "application/yang-data+json": { source: "iana", compressible: !0 },
  "application/yang-data+xml": { source: "iana", compressible: !0 },
  "application/yang-patch+json": { source: "iana", compressible: !0 },
  "application/yang-patch+xml": { source: "iana", compressible: !0 },
  "application/yin+xml": { source: "iana", compressible: !0, extensions: ["yin"] },
  "application/zip": { source: "iana", compressible: !1, extensions: ["zip"] },
  "application/zlib": { source: "iana" },
  "application/zstd": { source: "iana" },
  "audio/1d-interleaved-parityfec": { source: "iana" },
  "audio/32kadpcm": { source: "iana" },
  "audio/3gpp": { source: "iana", compressible: !1, extensions: ["3gpp"] },
  "audio/3gpp2": { source: "iana" },
  "audio/aac": { source: "iana" },
  "audio/ac3": { source: "iana" },
  "audio/adpcm": { source: "apache", extensions: ["adp"] },
  "audio/amr": { source: "iana", extensions: ["amr"] },
  "audio/amr-wb": { source: "iana" },
  "audio/amr-wb+": { source: "iana" },
  "audio/aptx": { source: "iana" },
  "audio/asc": { source: "iana" },
  "audio/atrac-advanced-lossless": { source: "iana" },
  "audio/atrac-x": { source: "iana" },
  "audio/atrac3": { source: "iana" },
  "audio/basic": { source: "iana", compressible: !1, extensions: ["au", "snd"] },
  "audio/bv16": { source: "iana" },
  "audio/bv32": { source: "iana" },
  "audio/clearmode": { source: "iana" },
  "audio/cn": { source: "iana" },
  "audio/dat12": { source: "iana" },
  "audio/dls": { source: "iana" },
  "audio/dsr-es201108": { source: "iana" },
  "audio/dsr-es202050": { source: "iana" },
  "audio/dsr-es202211": { source: "iana" },
  "audio/dsr-es202212": { source: "iana" },
  "audio/dv": { source: "iana" },
  "audio/dvi4": { source: "iana" },
  "audio/eac3": { source: "iana" },
  "audio/encaprtp": { source: "iana" },
  "audio/evrc": { source: "iana" },
  "audio/evrc-qcp": { source: "iana" },
  "audio/evrc0": { source: "iana" },
  "audio/evrc1": { source: "iana" },
  "audio/evrcb": { source: "iana" },
  "audio/evrcb0": { source: "iana" },
  "audio/evrcb1": { source: "iana" },
  "audio/evrcnw": { source: "iana" },
  "audio/evrcnw0": { source: "iana" },
  "audio/evrcnw1": { source: "iana" },
  "audio/evrcwb": { source: "iana" },
  "audio/evrcwb0": { source: "iana" },
  "audio/evrcwb1": { source: "iana" },
  "audio/evs": { source: "iana" },
  "audio/flexfec": { source: "iana" },
  "audio/fwdred": { source: "iana" },
  "audio/g711-0": { source: "iana" },
  "audio/g719": { source: "iana" },
  "audio/g722": { source: "iana" },
  "audio/g7221": { source: "iana" },
  "audio/g723": { source: "iana" },
  "audio/g726-16": { source: "iana" },
  "audio/g726-24": { source: "iana" },
  "audio/g726-32": { source: "iana" },
  "audio/g726-40": { source: "iana" },
  "audio/g728": { source: "iana" },
  "audio/g729": { source: "iana" },
  "audio/g7291": { source: "iana" },
  "audio/g729d": { source: "iana" },
  "audio/g729e": { source: "iana" },
  "audio/gsm": { source: "iana" },
  "audio/gsm-efr": { source: "iana" },
  "audio/gsm-hr-08": { source: "iana" },
  "audio/ilbc": { source: "iana" },
  "audio/ip-mr_v2.5": { source: "iana" },
  "audio/isac": { source: "apache" },
  "audio/l16": { source: "iana" },
  "audio/l20": { source: "iana" },
  "audio/l24": { source: "iana", compressible: !1 },
  "audio/l8": { source: "iana" },
  "audio/lpc": { source: "iana" },
  "audio/melp": { source: "iana" },
  "audio/melp1200": { source: "iana" },
  "audio/melp2400": { source: "iana" },
  "audio/melp600": { source: "iana" },
  "audio/mhas": { source: "iana" },
  "audio/midi": { source: "apache", extensions: ["mid", "midi", "kar", "rmi"] },
  "audio/mobile-xmf": { source: "iana", extensions: ["mxmf"] },
  "audio/mp3": { compressible: !1, extensions: ["mp3"] },
  "audio/mp4": { source: "iana", compressible: !1, extensions: ["m4a", "mp4a"] },
  "audio/mp4a-latm": { source: "iana" },
  "audio/mpa": { source: "iana" },
  "audio/mpa-robust": { source: "iana" },
  "audio/mpeg": { source: "iana", compressible: !1, extensions: ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"] },
  "audio/mpeg4-generic": { source: "iana" },
  "audio/musepack": { source: "apache" },
  "audio/ogg": { source: "iana", compressible: !1, extensions: ["oga", "ogg", "spx", "opus"] },
  "audio/opus": { source: "iana" },
  "audio/parityfec": { source: "iana" },
  "audio/pcma": { source: "iana" },
  "audio/pcma-wb": { source: "iana" },
  "audio/pcmu": { source: "iana" },
  "audio/pcmu-wb": { source: "iana" },
  "audio/prs.sid": { source: "iana" },
  "audio/qcelp": { source: "iana" },
  "audio/raptorfec": { source: "iana" },
  "audio/red": { source: "iana" },
  "audio/rtp-enc-aescm128": { source: "iana" },
  "audio/rtp-midi": { source: "iana" },
  "audio/rtploopback": { source: "iana" },
  "audio/rtx": { source: "iana" },
  "audio/s3m": { source: "apache", extensions: ["s3m"] },
  "audio/scip": { source: "iana" },
  "audio/silk": { source: "apache", extensions: ["sil"] },
  "audio/smv": { source: "iana" },
  "audio/smv-qcp": { source: "iana" },
  "audio/smv0": { source: "iana" },
  "audio/sofa": { source: "iana" },
  "audio/sp-midi": { source: "iana" },
  "audio/speex": { source: "iana" },
  "audio/t140c": { source: "iana" },
  "audio/t38": { source: "iana" },
  "audio/telephone-event": { source: "iana" },
  "audio/tetra_acelp": { source: "iana" },
  "audio/tetra_acelp_bb": { source: "iana" },
  "audio/tone": { source: "iana" },
  "audio/tsvcis": { source: "iana" },
  "audio/uemclip": { source: "iana" },
  "audio/ulpfec": { source: "iana" },
  "audio/usac": { source: "iana" },
  "audio/vdvi": { source: "iana" },
  "audio/vmr-wb": { source: "iana" },
  "audio/vnd.3gpp.iufp": { source: "iana" },
  "audio/vnd.4sb": { source: "iana" },
  "audio/vnd.audiokoz": { source: "iana" },
  "audio/vnd.celp": { source: "iana" },
  "audio/vnd.cisco.nse": { source: "iana" },
  "audio/vnd.cmles.radio-events": { source: "iana" },
  "audio/vnd.cns.anp1": { source: "iana" },
  "audio/vnd.cns.inf1": { source: "iana" },
  "audio/vnd.dece.audio": { source: "iana", extensions: ["uva", "uvva"] },
  "audio/vnd.digital-winds": { source: "iana", extensions: ["eol"] },
  "audio/vnd.dlna.adts": { source: "iana" },
  "audio/vnd.dolby.heaac.1": { source: "iana" },
  "audio/vnd.dolby.heaac.2": { source: "iana" },
  "audio/vnd.dolby.mlp": { source: "iana" },
  "audio/vnd.dolby.mps": { source: "iana" },
  "audio/vnd.dolby.pl2": { source: "iana" },
  "audio/vnd.dolby.pl2x": { source: "iana" },
  "audio/vnd.dolby.pl2z": { source: "iana" },
  "audio/vnd.dolby.pulse.1": { source: "iana" },
  "audio/vnd.dra": { source: "iana", extensions: ["dra"] },
  "audio/vnd.dts": { source: "iana", extensions: ["dts"] },
  "audio/vnd.dts.hd": { source: "iana", extensions: ["dtshd"] },
  "audio/vnd.dts.uhd": { source: "iana" },
  "audio/vnd.dvb.file": { source: "iana" },
  "audio/vnd.everad.plj": { source: "iana" },
  "audio/vnd.hns.audio": { source: "iana" },
  "audio/vnd.lucent.voice": { source: "iana", extensions: ["lvp"] },
  "audio/vnd.ms-playready.media.pya": { source: "iana", extensions: ["pya"] },
  "audio/vnd.nokia.mobile-xmf": { source: "iana" },
  "audio/vnd.nortel.vbk": { source: "iana" },
  "audio/vnd.nuera.ecelp4800": { source: "iana", extensions: ["ecelp4800"] },
  "audio/vnd.nuera.ecelp7470": { source: "iana", extensions: ["ecelp7470"] },
  "audio/vnd.nuera.ecelp9600": { source: "iana", extensions: ["ecelp9600"] },
  "audio/vnd.octel.sbc": { source: "iana" },
  "audio/vnd.presonus.multitrack": { source: "iana" },
  "audio/vnd.qcelp": { source: "iana" },
  "audio/vnd.rhetorex.32kadpcm": { source: "iana" },
  "audio/vnd.rip": { source: "iana", extensions: ["rip"] },
  "audio/vnd.rn-realaudio": { compressible: !1 },
  "audio/vnd.sealedmedia.softseal.mpeg": { source: "iana" },
  "audio/vnd.vmx.cvsd": { source: "iana" },
  "audio/vnd.wave": { compressible: !1 },
  "audio/vorbis": { source: "iana", compressible: !1 },
  "audio/vorbis-config": { source: "iana" },
  "audio/wav": { compressible: !1, extensions: ["wav"] },
  "audio/wave": { compressible: !1, extensions: ["wav"] },
  "audio/webm": { source: "apache", compressible: !1, extensions: ["weba"] },
  "audio/x-aac": { source: "apache", compressible: !1, extensions: ["aac"] },
  "audio/x-aiff": { source: "apache", extensions: ["aif", "aiff", "aifc"] },
  "audio/x-caf": { source: "apache", compressible: !1, extensions: ["caf"] },
  "audio/x-flac": { source: "apache", extensions: ["flac"] },
  "audio/x-m4a": { source: "nginx", extensions: ["m4a"] },
  "audio/x-matroska": { source: "apache", extensions: ["mka"] },
  "audio/x-mpegurl": { source: "apache", extensions: ["m3u"] },
  "audio/x-ms-wax": { source: "apache", extensions: ["wax"] },
  "audio/x-ms-wma": { source: "apache", extensions: ["wma"] },
  "audio/x-pn-realaudio": { source: "apache", extensions: ["ram", "ra"] },
  "audio/x-pn-realaudio-plugin": { source: "apache", extensions: ["rmp"] },
  "audio/x-realaudio": { source: "nginx", extensions: ["ra"] },
  "audio/x-tta": { source: "apache" },
  "audio/x-wav": { source: "apache", extensions: ["wav"] },
  "audio/xm": { source: "apache", extensions: ["xm"] },
  "chemical/x-cdx": { source: "apache", extensions: ["cdx"] },
  "chemical/x-cif": { source: "apache", extensions: ["cif"] },
  "chemical/x-cmdf": { source: "apache", extensions: ["cmdf"] },
  "chemical/x-cml": { source: "apache", extensions: ["cml"] },
  "chemical/x-csml": { source: "apache", extensions: ["csml"] },
  "chemical/x-pdb": { source: "apache" },
  "chemical/x-xyz": { source: "apache", extensions: ["xyz"] },
  "font/collection": { source: "iana", extensions: ["ttc"] },
  "font/otf": { source: "iana", compressible: !0, extensions: ["otf"] },
  "font/sfnt": { source: "iana" },
  "font/ttf": { source: "iana", compressible: !0, extensions: ["ttf"] },
  "font/woff": { source: "iana", extensions: ["woff"] },
  "font/woff2": { source: "iana", extensions: ["woff2"] },
  "image/aces": { source: "iana", extensions: ["exr"] },
  "image/apng": { compressible: !1, extensions: ["apng"] },
  "image/avci": { source: "iana", extensions: ["avci"] },
  "image/avcs": { source: "iana", extensions: ["avcs"] },
  "image/avif": { source: "iana", compressible: !1, extensions: ["avif"] },
  "image/bmp": { source: "iana", compressible: !0, extensions: ["bmp"] },
  "image/cgm": { source: "iana", extensions: ["cgm"] },
  "image/dicom-rle": { source: "iana", extensions: ["drle"] },
  "image/emf": { source: "iana", extensions: ["emf"] },
  "image/fits": { source: "iana", extensions: ["fits"] },
  "image/g3fax": { source: "iana", extensions: ["g3"] },
  "image/gif": { source: "iana", compressible: !1, extensions: ["gif"] },
  "image/heic": { source: "iana", extensions: ["heic"] },
  "image/heic-sequence": { source: "iana", extensions: ["heics"] },
  "image/heif": { source: "iana", extensions: ["heif"] },
  "image/heif-sequence": { source: "iana", extensions: ["heifs"] },
  "image/hej2k": { source: "iana", extensions: ["hej2"] },
  "image/hsj2": { source: "iana", extensions: ["hsj2"] },
  "image/ief": { source: "iana", extensions: ["ief"] },
  "image/jls": { source: "iana", extensions: ["jls"] },
  "image/jp2": { source: "iana", compressible: !1, extensions: ["jp2", "jpg2"] },
  "image/jpeg": { source: "iana", compressible: !1, extensions: ["jpeg", "jpg", "jpe"] },
  "image/jph": { source: "iana", extensions: ["jph"] },
  "image/jphc": { source: "iana", extensions: ["jhc"] },
  "image/jpm": { source: "iana", compressible: !1, extensions: ["jpm"] },
  "image/jpx": { source: "iana", compressible: !1, extensions: ["jpx", "jpf"] },
  "image/jxr": { source: "iana", extensions: ["jxr"] },
  "image/jxra": { source: "iana", extensions: ["jxra"] },
  "image/jxrs": { source: "iana", extensions: ["jxrs"] },
  "image/jxs": { source: "iana", extensions: ["jxs"] },
  "image/jxsc": { source: "iana", extensions: ["jxsc"] },
  "image/jxsi": { source: "iana", extensions: ["jxsi"] },
  "image/jxss": { source: "iana", extensions: ["jxss"] },
  "image/ktx": { source: "iana", extensions: ["ktx"] },
  "image/ktx2": { source: "iana", extensions: ["ktx2"] },
  "image/naplps": { source: "iana" },
  "image/pjpeg": { compressible: !1 },
  "image/png": { source: "iana", compressible: !1, extensions: ["png"] },
  "image/prs.btif": { source: "iana", extensions: ["btif"] },
  "image/prs.pti": { source: "iana", extensions: ["pti"] },
  "image/pwg-raster": { source: "iana" },
  "image/sgi": { source: "apache", extensions: ["sgi"] },
  "image/svg+xml": { source: "iana", compressible: !0, extensions: ["svg", "svgz"] },
  "image/t38": { source: "iana", extensions: ["t38"] },
  "image/tiff": { source: "iana", compressible: !1, extensions: ["tif", "tiff"] },
  "image/tiff-fx": { source: "iana", extensions: ["tfx"] },
  "image/vnd.adobe.photoshop": { source: "iana", compressible: !0, extensions: ["psd"] },
  "image/vnd.airzip.accelerator.azv": { source: "iana", extensions: ["azv"] },
  "image/vnd.cns.inf2": { source: "iana" },
  "image/vnd.dece.graphic": { source: "iana", extensions: ["uvi", "uvvi", "uvg", "uvvg"] },
  "image/vnd.djvu": { source: "iana", extensions: ["djvu", "djv"] },
  "image/vnd.dvb.subtitle": { source: "iana", extensions: ["sub"] },
  "image/vnd.dwg": { source: "iana", extensions: ["dwg"] },
  "image/vnd.dxf": { source: "iana", extensions: ["dxf"] },
  "image/vnd.fastbidsheet": { source: "iana", extensions: ["fbs"] },
  "image/vnd.fpx": { source: "iana", extensions: ["fpx"] },
  "image/vnd.fst": { source: "iana", extensions: ["fst"] },
  "image/vnd.fujixerox.edmics-mmr": { source: "iana", extensions: ["mmr"] },
  "image/vnd.fujixerox.edmics-rlc": { source: "iana", extensions: ["rlc"] },
  "image/vnd.globalgraphics.pgb": { source: "iana" },
  "image/vnd.microsoft.icon": { source: "iana", compressible: !0, extensions: ["ico"] },
  "image/vnd.mix": { source: "iana" },
  "image/vnd.mozilla.apng": { source: "iana" },
  "image/vnd.ms-dds": { compressible: !0, extensions: ["dds"] },
  "image/vnd.ms-modi": { source: "iana", extensions: ["mdi"] },
  "image/vnd.ms-photo": { source: "apache", extensions: ["wdp"] },
  "image/vnd.net-fpx": { source: "iana", extensions: ["npx"] },
  "image/vnd.pco.b16": { source: "iana", extensions: ["b16"] },
  "image/vnd.radiance": { source: "iana" },
  "image/vnd.sealed.png": { source: "iana" },
  "image/vnd.sealedmedia.softseal.gif": { source: "iana" },
  "image/vnd.sealedmedia.softseal.jpg": { source: "iana" },
  "image/vnd.svf": { source: "iana" },
  "image/vnd.tencent.tap": { source: "iana", extensions: ["tap"] },
  "image/vnd.valve.source.texture": { source: "iana", extensions: ["vtf"] },
  "image/vnd.wap.wbmp": { source: "iana", extensions: ["wbmp"] },
  "image/vnd.xiff": { source: "iana", extensions: ["xif"] },
  "image/vnd.zbrush.pcx": { source: "iana", extensions: ["pcx"] },
  "image/webp": { source: "apache", extensions: ["webp"] },
  "image/wmf": { source: "iana", extensions: ["wmf"] },
  "image/x-3ds": { source: "apache", extensions: ["3ds"] },
  "image/x-cmu-raster": { source: "apache", extensions: ["ras"] },
  "image/x-cmx": { source: "apache", extensions: ["cmx"] },
  "image/x-freehand": { source: "apache", extensions: ["fh", "fhc", "fh4", "fh5", "fh7"] },
  "image/x-icon": { source: "apache", compressible: !0, extensions: ["ico"] },
  "image/x-jng": { source: "nginx", extensions: ["jng"] },
  "image/x-mrsid-image": { source: "apache", extensions: ["sid"] },
  "image/x-ms-bmp": { source: "nginx", compressible: !0, extensions: ["bmp"] },
  "image/x-pcx": { source: "apache", extensions: ["pcx"] },
  "image/x-pict": { source: "apache", extensions: ["pic", "pct"] },
  "image/x-portable-anymap": { source: "apache", extensions: ["pnm"] },
  "image/x-portable-bitmap": { source: "apache", extensions: ["pbm"] },
  "image/x-portable-graymap": { source: "apache", extensions: ["pgm"] },
  "image/x-portable-pixmap": { source: "apache", extensions: ["ppm"] },
  "image/x-rgb": { source: "apache", extensions: ["rgb"] },
  "image/x-tga": { source: "apache", extensions: ["tga"] },
  "image/x-xbitmap": { source: "apache", extensions: ["xbm"] },
  "image/x-xcf": { compressible: !1 },
  "image/x-xpixmap": { source: "apache", extensions: ["xpm"] },
  "image/x-xwindowdump": { source: "apache", extensions: ["xwd"] },
  "message/cpim": { source: "iana" },
  "message/delivery-status": { source: "iana" },
  "message/disposition-notification": { source: "iana", extensions: ["disposition-notification"] },
  "message/external-body": { source: "iana" },
  "message/feedback-report": { source: "iana" },
  "message/global": { source: "iana", extensions: ["u8msg"] },
  "message/global-delivery-status": { source: "iana", extensions: ["u8dsn"] },
  "message/global-disposition-notification": { source: "iana", extensions: ["u8mdn"] },
  "message/global-headers": { source: "iana", extensions: ["u8hdr"] },
  "message/http": { source: "iana", compressible: !1 },
  "message/imdn+xml": { source: "iana", compressible: !0 },
  "message/news": { source: "iana" },
  "message/partial": { source: "iana", compressible: !1 },
  "message/rfc822": { source: "iana", compressible: !0, extensions: ["eml", "mime"] },
  "message/s-http": { source: "iana" },
  "message/sip": { source: "iana" },
  "message/sipfrag": { source: "iana" },
  "message/tracking-status": { source: "iana" },
  "message/vnd.si.simp": { source: "iana" },
  "message/vnd.wfa.wsc": { source: "iana", extensions: ["wsc"] },
  "model/3mf": { source: "iana", extensions: ["3mf"] },
  "model/e57": { source: "iana" },
  "model/gltf+json": { source: "iana", compressible: !0, extensions: ["gltf"] },
  "model/gltf-binary": { source: "iana", compressible: !0, extensions: ["glb"] },
  "model/iges": { source: "iana", compressible: !1, extensions: ["igs", "iges"] },
  "model/mesh": { source: "iana", compressible: !1, extensions: ["msh", "mesh", "silo"] },
  "model/mtl": { source: "iana", extensions: ["mtl"] },
  "model/obj": { source: "iana", extensions: ["obj"] },
  "model/step": { source: "iana" },
  "model/step+xml": { source: "iana", compressible: !0, extensions: ["stpx"] },
  "model/step+zip": { source: "iana", compressible: !1, extensions: ["stpz"] },
  "model/step-xml+zip": { source: "iana", compressible: !1, extensions: ["stpxz"] },
  "model/stl": { source: "iana", extensions: ["stl"] },
  "model/vnd.collada+xml": { source: "iana", compressible: !0, extensions: ["dae"] },
  "model/vnd.dwf": { source: "iana", extensions: ["dwf"] },
  "model/vnd.flatland.3dml": { source: "iana" },
  "model/vnd.gdl": { source: "iana", extensions: ["gdl"] },
  "model/vnd.gs-gdl": { source: "apache" },
  "model/vnd.gs.gdl": { source: "iana" },
  "model/vnd.gtw": { source: "iana", extensions: ["gtw"] },
  "model/vnd.moml+xml": { source: "iana", compressible: !0 },
  "model/vnd.mts": { source: "iana", extensions: ["mts"] },
  "model/vnd.opengex": { source: "iana", extensions: ["ogex"] },
  "model/vnd.parasolid.transmit.binary": { source: "iana", extensions: ["x_b"] },
  "model/vnd.parasolid.transmit.text": { source: "iana", extensions: ["x_t"] },
  "model/vnd.pytha.pyox": { source: "iana" },
  "model/vnd.rosette.annotated-data-model": { source: "iana" },
  "model/vnd.sap.vds": { source: "iana", extensions: ["vds"] },
  "model/vnd.usdz+zip": { source: "iana", compressible: !1, extensions: ["usdz"] },
  "model/vnd.valve.source.compiled-map": { source: "iana", extensions: ["bsp"] },
  "model/vnd.vtu": { source: "iana", extensions: ["vtu"] },
  "model/vrml": { source: "iana", compressible: !1, extensions: ["wrl", "vrml"] },
  "model/x3d+binary": { source: "apache", compressible: !1, extensions: ["x3db", "x3dbz"] },
  "model/x3d+fastinfoset": { source: "iana", extensions: ["x3db"] },
  "model/x3d+vrml": { source: "apache", compressible: !1, extensions: ["x3dv", "x3dvz"] },
  "model/x3d+xml": { source: "iana", compressible: !0, extensions: ["x3d", "x3dz"] },
  "model/x3d-vrml": { source: "iana", extensions: ["x3dv"] },
  "multipart/alternative": { source: "iana", compressible: !1 },
  "multipart/appledouble": { source: "iana" },
  "multipart/byteranges": { source: "iana" },
  "multipart/digest": { source: "iana" },
  "multipart/encrypted": { source: "iana", compressible: !1 },
  "multipart/form-data": { source: "iana", compressible: !1 },
  "multipart/header-set": { source: "iana" },
  "multipart/mixed": { source: "iana" },
  "multipart/multilingual": { source: "iana" },
  "multipart/parallel": { source: "iana" },
  "multipart/related": { source: "iana", compressible: !1 },
  "multipart/report": { source: "iana" },
  "multipart/signed": { source: "iana", compressible: !1 },
  "multipart/vnd.bint.med-plus": { source: "iana" },
  "multipart/voice-message": { source: "iana" },
  "multipart/x-mixed-replace": { source: "iana" },
  "text/1d-interleaved-parityfec": { source: "iana" },
  "text/cache-manifest": { source: "iana", compressible: !0, extensions: ["appcache", "manifest"] },
  "text/calendar": { source: "iana", extensions: ["ics", "ifb"] },
  "text/calender": { compressible: !0 },
  "text/cmd": { compressible: !0 },
  "text/coffeescript": { extensions: ["coffee", "litcoffee"] },
  "text/cql": { source: "iana" },
  "text/cql-expression": { source: "iana" },
  "text/cql-identifier": { source: "iana" },
  "text/css": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["css"] },
  "text/csv": { source: "iana", compressible: !0, extensions: ["csv"] },
  "text/csv-schema": { source: "iana" },
  "text/directory": { source: "iana" },
  "text/dns": { source: "iana" },
  "text/ecmascript": { source: "iana" },
  "text/encaprtp": { source: "iana" },
  "text/enriched": { source: "iana" },
  "text/fhirpath": { source: "iana" },
  "text/flexfec": { source: "iana" },
  "text/fwdred": { source: "iana" },
  "text/gff3": { source: "iana" },
  "text/grammar-ref-list": { source: "iana" },
  "text/html": { source: "iana", compressible: !0, extensions: ["html", "htm", "shtml"] },
  "text/jade": { extensions: ["jade"] },
  "text/javascript": { source: "iana", compressible: !0 },
  "text/jcr-cnd": { source: "iana" },
  "text/jsx": { compressible: !0, extensions: ["jsx"] },
  "text/less": { compressible: !0, extensions: ["less"] },
  "text/markdown": { source: "iana", compressible: !0, extensions: ["markdown", "md"] },
  "text/mathml": { source: "nginx", extensions: ["mml"] },
  "text/mdx": { compressible: !0, extensions: ["mdx"] },
  "text/mizar": { source: "iana" },
  "text/n3": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["n3"] },
  "text/parameters": { source: "iana", charset: "UTF-8" },
  "text/parityfec": { source: "iana" },
  "text/plain": { source: "iana", compressible: !0, extensions: ["txt", "text", "conf", "def", "list", "log", "in", "ini"] },
  "text/provenance-notation": { source: "iana", charset: "UTF-8" },
  "text/prs.fallenstein.rst": { source: "iana" },
  "text/prs.lines.tag": { source: "iana", extensions: ["dsc"] },
  "text/prs.prop.logic": { source: "iana" },
  "text/raptorfec": { source: "iana" },
  "text/red": { source: "iana" },
  "text/rfc822-headers": { source: "iana" },
  "text/richtext": { source: "iana", compressible: !0, extensions: ["rtx"] },
  "text/rtf": { source: "iana", compressible: !0, extensions: ["rtf"] },
  "text/rtp-enc-aescm128": { source: "iana" },
  "text/rtploopback": { source: "iana" },
  "text/rtx": { source: "iana" },
  "text/sgml": { source: "iana", extensions: ["sgml", "sgm"] },
  "text/shaclc": { source: "iana" },
  "text/shex": { source: "iana", extensions: ["shex"] },
  "text/slim": { extensions: ["slim", "slm"] },
  "text/spdx": { source: "iana", extensions: ["spdx"] },
  "text/strings": { source: "iana" },
  "text/stylus": { extensions: ["stylus", "styl"] },
  "text/t140": { source: "iana" },
  "text/tab-separated-values": { source: "iana", compressible: !0, extensions: ["tsv"] },
  "text/troff": { source: "iana", extensions: ["t", "tr", "roff", "man", "me", "ms"] },
  "text/turtle": { source: "iana", charset: "UTF-8", extensions: ["ttl"] },
  "text/ulpfec": { source: "iana" },
  "text/uri-list": { source: "iana", compressible: !0, extensions: ["uri", "uris", "urls"] },
  "text/vcard": { source: "iana", compressible: !0, extensions: ["vcard"] },
  "text/vnd.a": { source: "iana" },
  "text/vnd.abc": { source: "iana" },
  "text/vnd.ascii-art": { source: "iana" },
  "text/vnd.curl": { source: "iana", extensions: ["curl"] },
  "text/vnd.curl.dcurl": { source: "apache", extensions: ["dcurl"] },
  "text/vnd.curl.mcurl": { source: "apache", extensions: ["mcurl"] },
  "text/vnd.curl.scurl": { source: "apache", extensions: ["scurl"] },
  "text/vnd.debian.copyright": { source: "iana", charset: "UTF-8" },
  "text/vnd.dmclientscript": { source: "iana" },
  "text/vnd.dvb.subtitle": { source: "iana", extensions: ["sub"] },
  "text/vnd.esmertec.theme-descriptor": { source: "iana", charset: "UTF-8" },
  "text/vnd.familysearch.gedcom": { source: "iana", extensions: ["ged"] },
  "text/vnd.ficlab.flt": { source: "iana" },
  "text/vnd.fly": { source: "iana", extensions: ["fly"] },
  "text/vnd.fmi.flexstor": { source: "iana", extensions: ["flx"] },
  "text/vnd.gml": { source: "iana" },
  "text/vnd.graphviz": { source: "iana", extensions: ["gv"] },
  "text/vnd.hans": { source: "iana" },
  "text/vnd.hgl": { source: "iana" },
  "text/vnd.in3d.3dml": { source: "iana", extensions: ["3dml"] },
  "text/vnd.in3d.spot": { source: "iana", extensions: ["spot"] },
  "text/vnd.iptc.newsml": { source: "iana" },
  "text/vnd.iptc.nitf": { source: "iana" },
  "text/vnd.latex-z": { source: "iana" },
  "text/vnd.motorola.reflex": { source: "iana" },
  "text/vnd.ms-mediapackage": { source: "iana" },
  "text/vnd.net2phone.commcenter.command": { source: "iana" },
  "text/vnd.radisys.msml-basic-layout": { source: "iana" },
  "text/vnd.senx.warpscript": { source: "iana" },
  "text/vnd.si.uricatalogue": { source: "iana" },
  "text/vnd.sosi": { source: "iana" },
  "text/vnd.sun.j2me.app-descriptor": { source: "iana", charset: "UTF-8", extensions: ["jad"] },
  "text/vnd.trolltech.linguist": { source: "iana", charset: "UTF-8" },
  "text/vnd.wap.si": { source: "iana" },
  "text/vnd.wap.sl": { source: "iana" },
  "text/vnd.wap.wml": { source: "iana", extensions: ["wml"] },
  "text/vnd.wap.wmlscript": { source: "iana", extensions: ["wmls"] },
  "text/vtt": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["vtt"] },
  "text/x-asm": { source: "apache", extensions: ["s", "asm"] },
  "text/x-c": { source: "apache", extensions: ["c", "cc", "cxx", "cpp", "h", "hh", "dic"] },
  "text/x-component": { source: "nginx", extensions: ["htc"] },
  "text/x-fortran": { source: "apache", extensions: ["f", "for", "f77", "f90"] },
  "text/x-gwt-rpc": { compressible: !0 },
  "text/x-handlebars-template": { extensions: ["hbs"] },
  "text/x-java-source": { source: "apache", extensions: ["java"] },
  "text/x-jquery-tmpl": { compressible: !0 },
  "text/x-lua": { extensions: ["lua"] },
  "text/x-markdown": { compressible: !0, extensions: ["mkd"] },
  "text/x-nfo": { source: "apache", extensions: ["nfo"] },
  "text/x-opml": { source: "apache", extensions: ["opml"] },
  "text/x-org": { compressible: !0, extensions: ["org"] },
  "text/x-pascal": { source: "apache", extensions: ["p", "pas"] },
  "text/x-processing": { compressible: !0, extensions: ["pde"] },
  "text/x-sass": { extensions: ["sass"] },
  "text/x-scss": { extensions: ["scss"] },
  "text/x-setext": { source: "apache", extensions: ["etx"] },
  "text/x-sfv": { source: "apache", extensions: ["sfv"] },
  "text/x-suse-ymp": { compressible: !0, extensions: ["ymp"] },
  "text/x-uuencode": { source: "apache", extensions: ["uu"] },
  "text/x-vcalendar": { source: "apache", extensions: ["vcs"] },
  "text/x-vcard": { source: "apache", extensions: ["vcf"] },
  "text/xml": { source: "iana", compressible: !0, extensions: ["xml"] },
  "text/xml-external-parsed-entity": { source: "iana" },
  "text/yaml": { compressible: !0, extensions: ["yaml", "yml"] },
  "video/1d-interleaved-parityfec": { source: "iana" },
  "video/3gpp": { source: "iana", extensions: ["3gp", "3gpp"] },
  "video/3gpp-tt": { source: "iana" },
  "video/3gpp2": { source: "iana", extensions: ["3g2"] },
  "video/av1": { source: "iana" },
  "video/bmpeg": { source: "iana" },
  "video/bt656": { source: "iana" },
  "video/celb": { source: "iana" },
  "video/dv": { source: "iana" },
  "video/encaprtp": { source: "iana" },
  "video/ffv1": { source: "iana" },
  "video/flexfec": { source: "iana" },
  "video/h261": { source: "iana", extensions: ["h261"] },
  "video/h263": { source: "iana", extensions: ["h263"] },
  "video/h263-1998": { source: "iana" },
  "video/h263-2000": { source: "iana" },
  "video/h264": { source: "iana", extensions: ["h264"] },
  "video/h264-rcdo": { source: "iana" },
  "video/h264-svc": { source: "iana" },
  "video/h265": { source: "iana" },
  "video/iso.segment": { source: "iana", extensions: ["m4s"] },
  "video/jpeg": { source: "iana", extensions: ["jpgv"] },
  "video/jpeg2000": { source: "iana" },
  "video/jpm": { source: "apache", extensions: ["jpm", "jpgm"] },
  "video/jxsv": { source: "iana" },
  "video/mj2": { source: "iana", extensions: ["mj2", "mjp2"] },
  "video/mp1s": { source: "iana" },
  "video/mp2p": { source: "iana" },
  "video/mp2t": { source: "iana", extensions: ["ts"] },
  "video/mp4": { source: "iana", compressible: !1, extensions: ["mp4", "mp4v", "mpg4"] },
  "video/mp4v-es": { source: "iana" },
  "video/mpeg": { source: "iana", compressible: !1, extensions: ["mpeg", "mpg", "mpe", "m1v", "m2v"] },
  "video/mpeg4-generic": { source: "iana" },
  "video/mpv": { source: "iana" },
  "video/nv": { source: "iana" },
  "video/ogg": { source: "iana", compressible: !1, extensions: ["ogv"] },
  "video/parityfec": { source: "iana" },
  "video/pointer": { source: "iana" },
  "video/quicktime": { source: "iana", compressible: !1, extensions: ["qt", "mov"] },
  "video/raptorfec": { source: "iana" },
  "video/raw": { source: "iana" },
  "video/rtp-enc-aescm128": { source: "iana" },
  "video/rtploopback": { source: "iana" },
  "video/rtx": { source: "iana" },
  "video/scip": { source: "iana" },
  "video/smpte291": { source: "iana" },
  "video/smpte292m": { source: "iana" },
  "video/ulpfec": { source: "iana" },
  "video/vc1": { source: "iana" },
  "video/vc2": { source: "iana" },
  "video/vnd.cctv": { source: "iana" },
  "video/vnd.dece.hd": { source: "iana", extensions: ["uvh", "uvvh"] },
  "video/vnd.dece.mobile": { source: "iana", extensions: ["uvm", "uvvm"] },
  "video/vnd.dece.mp4": { source: "iana" },
  "video/vnd.dece.pd": { source: "iana", extensions: ["uvp", "uvvp"] },
  "video/vnd.dece.sd": { source: "iana", extensions: ["uvs", "uvvs"] },
  "video/vnd.dece.video": { source: "iana", extensions: ["uvv", "uvvv"] },
  "video/vnd.directv.mpeg": { source: "iana" },
  "video/vnd.directv.mpeg-tts": { source: "iana" },
  "video/vnd.dlna.mpeg-tts": { source: "iana" },
  "video/vnd.dvb.file": { source: "iana", extensions: ["dvb"] },
  "video/vnd.fvt": { source: "iana", extensions: ["fvt"] },
  "video/vnd.hns.video": { source: "iana" },
  "video/vnd.iptvforum.1dparityfec-1010": { source: "iana" },
  "video/vnd.iptvforum.1dparityfec-2005": { source: "iana" },
  "video/vnd.iptvforum.2dparityfec-1010": { source: "iana" },
  "video/vnd.iptvforum.2dparityfec-2005": { source: "iana" },
  "video/vnd.iptvforum.ttsavc": { source: "iana" },
  "video/vnd.iptvforum.ttsmpeg2": { source: "iana" },
  "video/vnd.motorola.video": { source: "iana" },
  "video/vnd.motorola.videop": { source: "iana" },
  "video/vnd.mpegurl": { source: "iana", extensions: ["mxu", "m4u"] },
  "video/vnd.ms-playready.media.pyv": { source: "iana", extensions: ["pyv"] },
  "video/vnd.nokia.interleaved-multimedia": { source: "iana" },
  "video/vnd.nokia.mp4vr": { source: "iana" },
  "video/vnd.nokia.videovoip": { source: "iana" },
  "video/vnd.objectvideo": { source: "iana" },
  "video/vnd.radgamettools.bink": { source: "iana" },
  "video/vnd.radgamettools.smacker": { source: "iana" },
  "video/vnd.sealed.mpeg1": { source: "iana" },
  "video/vnd.sealed.mpeg4": { source: "iana" },
  "video/vnd.sealed.swf": { source: "iana" },
  "video/vnd.sealedmedia.softseal.mov": { source: "iana" },
  "video/vnd.uvvu.mp4": { source: "iana", extensions: ["uvu", "uvvu"] },
  "video/vnd.vivo": { source: "iana", extensions: ["viv"] },
  "video/vnd.youtube.yt": { source: "iana" },
  "video/vp8": { source: "iana" },
  "video/vp9": { source: "iana" },
  "video/webm": { source: "apache", compressible: !1, extensions: ["webm"] },
  "video/x-f4v": { source: "apache", extensions: ["f4v"] },
  "video/x-fli": { source: "apache", extensions: ["fli"] },
  "video/x-flv": { source: "apache", compressible: !1, extensions: ["flv"] },
  "video/x-m4v": { source: "apache", extensions: ["m4v"] },
  "video/x-matroska": { source: "apache", compressible: !1, extensions: ["mkv", "mk3d", "mks"] },
  "video/x-mng": { source: "apache", extensions: ["mng"] },
  "video/x-ms-asf": { source: "apache", extensions: ["asf", "asx"] },
  "video/x-ms-vob": { source: "apache", extensions: ["vob"] },
  "video/x-ms-wm": { source: "apache", extensions: ["wm"] },
  "video/x-ms-wmv": { source: "apache", compressible: !1, extensions: ["wmv"] },
  "video/x-ms-wmx": { source: "apache", extensions: ["wmx"] },
  "video/x-ms-wvx": { source: "apache", extensions: ["wvx"] },
  "video/x-msvideo": { source: "apache", extensions: ["avi"] },
  "video/x-sgi-movie": { source: "apache", extensions: ["movie"] },
  "video/x-smv": { source: "apache", extensions: ["smv"] },
  "x-conference/x-cooltalk": { source: "apache", extensions: ["ice"] },
  "x-shader/x-fragment": { compressible: !0 },
  "x-shader/x-vertex": { compressible: !0 }
};
/*!
 * mime-db
 * Copyright(c) 2014 Jonathan Ong
 * Copyright(c) 2015-2022 Douglas Christopher Wilson
 * MIT Licensed
 */
var yx, UN;
function zae() {
  return UN || (UN = 1, yx = Wae), yx;
}
/*!
 * mime-types
 * Copyright(c) 2014 Jonathan Ong
 * Copyright(c) 2015 Douglas Christopher Wilson
 * MIT Licensed
 */
var LN;
function Kae() {
  return LN || (LN = 1, (function(t) {
    var e = zae(), n = be.extname, r = /^\s*([^;\s]*)(?:;|\s|$)/, i = /^text\//i;
    t.charset = o, t.charsets = { lookup: o }, t.contentType = s, t.extension = a, t.extensions = /* @__PURE__ */ Object.create(null), t.lookup = c, t.types = /* @__PURE__ */ Object.create(null), u(t.extensions, t.types);
    function o(l) {
      if (!l || typeof l != "string")
        return !1;
      var d = r.exec(l), f = d && e[d[1].toLowerCase()];
      return f && f.charset ? f.charset : d && i.test(d[1]) ? "UTF-8" : !1;
    }
    function s(l) {
      if (!l || typeof l != "string")
        return !1;
      var d = l.indexOf("/") === -1 ? t.lookup(l) : l;
      if (!d)
        return !1;
      if (d.indexOf("charset") === -1) {
        var f = t.charset(d);
        f && (d += "; charset=" + f.toLowerCase());
      }
      return d;
    }
    function a(l) {
      if (!l || typeof l != "string")
        return !1;
      var d = r.exec(l), f = d && t.extensions[d[1].toLowerCase()];
      return !f || !f.length ? !1 : f[0];
    }
    function c(l) {
      if (!l || typeof l != "string")
        return !1;
      var d = n("x." + l).toLowerCase().substr(1);
      return d && t.types[d] || !1;
    }
    function u(l, d) {
      var f = ["nginx", "apache", void 0, "iana"];
      Object.keys(e).forEach(function(h) {
        var y = e[h], x = y.extensions;
        if (!(!x || !x.length)) {
          l[h] = x;
          for (var g = 0; g < x.length; g++) {
            var v = x[g];
            if (d[v]) {
              var S = f.indexOf(e[d[v]].source), E = f.indexOf(y.source);
              if (d[v] !== "application/octet-stream" && (S > E || S === E && d[v].substr(0, 12) === "application/"))
                continue;
            }
            d[v] = h;
          }
        }
      });
    }
  })(gx)), gx;
}
/*!
 * type-is
 * Copyright(c) 2014 Jonathan Ong
 * Copyright(c) 2014-2015 Douglas Christopher Wilson
 * MIT Licensed
 */
var jN;
function jR() {
  if (jN) return Da.exports;
  jN = 1;
  var t = Hae(), e = Kae();
  Da.exports = i, Da.exports.is = n, Da.exports.hasBody = r, Da.exports.normalize = o, Da.exports.match = s;
  function n(u, l) {
    var d, f = l, m = c(u);
    if (!m)
      return !1;
    if (f && !Array.isArray(f))
      for (f = new Array(arguments.length - 1), d = 0; d < f.length; d++)
        f[d] = arguments[d + 1];
    if (!f || !f.length)
      return m;
    var h;
    for (d = 0; d < f.length; d++)
      if (s(o(h = f[d]), m))
        return h[0] === "+" || h.indexOf("*") !== -1 ? m : h;
    return !1;
  }
  function r(u) {
    return u.headers["transfer-encoding"] !== void 0 || !isNaN(u.headers["content-length"]);
  }
  function i(u, l) {
    var d = l;
    if (!r(u))
      return null;
    if (arguments.length > 2) {
      d = new Array(arguments.length - 1);
      for (var f = 0; f < d.length; f++)
        d[f] = arguments[f + 1];
    }
    var m = u.headers["content-type"];
    return n(m, d);
  }
  function o(u) {
    if (typeof u != "string")
      return !1;
    switch (u) {
      case "urlencoded":
        return "application/x-www-form-urlencoded";
      case "multipart":
        return "multipart/*";
    }
    return u[0] === "+" ? "*/*" + u : u.indexOf("/") === -1 ? e.lookup(u) : u;
  }
  function s(u, l) {
    if (u === !1)
      return !1;
    var d = l.split("/"), f = u.split("/");
    return d.length !== 2 || f.length !== 2 || f[0] !== "*" && f[0] !== d[0] ? !1 : f[1].substr(0, 2) === "*+" ? f[1].length <= d[1].length + 1 && f[1].substr(1) === d[1].substr(1 - f[1].length) : !(f[1] !== "*" && f[1] !== d[1]);
  }
  function a(u) {
    var l = t.parse(u);
    return l.parameters = void 0, t.format(l);
  }
  function c(u) {
    if (!u)
      return null;
    try {
      return a(u);
    } catch {
      return null;
    }
  }
  return Da.exports;
}
var vx, QN;
function kA() {
  if (QN) return vx;
  QN = 1;
  function t(m) {
    if (m.length === 0)
      return;
    const h = /* @__PURE__ */ Object.create(null);
    let y = 0;
    for (; y < m.length; ++y) {
      const S = m.charCodeAt(y);
      if (c[S] !== 1) {
        if (S !== 47 || y === 0)
          return;
        break;
      }
    }
    if (y === m.length)
      return;
    const x = m.slice(0, y).toLowerCase(), g = ++y;
    for (; y < m.length; ++y) {
      const S = m.charCodeAt(y);
      if (c[S] !== 1) {
        if (y === g || e(m, y, h) === void 0)
          return;
        break;
      }
    }
    if (y === g)
      return;
    const v = m.slice(g, y).toLowerCase();
    return { type: x, subtype: v, params: h };
  }
  function e(m, h, y) {
    for (; h < m.length; ) {
      for (; h < m.length; ++h) {
        const E = m.charCodeAt(h);
        if (E !== 32 && E !== 9)
          break;
      }
      if (h === m.length)
        break;
      if (m.charCodeAt(h++) !== 59)
        return;
      for (; h < m.length; ++h) {
        const E = m.charCodeAt(h);
        if (E !== 32 && E !== 9)
          break;
      }
      if (h === m.length)
        return;
      let x;
      const g = h;
      for (; h < m.length; ++h) {
        const E = m.charCodeAt(h);
        if (c[E] !== 1) {
          if (E !== 61)
            return;
          break;
        }
      }
      if (h === m.length || (x = m.slice(g, h), ++h, h === m.length))
        return;
      let v = "", S;
      if (m.charCodeAt(h) === 34) {
        S = ++h;
        let E = !1;
        for (; h < m.length; ++h) {
          const T = m.charCodeAt(h);
          if (T === 92) {
            E ? (S = h, E = !1) : (v += m.slice(S, h), E = !0);
            continue;
          }
          if (T === 34) {
            if (E) {
              S = h, E = !1;
              continue;
            }
            v += m.slice(S, h);
            break;
          }
          if (E && (S = h - 1, E = !1), u[T] !== 1)
            return;
        }
        if (h === m.length)
          return;
        ++h;
      } else {
        for (S = h; h < m.length; ++h) {
          const E = m.charCodeAt(h);
          if (c[E] !== 1) {
            if (h === S)
              return;
            break;
          }
        }
        v = m.slice(S, h);
      }
      x = x.toLowerCase(), y[x] === void 0 && (y[x] = v);
    }
    return y;
  }
  function n(m, h) {
    if (m.length === 0)
      return;
    const y = /* @__PURE__ */ Object.create(null);
    let x = 0;
    for (; x < m.length; ++x) {
      const v = m.charCodeAt(x);
      if (c[v] !== 1) {
        if (r(m, x, y, h) === void 0)
          return;
        break;
      }
    }
    return { type: m.slice(0, x).toLowerCase(), params: y };
  }
  function r(m, h, y, x) {
    for (; h < m.length; ) {
      for (; h < m.length; ++h) {
        const j = m.charCodeAt(h);
        if (j !== 32 && j !== 9)
          break;
      }
      if (h === m.length)
        break;
      if (m.charCodeAt(h++) !== 59)
        return;
      for (; h < m.length; ++h) {
        const j = m.charCodeAt(h);
        if (j !== 32 && j !== 9)
          break;
      }
      if (h === m.length)
        return;
      let g;
      const v = h;
      for (; h < m.length; ++h) {
        const j = m.charCodeAt(h);
        if (c[j] !== 1) {
          if (j === 61)
            break;
          return;
        }
      }
      if (h === m.length)
        return;
      let S = "", E, T;
      if (g = m.slice(v, h), g.charCodeAt(g.length - 1) === 42) {
        const j = ++h;
        for (; h < m.length; ++h) {
          const Y = m.charCodeAt(h);
          if (l[Y] !== 1) {
            if (Y !== 39)
              return;
            break;
          }
        }
        if (h === m.length)
          return;
        for (T = m.slice(j, h), ++h; h < m.length && m.charCodeAt(h) !== 39; ++h)
          ;
        if (h === m.length || (++h, h === m.length))
          return;
        E = h;
        let q = 0;
        for (; h < m.length; ++h) {
          const Y = m.charCodeAt(h);
          if (d[Y] !== 1) {
            if (Y === 37) {
              let W, G;
              if (h + 2 < m.length && (W = f[m.charCodeAt(h + 1)]) !== -1 && (G = f[m.charCodeAt(h + 2)]) !== -1) {
                const J = (W << 4) + G;
                S += m.slice(E, h), S += String.fromCharCode(J), h += 2, E = h + 1, J >= 128 ? q = 2 : q === 0 && (q = 1);
                continue;
              }
              return;
            }
            break;
          }
        }
        if (S += m.slice(E, h), S = s(S, T, q), S === void 0)
          return;
      } else {
        if (++h, h === m.length)
          return;
        if (m.charCodeAt(h) === 34) {
          E = ++h;
          let j = !1;
          for (; h < m.length; ++h) {
            const q = m.charCodeAt(h);
            if (q === 92) {
              j ? (E = h, j = !1) : (S += m.slice(E, h), j = !0);
              continue;
            }
            if (q === 34) {
              if (j) {
                E = h, j = !1;
                continue;
              }
              S += m.slice(E, h);
              break;
            }
            if (j && (E = h - 1, j = !1), u[q] !== 1)
              return;
          }
          if (h === m.length)
            return;
          ++h;
        } else {
          for (E = h; h < m.length; ++h) {
            const j = m.charCodeAt(h);
            if (c[j] !== 1) {
              if (h === E)
                return;
              break;
            }
          }
          S = m.slice(E, h);
        }
        if (S = x(S, 2), S === void 0)
          return;
      }
      g = g.toLowerCase(), y[g] === void 0 && (y[g] = S);
    }
    return y;
  }
  function i(m) {
    let h;
    for (; ; )
      switch (m) {
        case "utf-8":
        case "utf8":
          return o.utf8;
        case "latin1":
        case "ascii":
        // TODO: Make these a separate, strict decoder?
        case "us-ascii":
        case "iso-8859-1":
        case "iso8859-1":
        case "iso88591":
        case "iso_8859-1":
        case "windows-1252":
        case "iso_8859-1:1987":
        case "cp1252":
        case "x-cp1252":
          return o.latin1;
        case "utf16le":
        case "utf-16le":
        case "ucs2":
        case "ucs-2":
          return o.utf16le;
        case "base64":
          return o.base64;
        default:
          if (h === void 0) {
            h = !0, m = m.toLowerCase();
            continue;
          }
          return o.other.bind(m);
      }
  }
  const o = {
    utf8: (m, h) => {
      if (m.length === 0)
        return "";
      if (typeof m == "string") {
        if (h < 2)
          return m;
        m = Buffer.from(m, "latin1");
      }
      return m.utf8Slice(0, m.length);
    },
    latin1: (m, h) => m.length === 0 ? "" : typeof m == "string" ? m : m.latin1Slice(0, m.length),
    utf16le: (m, h) => m.length === 0 ? "" : (typeof m == "string" && (m = Buffer.from(m, "latin1")), m.ucs2Slice(0, m.length)),
    base64: (m, h) => m.length === 0 ? "" : (typeof m == "string" && (m = Buffer.from(m, "latin1")), m.base64Slice(0, m.length)),
    other: (m, h) => {
      if (m.length === 0)
        return "";
      typeof m == "string" && (m = Buffer.from(m, "latin1"));
      try {
        return new TextDecoder(this).decode(m);
      } catch {
      }
    }
  };
  function s(m, h, y) {
    const x = i(h);
    if (x)
      return x(m, y);
  }
  function a(m) {
    if (typeof m != "string")
      return "";
    for (let h = m.length - 1; h >= 0; --h)
      switch (m.charCodeAt(h)) {
        case 47:
        // '/'
        case 92:
          return m = m.slice(h + 1), m === ".." || m === "." ? "" : m;
      }
    return m === ".." || m === "." ? "" : m;
  }
  const c = [
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    1,
    0,
    1,
    1,
    1,
    1,
    1,
    0,
    0,
    1,
    1,
    0,
    1,
    1,
    0,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    0,
    0,
    0,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    0,
    1,
    0,
    1,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0
  ], u = [
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    1,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    1,
    1,
    0,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    0,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    0,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1
  ], l = [
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    1,
    0,
    1,
    1,
    1,
    1,
    0,
    0,
    0,
    0,
    1,
    0,
    1,
    0,
    0,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    0,
    0,
    0,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    0,
    1,
    1,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0
  ], d = [
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    1,
    0,
    1,
    1,
    0,
    1,
    0,
    0,
    0,
    0,
    1,
    0,
    1,
    1,
    0,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    0,
    0,
    0,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    0,
    1,
    0,
    1,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0
  ], f = [
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    10,
    11,
    12,
    13,
    14,
    15,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    10,
    11,
    12,
    13,
    14,
    15,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1
  ];
  return vx = {
    basename: a,
    convertToUTF8: s,
    getDecoder: i,
    parseContentType: t,
    parseDisposition: n
  }, vx;
}
var bx, $N;
function Vae() {
  if ($N) return bx;
  $N = 1;
  function t(i, o, s, a, c) {
    for (let u = 0; u < c; ++u)
      if (i[o + u] !== s[a + u])
        return !1;
    return !0;
  }
  class e {
    constructor(o, s) {
      if (typeof s != "function")
        throw new Error("Missing match callback");
      if (typeof o == "string")
        o = Buffer.from(o);
      else if (!Buffer.isBuffer(o))
        throw new Error(`Expected Buffer for needle, got ${typeof o}`);
      const a = o.length;
      if (this.maxMatches = 1 / 0, this.matches = 0, this._cb = s, this._lookbehindSize = 0, this._needle = o, this._bufPos = 0, this._lookbehind = Buffer.allocUnsafe(a), this._occ = [
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a,
        a
      ], a > 1)
        for (let c = 0; c < a - 1; ++c)
          this._occ[o[c]] = a - 1 - c;
    }
    reset() {
      this.matches = 0, this._lookbehindSize = 0, this._bufPos = 0;
    }
    push(o, s) {
      let a;
      Buffer.isBuffer(o) || (o = Buffer.from(o, "latin1"));
      const c = o.length;
      for (this._bufPos = s || 0; a !== c && this.matches < this.maxMatches; )
        a = n(this, o);
      return a;
    }
    destroy() {
      const o = this._lookbehindSize;
      o && this._cb(!1, this._lookbehind, 0, o, !1), this.reset();
    }
  }
  function n(i, o) {
    const s = o.length, a = i._needle, c = a.length;
    let u = -i._lookbehindSize;
    const l = c - 1, d = a[l], f = s - c, m = i._occ, h = i._lookbehind;
    if (u < 0) {
      for (; u < 0 && u <= f; ) {
        const x = u + l, g = x < 0 ? h[i._lookbehindSize + x] : o[x];
        if (g === d && r(i, o, u, l))
          return i._lookbehindSize = 0, ++i.matches, u > -i._lookbehindSize ? i._cb(!0, h, 0, i._lookbehindSize + u, !1) : i._cb(!0, void 0, 0, 0, !0), i._bufPos = u + c;
        u += m[g];
      }
      for (; u < 0 && !r(i, o, u, s - u); )
        ++u;
      if (u < 0) {
        const x = i._lookbehindSize + u;
        return x > 0 && i._cb(!1, h, 0, x, !1), i._lookbehindSize -= x, h.copy(h, 0, x, i._lookbehindSize), h.set(o, i._lookbehindSize), i._lookbehindSize += s, i._bufPos = s, s;
      }
      i._cb(!1, h, 0, i._lookbehindSize, !1), i._lookbehindSize = 0;
    }
    u += i._bufPos;
    const y = a[0];
    for (; u <= f; ) {
      const x = o[u + l];
      if (x === d && o[u] === y && t(a, 0, o, u, l))
        return ++i.matches, u > 0 ? i._cb(!0, o, i._bufPos, u, !0) : i._cb(!0, void 0, 0, 0, !0), i._bufPos = u + c;
      u += m[x];
    }
    for (; u < s; ) {
      if (o[u] !== y || !t(o, u, a, 0, s - u)) {
        ++u;
        continue;
      }
      o.copy(h, 0, u, s), i._lookbehindSize = s - u;
      break;
    }
    return u > 0 && i._cb(!1, o, i._bufPos, u < s ? u : s, !0), i._bufPos = s, s;
  }
  function r(i, o, s, a) {
    const c = i._lookbehind, u = i._lookbehindSize, l = i._needle;
    for (let d = 0; d < a; ++d, ++s)
      if ((s < 0 ? c[u + s] : o[s]) !== l[d])
        return !1;
    return !0;
  }
  return bx = e, bx;
}
var xx, GN;
function Yae() {
  if (GN) return xx;
  GN = 1;
  const { Readable: t, Writable: e } = ir, n = Vae(), {
    basename: r,
    convertToUTF8: i,
    getDecoder: o,
    parseContentType: s,
    parseDisposition: a
  } = kA(), c = Buffer.from(`\r
`), u = Buffer.from("\r"), l = Buffer.from("-");
  function d() {
  }
  const f = 2e3, m = 16 * 1024, h = 0, y = 1, x = 2;
  class g {
    constructor(B) {
      this.header = /* @__PURE__ */ Object.create(null), this.pairCount = 0, this.byteCount = 0, this.state = h, this.name = "", this.value = "", this.crlf = 0, this.cb = B;
    }
    reset() {
      this.header = /* @__PURE__ */ Object.create(null), this.pairCount = 0, this.byteCount = 0, this.state = h, this.name = "", this.value = "", this.crlf = 0;
    }
    push(B, D, X) {
      let V = D;
      for (; D < X; )
        switch (this.state) {
          case h: {
            let K = !1;
            for (; D < X; ++D) {
              if (this.byteCount === m)
                return -1;
              ++this.byteCount;
              const $ = B[D];
              if (W[$] !== 1) {
                if ($ !== 58 || (this.name += B.latin1Slice(V, D), this.name.length === 0))
                  return -1;
                ++D, K = !0, this.state = y;
                break;
              }
            }
            if (!K) {
              this.name += B.latin1Slice(V, D);
              break;
            }
          }
          case y: {
            let K = !1;
            for (; D < X; ++D) {
              if (this.byteCount === m)
                return -1;
              ++this.byteCount;
              const $ = B[D];
              if ($ !== 32 && $ !== 9) {
                V = D, K = !0, this.state = x;
                break;
              }
            }
            if (!K)
              break;
          }
          case x:
            switch (this.crlf) {
              case 0:
                for (; D < X; ++D) {
                  if (this.byteCount === m)
                    return -1;
                  ++this.byteCount;
                  const K = B[D];
                  if (G[K] !== 1) {
                    if (K !== 13)
                      return -1;
                    ++this.crlf;
                    break;
                  }
                }
                this.value += B.latin1Slice(V, D++);
                break;
              case 1:
                if (this.byteCount === m || (++this.byteCount, B[D++] !== 10))
                  return -1;
                ++this.crlf;
                break;
              case 2: {
                if (this.byteCount === m)
                  return -1;
                ++this.byteCount;
                const K = B[D];
                K === 32 || K === 9 ? (V = D, this.crlf = 0) : (++this.pairCount < f && (this.name = this.name.toLowerCase(), this.header[this.name] === void 0 ? this.header[this.name] = [this.value] : this.header[this.name].push(this.value)), K === 13 ? (++this.crlf, ++D) : (V = D, this.crlf = 0, this.state = h, this.name = "", this.value = ""));
                break;
              }
              case 3: {
                if (this.byteCount === m || (++this.byteCount, B[D++] !== 10))
                  return -1;
                const K = this.header;
                return this.reset(), this.cb(K), D;
              }
            }
            break;
        }
      return D;
    }
  }
  class v extends t {
    constructor(B, D) {
      super(B), this.truncated = !1, this._readcb = null, this.once("end", () => {
        if (this._read(), --D._fileEndsLeft === 0 && D._finalcb) {
          const X = D._finalcb;
          D._finalcb = null, process.nextTick(X);
        }
      });
    }
    _read(B) {
      const D = this._readcb;
      D && (this._readcb = null, D());
    }
  }
  const S = {
    push: (J, B) => {
    },
    destroy: () => {
    }
  };
  function E(J, B) {
    const D = J._writecb;
    J._writecb = null, D && D();
  }
  function T(J, B) {
    return J;
  }
  class j extends e {
    constructor(B) {
      const D = {
        autoDestroy: !0,
        emitClose: !0,
        highWaterMark: typeof B.highWaterMark == "number" ? B.highWaterMark : void 0
      };
      if (super(D), !B.conType.params || typeof B.conType.params.boundary != "string")
        throw new Error("Multipart: Boundary not found");
      const X = B.conType.params.boundary, V = typeof B.defParamCharset == "string" && B.defParamCharset ? o(B.defParamCharset) : T, K = B.defCharset || "utf8", $ = B.preservePath, _ = {
        autoDestroy: !0,
        emitClose: !0,
        highWaterMark: typeof B.fileHwm == "number" ? B.fileHwm : void 0
      }, I = B.limits, N = I && typeof I.fieldSize == "number" ? I.fieldSize : 1 * 1024 * 1024, U = I && typeof I.fileSize == "number" ? I.fileSize : 1 / 0, C = I && typeof I.files == "number" ? I.files : 1 / 0, L = I && typeof I.fields == "number" ? I.fields : 1 / 0, k = I && typeof I.parts == "number" ? I.parts : 1 / 0;
      let M = -1, F = 0, A = 0, O = !1;
      this._fileEndsLeft = 0, this._fileStream = void 0, this._complete = !1;
      let Z = 0, ee, P = 0, Q, z, se, ae, ie = !1, we = !1, Oe = !1;
      this._hparser = null;
      const He = new g((Ke) => {
        this._hparser = null, O = !1, se = "text/plain", Q = K, z = "7bit", ae = void 0, ie = !1;
        let nt;
        if (!Ke["content-disposition"]) {
          O = !0;
          return;
        }
        const qe = a(
          Ke["content-disposition"][0],
          V
        );
        if (!qe || qe.type !== "form-data") {
          O = !0;
          return;
        }
        if (qe.params && (qe.params.name && (ae = qe.params.name), qe.params["filename*"] ? nt = qe.params["filename*"] : qe.params.filename && (nt = qe.params.filename), nt !== void 0 && !$ && (nt = r(nt))), Ke["content-type"]) {
          const Nt = s(Ke["content-type"][0]);
          Nt && (se = `${Nt.type}/${Nt.subtype}`, Nt.params && typeof Nt.params.charset == "string" && (Q = Nt.params.charset.toLowerCase()));
        }
        if (Ke["content-transfer-encoding"] && (z = Ke["content-transfer-encoding"][0].toLowerCase()), se === "application/octet-stream" || nt !== void 0) {
          if (A === C) {
            we || (we = !0, this.emit("filesLimit")), O = !0;
            return;
          }
          if (++A, this.listenerCount("file") === 0) {
            O = !0;
            return;
          }
          Z = 0, this._fileStream = new v(_, this), ++this._fileEndsLeft, this.emit(
            "file",
            ae,
            this._fileStream,
            {
              filename: nt,
              encoding: z,
              mimeType: se
            }
          );
        } else {
          if (F === L) {
            Oe || (Oe = !0, this.emit("fieldsLimit")), O = !0;
            return;
          }
          if (++F, this.listenerCount("field") === 0) {
            O = !0;
            return;
          }
          ee = [], P = 0;
        }
      });
      let We = 0;
      const Ye = (Ke, nt, qe, Nt, Er) => {
        e:
          for (; nt; ) {
            if (this._hparser !== null) {
              const st = this._hparser.push(nt, qe, Nt);
              if (st === -1) {
                this._hparser = null, He.reset(), this.emit("error", new Error("Malformed part header"));
                break;
              }
              qe = st;
            }
            if (qe === Nt)
              break;
            if (We !== 0) {
              if (We === 1) {
                switch (nt[qe]) {
                  case 45:
                    We = 2, ++qe;
                    break;
                  case 13:
                    We = 3, ++qe;
                    break;
                  default:
                    We = 0;
                }
                if (qe === Nt)
                  return;
              }
              if (We === 2) {
                if (We = 0, nt[qe] === 45) {
                  this._complete = !0, this._bparser = S;
                  return;
                }
                const st = this._writecb;
                this._writecb = d, Ye(!1, l, 0, 1, !1), this._writecb = st;
              } else if (We === 3)
                if (We = 0, nt[qe] === 10) {
                  if (++qe, M >= k || (this._hparser = He, qe === Nt))
                    break;
                  continue e;
                } else {
                  const st = this._writecb;
                  this._writecb = d, Ye(!1, u, 0, 1, !1), this._writecb = st;
                }
            }
            if (!O) {
              if (this._fileStream) {
                let st;
                const Zn = Math.min(Nt - qe, U - Z);
                Er ? st = nt.slice(qe, qe + Zn) : (st = Buffer.allocUnsafe(Zn), nt.copy(st, 0, qe, qe + Zn)), Z += st.length, Z === U ? (st.length > 0 && this._fileStream.push(st), this._fileStream.emit("limit"), this._fileStream.truncated = !0, O = !0) : this._fileStream.push(st) || (this._writecb && (this._fileStream._readcb = this._writecb), this._writecb = null);
              } else if (ee !== void 0) {
                let st;
                const Zn = Math.min(
                  Nt - qe,
                  N - P
                );
                Er ? st = nt.slice(qe, qe + Zn) : (st = Buffer.allocUnsafe(Zn), nt.copy(st, 0, qe, qe + Zn)), P += Zn, ee.push(st), P === N && (O = !0, ie = !0);
              }
            }
            break;
          }
        if (Ke) {
          if (We = 1, this._fileStream)
            this._fileStream.push(null), this._fileStream = null;
          else if (ee !== void 0) {
            let st;
            switch (ee.length) {
              case 0:
                st = "";
                break;
              case 1:
                st = i(ee[0], Q, 0);
                break;
              default:
                st = i(
                  Buffer.concat(ee, P),
                  Q,
                  0
                );
            }
            ee = void 0, P = 0, this.emit(
              "field",
              ae,
              st,
              {
                nameTruncated: !1,
                valueTruncated: ie,
                encoding: z,
                mimeType: se
              }
            );
          }
          ++M === k && this.emit("partsLimit");
        }
      };
      this._bparser = new n(`\r
--${X}`, Ye), this._writecb = null, this._finalcb = null, this.write(c);
    }
    static detect(B) {
      return B.type === "multipart" && B.subtype === "form-data";
    }
    _write(B, D, X) {
      this._writecb = X, this._bparser.push(B, 0), this._writecb && E(this);
    }
    _destroy(B, D) {
      this._hparser = null, this._bparser = S, B || (B = Y(this));
      const X = this._fileStream;
      X && (this._fileStream = null, X.destroy(B)), D(B);
    }
    _final(B) {
      if (this._bparser.destroy(), !this._complete)
        return B(new Error("Unexpected end of form"));
      this._fileEndsLeft ? this._finalcb = q.bind(null, this, B) : q(this, B);
    }
  }
  function q(J, B, D) {
    if (D)
      return B(D);
    D = Y(J), B(D);
  }
  function Y(J) {
    if (J._hparser)
      return new Error("Malformed part header");
    const B = J._fileStream;
    if (B && (J._fileStream = null, B.destroy(new Error("Unexpected end of file"))), !J._complete)
      return new Error("Unexpected end of form");
  }
  const W = [
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    1,
    0,
    1,
    1,
    1,
    1,
    1,
    0,
    0,
    1,
    1,
    0,
    1,
    1,
    0,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    0,
    0,
    0,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    0,
    1,
    0,
    1,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0
  ], G = [
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    1,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    0,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1,
    1
  ];
  return xx = j, xx;
}
var wx, qN;
function Jae() {
  if (qN) return wx;
  qN = 1;
  const { Writable: t } = ir, { getDecoder: e } = kA();
  class n extends t {
    constructor(c) {
      const u = {
        autoDestroy: !0,
        emitClose: !0,
        highWaterMark: typeof c.highWaterMark == "number" ? c.highWaterMark : void 0
      };
      super(u);
      let l = c.defCharset || "utf8";
      c.conType.params && typeof c.conType.params.charset == "string" && (l = c.conType.params.charset), this.charset = l;
      const d = c.limits;
      this.fieldSizeLimit = d && typeof d.fieldSize == "number" ? d.fieldSize : 1 * 1024 * 1024, this.fieldsLimit = d && typeof d.fields == "number" ? d.fields : 1 / 0, this.fieldNameSizeLimit = d && typeof d.fieldNameSize == "number" ? d.fieldNameSize : 100, this._inKey = !0, this._keyTrunc = !1, this._valTrunc = !1, this._bytesKey = 0, this._bytesVal = 0, this._fields = 0, this._key = "", this._val = "", this._byte = -2, this._lastPos = 0, this._encode = 0, this._decoder = e(l);
    }
    static detect(c) {
      return c.type === "application" && c.subtype === "x-www-form-urlencoded";
    }
    _write(c, u, l) {
      if (this._fields >= this.fieldsLimit)
        return l();
      let d = 0;
      const f = c.length;
      if (this._lastPos = 0, this._byte !== -2) {
        if (d = r(this, c, d, f), d === -1)
          return l(new Error("Malformed urlencoded form"));
        if (d >= f)
          return l();
        this._inKey ? ++this._bytesKey : ++this._bytesVal;
      }
      e:
        for (; d < f; )
          if (this._inKey) {
            for (d = i(this, c, d, f); d < f; ) {
              switch (c[d]) {
                case 61:
                  this._lastPos < d && (this._key += c.latin1Slice(this._lastPos, d)), this._lastPos = ++d, this._key = this._decoder(this._key, this._encode), this._encode = 0, this._inKey = !1;
                  continue e;
                case 38:
                  if (this._lastPos < d && (this._key += c.latin1Slice(this._lastPos, d)), this._lastPos = ++d, this._key = this._decoder(this._key, this._encode), this._encode = 0, this._bytesKey > 0 && this.emit(
                    "field",
                    this._key,
                    "",
                    {
                      nameTruncated: this._keyTrunc,
                      valueTruncated: !1,
                      encoding: this.charset,
                      mimeType: "text/plain"
                    }
                  ), this._key = "", this._val = "", this._keyTrunc = !1, this._valTrunc = !1, this._bytesKey = 0, this._bytesVal = 0, ++this._fields >= this.fieldsLimit)
                    return this.emit("fieldsLimit"), l();
                  continue;
                case 43:
                  this._lastPos < d && (this._key += c.latin1Slice(this._lastPos, d)), this._key += " ", this._lastPos = d + 1;
                  break;
                case 37:
                  if (this._encode === 0 && (this._encode = 1), this._lastPos < d && (this._key += c.latin1Slice(this._lastPos, d)), this._lastPos = d + 1, this._byte = -1, d = r(this, c, d + 1, f), d === -1)
                    return l(new Error("Malformed urlencoded form"));
                  if (d >= f)
                    return l();
                  ++this._bytesKey, d = i(this, c, d, f);
                  continue;
              }
              ++d, ++this._bytesKey, d = i(this, c, d, f);
            }
            this._lastPos < d && (this._key += c.latin1Slice(this._lastPos, d));
          } else {
            for (d = o(this, c, d, f); d < f; ) {
              switch (c[d]) {
                case 38:
                  if (this._lastPos < d && (this._val += c.latin1Slice(this._lastPos, d)), this._lastPos = ++d, this._inKey = !0, this._val = this._decoder(this._val, this._encode), this._encode = 0, (this._bytesKey > 0 || this._bytesVal > 0) && this.emit(
                    "field",
                    this._key,
                    this._val,
                    {
                      nameTruncated: this._keyTrunc,
                      valueTruncated: this._valTrunc,
                      encoding: this.charset,
                      mimeType: "text/plain"
                    }
                  ), this._key = "", this._val = "", this._keyTrunc = !1, this._valTrunc = !1, this._bytesKey = 0, this._bytesVal = 0, ++this._fields >= this.fieldsLimit)
                    return this.emit("fieldsLimit"), l();
                  continue e;
                case 43:
                  this._lastPos < d && (this._val += c.latin1Slice(this._lastPos, d)), this._val += " ", this._lastPos = d + 1;
                  break;
                case 37:
                  if (this._encode === 0 && (this._encode = 1), this._lastPos < d && (this._val += c.latin1Slice(this._lastPos, d)), this._lastPos = d + 1, this._byte = -1, d = r(this, c, d + 1, f), d === -1)
                    return l(new Error("Malformed urlencoded form"));
                  if (d >= f)
                    return l();
                  ++this._bytesVal, d = o(this, c, d, f);
                  continue;
              }
              ++d, ++this._bytesVal, d = o(this, c, d, f);
            }
            this._lastPos < d && (this._val += c.latin1Slice(this._lastPos, d));
          }
      l();
    }
    _final(c) {
      if (this._byte !== -2)
        return c(new Error("Malformed urlencoded form"));
      (!this._inKey || this._bytesKey > 0 || this._bytesVal > 0) && (this._inKey ? this._key = this._decoder(this._key, this._encode) : this._val = this._decoder(this._val, this._encode), this.emit(
        "field",
        this._key,
        this._val,
        {
          nameTruncated: this._keyTrunc,
          valueTruncated: this._valTrunc,
          encoding: this.charset,
          mimeType: "text/plain"
        }
      )), c();
    }
  }
  function r(a, c, u, l) {
    if (u >= l)
      return l;
    if (a._byte === -1) {
      const d = s[c[u++]];
      if (d === -1)
        return -1;
      if (d >= 8 && (a._encode = 2), u < l) {
        const f = s[c[u++]];
        if (f === -1)
          return -1;
        a._inKey ? a._key += String.fromCharCode((d << 4) + f) : a._val += String.fromCharCode((d << 4) + f), a._byte = -2, a._lastPos = u;
      } else
        a._byte = d;
    } else {
      const d = s[c[u++]];
      if (d === -1)
        return -1;
      a._inKey ? a._key += String.fromCharCode((a._byte << 4) + d) : a._val += String.fromCharCode((a._byte << 4) + d), a._byte = -2, a._lastPos = u;
    }
    return u;
  }
  function i(a, c, u, l) {
    if (a._bytesKey > a.fieldNameSizeLimit) {
      for (a._keyTrunc || a._lastPos < u && (a._key += c.latin1Slice(a._lastPos, u - 1)), a._keyTrunc = !0; u < l; ++u) {
        const d = c[u];
        if (d === 61 || d === 38)
          break;
        ++a._bytesKey;
      }
      a._lastPos = u;
    }
    return u;
  }
  function o(a, c, u, l) {
    if (a._bytesVal > a.fieldSizeLimit) {
      for (a._valTrunc || a._lastPos < u && (a._val += c.latin1Slice(a._lastPos, u - 1)), a._valTrunc = !0; u < l && c[u] !== 38; ++u)
        ++a._bytesVal;
      a._lastPos = u;
    }
    return u;
  }
  const s = [
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    10,
    11,
    12,
    13,
    14,
    15,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    10,
    11,
    12,
    13,
    14,
    15,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1,
    -1
  ];
  return wx = n, wx;
}
var Sx, HN;
function Xae() {
  if (HN) return Sx;
  HN = 1;
  const { parseContentType: t } = kA();
  function e(r) {
    const i = r.headers, o = t(i["content-type"]);
    if (!o)
      throw new Error("Malformed content type");
    for (const s of n) {
      if (!s.detect(o))
        continue;
      const c = {
        limits: r.limits,
        headers: i,
        conType: o,
        highWaterMark: void 0,
        fileHwm: void 0,
        defCharset: void 0,
        defParamCharset: void 0,
        preservePath: !1
      };
      return r.highWaterMark && (c.highWaterMark = r.highWaterMark), r.fileHwm && (c.fileHwm = r.fileHwm), c.defCharset = r.defCharset, c.defParamCharset = r.defParamCharset, c.preservePath = r.preservePath, new s(c);
    }
    throw new Error(`Unsupported content type: ${i["content-type"]}`);
  }
  const n = [
    Yae(),
    Jae()
  ].filter(function(r) {
    return typeof r.detect == "function";
  });
  return Sx = (r) => {
    if ((typeof r != "object" || r === null) && (r = {}), typeof r.headers != "object" || r.headers === null || typeof r.headers["content-type"] != "string")
      throw new Error("Missing Content-Type");
    return e(r);
  }, Sx;
}
var _x, WN;
function Zae() {
  if (WN) return _x;
  WN = 1;
  var t = /^[^\[]*/, e = /^\[(\d+)\]/, n = /^\[([^\]]+)\]/;
  function r(i) {
    function o() {
      return [{ type: "object", key: i, last: !0 }];
    }
    var s = t.exec(i)[0];
    if (!s) return o();
    for (var a = i.length, c = s.length, u = { type: "object", key: s }, l = [u]; c < a; ) {
      var d;
      if (i[c] === "[" && i[c + 1] === "]") {
        if (c += 2, u.append = !0, c !== a) return o();
        continue;
      }
      if (d = e.exec(i.substring(c)), d !== null) {
        c += d[0].length, u.nextType = "array", u = { type: "array", key: parseInt(d[1], 10) }, l.push(u);
        continue;
      }
      if (d = n.exec(i.substring(c)), d !== null) {
        c += d[0].length, u.nextType = "object", u = { type: "object", key: d[1] }, l.push(u);
        continue;
      }
      return o();
    }
    return u.last = !0, l;
  }
  return _x = r, _x;
}
var Ex, zN;
function ece() {
  if (zN) return Ex;
  zN = 1;
  function t(r) {
    return r === void 0 ? "undefined" : Array.isArray(r) ? "array" : typeof r == "object" ? "object" : "scalar";
  }
  function e(r, i, o, s) {
    switch (t(o)) {
      case "undefined":
        i.append ? r[i.key] = [s] : r[i.key] = s;
        break;
      case "array":
        r[i.key].push(s);
        break;
      case "object":
        return e(o, { key: "" }, o[""], s);
      case "scalar":
        r[i.key] = [r[i.key], s];
        break;
    }
    return r;
  }
  function n(r, i, o, s) {
    if (i.last) return e(r, i, o, s);
    var a;
    switch (t(o)) {
      case "undefined":
        return i.nextType === "array" ? r[i.key] = [] : r[i.key] = /* @__PURE__ */ Object.create(null), r[i.key];
      case "object":
        return r[i.key];
      case "array":
        return i.nextType === "array" ? o : (a = /* @__PURE__ */ Object.create(null), r[i.key] = a, o.forEach(function(c, u) {
          c !== void 0 && (a["" + u] = c);
        }), a);
      case "scalar":
        return a = /* @__PURE__ */ Object.create(null), a[""] = o, r[i.key] = a, a;
    }
  }
  return Ex = n, Ex;
}
var Ax, KN;
function tce() {
  if (KN) return Ax;
  KN = 1;
  var t = Zae(), e = ece();
  function n(r, i, o) {
    var s = t(i);
    s.reduce(function(a, c) {
      return e(a, c, a[c.key], o);
    }, r);
  }
  return Ax = n, Ax;
}
var Ix, VN;
function nce() {
  if (VN) return Ix;
  VN = 1;
  var t = xs.EventEmitter;
  function e() {
    t.call(this), this.value = 0;
  }
  return e.prototype = Object.create(t.prototype), e.prototype.increment = function() {
    this.value++;
  }, e.prototype.decrement = function() {
    --this.value === 0 && this.emit("zero");
  }, e.prototype.isZero = function() {
    return this.value === 0;
  }, e.prototype.onceZero = function(r) {
    if (this.isZero()) return r();
    this.once("zero", r);
  }, Ix = e, Ix;
}
var Cx, YN;
function QR() {
  if (YN) return Cx;
  YN = 1;
  var t = _n, e = {
    LIMIT_PART_COUNT: "Too many parts",
    LIMIT_FILE_SIZE: "File too large",
    LIMIT_FILE_COUNT: "Too many files",
    LIMIT_FIELD_KEY: "Field name too long",
    LIMIT_FIELD_VALUE: "Field value too long",
    LIMIT_FIELD_COUNT: "Too many fields",
    LIMIT_UNEXPECTED_FILE: "Unexpected field",
    MISSING_FIELD_NAME: "Field name missing"
  };
  function n(r, i) {
    Error.captureStackTrace(this, this.constructor), this.name = this.constructor.name, this.message = e[r], this.code = r, i && (this.field = i);
  }
  return t.inherits(n, Error), Cx = n, Cx;
}
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
var Tx, JN;
function $R() {
  if (JN) return Tx;
  JN = 1;
  var t = Object.getOwnPropertySymbols, e = Object.prototype.hasOwnProperty, n = Object.prototype.propertyIsEnumerable;
  function r(o) {
    if (o == null)
      throw new TypeError("Object.assign cannot be called with null or undefined");
    return Object(o);
  }
  function i() {
    try {
      if (!Object.assign)
        return !1;
      var o = new String("abc");
      if (o[5] = "de", Object.getOwnPropertyNames(o)[0] === "5")
        return !1;
      for (var s = {}, a = 0; a < 10; a++)
        s["_" + String.fromCharCode(a)] = a;
      var c = Object.getOwnPropertyNames(s).map(function(l) {
        return s[l];
      });
      if (c.join("") !== "0123456789")
        return !1;
      var u = {};
      return "abcdefghijklmnopqrst".split("").forEach(function(l) {
        u[l] = l;
      }), Object.keys(Object.assign({}, u)).join("") === "abcdefghijklmnopqrst";
    } catch {
      return !1;
    }
  }
  return Tx = i() ? Object.assign : function(o, s) {
    for (var a, c = r(o), u, l = 1; l < arguments.length; l++) {
      a = Object(arguments[l]);
      for (var d in a)
        e.call(a, d) && (c[d] = a[d]);
      if (t) {
        u = t(a);
        for (var f = 0; f < u.length; f++)
          n.call(a, u[f]) && (c[u[f]] = a[u[f]]);
      }
    }
    return c;
  }, Tx;
}
var kx, XN;
function rce() {
  if (XN) return kx;
  XN = 1;
  var t = $R();
  function e(r, i) {
    var o = r.indexOf(i);
    ~o && r.splice(o, 1);
  }
  function n(r, i) {
    switch (this.strategy = r, this.req = i, r) {
      case "NONE":
        break;
      case "VALUE":
        break;
      case "ARRAY":
        i.files = [];
        break;
      case "OBJECT":
        i.files = /* @__PURE__ */ Object.create(null);
        break;
      default:
        throw new Error("Unknown file strategy: " + r);
    }
  }
  return n.prototype.insertPlaceholder = function(r) {
    var i = {
      fieldname: r.fieldname
    };
    switch (this.strategy) {
      case "NONE":
        break;
      case "VALUE":
        break;
      case "ARRAY":
        this.req.files.push(i);
        break;
      case "OBJECT":
        this.req.files[r.fieldname] ? this.req.files[r.fieldname].push(i) : this.req.files[r.fieldname] = [i];
        break;
    }
    return i;
  }, n.prototype.removePlaceholder = function(r) {
    switch (this.strategy) {
      case "NONE":
        break;
      case "VALUE":
        break;
      case "ARRAY":
        e(this.req.files, r);
        break;
      case "OBJECT":
        this.req.files[r.fieldname].length === 1 ? delete this.req.files[r.fieldname] : e(this.req.files[r.fieldname], r);
        break;
    }
  }, n.prototype.replacePlaceholder = function(r, i) {
    if (this.strategy === "VALUE") {
      this.req.file = i;
      return;
    }
    delete r.fieldname, t(r, i);
  }, kx = n, kx;
}
var Nx, ZN;
function ice() {
  if (ZN) return Nx;
  ZN = 1;
  function t(e, n, r) {
    var i = e.length, o = [];
    if (i === 0) return r(null, o);
    function s(a) {
      var c = e[a];
      n(c, function(u) {
        u && (u.file = c, u.field = c.fieldname, o.push(u)), a < i - 1 ? s(a + 1) : r(null, o);
      });
    }
    s(0);
  }
  return Nx = t, Nx;
}
var Px, eP;
function oce() {
  if (eP) return Px;
  eP = 1;
  var t = jR(), e = Xae(), n = c8(), r = tce(), i = nce(), o = QR(), s = rce(), a = ice();
  function c(l) {
    l.on("readable", () => {
      for (; l.read() !== null; )
        ;
    });
  }
  function u(l) {
    return function(f, m, h) {
      if (!t(f, ["multipart"])) return h();
      var y = l(), x = y.limits, g = y.storage, v = y.fileFilter, S = y.fileStrategy, E = y.preservePath;
      f.body = /* @__PURE__ */ Object.create(null), f.on("error", function(K) {
        X(K);
      });
      var T;
      try {
        T = e({ headers: f.headers, limits: x, preservePath: E });
      } catch (K) {
        return h(K);
      }
      var j = new s(S, f), q = !1, Y = !1, W = !1, G = new i(), J = [];
      function B(K) {
        q || (q = !0, f.unpipe(T), c(f), f.resume(), setImmediate(() => {
          T.removeAllListeners();
        }), h(K));
      }
      function D() {
        Y && G.isZero() && !W && B();
      }
      function X(K) {
        W || (W = !0, G.onceZero(function() {
          function $(_, I) {
            g._removeFile(f, _, I);
          }
          a(J, $, function(_, I) {
            if (_) return B(_);
            K.storageErrors = I, B(K);
          });
        }));
      }
      function V(K, $) {
        X(new o(K, $));
      }
      T.on("field", function(K, $, { nameTruncated: _, valueTruncated: I }) {
        if (K == null) return V("MISSING_FIELD_NAME");
        if (_) return V("LIMIT_FIELD_KEY");
        if (I) return V("LIMIT_FIELD_VALUE", K);
        if (x && Object.prototype.hasOwnProperty.call(x, "fieldNameSize") && K.length > x.fieldNameSize)
          return V("LIMIT_FIELD_KEY");
        r(f.body, K, $);
      }), T.on("file", function(K, $, { filename: _, encoding: I, mimeType: N }) {
        var U = !1;
        if ($.on("error", function(k) {
          U && G.decrement(), X(k);
        }), K == null) return V("MISSING_FIELD_NAME");
        if (!_) return $.resume();
        if (x && Object.prototype.hasOwnProperty.call(x, "fieldNameSize") && K.length > x.fieldNameSize)
          return V("LIMIT_FIELD_KEY");
        var C = {
          fieldname: K,
          originalname: _,
          encoding: I,
          mimetype: N
        }, L = j.insertPlaceholder(C);
        v(f, C, function(k, M) {
          if (k)
            return j.removePlaceholder(L), X(k);
          if (!M)
            return j.removePlaceholder(L), $.resume();
          var F = !1;
          U = !0, G.increment(), Object.defineProperty(C, "stream", {
            configurable: !0,
            enumerable: !1,
            value: $
          }), $.on("limit", function() {
            F = !0, V("LIMIT_FILE_SIZE", K);
          }), g._handleFile(f, C, function(A, O) {
            if (F)
              return j.removePlaceholder(L), J.push(n(C, O)), G.decrement();
            if (A)
              return j.removePlaceholder(L), G.decrement(), X(A);
            var Z = n(C, O);
            j.replacePlaceholder(L, Z), J.push(Z), G.decrement(), D();
          });
        });
      }), T.on("error", function(K) {
        X(K);
      }), T.on("partsLimit", function() {
        V("LIMIT_PART_COUNT");
      }), T.on("filesLimit", function() {
        V("LIMIT_FILE_COUNT");
      }), T.on("fieldsLimit", function() {
        V("LIMIT_FIELD_COUNT");
      }), T.on("close", function() {
        Y = !0, D();
      }), f.pipe(T);
    };
  }
  return Px = u, Px;
}
var Dx, tP;
function sce() {
  if (tP) return Dx;
  tP = 1;
  var t = de, e = Pn, n = be, r = Si, i = J6();
  function o(c, u, l) {
    r.randomBytes(16, function(d, f) {
      l(d, d ? void 0 : f.toString("hex"));
    });
  }
  function s(c, u, l) {
    l(null, e.tmpdir());
  }
  function a(c) {
    this.getFilename = c.filename || o, typeof c.destination == "string" ? (i.sync(c.destination), this.getDestination = function(u, l, d) {
      d(null, c.destination);
    }) : this.getDestination = c.destination || s;
  }
  return a.prototype._handleFile = function(u, l, d) {
    var f = this;
    f.getDestination(u, l, function(m, h) {
      if (m) return d(m);
      f.getFilename(u, l, function(y, x) {
        if (y) return d(y);
        var g = n.join(h, x), v = t.createWriteStream(g);
        l.stream.pipe(v), v.on("error", d), v.on("finish", function() {
          d(null, {
            destination: h,
            filename: x,
            path: g,
            size: v.bytesWritten
          });
        });
      });
    });
  }, a.prototype._removeFile = function(u, l, d) {
    var f = l.path;
    delete l.destination, delete l.filename, delete l.path, t.unlink(f, d);
  }, Dx = function(c) {
    return new a(c);
  }, Dx;
}
var Fx, nP;
function ace() {
  if (nP) return Fx;
  nP = 1;
  var t = Object.prototype.toString, e = typeof Buffer < "u" && typeof Buffer.alloc == "function" && typeof Buffer.allocUnsafe == "function" && typeof Buffer.from == "function";
  function n(s) {
    return t.call(s).slice(8, -1) === "ArrayBuffer";
  }
  function r(s, a, c) {
    a >>>= 0;
    var u = s.byteLength - a;
    if (u < 0)
      throw new RangeError("'offset' is out of bounds");
    if (c === void 0)
      c = u;
    else if (c >>>= 0, c > u)
      throw new RangeError("'length' is out of bounds");
    return e ? Buffer.from(s.slice(a, a + c)) : new Buffer(new Uint8Array(s.slice(a, a + c)));
  }
  function i(s, a) {
    if ((typeof a != "string" || a === "") && (a = "utf8"), !Buffer.isEncoding(a))
      throw new TypeError('"encoding" must be a valid string encoding');
    return e ? Buffer.from(s, a) : new Buffer(s, a);
  }
  function o(s, a, c) {
    if (typeof s == "number")
      throw new TypeError('"value" argument must not be a number');
    return n(s) ? r(s, a, c) : typeof s == "string" ? i(s, a) : e ? Buffer.from(s) : new Buffer(s);
  }
  return Fx = o, Fx;
}
var Ox = {}, rP;
function cce() {
  return rP || (rP = 1, (function(t) {
    var e = void 0, n = 1e5, r = /* @__PURE__ */ (function() {
      var N = Object.prototype.toString, U = Object.prototype.hasOwnProperty;
      return {
        // Class returns internal [[Class]] property, used to avoid cross-frame instanceof issues:
        Class: function(C) {
          return N.call(C).replace(/^\[object *|\]$/g, "");
        },
        HasProperty: function(C, L) {
          return L in C;
        },
        HasOwnProperty: function(C, L) {
          return U.call(C, L);
        },
        IsCallable: function(C) {
          return typeof C == "function";
        },
        ToInt32: function(C) {
          return C >> 0;
        },
        ToUint32: function(C) {
          return C >>> 0;
        }
      };
    })(), i = Math.LN2, o = Math.abs, s = Math.floor, a = Math.log, c = Math.min, u = Math.pow, l = Math.round;
    function d(N) {
      if (m && f) {
        var U = m(N), C;
        for (C = 0; C < U.length; C += 1)
          f(N, U[C], {
            value: N[U[C]],
            writable: !1,
            enumerable: !1,
            configurable: !1
          });
      }
    }
    var f;
    Object.defineProperty && (function() {
      try {
        return Object.defineProperty({}, "x", {}), !0;
      } catch {
        return !1;
      }
    })() ? f = Object.defineProperty : f = function(N, U, C) {
      if (!N === Object(N)) throw new TypeError("Object.defineProperty called on non-object");
      return r.HasProperty(C, "get") && Object.prototype.__defineGetter__ && Object.prototype.__defineGetter__.call(N, U, C.get), r.HasProperty(C, "set") && Object.prototype.__defineSetter__ && Object.prototype.__defineSetter__.call(N, U, C.set), r.HasProperty(C, "value") && (N[U] = C.value), N;
    };
    var m = Object.getOwnPropertyNames || function(N) {
      if (N !== Object(N)) throw new TypeError("Object.getOwnPropertyNames called on non-object");
      var U = [], C;
      for (C in N)
        r.HasOwnProperty(N, C) && U.push(C);
      return U;
    };
    function h(N) {
      if (!f)
        return;
      if (N.length > n) throw new RangeError("Array too large for polyfill");
      function U(L) {
        f(N, L, {
          get: function() {
            return N._getter(L);
          },
          set: function(k) {
            N._setter(L, k);
          },
          enumerable: !0,
          configurable: !1
        });
      }
      var C;
      for (C = 0; C < N.length; C += 1)
        U(C);
    }
    function y(N, U) {
      var C = 32 - U;
      return N << C >> C;
    }
    function x(N, U) {
      var C = 32 - U;
      return N << C >>> C;
    }
    function g(N) {
      return [N & 255];
    }
    function v(N) {
      return y(N[0], 8);
    }
    function S(N) {
      return [N & 255];
    }
    function E(N) {
      return x(N[0], 8);
    }
    function T(N) {
      return N = l(Number(N)), [N < 0 ? 0 : N > 255 ? 255 : N & 255];
    }
    function j(N) {
      return [N >> 8 & 255, N & 255];
    }
    function q(N) {
      return y(N[0] << 8 | N[1], 16);
    }
    function Y(N) {
      return [N >> 8 & 255, N & 255];
    }
    function W(N) {
      return x(N[0] << 8 | N[1], 16);
    }
    function G(N) {
      return [N >> 24 & 255, N >> 16 & 255, N >> 8 & 255, N & 255];
    }
    function J(N) {
      return y(N[0] << 24 | N[1] << 16 | N[2] << 8 | N[3], 32);
    }
    function B(N) {
      return [N >> 24 & 255, N >> 16 & 255, N >> 8 & 255, N & 255];
    }
    function D(N) {
      return x(N[0] << 24 | N[1] << 16 | N[2] << 8 | N[3], 32);
    }
    function X(N, U, C) {
      var L = (1 << U - 1) - 1, k, M, F, A, O, Z, ee;
      function P(Q) {
        var z = s(Q), se = Q - z;
        return se < 0.5 ? z : se > 0.5 || z % 2 ? z + 1 : z;
      }
      for (N !== N ? (M = (1 << U) - 1, F = u(2, C - 1), k = 0) : N === 1 / 0 || N === -1 / 0 ? (M = (1 << U) - 1, F = 0, k = N < 0 ? 1 : 0) : N === 0 ? (M = 0, F = 0, k = 1 / N === -1 / 0 ? 1 : 0) : (k = N < 0, N = o(N), N >= u(2, 1 - L) ? (M = c(s(a(N) / i), 1023), F = P(N / u(2, M) * u(2, C)), F / u(2, C) >= 2 && (M = M + 1, F = 1), M > L ? (M = (1 << U) - 1, F = 0) : (M = M + L, F = F - u(2, C))) : (M = 0, F = P(N / u(2, 1 - L - C)))), O = [], A = C; A; A -= 1)
        O.push(F % 2 ? 1 : 0), F = s(F / 2);
      for (A = U; A; A -= 1)
        O.push(M % 2 ? 1 : 0), M = s(M / 2);
      for (O.push(k ? 1 : 0), O.reverse(), Z = O.join(""), ee = []; Z.length; )
        ee.push(parseInt(Z.substring(0, 8), 2)), Z = Z.substring(8);
      return ee;
    }
    function V(N, U, C) {
      var L = [], k, M, F, A, O, Z, ee, P;
      for (k = N.length; k; k -= 1)
        for (F = N[k - 1], M = 8; M; M -= 1)
          L.push(F % 2 ? 1 : 0), F = F >> 1;
      return L.reverse(), A = L.join(""), O = (1 << U - 1) - 1, Z = parseInt(A.substring(0, 1), 2) ? -1 : 1, ee = parseInt(A.substring(1, 1 + U), 2), P = parseInt(A.substring(1 + U), 2), ee === (1 << U) - 1 ? P !== 0 ? NaN : Z * (1 / 0) : ee > 0 ? Z * u(2, ee - O) * (1 + P / u(2, C)) : P !== 0 ? Z * u(2, -(O - 1)) * (P / u(2, C)) : Z < 0 ? -0 : 0;
    }
    function K(N) {
      return V(N, 11, 52);
    }
    function $(N) {
      return X(N, 11, 52);
    }
    function _(N) {
      return V(N, 8, 23);
    }
    function I(N) {
      return X(N, 8, 23);
    }
    (function() {
      var N = function(z) {
        if (z = r.ToInt32(z), z < 0) throw new RangeError("ArrayBuffer size is not a small enough positive integer");
        this.byteLength = z, this._bytes = [], this._bytes.length = z;
        var se;
        for (se = 0; se < this.byteLength; se += 1)
          this._bytes[se] = 0;
        d(this);
      };
      t.ArrayBuffer = t.ArrayBuffer || N;
      var U = function() {
      };
      function C(Q, z, se) {
        var ae;
        return ae = function(ie, we, Oe) {
          var He, We, Ye, Ke;
          if (!arguments.length || typeof arguments[0] == "number") {
            if (this.length = r.ToInt32(arguments[0]), Oe < 0) throw new RangeError("ArrayBufferView size is not a small enough positive integer");
            this.byteLength = this.length * this.BYTES_PER_ELEMENT, this.buffer = new N(this.byteLength), this.byteOffset = 0;
          } else if (typeof arguments[0] == "object" && arguments[0].constructor === ae)
            for (He = arguments[0], this.length = He.length, this.byteLength = this.length * this.BYTES_PER_ELEMENT, this.buffer = new N(this.byteLength), this.byteOffset = 0, Ye = 0; Ye < this.length; Ye += 1)
              this._setter(Ye, He._getter(Ye));
          else if (typeof arguments[0] == "object" && !(arguments[0] instanceof N || r.Class(arguments[0]) === "ArrayBuffer"))
            for (We = arguments[0], this.length = r.ToUint32(We.length), this.byteLength = this.length * this.BYTES_PER_ELEMENT, this.buffer = new N(this.byteLength), this.byteOffset = 0, Ye = 0; Ye < this.length; Ye += 1)
              Ke = We[Ye], this._setter(Ye, Number(Ke));
          else if (typeof arguments[0] == "object" && (arguments[0] instanceof N || r.Class(arguments[0]) === "ArrayBuffer")) {
            if (this.buffer = ie, this.byteOffset = r.ToUint32(we), this.byteOffset > this.buffer.byteLength)
              throw new RangeError("byteOffset out of range");
            if (this.byteOffset % this.BYTES_PER_ELEMENT)
              throw new RangeError("ArrayBuffer length minus the byteOffset is not a multiple of the element size.");
            if (arguments.length < 3) {
              if (this.byteLength = this.buffer.byteLength - this.byteOffset, this.byteLength % this.BYTES_PER_ELEMENT)
                throw new RangeError("length of buffer minus byteOffset not a multiple of the element size");
              this.length = this.byteLength / this.BYTES_PER_ELEMENT;
            } else
              this.length = r.ToUint32(Oe), this.byteLength = this.length * this.BYTES_PER_ELEMENT;
            if (this.byteOffset + this.byteLength > this.buffer.byteLength)
              throw new RangeError("byteOffset and length reference an area beyond the end of the buffer");
          } else
            throw new TypeError("Unexpected argument type(s)");
          this.constructor = ae, d(this), h(this);
        }, ae.prototype = new U(), ae.prototype.BYTES_PER_ELEMENT = Q, ae.prototype._pack = z, ae.prototype._unpack = se, ae.BYTES_PER_ELEMENT = Q, ae.prototype._getter = function(ie) {
          if (arguments.length < 1) throw new SyntaxError("Not enough arguments");
          if (ie = r.ToUint32(ie), ie >= this.length)
            return e;
          var we = [], Oe, He;
          for (Oe = 0, He = this.byteOffset + ie * this.BYTES_PER_ELEMENT; Oe < this.BYTES_PER_ELEMENT; Oe += 1, He += 1)
            we.push(this.buffer._bytes[He]);
          return this._unpack(we);
        }, ae.prototype.get = ae.prototype._getter, ae.prototype._setter = function(ie, we) {
          if (arguments.length < 2) throw new SyntaxError("Not enough arguments");
          if (ie = r.ToUint32(ie), ie >= this.length)
            return e;
          var Oe = this._pack(we), He, We;
          for (He = 0, We = this.byteOffset + ie * this.BYTES_PER_ELEMENT; He < this.BYTES_PER_ELEMENT; He += 1, We += 1)
            this.buffer._bytes[We] = Oe[He];
        }, ae.prototype.set = function(ie, we) {
          if (arguments.length < 1) throw new SyntaxError("Not enough arguments");
          var Oe, He, We, Ye, Ke, nt, qe, Nt, Er, st;
          if (typeof arguments[0] == "object" && arguments[0].constructor === this.constructor) {
            if (Oe = arguments[0], We = r.ToUint32(arguments[1]), We + Oe.length > this.length)
              throw new RangeError("Offset plus length of array is out of range");
            if (Nt = this.byteOffset + We * this.BYTES_PER_ELEMENT, Er = Oe.length * this.BYTES_PER_ELEMENT, Oe.buffer === this.buffer) {
              for (st = [], Ke = 0, nt = Oe.byteOffset; Ke < Er; Ke += 1, nt += 1)
                st[Ke] = Oe.buffer._bytes[nt];
              for (Ke = 0, qe = Nt; Ke < Er; Ke += 1, qe += 1)
                this.buffer._bytes[qe] = st[Ke];
            } else
              for (Ke = 0, nt = Oe.byteOffset, qe = Nt; Ke < Er; Ke += 1, nt += 1, qe += 1)
                this.buffer._bytes[qe] = Oe.buffer._bytes[nt];
          } else if (typeof arguments[0] == "object" && typeof arguments[0].length < "u") {
            if (He = arguments[0], Ye = r.ToUint32(He.length), We = r.ToUint32(arguments[1]), We + Ye > this.length)
              throw new RangeError("Offset plus length of array is out of range");
            for (Ke = 0; Ke < Ye; Ke += 1)
              nt = He[Ke], this._setter(We + Ke, Number(nt));
          } else
            throw new TypeError("Unexpected argument type(s)");
        }, ae.prototype.subarray = function(ie, we) {
          function Oe(We, Ye, Ke) {
            return We < Ye ? Ye : We > Ke ? Ke : We;
          }
          ie = r.ToInt32(ie), we = r.ToInt32(we), arguments.length < 1 && (ie = 0), arguments.length < 2 && (we = this.length), ie < 0 && (ie = this.length + ie), we < 0 && (we = this.length + we), ie = Oe(ie, 0, this.length), we = Oe(we, 0, this.length);
          var He = we - ie;
          return He < 0 && (He = 0), new this.constructor(
            this.buffer,
            this.byteOffset + ie * this.BYTES_PER_ELEMENT,
            He
          );
        }, ae;
      }
      var L = C(1, g, v), k = C(1, S, E), M = C(1, T, E), F = C(2, j, q), A = C(2, Y, W), O = C(4, G, J), Z = C(4, B, D), ee = C(4, I, _), P = C(8, $, K);
      t.Int8Array = t.Int8Array || L, t.Uint8Array = t.Uint8Array || k, t.Uint8ClampedArray = t.Uint8ClampedArray || M, t.Int16Array = t.Int16Array || F, t.Uint16Array = t.Uint16Array || A, t.Int32Array = t.Int32Array || O, t.Uint32Array = t.Uint32Array || Z, t.Float32Array = t.Float32Array || ee, t.Float64Array = t.Float64Array || P;
    })(), (function() {
      function N(M, F) {
        return r.IsCallable(M.get) ? M.get(F) : M[F];
      }
      var U = (function() {
        var M = new t.Uint16Array([4660]), F = new t.Uint8Array(M.buffer);
        return N(F, 0) === 18;
      })(), C = function(F, A, O) {
        if (arguments.length === 0)
          F = new t.ArrayBuffer(0);
        else if (!(F instanceof t.ArrayBuffer || r.Class(F) === "ArrayBuffer"))
          throw new TypeError("TypeError");
        if (this.buffer = F || new t.ArrayBuffer(0), this.byteOffset = r.ToUint32(A), this.byteOffset > this.buffer.byteLength)
          throw new RangeError("byteOffset out of range");
        if (arguments.length < 3 ? this.byteLength = this.buffer.byteLength - this.byteOffset : this.byteLength = r.ToUint32(O), this.byteOffset + this.byteLength > this.buffer.byteLength)
          throw new RangeError("byteOffset and length reference an area beyond the end of the buffer");
        d(this);
      };
      function L(M) {
        return function(F, A) {
          if (F = r.ToUint32(F), F + M.BYTES_PER_ELEMENT > this.byteLength)
            throw new RangeError("Array index out of range");
          F += this.byteOffset;
          var O = new t.Uint8Array(this.buffer, F, M.BYTES_PER_ELEMENT), Z = [], ee;
          for (ee = 0; ee < M.BYTES_PER_ELEMENT; ee += 1)
            Z.push(N(O, ee));
          return !!A == !!U && Z.reverse(), N(new M(new t.Uint8Array(Z).buffer), 0);
        };
      }
      C.prototype.getUint8 = L(t.Uint8Array), C.prototype.getInt8 = L(t.Int8Array), C.prototype.getUint16 = L(t.Uint16Array), C.prototype.getInt16 = L(t.Int16Array), C.prototype.getUint32 = L(t.Uint32Array), C.prototype.getInt32 = L(t.Int32Array), C.prototype.getFloat32 = L(t.Float32Array), C.prototype.getFloat64 = L(t.Float64Array);
      function k(M) {
        return function(F, A, O) {
          if (F = r.ToUint32(F), F + M.BYTES_PER_ELEMENT > this.byteLength)
            throw new RangeError("Array index out of range");
          var Z = new M([A]), ee = new t.Uint8Array(Z.buffer), P = [], Q, z;
          for (Q = 0; Q < M.BYTES_PER_ELEMENT; Q += 1)
            P.push(N(ee, Q));
          !!O == !!U && P.reverse(), z = new t.Uint8Array(this.buffer, F, M.BYTES_PER_ELEMENT), z.set(P);
        };
      }
      C.prototype.setUint8 = k(t.Uint8Array), C.prototype.setInt8 = k(t.Int8Array), C.prototype.setUint16 = k(t.Uint16Array), C.prototype.setInt16 = k(t.Int16Array), C.prototype.setUint32 = k(t.Uint32Array), C.prototype.setInt32 = k(t.Int32Array), C.prototype.setFloat32 = k(t.Float32Array), C.prototype.setFloat64 = k(t.Float64Array), t.DataView = t.DataView || C;
    })();
  })(Ox)), Ox;
}
var Mx, iP;
function uce() {
  if (iP) return Mx;
  iP = 1;
  var t = yc().Writable, e = fo(), n = ace();
  if (typeof Uint8Array > "u")
    var r = cce().Uint8Array;
  else
    var r = Uint8Array;
  function i(d, f) {
    if (!(this instanceof i)) return new i(d, f);
    typeof d == "function" && (f = d, d = {}), d || (d = {});
    var m = d.encoding, h = !1;
    m ? (m = String(m).toLowerCase(), (m === "u8" || m === "uint8") && (m = "uint8array")) : h = !0, t.call(this, { objectMode: !0 }), this.encoding = m, this.shouldInferEncoding = h, f && this.on("finish", function() {
      f(this.getBody());
    }), this.body = [];
  }
  Mx = i, e(i, t), i.prototype._write = function(d, f, m) {
    this.body.push(d), m();
  }, i.prototype.inferEncoding = function(d) {
    var f = d === void 0 ? this.body[0] : d;
    return Buffer.isBuffer(f) ? "buffer" : typeof Uint8Array < "u" && f instanceof Uint8Array ? "uint8array" : Array.isArray(f) ? "array" : typeof f == "string" ? "string" : Object.prototype.toString.call(f) === "[object Object]" ? "object" : "buffer";
  }, i.prototype.getBody = function() {
    return !this.encoding && this.body.length === 0 ? [] : (this.shouldInferEncoding && (this.encoding = this.inferEncoding()), this.encoding === "array" ? u(this.body) : this.encoding === "string" ? a(this.body) : this.encoding === "buffer" ? c(this.body) : this.encoding === "uint8array" ? l(this.body) : this.body);
  };
  function o(d) {
    return /Array\]$/.test(Object.prototype.toString.call(d));
  }
  function s(d) {
    return typeof d == "string" || o(d) || d && typeof d.subarray == "function";
  }
  function a(d) {
    for (var f = [], m = 0; m < d.length; m++) {
      var h = d[m];
      typeof h == "string" || Buffer.isBuffer(h) ? f.push(h) : s(h) ? f.push(n(h)) : f.push(n(String(h)));
    }
    return Buffer.isBuffer(d[0]) ? (f = Buffer.concat(f), f = f.toString("utf8")) : f = f.join(""), f;
  }
  function c(d) {
    for (var f = [], m = 0; m < d.length; m++) {
      var h = d[m];
      Buffer.isBuffer(h) ? f.push(h) : s(h) ? f.push(n(h)) : f.push(n(String(h)));
    }
    return Buffer.concat(f);
  }
  function u(d) {
    for (var f = [], m = 0; m < d.length; m++)
      f.push.apply(f, d[m]);
    return f;
  }
  function l(d) {
    for (var f = 0, m = 0; m < d.length; m++)
      typeof d[m] == "string" && (d[m] = n(d[m])), f += d[m].length;
    for (var h = new r(f), m = 0, y = 0; m < d.length; m++)
      for (var x = d[m], g = 0; g < x.length; g++)
        h[y++] = x[g];
    return h;
  }
  return Mx;
}
var Rx, oP;
function lce() {
  if (oP) return Rx;
  oP = 1;
  var t = uce();
  function e(n) {
  }
  return e.prototype._handleFile = function(r, i, o) {
    i.stream.pipe(t({ encoding: "buffer" }, function(s) {
      o(null, {
        buffer: s,
        size: s.length
      });
    }));
  }, e.prototype._removeFile = function(r, i, o) {
    delete i.buffer, o(null);
  }, Rx = function(n) {
    return new e();
  }, Rx;
}
var sP;
function pce() {
  if (sP) return Bc.exports;
  sP = 1;
  var t = oce(), e = sce(), n = lce(), r = QR();
  function i(a, c, u) {
    u(null, !0);
  }
  function o(a) {
    a.storage ? this.storage = a.storage : a.dest ? this.storage = e({ destination: a.dest }) : this.storage = n(), this.limits = a.limits, this.preservePath = a.preservePath, this.fileFilter = a.fileFilter || i;
  }
  o.prototype._makeMiddleware = function(a, c) {
    function u() {
      var l = this.fileFilter, d = /* @__PURE__ */ Object.create(null);
      a.forEach(function(m) {
        typeof m.maxCount == "number" ? d[m.name] = m.maxCount : d[m.name] = 1 / 0;
      });
      function f(m, h, y) {
        if ((d[h.fieldname] || 0) <= 0)
          return y(new r("LIMIT_UNEXPECTED_FILE", h.fieldname));
        d[h.fieldname] -= 1, l(m, h, y);
      }
      return {
        limits: this.limits,
        preservePath: this.preservePath,
        storage: this.storage,
        fileFilter: f,
        fileStrategy: c
      };
    }
    return t(u.bind(this));
  }, o.prototype.single = function(a) {
    return this._makeMiddleware([{ name: a, maxCount: 1 }], "VALUE");
  }, o.prototype.array = function(a, c) {
    return this._makeMiddleware([{ name: a, maxCount: c }], "ARRAY");
  }, o.prototype.fields = function(a) {
    return this._makeMiddleware(a, "OBJECT");
  }, o.prototype.none = function() {
    return this._makeMiddleware([], "NONE");
  }, o.prototype.any = function() {
    function a() {
      return {
        limits: this.limits,
        preservePath: this.preservePath,
        storage: this.storage,
        fileFilter: this.fileFilter,
        fileStrategy: "ARRAY"
      };
    }
    return t(a.bind(this));
  };
  function s(a) {
    if (a === void 0)
      return new o({});
    if (typeof a == "object" && a !== null)
      return new o(a);
    throw new TypeError("Expected object for argument options");
  }
  return Bc.exports = s, Bc.exports.diskStorage = e, Bc.exports.memoryStorage = n, Bc.exports.MulterError = r, Bc.exports;
}
var dce = pce();
const ds = /* @__PURE__ */ Bo(dce), fce = p.Object({
  name: p.String({ default: "http-server" }),
  enable: p.Boolean({ default: !1 }),
  port: p.Number({ default: 3e3 }),
  host: p.String({ default: "127.0.0.1" }),
  enableCors: p.Boolean({ default: !0 }),
  enableWebsocket: p.Boolean({ default: !1 }),
  messagePostFormat: p.String({ default: "array" }),
  token: p.String({ default: "" }),
  debug: p.Boolean({ default: !1 })
}), hce = p.Object({
  name: p.String({ default: "http-sse-server" }),
  enable: p.Boolean({ default: !1 }),
  port: p.Number({ default: 3e3 }),
  host: p.String({ default: "127.0.0.1" }),
  enableCors: p.Boolean({ default: !0 }),
  enableWebsocket: p.Boolean({ default: !1 }),
  messagePostFormat: p.String({ default: "array" }),
  token: p.String({ default: "" }),
  debug: p.Boolean({ default: !1 }),
  reportSelfMessage: p.Boolean({ default: !1 })
}), mce = p.Object({
  name: p.String({ default: "http-client" }),
  enable: p.Boolean({ default: !1 }),
  url: p.String({ default: "http://localhost:8080" }),
  messagePostFormat: p.String({ default: "array" }),
  reportSelfMessage: p.Boolean({ default: !1 }),
  token: p.String({ default: "" }),
  debug: p.Boolean({ default: !1 })
}), gce = p.Object({
  name: p.String({ default: "websocket-server" }),
  enable: p.Boolean({ default: !1 }),
  host: p.String({ default: "127.0.0.1" }),
  port: p.Number({ default: 3001 }),
  messagePostFormat: p.String({ default: "array" }),
  reportSelfMessage: p.Boolean({ default: !1 }),
  token: p.String({ default: "" }),
  enableForcePushEvent: p.Boolean({ default: !0 }),
  debug: p.Boolean({ default: !1 }),
  heartInterval: p.Number({ default: 3e4 })
}), yce = p.Object({
  name: p.String({ default: "websocket-client" }),
  enable: p.Boolean({ default: !1 }),
  url: p.String({ default: "ws://localhost:8082" }),
  messagePostFormat: p.String({ default: "array" }),
  reportSelfMessage: p.Boolean({ default: !1 }),
  reconnectInterval: p.Number({ default: 5e3 }),
  token: p.String({ default: "" }),
  debug: p.Boolean({ default: !1 }),
  heartInterval: p.Number({ default: 3e4 })
}), vce = p.Object({
  name: p.String({ default: "plugin" }),
  enable: p.Boolean({ default: !1 }),
  messagePostFormat: p.String({ default: "array" }),
  reportSelfMessage: p.Boolean({ default: !1 }),
  debug: p.Boolean({ default: !1 })
}), bce = p.Object({
  httpServers: p.Array(fce, { default: [] }),
  httpSseServers: p.Array(hce, { default: [] }),
  httpClients: p.Array(mce, { default: [] }),
  websocketServers: p.Array(gce, { default: [] }),
  websocketClients: p.Array(yce, { default: [] }),
  plugins: p.Array(vce, { default: [] })
}, { default: {} }), xce = p.Object({
  baseTimeout: p.Number({ default: 1e4 }),
  uploadSpeedKBps: p.Number({ default: 256 }),
  downloadSpeedKBps: p.Number({ default: 256 }),
  maxTimeout: p.Number({ default: 18e5 })
}, { default: {} }), aP = p.Object({
  network: bce,
  musicSignUrl: p.String({ default: "" }),
  enableLocalFile2Url: p.Boolean({ default: !1 }),
  parseMultMsg: p.Boolean({ default: !1 }),
  imageDownloadProxy: p.String({ default: "" }),
  timeout: xce
});
function GR(t) {
  let e = t;
  e = Za(aP, e);
  const n = wu.Compile(aP);
  if (!n.Check(e)) {
    const i = [...n.Errors(e)].map((o) => o.message).join(", ");
    throw new Error(i);
  }
  return e;
}
class wce {
  store = /* @__PURE__ */ new Map();
  set(e, n, r) {
    this.store.set(e, n), r && setTimeout(() => this.store.delete(e), r * 1e3);
  }
  get(e) {
    return this.store.get(e) ?? null;
  }
  exists(...e) {
    return e.filter((n) => this.store.has(n)).length;
  }
}
const Rp = new wce();
var _0 = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.Shell = 1] = "Shell", t[t.Framework = 2] = "Framework", t))(_0 || {});
const et = {
  workingEnv: _0.Unknown,
  LoginCurrentTime: Date.now(),
  LoginCurrentRate: 0,
  QQLoginStatus: !1,
  // 已实现 但太傻了 得去那边注册个回调刷新
  QQQRCodeURL: "",
  QQLoginUin: "",
  QQLoginInfo: {
    uid: "",
    uin: "",
    nick: ""
  },
  QQLoginError: "",
  QQVersion: "unknown",
  QQDataPath: "",
  OneBotContext: null,
  onQQLoginStatusChange: async (t) => {
    et.QQLoginStatus = t;
  },
  onWebUiTokenChange: async (t) => {
  },
  onRefreshQRCode: async () => {
  },
  NapCatHelper: {
    onOB11ConfigChanged: async () => {
    },
    onQuickLoginRequested: async () => ({ result: !1, message: "" }),
    onPasswordLoginRequested: async () => ({ result: !1, message: "密码登录功能未初始化" }),
    onCaptchaLoginRequested: async () => ({ result: !1, message: "验证码登录功能未初始化" }),
    onNewDeviceLoginRequested: async () => ({ result: !1, message: "新设备登录功能未初始化" }),
    onRestartProcessRequested: async () => ({ result: !1, message: "重启功能未初始化" }),
    QQLoginList: [],
    NewQQLoginList: []
  },
  NapCatVersion: Hu,
  WebUiConfigQuickFunction: async () => {
  }
}, ve = {
  setWorkingEnv(t) {
    et.workingEnv = t;
  },
  getWorkingEnv() {
    return et.workingEnv;
  },
  setWebUiTokenChangeCallback(t) {
    et.onWebUiTokenChange = t;
  },
  getWebUiTokenChangeCallback() {
    return et.onWebUiTokenChange;
  },
  checkLoginRate(t, e) {
    const n = `login_rate:${t}`, r = Rp.get(n) || 0;
    return r === 0 ? (Rp.set(n, 1, 60), !0) : r >= e ? !1 : (Rp.set(n, r + 1), !0);
  },
  getQQLoginStatus() {
    return et.QQLoginStatus;
  },
  setQQLoginCallback(t) {
    et.onQQLoginStatusChange = t;
  },
  getQQLoginCallback() {
    return et.onQQLoginStatusChange;
  },
  setQQLoginStatus(t) {
    et.QQLoginStatus = t;
  },
  setQQLoginQrcodeURL(t) {
    et.QQQRCodeURL = t;
  },
  getQQLoginQrcodeURL() {
    return et.QQQRCodeURL;
  },
  setQQLoginInfo(t) {
    et.QQLoginInfo = t, et.QQLoginUin = t.uin.toString();
  },
  getQQLoginInfo() {
    return et.QQLoginInfo;
  },
  getQQLoginUin() {
    return et.QQLoginUin;
  },
  getQQQuickLoginList() {
    return et.NapCatHelper.QQLoginList;
  },
  setQQQuickLoginList(t) {
    et.NapCatHelper.QQLoginList = t;
  },
  getQQNewLoginList() {
    return et.NapCatHelper.NewQQLoginList;
  },
  setQQNewLoginList(t) {
    et.NapCatHelper.NewQQLoginList = t;
  },
  setQuickLoginCall(t) {
    et.NapCatHelper.onQuickLoginRequested = t;
  },
  requestQuickLogin: function(t) {
    return et.NapCatHelper.onQuickLoginRequested(t);
  },
  setPasswordLoginCall(t) {
    et.NapCatHelper.onPasswordLoginRequested = t;
  },
  requestPasswordLogin: function(t, e) {
    return et.NapCatHelper.onPasswordLoginRequested(t, e);
  },
  setCaptchaLoginCall(t) {
    et.NapCatHelper.onCaptchaLoginRequested = t;
  },
  requestCaptchaLogin: function(t, e, n, r, i) {
    return et.NapCatHelper.onCaptchaLoginRequested(t, e, n, r, i);
  },
  setNewDeviceLoginCall(t) {
    et.NapCatHelper.onNewDeviceLoginRequested = t;
  },
  requestNewDeviceLogin: function(t, e, n) {
    return et.NapCatHelper.onNewDeviceLoginRequested(t, e, n);
  },
  setOnOB11ConfigChanged(t) {
    et.NapCatHelper.onOB11ConfigChanged = t;
  },
  setOB11Config: function(t) {
    return et.NapCatHelper.onOB11ConfigChanged(t);
  },
  GetNapCatVersion() {
    return et.NapCatVersion;
  },
  setQQVersion(t) {
    et.QQVersion = t;
  },
  getQQVersion() {
    return et.QQVersion;
  },
  setQQDataPath(t) {
    et.QQDataPath = t;
  },
  getQQDataPath() {
    return et.QQDataPath;
  },
  setWebUiConfigQuickFunction(t) {
    et.WebUiConfigQuickFunction = t;
  },
  runWebUiConfigQuickFunction: async function() {
    await et.WebUiConfigQuickFunction();
  },
  setOneBotContext(t) {
    et.OneBotContext = t;
  },
  getOneBotContext() {
    return et.OneBotContext;
  },
  setRestartProcessCall(t) {
    et.NapCatHelper.onRestartProcessRequested = t;
  },
  requestRestartProcess: async function() {
    return await et.NapCatHelper.onRestartProcessRequested();
  },
  setQQLoginError(t) {
    et.QQLoginError = t;
  },
  getQQLoginError() {
    return et.QQLoginError;
  },
  setRefreshQRCodeCallback(t) {
    et.onRefreshQRCode = t;
  },
  getRefreshQRCodeCallback() {
    return et.onRefreshQRCode;
  },
  refreshQRCode: async function() {
    et.QQLoginError = "", await et.onRefreshQRCode();
  }
};
var td = /* @__PURE__ */ ((t) => (t[t.OK = 200] = "OK", t[t.BadRequest = 400] = "BadRequest", t[t.Unauthorized = 401] = "Unauthorized", t[t.Forbidden = 403] = "Forbidden", t[t.NotFound = 404] = "NotFound", t[t.InternalServerError = 500] = "InternalServerError", t))(td || {}), NA = /* @__PURE__ */ ((t) => (t[t.Success = 0] = "Success", t[t.Error = -1] = "Error", t))(NA || {});
const ne = (t, e = "error", n = !1) => {
  const r = {
    code: NA.Error,
    message: e
  };
  if (n) {
    t.status(td.OK).send(JSON.stringify(r));
    return;
  }
  t.status(td.OK).json(r);
}, me = (t, e, n = "success", r = !1) => {
  const i = {
    code: NA.Success,
    data: e,
    message: n
  };
  if (r) {
    t.status(td.OK).send(JSON.stringify(i));
    return;
  }
  t.status(td.OK).json(i);
}, qn = (t) => t == null || t === "", Sce = (t, e) => {
  if (!ve.getQQLoginStatus())
    return ne(e, "Not Login");
  const r = ve.getQQLoginUin(), i = kn(at.configPath, `./onebot11_${r}.json`);
  try {
    const o = sr(i) ? Fo(i).toString() : Fo(kn(at.configPath, "./onebot11.json")).toString(), s = GR(Ci.parse(o));
    return me(e, s);
  } catch {
    return ne(e, "Config Get Error");
  }
}, _ce = async (t, e) => {
  if (!ve.getQQLoginStatus())
    return ne(e, "Not Login");
  if (qn(t.body.config))
    return ne(e, "config is empty");
  try {
    const r = GR(Ci.parse(t.body.config));
    return await ve.setOB11Config(r), me(e, null);
  } catch (r) {
    return ne(e, "Error: " + r);
  }
}, Ece = async (t, e) => {
  if (!ve.getQQLoginStatus())
    return ne(e, "Not Login");
  try {
    const r = at.configPath;
    if (!sr(r))
      return ne(e, "配置目录不存在");
    const o = `config_backup_${((c) => c.toISOString().replace(/[:.]/g, "-"))(/* @__PURE__ */ new Date())}.zip`;
    e.setHeader("Content-Type", "application/zip"), e.setHeader("Content-Disposition", `attachment; filename="${o}"`);
    const s = new zu.zip.Stream(), a = fO(r, { withFileTypes: !0 });
    for (const c of a)
      if (c.isFile()) {
        const u = yn(r, c.name);
        s.addEntry(u, { relativePath: c.name });
      }
    s.pipe(e), s.on("error", (c) => {
      console.error("压缩流错误:", c), e.headersSent || ne(e, "流式压缩失败");
    });
  } catch (r) {
    const i = r.message;
    if (console.error("导出配置失败:", r), !e.headersSent)
      return ne(e, `导出配置失败: ${i}`);
  }
};
async function Ace(t) {
  return new Promise((e, n) => {
    const r = /* @__PURE__ */ new Map(), i = aO.from(t), o = new zu.zip.UncompressStream();
    o.on("entry", (s, a, c) => {
      if (s.type === "file") {
        const u = [];
        a.on("data", (l) => u.push(Buffer.from(l))), a.on("end", () => {
          const l = s.name.split("/").pop() || s.name;
          r.set(l, Buffer.concat(u)), c();
        }), a.on("error", (l) => {
          console.error(`读取文件失败: ${s.name}`, l), c();
        });
      } else
        a.resume(), c();
    }), o.on("finish", () => e(r)), o.on("error", n), i.pipe(o);
  });
}
const Ice = async (t, e) => {
  if (!t.file || !t.file.buffer)
    return ne(e, "请选择要导入的配置文件");
  try {
    const n = at.configPath, r = await Ace(t.file.buffer);
    if (r.size === 0)
      return ne(e, "配置文件为空或格式不正确");
    const i = /* @__PURE__ */ new Map();
    if (sr(n)) {
      const o = fO(n, { withFileTypes: !0 });
      for (const s of o)
        if (s.isFile()) {
          const a = yn(n, s.name);
          i.set(s.name, Fo(a));
        }
    }
    for (const [o, s] of r) {
      const a = yn(n, o);
      z2(a).startsWith(z2(n)) && z_(a, s);
    }
    return me(e, {
      message: "配置导入成功，重启后生效~",
      filesImported: r.size,
      filesBackedUp: i.size
    });
  } catch (n) {
    console.error("导入配置失败:", n);
    const r = n.message;
    return ne(e, `导入配置失败: ${r}`);
  }
}, Jd = yr(), Cce = ds({
  storage: ds.memoryStorage()
});
Jd.post("/GetConfig", Sce);
Jd.post("/SetConfig", _ce);
Jd.get("/ExportConfig", Ece);
Jd.post("/ImportConfig", Cce.single("configFile"), Ice);
class nn {
  static secretKey = process.env.NAPCAT_WEBUI_JWT_SECRET_KEY || Math.random().toString(36).slice(2);
  static MAX_CREDENTIAL_VALID_SECONDS = 3600;
  static getSecretKey() {
    return nn.secretKey;
  }
  /**
     * 签名凭证方法。
     * @param hash 待签名的凭证字符串。
     * @returns 签名后的凭证对象。
     */
  static signCredential(e) {
    const n = {
      // 统一使用秒级时间戳，避免与校验逻辑出现单位不一致
      CreatedTime: Math.floor(Date.now() / 1e3),
      HashEncoded: e
    }, r = JSON.stringify(n), i = Si.createHmac("sha256", nn.secretKey).update(r, "utf8").digest("hex");
    return { Data: n, Hmac: i };
  }
  /**
     * 检查凭证是否被篡改的方法。
     * @param credentialJson 凭证的JSON对象。
     * @returns 布尔值，表示凭证是否有效。
     */
  static checkCredential(e) {
    try {
      const n = JSON.stringify(e.Data);
      return Si.createHmac("sha256", nn.secretKey).update(n, "utf8").digest("hex") === e.Hmac;
    } catch {
      return !1;
    }
  }
  /**
     * 验证凭证在1小时内有效且token与原始token相同。
     * @param token 待验证的原始token。
     * @param credentialJson 已签名的凭证JSON对象。
     * @returns 布尔值，表示凭证是否有效且token匹配。
     */
  static validateCredentialWithinOneHour(e, n) {
    if (!nn.checkCredential(n) || nn.isCredentialRevoked(n))
      return !1;
    const i = Math.floor(Date.now() / 1e3), o = Math.floor(Number(n.Data.CreatedTime)), s = i - o;
    return s >= 0 && s <= nn.MAX_CREDENTIAL_VALID_SECONDS && n.Data.HashEncoded === nn.generatePasswordHash(e);
  }
  /**
     * 注销指定的Token凭证
     * @param credentialJson 凭证JSON对象
     * @returns void
     */
  static revokeCredential(e) {
    const n = JSON.stringify(e.Data), r = Si.createHmac("sha256", nn.secretKey).update(n, "utf8").digest("hex");
    Rp.set(`revoked:${r}`, !0, 3600);
  }
  /**
     * 检查凭证是否已被注销
     * @param credentialJson 凭证JSON对象
     * @returns 布尔值，表示凭证是否已被注销
     */
  static isCredentialRevoked(e) {
    const n = JSON.stringify(e.Data), r = Si.createHmac("sha256", nn.secretKey).update(n, "utf8").digest("hex");
    return Rp.exists(`revoked:${r}`) > 0;
  }
  /**
     * 生成密码Hash
     * @param password 密码
     * @returns 生成的Hash值
     */
  static generatePasswordHash(e) {
    return Si.createHash("sha256").update(e + ".napcat").digest().toString("hex");
  }
  /**
     * 对比密码和Hash值
     * @param password 密码
     * @param hash Hash值
     * @returns 布尔值，表示密码是否匹配Hash值
     */
  static comparePasswordHash(e, n) {
    return this.generatePasswordHash(e) === n;
  }
}
async function Tce(t, e, n) {
  if (t.url === "/auth/login" || t.url === "/auth/passkey/generate-authentication-options" || t.url === "/auth/passkey/verify-authentication")
    return n();
  let r;
  if (t.headers?.authorization) {
    const i = t.headers.authorization.split(" ");
    if (i.length < 2)
      return ne(e, "Unauthorized");
    r = i[1];
  } else t.query.webui_token && typeof t.query.webui_token == "string" && (r = t.query.webui_token);
  if (r) {
    let i;
    try {
      i = JSON.parse(Buffer.from(r, "base64").toString("utf-8"));
    } catch {
      return ne(e, "Unauthorized");
    }
    const o = ls();
    return o ? nn.validateCredentialWithinOneHour(o, i) ? n() : ne(e, "Unauthorized") : ne(e, "Server token not initialized");
  }
  return ne(e, "Unauthorized");
}
let Ih = null, Bx = null;
function kce() {
  const t = H_(Pg(import.meta.url)), e = process.platform, n = process.arch;
  return xe.join(t, "native", "dpapi", `${e}-${n}`, "@primno+dpapi.node");
}
function qR() {
  if (Ih)
    return Ih;
  if (Bx)
    throw Bx;
  try {
    const t = kce(), e = { exports: {} };
    return process.dlopen(e, t), Ih = e.exports, Ih;
  } catch (t) {
    throw Bx = t, new Error(`Failed to load DPAPI native addon: ${t.message}`);
  }
}
process.platform;
function Nce(t, e, n) {
  return qR().protectData(t, e, n);
}
function Pce(t, e, n) {
  return qR().unprotectData(t, e, n);
}
const Dce = Buffer.from([0, 0, 0, 20]), cP = 16;
function Fce(t) {
  const e = Ge.readFileSync(t);
  return Buffer.from(Pce(e, null, "CurrentUser"));
}
function Oce(t, e) {
  const n = Nce(e, null, "CurrentUser");
  Ge.writeFileSync(t, Buffer.from(n));
}
class fs {
  static getRegistryPath(e) {
    return xe.join(e, "nt_qq", "global", "nt_data", "msf", "Registry20");
  }
  static readGuid(e) {
    if (!Ge.existsSync(e))
      throw new Error("Registry20 file not found");
    if (dt.platform() !== "win32")
      throw new Error("Registry20 decryption is only supported on Windows");
    const n = Fce(e);
    if (n.length < 20)
      throw new Error(`Decrypted data too short (got ${n.length} bytes, need 20)`);
    const r = n.subarray(4, 20), i = Buffer.alloc(16);
    for (let o = 0; o < 16; o++) {
      const s = r[o] ?? 0;
      i[o] = ~(s ^ cP) & 255;
    }
    return i.toString("hex");
  }
  static writeGuid(e, n) {
    if (n.length !== 32)
      throw new Error("Invalid GUID length, must be 32 hex chars");
    if (dt.platform() !== "win32")
      throw new Error("Registry20 encryption is only supported on Windows");
    const r = Buffer.from(n, "hex"), i = Buffer.alloc(16);
    for (let a = 0; a < 16; a++) {
      const c = r[a] ?? 0;
      i[a] = cP ^ ~c & 255;
    }
    const o = Buffer.concat([Dce, i]), s = xe.dirname(e);
    Ge.existsSync(s) || Ge.mkdirSync(s, { recursive: !0 }), Oce(e, o);
  }
  static getBackups(e) {
    const n = xe.dirname(e), r = xe.basename(e);
    return Ge.existsSync(n) ? Ge.readdirSync(n).filter((i) => i.startsWith(`${r}.bak.`)).sort().reverse() : [];
  }
  static backup(e) {
    if (!Ge.existsSync(e))
      throw new Error("Registry20 does not exist");
    const n = (/* @__PURE__ */ new Date()).toISOString().replace(/[-:T.]/g, "").slice(0, 14), r = `${e}.bak.${n}`;
    return Ge.copyFileSync(e, r), r;
  }
  static restore(e, n) {
    const r = xe.dirname(e), i = xe.join(r, n);
    if (!Ge.existsSync(i))
      throw new Error("Backup file not found");
    Ge.copyFileSync(i, e);
  }
  static delete(e) {
    Ge.existsSync(e) && Ge.unlinkSync(e);
  }
}
function uP(t) {
  return t.replace(/[a-zA-Z]/g, (e) => {
    const n = e <= "Z" ? 65 : 97;
    return String.fromCharCode((e.charCodeAt(0) - n + 13) % 26 + n);
  });
}
class ii {
  /**
   * 获取 machine-info 文件路径
   */
  static getMachineInfoPath(e) {
    return xe.join(e, "nt_qq", "global", "nt_data", "msf", "machine-info");
  }
  /**
   * 从 machine-info 文件读取 MAC 地址
   */
  static readMac(e) {
    if (!Ge.existsSync(e))
      throw new Error("machine-info file not found");
    const n = Ge.readFileSync(e);
    if (n.length < 4)
      throw new Error(`machine-info data too short: ${n.length} < 4 bytes`);
    const r = n.readUInt32BE(0);
    if (r >= 18)
      throw new Error(`MAC string length abnormal: ${r} >= 18`);
    if (n.length < 4 + r)
      throw new Error(`machine-info data incomplete: need ${4 + r} bytes, got ${n.length}`);
    const i = n.subarray(4, 4 + r).toString("ascii");
    return uP(i);
  }
  /**
   * 将 MAC 地址写入 machine-info 文件
   */
  static writeMac(e, n) {
    if (n = n.trim().toLowerCase(), !/^[0-9a-f]{2}(-[0-9a-f]{2}){5}$/.test(n))
      throw new Error("Invalid MAC format, must be xx-xx-xx-xx-xx-xx");
    const r = uP(n), i = r.length, o = Buffer.alloc(4 + i);
    o.writeUInt32BE(i, 0), o.write(r, 4, "ascii");
    const s = xe.dirname(e);
    Ge.existsSync(s) || Ge.mkdirSync(s, { recursive: !0 }), Ge.writeFileSync(e, o);
  }
  /**
   * 读取 /etc/machine-id
   */
  static readMachineId() {
    const e = "/etc/machine-id";
    if (!Ge.existsSync(e))
      throw new Error("/etc/machine-id not found");
    return Ge.readFileSync(e, "utf-8").trim();
  }
  /**
   * 计算 Linux GUID = MD5(machine-id + MAC)
   */
  static computeGuid(e, n) {
    const r = bs.createHash("md5");
    return r.update(e, "ascii"), r.update(n, "ascii"), r.digest("hex");
  }
  /**
   * 获取备份列表
   */
  static getBackups(e) {
    const n = xe.dirname(e), r = xe.basename(e);
    return Ge.existsSync(n) ? Ge.readdirSync(n).filter((i) => i.startsWith(`${r}.bak.`)).sort().reverse() : [];
  }
  /**
   * 创建备份
   */
  static backup(e) {
    if (!Ge.existsSync(e))
      throw new Error("machine-info file does not exist");
    const n = (/* @__PURE__ */ new Date()).toISOString().replace(/[-:T.]/g, "").slice(0, 14), r = `${e}.bak.${n}`;
    return Ge.copyFileSync(e, r), r;
  }
  /**
   * 恢复备份
   */
  static restore(e, n) {
    const r = xe.dirname(e), i = xe.join(r, n);
    if (!Ge.existsSync(i))
      throw new Error("Backup file not found");
    Ge.copyFileSync(i, e);
  }
  /**
   * 删除 machine-info
   */
  static delete(e) {
    Ge.existsSync(e) && Ge.unlinkSync(e);
  }
}
function HR(t, e) {
  return new Promise((n, r) => {
    const i = JSON.stringify(e), o = Gu.request({
      hostname: "oidb.tim.qq.com",
      path: `/v3/oidbinterface/oidb_0xc9e_8?uid=${encodeURIComponent(t)}&getqrcode=1&sdkappid=39998&actype=2`,
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        "Content-Length": Buffer.byteLength(i),
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36",
        Accept: "application/json, text/plain, */*"
      }
    }, (s) => {
      let a = "";
      s.on("data", (c) => {
        a += c;
      }), s.on("end", () => {
        try {
          n(JSON.parse(a));
        } catch {
          r(new Error("Failed to parse oidb response"));
        }
      });
    });
    o.on("error", r), o.write(i), o.end();
  });
}
const pl = () => {
  let t = ve.getQQDataPath();
  if (t || (t = ve.getOneBotContext()?.core?.dataPath), !t)
    throw new Error("QQ data path not available yet");
  return fs.getRegistryPath(t);
}, Cc = () => {
  let t = ve.getQQDataPath();
  if (t || (t = ve.getOneBotContext()?.core?.dataPath), !t)
    throw new Error("QQ data path not available yet");
  return ii.getMachineInfoPath(t);
}, Mce = async (t, e) => {
  if (ve.getQQLoginStatus())
    return ne(e, "QQ Is Logined");
  const n = ve.getQQLoginQrcodeURL();
  return qn(n) ? ne(e, "QRCode Get Error") : me(e, {
    qrcode: n
  });
}, Rce = async (t, e) => {
  const i = ve.getOneBotContext()?.core?.selfInfo?.online, o = ve.getQQLoginStatus(), c = {
    isLogin: o && i === !0,
    isOffline: o && i === !1,
    qrcodeurl: ve.getQQLoginQrcodeURL(),
    loginError: ve.getQQLoginError()
  };
  return me(e, c);
}, Bce = async (t, e) => {
  const { uin: n } = t.body;
  if (ve.getQQLoginStatus())
    return ne(e, "QQ Is Logined");
  if (qn(n))
    return ne(e, "uin is empty");
  const { result: i, message: o } = await ve.requestQuickLogin(n);
  return i ? me(e, null) : ne(e, o);
}, Uce = async (t, e) => {
  const n = ve.getQQQuickLoginList();
  return me(e, n);
}, Lce = async (t, e) => {
  const n = ve.getQQNewLoginList();
  return me(e, n);
}, jce = async (t, e) => {
  const n = ve.getQQLoginInfo(), i = ve.getOneBotContext()?.core?.selfInfo, o = i?.online ?? void 0, s = i?.avatarUrl, a = {
    ...n,
    online: o,
    avatarUrl: s
  };
  return me(e, a);
}, Qce = async (t, e) => {
  const n = Et.getAutoLoginAccount();
  return me(e, n);
}, $ce = async (t, e) => {
  const { uin: n } = t.body;
  return await Et.UpdateAutoLoginAccount(n), me(e, null);
}, Gce = async (t, e) => ve.getQQLoginStatus() ? ne(e, "QQ Is Logined") : (await ve.refreshQRCode(), me(e, null)), qce = async (t, e) => {
  const { uin: n, passwordMd5: r } = t.body;
  if (ve.getQQLoginStatus())
    return ne(e, "QQ Is Logined");
  if (qn(n))
    return ne(e, "uin is empty");
  if (qn(r))
    return ne(e, "passwordMd5 is empty");
  const { result: o, message: s, needCaptcha: a, proofWaterUrl: c, needNewDevice: u, jumpUrl: l, newDevicePullQrCodeSig: d } = await ve.requestPasswordLogin(n, r);
  return o ? me(e, null) : a && c ? me(e, { needCaptcha: !0, proofWaterUrl: c }) : u && l ? me(e, { needNewDevice: !0, jumpUrl: l, newDevicePullQrCodeSig: d }) : ne(e, s);
}, Hce = async (t, e) => {
  const { uin: n, passwordMd5: r, ticket: i, randstr: o, sid: s } = t.body;
  if (ve.getQQLoginStatus())
    return ne(e, "QQ Is Logined");
  if (qn(n) || qn(r))
    return ne(e, "uin or passwordMd5 is empty");
  if (qn(i) || qn(o))
    return ne(e, "captcha ticket or randstr is empty");
  const { result: c, message: u, needNewDevice: l, jumpUrl: d, newDevicePullQrCodeSig: f } = await ve.requestCaptchaLogin(n, r, i, o, s || "");
  return c ? me(e, null) : l && d ? me(e, { needNewDevice: !0, jumpUrl: d, newDevicePullQrCodeSig: f }) : ne(e, u);
}, Wce = async (t, e) => {
  const { uin: n, passwordMd5: r, newDevicePullQrCodeSig: i } = t.body;
  if (ve.getQQLoginStatus())
    return ne(e, "QQ Is Logined");
  if (qn(n) || qn(r))
    return ne(e, "uin or passwordMd5 is empty");
  if (qn(i))
    return ne(e, "newDevicePullQrCodeSig is empty");
  const { result: s, message: a, needNewDevice: c, jumpUrl: u, newDevicePullQrCodeSig: l } = await ve.requestNewDeviceLogin(n, r, i);
  return s ? me(e, null) : c && u ? me(e, { needNewDevice: !0, jumpUrl: u, newDevicePullQrCodeSig: l }) : ne(e, a);
}, zce = async (t, e) => {
  try {
    const n = pl();
    try {
      await fs.backup(n);
    } catch {
    }
    return await fs.delete(n), me(e, { message: "Device ID reset successfully (Registry20 deleted)" });
  } catch (n) {
    return ne(e, `Failed to reset Device ID: ${n.message}`);
  }
}, Kce = async (t, e) => {
  try {
    const n = pl(), r = await fs.readGuid(n);
    return me(e, { guid: r });
  } catch (n) {
    return ne(e, `Failed to get GUID: ${n.message}`);
  }
}, Vce = async (t, e) => {
  const { guid: n } = t.body;
  if (!n || typeof n != "string" || n.length !== 32)
    return ne(e, "Invalid GUID format, must be 32 hex characters");
  try {
    const r = pl();
    try {
      await fs.backup(r);
    } catch {
    }
    return await fs.writeGuid(r, n), me(e, { message: "GUID set successfully" });
  } catch (r) {
    return ne(e, `Failed to set GUID: ${r.message}`);
  }
}, Yce = async (t, e) => {
  try {
    const n = pl(), r = fs.getBackups(n);
    return me(e, r);
  } catch (n) {
    return ne(e, `Failed to get backups: ${n.message}`);
  }
}, Jce = async (t, e) => {
  const { backupName: n } = t.body;
  if (!n)
    return ne(e, "Backup name is required");
  try {
    const r = pl();
    return await fs.restore(r, n), me(e, { message: "Restored successfully" });
  } catch (r) {
    return ne(e, `Failed to restore: ${r.message}`);
  }
}, Xce = async (t, e) => {
  try {
    const n = pl(), r = await fs.backup(n);
    return me(e, { message: "Backup created", path: r });
  } catch (n) {
    return ne(e, `Failed to backup: ${n.message}`);
  }
}, Zce = async (t, e) => {
  try {
    const n = await ve.requestRestartProcess();
    return n.result ? me(e, { message: n.message || "Restart initiated" }) : ne(e, n.message || "Restart failed");
  } catch (n) {
    return ne(e, `Restart error: ${n.message}`);
  }
}, eue = async (t, e) => me(e, { platform: dt.platform() }), tue = async (t, e) => {
  try {
    const n = Cc(), r = ii.readMac(n);
    return me(e, { mac: r });
  } catch (n) {
    return ne(e, `Failed to get MAC: ${n.message}`);
  }
}, nue = async (t, e) => {
  const { mac: n } = t.body;
  if (!n || typeof n != "string")
    return ne(e, "MAC address is required");
  try {
    const r = Cc();
    try {
      ii.backup(r);
    } catch {
    }
    return ii.writeMac(r, n), me(e, { message: "MAC set successfully" });
  } catch (r) {
    return ne(e, `Failed to set MAC: ${r.message}`);
  }
}, rue = async (t, e) => {
  try {
    const n = ii.readMachineId();
    return me(e, { machineId: n });
  } catch (n) {
    return ne(e, `Failed to read machine-id: ${n.message}`);
  }
}, iue = async (t, e) => {
  const { mac: n, machineId: r } = t.body;
  try {
    let i = r;
    if (!i || typeof i != "string")
      try {
        i = ii.readMachineId();
      } catch {
        i = "";
      }
    let o = n;
    if (!o || typeof o != "string")
      try {
        const a = Cc();
        o = ii.readMac(a);
      } catch {
        o = "";
      }
    const s = ii.computeGuid(i, o);
    return me(e, { guid: s, machineId: i, mac: o });
  } catch (i) {
    return ne(e, `Failed to compute GUID: ${i.message}`);
  }
}, oue = async (t, e) => {
  try {
    const n = Cc(), r = ii.getBackups(n);
    return me(e, r);
  } catch (n) {
    return ne(e, `Failed to get backups: ${n.message}`);
  }
}, sue = async (t, e) => {
  try {
    const n = Cc(), r = ii.backup(n);
    return me(e, { message: "Backup created", path: r });
  } catch (n) {
    return ne(e, `Failed to backup: ${n.message}`);
  }
}, aue = async (t, e) => {
  const { backupName: n } = t.body;
  if (!n)
    return ne(e, "Backup name is required");
  try {
    const r = Cc();
    return ii.restore(r, n), me(e, { message: "Restored successfully" });
  } catch (r) {
    return ne(e, `Failed to restore: ${r.message}`);
  }
}, cue = async (t, e) => {
  try {
    const n = Cc();
    try {
      ii.backup(n);
    } catch {
    }
    return ii.delete(n), me(e, { message: "Device ID reset successfully (machine-info deleted)" });
  } catch (n) {
    return ne(e, `Failed to reset Device ID: ${n.message}`);
  }
}, uue = async (t, e) => {
  const { uin: n, jumpUrl: r } = t.body;
  if (!n || !r)
    return ne(e, "uin and jumpUrl are required");
  const i = new URL(r), o = i.searchParams.get("sig") || "", s = i.searchParams.get("uin-token") || "";
  if (!o || !s)
    return ne(e, "Failed to get new device QR code: unable to extract sig/uin-token from jumpUrl");
  const a = {
    str_dev_auth_token: o,
    uint32_flag: 1,
    uint32_url_type: 0,
    str_uin_token: s,
    str_dev_type: "Windows",
    str_dev_name: dt.hostname() || "DESKTOP-NAPCAT"
  }, c = await HR(n, a);
  return me(e, c);
}, lue = async (t, e) => {
  const { uin: n, bytesToken: r } = t.body;
  if (!n || !r)
    return ne(e, "uin and bytesToken are required");
  try {
    const o = await HR(n, {
      uint32_flag: 0,
      bytes_token: r
      // base64 编码的 token
    });
    return me(e, o);
  } catch (i) {
    return ne(e, `Failed to poll QR status: ${i.message}`);
  }
}, kt = yr();
kt.all("/GetQuickLoginList", Uce);
kt.all("/GetQuickLoginListNew", Lce);
kt.post("/CheckLoginStatus", Rce);
kt.post("/GetQQLoginQrcode", Mce);
kt.post("/SetQuickLogin", Bce);
kt.post("/GetQQLoginInfo", jce);
kt.post("/GetQuickLoginQQ", Qce);
kt.post("/SetQuickLoginQQ", $ce);
kt.post("/RefreshQRcode", Gce);
kt.post("/PasswordLogin", qce);
kt.post("/CaptchaLogin", Hce);
kt.post("/NewDeviceLogin", Wce);
kt.post("/GetNewDeviceQRCode", uue);
kt.post("/PollNewDeviceQR", lue);
kt.post("/ResetDeviceID", zce);
kt.post("/RestartNapCat", Zce);
kt.post("/GetDeviceGUID", Kce);
kt.post("/SetDeviceGUID", Vce);
kt.post("/GetGUIDBackups", Yce);
kt.post("/RestoreGUIDBackup", Jce);
kt.post("/CreateGUIDBackup", Xce);
kt.post("/GetPlatformInfo", eue);
kt.post("/GetLinuxMAC", tue);
kt.post("/SetLinuxMAC", nue);
kt.post("/GetLinuxMachineId", rue);
kt.post("/ComputeLinuxGUID", iue);
kt.post("/GetLinuxMachineInfoBackups", oue);
kt.post("/CreateLinuxMachineInfoBackup", sue);
kt.post("/RestoreLinuxMachineInfoBackup", aue);
kt.post("/ResetLinuxDeviceID", cue);
const PA = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", WR = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_", zR = (t) => {
  const e = typeof Uint8Array > "u" ? [] : new Uint8Array(256), n = PA.length;
  for (let r = 0; r < n; r++)
    e[t.charCodeAt(r)] = r;
  return e;
}, pue = zR(PA), due = zR(WR), fue = /^[-A-Za-z0-9\-_]*$/, hue = /^[-A-Za-z0-9+/]*={0,3}$/, br = {};
br.toArrayBuffer = (t, e) => {
  const n = t.length;
  let r = t.length * 0.75, i, o = 0, s, a, c, u;
  t[t.length - 1] === "=" && (r--, t[t.length - 2] === "=" && r--);
  const l = new ArrayBuffer(r), d = new Uint8Array(l), f = e ? due : pue;
  for (i = 0; i < n; i += 4)
    s = f[t.charCodeAt(i)], a = f[t.charCodeAt(i + 1)], c = f[t.charCodeAt(i + 2)], u = f[t.charCodeAt(i + 3)], d[o++] = s << 2 | a >> 4, d[o++] = (a & 15) << 4 | c >> 2, d[o++] = (c & 3) << 6 | u & 63;
  return l;
};
br.fromArrayBuffer = (t, e) => {
  const n = new Uint8Array(t);
  let r, i = "";
  const o = n.length, s = e ? WR : PA;
  for (r = 0; r < o; r += 3)
    i += s[n[r] >> 2], i += s[(n[r] & 3) << 4 | n[r + 1] >> 4], i += s[(n[r + 1] & 15) << 2 | n[r + 2] >> 6], i += s[n[r + 2] & 63];
  const a = o % 3;
  return a === 2 ? i = i.substring(0, i.length - 1) + (e ? "" : "=") : a === 1 && (i = i.substring(0, i.length - 2) + (e ? "" : "==")), i;
};
br.toString = (t, e) => new TextDecoder().decode(br.toArrayBuffer(t, e));
br.fromString = (t, e) => br.fromArrayBuffer(new TextEncoder().encode(t), e);
br.validate = (t, e) => {
  if (!(typeof t == "string" || t instanceof String))
    return !1;
  try {
    return e ? fue.test(t) : hue.test(t);
  } catch {
    return !1;
  }
};
br.base64 = br;
function No(t, e = "base64url") {
  const n = br.toArrayBuffer(t, e === "base64url");
  return new Uint8Array(n);
}
function ki(t, e = "base64url") {
  const n = new Uint8Array(t);
  return br.fromArrayBuffer(n.buffer, e === "base64url");
}
function mue(t) {
  const e = br.toArrayBuffer(t, !0);
  return br.fromArrayBuffer(e);
}
function nd(t) {
  return br.toString(t, !0);
}
function gue(t) {
  return br.validate(t, !1);
}
function rd(t) {
  return t = DA(t), br.validate(t, !0);
}
function DA(t) {
  return t.replace(/=/g, "");
}
function Xd(t, e, n) {
  if (e < 24)
    return [e, 1];
  const r = t.byteLength - n - 1, i = new DataView(t.buffer, n + 1);
  let o, s = 0;
  switch (e) {
    case 24: {
      r > 0 && (o = i.getUint8(0), s = 2);
      break;
    }
    case 25: {
      r > 1 && (o = i.getUint16(0, !1), s = 3);
      break;
    }
    case 26: {
      r > 3 && (o = i.getUint32(0, !1), s = 5);
      break;
    }
    case 27: {
      if (r > 7) {
        const a = i.getBigUint64(0, !1);
        if (a >= 24n && a <= Number.MAX_SAFE_INTEGER)
          return [Number(a), 9];
      }
      break;
    }
  }
  if (o && o >= 24)
    return [o, s];
  throw new Error("Length not supported or not well formed");
}
const pS = 0, Qm = 1, KR = 2, VR = 3, YR = 4, JR = 5, XR = 6, yue = 7;
function os(t, e) {
  const n = t << 5;
  if (e < 0)
    throw new Error("CBOR Data Item argument must not be negative");
  let r;
  if (typeof e == "number") {
    if (!Number.isInteger(e))
      throw new Error("CBOR Data Item argument must be an integer");
    r = BigInt(e);
  } else
    r = e;
  if (t == Qm) {
    if (r == 0n)
      throw new Error("CBOR Data Item argument cannot be zero when negative");
    r = r - 1n;
  }
  if (r > 18446744073709551615n)
    throw new Error("CBOR number out of range");
  const i = new Uint8Array(8);
  return new DataView(i.buffer).setBigUint64(0, r, !1), r <= 23 ? [n | i[7]] : r <= 255 ? [n | 24, i[7]] : r <= 65535 ? [n | 25, ...i.slice(6)] : r <= 4294967295 ? [
    n | 26,
    ...i.slice(4)
  ] : [
    n | 27,
    ...i
  ];
}
class ZR {
  /**
   * Wrap a value with a tag number.
   * When encoded, this tag will be attached to the value.
   *
   * @param tag Tag number
   * @param value Wrapped value
   */
  constructor(e, n) {
    Object.defineProperty(this, "tagId", {
      enumerable: !0,
      configurable: !0,
      writable: !0,
      value: void 0
    }), Object.defineProperty(this, "tagValue", {
      enumerable: !0,
      configurable: !0,
      writable: !0,
      value: void 0
    }), this.tagId = e, this.tagValue = n;
  }
  /**
   * Read the tag number
   */
  get tag() {
    return this.tagId;
  }
  /**
   * Read the value
   */
  get value() {
    return this.tagValue;
  }
}
function e5(t, e, n) {
  return Xd(t, e, n);
}
function vue(t, e, n) {
  const [r, i] = e5(t, e, n);
  return [-r - 1, i];
}
function t5(t, e, n) {
  const [r, i] = Xd(t, e, n), o = n + i;
  return [
    new Uint8Array(t.buffer.slice(o, o + r)),
    i + r
  ];
}
const bue = new TextDecoder();
function xue(t, e, n) {
  const [r, i] = t5(t, e, n);
  return [bue.decode(r), i];
}
function wue(t, e, n) {
  if (e === 0)
    return [[], 1];
  const [r, i] = Xd(t, e, n);
  let o = i;
  const s = [];
  for (let a = 0; a < r; a++) {
    if (t.byteLength - n - o <= 0)
      throw new Error("array is not supported or well formed");
    const [u, l] = qa(t, n + o);
    s.push(u), o += l;
  }
  return [s, o];
}
const Ch = "Map is not supported or well formed";
function Sue(t, e, n) {
  if (e === 0)
    return [/* @__PURE__ */ new Map(), 1];
  const [r, i] = Xd(t, e, n);
  let o = i;
  const s = /* @__PURE__ */ new Map();
  for (let a = 0; a < r; a++) {
    let c = t.byteLength - n - o;
    if (c <= 0)
      throw new Error(Ch);
    const [u, l] = qa(t, n + o);
    if (o += l, c -= l, c <= 0)
      throw new Error(Ch);
    if (typeof u != "string" && typeof u != "number")
      throw new Error(Ch);
    if (s.has(u))
      throw new Error(Ch);
    const [d, f] = qa(t, n + o);
    o += f, s.set(u, d);
  }
  return [s, o];
}
function _ue(t, e) {
  if (e + 3 > t.byteLength)
    throw new Error("CBOR stream ended before end of Float 16");
  const n = t.getUint16(e + 1, !1);
  if (n == 31744)
    return [1 / 0, 3];
  if (n == 32256)
    return [NaN, 3];
  if (n == 64512)
    return [-1 / 0, 3];
  throw new Error("Float16 data is unsupported");
}
function Eue(t, e) {
  if (e + 5 > t.byteLength)
    throw new Error("CBOR stream ended before end of Float 32");
  return [t.getFloat32(e + 1, !1), 5];
}
function Aue(t, e) {
  if (e + 9 > t.byteLength)
    throw new Error("CBOR stream ended before end of Float 64");
  return [t.getFloat64(e + 1, !1), 9];
}
function Iue(t, e, n) {
  const [r, i] = Xd(t, e, n), [o, s] = qa(t, n + i);
  return [new ZR(r, o), i + s];
}
function qa(t, e) {
  if (e >= t.byteLength)
    throw new Error("CBOR stream ended before tag value");
  const n = t.getUint8(e), r = n >> 5, i = n & 31;
  switch (r) {
    case pS:
      return e5(t, i, e);
    case Qm:
      return vue(t, i, e);
    case KR:
      return t5(t, i, e);
    case VR:
      return xue(t, i, e);
    case YR:
      return wue(t, i, e);
    case JR:
      return Sue(t, i, e);
    case XR:
      return Iue(t, i, e);
    case yue:
      switch (i) {
        case 20:
          return [!1, 1];
        case 21:
          return [!0, 1];
        case 22:
          return [null, 1];
        case 23:
          return [void 0, 1];
        // 24: Simple value (value 32..255 in following byte)
        case 25:
          return _ue(t, e);
        case 26:
          return Eue(t, e);
        case 27:
          return Aue(t, e);
      }
  }
  throw new Error(`Unsupported or not well formed at ${e}`);
}
function Cue(t) {
  return t === !0 ? 245 : t === !1 ? 244 : t === null ? 246 : 247;
}
function Tue(t) {
  if (Math.fround(t) == t || !Number.isFinite(t) || Number.isNaN(t)) {
    const e = new Uint8Array(5);
    return e[0] = 250, new DataView(e.buffer).setFloat32(1, t, !1), e;
  } else {
    const e = new Uint8Array(9);
    return e[0] = 251, new DataView(e.buffer).setFloat64(1, t, !1), e;
  }
}
function kue(t) {
  return typeof t == "number" ? Number.isSafeInteger(t) ? t < 0 ? os(Qm, Math.abs(t)) : os(pS, t) : [Tue(t)] : t < 0n ? os(Qm, t * -1n) : os(pS, t);
}
const Nue = new TextEncoder();
function Pue(t, e) {
  e.push(...os(VR, t.length)), e.push(Nue.encode(t));
}
function Due(t, e) {
  e.push(...os(KR, t.length)), e.push(t);
}
function Fue(t, e) {
  e.push(...os(YR, t.length));
  for (const n of t)
    id(n, e);
}
function Oue(t, e) {
  e.push(new Uint8Array(os(JR, t.size)));
  for (const [n, r] of t.entries())
    id(n, e), id(r, e);
}
function Mue(t, e) {
  e.push(...os(XR, t.tag)), id(t.value, e);
}
function id(t, e) {
  if (typeof t == "boolean" || t === null || t == null) {
    e.push(Cue(t));
    return;
  }
  if (typeof t == "number" || typeof t == "bigint") {
    e.push(...kue(t));
    return;
  }
  if (typeof t == "string") {
    Pue(t, e);
    return;
  }
  if (t instanceof Uint8Array) {
    Due(t, e);
    return;
  }
  if (Array.isArray(t)) {
    Fue(t, e);
    return;
  }
  if (t instanceof Map) {
    Oue(t, e);
    return;
  }
  if (t instanceof ZR) {
    Mue(t, e);
    return;
  }
  throw new Error("Not implemented");
}
function Rue(t, e) {
  if (t.byteLength === 0 || t.byteLength <= e || e < 0)
    throw new Error("No data");
  return t instanceof Uint8Array ? qa(new DataView(t.buffer), e) : t instanceof ArrayBuffer ? qa(new DataView(t), e) : qa(t, e);
}
function Bue(t) {
  const e = [];
  id(t, e);
  let n = 0;
  for (const o of e)
    typeof o == "number" ? n += 1 : n += o.length;
  const r = new Uint8Array(n);
  let i = 0;
  for (const o of e)
    typeof o == "number" ? (r[i] = o, i += 1) : (r.set(o, i), i += o.length);
  return r;
}
function _u(t) {
  const e = new Uint8Array(t), n = Rue(e, 0), [r] = n;
  return r;
}
function lP(t) {
  return Bue(t);
}
function Uue(t) {
  const e = t.get(ut.kty);
  return OA(e) && e === so.OKP;
}
function E0(t) {
  const e = t.get(ut.kty);
  return OA(e) && e === so.EC2;
}
function FA(t) {
  const e = t.get(ut.kty);
  return OA(e) && e === so.RSA;
}
var ut;
(function(t) {
  t[t.kty = 1] = "kty", t[t.alg = 3] = "alg", t[t.crv = -1] = "crv", t[t.x = -2] = "x", t[t.y = -3] = "y", t[t.n = -1] = "n", t[t.e = -2] = "e";
})(ut || (ut = {}));
var so;
(function(t) {
  t[t.OKP = 1] = "OKP", t[t.EC2 = 2] = "EC2", t[t.RSA = 3] = "RSA";
})(so || (so = {}));
function OA(t) {
  return Object.values(so).indexOf(t) >= 0;
}
var Ii;
(function(t) {
  t[t.P256 = 1] = "P256", t[t.P384 = 2] = "P384", t[t.P521 = 3] = "P521", t[t.ED25519 = 6] = "ED25519", t[t.SECP256K1 = 8] = "SECP256K1";
})(Ii || (Ii = {}));
function Lue(t) {
  return Object.values(Ii).indexOf(t) >= 0;
}
var ft;
(function(t) {
  t[t.ES256 = -7] = "ES256", t[t.EdDSA = -8] = "EdDSA", t[t.ES384 = -35] = "ES384", t[t.ES512 = -36] = "ES512", t[t.PS256 = -37] = "PS256", t[t.PS384 = -38] = "PS384", t[t.PS512 = -39] = "PS512", t[t.ES256K = -47] = "ES256K", t[t.RS256 = -257] = "RS256", t[t.RS384 = -258] = "RS384", t[t.RS512 = -259] = "RS512", t[t.RS1 = -65535] = "RS1";
})(ft || (ft = {}));
function Zd(t) {
  return Object.values(ft).indexOf(t) >= 0;
}
function od(t) {
  if ([ft.RS1].indexOf(t) >= 0)
    return "SHA-1";
  if ([ft.ES256, ft.PS256, ft.RS256].indexOf(t) >= 0)
    return "SHA-256";
  if ([ft.ES384, ft.PS384, ft.RS384].indexOf(t) >= 0)
    return "SHA-384";
  if ([ft.ES512, ft.PS512, ft.RS512, ft.EdDSA].indexOf(t) >= 0)
    return "SHA-512";
  throw new Error(`Could not map COSE alg value of ${t} to a WebCrypto alg`);
}
let Xl;
function Tc() {
  return new Promise((e, n) => {
    if (Xl)
      return e(Xl);
    const r = Que.stubThisGlobalThisCrypto();
    return r ? (Xl = r, e(Xl)) : n(new jue());
  });
}
class jue extends Error {
  constructor() {
    super("An instance of the Crypto API could not be located"), this.name = "MissingWebCrypto";
  }
}
const Que = {
  stubThisGlobalThisCrypto: () => globalThis.crypto,
  // Make it possible to reset the `webCrypto` at the top of the file
  setCachedCrypto: (t) => {
    Xl = t;
  }
};
async function $ue(t, e) {
  const n = await Tc(), r = od(e), i = await n.subtle.digest(r, t);
  return new Uint8Array(i);
}
async function n5(t) {
  return (await Tc()).getRandomValues(t), t;
}
async function MA(t) {
  const e = await Tc(), { keyData: n, algorithm: r } = t;
  return e.subtle.importKey("jwk", n, r, !1, [
    "verify"
  ]);
}
async function r5(t) {
  const { cosePublicKey: e, signature: n, data: r, shaHashOverride: i } = t, o = await Tc(), s = e.get(ut.alg), a = e.get(ut.crv), c = e.get(ut.x), u = e.get(ut.y);
  if (!s)
    throw new Error("Public key was missing alg (EC2)");
  if (!a)
    throw new Error("Public key was missing crv (EC2)");
  if (!c)
    throw new Error("Public key was missing x (EC2)");
  if (!u)
    throw new Error("Public key was missing y (EC2)");
  let l;
  if (a === Ii.P256)
    l = "P-256";
  else if (a === Ii.P384)
    l = "P-384";
  else if (a === Ii.P521)
    l = "P-521";
  else
    throw new Error(`Unexpected COSE crv value of ${a} (EC2)`);
  const d = {
    kty: "EC",
    crv: l,
    x: ki(c),
    y: ki(u),
    ext: !1
  }, m = await MA({
    keyData: d,
    algorithm: {
      /**
       * Note to future self: you can't use `mapCoseAlgToWebCryptoKeyAlgName()` here because some
       * leaf certs from actual devices specified an RSA SHA value for `alg` (e.g. `-257`) which
       * would then map here to `'RSASSA-PKCS1-v1_5'`. We always want `'ECDSA'` here so we'll
       * hard-code this.
       */
      name: "ECDSA",
      namedCurve: l
    }
  });
  let h = od(s);
  i && (h = od(i));
  const y = {
    name: "ECDSA",
    hash: { name: h }
  };
  return o.subtle.verify(y, m, n, r);
}
function pP(t) {
  if ([ft.EdDSA].indexOf(t) >= 0)
    return "Ed25519";
  if ([ft.ES256, ft.ES384, ft.ES512, ft.ES256K].indexOf(t) >= 0)
    return "ECDSA";
  if ([ft.RS256, ft.RS384, ft.RS512, ft.RS1].indexOf(t) >= 0)
    return "RSASSA-PKCS1-v1_5";
  if ([ft.PS256, ft.PS384, ft.PS512].indexOf(t) >= 0)
    return "RSA-PSS";
  throw new Error(`Could not map COSE alg value of ${t} to a WebCrypto key alg name`);
}
async function i5(t) {
  const { cosePublicKey: e, signature: n, data: r, shaHashOverride: i } = t, o = await Tc(), s = e.get(ut.alg), a = e.get(ut.n), c = e.get(ut.e);
  if (!s)
    throw new Error("Public key was missing alg (RSA)");
  if (!Zd(s))
    throw new Error(`Public key had invalid alg ${s} (RSA)`);
  if (!a)
    throw new Error("Public key was missing n (RSA)");
  if (!c)
    throw new Error("Public key was missing e (RSA)");
  const u = {
    kty: "RSA",
    alg: "",
    n: ki(a),
    e: ki(c),
    ext: !1
  }, l = {
    name: pP(s),
    hash: { name: od(s) }
  }, d = {
    name: pP(s)
  };
  if (i && (l.hash.name = od(i)), l.name === "RSASSA-PKCS1-v1_5")
    l.hash.name === "SHA-256" ? u.alg = "RS256" : l.hash.name === "SHA-384" ? u.alg = "RS384" : l.hash.name === "SHA-512" ? u.alg = "RS512" : l.hash.name === "SHA-1" && (u.alg = "RS1");
  else if (l.name === "RSA-PSS") {
    let m = 0;
    l.hash.name === "SHA-256" ? (u.alg = "PS256", m = 32) : l.hash.name === "SHA-384" ? (u.alg = "PS384", m = 48) : l.hash.name === "SHA-512" && (u.alg = "PS512", m = 64), d.saltLength = m;
  } else
    throw new Error(`Unexpected RSA key algorithm ${s} (${l.name})`);
  const f = await MA({
    keyData: u,
    algorithm: l
  });
  return o.subtle.verify(d, f, n, r);
}
function o5(t) {
  const e = wg(t);
  return [
    e.slice(0, 8),
    // 8
    e.slice(8, 12),
    // 4
    e.slice(12, 16),
    // 4
    e.slice(16, 20),
    // 4
    e.slice(20, 32)
    // 8
  ].join("-");
}
function ao(t) {
  let e;
  if (typeof t == "string")
    if (rd(t))
      e = mue(t);
    else if (gue(t))
      e = t;
    else
      throw new Error("Certificate is not a valid base64 or base64url string");
  else
    e = ki(t, "base64");
  let n = "";
  for (let r = 0; r < Math.ceil(e.length / 64); r += 1) {
    const i = 64 * r;
    n += `${e.substr(i, 64)}
`;
  }
  return n = `-----BEGIN CERTIFICATE-----
${n}-----END CERTIFICATE-----
`, n;
}
function RA(t) {
  const e = _u(t), n = Uint8Array.from([4]), r = e.get(ut.x), i = e.get(ut.y);
  if (!r)
    throw new Error("COSE public key was missing x");
  return oi(i ? [n, r, i] : [n, r]);
}
function Gue(t) {
  return que.stubThis(_u(t));
}
const que = {
  stubThis: (t) => t
};
function s5(t) {
  const e = nd(t), n = JSON.parse(e);
  return Hue.stubThis(n);
}
const Hue = {
  stubThis: (t) => t
};
function A0(t) {
  return Wue.stubThis(_u(t));
}
const Wue = {
  stubThis: (t) => t
};
async function zue() {
  const t = new Uint8Array(32);
  return await n5(t), Kue.stubThis(t);
}
const Kue = {
  stubThis: (t) => t
};
/*!
 * MIT License
 * 
 * Copyright (c) 2017-2024 Peculiar Ventures, LLC
 * 
 * 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.
 * 
 */
const Vue = "[object ArrayBuffer]";
class Ie {
  static isArrayBuffer(e) {
    return Object.prototype.toString.call(e) === Vue;
  }
  static toArrayBuffer(e) {
    return this.isArrayBuffer(e) ? e : e.byteLength === e.buffer.byteLength || e.byteOffset === 0 && e.byteLength === e.buffer.byteLength ? e.buffer : this.toUint8Array(e.buffer).slice(e.byteOffset, e.byteOffset + e.byteLength).buffer;
  }
  static toUint8Array(e) {
    return this.toView(e, Uint8Array);
  }
  static toView(e, n) {
    if (e.constructor === n)
      return e;
    if (this.isArrayBuffer(e))
      return new n(e);
    if (this.isArrayBufferView(e))
      return new n(e.buffer, e.byteOffset, e.byteLength);
    throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");
  }
  static isBufferSource(e) {
    return this.isArrayBufferView(e) || this.isArrayBuffer(e);
  }
  static isArrayBufferView(e) {
    return ArrayBuffer.isView(e) || e && this.isArrayBuffer(e.buffer);
  }
  static isEqual(e, n) {
    const r = Ie.toUint8Array(e), i = Ie.toUint8Array(n);
    if (r.length !== i.byteLength)
      return !1;
    for (let o = 0; o < r.length; o++)
      if (r[o] !== i[o])
        return !1;
    return !0;
  }
  static concat(...e) {
    let n;
    Array.isArray(e[0]) && !(e[1] instanceof Function) || Array.isArray(e[0]) && e[1] instanceof Function ? n = e[0] : e[e.length - 1] instanceof Function ? n = e.slice(0, e.length - 1) : n = e;
    let r = 0;
    for (const s of n)
      r += s.byteLength;
    const i = new Uint8Array(r);
    let o = 0;
    for (const s of n) {
      const a = this.toUint8Array(s);
      i.set(a, o), o += a.length;
    }
    return e[e.length - 1] instanceof Function ? this.toView(i, e[e.length - 1]) : i.buffer;
  }
}
const Ux = "string", Yue = /^[0-9a-f\s]+$/i, Jue = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/, Xue = /^[a-zA-Z0-9-_]+$/;
class dP {
  static fromString(e) {
    const n = unescape(encodeURIComponent(e)), r = new Uint8Array(n.length);
    for (let i = 0; i < n.length; i++)
      r[i] = n.charCodeAt(i);
    return r.buffer;
  }
  static toString(e) {
    const n = Ie.toUint8Array(e);
    let r = "";
    for (let o = 0; o < n.length; o++)
      r += String.fromCharCode(n[o]);
    return decodeURIComponent(escape(r));
  }
}
class Io {
  static toString(e, n = !1) {
    const r = Ie.toArrayBuffer(e), i = new DataView(r);
    let o = "";
    for (let s = 0; s < r.byteLength; s += 2) {
      const a = i.getUint16(s, n);
      o += String.fromCharCode(a);
    }
    return o;
  }
  static fromString(e, n = !1) {
    const r = new ArrayBuffer(e.length * 2), i = new DataView(r);
    for (let o = 0; o < e.length; o++)
      i.setUint16(o * 2, e.charCodeAt(o), n);
    return r;
  }
}
class Ue {
  static isHex(e) {
    return typeof e === Ux && Yue.test(e);
  }
  static isBase64(e) {
    return typeof e === Ux && Jue.test(e);
  }
  static isBase64Url(e) {
    return typeof e === Ux && Xue.test(e);
  }
  static ToString(e, n = "utf8") {
    const r = Ie.toUint8Array(e);
    switch (n.toLowerCase()) {
      case "utf8":
        return this.ToUtf8String(r);
      case "binary":
        return this.ToBinary(r);
      case "hex":
        return this.ToHex(r);
      case "base64":
        return this.ToBase64(r);
      case "base64url":
        return this.ToBase64Url(r);
      case "utf16le":
        return Io.toString(r, !0);
      case "utf16":
      case "utf16be":
        return Io.toString(r);
      default:
        throw new Error(`Unknown type of encoding '${n}'`);
    }
  }
  static FromString(e, n = "utf8") {
    if (!e)
      return new ArrayBuffer(0);
    switch (n.toLowerCase()) {
      case "utf8":
        return this.FromUtf8String(e);
      case "binary":
        return this.FromBinary(e);
      case "hex":
        return this.FromHex(e);
      case "base64":
        return this.FromBase64(e);
      case "base64url":
        return this.FromBase64Url(e);
      case "utf16le":
        return Io.fromString(e, !0);
      case "utf16":
      case "utf16be":
        return Io.fromString(e);
      default:
        throw new Error(`Unknown type of encoding '${n}'`);
    }
  }
  static ToBase64(e) {
    const n = Ie.toUint8Array(e);
    if (typeof btoa < "u") {
      const r = this.ToString(n, "binary");
      return btoa(r);
    } else
      return Buffer.from(n).toString("base64");
  }
  static FromBase64(e) {
    const n = this.formatString(e);
    if (!n)
      return new ArrayBuffer(0);
    if (!Ue.isBase64(n))
      throw new TypeError("Argument 'base64Text' is not Base64 encoded");
    return typeof atob < "u" ? this.FromBinary(atob(n)) : new Uint8Array(Buffer.from(n, "base64")).buffer;
  }
  static FromBase64Url(e) {
    const n = this.formatString(e);
    if (!n)
      return new ArrayBuffer(0);
    if (!Ue.isBase64Url(n))
      throw new TypeError("Argument 'base64url' is not Base64Url encoded");
    return this.FromBase64(this.Base64Padding(n.replace(/\-/g, "+").replace(/\_/g, "/")));
  }
  static ToBase64Url(e) {
    return this.ToBase64(e).replace(/\+/g, "-").replace(/\//g, "_").replace(/\=/g, "");
  }
  static FromUtf8String(e, n = Ue.DEFAULT_UTF8_ENCODING) {
    switch (n) {
      case "ascii":
        return this.FromBinary(e);
      case "utf8":
        return dP.fromString(e);
      case "utf16":
      case "utf16be":
        return Io.fromString(e);
      case "utf16le":
      case "usc2":
        return Io.fromString(e, !0);
      default:
        throw new Error(`Unknown type of encoding '${n}'`);
    }
  }
  static ToUtf8String(e, n = Ue.DEFAULT_UTF8_ENCODING) {
    switch (n) {
      case "ascii":
        return this.ToBinary(e);
      case "utf8":
        return dP.toString(e);
      case "utf16":
      case "utf16be":
        return Io.toString(e);
      case "utf16le":
      case "usc2":
        return Io.toString(e, !0);
      default:
        throw new Error(`Unknown type of encoding '${n}'`);
    }
  }
  static FromBinary(e) {
    const n = e.length, r = new Uint8Array(n);
    for (let i = 0; i < n; i++)
      r[i] = e.charCodeAt(i);
    return r.buffer;
  }
  static ToBinary(e) {
    const n = Ie.toUint8Array(e);
    let r = "";
    for (let i = 0; i < n.length; i++)
      r += String.fromCharCode(n[i]);
    return r;
  }
  static ToHex(e) {
    const n = Ie.toUint8Array(e);
    let r = "";
    const i = n.length;
    for (let o = 0; o < i; o++) {
      const s = n[o];
      s < 16 && (r += "0"), r += s.toString(16);
    }
    return r;
  }
  static FromHex(e) {
    let n = this.formatString(e);
    if (!n)
      return new ArrayBuffer(0);
    if (!Ue.isHex(n))
      throw new TypeError("Argument 'hexString' is not HEX encoded");
    n.length % 2 && (n = `0${n}`);
    const r = new Uint8Array(n.length / 2);
    for (let i = 0; i < n.length; i = i + 2) {
      const o = n.slice(i, i + 2);
      r[i / 2] = parseInt(o, 16);
    }
    return r.buffer;
  }
  static ToUtf16String(e, n = !1) {
    return Io.toString(e, n);
  }
  static FromUtf16String(e, n = !1) {
    return Io.fromString(e, n);
  }
  static Base64Padding(e) {
    const n = 4 - e.length % 4;
    if (n < 4)
      for (let r = 0; r < n; r++)
        e += "=";
    return e;
  }
  static formatString(e) {
    return e?.replace(/[\n\r\t ]/g, "") || "";
  }
}
Ue.DEFAULT_UTF8_ENCODING = "utf8";
function Zue(...t) {
  const e = t.map((i) => i.byteLength).reduce((i, o) => i + o), n = new Uint8Array(e);
  let r = 0;
  return t.map((i) => new Uint8Array(i)).forEach((i) => {
    for (const o of i)
      n[r++] = o;
  }), n.buffer;
}
function a5(t, e) {
  if (!(t && e) || t.byteLength !== e.byteLength)
    return !1;
  const n = new Uint8Array(t), r = new Uint8Array(e);
  for (let i = 0; i < t.byteLength; i++)
    if (n[i] !== r[i])
      return !1;
  return !0;
}
/*!
 Copyright (c) Peculiar Ventures, LLC
*/
function Eu(t, e) {
  let n = 0;
  if (t.length === 1)
    return t[0];
  for (let r = t.length - 1; r >= 0; r--)
    n += t[t.length - 1 - r] * Math.pow(2, e * r);
  return n;
}
function ec(t, e, n = -1) {
  const r = n;
  let i = t, o = 0, s = Math.pow(2, e);
  for (let a = 1; a < 8; a++) {
    if (t < s) {
      let c;
      if (r < 0)
        c = new ArrayBuffer(a), o = a;
      else {
        if (r < a)
          return new ArrayBuffer(0);
        c = new ArrayBuffer(r), o = r;
      }
      const u = new Uint8Array(c);
      for (let l = a - 1; l >= 0; l--) {
        const d = Math.pow(2, l * e);
        u[o - l - 1] = Math.floor(i / d), i -= u[o - l - 1] * d;
      }
      return c;
    }
    s *= Math.pow(2, e);
  }
  return new ArrayBuffer(0);
}
function dS(...t) {
  let e = 0, n = 0;
  for (const o of t)
    e += o.length;
  const r = new ArrayBuffer(e), i = new Uint8Array(r);
  for (const o of t)
    i.set(o, n), n += o.length;
  return i;
}
function c5() {
  const t = new Uint8Array(this.valueHex);
  if (this.valueHex.byteLength >= 2) {
    const a = t[0] === 255 && t[1] & 128, c = t[0] === 0 && (t[1] & 128) === 0;
    (a || c) && this.warnings.push("Needlessly long format");
  }
  const e = new ArrayBuffer(this.valueHex.byteLength), n = new Uint8Array(e);
  for (let a = 0; a < this.valueHex.byteLength; a++)
    n[a] = 0;
  n[0] = t[0] & 128;
  const r = Eu(n, 8), i = new ArrayBuffer(this.valueHex.byteLength), o = new Uint8Array(i);
  for (let a = 0; a < this.valueHex.byteLength; a++)
    o[a] = t[a];
  return o[0] &= 127, Eu(o, 8) - r;
}
function ele(t) {
  const e = t < 0 ? t * -1 : t;
  let n = 128;
  for (let r = 1; r < 8; r++) {
    if (e <= n) {
      if (t < 0) {
        const s = n - e, a = ec(s, 8, r), c = new Uint8Array(a);
        return c[0] |= 128, a;
      }
      let i = ec(e, 8, r), o = new Uint8Array(i);
      if (o[0] & 128) {
        const s = i.slice(0), a = new Uint8Array(s);
        i = new ArrayBuffer(i.byteLength + 1), o = new Uint8Array(i);
        for (let c = 0; c < s.byteLength; c++)
          o[c + 1] = a[c];
        o[0] = 0;
      }
      return i;
    }
    n *= Math.pow(2, 8);
  }
  return new ArrayBuffer(0);
}
function tle(t, e) {
  if (t.byteLength !== e.byteLength)
    return !1;
  const n = new Uint8Array(t), r = new Uint8Array(e);
  for (let i = 0; i < n.length; i++)
    if (n[i] !== r[i])
      return !1;
  return !0;
}
function ni(t, e) {
  const n = t.toString(10);
  if (e < n.length)
    return "";
  const r = e - n.length, i = new Array(r);
  for (let s = 0; s < r; s++)
    i[s] = "0";
  return i.join("").concat(n);
}
/*!
 * Copyright (c) 2014, GMO GlobalSign
 * Copyright (c) 2015-2022, Peculiar Ventures
 * All rights reserved.
 * 
 * Author 2014-2019, Yury Strozhevsky
 * 
 * Redistribution and use in source and binary forms, with or without modification,
 * are permitted provided that the following conditions are met:
 * 
 * * Redistributions of source code must retain the above copyright notice, this
 *   list of conditions and the following disclaimer.
 * 
 * * Redistributions in binary form must reproduce the above copyright notice, this
 *   list of conditions and the following disclaimer in the documentation and/or
 *   other materials provided with the distribution.
 * 
 * * Neither the name of the copyright holder nor the names of its
 *   contributors may be used to endorse or promote products derived from
 *   this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * 
 */
function $m() {
  if (typeof BigInt > "u")
    throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.");
}
function BA(t) {
  let e = 0, n = 0;
  for (let i = 0; i < t.length; i++) {
    const o = t[i];
    e += o.byteLength;
  }
  const r = new Uint8Array(e);
  for (let i = 0; i < t.length; i++) {
    const o = t[i];
    r.set(new Uint8Array(o), n), n += o.byteLength;
  }
  return r.buffer;
}
function As(t, e, n, r) {
  return e instanceof Uint8Array ? e.byteLength ? n < 0 ? (t.error = "Wrong parameter: inputOffset less than zero", !1) : r < 0 ? (t.error = "Wrong parameter: inputLength less than zero", !1) : e.byteLength - n - r < 0 ? (t.error = "End of input reached before message was fully decoded (inconsistent offset and length values)", !1) : !0 : (t.error = "Wrong parameter: inputBuffer has zero length", !1) : (t.error = "Wrong parameter: inputBuffer must be 'Uint8Array'", !1);
}
class I0 {
  constructor() {
    this.items = [];
  }
  write(e) {
    this.items.push(e);
  }
  final() {
    return BA(this.items);
  }
}
const Ql = [new Uint8Array([1])], fP = "0123456789", Lx = "name", hP = "valueHexView", nle = "isHexOnly", rle = "idBlock", ile = "tagClass", ole = "tagNumber", sle = "isConstructed", ale = "fromBER", cle = "toBER", ule = "local", Or = "", go = new ArrayBuffer(0), C0 = new Uint8Array(0), sd = "EndOfContent", u5 = "OCTET STRING", l5 = "BIT STRING";
function Uo(t) {
  var e;
  return e = class extends t {
    get valueHex() {
      return this.valueHexView.slice().buffer;
    }
    set valueHex(r) {
      this.valueHexView = new Uint8Array(r);
    }
    constructor(...r) {
      var i;
      super(...r);
      const o = r[0] || {};
      this.isHexOnly = (i = o.isHexOnly) !== null && i !== void 0 ? i : !1, this.valueHexView = o.valueHex ? Ie.toUint8Array(o.valueHex) : C0;
    }
    fromBER(r, i, o) {
      const s = r instanceof ArrayBuffer ? new Uint8Array(r) : r;
      if (!As(this, s, i, o))
        return -1;
      const a = i + o;
      return this.valueHexView = s.subarray(i, a), this.valueHexView.length ? (this.blockLength = o, a) : (this.warnings.push("Zero buffer length"), i);
    }
    toBER(r = !1) {
      return this.isHexOnly ? r ? new ArrayBuffer(this.valueHexView.byteLength) : this.valueHexView.byteLength === this.valueHexView.buffer.byteLength ? this.valueHexView.buffer : this.valueHexView.slice().buffer : (this.error = "Flag 'isHexOnly' is not set, abort", go);
    }
    toJSON() {
      return {
        ...super.toJSON(),
        isHexOnly: this.isHexOnly,
        valueHex: Ue.ToHex(this.valueHexView)
      };
    }
  }, e.NAME = "hexBlock", e;
}
class kc {
  static blockName() {
    return this.NAME;
  }
  get valueBeforeDecode() {
    return this.valueBeforeDecodeView.slice().buffer;
  }
  set valueBeforeDecode(e) {
    this.valueBeforeDecodeView = new Uint8Array(e);
  }
  constructor({ blockLength: e = 0, error: n = Or, warnings: r = [], valueBeforeDecode: i = C0 } = {}) {
    this.blockLength = e, this.error = n, this.warnings = r, this.valueBeforeDecodeView = Ie.toUint8Array(i);
  }
  toJSON() {
    return {
      blockName: this.constructor.NAME,
      blockLength: this.blockLength,
      error: this.error,
      warnings: this.warnings,
      valueBeforeDecode: Ue.ToHex(this.valueBeforeDecodeView)
    };
  }
}
kc.NAME = "baseBlock";
class Nr extends kc {
  fromBER(e, n, r) {
    throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'");
  }
  toBER(e, n) {
    throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'");
  }
}
Nr.NAME = "valueBlock";
class p5 extends Uo(kc) {
  constructor({ idBlock: e = {} } = {}) {
    var n, r, i, o;
    super(), e ? (this.isHexOnly = (n = e.isHexOnly) !== null && n !== void 0 ? n : !1, this.valueHexView = e.valueHex ? Ie.toUint8Array(e.valueHex) : C0, this.tagClass = (r = e.tagClass) !== null && r !== void 0 ? r : -1, this.tagNumber = (i = e.tagNumber) !== null && i !== void 0 ? i : -1, this.isConstructed = (o = e.isConstructed) !== null && o !== void 0 ? o : !1) : (this.tagClass = -1, this.tagNumber = -1, this.isConstructed = !1);
  }
  toBER(e = !1) {
    let n = 0;
    switch (this.tagClass) {
      case 1:
        n |= 0;
        break;
      case 2:
        n |= 64;
        break;
      case 3:
        n |= 128;
        break;
      case 4:
        n |= 192;
        break;
      default:
        return this.error = "Unknown tag class", go;
    }
    if (this.isConstructed && (n |= 32), this.tagNumber < 31 && !this.isHexOnly) {
      const i = new Uint8Array(1);
      if (!e) {
        let o = this.tagNumber;
        o &= 31, n |= o, i[0] = n;
      }
      return i.buffer;
    }
    if (!this.isHexOnly) {
      const i = ec(this.tagNumber, 7), o = new Uint8Array(i), s = i.byteLength, a = new Uint8Array(s + 1);
      if (a[0] = n | 31, !e) {
        for (let c = 0; c < s - 1; c++)
          a[c + 1] = o[c] | 128;
        a[s] = o[s - 1];
      }
      return a.buffer;
    }
    const r = new Uint8Array(this.valueHexView.byteLength + 1);
    if (r[0] = n | 31, !e) {
      const i = this.valueHexView;
      for (let o = 0; o < i.length - 1; o++)
        r[o + 1] = i[o] | 128;
      r[this.valueHexView.byteLength] = i[i.length - 1];
    }
    return r.buffer;
  }
  fromBER(e, n, r) {
    const i = Ie.toUint8Array(e);
    if (!As(this, i, n, r))
      return -1;
    const o = i.subarray(n, n + r);
    if (o.length === 0)
      return this.error = "Zero buffer length", -1;
    switch (o[0] & 192) {
      case 0:
        this.tagClass = 1;
        break;
      case 64:
        this.tagClass = 2;
        break;
      case 128:
        this.tagClass = 3;
        break;
      case 192:
        this.tagClass = 4;
        break;
      default:
        return this.error = "Unknown tag class", -1;
    }
    this.isConstructed = (o[0] & 32) === 32, this.isHexOnly = !1;
    const a = o[0] & 31;
    if (a !== 31)
      this.tagNumber = a, this.blockLength = 1;
    else {
      let c = 1, u = this.valueHexView = new Uint8Array(255), l = 255;
      for (; o[c] & 128; ) {
        if (u[c - 1] = o[c] & 127, c++, c >= o.length)
          return this.error = "End of input reached before message was fully decoded", -1;
        if (c === l) {
          l += 255;
          const f = new Uint8Array(l);
          for (let m = 0; m < u.length; m++)
            f[m] = u[m];
          u = this.valueHexView = new Uint8Array(l);
        }
      }
      this.blockLength = c + 1, u[c - 1] = o[c] & 127;
      const d = new Uint8Array(c);
      for (let f = 0; f < c; f++)
        d[f] = u[f];
      u = this.valueHexView = new Uint8Array(c), u.set(d), this.blockLength <= 9 ? this.tagNumber = Eu(u, 7) : (this.isHexOnly = !0, this.warnings.push("Tag too long, represented as hex-coded"));
    }
    if (this.tagClass === 1 && this.isConstructed)
      switch (this.tagNumber) {
        case 1:
        case 2:
        case 5:
        case 6:
        case 9:
        case 13:
        case 14:
        case 23:
        case 24:
        case 31:
        case 32:
        case 33:
        case 34:
          return this.error = "Constructed encoding used for primitive type", -1;
      }
    return n + this.blockLength;
  }
  toJSON() {
    return {
      ...super.toJSON(),
      tagClass: this.tagClass,
      tagNumber: this.tagNumber,
      isConstructed: this.isConstructed
    };
  }
}
p5.NAME = "identificationBlock";
class d5 extends kc {
  constructor({ lenBlock: e = {} } = {}) {
    var n, r, i;
    super(), this.isIndefiniteForm = (n = e.isIndefiniteForm) !== null && n !== void 0 ? n : !1, this.longFormUsed = (r = e.longFormUsed) !== null && r !== void 0 ? r : !1, this.length = (i = e.length) !== null && i !== void 0 ? i : 0;
  }
  fromBER(e, n, r) {
    const i = Ie.toUint8Array(e);
    if (!As(this, i, n, r))
      return -1;
    const o = i.subarray(n, n + r);
    if (o.length === 0)
      return this.error = "Zero buffer length", -1;
    if (o[0] === 255)
      return this.error = "Length block 0xFF is reserved by standard", -1;
    if (this.isIndefiniteForm = o[0] === 128, this.isIndefiniteForm)
      return this.blockLength = 1, n + this.blockLength;
    if (this.longFormUsed = !!(o[0] & 128), this.longFormUsed === !1)
      return this.length = o[0], this.blockLength = 1, n + this.blockLength;
    const s = o[0] & 127;
    if (s > 8)
      return this.error = "Too big integer", -1;
    if (s + 1 > o.length)
      return this.error = "End of input reached before message was fully decoded", -1;
    const a = n + 1, c = i.subarray(a, a + s);
    return c[s - 1] === 0 && this.warnings.push("Needlessly long encoded length"), this.length = Eu(c, 8), this.longFormUsed && this.length <= 127 && this.warnings.push("Unnecessary usage of long length form"), this.blockLength = s + 1, n + this.blockLength;
  }
  toBER(e = !1) {
    let n, r;
    if (this.length > 127 && (this.longFormUsed = !0), this.isIndefiniteForm)
      return n = new ArrayBuffer(1), e === !1 && (r = new Uint8Array(n), r[0] = 128), n;
    if (this.longFormUsed) {
      const i = ec(this.length, 8);
      if (i.byteLength > 127)
        return this.error = "Too big length", go;
      if (n = new ArrayBuffer(i.byteLength + 1), e)
        return n;
      const o = new Uint8Array(i);
      r = new Uint8Array(n), r[0] = i.byteLength | 128;
      for (let s = 0; s < i.byteLength; s++)
        r[s + 1] = o[s];
      return n;
    }
    return n = new ArrayBuffer(1), e === !1 && (r = new Uint8Array(n), r[0] = this.length), n;
  }
  toJSON() {
    return {
      ...super.toJSON(),
      isIndefiniteForm: this.isIndefiniteForm,
      longFormUsed: this.longFormUsed,
      length: this.length
    };
  }
}
d5.NAME = "lengthBlock";
const Me = {};
class cr extends kc {
  constructor({ name: e = Or, optional: n = !1, primitiveSchema: r, ...i } = {}, o) {
    super(i), this.name = e, this.optional = n, r && (this.primitiveSchema = r), this.idBlock = new p5(i), this.lenBlock = new d5(i), this.valueBlock = o ? new o(i) : new Nr(i);
  }
  fromBER(e, n, r) {
    const i = this.valueBlock.fromBER(e, n, this.lenBlock.isIndefiniteForm ? r : this.lenBlock.length);
    return i === -1 ? (this.error = this.valueBlock.error, i) : (this.idBlock.error.length || (this.blockLength += this.idBlock.blockLength), this.lenBlock.error.length || (this.blockLength += this.lenBlock.blockLength), this.valueBlock.error.length || (this.blockLength += this.valueBlock.blockLength), i);
  }
  toBER(e, n) {
    const r = n || new I0();
    n || f5(this);
    const i = this.idBlock.toBER(e);
    if (r.write(i), this.lenBlock.isIndefiniteForm)
      r.write(new Uint8Array([128]).buffer), this.valueBlock.toBER(e, r), r.write(new ArrayBuffer(2));
    else {
      const o = this.valueBlock.toBER(e);
      this.lenBlock.length = o.byteLength;
      const s = this.lenBlock.toBER(e);
      r.write(s), r.write(o);
    }
    return n ? go : r.final();
  }
  toJSON() {
    const e = {
      ...super.toJSON(),
      idBlock: this.idBlock.toJSON(),
      lenBlock: this.lenBlock.toJSON(),
      valueBlock: this.valueBlock.toJSON(),
      name: this.name,
      optional: this.optional
    };
    return this.primitiveSchema && (e.primitiveSchema = this.primitiveSchema.toJSON()), e;
  }
  toString(e = "ascii") {
    return e === "ascii" ? this.onAsciiEncoding() : Ue.ToHex(this.toBER());
  }
  onAsciiEncoding() {
    const e = this.constructor.NAME, n = Ue.ToHex(this.valueBlock.valueBeforeDecodeView);
    return `${e} : ${n}`;
  }
  isEqual(e) {
    if (this === e)
      return !0;
    if (!(e instanceof this.constructor))
      return !1;
    const n = this.toBER(), r = e.toBER();
    return tle(n, r);
  }
}
cr.NAME = "BaseBlock";
function f5(t) {
  var e;
  if (t instanceof Me.Constructed)
    for (const n of t.valueBlock.value)
      f5(n) && (t.lenBlock.isIndefiniteForm = !0);
  return !!(!((e = t.lenBlock) === null || e === void 0) && e.isIndefiniteForm);
}
class UA extends cr {
  getValue() {
    return this.valueBlock.value;
  }
  setValue(e) {
    this.valueBlock.value = e;
  }
  constructor({ value: e = Or, ...n } = {}, r) {
    super(n, r), e && this.fromString(e);
  }
  fromBER(e, n, r) {
    const i = this.valueBlock.fromBER(e, n, this.lenBlock.isIndefiniteForm ? r : this.lenBlock.length);
    return i === -1 ? (this.error = this.valueBlock.error, i) : (this.fromBuffer(this.valueBlock.valueHexView), this.idBlock.error.length || (this.blockLength += this.idBlock.blockLength), this.lenBlock.error.length || (this.blockLength += this.lenBlock.blockLength), this.valueBlock.error.length || (this.blockLength += this.valueBlock.blockLength), i);
  }
  onAsciiEncoding() {
    return `${this.constructor.NAME} : '${this.valueBlock.value}'`;
  }
}
UA.NAME = "BaseStringBlock";
class h5 extends Uo(Nr) {
  constructor({ isHexOnly: e = !0, ...n } = {}) {
    super(n), this.isHexOnly = e;
  }
}
h5.NAME = "PrimitiveValueBlock";
var m5;
class ef extends cr {
  constructor(e = {}) {
    super(e, h5), this.idBlock.isConstructed = !1;
  }
}
m5 = ef;
Me.Primitive = m5;
ef.NAME = "PRIMITIVE";
function lle(t, e) {
  if (t instanceof e)
    return t;
  const n = new e();
  return n.idBlock = t.idBlock, n.lenBlock = t.lenBlock, n.warnings = t.warnings, n.valueBeforeDecodeView = t.valueBeforeDecodeView, n;
}
function dl(t, e = 0, n = t.length) {
  const r = e;
  let i = new cr({}, Nr);
  const o = new kc();
  if (!As(o, t, e, n))
    return i.error = o.error, {
      offset: -1,
      result: i
    };
  if (!t.subarray(e, e + n).length)
    return i.error = "Zero buffer length", {
      offset: -1,
      result: i
    };
  let a = i.idBlock.fromBER(t, e, n);
  if (i.idBlock.warnings.length && i.warnings.concat(i.idBlock.warnings), a === -1)
    return i.error = i.idBlock.error, {
      offset: -1,
      result: i
    };
  if (e = a, n -= i.idBlock.blockLength, a = i.lenBlock.fromBER(t, e, n), i.lenBlock.warnings.length && i.warnings.concat(i.lenBlock.warnings), a === -1)
    return i.error = i.lenBlock.error, {
      offset: -1,
      result: i
    };
  if (e = a, n -= i.lenBlock.blockLength, !i.idBlock.isConstructed && i.lenBlock.isIndefiniteForm)
    return i.error = "Indefinite length form used for primitive encoding form", {
      offset: -1,
      result: i
    };
  let c = cr;
  switch (i.idBlock.tagClass) {
    case 1:
      if (i.idBlock.tagNumber >= 37 && i.idBlock.isHexOnly === !1)
        return i.error = "UNIVERSAL 37 and upper tags are reserved by ASN.1 standard", {
          offset: -1,
          result: i
        };
      switch (i.idBlock.tagNumber) {
        case 0:
          if (i.idBlock.isConstructed && i.lenBlock.length > 0)
            return i.error = "Type [UNIVERSAL 0] is reserved", {
              offset: -1,
              result: i
            };
          c = Me.EndOfContent;
          break;
        case 1:
          c = Me.Boolean;
          break;
        case 2:
          c = Me.Integer;
          break;
        case 3:
          c = Me.BitString;
          break;
        case 4:
          c = Me.OctetString;
          break;
        case 5:
          c = Me.Null;
          break;
        case 6:
          c = Me.ObjectIdentifier;
          break;
        case 10:
          c = Me.Enumerated;
          break;
        case 12:
          c = Me.Utf8String;
          break;
        case 13:
          c = Me.RelativeObjectIdentifier;
          break;
        case 14:
          c = Me.TIME;
          break;
        case 15:
          return i.error = "[UNIVERSAL 15] is reserved by ASN.1 standard", {
            offset: -1,
            result: i
          };
        case 16:
          c = Me.Sequence;
          break;
        case 17:
          c = Me.Set;
          break;
        case 18:
          c = Me.NumericString;
          break;
        case 19:
          c = Me.PrintableString;
          break;
        case 20:
          c = Me.TeletexString;
          break;
        case 21:
          c = Me.VideotexString;
          break;
        case 22:
          c = Me.IA5String;
          break;
        case 23:
          c = Me.UTCTime;
          break;
        case 24:
          c = Me.GeneralizedTime;
          break;
        case 25:
          c = Me.GraphicString;
          break;
        case 26:
          c = Me.VisibleString;
          break;
        case 27:
          c = Me.GeneralString;
          break;
        case 28:
          c = Me.UniversalString;
          break;
        case 29:
          c = Me.CharacterString;
          break;
        case 30:
          c = Me.BmpString;
          break;
        case 31:
          c = Me.DATE;
          break;
        case 32:
          c = Me.TimeOfDay;
          break;
        case 33:
          c = Me.DateTime;
          break;
        case 34:
          c = Me.Duration;
          break;
        default: {
          const u = i.idBlock.isConstructed ? new Me.Constructed() : new Me.Primitive();
          u.idBlock = i.idBlock, u.lenBlock = i.lenBlock, u.warnings = i.warnings, i = u;
        }
      }
      break;
    case 2:
    case 3:
    case 4:
    default:
      c = i.idBlock.isConstructed ? Me.Constructed : Me.Primitive;
  }
  return i = lle(i, c), a = i.fromBER(t, e, i.lenBlock.isIndefiniteForm ? n : i.lenBlock.length), i.valueBeforeDecodeView = t.subarray(r, r + i.blockLength), {
    offset: a,
    result: i
  };
}
function au(t) {
  if (!t.byteLength) {
    const e = new cr({}, Nr);
    return e.error = "Input buffer has zero length", {
      offset: -1,
      result: e
    };
  }
  return dl(Ie.toUint8Array(t).slice(), 0, t.byteLength);
}
function ple(t, e) {
  return t ? 1 : e;
}
class Js extends Nr {
  constructor({ value: e = [], isIndefiniteForm: n = !1, ...r } = {}) {
    super(r), this.value = e, this.isIndefiniteForm = n;
  }
  fromBER(e, n, r) {
    const i = Ie.toUint8Array(e);
    if (!As(this, i, n, r))
      return -1;
    if (this.valueBeforeDecodeView = i.subarray(n, n + r), this.valueBeforeDecodeView.length === 0)
      return this.warnings.push("Zero buffer length"), n;
    let o = n;
    for (; ple(this.isIndefiniteForm, r) > 0; ) {
      const s = dl(i, o, r);
      if (s.offset === -1)
        return this.error = s.result.error, this.warnings.concat(s.result.warnings), -1;
      if (o = s.offset, this.blockLength += s.result.blockLength, r -= s.result.blockLength, this.value.push(s.result), this.isIndefiniteForm && s.result.constructor.NAME === sd)
        break;
    }
    return this.isIndefiniteForm && (this.value[this.value.length - 1].constructor.NAME === sd ? this.value.pop() : this.warnings.push("No EndOfContent block encoded")), o;
  }
  toBER(e, n) {
    const r = n || new I0();
    for (let i = 0; i < this.value.length; i++)
      this.value[i].toBER(e, r);
    return n ? go : r.final();
  }
  toJSON() {
    const e = {
      ...super.toJSON(),
      isIndefiniteForm: this.isIndefiniteForm,
      value: []
    };
    for (const n of this.value)
      e.value.push(n.toJSON());
    return e;
  }
}
Js.NAME = "ConstructedValueBlock";
var g5;
class Tr extends cr {
  constructor(e = {}) {
    super(e, Js), this.idBlock.isConstructed = !0;
  }
  fromBER(e, n, r) {
    this.valueBlock.isIndefiniteForm = this.lenBlock.isIndefiniteForm;
    const i = this.valueBlock.fromBER(e, n, this.lenBlock.isIndefiniteForm ? r : this.lenBlock.length);
    return i === -1 ? (this.error = this.valueBlock.error, i) : (this.idBlock.error.length || (this.blockLength += this.idBlock.blockLength), this.lenBlock.error.length || (this.blockLength += this.lenBlock.blockLength), this.valueBlock.error.length || (this.blockLength += this.valueBlock.blockLength), i);
  }
  onAsciiEncoding() {
    const e = [];
    for (const r of this.valueBlock.value)
      e.push(r.toString("ascii").split(`
`).map((i) => `  ${i}`).join(`
`));
    const n = this.idBlock.tagClass === 3 ? `[${this.idBlock.tagNumber}]` : this.constructor.NAME;
    return e.length ? `${n} :
${e.join(`
`)}` : `${n} :`;
  }
}
g5 = Tr;
Me.Constructed = g5;
Tr.NAME = "CONSTRUCTED";
class y5 extends Nr {
  fromBER(e, n, r) {
    return n;
  }
  toBER(e) {
    return go;
  }
}
y5.override = "EndOfContentValueBlock";
var v5;
class LA extends cr {
  constructor(e = {}) {
    super(e, y5), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 0;
  }
}
v5 = LA;
Me.EndOfContent = v5;
LA.NAME = sd;
var b5;
class tc extends cr {
  constructor(e = {}) {
    super(e, Nr), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 5;
  }
  fromBER(e, n, r) {
    return this.lenBlock.length > 0 && this.warnings.push("Non-zero length of value block for Null type"), this.idBlock.error.length || (this.blockLength += this.idBlock.blockLength), this.lenBlock.error.length || (this.blockLength += this.lenBlock.blockLength), this.blockLength += r, n + r > e.byteLength ? (this.error = "End of input reached before message was fully decoded (inconsistent offset and length values)", -1) : n + r;
  }
  toBER(e, n) {
    const r = new ArrayBuffer(2);
    if (!e) {
      const i = new Uint8Array(r);
      i[0] = 5, i[1] = 0;
    }
    return n && n.write(r), r;
  }
  onAsciiEncoding() {
    return `${this.constructor.NAME}`;
  }
}
b5 = tc;
Me.Null = b5;
tc.NAME = "NULL";
class x5 extends Uo(Nr) {
  get value() {
    for (const e of this.valueHexView)
      if (e > 0)
        return !0;
    return !1;
  }
  set value(e) {
    this.valueHexView[0] = e ? 255 : 0;
  }
  constructor({ value: e, ...n } = {}) {
    super(n), n.valueHex ? this.valueHexView = Ie.toUint8Array(n.valueHex) : this.valueHexView = new Uint8Array(1), e && (this.value = e);
  }
  fromBER(e, n, r) {
    const i = Ie.toUint8Array(e);
    return As(this, i, n, r) ? (this.valueHexView = i.subarray(n, n + r), r > 1 && this.warnings.push("Boolean value encoded in more then 1 octet"), this.isHexOnly = !0, c5.call(this), this.blockLength = r, n + r) : -1;
  }
  toBER() {
    return this.valueHexView.slice();
  }
  toJSON() {
    return {
      ...super.toJSON(),
      value: this.value
    };
  }
}
x5.NAME = "BooleanValueBlock";
var w5;
let T0 = class extends cr {
  getValue() {
    return this.valueBlock.value;
  }
  setValue(e) {
    this.valueBlock.value = e;
  }
  constructor(e = {}) {
    super(e, x5), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 1;
  }
  onAsciiEncoding() {
    return `${this.constructor.NAME} : ${this.getValue}`;
  }
};
w5 = T0;
Me.Boolean = w5;
T0.NAME = "BOOLEAN";
class S5 extends Uo(Js) {
  constructor({ isConstructed: e = !1, ...n } = {}) {
    super(n), this.isConstructed = e;
  }
  fromBER(e, n, r) {
    let i = 0;
    if (this.isConstructed) {
      if (this.isHexOnly = !1, i = Js.prototype.fromBER.call(this, e, n, r), i === -1)
        return i;
      for (let o = 0; o < this.value.length; o++) {
        const s = this.value[o].constructor.NAME;
        if (s === sd) {
          if (this.isIndefiniteForm)
            break;
          return this.error = "EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only", -1;
        }
        if (s !== u5)
          return this.error = "OCTET STRING may consists of OCTET STRINGs only", -1;
      }
    } else
      this.isHexOnly = !0, i = super.fromBER(e, n, r), this.blockLength = r;
    return i;
  }
  toBER(e, n) {
    return this.isConstructed ? Js.prototype.toBER.call(this, e, n) : e ? new ArrayBuffer(this.valueHexView.byteLength) : this.valueHexView.slice().buffer;
  }
  toJSON() {
    return {
      ...super.toJSON(),
      isConstructed: this.isConstructed
    };
  }
}
S5.NAME = "OctetStringValueBlock";
var jA;
let Ha = class extends cr {
  constructor({ idBlock: e = {}, lenBlock: n = {}, ...r } = {}) {
    var i, o;
    (i = r.isConstructed) !== null && i !== void 0 || (r.isConstructed = !!(!((o = r.value) === null || o === void 0) && o.length)), super({
      idBlock: {
        isConstructed: r.isConstructed,
        ...e
      },
      lenBlock: {
        ...n,
        isIndefiniteForm: !!r.isIndefiniteForm
      },
      ...r
    }, S5), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 4;
  }
  fromBER(e, n, r) {
    if (this.valueBlock.isConstructed = this.idBlock.isConstructed, this.valueBlock.isIndefiniteForm = this.lenBlock.isIndefiniteForm, r === 0)
      return this.idBlock.error.length === 0 && (this.blockLength += this.idBlock.blockLength), this.lenBlock.error.length === 0 && (this.blockLength += this.lenBlock.blockLength), n;
    if (!this.valueBlock.isConstructed) {
      const o = (e instanceof ArrayBuffer ? new Uint8Array(e) : e).subarray(n, n + r);
      try {
        if (o.byteLength) {
          const s = dl(o, 0, o.byteLength);
          s.offset !== -1 && s.offset === r && (this.valueBlock.value = [s.result]);
        }
      } catch {
      }
    }
    return super.fromBER(e, n, r);
  }
  onAsciiEncoding() {
    if (this.valueBlock.isConstructed || this.valueBlock.value && this.valueBlock.value.length)
      return Tr.prototype.onAsciiEncoding.call(this);
    const e = this.constructor.NAME, n = Ue.ToHex(this.valueBlock.valueHexView);
    return `${e} : ${n}`;
  }
  getValue() {
    if (!this.idBlock.isConstructed)
      return this.valueBlock.valueHexView.slice().buffer;
    const e = [];
    for (const n of this.valueBlock.value)
      n instanceof jA && e.push(n.valueBlock.valueHexView);
    return Ie.concat(e);
  }
};
jA = Ha;
Me.OctetString = jA;
Ha.NAME = u5;
class _5 extends Uo(Js) {
  constructor({ unusedBits: e = 0, isConstructed: n = !1, ...r } = {}) {
    super(r), this.unusedBits = e, this.isConstructed = n, this.blockLength = this.valueHexView.byteLength;
  }
  fromBER(e, n, r) {
    if (!r)
      return n;
    let i = -1;
    if (this.isConstructed) {
      if (i = Js.prototype.fromBER.call(this, e, n, r), i === -1)
        return i;
      for (const a of this.value) {
        const c = a.constructor.NAME;
        if (c === sd) {
          if (this.isIndefiniteForm)
            break;
          return this.error = "EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only", -1;
        }
        if (c !== l5)
          return this.error = "BIT STRING may consists of BIT STRINGs only", -1;
        const u = a.valueBlock;
        if (this.unusedBits > 0 && u.unusedBits > 0)
          return this.error = 'Using of "unused bits" inside constructive BIT STRING allowed for least one only', -1;
        this.unusedBits = u.unusedBits;
      }
      return i;
    }
    const o = Ie.toUint8Array(e);
    if (!As(this, o, n, r))
      return -1;
    const s = o.subarray(n, n + r);
    if (this.unusedBits = s[0], this.unusedBits > 7)
      return this.error = "Unused bits for BitString must be in range 0-7", -1;
    if (!this.unusedBits) {
      const a = s.subarray(1);
      try {
        if (a.byteLength) {
          const c = dl(a, 0, a.byteLength);
          c.offset !== -1 && c.offset === r - 1 && (this.value = [c.result]);
        }
      } catch {
      }
    }
    return this.valueHexView = s.subarray(1), this.blockLength = s.length, n + r;
  }
  toBER(e, n) {
    if (this.isConstructed)
      return Js.prototype.toBER.call(this, e, n);
    if (e)
      return new ArrayBuffer(this.valueHexView.byteLength + 1);
    if (!this.valueHexView.byteLength)
      return go;
    const r = new Uint8Array(this.valueHexView.length + 1);
    return r[0] = this.unusedBits, r.set(this.valueHexView, 1), r.buffer;
  }
  toJSON() {
    return {
      ...super.toJSON(),
      unusedBits: this.unusedBits,
      isConstructed: this.isConstructed
    };
  }
}
_5.NAME = "BitStringValueBlock";
var E5;
let Wa = class extends cr {
  constructor({ idBlock: e = {}, lenBlock: n = {}, ...r } = {}) {
    var i, o;
    (i = r.isConstructed) !== null && i !== void 0 || (r.isConstructed = !!(!((o = r.value) === null || o === void 0) && o.length)), super({
      idBlock: {
        isConstructed: r.isConstructed,
        ...e
      },
      lenBlock: {
        ...n,
        isIndefiniteForm: !!r.isIndefiniteForm
      },
      ...r
    }, _5), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 3;
  }
  fromBER(e, n, r) {
    return this.valueBlock.isConstructed = this.idBlock.isConstructed, this.valueBlock.isIndefiniteForm = this.lenBlock.isIndefiniteForm, super.fromBER(e, n, r);
  }
  onAsciiEncoding() {
    if (this.valueBlock.isConstructed || this.valueBlock.value && this.valueBlock.value.length)
      return Tr.prototype.onAsciiEncoding.call(this);
    {
      const e = [], n = this.valueBlock.valueHexView;
      for (const s of n)
        e.push(s.toString(2).padStart(8, "0"));
      const r = e.join(""), i = this.constructor.NAME, o = r.substring(0, r.length - this.valueBlock.unusedBits);
      return `${i} : ${o}`;
    }
  }
};
E5 = Wa;
Me.BitString = E5;
Wa.NAME = l5;
var A5;
function dle(t, e) {
  const n = new Uint8Array([0]), r = new Uint8Array(t), i = new Uint8Array(e);
  let o = r.slice(0);
  const s = o.length - 1, a = i.slice(0), c = a.length - 1;
  let u = 0;
  const l = c < s ? s : c;
  let d = 0;
  for (let f = l; f >= 0; f--, d++) {
    switch (!0) {
      case d < a.length:
        u = o[s - d] + a[c - d] + n[0];
        break;
      default:
        u = o[s - d] + n[0];
    }
    switch (n[0] = u / 10, !0) {
      case d >= o.length:
        o = dS(new Uint8Array([u % 10]), o);
        break;
      default:
        o[s - d] = u % 10;
    }
  }
  return n[0] > 0 && (o = dS(n, o)), o;
}
function mP(t) {
  if (t >= Ql.length)
    for (let e = Ql.length; e <= t; e++) {
      const n = new Uint8Array([0]);
      let r = Ql[e - 1].slice(0);
      for (let i = r.length - 1; i >= 0; i--) {
        const o = new Uint8Array([(r[i] << 1) + n[0]]);
        n[0] = o[0] / 10, r[i] = o[0] % 10;
      }
      n[0] > 0 && (r = dS(n, r)), Ql.push(r);
    }
  return Ql[t];
}
function fle(t, e) {
  let n = 0;
  const r = new Uint8Array(t), i = new Uint8Array(e), o = r.slice(0), s = o.length - 1, a = i.slice(0), c = a.length - 1;
  let u, l = 0;
  for (let d = c; d >= 0; d--, l++)
    switch (u = o[s - l] - a[c - l] - n, !0) {
      case u < 0:
        n = 1, o[s - l] = u + 10;
        break;
      default:
        n = 0, o[s - l] = u;
    }
  if (n > 0)
    for (let d = s - c + 1; d >= 0; d--, l++)
      if (u = o[s - l] - n, u < 0)
        n = 1, o[s - l] = u + 10;
      else {
        n = 0, o[s - l] = u;
        break;
      }
  return o.slice();
}
class QA extends Uo(Nr) {
  setValueHex() {
    this.valueHexView.length >= 4 ? (this.warnings.push("Too big Integer for decoding, hex only"), this.isHexOnly = !0, this._valueDec = 0) : (this.isHexOnly = !1, this.valueHexView.length > 0 && (this._valueDec = c5.call(this)));
  }
  constructor({ value: e, ...n } = {}) {
    super(n), this._valueDec = 0, n.valueHex && this.setValueHex(), e !== void 0 && (this.valueDec = e);
  }
  set valueDec(e) {
    this._valueDec = e, this.isHexOnly = !1, this.valueHexView = new Uint8Array(ele(e));
  }
  get valueDec() {
    return this._valueDec;
  }
  fromDER(e, n, r, i = 0) {
    const o = this.fromBER(e, n, r);
    if (o === -1)
      return o;
    const s = this.valueHexView;
    return s[0] === 0 && (s[1] & 128) !== 0 ? this.valueHexView = s.subarray(1) : i !== 0 && s.length < i && (i - s.length > 1 && (i = s.length + 1), this.valueHexView = s.subarray(i - s.length)), o;
  }
  toDER(e = !1) {
    const n = this.valueHexView;
    switch (!0) {
      case (n[0] & 128) !== 0:
        {
          const r = new Uint8Array(this.valueHexView.length + 1);
          r[0] = 0, r.set(n, 1), this.valueHexView = r;
        }
        break;
      case (n[0] === 0 && (n[1] & 128) === 0):
        this.valueHexView = this.valueHexView.subarray(1);
        break;
    }
    return this.toBER(e);
  }
  fromBER(e, n, r) {
    const i = super.fromBER(e, n, r);
    return i === -1 || this.setValueHex(), i;
  }
  toBER(e) {
    return e ? new ArrayBuffer(this.valueHexView.length) : this.valueHexView.slice().buffer;
  }
  toJSON() {
    return {
      ...super.toJSON(),
      valueDec: this.valueDec
    };
  }
  toString() {
    const e = this.valueHexView.length * 8 - 1;
    let n = new Uint8Array(this.valueHexView.length * 8 / 3), r = 0, i;
    const o = this.valueHexView;
    let s = "", a = !1;
    for (let c = o.byteLength - 1; c >= 0; c--) {
      i = o[c];
      for (let u = 0; u < 8; u++) {
        if ((i & 1) === 1)
          switch (r) {
            case e:
              n = fle(mP(r), n), s = "-";
              break;
            default:
              n = dle(n, mP(r));
          }
        r++, i >>= 1;
      }
    }
    for (let c = 0; c < n.length; c++)
      n[c] && (a = !0), a && (s += fP.charAt(n[c]));
    return a === !1 && (s += fP.charAt(0)), s;
  }
}
A5 = QA;
QA.NAME = "IntegerValueBlock";
Object.defineProperty(A5.prototype, "valueHex", {
  set: function(t) {
    this.valueHexView = new Uint8Array(t), this.setValueHex();
  },
  get: function() {
    return this.valueHexView.slice().buffer;
  }
});
var Bp;
class fl extends cr {
  constructor(e = {}) {
    super(e, QA), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 2;
  }
  toBigInt() {
    return $m(), BigInt(this.valueBlock.toString());
  }
  static fromBigInt(e) {
    $m();
    const n = BigInt(e), r = new I0(), i = n.toString(16).replace(/^-/, ""), o = new Uint8Array(Ue.FromHex(i));
    if (n < 0) {
      const a = new Uint8Array(o.length + (o[0] & 128 ? 1 : 0));
      a[0] |= 128;
      const u = BigInt(`0x${Ue.ToHex(a)}`) + n, l = Ie.toUint8Array(Ue.FromHex(u.toString(16)));
      l[0] |= 128, r.write(l);
    } else
      o[0] & 128 && r.write(new Uint8Array([0])), r.write(o);
    return new Bp({ valueHex: r.final() });
  }
  convertToDER() {
    const e = new Bp({ valueHex: this.valueBlock.valueHexView });
    return e.valueBlock.toDER(), e;
  }
  convertFromDER() {
    return new Bp({
      valueHex: this.valueBlock.valueHexView[0] === 0 ? this.valueBlock.valueHexView.subarray(1) : this.valueBlock.valueHexView
    });
  }
  onAsciiEncoding() {
    return `${this.constructor.NAME} : ${this.valueBlock.toString()}`;
  }
}
Bp = fl;
Me.Integer = Bp;
fl.NAME = "INTEGER";
var I5;
class k0 extends fl {
  constructor(e = {}) {
    super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 10;
  }
}
I5 = k0;
Me.Enumerated = I5;
k0.NAME = "ENUMERATED";
class fS extends Uo(Nr) {
  constructor({ valueDec: e = -1, isFirstSid: n = !1, ...r } = {}) {
    super(r), this.valueDec = e, this.isFirstSid = n;
  }
  fromBER(e, n, r) {
    if (!r)
      return n;
    const i = Ie.toUint8Array(e);
    if (!As(this, i, n, r))
      return -1;
    const o = i.subarray(n, n + r);
    this.valueHexView = new Uint8Array(r);
    for (let a = 0; a < r && (this.valueHexView[a] = o[a] & 127, this.blockLength++, (o[a] & 128) !== 0); a++)
      ;
    const s = new Uint8Array(this.blockLength);
    for (let a = 0; a < this.blockLength; a++)
      s[a] = this.valueHexView[a];
    return this.valueHexView = s, (o[this.blockLength - 1] & 128) !== 0 ? (this.error = "End of input reached before message was fully decoded", -1) : (this.valueHexView[0] === 0 && this.warnings.push("Needlessly long format of SID encoding"), this.blockLength <= 8 ? this.valueDec = Eu(this.valueHexView, 7) : (this.isHexOnly = !0, this.warnings.push("Too big SID for decoding, hex only")), n + this.blockLength);
  }
  set valueBigInt(e) {
    $m();
    let n = BigInt(e).toString(2);
    for (; n.length % 7; )
      n = "0" + n;
    const r = new Uint8Array(n.length / 7);
    for (let i = 0; i < r.length; i++)
      r[i] = parseInt(n.slice(i * 7, i * 7 + 7), 2) + (i + 1 < r.length ? 128 : 0);
    this.fromBER(r.buffer, 0, r.length);
  }
  toBER(e) {
    if (this.isHexOnly) {
      if (e)
        return new ArrayBuffer(this.valueHexView.byteLength);
      const i = this.valueHexView, o = new Uint8Array(this.blockLength);
      for (let s = 0; s < this.blockLength - 1; s++)
        o[s] = i[s] | 128;
      return o[this.blockLength - 1] = i[this.blockLength - 1], o.buffer;
    }
    const n = ec(this.valueDec, 7);
    if (n.byteLength === 0)
      return this.error = "Error during encoding SID value", go;
    const r = new Uint8Array(n.byteLength);
    if (!e) {
      const i = new Uint8Array(n), o = n.byteLength - 1;
      for (let s = 0; s < o; s++)
        r[s] = i[s] | 128;
      r[o] = i[o];
    }
    return r;
  }
  toString() {
    let e = "";
    if (this.isHexOnly)
      e = Ue.ToHex(this.valueHexView);
    else if (this.isFirstSid) {
      let n = this.valueDec;
      this.valueDec <= 39 ? e = "0." : this.valueDec <= 79 ? (e = "1.", n -= 40) : (e = "2.", n -= 80), e += n.toString();
    } else
      e = this.valueDec.toString();
    return e;
  }
  toJSON() {
    return {
      ...super.toJSON(),
      valueDec: this.valueDec,
      isFirstSid: this.isFirstSid
    };
  }
}
fS.NAME = "sidBlock";
class C5 extends Nr {
  constructor({ value: e = Or, ...n } = {}) {
    super(n), this.value = [], e && this.fromString(e);
  }
  fromBER(e, n, r) {
    let i = n;
    for (; r > 0; ) {
      const o = new fS();
      if (i = o.fromBER(e, i, r), i === -1)
        return this.blockLength = 0, this.error = o.error, i;
      this.value.length === 0 && (o.isFirstSid = !0), this.blockLength += o.blockLength, r -= o.blockLength, this.value.push(o);
    }
    return i;
  }
  toBER(e) {
    const n = [];
    for (let r = 0; r < this.value.length; r++) {
      const i = this.value[r].toBER(e);
      if (i.byteLength === 0)
        return this.error = this.value[r].error, go;
      n.push(i);
    }
    return BA(n);
  }
  fromString(e) {
    this.value = [];
    let n = 0, r = 0, i = "", o = !1;
    do
      if (r = e.indexOf(".", n), r === -1 ? i = e.substring(n) : i = e.substring(n, r), n = r + 1, o) {
        const s = this.value[0];
        let a = 0;
        switch (s.valueDec) {
          case 0:
            break;
          case 1:
            a = 40;
            break;
          case 2:
            a = 80;
            break;
          default:
            this.value = [];
            return;
        }
        const c = parseInt(i, 10);
        if (isNaN(c))
          return;
        s.valueDec = c + a, o = !1;
      } else {
        const s = new fS();
        if (i > Number.MAX_SAFE_INTEGER) {
          $m();
          const a = BigInt(i);
          s.valueBigInt = a;
        } else if (s.valueDec = parseInt(i, 10), isNaN(s.valueDec))
          return;
        this.value.length || (s.isFirstSid = !0, o = !0), this.value.push(s);
      }
    while (r !== -1);
  }
  toString() {
    let e = "", n = !1;
    for (let r = 0; r < this.value.length; r++) {
      n = this.value[r].isHexOnly;
      let i = this.value[r].toString();
      r !== 0 && (e = `${e}.`), n ? (i = `{${i}}`, this.value[r].isFirstSid ? e = `2.{${i} - 80}` : e += i) : e += i;
    }
    return e;
  }
  toJSON() {
    const e = {
      ...super.toJSON(),
      value: this.toString(),
      sidArray: []
    };
    for (let n = 0; n < this.value.length; n++)
      e.sidArray.push(this.value[n].toJSON());
    return e;
  }
}
C5.NAME = "ObjectIdentifierValueBlock";
var T5;
class N0 extends cr {
  getValue() {
    return this.valueBlock.toString();
  }
  setValue(e) {
    this.valueBlock.fromString(e);
  }
  constructor(e = {}) {
    super(e, C5), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 6;
  }
  onAsciiEncoding() {
    return `${this.constructor.NAME} : ${this.valueBlock.toString() || "empty"}`;
  }
  toJSON() {
    return {
      ...super.toJSON(),
      value: this.getValue()
    };
  }
}
T5 = N0;
Me.ObjectIdentifier = T5;
N0.NAME = "OBJECT IDENTIFIER";
class hS extends Uo(kc) {
  constructor({ valueDec: e = 0, ...n } = {}) {
    super(n), this.valueDec = e;
  }
  fromBER(e, n, r) {
    if (r === 0)
      return n;
    const i = Ie.toUint8Array(e);
    if (!As(this, i, n, r))
      return -1;
    const o = i.subarray(n, n + r);
    this.valueHexView = new Uint8Array(r);
    for (let a = 0; a < r && (this.valueHexView[a] = o[a] & 127, this.blockLength++, (o[a] & 128) !== 0); a++)
      ;
    const s = new Uint8Array(this.blockLength);
    for (let a = 0; a < this.blockLength; a++)
      s[a] = this.valueHexView[a];
    return this.valueHexView = s, (o[this.blockLength - 1] & 128) !== 0 ? (this.error = "End of input reached before message was fully decoded", -1) : (this.valueHexView[0] === 0 && this.warnings.push("Needlessly long format of SID encoding"), this.blockLength <= 8 ? this.valueDec = Eu(this.valueHexView, 7) : (this.isHexOnly = !0, this.warnings.push("Too big SID for decoding, hex only")), n + this.blockLength);
  }
  toBER(e) {
    if (this.isHexOnly) {
      if (e)
        return new ArrayBuffer(this.valueHexView.byteLength);
      const i = this.valueHexView, o = new Uint8Array(this.blockLength);
      for (let s = 0; s < this.blockLength - 1; s++)
        o[s] = i[s] | 128;
      return o[this.blockLength - 1] = i[this.blockLength - 1], o.buffer;
    }
    const n = ec(this.valueDec, 7);
    if (n.byteLength === 0)
      return this.error = "Error during encoding SID value", go;
    const r = new Uint8Array(n.byteLength);
    if (!e) {
      const i = new Uint8Array(n), o = n.byteLength - 1;
      for (let s = 0; s < o; s++)
        r[s] = i[s] | 128;
      r[o] = i[o];
    }
    return r.buffer;
  }
  toString() {
    let e = "";
    return this.isHexOnly ? e = Ue.ToHex(this.valueHexView) : e = this.valueDec.toString(), e;
  }
  toJSON() {
    return {
      ...super.toJSON(),
      valueDec: this.valueDec
    };
  }
}
hS.NAME = "relativeSidBlock";
class k5 extends Nr {
  constructor({ value: e = Or, ...n } = {}) {
    super(n), this.value = [], e && this.fromString(e);
  }
  fromBER(e, n, r) {
    let i = n;
    for (; r > 0; ) {
      const o = new hS();
      if (i = o.fromBER(e, i, r), i === -1)
        return this.blockLength = 0, this.error = o.error, i;
      this.blockLength += o.blockLength, r -= o.blockLength, this.value.push(o);
    }
    return i;
  }
  toBER(e, n) {
    const r = [];
    for (let i = 0; i < this.value.length; i++) {
      const o = this.value[i].toBER(e);
      if (o.byteLength === 0)
        return this.error = this.value[i].error, go;
      r.push(o);
    }
    return BA(r);
  }
  fromString(e) {
    this.value = [];
    let n = 0, r = 0, i = "";
    do {
      r = e.indexOf(".", n), r === -1 ? i = e.substring(n) : i = e.substring(n, r), n = r + 1;
      const o = new hS();
      if (o.valueDec = parseInt(i, 10), isNaN(o.valueDec))
        return !0;
      this.value.push(o);
    } while (r !== -1);
    return !0;
  }
  toString() {
    let e = "", n = !1;
    for (let r = 0; r < this.value.length; r++) {
      n = this.value[r].isHexOnly;
      let i = this.value[r].toString();
      r !== 0 && (e = `${e}.`), n && (i = `{${i}}`), e += i;
    }
    return e;
  }
  toJSON() {
    const e = {
      ...super.toJSON(),
      value: this.toString(),
      sidArray: []
    };
    for (let n = 0; n < this.value.length; n++)
      e.sidArray.push(this.value[n].toJSON());
    return e;
  }
}
k5.NAME = "RelativeObjectIdentifierValueBlock";
var N5;
class $A extends cr {
  getValue() {
    return this.valueBlock.toString();
  }
  setValue(e) {
    this.valueBlock.fromString(e);
  }
  constructor(e = {}) {
    super(e, k5), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 13;
  }
  onAsciiEncoding() {
    return `${this.constructor.NAME} : ${this.valueBlock.toString() || "empty"}`;
  }
  toJSON() {
    return {
      ...super.toJSON(),
      value: this.getValue()
    };
  }
}
N5 = $A;
Me.RelativeObjectIdentifier = N5;
$A.NAME = "RelativeObjectIdentifier";
var P5;
class zi extends Tr {
  constructor(e = {}) {
    super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 16;
  }
}
P5 = zi;
Me.Sequence = P5;
zi.NAME = "SEQUENCE";
var D5;
let Po = class extends Tr {
  constructor(e = {}) {
    super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 17;
  }
};
D5 = Po;
Me.Set = D5;
Po.NAME = "SET";
class F5 extends Uo(Nr) {
  constructor({ ...e } = {}) {
    super(e), this.isHexOnly = !0, this.value = Or;
  }
  toJSON() {
    return {
      ...super.toJSON(),
      value: this.value
    };
  }
}
F5.NAME = "StringValueBlock";
class O5 extends F5 {
}
O5.NAME = "SimpleStringValueBlock";
class hi extends UA {
  constructor({ ...e } = {}) {
    super(e, O5);
  }
  fromBuffer(e) {
    this.valueBlock.value = String.fromCharCode.apply(null, Ie.toUint8Array(e));
  }
  fromString(e) {
    const n = e.length, r = this.valueBlock.valueHexView = new Uint8Array(n);
    for (let i = 0; i < n; i++)
      r[i] = e.charCodeAt(i);
    this.valueBlock.value = e;
  }
}
hi.NAME = "SIMPLE STRING";
class M5 extends hi {
  fromBuffer(e) {
    this.valueBlock.valueHexView = Ie.toUint8Array(e);
    try {
      this.valueBlock.value = Ue.ToUtf8String(e);
    } catch (n) {
      this.warnings.push(`Error during "decodeURIComponent": ${n}, using raw string`), this.valueBlock.value = Ue.ToBinary(e);
    }
  }
  fromString(e) {
    this.valueBlock.valueHexView = new Uint8Array(Ue.FromUtf8String(e)), this.valueBlock.value = e;
  }
}
M5.NAME = "Utf8StringValueBlock";
var R5;
class Is extends M5 {
  constructor(e = {}) {
    super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 12;
  }
}
R5 = Is;
Me.Utf8String = R5;
Is.NAME = "UTF8String";
class B5 extends hi {
  fromBuffer(e) {
    this.valueBlock.value = Ue.ToUtf16String(e), this.valueBlock.valueHexView = Ie.toUint8Array(e);
  }
  fromString(e) {
    this.valueBlock.value = e, this.valueBlock.valueHexView = new Uint8Array(Ue.FromUtf16String(e));
  }
}
B5.NAME = "BmpStringValueBlock";
var U5;
class P0 extends B5 {
  constructor({ ...e } = {}) {
    super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 30;
  }
}
U5 = P0;
Me.BmpString = U5;
P0.NAME = "BMPString";
class L5 extends hi {
  fromBuffer(e) {
    const n = ArrayBuffer.isView(e) ? e.slice().buffer : e.slice(0), r = new Uint8Array(n);
    for (let i = 0; i < r.length; i += 4)
      r[i] = r[i + 3], r[i + 1] = r[i + 2], r[i + 2] = 0, r[i + 3] = 0;
    this.valueBlock.value = String.fromCharCode.apply(null, new Uint32Array(n));
  }
  fromString(e) {
    const n = e.length, r = this.valueBlock.valueHexView = new Uint8Array(n * 4);
    for (let i = 0; i < n; i++) {
      const o = ec(e.charCodeAt(i), 8), s = new Uint8Array(o);
      if (s.length > 4)
        continue;
      const a = 4 - s.length;
      for (let c = s.length - 1; c >= 0; c--)
        r[i * 4 + c + a] = s[c];
    }
    this.valueBlock.value = e;
  }
}
L5.NAME = "UniversalStringValueBlock";
var j5;
class D0 extends L5 {
  constructor({ ...e } = {}) {
    super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 28;
  }
}
j5 = D0;
Me.UniversalString = j5;
D0.NAME = "UniversalString";
var Q5;
class F0 extends hi {
  constructor(e = {}) {
    super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 18;
  }
}
Q5 = F0;
Me.NumericString = Q5;
F0.NAME = "NumericString";
var $5;
class O0 extends hi {
  constructor(e = {}) {
    super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 19;
  }
}
$5 = O0;
Me.PrintableString = $5;
O0.NAME = "PrintableString";
var G5;
class M0 extends hi {
  constructor(e = {}) {
    super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 20;
  }
}
G5 = M0;
Me.TeletexString = G5;
M0.NAME = "TeletexString";
var q5;
class R0 extends hi {
  constructor(e = {}) {
    super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 21;
  }
}
q5 = R0;
Me.VideotexString = q5;
R0.NAME = "VideotexString";
var H5;
class B0 extends hi {
  constructor(e = {}) {
    super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 22;
  }
}
H5 = B0;
Me.IA5String = H5;
B0.NAME = "IA5String";
var W5;
class U0 extends hi {
  constructor(e = {}) {
    super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 25;
  }
}
W5 = U0;
Me.GraphicString = W5;
U0.NAME = "GraphicString";
var z5;
class tf extends hi {
  constructor(e = {}) {
    super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 26;
  }
}
z5 = tf;
Me.VisibleString = z5;
tf.NAME = "VisibleString";
var K5;
class L0 extends hi {
  constructor(e = {}) {
    super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 27;
  }
}
K5 = L0;
Me.GeneralString = K5;
L0.NAME = "GeneralString";
var V5;
class j0 extends hi {
  constructor(e = {}) {
    super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 29;
  }
}
V5 = j0;
Me.CharacterString = V5;
j0.NAME = "CharacterString";
var Y5;
class nf extends tf {
  constructor({ value: e, valueDate: n, ...r } = {}) {
    if (super(r), this.year = 0, this.month = 0, this.day = 0, this.hour = 0, this.minute = 0, this.second = 0, e) {
      this.fromString(e), this.valueBlock.valueHexView = new Uint8Array(e.length);
      for (let i = 0; i < e.length; i++)
        this.valueBlock.valueHexView[i] = e.charCodeAt(i);
    }
    n && (this.fromDate(n), this.valueBlock.valueHexView = new Uint8Array(this.toBuffer())), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 23;
  }
  fromBuffer(e) {
    this.fromString(String.fromCharCode.apply(null, Ie.toUint8Array(e)));
  }
  toBuffer() {
    const e = this.toString(), n = new ArrayBuffer(e.length), r = new Uint8Array(n);
    for (let i = 0; i < e.length; i++)
      r[i] = e.charCodeAt(i);
    return n;
  }
  fromDate(e) {
    this.year = e.getUTCFullYear(), this.month = e.getUTCMonth() + 1, this.day = e.getUTCDate(), this.hour = e.getUTCHours(), this.minute = e.getUTCMinutes(), this.second = e.getUTCSeconds();
  }
  toDate() {
    return new Date(Date.UTC(this.year, this.month - 1, this.day, this.hour, this.minute, this.second));
  }
  fromString(e) {
    const r = /(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(e);
    if (r === null) {
      this.error = "Wrong input string for conversion";
      return;
    }
    const i = parseInt(r[1], 10);
    i >= 50 ? this.year = 1900 + i : this.year = 2e3 + i, this.month = parseInt(r[2], 10), this.day = parseInt(r[3], 10), this.hour = parseInt(r[4], 10), this.minute = parseInt(r[5], 10), this.second = parseInt(r[6], 10);
  }
  toString(e = "iso") {
    if (e === "iso") {
      const n = new Array(7);
      return n[0] = ni(this.year < 2e3 ? this.year - 1900 : this.year - 2e3, 2), n[1] = ni(this.month, 2), n[2] = ni(this.day, 2), n[3] = ni(this.hour, 2), n[4] = ni(this.minute, 2), n[5] = ni(this.second, 2), n[6] = "Z", n.join("");
    }
    return super.toString(e);
  }
  onAsciiEncoding() {
    return `${this.constructor.NAME} : ${this.toDate().toISOString()}`;
  }
  toJSON() {
    return {
      ...super.toJSON(),
      year: this.year,
      month: this.month,
      day: this.day,
      hour: this.hour,
      minute: this.minute,
      second: this.second
    };
  }
}
Y5 = nf;
Me.UTCTime = Y5;
nf.NAME = "UTCTime";
var J5;
class Q0 extends nf {
  constructor(e = {}) {
    var n;
    super(e), (n = this.millisecond) !== null && n !== void 0 || (this.millisecond = 0), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 24;
  }
  fromDate(e) {
    super.fromDate(e), this.millisecond = e.getUTCMilliseconds();
  }
  toDate() {
    const e = Date.UTC(this.year, this.month - 1, this.day, this.hour, this.minute, this.second, this.millisecond);
    return new Date(e);
  }
  fromString(e) {
    let n = !1, r = "", i = "", o = 0, s, a = 0, c = 0;
    if (e[e.length - 1] === "Z")
      r = e.substring(0, e.length - 1), n = !0;
    else {
      const d = new Number(e[e.length - 1]);
      if (isNaN(d.valueOf()))
        throw new Error("Wrong input string for conversion");
      r = e;
    }
    if (n) {
      if (r.indexOf("+") !== -1)
        throw new Error("Wrong input string for conversion");
      if (r.indexOf("-") !== -1)
        throw new Error("Wrong input string for conversion");
    } else {
      let d = 1, f = r.indexOf("+"), m = "";
      if (f === -1 && (f = r.indexOf("-"), d = -1), f !== -1) {
        if (m = r.substring(f + 1), r = r.substring(0, f), m.length !== 2 && m.length !== 4)
          throw new Error("Wrong input string for conversion");
        let h = parseInt(m.substring(0, 2), 10);
        if (isNaN(h.valueOf()))
          throw new Error("Wrong input string for conversion");
        if (a = d * h, m.length === 4) {
          if (h = parseInt(m.substring(2, 4), 10), isNaN(h.valueOf()))
            throw new Error("Wrong input string for conversion");
          c = d * h;
        }
      }
    }
    let u = r.indexOf(".");
    if (u === -1 && (u = r.indexOf(",")), u !== -1) {
      const d = new Number(`0${r.substring(u)}`);
      if (isNaN(d.valueOf()))
        throw new Error("Wrong input string for conversion");
      o = d.valueOf(), i = r.substring(0, u);
    } else
      i = r;
    switch (!0) {
      case i.length === 8:
        if (s = /(\d{4})(\d{2})(\d{2})/ig, u !== -1)
          throw new Error("Wrong input string for conversion");
        break;
      case i.length === 10:
        if (s = /(\d{4})(\d{2})(\d{2})(\d{2})/ig, u !== -1) {
          let d = 60 * o;
          this.minute = Math.floor(d), d = 60 * (d - this.minute), this.second = Math.floor(d), d = 1e3 * (d - this.second), this.millisecond = Math.floor(d);
        }
        break;
      case i.length === 12:
        if (s = /(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig, u !== -1) {
          let d = 60 * o;
          this.second = Math.floor(d), d = 1e3 * (d - this.second), this.millisecond = Math.floor(d);
        }
        break;
      case i.length === 14:
        if (s = /(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig, u !== -1) {
          const d = 1e3 * o;
          this.millisecond = Math.floor(d);
        }
        break;
      default:
        throw new Error("Wrong input string for conversion");
    }
    const l = s.exec(i);
    if (l === null)
      throw new Error("Wrong input string for conversion");
    for (let d = 1; d < l.length; d++)
      switch (d) {
        case 1:
          this.year = parseInt(l[d], 10);
          break;
        case 2:
          this.month = parseInt(l[d], 10);
          break;
        case 3:
          this.day = parseInt(l[d], 10);
          break;
        case 4:
          this.hour = parseInt(l[d], 10) + a;
          break;
        case 5:
          this.minute = parseInt(l[d], 10) + c;
          break;
        case 6:
          this.second = parseInt(l[d], 10);
          break;
        default:
          throw new Error("Wrong input string for conversion");
      }
    if (n === !1) {
      const d = new Date(this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
      this.year = d.getUTCFullYear(), this.month = d.getUTCMonth(), this.day = d.getUTCDay(), this.hour = d.getUTCHours(), this.minute = d.getUTCMinutes(), this.second = d.getUTCSeconds(), this.millisecond = d.getUTCMilliseconds();
    }
  }
  toString(e = "iso") {
    if (e === "iso") {
      const n = [];
      return n.push(ni(this.year, 4)), n.push(ni(this.month, 2)), n.push(ni(this.day, 2)), n.push(ni(this.hour, 2)), n.push(ni(this.minute, 2)), n.push(ni(this.second, 2)), this.millisecond !== 0 && (n.push("."), n.push(ni(this.millisecond, 3))), n.push("Z"), n.join("");
    }
    return super.toString(e);
  }
  toJSON() {
    return {
      ...super.toJSON(),
      millisecond: this.millisecond
    };
  }
}
J5 = Q0;
Me.GeneralizedTime = J5;
Q0.NAME = "GeneralizedTime";
var X5;
class GA extends Is {
  constructor(e = {}) {
    super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 31;
  }
}
X5 = GA;
Me.DATE = X5;
GA.NAME = "DATE";
var Z5;
class qA extends Is {
  constructor(e = {}) {
    super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 32;
  }
}
Z5 = qA;
Me.TimeOfDay = Z5;
qA.NAME = "TimeOfDay";
var eB;
class HA extends Is {
  constructor(e = {}) {
    super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 33;
  }
}
eB = HA;
Me.DateTime = eB;
HA.NAME = "DateTime";
var tB;
class WA extends Is {
  constructor(e = {}) {
    super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 34;
  }
}
tB = WA;
Me.Duration = tB;
WA.NAME = "Duration";
var nB;
class zA extends Is {
  constructor(e = {}) {
    super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 14;
  }
}
nB = zA;
Me.TIME = nB;
zA.NAME = "TIME";
class nc {
  constructor({ name: e = Or, optional: n = !1 } = {}) {
    this.name = e, this.optional = n;
  }
}
class KA extends nc {
  constructor({ value: e = [], ...n } = {}) {
    super(n), this.value = e;
  }
}
class Gm extends nc {
  constructor({ value: e = new nc(), local: n = !1, ...r } = {}) {
    super(r), this.value = e, this.local = n;
  }
}
class hle {
  get data() {
    return this.dataView.slice().buffer;
  }
  set data(e) {
    this.dataView = Ie.toUint8Array(e);
  }
  constructor({ data: e = C0 } = {}) {
    this.dataView = Ie.toUint8Array(e);
  }
  fromBER(e, n, r) {
    const i = n + r;
    return this.dataView = Ie.toUint8Array(e).subarray(n, i), i;
  }
  toBER(e) {
    return this.dataView.slice().buffer;
  }
}
function Ws(t, e, n) {
  if (n instanceof KA) {
    for (const o of n.value)
      if (Ws(t, e, o).verified)
        return {
          verified: !0,
          result: t
        };
    {
      const o = {
        verified: !1,
        result: { error: "Wrong values for Choice type" }
      };
      return n.hasOwnProperty(Lx) && (o.name = n.name), o;
    }
  }
  if (n instanceof nc)
    return n.hasOwnProperty(Lx) && (t[n.name] = e), {
      verified: !0,
      result: t
    };
  if (!(t instanceof Object))
    return {
      verified: !1,
      result: { error: "Wrong root object" }
    };
  if (!(e instanceof Object))
    return {
      verified: !1,
      result: { error: "Wrong ASN.1 data" }
    };
  if (!(n instanceof Object))
    return {
      verified: !1,
      result: { error: "Wrong ASN.1 schema" }
    };
  if (!(rle in n))
    return {
      verified: !1,
      result: { error: "Wrong ASN.1 schema" }
    };
  if (!(ale in n.idBlock))
    return {
      verified: !1,
      result: { error: "Wrong ASN.1 schema" }
    };
  if (!(cle in n.idBlock))
    return {
      verified: !1,
      result: { error: "Wrong ASN.1 schema" }
    };
  const r = n.idBlock.toBER(!1);
  if (r.byteLength === 0)
    return {
      verified: !1,
      result: { error: "Error encoding idBlock for ASN.1 schema" }
    };
  if (n.idBlock.fromBER(r, 0, r.byteLength) === -1)
    return {
      verified: !1,
      result: { error: "Error decoding idBlock for ASN.1 schema" }
    };
  if (n.idBlock.hasOwnProperty(ile) === !1)
    return {
      verified: !1,
      result: { error: "Wrong ASN.1 schema" }
    };
  if (n.idBlock.tagClass !== e.idBlock.tagClass)
    return {
      verified: !1,
      result: t
    };
  if (n.idBlock.hasOwnProperty(ole) === !1)
    return {
      verified: !1,
      result: { error: "Wrong ASN.1 schema" }
    };
  if (n.idBlock.tagNumber !== e.idBlock.tagNumber)
    return {
      verified: !1,
      result: t
    };
  if (n.idBlock.hasOwnProperty(sle) === !1)
    return {
      verified: !1,
      result: { error: "Wrong ASN.1 schema" }
    };
  if (n.idBlock.isConstructed !== e.idBlock.isConstructed)
    return {
      verified: !1,
      result: t
    };
  if (!(nle in n.idBlock))
    return {
      verified: !1,
      result: { error: "Wrong ASN.1 schema" }
    };
  if (n.idBlock.isHexOnly !== e.idBlock.isHexOnly)
    return {
      verified: !1,
      result: t
    };
  if (n.idBlock.isHexOnly) {
    if (!(hP in n.idBlock))
      return {
        verified: !1,
        result: { error: "Wrong ASN.1 schema" }
      };
    const o = n.idBlock.valueHexView, s = e.idBlock.valueHexView;
    if (o.length !== s.length)
      return {
        verified: !1,
        result: t
      };
    for (let a = 0; a < o.length; a++)
      if (o[a] !== s[1])
        return {
          verified: !1,
          result: t
        };
  }
  if (n.name && (n.name = n.name.replace(/^\s+|\s+$/g, Or), n.name && (t[n.name] = e)), n instanceof Me.Constructed) {
    let o = 0, s = {
      verified: !1,
      result: { error: "Unknown error" }
    }, a = n.valueBlock.value.length;
    if (a > 0 && n.valueBlock.value[0] instanceof Gm && (a = e.valueBlock.value.length), a === 0)
      return {
        verified: !0,
        result: t
      };
    if (e.valueBlock.value.length === 0 && n.valueBlock.value.length !== 0) {
      let c = !0;
      for (let u = 0; u < n.valueBlock.value.length; u++)
        c = c && (n.valueBlock.value[u].optional || !1);
      return c ? {
        verified: !0,
        result: t
      } : (n.name && (n.name = n.name.replace(/^\s+|\s+$/g, Or), n.name && delete t[n.name]), t.error = "Inconsistent object length", {
        verified: !1,
        result: t
      });
    }
    for (let c = 0; c < a; c++)
      if (c - o >= e.valueBlock.value.length) {
        if (n.valueBlock.value[c].optional === !1) {
          const u = {
            verified: !1,
            result: t
          };
          return t.error = "Inconsistent length between ASN.1 data and schema", n.name && (n.name = n.name.replace(/^\s+|\s+$/g, Or), n.name && (delete t[n.name], u.name = n.name)), u;
        }
      } else if (n.valueBlock.value[0] instanceof Gm) {
        if (s = Ws(t, e.valueBlock.value[c], n.valueBlock.value[0].value), s.verified === !1)
          if (n.valueBlock.value[0].optional)
            o++;
          else
            return n.name && (n.name = n.name.replace(/^\s+|\s+$/g, Or), n.name && delete t[n.name]), s;
        if (Lx in n.valueBlock.value[0] && n.valueBlock.value[0].name.length > 0) {
          let u = {};
          ule in n.valueBlock.value[0] && n.valueBlock.value[0].local ? u = e : u = t, typeof u[n.valueBlock.value[0].name] > "u" && (u[n.valueBlock.value[0].name] = []), u[n.valueBlock.value[0].name].push(e.valueBlock.value[c]);
        }
      } else if (s = Ws(t, e.valueBlock.value[c - o], n.valueBlock.value[c]), s.verified === !1)
        if (n.valueBlock.value[c].optional)
          o++;
        else
          return n.name && (n.name = n.name.replace(/^\s+|\s+$/g, Or), n.name && delete t[n.name]), s;
    if (s.verified === !1) {
      const c = {
        verified: !1,
        result: t
      };
      return n.name && (n.name = n.name.replace(/^\s+|\s+$/g, Or), n.name && (delete t[n.name], c.name = n.name)), c;
    }
    return {
      verified: !0,
      result: t
    };
  }
  if (n.primitiveSchema && hP in e.valueBlock) {
    const o = dl(e.valueBlock.valueHexView);
    if (o.offset === -1) {
      const s = {
        verified: !1,
        result: o.result
      };
      return n.name && (n.name = n.name.replace(/^\s+|\s+$/g, Or), n.name && (delete t[n.name], s.name = n.name)), s;
    }
    return Ws(t, o.result, n.primitiveSchema);
  }
  return {
    verified: !0,
    result: t
  };
}
function mle(t, e) {
  if (!(e instanceof Object))
    return {
      verified: !1,
      result: { error: "Wrong ASN.1 schema type" }
    };
  const n = dl(Ie.toUint8Array(t));
  return n.offset === -1 ? {
    verified: !1,
    result: n.result
  } : Ws(n.result, n.result, e);
}
const rB = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  Any: nc,
  BaseBlock: cr,
  BaseStringBlock: UA,
  BitString: Wa,
  BmpString: P0,
  Boolean: T0,
  CharacterString: j0,
  Choice: KA,
  Constructed: Tr,
  DATE: GA,
  DateTime: HA,
  Duration: WA,
  EndOfContent: LA,
  Enumerated: k0,
  GeneralString: L0,
  GeneralizedTime: Q0,
  GraphicString: U0,
  HexBlock: Uo,
  IA5String: B0,
  Integer: fl,
  Null: tc,
  NumericString: F0,
  ObjectIdentifier: N0,
  OctetString: Ha,
  Primitive: ef,
  PrintableString: O0,
  RawData: hle,
  RelativeObjectIdentifier: $A,
  Repeated: Gm,
  Sequence: zi,
  Set: Po,
  TIME: zA,
  TeletexString: M0,
  TimeOfDay: qA,
  UTCTime: nf,
  UniversalString: D0,
  Utf8String: Is,
  ValueBlock: Nr,
  VideotexString: R0,
  ViewWriter: I0,
  VisibleString: tf,
  compareSchema: Ws,
  fromBER: au,
  verifySchema: mle
}, Symbol.toStringTag, { value: "Module" }));
var ge;
(function(t) {
  t[t.Sequence = 0] = "Sequence", t[t.Set = 1] = "Set", t[t.Choice = 2] = "Choice";
})(ge || (ge = {}));
var te;
(function(t) {
  t[t.Any = 1] = "Any", t[t.Boolean = 2] = "Boolean", t[t.OctetString = 3] = "OctetString", t[t.BitString = 4] = "BitString", t[t.Integer = 5] = "Integer", t[t.Enumerated = 6] = "Enumerated", t[t.ObjectIdentifier = 7] = "ObjectIdentifier", t[t.Utf8String = 8] = "Utf8String", t[t.BmpString = 9] = "BmpString", t[t.UniversalString = 10] = "UniversalString", t[t.NumericString = 11] = "NumericString", t[t.PrintableString = 12] = "PrintableString", t[t.TeletexString = 13] = "TeletexString", t[t.VideotexString = 14] = "VideotexString", t[t.IA5String = 15] = "IA5String", t[t.GraphicString = 16] = "GraphicString", t[t.VisibleString = 17] = "VisibleString", t[t.GeneralString = 18] = "GeneralString", t[t.CharacterString = 19] = "CharacterString", t[t.UTCTime = 20] = "UTCTime", t[t.GeneralizedTime = 21] = "GeneralizedTime", t[t.DATE = 22] = "DATE", t[t.TimeOfDay = 23] = "TimeOfDay", t[t.DateTime = 24] = "DateTime", t[t.Duration = 25] = "Duration", t[t.TIME = 26] = "TIME", t[t.Null = 27] = "Null";
})(te || (te = {}));
class $0 {
  constructor(e, n = 0) {
    if (this.unusedBits = 0, this.value = new ArrayBuffer(0), e)
      if (typeof e == "number")
        this.fromNumber(e);
      else if (Ie.isBufferSource(e))
        this.unusedBits = n, this.value = Ie.toArrayBuffer(e);
      else
        throw TypeError("Unsupported type of 'params' argument for BitString");
  }
  fromASN(e) {
    if (!(e instanceof Wa))
      throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString");
    return this.unusedBits = e.valueBlock.unusedBits, this.value = e.valueBlock.valueHex, this;
  }
  toASN() {
    return new Wa({ unusedBits: this.unusedBits, valueHex: this.value });
  }
  toSchema(e) {
    return new Wa({ name: e });
  }
  toNumber() {
    let e = "";
    const n = new Uint8Array(this.value);
    for (const r of n)
      e += r.toString(2).padStart(8, "0");
    return e = e.split("").reverse().join(""), this.unusedBits && (e = e.slice(this.unusedBits).padStart(this.unusedBits, "0")), parseInt(e, 2);
  }
  fromNumber(e) {
    let n = e.toString(2);
    const r = n.length + 7 >> 3;
    this.unusedBits = (r << 3) - n.length;
    const i = new Uint8Array(r);
    n = n.padStart(r << 3, "0").split("").reverse().join("");
    let o = 0;
    for (; o < r; )
      i[o] = parseInt(n.slice(o << 3, (o << 3) + 8), 2), o++;
    this.value = i.buffer;
  }
}
class je {
  get byteLength() {
    return this.buffer.byteLength;
  }
  get byteOffset() {
    return 0;
  }
  constructor(e) {
    typeof e == "number" ? this.buffer = new ArrayBuffer(e) : Ie.isBufferSource(e) ? this.buffer = Ie.toArrayBuffer(e) : Array.isArray(e) ? this.buffer = new Uint8Array(e) : this.buffer = new ArrayBuffer(0);
  }
  fromASN(e) {
    if (!(e instanceof Ha))
      throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");
    return this.buffer = e.valueBlock.valueHex, this;
  }
  toASN() {
    return new Ha({ valueHex: this.buffer });
  }
  toSchema(e) {
    return new Ha({ name: e });
  }
}
const gle = {
  fromASN: (t) => t instanceof tc ? null : t.valueBeforeDecodeView,
  toASN: (t) => {
    if (t === null)
      return new tc();
    const e = au(t);
    if (e.result.error)
      throw new Error(e.result.error);
    return e.result;
  }
}, yle = {
  fromASN: (t) => t.valueBlock.valueHexView.byteLength >= 4 ? t.valueBlock.toString() : t.valueBlock.valueDec,
  toASN: (t) => new fl({ value: +t })
}, vle = {
  fromASN: (t) => t.valueBlock.valueDec,
  toASN: (t) => new k0({ value: t })
}, zt = {
  fromASN: (t) => t.valueBlock.valueHexView,
  toASN: (t) => new fl({ valueHex: t })
}, ble = {
  fromASN: (t) => t.valueBlock.valueHexView,
  toASN: (t) => new Wa({ valueHex: t })
}, xle = {
  fromASN: (t) => t.valueBlock.toString(),
  toASN: (t) => new N0({ value: t })
}, wle = {
  fromASN: (t) => t.valueBlock.value,
  toASN: (t) => new T0({ value: t })
}, qm = {
  fromASN: (t) => t.valueBlock.valueHexView,
  toASN: (t) => new Ha({ valueHex: t })
}, Sle = {
  fromASN: (t) => new je(t.getValue()),
  toASN: (t) => t.toASN()
};
function Mi(t) {
  return {
    fromASN: (e) => e.valueBlock.value,
    toASN: (e) => new t({ value: e })
  };
}
const iB = Mi(Is), _le = Mi(P0), Ele = Mi(D0), Ale = Mi(F0), Ile = Mi(O0), Cle = Mi(M0), Tle = Mi(R0), kle = Mi(B0), Nle = Mi(U0), Ple = Mi(tf), Dle = Mi(L0), Fle = Mi(j0), Ole = {
  fromASN: (t) => t.toDate(),
  toASN: (t) => new nf({ valueDate: t })
}, Mle = {
  fromASN: (t) => t.toDate(),
  toASN: (t) => new Q0({ valueDate: t })
}, Rle = {
  fromASN: () => null,
  toASN: () => new tc()
};
function Up(t) {
  switch (t) {
    case te.Any:
      return gle;
    case te.BitString:
      return ble;
    case te.BmpString:
      return _le;
    case te.Boolean:
      return wle;
    case te.CharacterString:
      return Fle;
    case te.Enumerated:
      return vle;
    case te.GeneralString:
      return Dle;
    case te.GeneralizedTime:
      return Mle;
    case te.GraphicString:
      return Nle;
    case te.IA5String:
      return kle;
    case te.Integer:
      return yle;
    case te.Null:
      return Rle;
    case te.NumericString:
      return Ale;
    case te.ObjectIdentifier:
      return xle;
    case te.OctetString:
      return qm;
    case te.PrintableString:
      return Ile;
    case te.TeletexString:
      return Cle;
    case te.UTCTime:
      return Ole;
    case te.UniversalString:
      return Ele;
    case te.Utf8String:
      return iB;
    case te.VideotexString:
      return Tle;
    case te.VisibleString:
      return Ple;
    default:
      return null;
  }
}
function ss(t) {
  return typeof t == "function" && t.prototype ? t.prototype.toASN && t.prototype.fromASN ? !0 : ss(t.prototype) : !!(t && typeof t == "object" && "toASN" in t && "fromASN" in t);
}
function oB(t) {
  var e;
  if (t) {
    const n = Object.getPrototypeOf(t);
    return ((e = n?.prototype) === null || e === void 0 ? void 0 : e.constructor) === Array ? !0 : oB(n);
  }
  return !1;
}
function Ble(t, e) {
  if (!(t && e) || t.byteLength !== e.byteLength)
    return !1;
  const n = new Uint8Array(t), r = new Uint8Array(e);
  for (let i = 0; i < t.byteLength; i++)
    if (n[i] !== r[i])
      return !1;
  return !0;
}
class Ule {
  constructor() {
    this.items = /* @__PURE__ */ new WeakMap();
  }
  has(e) {
    return this.items.has(e);
  }
  get(e, n = !1) {
    const r = this.items.get(e);
    if (!r)
      throw new Error(`Cannot get schema for '${e.prototype.constructor.name}' target`);
    if (n && !r.schema)
      throw new Error(`Schema '${e.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);
    return r;
  }
  cache(e) {
    const n = this.get(e);
    n.schema || (n.schema = this.create(e, !0));
  }
  createDefault(e) {
    const n = { type: ge.Sequence, items: {} }, r = this.findParentSchema(e);
    return r && (Object.assign(n, r), n.items = Object.assign({}, n.items, r.items)), n;
  }
  create(e, n) {
    const r = this.items.get(e) || this.createDefault(e), i = [];
    for (const o in r.items) {
      const s = r.items[o], a = n ? o : "";
      let c;
      if (typeof s.type == "number") {
        const l = te[s.type], d = rB[l];
        if (!d)
          throw new Error(`Cannot get ASN1 class by name '${l}'`);
        c = new d({ name: a });
      } else ss(s.type) ? c = new s.type().toSchema(a) : s.optional ? this.get(s.type).type === ge.Choice ? c = new nc({ name: a }) : (c = this.create(s.type, !1), c.name = a) : c = new nc({ name: a });
      const u = !!s.optional || s.defaultValue !== void 0;
      if (s.repeated) {
        c.name = "";
        const l = s.repeated === "set" ? Po : zi;
        c = new l({
          name: "",
          value: [new Gm({ name: a, value: c })]
        });
      }
      if (s.context !== null && s.context !== void 0)
        if (s.implicit)
          if (typeof s.type == "number" || ss(s.type)) {
            const l = s.repeated ? Tr : ef;
            i.push(new l({ name: a, optional: u, idBlock: { tagClass: 3, tagNumber: s.context } }));
          } else {
            this.cache(s.type);
            const l = !!s.repeated;
            let d = l ? c : this.get(s.type, !0).schema;
            d = "valueBlock" in d ? d.valueBlock.value : d.value, i.push(new Tr({
              name: l ? "" : a,
              optional: u,
              idBlock: { tagClass: 3, tagNumber: s.context },
              value: d
            }));
          }
        else
          i.push(new Tr({
            optional: u,
            idBlock: { tagClass: 3, tagNumber: s.context },
            value: [c]
          }));
      else
        c.optional = u, i.push(c);
    }
    switch (r.type) {
      case ge.Sequence:
        return new zi({ value: i, name: "" });
      case ge.Set:
        return new Po({ value: i, name: "" });
      case ge.Choice:
        return new KA({ value: i, name: "" });
      default:
        throw new Error("Unsupported ASN1 type in use");
    }
  }
  set(e, n) {
    return this.items.set(e, n), this;
  }
  findParentSchema(e) {
    const n = Object.getPrototypeOf(e);
    return n ? this.items.get(n) || this.findParentSchema(n) : null;
  }
}
const tr = new Ule(), Se = (t) => (e) => {
  let n;
  tr.has(e) ? n = tr.get(e) : (n = tr.createDefault(e), tr.set(e, n)), Object.assign(n, t);
}, H = (t) => (e, n) => {
  let r;
  tr.has(e.constructor) ? r = tr.get(e.constructor) : (r = tr.createDefault(e.constructor), tr.set(e.constructor, r));
  const i = Object.assign({}, t);
  if (typeof i.type == "number" && !i.converter) {
    const o = Up(t.type);
    if (!o)
      throw new Error(`Cannot get default converter for property '${n}' of ${e.constructor.name}`);
    i.converter = o;
  }
  i.raw = t.raw, r.items[n] = i;
};
class $l extends Error {
  constructor() {
    super(...arguments), this.schemas = [];
  }
}
class Qr {
  static parse(e, n) {
    const r = au(e);
    if (r.result.error)
      throw new Error(r.result.error);
    return this.fromASN(r.result, n);
  }
  static fromASN(e, n) {
    try {
      if (ss(n))
        return new n().fromASN(e);
      const r = tr.get(n);
      tr.cache(n);
      let i = r.schema;
      const o = this.handleChoiceTypes(e, r, n, i);
      if (o?.result)
        return o.result;
      o?.targetSchema && (i = o.targetSchema);
      const s = this.handleSequenceTypes(e, r, n, i), a = new n();
      return oB(n) ? this.handleArrayTypes(e, r, n) : (this.processSchemaItems(r, s, a), a);
    } catch (r) {
      throw r instanceof $l && r.schemas.push(n.name), r;
    }
  }
  static handleChoiceTypes(e, n, r, i) {
    if (e.constructor === Tr && n.type === ge.Choice && e.idBlock.tagClass === 3)
      for (const o in n.items) {
        const s = n.items[o];
        if (s.context === e.idBlock.tagNumber && s.implicit && typeof s.type == "function" && tr.has(s.type)) {
          const a = tr.get(s.type);
          if (a && a.type === ge.Sequence) {
            const c = new zi();
            if ("value" in e.valueBlock && Array.isArray(e.valueBlock.value) && "value" in c.valueBlock) {
              c.valueBlock.value = e.valueBlock.value;
              const u = this.fromASN(c, s.type), l = new r();
              return l[o] = u, { result: l };
            }
          }
        }
      }
    else if (e.constructor === Tr && n.type !== ge.Choice) {
      const o = new Tr({
        idBlock: {
          tagClass: 3,
          tagNumber: e.idBlock.tagNumber
        },
        value: n.schema.valueBlock.value
      });
      for (const s in n.items)
        delete e[s];
      return { targetSchema: o };
    }
    return null;
  }
  static handleSequenceTypes(e, n, r, i) {
    if (n.type === ge.Sequence) {
      const o = Ws({}, e, i);
      if (!o.verified)
        throw new $l(`Data does not match to ${r.name} ASN1 schema.${o.result.error ? ` ${o.result.error}` : ""}`);
      return o;
    } else {
      const o = Ws({}, e, i);
      if (!o.verified)
        throw new $l(`Data does not match to ${r.name} ASN1 schema.${o.result.error ? ` ${o.result.error}` : ""}`);
      return o;
    }
  }
  static processRepeatedField(e, n, r) {
    let i = e.slice(n);
    if (i.length === 1 && i[0].constructor.name === "Sequence") {
      const o = i[0];
      o.valueBlock && o.valueBlock.value && Array.isArray(o.valueBlock.value) && (i = o.valueBlock.value);
    }
    if (typeof r.type == "number") {
      const o = Up(r.type);
      if (!o)
        throw new Error(`No converter for ASN.1 type ${r.type}`);
      return i.filter((s) => s && s.valueBlock).map((s) => {
        try {
          return o.fromASN(s);
        } catch {
          return;
        }
      }).filter((s) => s !== void 0);
    } else
      return i.filter((o) => o && o.valueBlock).map((o) => {
        try {
          return this.fromASN(o, r.type);
        } catch {
          return;
        }
      }).filter((o) => o !== void 0);
  }
  static processPrimitiveField(e, n) {
    const r = Up(n.type);
    if (!r)
      throw new Error(`No converter for ASN.1 type ${n.type}`);
    return r.fromASN(e);
  }
  static isOptionalChoiceField(e) {
    return e.optional && typeof e.type == "function" && tr.has(e.type) && tr.get(e.type).type === ge.Choice;
  }
  static processOptionalChoiceField(e, n) {
    try {
      return { processed: !0, value: this.fromASN(e, n.type) };
    } catch (r) {
      if (r instanceof $l && /Wrong values for Choice type/.test(r.message))
        return { processed: !1 };
      throw r;
    }
  }
  static handleArrayTypes(e, n, r) {
    if (!("value" in e.valueBlock && Array.isArray(e.valueBlock.value)))
      throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");
    const i = n.itemType;
    if (typeof i == "number") {
      const o = Up(i);
      if (!o)
        throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);
      return r.from(e.valueBlock.value, (s) => o.fromASN(s));
    } else
      return r.from(e.valueBlock.value, (o) => this.fromASN(o, i));
  }
  static processSchemaItems(e, n, r) {
    for (const i in e.items) {
      const o = n.result[i];
      if (!o)
        continue;
      const s = e.items[i], a = s.type;
      let c;
      typeof a == "number" || ss(a) ? c = this.processPrimitiveSchemaItem(o, s, a) : c = this.processComplexSchemaItem(o, s, a), c && typeof c == "object" && "value" in c && "raw" in c ? (r[i] = c.value, r[`${i}Raw`] = c.raw) : r[i] = c;
    }
  }
  static processPrimitiveSchemaItem(e, n, r) {
    var i;
    const o = (i = n.converter) !== null && i !== void 0 ? i : ss(r) ? new r() : null;
    if (!o)
      throw new Error("Converter is empty");
    return n.repeated ? this.processRepeatedPrimitiveItem(e, n, o) : this.processSinglePrimitiveItem(e, n, r, o);
  }
  static processRepeatedPrimitiveItem(e, n, r) {
    if (n.implicit) {
      const i = n.repeated === "sequence" ? zi : Po, o = new i();
      o.valueBlock = e.valueBlock;
      const s = au(o.toBER(!1));
      if (s.offset === -1)
        throw new Error(`Cannot parse the child item. ${s.result.error}`);
      if (!("value" in s.result.valueBlock && Array.isArray(s.result.valueBlock.value)))
        throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");
      const a = s.result.valueBlock.value;
      return Array.from(a, (c) => r.fromASN(c));
    } else
      return Array.from(e, (i) => r.fromASN(i));
  }
  static processSinglePrimitiveItem(e, n, r, i) {
    let o = e;
    if (n.implicit) {
      let s;
      if (ss(r))
        s = new r().toSchema("");
      else {
        const a = te[r], c = rB[a];
        if (!c)
          throw new Error(`Cannot get '${a}' class from asn1js module`);
        s = new c();
      }
      s.valueBlock = o.valueBlock, o = au(s.toBER(!1)).result;
    }
    return i.fromASN(o);
  }
  static processComplexSchemaItem(e, n, r) {
    if (n.repeated) {
      if (!Array.isArray(e))
        throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");
      return Array.from(e, (i) => this.fromASN(i, r));
    } else {
      const i = this.handleImplicitTagging(e, n, r);
      if (this.isOptionalChoiceField(n))
        try {
          return this.fromASN(i, r);
        } catch (o) {
          if (o instanceof $l && /Wrong values for Choice type/.test(o.message))
            return;
          throw o;
        }
      else {
        const o = this.fromASN(i, r);
        return n.raw ? {
          value: o,
          raw: e.valueBeforeDecodeView
        } : o;
      }
    }
  }
  static handleImplicitTagging(e, n, r) {
    if (n.implicit && typeof n.context == "number") {
      const i = tr.get(r);
      if (i.type === ge.Sequence) {
        const o = new zi();
        if ("value" in e.valueBlock && Array.isArray(e.valueBlock.value) && "value" in o.valueBlock)
          return o.valueBlock.value = e.valueBlock.value, o;
      } else if (i.type === ge.Set) {
        const o = new Po();
        if ("value" in e.valueBlock && Array.isArray(e.valueBlock.value) && "value" in o.valueBlock)
          return o.valueBlock.value = e.valueBlock.value, o;
      }
    }
    return e;
  }
}
class VA {
  static serialize(e) {
    return e instanceof cr ? e.toBER(!1) : this.toASN(e).toBER(!1);
  }
  static toASN(e) {
    if (e && typeof e == "object" && ss(e))
      return e.toASN();
    if (!(e && typeof e == "object"))
      throw new TypeError("Parameter 1 should be type of Object.");
    const n = e.constructor, r = tr.get(n);
    tr.cache(n);
    let i = [];
    if (r.itemType) {
      if (!Array.isArray(e))
        throw new TypeError("Parameter 1 should be type of Array.");
      if (typeof r.itemType == "number") {
        const s = Up(r.itemType);
        if (!s)
          throw new Error(`Cannot get default converter for array item of ${n.name} ASN1 schema`);
        i = e.map((a) => s.toASN(a));
      } else
        i = e.map((s) => this.toAsnItem({ type: r.itemType }, "[]", n, s));
    } else
      for (const s in r.items) {
        const a = r.items[s], c = e[s];
        if (c === void 0 || a.defaultValue === c || typeof a.defaultValue == "object" && typeof c == "object" && Ble(this.serialize(a.defaultValue), this.serialize(c)))
          continue;
        const u = VA.toAsnItem(a, s, n, c);
        if (typeof a.context == "number")
          if (a.implicit)
            if (!a.repeated && (typeof a.type == "number" || ss(a.type))) {
              const l = {};
              l.valueHex = u instanceof tc ? u.valueBeforeDecodeView : u.valueBlock.toBER(), i.push(new ef({
                optional: a.optional,
                idBlock: {
                  tagClass: 3,
                  tagNumber: a.context
                },
                ...l
              }));
            } else
              i.push(new Tr({
                optional: a.optional,
                idBlock: {
                  tagClass: 3,
                  tagNumber: a.context
                },
                value: u.valueBlock.value
              }));
          else
            i.push(new Tr({
              optional: a.optional,
              idBlock: {
                tagClass: 3,
                tagNumber: a.context
              },
              value: [u]
            }));
        else a.repeated ? i = i.concat(u) : i.push(u);
      }
    let o;
    switch (r.type) {
      case ge.Sequence:
        o = new zi({ value: i });
        break;
      case ge.Set:
        o = new Po({ value: i });
        break;
      case ge.Choice:
        if (!i[0])
          throw new Error(`Schema '${n.name}' has wrong data. Choice cannot be empty.`);
        o = i[0];
        break;
    }
    return o;
  }
  static toAsnItem(e, n, r, i) {
    let o;
    if (typeof e.type == "number") {
      const s = e.converter;
      if (!s)
        throw new Error(`Property '${n}' doesn't have converter for type ${te[e.type]} in schema '${r.name}'`);
      if (e.repeated) {
        if (!Array.isArray(i))
          throw new TypeError("Parameter 'objProp' should be type of Array.");
        const a = Array.from(i, (u) => s.toASN(u)), c = e.repeated === "sequence" ? zi : Po;
        o = new c({
          value: a
        });
      } else
        o = s.toASN(i);
    } else if (e.repeated) {
      if (!Array.isArray(i))
        throw new TypeError("Parameter 'objProp' should be type of Array.");
      const s = Array.from(i, (c) => this.toASN(c)), a = e.repeated === "sequence" ? zi : Po;
      o = new a({
        value: s
      });
    } else
      o = this.toASN(i);
    return o;
  }
}
class Ct extends Array {
  constructor(e = []) {
    if (typeof e == "number")
      super(e);
    else {
      super();
      for (const n of e)
        this.push(n);
    }
  }
}
class Ce {
  static serialize(e) {
    return VA.serialize(e);
  }
  static parse(e, n) {
    return Qr.parse(e, n);
  }
  static toString(e) {
    const n = Ie.isBufferSource(e) ? Ie.toArrayBuffer(e) : Ce.serialize(e), r = au(n);
    if (r.offset === -1)
      throw new Error(`Cannot decode ASN.1 data. ${r.result.error}`);
    return r.result.toString();
  }
}
var jx = { exports: {} }, gP;
function Lle() {
  return gP || (gP = 1, (function(t) {
    var e, n, r, i, o, s, a, c, u, l, d, f, m, h, y, x, g, v, S, E, T, j, q, Y, W, G, J, B, D, X, V, K;
    (function($) {
      var _ = typeof On == "object" ? On : typeof self == "object" ? self : typeof this == "object" ? this : {};
      $(I(_, I(t.exports)));
      function I(N, U) {
        return N !== _ && (typeof Object.create == "function" ? Object.defineProperty(N, "__esModule", { value: !0 }) : N.__esModule = !0), function(C, L) {
          return N[C] = U ? U(C, L) : L;
        };
      }
    })(function($) {
      var _ = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(C, L) {
        C.__proto__ = L;
      } || function(C, L) {
        for (var k in L) Object.prototype.hasOwnProperty.call(L, k) && (C[k] = L[k]);
      };
      e = function(C, L) {
        if (typeof L != "function" && L !== null)
          throw new TypeError("Class extends value " + String(L) + " is not a constructor or null");
        _(C, L);
        function k() {
          this.constructor = C;
        }
        C.prototype = L === null ? Object.create(L) : (k.prototype = L.prototype, new k());
      }, n = Object.assign || function(C) {
        for (var L, k = 1, M = arguments.length; k < M; k++) {
          L = arguments[k];
          for (var F in L) Object.prototype.hasOwnProperty.call(L, F) && (C[F] = L[F]);
        }
        return C;
      }, r = function(C, L) {
        var k = {};
        for (var M in C) Object.prototype.hasOwnProperty.call(C, M) && L.indexOf(M) < 0 && (k[M] = C[M]);
        if (C != null && typeof Object.getOwnPropertySymbols == "function")
          for (var F = 0, M = Object.getOwnPropertySymbols(C); F < M.length; F++)
            L.indexOf(M[F]) < 0 && Object.prototype.propertyIsEnumerable.call(C, M[F]) && (k[M[F]] = C[M[F]]);
        return k;
      }, i = function(C, L, k, M) {
        var F = arguments.length, A = F < 3 ? L : M === null ? M = Object.getOwnPropertyDescriptor(L, k) : M, O;
        if (typeof Reflect == "object" && typeof Reflect.decorate == "function") A = Reflect.decorate(C, L, k, M);
        else for (var Z = C.length - 1; Z >= 0; Z--) (O = C[Z]) && (A = (F < 3 ? O(A) : F > 3 ? O(L, k, A) : O(L, k)) || A);
        return F > 3 && A && Object.defineProperty(L, k, A), A;
      }, o = function(C, L) {
        return function(k, M) {
          L(k, M, C);
        };
      }, s = function(C, L, k, M, F, A) {
        function O(He) {
          if (He !== void 0 && typeof He != "function") throw new TypeError("Function expected");
          return He;
        }
        for (var Z = M.kind, ee = Z === "getter" ? "get" : Z === "setter" ? "set" : "value", P = !L && C ? M.static ? C : C.prototype : null, Q = L || (P ? Object.getOwnPropertyDescriptor(P, M.name) : {}), z, se = !1, ae = k.length - 1; ae >= 0; ae--) {
          var ie = {};
          for (var we in M) ie[we] = we === "access" ? {} : M[we];
          for (var we in M.access) ie.access[we] = M.access[we];
          ie.addInitializer = function(He) {
            if (se) throw new TypeError("Cannot add initializers after decoration has completed");
            A.push(O(He || null));
          };
          var Oe = (0, k[ae])(Z === "accessor" ? { get: Q.get, set: Q.set } : Q[ee], ie);
          if (Z === "accessor") {
            if (Oe === void 0) continue;
            if (Oe === null || typeof Oe != "object") throw new TypeError("Object expected");
            (z = O(Oe.get)) && (Q.get = z), (z = O(Oe.set)) && (Q.set = z), (z = O(Oe.init)) && F.unshift(z);
          } else (z = O(Oe)) && (Z === "field" ? F.unshift(z) : Q[ee] = z);
        }
        P && Object.defineProperty(P, M.name, Q), se = !0;
      }, a = function(C, L, k) {
        for (var M = arguments.length > 2, F = 0; F < L.length; F++)
          k = M ? L[F].call(C, k) : L[F].call(C);
        return M ? k : void 0;
      }, c = function(C) {
        return typeof C == "symbol" ? C : "".concat(C);
      }, u = function(C, L, k) {
        return typeof L == "symbol" && (L = L.description ? "[".concat(L.description, "]") : ""), Object.defineProperty(C, "name", { configurable: !0, value: k ? "".concat(k, " ", L) : L });
      }, l = function(C, L) {
        if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(C, L);
      }, d = function(C, L, k, M) {
        function F(A) {
          return A instanceof k ? A : new k(function(O) {
            O(A);
          });
        }
        return new (k || (k = Promise))(function(A, O) {
          function Z(Q) {
            try {
              P(M.next(Q));
            } catch (z) {
              O(z);
            }
          }
          function ee(Q) {
            try {
              P(M.throw(Q));
            } catch (z) {
              O(z);
            }
          }
          function P(Q) {
            Q.done ? A(Q.value) : F(Q.value).then(Z, ee);
          }
          P((M = M.apply(C, L || [])).next());
        });
      }, f = function(C, L) {
        var k = { label: 0, sent: function() {
          if (A[0] & 1) throw A[1];
          return A[1];
        }, trys: [], ops: [] }, M, F, A, O = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
        return O.next = Z(0), O.throw = Z(1), O.return = Z(2), typeof Symbol == "function" && (O[Symbol.iterator] = function() {
          return this;
        }), O;
        function Z(P) {
          return function(Q) {
            return ee([P, Q]);
          };
        }
        function ee(P) {
          if (M) throw new TypeError("Generator is already executing.");
          for (; O && (O = 0, P[0] && (k = 0)), k; ) try {
            if (M = 1, F && (A = P[0] & 2 ? F.return : P[0] ? F.throw || ((A = F.return) && A.call(F), 0) : F.next) && !(A = A.call(F, P[1])).done) return A;
            switch (F = 0, A && (P = [P[0] & 2, A.value]), P[0]) {
              case 0:
              case 1:
                A = P;
                break;
              case 4:
                return k.label++, { value: P[1], done: !1 };
              case 5:
                k.label++, F = P[1], P = [0];
                continue;
              case 7:
                P = k.ops.pop(), k.trys.pop();
                continue;
              default:
                if (A = k.trys, !(A = A.length > 0 && A[A.length - 1]) && (P[0] === 6 || P[0] === 2)) {
                  k = 0;
                  continue;
                }
                if (P[0] === 3 && (!A || P[1] > A[0] && P[1] < A[3])) {
                  k.label = P[1];
                  break;
                }
                if (P[0] === 6 && k.label < A[1]) {
                  k.label = A[1], A = P;
                  break;
                }
                if (A && k.label < A[2]) {
                  k.label = A[2], k.ops.push(P);
                  break;
                }
                A[2] && k.ops.pop(), k.trys.pop();
                continue;
            }
            P = L.call(C, k);
          } catch (Q) {
            P = [6, Q], F = 0;
          } finally {
            M = A = 0;
          }
          if (P[0] & 5) throw P[1];
          return { value: P[0] ? P[1] : void 0, done: !0 };
        }
      }, m = function(C, L) {
        for (var k in C) k !== "default" && !Object.prototype.hasOwnProperty.call(L, k) && D(L, C, k);
      }, D = Object.create ? (function(C, L, k, M) {
        M === void 0 && (M = k);
        var F = Object.getOwnPropertyDescriptor(L, k);
        (!F || ("get" in F ? !L.__esModule : F.writable || F.configurable)) && (F = { enumerable: !0, get: function() {
          return L[k];
        } }), Object.defineProperty(C, M, F);
      }) : (function(C, L, k, M) {
        M === void 0 && (M = k), C[M] = L[k];
      }), h = function(C) {
        var L = typeof Symbol == "function" && Symbol.iterator, k = L && C[L], M = 0;
        if (k) return k.call(C);
        if (C && typeof C.length == "number") return {
          next: function() {
            return C && M >= C.length && (C = void 0), { value: C && C[M++], done: !C };
          }
        };
        throw new TypeError(L ? "Object is not iterable." : "Symbol.iterator is not defined.");
      }, y = function(C, L) {
        var k = typeof Symbol == "function" && C[Symbol.iterator];
        if (!k) return C;
        var M = k.call(C), F, A = [], O;
        try {
          for (; (L === void 0 || L-- > 0) && !(F = M.next()).done; ) A.push(F.value);
        } catch (Z) {
          O = { error: Z };
        } finally {
          try {
            F && !F.done && (k = M.return) && k.call(M);
          } finally {
            if (O) throw O.error;
          }
        }
        return A;
      }, x = function() {
        for (var C = [], L = 0; L < arguments.length; L++)
          C = C.concat(y(arguments[L]));
        return C;
      }, g = function() {
        for (var C = 0, L = 0, k = arguments.length; L < k; L++) C += arguments[L].length;
        for (var M = Array(C), F = 0, L = 0; L < k; L++)
          for (var A = arguments[L], O = 0, Z = A.length; O < Z; O++, F++)
            M[F] = A[O];
        return M;
      }, v = function(C, L, k) {
        if (k || arguments.length === 2) for (var M = 0, F = L.length, A; M < F; M++)
          (A || !(M in L)) && (A || (A = Array.prototype.slice.call(L, 0, M)), A[M] = L[M]);
        return C.concat(A || Array.prototype.slice.call(L));
      }, S = function(C) {
        return this instanceof S ? (this.v = C, this) : new S(C);
      }, E = function(C, L, k) {
        if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
        var M = k.apply(C, L || []), F, A = [];
        return F = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), Z("next"), Z("throw"), Z("return", O), F[Symbol.asyncIterator] = function() {
          return this;
        }, F;
        function O(ae) {
          return function(ie) {
            return Promise.resolve(ie).then(ae, z);
          };
        }
        function Z(ae, ie) {
          M[ae] && (F[ae] = function(we) {
            return new Promise(function(Oe, He) {
              A.push([ae, we, Oe, He]) > 1 || ee(ae, we);
            });
          }, ie && (F[ae] = ie(F[ae])));
        }
        function ee(ae, ie) {
          try {
            P(M[ae](ie));
          } catch (we) {
            se(A[0][3], we);
          }
        }
        function P(ae) {
          ae.value instanceof S ? Promise.resolve(ae.value.v).then(Q, z) : se(A[0][2], ae);
        }
        function Q(ae) {
          ee("next", ae);
        }
        function z(ae) {
          ee("throw", ae);
        }
        function se(ae, ie) {
          ae(ie), A.shift(), A.length && ee(A[0][0], A[0][1]);
        }
      }, T = function(C) {
        var L, k;
        return L = {}, M("next"), M("throw", function(F) {
          throw F;
        }), M("return"), L[Symbol.iterator] = function() {
          return this;
        }, L;
        function M(F, A) {
          L[F] = C[F] ? function(O) {
            return (k = !k) ? { value: S(C[F](O)), done: !1 } : A ? A(O) : O;
          } : A;
        }
      }, j = function(C) {
        if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
        var L = C[Symbol.asyncIterator], k;
        return L ? L.call(C) : (C = typeof h == "function" ? h(C) : C[Symbol.iterator](), k = {}, M("next"), M("throw"), M("return"), k[Symbol.asyncIterator] = function() {
          return this;
        }, k);
        function M(A) {
          k[A] = C[A] && function(O) {
            return new Promise(function(Z, ee) {
              O = C[A](O), F(Z, ee, O.done, O.value);
            });
          };
        }
        function F(A, O, Z, ee) {
          Promise.resolve(ee).then(function(P) {
            A({ value: P, done: Z });
          }, O);
        }
      }, q = function(C, L) {
        return Object.defineProperty ? Object.defineProperty(C, "raw", { value: L }) : C.raw = L, C;
      };
      var I = Object.create ? (function(C, L) {
        Object.defineProperty(C, "default", { enumerable: !0, value: L });
      }) : function(C, L) {
        C.default = L;
      }, N = function(C) {
        return N = Object.getOwnPropertyNames || function(L) {
          var k = [];
          for (var M in L) Object.prototype.hasOwnProperty.call(L, M) && (k[k.length] = M);
          return k;
        }, N(C);
      };
      Y = function(C) {
        if (C && C.__esModule) return C;
        var L = {};
        if (C != null) for (var k = N(C), M = 0; M < k.length; M++) k[M] !== "default" && D(L, C, k[M]);
        return I(L, C), L;
      }, W = function(C) {
        return C && C.__esModule ? C : { default: C };
      }, G = function(C, L, k, M) {
        if (k === "a" && !M) throw new TypeError("Private accessor was defined without a getter");
        if (typeof L == "function" ? C !== L || !M : !L.has(C)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
        return k === "m" ? M : k === "a" ? M.call(C) : M ? M.value : L.get(C);
      }, J = function(C, L, k, M, F) {
        if (M === "m") throw new TypeError("Private method is not writable");
        if (M === "a" && !F) throw new TypeError("Private accessor was defined without a setter");
        if (typeof L == "function" ? C !== L || !F : !L.has(C)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
        return M === "a" ? F.call(C, k) : F ? F.value = k : L.set(C, k), k;
      }, B = function(C, L) {
        if (L === null || typeof L != "object" && typeof L != "function") throw new TypeError("Cannot use 'in' operator on non-object");
        return typeof C == "function" ? L === C : C.has(L);
      }, X = function(C, L, k) {
        if (L != null) {
          if (typeof L != "object" && typeof L != "function") throw new TypeError("Object expected.");
          var M, F;
          if (k) {
            if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
            M = L[Symbol.asyncDispose];
          }
          if (M === void 0) {
            if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
            M = L[Symbol.dispose], k && (F = M);
          }
          if (typeof M != "function") throw new TypeError("Object not disposable.");
          F && (M = function() {
            try {
              F.call(this);
            } catch (A) {
              return Promise.reject(A);
            }
          }), C.stack.push({ value: L, dispose: M, async: k });
        } else k && C.stack.push({ async: !0 });
        return L;
      };
      var U = typeof SuppressedError == "function" ? SuppressedError : function(C, L, k) {
        var M = new Error(k);
        return M.name = "SuppressedError", M.error = C, M.suppressed = L, M;
      };
      V = function(C) {
        function L(A) {
          C.error = C.hasError ? new U(A, C.error, "An error was suppressed during disposal.") : A, C.hasError = !0;
        }
        var k, M = 0;
        function F() {
          for (; k = C.stack.pop(); )
            try {
              if (!k.async && M === 1) return M = 0, C.stack.push(k), Promise.resolve().then(F);
              if (k.dispose) {
                var A = k.dispose.call(k.value);
                if (k.async) return M |= 2, Promise.resolve(A).then(F, function(O) {
                  return L(O), F();
                });
              } else M |= 1;
            } catch (O) {
              L(O);
            }
          if (M === 1) return C.hasError ? Promise.reject(C.error) : Promise.resolve();
          if (C.hasError) throw C.error;
        }
        return F();
      }, K = function(C, L) {
        return typeof C == "string" && /^\.\.?\//.test(C) ? C.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(k, M, F, A, O) {
          return M ? L ? ".jsx" : ".js" : F && (!A || !O) ? k : F + A + "." + O.toLowerCase() + "js";
        }) : C;
      }, $("__extends", e), $("__assign", n), $("__rest", r), $("__decorate", i), $("__param", o), $("__esDecorate", s), $("__runInitializers", a), $("__propKey", c), $("__setFunctionName", u), $("__metadata", l), $("__awaiter", d), $("__generator", f), $("__exportStar", m), $("__createBinding", D), $("__values", h), $("__read", y), $("__spread", x), $("__spreadArrays", g), $("__spreadArray", v), $("__await", S), $("__asyncGenerator", E), $("__asyncDelegator", T), $("__asyncValues", j), $("__makeTemplateObject", q), $("__importStar", Y), $("__importDefault", W), $("__classPrivateFieldGet", G), $("__classPrivateFieldSet", J), $("__classPrivateFieldIn", B), $("__addDisposableResource", X), $("__disposeResources", V), $("__rewriteRelativeImportExtension", K);
    });
  })(jx)), jx.exports;
}
var jle = /* @__PURE__ */ Lle();
const Qle = /* @__PURE__ */ Bo(jle), {
  __extends: RAe,
  __assign: BAe,
  __rest: UAe,
  __decorate: R,
  __param: LAe,
  __esDecorate: jAe,
  __runInitializers: QAe,
  __propKey: $Ae,
  __setFunctionName: GAe,
  __metadata: qAe,
  __awaiter: HAe,
  __generator: WAe,
  __exportStar: zAe,
  __createBinding: KAe,
  __values: VAe,
  __read: YAe,
  __spread: JAe,
  __spreadArrays: XAe,
  __spreadArray: ZAe,
  __await: e2e,
  __asyncGenerator: t2e,
  __asyncDelegator: n2e,
  __asyncValues: r2e,
  __makeTemplateObject: i2e,
  __importStar: o2e,
  __importDefault: s2e,
  __classPrivateFieldGet: Re,
  __classPrivateFieldSet: pt,
  __classPrivateFieldIn: a2e,
  __addDisposableResource: c2e,
  __disposeResources: u2e,
  __rewriteRelativeImportExtension: l2e
} = Qle;
class yP {
  static isIPv4(e) {
    return /^(\d{1,3}\.){3}\d{1,3}$/.test(e);
  }
  static parseIPv4(e) {
    const n = e.split(".");
    if (n.length !== 4)
      throw new Error("Invalid IPv4 address");
    return n.map((r) => {
      const i = parseInt(r, 10);
      if (isNaN(i) || i < 0 || i > 255)
        throw new Error("Invalid IPv4 address part");
      return i;
    });
  }
  static parseIPv6(e) {
    const r = this.expandIPv6(e).split(":");
    if (r.length !== 8)
      throw new Error("Invalid IPv6 address");
    return r.reduce((i, o) => {
      const s = parseInt(o, 16);
      if (isNaN(s) || s < 0 || s > 65535)
        throw new Error("Invalid IPv6 address part");
      return i.push(s >> 8 & 255), i.push(s & 255), i;
    }, []);
  }
  static expandIPv6(e) {
    if (!e.includes("::"))
      return e;
    const n = e.split("::");
    if (n.length > 2)
      throw new Error("Invalid IPv6 address");
    const r = n[0] ? n[0].split(":") : [], i = n[1] ? n[1].split(":") : [], o = 8 - (r.length + i.length);
    if (o < 0)
      throw new Error("Invalid IPv6 address");
    return [...r, ...Array(o).fill("0"), ...i].join(":");
  }
  static formatIPv6(e) {
    const n = [];
    for (let r = 0; r < 16; r += 2)
      n.push((e[r] << 8 | e[r + 1]).toString(16));
    return this.compressIPv6(n.join(":"));
  }
  static compressIPv6(e) {
    const n = e.split(":");
    let r = -1, i = 0, o = -1, s = 0;
    for (let a = 0; a < n.length; a++)
      n[a] === "0" ? (o === -1 && (o = a), s++) : (s > i && (r = o, i = s), o = -1, s = 0);
    if (s > i && (r = o, i = s), i > 1) {
      const a = n.slice(0, r).join(":"), c = n.slice(r + i).join(":");
      return `${a}::${c}`;
    }
    return e;
  }
  static parseCIDR(e) {
    const [n, r] = e.split("/"), i = parseInt(r, 10);
    if (this.isIPv4(n)) {
      if (i < 0 || i > 32)
        throw new Error("Invalid IPv4 prefix length");
      return [this.parseIPv4(n), i];
    } else {
      if (i < 0 || i > 128)
        throw new Error("Invalid IPv6 prefix length");
      return [this.parseIPv6(n), i];
    }
  }
  static decodeIP(e) {
    if (e.length === 64 && parseInt(e, 16) === 0)
      return "::/0";
    if (e.length !== 16)
      return e;
    const n = parseInt(e.slice(8), 16).toString(2).split("").reduce((i, o) => i + +o, 0);
    let r = e.slice(0, 8).replace(/(.{2})/g, (i) => `${parseInt(i, 16)}.`);
    return r = r.slice(0, -1), `${r}/${n}`;
  }
  static toString(e) {
    const n = new Uint8Array(e);
    if (n.length === 4)
      return Array.from(n).join(".");
    if (n.length === 16)
      return this.formatIPv6(n);
    if (n.length === 8 || n.length === 32) {
      const r = n.length / 2, i = n.slice(0, r), o = n.slice(r);
      if (n.every((c) => c === 0))
        return n.length === 8 ? "0.0.0.0/0" : "::/0";
      const a = o.reduce((c, u) => c + (u.toString(2).match(/1/g) || []).length, 0);
      return n.length === 8 ? `${Array.from(i).join(".")}/${a}` : `${this.formatIPv6(i)}/${a}`;
    }
    return this.decodeIP(Ue.ToHex(e));
  }
  static fromString(e) {
    if (e.includes("/")) {
      const [r, i] = this.parseCIDR(e), o = new Uint8Array(r.length);
      let s = i;
      for (let c = 0; c < o.length; c++)
        s >= 8 ? (o[c] = 255, s -= 8) : s > 0 && (o[c] = 255 << 8 - s, s = 0);
      const a = new Uint8Array(r.length * 2);
      return a.set(r, 0), a.set(o, r.length), a.buffer;
    }
    const n = this.isIPv4(e) ? this.parseIPv4(e) : this.parseIPv6(e);
    return new Uint8Array(n).buffer;
  }
}
var mS, gS, yS;
let ur = class {
  constructor(e = {}) {
    Object.assign(this, e);
  }
  toString() {
    return this.bmpString || this.printableString || this.teletexString || this.universalString || this.utf8String || "";
  }
};
R([
  H({ type: te.TeletexString })
], ur.prototype, "teletexString", void 0);
R([
  H({ type: te.PrintableString })
], ur.prototype, "printableString", void 0);
R([
  H({ type: te.UniversalString })
], ur.prototype, "universalString", void 0);
R([
  H({ type: te.Utf8String })
], ur.prototype, "utf8String", void 0);
R([
  H({ type: te.BmpString })
], ur.prototype, "bmpString", void 0);
ur = R([
  Se({ type: ge.Choice })
], ur);
let Au = class extends ur {
  constructor(e = {}) {
    super(e), Object.assign(this, e);
  }
  toString() {
    return this.ia5String || (this.anyValue ? Ue.ToHex(this.anyValue) : super.toString());
  }
};
R([
  H({ type: te.IA5String })
], Au.prototype, "ia5String", void 0);
R([
  H({ type: te.Any })
], Au.prototype, "anyValue", void 0);
Au = R([
  Se({ type: ge.Choice })
], Au);
class G0 {
  constructor(e = {}) {
    this.type = "", this.value = new Au(), Object.assign(this, e);
  }
}
R([
  H({ type: te.ObjectIdentifier })
], G0.prototype, "type", void 0);
R([
  H({ type: Au })
], G0.prototype, "value", void 0);
let Iu = mS = class extends Ct {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, mS.prototype);
  }
};
Iu = mS = R([
  Se({ type: ge.Set, itemType: G0 })
], Iu);
let vS = gS = class extends Ct {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, gS.prototype);
  }
};
vS = gS = R([
  Se({ type: ge.Sequence, itemType: Iu })
], vS);
let Nn = yS = class extends vS {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, yS.prototype);
  }
};
Nn = yS = R([
  Se({ type: ge.Sequence })
], Nn);
const $le = {
  fromASN: (t) => yP.toString(qm.fromASN(t)),
  toASN: (t) => qm.toASN(yP.fromString(t))
};
class ad {
  constructor(e = {}) {
    this.typeId = "", this.value = new ArrayBuffer(0), Object.assign(this, e);
  }
}
R([
  H({ type: te.ObjectIdentifier })
], ad.prototype, "typeId", void 0);
R([
  H({ type: te.Any, context: 0 })
], ad.prototype, "value", void 0);
class YA {
  constructor(e = {}) {
    this.partyName = new ur(), Object.assign(this, e);
  }
}
R([
  H({ type: ur, optional: !0, context: 0, implicit: !0 })
], YA.prototype, "nameAssigner", void 0);
R([
  H({ type: ur, context: 1, implicit: !0 })
], YA.prototype, "partyName", void 0);
let ot = class {
  constructor(e = {}) {
    Object.assign(this, e);
  }
};
R([
  H({ type: ad, context: 0, implicit: !0 })
], ot.prototype, "otherName", void 0);
R([
  H({ type: te.IA5String, context: 1, implicit: !0 })
], ot.prototype, "rfc822Name", void 0);
R([
  H({ type: te.IA5String, context: 2, implicit: !0 })
], ot.prototype, "dNSName", void 0);
R([
  H({ type: te.Any, context: 3, implicit: !0 })
], ot.prototype, "x400Address", void 0);
R([
  H({ type: Nn, context: 4, implicit: !1 })
], ot.prototype, "directoryName", void 0);
R([
  H({ type: YA, context: 5 })
], ot.prototype, "ediPartyName", void 0);
R([
  H({ type: te.IA5String, context: 6, implicit: !0 })
], ot.prototype, "uniformResourceIdentifier", void 0);
R([
  H({
    type: te.OctetString,
    context: 7,
    implicit: !0,
    converter: $le
  })
], ot.prototype, "iPAddress", void 0);
R([
  H({ type: te.ObjectIdentifier, context: 8, implicit: !0 })
], ot.prototype, "registeredID", void 0);
ot = R([
  Se({ type: ge.Choice })
], ot);
const JA = "1.3.6.1.5.5.7", Gle = `${JA}.1`, hl = `${JA}.3`, q0 = `${JA}.48`, vP = `${q0}.1`, bP = `${q0}.2`, xP = `${q0}.3`, wP = `${q0}.5`, yo = "2.5.29";
var bS;
const xS = `${Gle}.1`;
class rf {
  constructor(e = {}) {
    this.accessMethod = "", this.accessLocation = new ot(), Object.assign(this, e);
  }
}
R([
  H({ type: te.ObjectIdentifier })
], rf.prototype, "accessMethod", void 0);
R([
  H({ type: ot })
], rf.prototype, "accessLocation", void 0);
let nu = bS = class extends Ct {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, bS.prototype);
  }
};
nu = bS = R([
  Se({ type: ge.Sequence, itemType: rf })
], nu);
const wS = `${yo}.35`;
class XA extends je {
}
class ja {
  constructor(e = {}) {
    e && Object.assign(this, e);
  }
}
R([
  H({ type: XA, context: 0, optional: !0, implicit: !0 })
], ja.prototype, "keyIdentifier", void 0);
R([
  H({ type: ot, context: 1, optional: !0, implicit: !0, repeated: "sequence" })
], ja.prototype, "authorityCertIssuer", void 0);
R([
  H({
    type: te.Integer,
    context: 2,
    optional: !0,
    implicit: !0,
    converter: zt
  })
], ja.prototype, "authorityCertSerialNumber", void 0);
const ZA = `${yo}.19`;
class cd {
  constructor(e = {}) {
    this.cA = !1, Object.assign(this, e);
  }
}
R([
  H({ type: te.Boolean, defaultValue: !1 })
], cd.prototype, "cA", void 0);
R([
  H({ type: te.Integer, optional: !0 })
], cd.prototype, "pathLenConstraint", void 0);
var SS;
let gr = SS = class extends Ct {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, SS.prototype);
  }
};
gr = SS = R([
  Se({ type: ge.Sequence, itemType: ot })
], gr);
var _S;
let SP = _S = class extends gr {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, _S.prototype);
  }
};
SP = _S = R([
  Se({ type: ge.Sequence })
], SP);
var ES;
const sB = `${yo}.32`;
let hs = class {
  constructor(e = {}) {
    Object.assign(this, e);
  }
  toString() {
    return this.ia5String || this.visibleString || this.bmpString || this.utf8String || "";
  }
};
R([
  H({ type: te.IA5String })
], hs.prototype, "ia5String", void 0);
R([
  H({ type: te.VisibleString })
], hs.prototype, "visibleString", void 0);
R([
  H({ type: te.BmpString })
], hs.prototype, "bmpString", void 0);
R([
  H({ type: te.Utf8String })
], hs.prototype, "utf8String", void 0);
hs = R([
  Se({ type: ge.Choice })
], hs);
class e2 {
  constructor(e = {}) {
    this.organization = new hs(), this.noticeNumbers = [], Object.assign(this, e);
  }
}
R([
  H({ type: hs })
], e2.prototype, "organization", void 0);
R([
  H({ type: te.Integer, repeated: "sequence" })
], e2.prototype, "noticeNumbers", void 0);
class t2 {
  constructor(e = {}) {
    Object.assign(this, e);
  }
}
R([
  H({ type: e2, optional: !0 })
], t2.prototype, "noticeRef", void 0);
R([
  H({ type: hs, optional: !0 })
], t2.prototype, "explicitText", void 0);
let Hm = class {
  constructor(e = {}) {
    Object.assign(this, e);
  }
};
R([
  H({ type: te.IA5String })
], Hm.prototype, "cPSuri", void 0);
R([
  H({ type: t2 })
], Hm.prototype, "userNotice", void 0);
Hm = R([
  Se({ type: ge.Choice })
], Hm);
class n2 {
  constructor(e = {}) {
    this.policyQualifierId = "", this.qualifier = new ArrayBuffer(0), Object.assign(this, e);
  }
}
R([
  H({ type: te.ObjectIdentifier })
], n2.prototype, "policyQualifierId", void 0);
R([
  H({ type: te.Any })
], n2.prototype, "qualifier", void 0);
class H0 {
  constructor(e = {}) {
    this.policyIdentifier = "", Object.assign(this, e);
  }
}
R([
  H({ type: te.ObjectIdentifier })
], H0.prototype, "policyIdentifier", void 0);
R([
  H({ type: n2, repeated: "sequence", optional: !0 })
], H0.prototype, "policyQualifiers", void 0);
let Wm = ES = class extends Ct {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, ES.prototype);
  }
};
Wm = ES = R([
  Se({ type: ge.Sequence, itemType: H0 })
], Wm);
let zm = class {
  constructor(e = 0) {
    this.value = e;
  }
};
R([
  H({ type: te.Integer })
], zm.prototype, "value", void 0);
zm = R([
  Se({ type: ge.Choice })
], zm);
let _P = class extends zm {
};
_P = R([
  Se({ type: ge.Choice })
], _P);
var AS;
const IS = `${yo}.31`;
var Li;
(function(t) {
  t[t.unused = 1] = "unused", t[t.keyCompromise = 2] = "keyCompromise", t[t.cACompromise = 4] = "cACompromise", t[t.affiliationChanged = 8] = "affiliationChanged", t[t.superseded = 16] = "superseded", t[t.cessationOfOperation = 32] = "cessationOfOperation", t[t.certificateHold = 64] = "certificateHold", t[t.privilegeWithdrawn = 128] = "privilegeWithdrawn", t[t.aACompromise = 256] = "aACompromise";
})(Li || (Li = {}));
class aB extends $0 {
  toJSON() {
    const e = [], n = this.toNumber();
    return n & Li.aACompromise && e.push("aACompromise"), n & Li.affiliationChanged && e.push("affiliationChanged"), n & Li.cACompromise && e.push("cACompromise"), n & Li.certificateHold && e.push("certificateHold"), n & Li.cessationOfOperation && e.push("cessationOfOperation"), n & Li.keyCompromise && e.push("keyCompromise"), n & Li.privilegeWithdrawn && e.push("privilegeWithdrawn"), n & Li.superseded && e.push("superseded"), n & Li.unused && e.push("unused"), e;
  }
  toString() {
    return `[${this.toJSON().join(", ")}]`;
  }
}
let rc = class {
  constructor(e = {}) {
    Object.assign(this, e);
  }
};
R([
  H({ type: ot, context: 0, repeated: "sequence", implicit: !0 })
], rc.prototype, "fullName", void 0);
R([
  H({ type: Iu, context: 1, implicit: !0 })
], rc.prototype, "nameRelativeToCRLIssuer", void 0);
rc = R([
  Se({ type: ge.Choice })
], rc);
class ml {
  constructor(e = {}) {
    Object.assign(this, e);
  }
}
R([
  H({ type: rc, context: 0, optional: !0 })
], ml.prototype, "distributionPoint", void 0);
R([
  H({ type: aB, context: 1, optional: !0, implicit: !0 })
], ml.prototype, "reasons", void 0);
R([
  H({ type: ot, context: 2, optional: !0, repeated: "sequence", implicit: !0 })
], ml.prototype, "cRLIssuer", void 0);
let cu = AS = class extends Ct {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, AS.prototype);
  }
};
cu = AS = R([
  Se({ type: ge.Sequence, itemType: ml })
], cu);
var CS;
let EP = CS = class extends cu {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, CS.prototype);
  }
};
EP = CS = R([
  Se({ type: ge.Sequence, itemType: ml })
], EP);
class hr {
  constructor(e = {}) {
    this.onlyContainsUserCerts = hr.ONLY, this.onlyContainsCACerts = hr.ONLY, this.indirectCRL = hr.ONLY, this.onlyContainsAttributeCerts = hr.ONLY, Object.assign(this, e);
  }
}
hr.ONLY = !1;
R([
  H({ type: rc, context: 0, optional: !0 })
], hr.prototype, "distributionPoint", void 0);
R([
  H({
    type: te.Boolean,
    context: 1,
    defaultValue: hr.ONLY,
    implicit: !0
  })
], hr.prototype, "onlyContainsUserCerts", void 0);
R([
  H({
    type: te.Boolean,
    context: 2,
    defaultValue: hr.ONLY,
    implicit: !0
  })
], hr.prototype, "onlyContainsCACerts", void 0);
R([
  H({ type: aB, context: 3, optional: !0, implicit: !0 })
], hr.prototype, "onlySomeReasons", void 0);
R([
  H({
    type: te.Boolean,
    context: 4,
    defaultValue: hr.ONLY,
    implicit: !0
  })
], hr.prototype, "indirectCRL", void 0);
R([
  H({
    type: te.Boolean,
    context: 5,
    defaultValue: hr.ONLY,
    implicit: !0
  })
], hr.prototype, "onlyContainsAttributeCerts", void 0);
const qle = `${yo}.21`;
var Lp;
(function(t) {
  t[t.unspecified = 0] = "unspecified", t[t.keyCompromise = 1] = "keyCompromise", t[t.cACompromise = 2] = "cACompromise", t[t.affiliationChanged = 3] = "affiliationChanged", t[t.superseded = 4] = "superseded", t[t.cessationOfOperation = 5] = "cessationOfOperation", t[t.certificateHold = 6] = "certificateHold", t[t.removeFromCRL = 8] = "removeFromCRL", t[t.privilegeWithdrawn = 9] = "privilegeWithdrawn", t[t.aACompromise = 10] = "aACompromise";
})(Lp || (Lp = {}));
let Km = class {
  constructor(e = Lp.unspecified) {
    this.reason = Lp.unspecified, this.reason = e;
  }
  toJSON() {
    return Lp[this.reason];
  }
  toString() {
    return this.toJSON();
  }
};
R([
  H({ type: te.Enumerated })
], Km.prototype, "reason", void 0);
Km = R([
  Se({ type: ge.Choice })
], Km);
var TS;
const r2 = `${yo}.37`;
let ud = TS = class extends Ct {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, TS.prototype);
  }
};
ud = TS = R([
  Se({ type: ge.Sequence, itemType: te.ObjectIdentifier })
], ud);
const Hle = `${hl}.1`, Wle = `${hl}.2`, zle = `${hl}.3`, Kle = `${hl}.4`, Vle = `${hl}.8`, Yle = `${hl}.9`;
let kS = class {
  constructor(e = new ArrayBuffer(0)) {
    this.value = e;
  }
};
R([
  H({ type: te.Integer, converter: zt })
], kS.prototype, "value", void 0);
kS = R([
  Se({ type: ge.Choice })
], kS);
const Jle = `${yo}.24`;
let Vm = class {
  constructor(e) {
    this.value = /* @__PURE__ */ new Date(), e && (this.value = e);
  }
};
R([
  H({ type: te.GeneralizedTime })
], Vm.prototype, "value", void 0);
Vm = R([
  Se({ type: ge.Choice })
], Vm);
var NS;
const cB = `${yo}.18`;
let AP = NS = class extends gr {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, NS.prototype);
  }
};
AP = NS = R([
  Se({ type: ge.Sequence })
], AP);
const uB = `${yo}.15`;
var ji;
(function(t) {
  t[t.digitalSignature = 1] = "digitalSignature", t[t.nonRepudiation = 2] = "nonRepudiation", t[t.keyEncipherment = 4] = "keyEncipherment", t[t.dataEncipherment = 8] = "dataEncipherment", t[t.keyAgreement = 16] = "keyAgreement", t[t.keyCertSign = 32] = "keyCertSign", t[t.cRLSign = 64] = "cRLSign", t[t.encipherOnly = 128] = "encipherOnly", t[t.decipherOnly = 256] = "decipherOnly";
})(ji || (ji = {}));
class Qx extends $0 {
  toJSON() {
    const e = this.toNumber(), n = [];
    return e & ji.cRLSign && n.push("crlSign"), e & ji.dataEncipherment && n.push("dataEncipherment"), e & ji.decipherOnly && n.push("decipherOnly"), e & ji.digitalSignature && n.push("digitalSignature"), e & ji.encipherOnly && n.push("encipherOnly"), e & ji.keyAgreement && n.push("keyAgreement"), e & ji.keyCertSign && n.push("keyCertSign"), e & ji.keyEncipherment && n.push("keyEncipherment"), e & ji.nonRepudiation && n.push("nonRepudiation"), n;
  }
  toString() {
    return `[${this.toJSON().join(", ")}]`;
  }
}
var PS;
class W0 {
  constructor(e = {}) {
    this.base = new ot(), this.minimum = 0, Object.assign(this, e);
  }
}
R([
  H({ type: ot })
], W0.prototype, "base", void 0);
R([
  H({ type: te.Integer, context: 0, defaultValue: 0, implicit: !0 })
], W0.prototype, "minimum", void 0);
R([
  H({ type: te.Integer, context: 1, optional: !0, implicit: !0 })
], W0.prototype, "maximum", void 0);
let Ym = PS = class extends Ct {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, PS.prototype);
  }
};
Ym = PS = R([
  Se({ type: ge.Sequence, itemType: W0 })
], Ym);
class lB {
  constructor(e = {}) {
    Object.assign(this, e);
  }
}
R([
  H({ type: Ym, context: 0, optional: !0, implicit: !0 })
], lB.prototype, "permittedSubtrees", void 0);
R([
  H({ type: Ym, context: 1, optional: !0, implicit: !0 })
], lB.prototype, "excludedSubtrees", void 0);
class pB {
  constructor(e = {}) {
    Object.assign(this, e);
  }
}
R([
  H({
    type: te.Integer,
    context: 0,
    implicit: !0,
    optional: !0,
    converter: zt
  })
], pB.prototype, "requireExplicitPolicy", void 0);
R([
  H({
    type: te.Integer,
    context: 1,
    implicit: !0,
    optional: !0,
    converter: zt
  })
], pB.prototype, "inhibitPolicyMapping", void 0);
var DS;
class i2 {
  constructor(e = {}) {
    this.issuerDomainPolicy = "", this.subjectDomainPolicy = "", Object.assign(this, e);
  }
}
R([
  H({ type: te.ObjectIdentifier })
], i2.prototype, "issuerDomainPolicy", void 0);
R([
  H({ type: te.ObjectIdentifier })
], i2.prototype, "subjectDomainPolicy", void 0);
let IP = DS = class extends Ct {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, DS.prototype);
  }
};
IP = DS = R([
  Se({ type: ge.Sequence, itemType: i2 })
], IP);
var FS;
const o2 = `${yo}.17`;
let Jm = FS = class extends gr {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, FS.prototype);
  }
};
Jm = FS = R([
  Se({ type: ge.Sequence })
], Jm);
let ms = class {
  constructor(e = {}) {
    this.type = "", this.values = [], Object.assign(this, e);
  }
};
R([
  H({ type: te.ObjectIdentifier })
], ms.prototype, "type", void 0);
R([
  H({ type: te.Any, repeated: "set" })
], ms.prototype, "values", void 0);
var OS;
let CP = OS = class extends Ct {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, OS.prototype);
  }
};
CP = OS = R([
  Se({ type: ge.Sequence, itemType: ms })
], CP);
const dB = `${yo}.14`;
class Xs extends XA {
}
class fB {
  constructor(e = {}) {
    Object.assign(this, e);
  }
}
R([
  H({ type: te.GeneralizedTime, context: 0, implicit: !0, optional: !0 })
], fB.prototype, "notBefore", void 0);
R([
  H({ type: te.GeneralizedTime, context: 1, implicit: !0, optional: !0 })
], fB.prototype, "notAfter", void 0);
var jp;
(function(t) {
  t[t.keyUpdateAllowed = 1] = "keyUpdateAllowed", t[t.newExtensions = 2] = "newExtensions", t[t.pKIXCertificate = 4] = "pKIXCertificate";
})(jp || (jp = {}));
class hB extends $0 {
  toJSON() {
    const e = [], n = this.toNumber();
    return n & jp.pKIXCertificate && e.push("pKIXCertificate"), n & jp.newExtensions && e.push("newExtensions"), n & jp.keyUpdateAllowed && e.push("keyUpdateAllowed"), e;
  }
  toString() {
    return `[${this.toJSON().join(", ")}]`;
  }
}
class mB {
  constructor(e = {}) {
    this.entrustVers = "", this.entrustInfoFlags = new hB(), Object.assign(this, e);
  }
}
R([
  H({ type: te.GeneralString })
], mB.prototype, "entrustVers", void 0);
R([
  H({ type: hB })
], mB.prototype, "entrustInfoFlags", void 0);
var MS;
let TP = MS = class extends Ct {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, MS.prototype);
  }
};
TP = MS = R([
  Se({ type: ge.Sequence, itemType: rf })
], TP);
class Fe {
  constructor(e = {}) {
    this.algorithm = "", Object.assign(this, e);
  }
  isEqual(e) {
    return e instanceof Fe && e.algorithm == this.algorithm && (e.parameters && this.parameters && a5(e.parameters, this.parameters) || e.parameters === this.parameters);
  }
}
R([
  H({
    type: te.ObjectIdentifier
  })
], Fe.prototype, "algorithm", void 0);
R([
  H({
    type: te.Any,
    optional: !0
  })
], Fe.prototype, "parameters", void 0);
class Co {
  constructor(e = {}) {
    this.algorithm = new Fe(), this.subjectPublicKey = new ArrayBuffer(0), Object.assign(this, e);
  }
}
R([
  H({ type: Fe })
], Co.prototype, "algorithm", void 0);
R([
  H({ type: te.BitString })
], Co.prototype, "subjectPublicKey", void 0);
let Hn = class {
  constructor(e) {
    if (e)
      if (typeof e == "string" || typeof e == "number" || e instanceof Date) {
        const n = new Date(e);
        n.getUTCFullYear() > 2049 ? this.generalTime = n : this.utcTime = n;
      } else
        Object.assign(this, e);
  }
  getTime() {
    const e = this.utcTime || this.generalTime;
    if (!e)
      throw new Error("Cannot get time from CHOICE object");
    return e;
  }
};
R([
  H({
    type: te.UTCTime
  })
], Hn.prototype, "utcTime", void 0);
R([
  H({
    type: te.GeneralizedTime
  })
], Hn.prototype, "generalTime", void 0);
Hn = R([
  Se({ type: ge.Choice })
], Hn);
class z0 {
  constructor(e) {
    this.notBefore = new Hn(/* @__PURE__ */ new Date()), this.notAfter = new Hn(/* @__PURE__ */ new Date()), e && (this.notBefore = new Hn(e.notBefore), this.notAfter = new Hn(e.notAfter));
  }
}
R([
  H({ type: Hn })
], z0.prototype, "notBefore", void 0);
R([
  H({ type: Hn })
], z0.prototype, "notAfter", void 0);
var RS;
let co = class gB {
  constructor(e = {}) {
    this.extnID = "", this.critical = gB.CRITICAL, this.extnValue = new je(), Object.assign(this, e);
  }
};
co.CRITICAL = !1;
R([
  H({ type: te.ObjectIdentifier })
], co.prototype, "extnID", void 0);
R([
  H({
    type: te.Boolean,
    defaultValue: co.CRITICAL
  })
], co.prototype, "critical", void 0);
R([
  H({ type: je })
], co.prototype, "extnValue", void 0);
let ic = RS = class extends Ct {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, RS.prototype);
  }
};
ic = RS = R([
  Se({ type: ge.Sequence, itemType: co })
], ic);
var Cu;
(function(t) {
  t[t.v1 = 0] = "v1", t[t.v2 = 1] = "v2", t[t.v3 = 2] = "v3";
})(Cu || (Cu = {}));
class Ri {
  constructor(e = {}) {
    this.version = Cu.v1, this.serialNumber = new ArrayBuffer(0), this.signature = new Fe(), this.issuer = new Nn(), this.validity = new z0(), this.subject = new Nn(), this.subjectPublicKeyInfo = new Co(), Object.assign(this, e);
  }
}
R([
  H({
    type: te.Integer,
    context: 0,
    defaultValue: Cu.v1
  })
], Ri.prototype, "version", void 0);
R([
  H({
    type: te.Integer,
    converter: zt
  })
], Ri.prototype, "serialNumber", void 0);
R([
  H({ type: Fe })
], Ri.prototype, "signature", void 0);
R([
  H({ type: Nn })
], Ri.prototype, "issuer", void 0);
R([
  H({ type: z0 })
], Ri.prototype, "validity", void 0);
R([
  H({ type: Nn })
], Ri.prototype, "subject", void 0);
R([
  H({ type: Co })
], Ri.prototype, "subjectPublicKeyInfo", void 0);
R([
  H({
    type: te.BitString,
    context: 1,
    implicit: !0,
    optional: !0
  })
], Ri.prototype, "issuerUniqueID", void 0);
R([
  H({ type: te.BitString, context: 2, implicit: !0, optional: !0 })
], Ri.prototype, "subjectUniqueID", void 0);
R([
  H({ type: ic, context: 3, optional: !0 })
], Ri.prototype, "extensions", void 0);
class uo {
  constructor(e = {}) {
    this.tbsCertificate = new Ri(), this.signatureAlgorithm = new Fe(), this.signatureValue = new ArrayBuffer(0), Object.assign(this, e);
  }
}
R([
  H({ type: Ri, raw: !0 })
], uo.prototype, "tbsCertificate", void 0);
R([
  H({ type: Fe })
], uo.prototype, "signatureAlgorithm", void 0);
R([
  H({ type: te.BitString })
], uo.prototype, "signatureValue", void 0);
class za {
  constructor(e = {}) {
    this.userCertificate = new ArrayBuffer(0), this.revocationDate = new Hn(), Object.assign(this, e);
  }
}
R([
  H({ type: te.Integer, converter: zt })
], za.prototype, "userCertificate", void 0);
R([
  H({ type: Hn })
], za.prototype, "revocationDate", void 0);
R([
  H({ type: co, optional: !0, repeated: "sequence" })
], za.prototype, "crlEntryExtensions", void 0);
class Cs {
  constructor(e = {}) {
    this.signature = new Fe(), this.issuer = new Nn(), this.thisUpdate = new Hn(), Object.assign(this, e);
  }
}
R([
  H({ type: te.Integer, optional: !0 })
], Cs.prototype, "version", void 0);
R([
  H({ type: Fe })
], Cs.prototype, "signature", void 0);
R([
  H({ type: Nn })
], Cs.prototype, "issuer", void 0);
R([
  H({ type: Hn })
], Cs.prototype, "thisUpdate", void 0);
R([
  H({ type: Hn, optional: !0 })
], Cs.prototype, "nextUpdate", void 0);
R([
  H({ type: za, repeated: "sequence", optional: !0 })
], Cs.prototype, "revokedCertificates", void 0);
R([
  H({ type: co, optional: !0, context: 0, repeated: "sequence" })
], Cs.prototype, "crlExtensions", void 0);
class K0 {
  constructor(e = {}) {
    this.tbsCertList = new Cs(), this.signatureAlgorithm = new Fe(), this.signature = new ArrayBuffer(0), Object.assign(this, e);
  }
}
R([
  H({ type: Cs, raw: !0 })
], K0.prototype, "tbsCertList", void 0);
R([
  H({ type: Fe })
], K0.prototype, "signatureAlgorithm", void 0);
R([
  H({ type: te.BitString })
], K0.prototype, "signature", void 0);
const kP = {
  "2.5.4.6": "C",
  "2.5.4.10": "O",
  "2.5.4.11": "OU",
  "2.5.4.3": "CN"
};
function s2(t) {
  const e = Qr.parse(t, uo), n = e.tbsCertificate, r = { combined: "" };
  n.issuer.forEach(([s]) => {
    const a = kP[s.type];
    a && (r[a] = s.value.toString());
  }), r.combined = NP(r);
  const i = { combined: "" };
  n.subject.forEach(([s]) => {
    const a = kP[s.type];
    a && (i[a] = s.value.toString());
  }), i.combined = NP(i);
  let o = !1;
  if (n.extensions)
    for (const s of n.extensions)
      s.extnID === ZA && (o = Qr.parse(s.extnValue, cd).cA);
  return {
    issuer: r,
    subject: i,
    version: n.version,
    basicConstraintsCA: o,
    notBefore: n.validity.notBefore.getTime(),
    notAfter: n.validity.notAfter.getTime(),
    parsedCertificate: e
  };
}
function NP(t) {
  const e = [];
  return t.C && e.push(t.C), t.O && e.push(t.O), t.OU && e.push(t.OU), t.CN && e.push(t.CN), e.join(" : ");
}
class gl {
  constructor(e = {}) {
    this.issuer = new Nn(), this.serialNumber = new ArrayBuffer(0), Object.assign(this, e);
  }
}
R([
  H({ type: Nn })
], gl.prototype, "issuer", void 0);
R([
  H({ type: te.Integer, converter: zt })
], gl.prototype, "serialNumber", void 0);
let Tu = class {
  constructor(e = {}) {
    Object.assign(this, e);
  }
};
R([
  H({ type: Xs, context: 0, implicit: !0 })
], Tu.prototype, "subjectKeyIdentifier", void 0);
R([
  H({ type: gl })
], Tu.prototype, "issuerAndSerialNumber", void 0);
Tu = R([
  Se({ type: ge.Choice })
], Tu);
var gs;
(function(t) {
  t[t.v0 = 0] = "v0", t[t.v1 = 1] = "v1", t[t.v2 = 2] = "v2", t[t.v3 = 3] = "v3", t[t.v4 = 4] = "v4", t[t.v5 = 5] = "v5";
})(gs || (gs = {}));
let ld = class extends Fe {
};
ld = R([
  Se({ type: ge.Sequence })
], ld);
let Xm = class extends Fe {
};
Xm = R([
  Se({ type: ge.Sequence })
], Xm);
let Mo = class extends Fe {
};
Mo = R([
  Se({ type: ge.Sequence })
], Mo);
let Zm = class extends Fe {
};
Zm = R([
  Se({ type: ge.Sequence })
], Zm);
let PP = class extends Fe {
};
PP = R([
  Se({ type: ge.Sequence })
], PP);
let BS = class extends Fe {
};
BS = R([
  Se({ type: ge.Sequence })
], BS);
let yl = class {
  constructor(e = {}) {
    this.attrType = "", this.attrValues = [], Object.assign(this, e);
  }
};
R([
  H({ type: te.ObjectIdentifier })
], yl.prototype, "attrType", void 0);
R([
  H({ type: te.Any, repeated: "set" })
], yl.prototype, "attrValues", void 0);
var US;
class Lo {
  constructor(e = {}) {
    this.version = gs.v0, this.sid = new Tu(), this.digestAlgorithm = new ld(), this.signatureAlgorithm = new Xm(), this.signature = new je(), Object.assign(this, e);
  }
}
R([
  H({ type: te.Integer })
], Lo.prototype, "version", void 0);
R([
  H({ type: Tu })
], Lo.prototype, "sid", void 0);
R([
  H({ type: ld })
], Lo.prototype, "digestAlgorithm", void 0);
R([
  H({
    type: yl,
    repeated: "set",
    context: 0,
    implicit: !0,
    optional: !0,
    raw: !0
  })
], Lo.prototype, "signedAttrs", void 0);
R([
  H({ type: Xm })
], Lo.prototype, "signatureAlgorithm", void 0);
R([
  H({ type: je })
], Lo.prototype, "signature", void 0);
R([
  H({ type: yl, repeated: "set", context: 1, implicit: !0, optional: !0 })
], Lo.prototype, "unsignedAttrs", void 0);
let eg = US = class extends Ct {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, US.prototype);
  }
};
eg = US = R([
  Se({ type: ge.Set, itemType: Lo })
], eg);
let DP = class extends Lo {
};
DP = R([
  Se({ type: ge.Sequence })
], DP);
let FP = class extends Hn {
};
FP = R([
  Se({ type: ge.Choice })
], FP);
class a2 {
  constructor(e = {}) {
    this.acIssuer = new ot(), this.acSerial = 0, this.attrs = [], Object.assign(this, e);
  }
}
R([
  H({ type: ot })
], a2.prototype, "acIssuer", void 0);
R([
  H({ type: te.Integer })
], a2.prototype, "acSerial", void 0);
R([
  H({ type: ms, repeated: "sequence" })
], a2.prototype, "attrs", void 0);
var LS;
let tg = LS = class extends Ct {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, LS.prototype);
  }
};
tg = LS = R([
  Se({ type: ge.Sequence, itemType: te.ObjectIdentifier })
], tg);
class V0 {
  constructor(e = {}) {
    this.permitUnSpecified = !0, Object.assign(this, e);
  }
}
R([
  H({ type: te.Integer, optional: !0 })
], V0.prototype, "pathLenConstraint", void 0);
R([
  H({ type: tg, implicit: !0, context: 0, optional: !0 })
], V0.prototype, "permittedAttrs", void 0);
R([
  H({ type: tg, implicit: !0, context: 1, optional: !0 })
], V0.prototype, "excludedAttrs", void 0);
R([
  H({ type: te.Boolean, defaultValue: !0 })
], V0.prototype, "permitUnSpecified", void 0);
class Nc {
  constructor(e = {}) {
    this.issuer = new gr(), this.serial = new ArrayBuffer(0), this.issuerUID = new ArrayBuffer(0), Object.assign(this, e);
  }
}
R([
  H({ type: gr })
], Nc.prototype, "issuer", void 0);
R([
  H({ type: te.Integer, converter: zt })
], Nc.prototype, "serial", void 0);
R([
  H({ type: te.BitString, optional: !0 })
], Nc.prototype, "issuerUID", void 0);
var jS;
(function(t) {
  t[t.publicKey = 0] = "publicKey", t[t.publicKeyCert = 1] = "publicKeyCert", t[t.otherObjectTypes = 2] = "otherObjectTypes";
})(jS || (jS = {}));
class Pc {
  constructor(e = {}) {
    this.digestedObjectType = jS.publicKey, this.digestAlgorithm = new Fe(), this.objectDigest = new ArrayBuffer(0), Object.assign(this, e);
  }
}
R([
  H({ type: te.Enumerated })
], Pc.prototype, "digestedObjectType", void 0);
R([
  H({ type: te.ObjectIdentifier, optional: !0 })
], Pc.prototype, "otherObjectTypeID", void 0);
R([
  H({ type: Fe })
], Pc.prototype, "digestAlgorithm", void 0);
R([
  H({ type: te.BitString })
], Pc.prototype, "objectDigest", void 0);
class Y0 {
  constructor(e = {}) {
    Object.assign(this, e);
  }
}
R([
  H({ type: gr, optional: !0 })
], Y0.prototype, "issuerName", void 0);
R([
  H({ type: Nc, context: 0, implicit: !0, optional: !0 })
], Y0.prototype, "baseCertificateID", void 0);
R([
  H({ type: Pc, context: 1, implicit: !0, optional: !0 })
], Y0.prototype, "objectDigestInfo", void 0);
let ku = class {
  constructor(e = {}) {
    Object.assign(this, e);
  }
};
R([
  H({ type: ot, repeated: "sequence" })
], ku.prototype, "v1Form", void 0);
R([
  H({ type: Y0, context: 0, implicit: !0 })
], ku.prototype, "v2Form", void 0);
ku = R([
  Se({ type: ge.Choice })
], ku);
class J0 {
  constructor(e = {}) {
    this.notBeforeTime = /* @__PURE__ */ new Date(), this.notAfterTime = /* @__PURE__ */ new Date(), Object.assign(this, e);
  }
}
R([
  H({ type: te.GeneralizedTime })
], J0.prototype, "notBeforeTime", void 0);
R([
  H({ type: te.GeneralizedTime })
], J0.prototype, "notAfterTime", void 0);
class of {
  constructor(e = {}) {
    Object.assign(this, e);
  }
}
R([
  H({ type: Nc, implicit: !0, context: 0, optional: !0 })
], of.prototype, "baseCertificateID", void 0);
R([
  H({ type: gr, implicit: !0, context: 1, optional: !0 })
], of.prototype, "entityName", void 0);
R([
  H({ type: Pc, implicit: !0, context: 2, optional: !0 })
], of.prototype, "objectDigestInfo", void 0);
var QS;
(function(t) {
  t[t.v2 = 1] = "v2";
})(QS || (QS = {}));
class vo {
  constructor(e = {}) {
    this.version = QS.v2, this.holder = new of(), this.issuer = new ku(), this.signature = new Fe(), this.serialNumber = new ArrayBuffer(0), this.attrCertValidityPeriod = new J0(), this.attributes = [], Object.assign(this, e);
  }
}
R([
  H({ type: te.Integer })
], vo.prototype, "version", void 0);
R([
  H({ type: of })
], vo.prototype, "holder", void 0);
R([
  H({ type: ku })
], vo.prototype, "issuer", void 0);
R([
  H({ type: Fe })
], vo.prototype, "signature", void 0);
R([
  H({ type: te.Integer, converter: zt })
], vo.prototype, "serialNumber", void 0);
R([
  H({ type: J0 })
], vo.prototype, "attrCertValidityPeriod", void 0);
R([
  H({ type: ms, repeated: "sequence" })
], vo.prototype, "attributes", void 0);
R([
  H({ type: te.BitString, optional: !0 })
], vo.prototype, "issuerUniqueID", void 0);
R([
  H({ type: ic, optional: !0 })
], vo.prototype, "extensions", void 0);
class X0 {
  constructor(e = {}) {
    this.acinfo = new vo(), this.signatureAlgorithm = new Fe(), this.signatureValue = new ArrayBuffer(0), Object.assign(this, e);
  }
}
R([
  H({ type: vo })
], X0.prototype, "acinfo", void 0);
R([
  H({ type: Fe })
], X0.prototype, "signatureAlgorithm", void 0);
R([
  H({ type: te.BitString })
], X0.prototype, "signatureValue", void 0);
var ng;
(function(t) {
  t[t.unmarked = 1] = "unmarked", t[t.unclassified = 2] = "unclassified", t[t.restricted = 4] = "restricted", t[t.confidential = 8] = "confidential", t[t.secret = 16] = "secret", t[t.topSecret = 32] = "topSecret";
})(ng || (ng = {}));
class $S extends $0 {
}
class c2 {
  constructor(e = {}) {
    this.type = "", this.value = new ArrayBuffer(0), Object.assign(this, e);
  }
}
R([
  H({ type: te.ObjectIdentifier, implicit: !0, context: 0 })
], c2.prototype, "type", void 0);
R([
  H({ type: te.Any, implicit: !0, context: 1 })
], c2.prototype, "value", void 0);
class u2 {
  constructor(e = {}) {
    this.policyId = "", this.classList = new $S(ng.unclassified), Object.assign(this, e);
  }
}
R([
  H({ type: te.ObjectIdentifier })
], u2.prototype, "policyId", void 0);
R([
  H({ type: $S, defaultValue: new $S(ng.unclassified) })
], u2.prototype, "classList", void 0);
R([
  H({ type: c2, repeated: "set" })
], u2.prototype, "securityCategories", void 0);
class Z0 {
  constructor(e = {}) {
    Object.assign(this, e);
  }
}
R([
  H({ type: je })
], Z0.prototype, "cotets", void 0);
R([
  H({ type: te.ObjectIdentifier })
], Z0.prototype, "oid", void 0);
R([
  H({ type: te.Utf8String })
], Z0.prototype, "string", void 0);
class yB {
  constructor(e = {}) {
    this.values = [], Object.assign(this, e);
  }
}
R([
  H({ type: gr, implicit: !0, context: 0, optional: !0 })
], yB.prototype, "policyAuthority", void 0);
R([
  H({ type: Z0, repeated: "sequence" })
], yB.prototype, "values", void 0);
var GS;
class ey {
  constructor(e = {}) {
    this.targetCertificate = new Nc(), Object.assign(this, e);
  }
}
R([
  H({ type: Nc })
], ey.prototype, "targetCertificate", void 0);
R([
  H({ type: ot, optional: !0 })
], ey.prototype, "targetName", void 0);
R([
  H({ type: Pc, optional: !0 })
], ey.prototype, "certDigestInfo", void 0);
let Nu = class {
  constructor(e = {}) {
    Object.assign(this, e);
  }
};
R([
  H({ type: ot, context: 0, implicit: !0 })
], Nu.prototype, "targetName", void 0);
R([
  H({ type: ot, context: 1, implicit: !0 })
], Nu.prototype, "targetGroup", void 0);
R([
  H({ type: ey, context: 2, implicit: !0 })
], Nu.prototype, "targetCert", void 0);
Nu = R([
  Se({ type: ge.Choice })
], Nu);
let qS = GS = class extends Ct {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, GS.prototype);
  }
};
qS = GS = R([
  Se({ type: ge.Sequence, itemType: Nu })
], qS);
var HS;
let OP = HS = class extends Ct {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, HS.prototype);
  }
};
OP = HS = R([
  Se({ type: ge.Sequence, itemType: qS })
], OP);
class vB {
  constructor(e = {}) {
    Object.assign(this, e);
  }
}
R([
  H({ type: gr, implicit: !0, context: 0, optional: !0 })
], vB.prototype, "roleAuthority", void 0);
R([
  H({ type: ot, implicit: !0, context: 1 })
], vB.prototype, "roleName", void 0);
class l2 {
  constructor(e = {}) {
    this.service = new ot(), this.ident = new ot(), Object.assign(this, e);
  }
}
R([
  H({ type: ot })
], l2.prototype, "service", void 0);
R([
  H({ type: ot })
], l2.prototype, "ident", void 0);
R([
  H({ type: je, optional: !0 })
], l2.prototype, "authInfo", void 0);
var WS;
class p2 {
  constructor(e = {}) {
    this.otherCertFormat = "", this.otherCert = new ArrayBuffer(0), Object.assign(this, e);
  }
}
R([
  H({ type: te.ObjectIdentifier })
], p2.prototype, "otherCertFormat", void 0);
R([
  H({ type: te.Any })
], p2.prototype, "otherCert", void 0);
let Pu = class {
  constructor(e = {}) {
    Object.assign(this, e);
  }
};
R([
  H({ type: uo })
], Pu.prototype, "certificate", void 0);
R([
  H({ type: X0, context: 2, implicit: !0 })
], Pu.prototype, "v2AttrCert", void 0);
R([
  H({ type: p2, context: 3, implicit: !0 })
], Pu.prototype, "other", void 0);
Pu = R([
  Se({ type: ge.Choice })
], Pu);
let rg = WS = class extends Ct {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, WS.prototype);
  }
};
rg = WS = R([
  Se({ type: ge.Set, itemType: Pu })
], rg);
class vl {
  constructor(e = {}) {
    this.contentType = "", this.content = new ArrayBuffer(0), Object.assign(this, e);
  }
}
R([
  H({ type: te.ObjectIdentifier })
], vl.prototype, "contentType", void 0);
R([
  H({ type: te.Any, context: 0 })
], vl.prototype, "content", void 0);
let pd = class {
  constructor(e = {}) {
    Object.assign(this, e);
  }
};
R([
  H({ type: je })
], pd.prototype, "single", void 0);
R([
  H({ type: te.Any })
], pd.prototype, "any", void 0);
pd = R([
  Se({ type: ge.Choice })
], pd);
class ty {
  constructor(e = {}) {
    this.eContentType = "", Object.assign(this, e);
  }
}
R([
  H({ type: te.ObjectIdentifier })
], ty.prototype, "eContentType", void 0);
R([
  H({ type: pd, context: 0, optional: !0 })
], ty.prototype, "eContent", void 0);
let dd = class {
  constructor(e = {}) {
    Object.assign(this, e);
  }
};
R([
  H({ type: je, context: 0, implicit: !0, optional: !0 })
], dd.prototype, "value", void 0);
R([
  H({
    type: je,
    converter: Sle,
    context: 0,
    implicit: !0,
    optional: !0,
    repeated: "sequence"
  })
], dd.prototype, "constructedValue", void 0);
dd = R([
  Se({ type: ge.Choice })
], dd);
class sf {
  constructor(e = {}) {
    this.contentType = "", this.contentEncryptionAlgorithm = new Zm(), Object.assign(this, e);
  }
}
R([
  H({ type: te.ObjectIdentifier })
], sf.prototype, "contentType", void 0);
R([
  H({ type: Zm })
], sf.prototype, "contentEncryptionAlgorithm", void 0);
R([
  H({ type: dd, optional: !0 })
], sf.prototype, "encryptedContent", void 0);
class ny {
  constructor(e = {}) {
    this.keyAttrId = "", Object.assign(this, e);
  }
}
R([
  H({ type: te.ObjectIdentifier })
], ny.prototype, "keyAttrId", void 0);
R([
  H({ type: te.Any, optional: !0 })
], ny.prototype, "keyAttr", void 0);
var zS;
class ry {
  constructor(e = {}) {
    this.subjectKeyIdentifier = new Xs(), Object.assign(this, e);
  }
}
R([
  H({ type: Xs })
], ry.prototype, "subjectKeyIdentifier", void 0);
R([
  H({ type: te.GeneralizedTime, optional: !0 })
], ry.prototype, "date", void 0);
R([
  H({ type: ny, optional: !0 })
], ry.prototype, "other", void 0);
let Du = class {
  constructor(e = {}) {
    Object.assign(this, e);
  }
};
R([
  H({ type: ry, context: 0, implicit: !0, optional: !0 })
], Du.prototype, "rKeyId", void 0);
R([
  H({ type: gl, optional: !0 })
], Du.prototype, "issuerAndSerialNumber", void 0);
Du = R([
  Se({ type: ge.Choice })
], Du);
class d2 {
  constructor(e = {}) {
    this.rid = new Du(), this.encryptedKey = new je(), Object.assign(this, e);
  }
}
R([
  H({ type: Du })
], d2.prototype, "rid", void 0);
R([
  H({ type: je })
], d2.prototype, "encryptedKey", void 0);
let ig = zS = class extends Ct {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, zS.prototype);
  }
};
ig = zS = R([
  Se({ type: ge.Sequence, itemType: d2 })
], ig);
class f2 {
  constructor(e = {}) {
    this.algorithm = new Fe(), this.publicKey = new ArrayBuffer(0), Object.assign(this, e);
  }
}
R([
  H({ type: Fe })
], f2.prototype, "algorithm", void 0);
R([
  H({ type: te.BitString })
], f2.prototype, "publicKey", void 0);
let oc = class {
  constructor(e = {}) {
    Object.assign(this, e);
  }
};
R([
  H({ type: Xs, context: 0, implicit: !0, optional: !0 })
], oc.prototype, "subjectKeyIdentifier", void 0);
R([
  H({ type: f2, context: 1, implicit: !0, optional: !0 })
], oc.prototype, "originatorKey", void 0);
R([
  H({ type: gl, optional: !0 })
], oc.prototype, "issuerAndSerialNumber", void 0);
oc = R([
  Se({ type: ge.Choice })
], oc);
class bl {
  constructor(e = {}) {
    this.version = gs.v3, this.originator = new oc(), this.keyEncryptionAlgorithm = new Mo(), this.recipientEncryptedKeys = new ig(), Object.assign(this, e);
  }
}
R([
  H({ type: te.Integer })
], bl.prototype, "version", void 0);
R([
  H({ type: oc, context: 0 })
], bl.prototype, "originator", void 0);
R([
  H({ type: je, context: 1, optional: !0 })
], bl.prototype, "ukm", void 0);
R([
  H({ type: Mo })
], bl.prototype, "keyEncryptionAlgorithm", void 0);
R([
  H({ type: ig })
], bl.prototype, "recipientEncryptedKeys", void 0);
let Fu = class {
  constructor(e = {}) {
    Object.assign(this, e);
  }
};
R([
  H({ type: Xs, context: 0, implicit: !0 })
], Fu.prototype, "subjectKeyIdentifier", void 0);
R([
  H({ type: gl })
], Fu.prototype, "issuerAndSerialNumber", void 0);
Fu = R([
  Se({ type: ge.Choice })
], Fu);
class af {
  constructor(e = {}) {
    this.version = gs.v0, this.rid = new Fu(), this.keyEncryptionAlgorithm = new Mo(), this.encryptedKey = new je(), Object.assign(this, e);
  }
}
R([
  H({ type: te.Integer })
], af.prototype, "version", void 0);
R([
  H({ type: Fu })
], af.prototype, "rid", void 0);
R([
  H({ type: Mo })
], af.prototype, "keyEncryptionAlgorithm", void 0);
R([
  H({ type: je })
], af.prototype, "encryptedKey", void 0);
class cf {
  constructor(e = {}) {
    this.keyIdentifier = new je(), Object.assign(this, e);
  }
}
R([
  H({ type: je })
], cf.prototype, "keyIdentifier", void 0);
R([
  H({ type: te.GeneralizedTime, optional: !0 })
], cf.prototype, "date", void 0);
R([
  H({ type: ny, optional: !0 })
], cf.prototype, "other", void 0);
class uf {
  constructor(e = {}) {
    this.version = gs.v4, this.kekid = new cf(), this.keyEncryptionAlgorithm = new Mo(), this.encryptedKey = new je(), Object.assign(this, e);
  }
}
R([
  H({ type: te.Integer })
], uf.prototype, "version", void 0);
R([
  H({ type: cf })
], uf.prototype, "kekid", void 0);
R([
  H({ type: Mo })
], uf.prototype, "keyEncryptionAlgorithm", void 0);
R([
  H({ type: je })
], uf.prototype, "encryptedKey", void 0);
class lf {
  constructor(e = {}) {
    this.version = gs.v0, this.keyEncryptionAlgorithm = new Mo(), this.encryptedKey = new je(), Object.assign(this, e);
  }
}
R([
  H({ type: te.Integer })
], lf.prototype, "version", void 0);
R([
  H({ type: BS, context: 0, optional: !0 })
], lf.prototype, "keyDerivationAlgorithm", void 0);
R([
  H({ type: Mo })
], lf.prototype, "keyEncryptionAlgorithm", void 0);
R([
  H({ type: je })
], lf.prototype, "encryptedKey", void 0);
class h2 {
  constructor(e = {}) {
    this.oriType = "", this.oriValue = new ArrayBuffer(0), Object.assign(this, e);
  }
}
R([
  H({ type: te.ObjectIdentifier })
], h2.prototype, "oriType", void 0);
R([
  H({ type: te.Any })
], h2.prototype, "oriValue", void 0);
let ra = class {
  constructor(e = {}) {
    Object.assign(this, e);
  }
};
R([
  H({ type: af, optional: !0 })
], ra.prototype, "ktri", void 0);
R([
  H({ type: bl, context: 1, implicit: !0, optional: !0 })
], ra.prototype, "kari", void 0);
R([
  H({ type: uf, context: 2, implicit: !0, optional: !0 })
], ra.prototype, "kekri", void 0);
R([
  H({ type: lf, context: 3, implicit: !0, optional: !0 })
], ra.prototype, "pwri", void 0);
R([
  H({ type: h2, context: 4, implicit: !0, optional: !0 })
], ra.prototype, "ori", void 0);
ra = R([
  Se({ type: ge.Choice })
], ra);
var KS;
let og = KS = class extends Ct {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, KS.prototype);
  }
};
og = KS = R([
  Se({ type: ge.Set, itemType: ra })
], og);
var VS;
class iy {
  constructor(e = {}) {
    this.otherRevInfoFormat = "", this.otherRevInfo = new ArrayBuffer(0), Object.assign(this, e);
  }
}
R([
  H({ type: te.ObjectIdentifier })
], iy.prototype, "otherRevInfoFormat", void 0);
R([
  H({ type: te.Any })
], iy.prototype, "otherRevInfo", void 0);
let sg = class {
  constructor(e = {}) {
    this.other = new iy(), Object.assign(this, e);
  }
};
R([
  H({ type: iy, context: 1, implicit: !0 })
], sg.prototype, "other", void 0);
sg = R([
  Se({ type: ge.Choice })
], sg);
let ag = VS = class extends Ct {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, VS.prototype);
  }
};
ag = VS = R([
  Se({ type: ge.Set, itemType: sg })
], ag);
class m2 {
  constructor(e = {}) {
    Object.assign(this, e);
  }
}
R([
  H({ type: rg, context: 0, implicit: !0, optional: !0 })
], m2.prototype, "certs", void 0);
R([
  H({ type: ag, context: 1, implicit: !0, optional: !0 })
], m2.prototype, "crls", void 0);
var YS;
let JS = YS = class extends Ct {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, YS.prototype);
  }
};
JS = YS = R([
  Se({ type: ge.Set, itemType: yl })
], JS);
class pf {
  constructor(e = {}) {
    this.version = gs.v0, this.recipientInfos = new og(), this.encryptedContentInfo = new sf(), Object.assign(this, e);
  }
}
R([
  H({ type: te.Integer })
], pf.prototype, "version", void 0);
R([
  H({ type: m2, context: 0, implicit: !0, optional: !0 })
], pf.prototype, "originatorInfo", void 0);
R([
  H({ type: og })
], pf.prototype, "recipientInfos", void 0);
R([
  H({ type: sf })
], pf.prototype, "encryptedContentInfo", void 0);
R([
  H({ type: JS, context: 1, implicit: !0, optional: !0 })
], pf.prototype, "unprotectedAttrs", void 0);
const Xle = "1.2.840.113549.1.7.2";
var XS;
let cg = XS = class extends Ct {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, XS.prototype);
  }
};
cg = XS = R([
  Se({ type: ge.Set, itemType: ld })
], cg);
class xl {
  constructor(e = {}) {
    this.version = gs.v0, this.digestAlgorithms = new cg(), this.encapContentInfo = new ty(), this.signerInfos = new eg(), Object.assign(this, e);
  }
}
R([
  H({ type: te.Integer })
], xl.prototype, "version", void 0);
R([
  H({ type: cg })
], xl.prototype, "digestAlgorithms", void 0);
R([
  H({ type: ty })
], xl.prototype, "encapContentInfo", void 0);
R([
  H({ type: rg, context: 0, implicit: !0, optional: !0 })
], xl.prototype, "certificates", void 0);
R([
  H({ type: ag, context: 1, implicit: !0, optional: !0 })
], xl.prototype, "crls", void 0);
R([
  H({ type: eg })
], xl.prototype, "signerInfos", void 0);
const Ou = "1.2.840.10045.2.1", g2 = "1.2.840.10045.4.1", bB = "1.2.840.10045.4.3.1", y2 = "1.2.840.10045.4.3.2", v2 = "1.2.840.10045.4.3.3", b2 = "1.2.840.10045.4.3.4", ZS = "1.2.840.10045.3.1.7", e_ = "1.3.132.0.34", MP = "1.3.132.0.35";
function df(t) {
  return new Fe({ algorithm: t });
}
const Zle = df(g2);
df(bB);
const epe = df(y2), tpe = df(v2), npe = df(b2);
let fd = class {
  constructor(e = {}) {
    Object.assign(this, e);
  }
};
R([
  H({ type: te.ObjectIdentifier })
], fd.prototype, "fieldType", void 0);
R([
  H({ type: te.Any })
], fd.prototype, "parameters", void 0);
fd = R([
  Se({ type: ge.Sequence })
], fd);
class rpe extends je {
}
let Mu = class {
  constructor(e = {}) {
    Object.assign(this, e);
  }
};
R([
  H({ type: te.OctetString })
], Mu.prototype, "a", void 0);
R([
  H({ type: te.OctetString })
], Mu.prototype, "b", void 0);
R([
  H({ type: te.BitString, optional: !0 })
], Mu.prototype, "seed", void 0);
Mu = R([
  Se({ type: ge.Sequence })
], Mu);
var t_;
(function(t) {
  t[t.ecpVer1 = 1] = "ecpVer1";
})(t_ || (t_ = {}));
let ys = class {
  constructor(e = {}) {
    this.version = t_.ecpVer1, Object.assign(this, e);
  }
};
R([
  H({ type: te.Integer })
], ys.prototype, "version", void 0);
R([
  H({ type: fd })
], ys.prototype, "fieldID", void 0);
R([
  H({ type: Mu })
], ys.prototype, "curve", void 0);
R([
  H({ type: rpe })
], ys.prototype, "base", void 0);
R([
  H({ type: te.Integer, converter: zt })
], ys.prototype, "order", void 0);
R([
  H({ type: te.Integer, optional: !0 })
], ys.prototype, "cofactor", void 0);
ys = R([
  Se({ type: ge.Sequence })
], ys);
let vs = class {
  constructor(e = {}) {
    Object.assign(this, e);
  }
};
R([
  H({ type: te.ObjectIdentifier })
], vs.prototype, "namedCurve", void 0);
R([
  H({ type: te.Null })
], vs.prototype, "implicitCurve", void 0);
R([
  H({ type: ys })
], vs.prototype, "specifiedCurve", void 0);
vs = R([
  Se({ type: ge.Choice })
], vs);
class oy {
  constructor(e = {}) {
    this.version = 1, this.privateKey = new je(), Object.assign(this, e);
  }
}
R([
  H({ type: te.Integer })
], oy.prototype, "version", void 0);
R([
  H({ type: je })
], oy.prototype, "privateKey", void 0);
R([
  H({ type: vs, context: 0, optional: !0 })
], oy.prototype, "parameters", void 0);
R([
  H({ type: te.BitString, context: 1, optional: !0 })
], oy.prototype, "publicKey", void 0);
class hd {
  constructor(e = {}) {
    this.r = new ArrayBuffer(0), this.s = new ArrayBuffer(0), Object.assign(this, e);
  }
}
R([
  H({ type: te.Integer, converter: zt })
], hd.prototype, "r", void 0);
R([
  H({ type: te.Integer, converter: zt })
], hd.prototype, "s", void 0);
const Vr = "1.2.840.113549.1.1", ia = `${Vr}.1`, ipe = `${Vr}.7`, ope = `${Vr}.9`, Qp = `${Vr}.10`, spe = `${Vr}.2`, ape = `${Vr}.4`, ug = `${Vr}.5`, cpe = `${Vr}.14`, n_ = `${Vr}.11`, lg = `${Vr}.12`, pg = `${Vr}.13`, xB = `${Vr}.15`, wB = `${Vr}.16`, dg = "1.3.14.3.2.26", SB = "2.16.840.1.101.3.4.2.4", fg = "2.16.840.1.101.3.4.2.1", hg = "2.16.840.1.101.3.4.2.2", mg = "2.16.840.1.101.3.4.2.3", upe = "2.16.840.1.101.3.4.2.5", lpe = "2.16.840.1.101.3.4.2.6", ppe = "1.2.840.113549.2.2", dpe = "1.2.840.113549.2.5", sy = `${Vr}.8`;
function Rn(t) {
  return new Fe({ algorithm: t, parameters: null });
}
Rn(ppe);
Rn(dpe);
const sc = Rn(dg);
Rn(SB);
Rn(fg);
Rn(hg);
Rn(mg);
Rn(upe);
Rn(lpe);
const _B = new Fe({
  algorithm: sy,
  parameters: Ce.serialize(sc)
}), EB = new Fe({
  algorithm: ope,
  parameters: Ce.serialize(qm.toASN(new Uint8Array([
    218,
    57,
    163,
    238,
    94,
    107,
    75,
    13,
    50,
    85,
    191,
    239,
    149,
    96,
    24,
    144,
    175,
    216,
    7,
    9
  ]).buffer))
});
Rn(ia);
Rn(spe);
Rn(ape);
Rn(ug);
Rn(xB);
Rn(wB);
Rn(lg);
Rn(pg);
Rn(xB);
Rn(wB);
class ay {
  constructor(e = {}) {
    this.hashAlgorithm = new Fe(sc), this.maskGenAlgorithm = new Fe({
      algorithm: sy,
      parameters: Ce.serialize(sc)
    }), this.pSourceAlgorithm = new Fe(EB), Object.assign(this, e);
  }
}
R([
  H({ type: Fe, context: 0, defaultValue: sc })
], ay.prototype, "hashAlgorithm", void 0);
R([
  H({ type: Fe, context: 1, defaultValue: _B })
], ay.prototype, "maskGenAlgorithm", void 0);
R([
  H({ type: Fe, context: 2, defaultValue: EB })
], ay.prototype, "pSourceAlgorithm", void 0);
new Fe({
  algorithm: ipe,
  parameters: Ce.serialize(new ay())
});
class ac {
  constructor(e = {}) {
    this.hashAlgorithm = new Fe(sc), this.maskGenAlgorithm = new Fe({
      algorithm: sy,
      parameters: Ce.serialize(sc)
    }), this.saltLength = 20, this.trailerField = 1, Object.assign(this, e);
  }
}
R([
  H({ type: Fe, context: 0, defaultValue: sc })
], ac.prototype, "hashAlgorithm", void 0);
R([
  H({ type: Fe, context: 1, defaultValue: _B })
], ac.prototype, "maskGenAlgorithm", void 0);
R([
  H({ type: te.Integer, context: 2, defaultValue: 20 })
], ac.prototype, "saltLength", void 0);
R([
  H({ type: te.Integer, context: 3, defaultValue: 1 })
], ac.prototype, "trailerField", void 0);
new Fe({
  algorithm: Qp,
  parameters: Ce.serialize(new ac())
});
class cy {
  constructor(e = {}) {
    this.digestAlgorithm = new Fe(), this.digest = new je(), Object.assign(this, e);
  }
}
R([
  H({ type: Fe })
], cy.prototype, "digestAlgorithm", void 0);
R([
  H({ type: je })
], cy.prototype, "digest", void 0);
var r_;
class uy {
  constructor(e = {}) {
    this.prime = new ArrayBuffer(0), this.exponent = new ArrayBuffer(0), this.coefficient = new ArrayBuffer(0), Object.assign(this, e);
  }
}
R([
  H({ type: te.Integer, converter: zt })
], uy.prototype, "prime", void 0);
R([
  H({ type: te.Integer, converter: zt })
], uy.prototype, "exponent", void 0);
R([
  H({ type: te.Integer, converter: zt })
], uy.prototype, "coefficient", void 0);
let i_ = r_ = class extends Ct {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, r_.prototype);
  }
};
i_ = r_ = R([
  Se({ type: ge.Sequence, itemType: uy })
], i_);
class jo {
  constructor(e = {}) {
    this.version = 0, this.modulus = new ArrayBuffer(0), this.publicExponent = new ArrayBuffer(0), this.privateExponent = new ArrayBuffer(0), this.prime1 = new ArrayBuffer(0), this.prime2 = new ArrayBuffer(0), this.exponent1 = new ArrayBuffer(0), this.exponent2 = new ArrayBuffer(0), this.coefficient = new ArrayBuffer(0), Object.assign(this, e);
  }
}
R([
  H({ type: te.Integer })
], jo.prototype, "version", void 0);
R([
  H({ type: te.Integer, converter: zt })
], jo.prototype, "modulus", void 0);
R([
  H({ type: te.Integer, converter: zt })
], jo.prototype, "publicExponent", void 0);
R([
  H({ type: te.Integer, converter: zt })
], jo.prototype, "privateExponent", void 0);
R([
  H({ type: te.Integer, converter: zt })
], jo.prototype, "prime1", void 0);
R([
  H({ type: te.Integer, converter: zt })
], jo.prototype, "prime2", void 0);
R([
  H({ type: te.Integer, converter: zt })
], jo.prototype, "exponent1", void 0);
R([
  H({ type: te.Integer, converter: zt })
], jo.prototype, "exponent2", void 0);
R([
  H({ type: te.Integer, converter: zt })
], jo.prototype, "coefficient", void 0);
R([
  H({ type: i_, optional: !0 })
], jo.prototype, "otherPrimeInfos", void 0);
class ly {
  constructor(e = {}) {
    this.modulus = new ArrayBuffer(0), this.publicExponent = new ArrayBuffer(0), Object.assign(this, e);
  }
}
R([
  H({ type: te.Integer, converter: zt })
], ly.prototype, "modulus", void 0);
R([
  H({ type: te.Integer, converter: zt })
], ly.prototype, "publicExponent", void 0);
var o_;
(function(t) {
  t[t.Transient = 0] = "Transient", t[t.Singleton = 1] = "Singleton", t[t.ResolutionScoped = 2] = "ResolutionScoped", t[t.ContainerScoped = 3] = "ContainerScoped";
})(o_ || (o_ = {}));
const Fr = o_;
var $x = { exports: {} };
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var RP;
function fpe() {
  return RP || (RP = 1, (function(t) {
    var e, n, r, i, o, s, a, c, u, l, d, f, m, h, y, x, g, v, S, E, T, j, q;
    (function(Y) {
      var W = typeof On == "object" ? On : typeof self == "object" ? self : typeof this == "object" ? this : {};
      Y(G(W, G(t.exports)));
      function G(J, B) {
        return J !== W && (typeof Object.create == "function" ? Object.defineProperty(J, "__esModule", { value: !0 }) : J.__esModule = !0), function(D, X) {
          return J[D] = B ? B(D, X) : X;
        };
      }
    })(function(Y) {
      var W = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(G, J) {
        G.__proto__ = J;
      } || function(G, J) {
        for (var B in J) J.hasOwnProperty(B) && (G[B] = J[B]);
      };
      e = function(G, J) {
        W(G, J);
        function B() {
          this.constructor = G;
        }
        G.prototype = J === null ? Object.create(J) : (B.prototype = J.prototype, new B());
      }, n = Object.assign || function(G) {
        for (var J, B = 1, D = arguments.length; B < D; B++) {
          J = arguments[B];
          for (var X in J) Object.prototype.hasOwnProperty.call(J, X) && (G[X] = J[X]);
        }
        return G;
      }, r = function(G, J) {
        var B = {};
        for (var D in G) Object.prototype.hasOwnProperty.call(G, D) && J.indexOf(D) < 0 && (B[D] = G[D]);
        if (G != null && typeof Object.getOwnPropertySymbols == "function")
          for (var X = 0, D = Object.getOwnPropertySymbols(G); X < D.length; X++)
            J.indexOf(D[X]) < 0 && Object.prototype.propertyIsEnumerable.call(G, D[X]) && (B[D[X]] = G[D[X]]);
        return B;
      }, i = function(G, J, B, D) {
        var X = arguments.length, V = X < 3 ? J : D === null ? D = Object.getOwnPropertyDescriptor(J, B) : D, K;
        if (typeof Reflect == "object" && typeof Reflect.decorate == "function") V = Reflect.decorate(G, J, B, D);
        else for (var $ = G.length - 1; $ >= 0; $--) (K = G[$]) && (V = (X < 3 ? K(V) : X > 3 ? K(J, B, V) : K(J, B)) || V);
        return X > 3 && V && Object.defineProperty(J, B, V), V;
      }, o = function(G, J) {
        return function(B, D) {
          J(B, D, G);
        };
      }, s = function(G, J) {
        if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(G, J);
      }, a = function(G, J, B, D) {
        function X(V) {
          return V instanceof B ? V : new B(function(K) {
            K(V);
          });
        }
        return new (B || (B = Promise))(function(V, K) {
          function $(N) {
            try {
              I(D.next(N));
            } catch (U) {
              K(U);
            }
          }
          function _(N) {
            try {
              I(D.throw(N));
            } catch (U) {
              K(U);
            }
          }
          function I(N) {
            N.done ? V(N.value) : X(N.value).then($, _);
          }
          I((D = D.apply(G, J || [])).next());
        });
      }, c = function(G, J) {
        var B = { label: 0, sent: function() {
          if (V[0] & 1) throw V[1];
          return V[1];
        }, trys: [], ops: [] }, D, X, V, K;
        return K = { next: $(0), throw: $(1), return: $(2) }, typeof Symbol == "function" && (K[Symbol.iterator] = function() {
          return this;
        }), K;
        function $(I) {
          return function(N) {
            return _([I, N]);
          };
        }
        function _(I) {
          if (D) throw new TypeError("Generator is already executing.");
          for (; B; ) try {
            if (D = 1, X && (V = I[0] & 2 ? X.return : I[0] ? X.throw || ((V = X.return) && V.call(X), 0) : X.next) && !(V = V.call(X, I[1])).done) return V;
            switch (X = 0, V && (I = [I[0] & 2, V.value]), I[0]) {
              case 0:
              case 1:
                V = I;
                break;
              case 4:
                return B.label++, { value: I[1], done: !1 };
              case 5:
                B.label++, X = I[1], I = [0];
                continue;
              case 7:
                I = B.ops.pop(), B.trys.pop();
                continue;
              default:
                if (V = B.trys, !(V = V.length > 0 && V[V.length - 1]) && (I[0] === 6 || I[0] === 2)) {
                  B = 0;
                  continue;
                }
                if (I[0] === 3 && (!V || I[1] > V[0] && I[1] < V[3])) {
                  B.label = I[1];
                  break;
                }
                if (I[0] === 6 && B.label < V[1]) {
                  B.label = V[1], V = I;
                  break;
                }
                if (V && B.label < V[2]) {
                  B.label = V[2], B.ops.push(I);
                  break;
                }
                V[2] && B.ops.pop(), B.trys.pop();
                continue;
            }
            I = J.call(G, B);
          } catch (N) {
            I = [6, N], X = 0;
          } finally {
            D = V = 0;
          }
          if (I[0] & 5) throw I[1];
          return { value: I[0] ? I[1] : void 0, done: !0 };
        }
      }, q = function(G, J, B, D) {
        D === void 0 && (D = B), G[D] = J[B];
      }, u = function(G, J) {
        for (var B in G) B !== "default" && !J.hasOwnProperty(B) && (J[B] = G[B]);
      }, l = function(G) {
        var J = typeof Symbol == "function" && Symbol.iterator, B = J && G[J], D = 0;
        if (B) return B.call(G);
        if (G && typeof G.length == "number") return {
          next: function() {
            return G && D >= G.length && (G = void 0), { value: G && G[D++], done: !G };
          }
        };
        throw new TypeError(J ? "Object is not iterable." : "Symbol.iterator is not defined.");
      }, d = function(G, J) {
        var B = typeof Symbol == "function" && G[Symbol.iterator];
        if (!B) return G;
        var D = B.call(G), X, V = [], K;
        try {
          for (; (J === void 0 || J-- > 0) && !(X = D.next()).done; ) V.push(X.value);
        } catch ($) {
          K = { error: $ };
        } finally {
          try {
            X && !X.done && (B = D.return) && B.call(D);
          } finally {
            if (K) throw K.error;
          }
        }
        return V;
      }, f = function() {
        for (var G = [], J = 0; J < arguments.length; J++)
          G = G.concat(d(arguments[J]));
        return G;
      }, m = function() {
        for (var G = 0, J = 0, B = arguments.length; J < B; J++) G += arguments[J].length;
        for (var D = Array(G), X = 0, J = 0; J < B; J++)
          for (var V = arguments[J], K = 0, $ = V.length; K < $; K++, X++)
            D[X] = V[K];
        return D;
      }, h = function(G) {
        return this instanceof h ? (this.v = G, this) : new h(G);
      }, y = function(G, J, B) {
        if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
        var D = B.apply(G, J || []), X, V = [];
        return X = {}, K("next"), K("throw"), K("return"), X[Symbol.asyncIterator] = function() {
          return this;
        }, X;
        function K(C) {
          D[C] && (X[C] = function(L) {
            return new Promise(function(k, M) {
              V.push([C, L, k, M]) > 1 || $(C, L);
            });
          });
        }
        function $(C, L) {
          try {
            _(D[C](L));
          } catch (k) {
            U(V[0][3], k);
          }
        }
        function _(C) {
          C.value instanceof h ? Promise.resolve(C.value.v).then(I, N) : U(V[0][2], C);
        }
        function I(C) {
          $("next", C);
        }
        function N(C) {
          $("throw", C);
        }
        function U(C, L) {
          C(L), V.shift(), V.length && $(V[0][0], V[0][1]);
        }
      }, x = function(G) {
        var J, B;
        return J = {}, D("next"), D("throw", function(X) {
          throw X;
        }), D("return"), J[Symbol.iterator] = function() {
          return this;
        }, J;
        function D(X, V) {
          J[X] = G[X] ? function(K) {
            return (B = !B) ? { value: h(G[X](K)), done: X === "return" } : V ? V(K) : K;
          } : V;
        }
      }, g = function(G) {
        if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
        var J = G[Symbol.asyncIterator], B;
        return J ? J.call(G) : (G = typeof l == "function" ? l(G) : G[Symbol.iterator](), B = {}, D("next"), D("throw"), D("return"), B[Symbol.asyncIterator] = function() {
          return this;
        }, B);
        function D(V) {
          B[V] = G[V] && function(K) {
            return new Promise(function($, _) {
              K = G[V](K), X($, _, K.done, K.value);
            });
          };
        }
        function X(V, K, $, _) {
          Promise.resolve(_).then(function(I) {
            V({ value: I, done: $ });
          }, K);
        }
      }, v = function(G, J) {
        return Object.defineProperty ? Object.defineProperty(G, "raw", { value: J }) : G.raw = J, G;
      }, S = function(G) {
        if (G && G.__esModule) return G;
        var J = {};
        if (G != null) for (var B in G) Object.hasOwnProperty.call(G, B) && (J[B] = G[B]);
        return J.default = G, J;
      }, E = function(G) {
        return G && G.__esModule ? G : { default: G };
      }, T = function(G, J) {
        if (!J.has(G))
          throw new TypeError("attempted to get private field on non-instance");
        return J.get(G);
      }, j = function(G, J, B) {
        if (!J.has(G))
          throw new TypeError("attempted to set private field on non-instance");
        return J.set(G, B), B;
      }, Y("__extends", e), Y("__assign", n), Y("__rest", r), Y("__decorate", i), Y("__param", o), Y("__metadata", s), Y("__awaiter", a), Y("__generator", c), Y("__exportStar", u), Y("__createBinding", q), Y("__values", l), Y("__read", d), Y("__spread", f), Y("__spreadArrays", m), Y("__await", h), Y("__asyncGenerator", y), Y("__asyncDelegator", x), Y("__asyncValues", g), Y("__makeTemplateObject", v), Y("__importStar", S), Y("__importDefault", E), Y("__classPrivateFieldGet", T), Y("__classPrivateFieldSet", j);
    });
  })($x)), $x.exports;
}
var hpe = /* @__PURE__ */ fpe();
const mpe = /* @__PURE__ */ Bo(hpe), {
  __extends: x2,
  __assign: SIe,
  __rest: _Ie,
  __decorate: EIe,
  __param: AIe,
  __metadata: IIe,
  __awaiter: gpe,
  __generator: ype,
  __exportStar: CIe,
  __createBinding: TIe,
  __values: Th,
  __read: s_,
  __spread: Ua,
  __spreadArrays: kIe,
  __await: NIe,
  __asyncGenerator: PIe,
  __asyncDelegator: DIe,
  __asyncValues: FIe,
  __makeTemplateObject: OIe,
  __importStar: MIe,
  __importDefault: RIe,
  __classPrivateFieldGet: BIe,
  __classPrivateFieldSet: UIe
} = mpe;
var vpe = "injectionTokens";
function bpe(t) {
  var e = Reflect.getMetadata("design:paramtypes", t) || [], n = Reflect.getOwnMetadata(vpe, t) || {};
  return Object.keys(n).forEach(function(r) {
    e[+r] = n[r];
  }), e;
}
function AB(t) {
  return !!t.useClass;
}
function a_(t) {
  return !!t.useFactory;
}
var IB = (function() {
  function t(e) {
    this.wrap = e, this.reflectMethods = [
      "get",
      "getPrototypeOf",
      "setPrototypeOf",
      "getOwnPropertyDescriptor",
      "defineProperty",
      "has",
      "set",
      "deleteProperty",
      "apply",
      "construct",
      "ownKeys"
    ];
  }
  return t.prototype.createProxy = function(e) {
    var n = this, r = {}, i = !1, o, s = function() {
      return i || (o = e(n.wrap()), i = !0), o;
    };
    return new Proxy(r, this.createHandler(s));
  }, t.prototype.createHandler = function(e) {
    var n = {}, r = function(i) {
      n[i] = function() {
        for (var o = [], s = 0; s < arguments.length; s++)
          o[s] = arguments[s];
        o[0] = e();
        var a = Reflect[i];
        return a.apply(void 0, Ua(o));
      };
    };
    return this.reflectMethods.forEach(r), n;
  }, t;
})();
function Uc(t) {
  return typeof t == "string" || typeof t == "symbol";
}
function xpe(t) {
  return typeof t == "object" && "token" in t && "multiple" in t;
}
function BP(t) {
  return typeof t == "object" && "token" in t && "transform" in t;
}
function wpe(t) {
  return typeof t == "function" || t instanceof IB;
}
function sm(t) {
  return !!t.useToken;
}
function am(t) {
  return t.useValue != null;
}
function Spe(t) {
  return AB(t) || am(t) || sm(t) || a_(t);
}
var w2 = (function() {
  function t() {
    this._registryMap = /* @__PURE__ */ new Map();
  }
  return t.prototype.entries = function() {
    return this._registryMap.entries();
  }, t.prototype.getAll = function(e) {
    return this.ensure(e), this._registryMap.get(e);
  }, t.prototype.get = function(e) {
    this.ensure(e);
    var n = this._registryMap.get(e);
    return n[n.length - 1] || null;
  }, t.prototype.set = function(e, n) {
    this.ensure(e), this._registryMap.get(e).push(n);
  }, t.prototype.setAll = function(e, n) {
    this._registryMap.set(e, n);
  }, t.prototype.has = function(e) {
    return this.ensure(e), this._registryMap.get(e).length > 0;
  }, t.prototype.clear = function() {
    this._registryMap.clear();
  }, t.prototype.ensure = function(e) {
    this._registryMap.has(e) || this._registryMap.set(e, []);
  }, t;
})(), _pe = (function(t) {
  x2(e, t);
  function e() {
    return t !== null && t.apply(this, arguments) || this;
  }
  return e;
})(w2), kh = /* @__PURE__ */ (function() {
  function t() {
    this.scopedResolutions = /* @__PURE__ */ new Map();
  }
  return t;
})();
function Epe(t, e) {
  if (t === null)
    return "at position #" + e;
  var n = t.split(",")[e].trim();
  return '"' + n + '" at position #' + e;
}
function Ape(t, e, n) {
  return n === void 0 && (n = "    "), Ua([t], e.message.split(`
`).map(function(r) {
    return n + r;
  })).join(`
`);
}
function Ipe(t, e, n) {
  var r = s_(t.toString().match(/constructor\(([\w, ]+)\)/) || [], 2), i = r[1], o = i === void 0 ? null : i, s = Epe(o, e);
  return Ape("Cannot inject the dependency " + s + ' of "' + t.name + '" constructor. Reason:', n);
}
function Cpe(t) {
  if (typeof t.dispose != "function")
    return !1;
  var e = t.dispose;
  return !(e.length > 0);
}
var Tpe = (function(t) {
  x2(e, t);
  function e() {
    return t !== null && t.apply(this, arguments) || this;
  }
  return e;
})(w2), kpe = (function(t) {
  x2(e, t);
  function e() {
    return t !== null && t.apply(this, arguments) || this;
  }
  return e;
})(w2), Npe = /* @__PURE__ */ (function() {
  function t() {
    this.preResolution = new Tpe(), this.postResolution = new kpe();
  }
  return t;
})(), CB = /* @__PURE__ */ new Map(), Ppe = (function() {
  function t(e) {
    this.parent = e, this._registry = new _pe(), this.interceptors = new Npe(), this.disposed = !1, this.disposables = /* @__PURE__ */ new Set();
  }
  return t.prototype.register = function(e, n, r) {
    r === void 0 && (r = { lifecycle: Fr.Transient }), this.ensureNotDisposed();
    var i;
    if (Spe(n) ? i = n : i = { useClass: n }, sm(i))
      for (var o = [e], s = i; s != null; ) {
        var a = s.useToken;
        if (o.includes(a))
          throw new Error("Token registration cycle detected! " + Ua(o, [a]).join(" -> "));
        o.push(a);
        var c = this._registry.get(a);
        c && sm(c.provider) ? s = c.provider : s = null;
      }
    if ((r.lifecycle === Fr.Singleton || r.lifecycle == Fr.ContainerScoped || r.lifecycle == Fr.ResolutionScoped) && (am(i) || a_(i)))
      throw new Error('Cannot use lifecycle "' + Fr[r.lifecycle] + '" with ValueProviders or FactoryProviders');
    return this._registry.set(e, { provider: i, options: r }), this;
  }, t.prototype.registerType = function(e, n) {
    return this.ensureNotDisposed(), Uc(n) ? this.register(e, {
      useToken: n
    }) : this.register(e, {
      useClass: n
    });
  }, t.prototype.registerInstance = function(e, n) {
    return this.ensureNotDisposed(), this.register(e, {
      useValue: n
    });
  }, t.prototype.registerSingleton = function(e, n) {
    if (this.ensureNotDisposed(), Uc(e)) {
      if (Uc(n))
        return this.register(e, {
          useToken: n
        }, { lifecycle: Fr.Singleton });
      if (n)
        return this.register(e, {
          useClass: n
        }, { lifecycle: Fr.Singleton });
      throw new Error('Cannot register a type name as a singleton without a "to" token');
    }
    var r = e;
    return n && !Uc(n) && (r = n), this.register(e, {
      useClass: r
    }, { lifecycle: Fr.Singleton });
  }, t.prototype.resolve = function(e, n, r) {
    n === void 0 && (n = new kh()), r === void 0 && (r = !1), this.ensureNotDisposed();
    var i = this.getRegistration(e);
    if (!i && Uc(e)) {
      if (r)
        return;
      throw new Error('Attempted to resolve unregistered dependency token: "' + e.toString() + '"');
    }
    if (this.executePreResolutionInterceptor(e, "Single"), i) {
      var o = this.resolveRegistration(i, n);
      return this.executePostResolutionInterceptor(e, o, "Single"), o;
    }
    if (wpe(e)) {
      var o = this.construct(e, n);
      return this.executePostResolutionInterceptor(e, o, "Single"), o;
    }
    throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.");
  }, t.prototype.executePreResolutionInterceptor = function(e, n) {
    var r, i;
    if (this.interceptors.preResolution.has(e)) {
      var o = [];
      try {
        for (var s = Th(this.interceptors.preResolution.getAll(e)), a = s.next(); !a.done; a = s.next()) {
          var c = a.value;
          c.options.frequency != "Once" && o.push(c), c.callback(e, n);
        }
      } catch (u) {
        r = { error: u };
      } finally {
        try {
          a && !a.done && (i = s.return) && i.call(s);
        } finally {
          if (r) throw r.error;
        }
      }
      this.interceptors.preResolution.setAll(e, o);
    }
  }, t.prototype.executePostResolutionInterceptor = function(e, n, r) {
    var i, o;
    if (this.interceptors.postResolution.has(e)) {
      var s = [];
      try {
        for (var a = Th(this.interceptors.postResolution.getAll(e)), c = a.next(); !c.done; c = a.next()) {
          var u = c.value;
          u.options.frequency != "Once" && s.push(u), u.callback(e, n, r);
        }
      } catch (l) {
        i = { error: l };
      } finally {
        try {
          c && !c.done && (o = a.return) && o.call(a);
        } finally {
          if (i) throw i.error;
        }
      }
      this.interceptors.postResolution.setAll(e, s);
    }
  }, t.prototype.resolveRegistration = function(e, n) {
    if (this.ensureNotDisposed(), e.options.lifecycle === Fr.ResolutionScoped && n.scopedResolutions.has(e))
      return n.scopedResolutions.get(e);
    var r = e.options.lifecycle === Fr.Singleton, i = e.options.lifecycle === Fr.ContainerScoped, o = r || i, s;
    return am(e.provider) ? s = e.provider.useValue : sm(e.provider) ? s = o ? e.instance || (e.instance = this.resolve(e.provider.useToken, n)) : this.resolve(e.provider.useToken, n) : AB(e.provider) ? s = o ? e.instance || (e.instance = this.construct(e.provider.useClass, n)) : this.construct(e.provider.useClass, n) : a_(e.provider) ? s = e.provider.useFactory(this) : s = this.construct(e.provider, n), e.options.lifecycle === Fr.ResolutionScoped && n.scopedResolutions.set(e, s), s;
  }, t.prototype.resolveAll = function(e, n, r) {
    var i = this;
    n === void 0 && (n = new kh()), r === void 0 && (r = !1), this.ensureNotDisposed();
    var o = this.getAllRegistrations(e);
    if (!o && Uc(e)) {
      if (r)
        return [];
      throw new Error('Attempted to resolve unregistered dependency token: "' + e.toString() + '"');
    }
    if (this.executePreResolutionInterceptor(e, "All"), o) {
      var s = o.map(function(c) {
        return i.resolveRegistration(c, n);
      });
      return this.executePostResolutionInterceptor(e, s, "All"), s;
    }
    var a = [this.construct(e, n)];
    return this.executePostResolutionInterceptor(e, a, "All"), a;
  }, t.prototype.isRegistered = function(e, n) {
    return n === void 0 && (n = !1), this.ensureNotDisposed(), this._registry.has(e) || n && (this.parent || !1) && this.parent.isRegistered(e, !0);
  }, t.prototype.reset = function() {
    this.ensureNotDisposed(), this._registry.clear(), this.interceptors.preResolution.clear(), this.interceptors.postResolution.clear();
  }, t.prototype.clearInstances = function() {
    var e, n;
    this.ensureNotDisposed();
    try {
      for (var r = Th(this._registry.entries()), i = r.next(); !i.done; i = r.next()) {
        var o = s_(i.value, 2), s = o[0], a = o[1];
        this._registry.setAll(s, a.filter(function(c) {
          return !am(c.provider);
        }).map(function(c) {
          return c.instance = void 0, c;
        }));
      }
    } catch (c) {
      e = { error: c };
    } finally {
      try {
        i && !i.done && (n = r.return) && n.call(r);
      } finally {
        if (e) throw e.error;
      }
    }
  }, t.prototype.createChildContainer = function() {
    var e, n;
    this.ensureNotDisposed();
    var r = new t(this);
    try {
      for (var i = Th(this._registry.entries()), o = i.next(); !o.done; o = i.next()) {
        var s = s_(o.value, 2), a = s[0], c = s[1];
        c.some(function(u) {
          var l = u.options;
          return l.lifecycle === Fr.ContainerScoped;
        }) && r._registry.setAll(a, c.map(function(u) {
          return u.options.lifecycle === Fr.ContainerScoped ? {
            provider: u.provider,
            options: u.options
          } : u;
        }));
      }
    } catch (u) {
      e = { error: u };
    } finally {
      try {
        o && !o.done && (n = i.return) && n.call(i);
      } finally {
        if (e) throw e.error;
      }
    }
    return r;
  }, t.prototype.beforeResolution = function(e, n, r) {
    r === void 0 && (r = { frequency: "Always" }), this.interceptors.preResolution.set(e, {
      callback: n,
      options: r
    });
  }, t.prototype.afterResolution = function(e, n, r) {
    r === void 0 && (r = { frequency: "Always" }), this.interceptors.postResolution.set(e, {
      callback: n,
      options: r
    });
  }, t.prototype.dispose = function() {
    return gpe(this, void 0, void 0, function() {
      var e;
      return ype(this, function(n) {
        switch (n.label) {
          case 0:
            return this.disposed = !0, e = [], this.disposables.forEach(function(r) {
              var i = r.dispose();
              i && e.push(i);
            }), [4, Promise.all(e)];
          case 1:
            return n.sent(), [2];
        }
      });
    });
  }, t.prototype.getRegistration = function(e) {
    return this.isRegistered(e) ? this._registry.get(e) : this.parent ? this.parent.getRegistration(e) : null;
  }, t.prototype.getAllRegistrations = function(e) {
    return this.isRegistered(e) ? this._registry.getAll(e) : this.parent ? this.parent.getAllRegistrations(e) : null;
  }, t.prototype.construct = function(e, n) {
    var r = this;
    if (e instanceof IB)
      return e.createProxy(function(o) {
        return r.resolve(o, n);
      });
    var i = (function() {
      var o = CB.get(e);
      if (!o || o.length === 0) {
        if (e.length === 0)
          return new e();
        throw new Error('TypeInfo not known for "' + e.name + '"');
      }
      var s = o.map(r.resolveParams(n, e));
      return new (e.bind.apply(e, Ua([void 0], s)))();
    })();
    return Cpe(i) && this.disposables.add(i), i;
  }, t.prototype.resolveParams = function(e, n) {
    var r = this;
    return function(i, o) {
      var s, a, c;
      try {
        return xpe(i) ? BP(i) ? i.multiple ? (s = r.resolve(i.transform)).transform.apply(s, Ua([r.resolveAll(i.token, new kh(), i.isOptional)], i.transformArgs)) : (a = r.resolve(i.transform)).transform.apply(a, Ua([r.resolve(i.token, e, i.isOptional)], i.transformArgs)) : i.multiple ? r.resolveAll(i.token, new kh(), i.isOptional) : r.resolve(i.token, e, i.isOptional) : BP(i) ? (c = r.resolve(i.transform, e)).transform.apply(c, Ua([r.resolve(i.token, e)], i.transformArgs)) : r.resolve(i, e);
      } catch (u) {
        throw new Error(Ipe(n, o, u));
      }
    };
  }, t.prototype.ensureNotDisposed = function() {
    if (this.disposed)
      throw new Error("This container has been disposed, you cannot interact with a disposed container");
  }, t;
})(), lr = new Ppe();
function py(t) {
  return function(e) {
    CB.set(e, bpe(e));
  };
}
if (typeof Reflect > "u" || !Reflect.getMetadata)
  throw new Error(`tsyringe requires a reflect polyfill. Please add 'import "reflect-metadata"' to the top of your entry point.`);
var c_;
class dy {
  constructor(e = {}) {
    this.attrId = "", this.attrValues = [], Object.assign(e);
  }
}
R([
  H({ type: te.ObjectIdentifier })
], dy.prototype, "attrId", void 0);
R([
  H({ type: te.Any, repeated: "set" })
], dy.prototype, "attrValues", void 0);
let UP = c_ = class extends Ct {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, c_.prototype);
  }
};
UP = c_ = R([
  Se({ type: ge.Sequence, itemType: dy })
], UP);
var u_;
let LP = u_ = class extends Ct {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, u_.prototype);
  }
};
LP = u_ = R([
  Se({ type: ge.Sequence, itemType: vl })
], LP);
class TB {
  constructor(e = {}) {
    this.certId = "", this.certValue = new ArrayBuffer(0), Object.assign(this, e);
  }
}
R([
  H({ type: te.ObjectIdentifier })
], TB.prototype, "certId", void 0);
R([
  H({ type: te.Any, context: 0 })
], TB.prototype, "certValue", void 0);
class kB {
  constructor(e = {}) {
    this.crlId = "", this.crltValue = new ArrayBuffer(0), Object.assign(this, e);
  }
}
R([
  H({ type: te.ObjectIdentifier })
], kB.prototype, "crlId", void 0);
R([
  H({ type: te.Any, context: 0 })
], kB.prototype, "crltValue", void 0);
class NB extends je {
}
let fy = class {
  constructor(e = {}) {
    this.encryptionAlgorithm = new Fe(), this.encryptedData = new NB(), Object.assign(this, e);
  }
};
R([
  H({ type: Fe })
], fy.prototype, "encryptionAlgorithm", void 0);
R([
  H({ type: NB })
], fy.prototype, "encryptedData", void 0);
var l_, p_;
(function(t) {
  t[t.v1 = 0] = "v1";
})(p_ || (p_ = {}));
class PB extends je {
}
let d_ = l_ = class extends Ct {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, l_.prototype);
  }
};
d_ = l_ = R([
  Se({ type: ge.Sequence, itemType: ms })
], d_);
class ff {
  constructor(e = {}) {
    this.version = p_.v1, this.privateKeyAlgorithm = new Fe(), this.privateKey = new PB(), Object.assign(this, e);
  }
}
R([
  H({ type: te.Integer })
], ff.prototype, "version", void 0);
R([
  H({ type: Fe })
], ff.prototype, "privateKeyAlgorithm", void 0);
R([
  H({ type: PB })
], ff.prototype, "privateKey", void 0);
R([
  H({ type: d_, implicit: !0, context: 0, optional: !0 })
], ff.prototype, "attributes", void 0);
let jP = class extends ff {
};
jP = R([
  Se({ type: ge.Sequence })
], jP);
let QP = class extends fy {
};
QP = R([
  Se({ type: ge.Sequence })
], QP);
class DB {
  constructor(e = {}) {
    this.secretTypeId = "", this.secretValue = new ArrayBuffer(0), Object.assign(this, e);
  }
}
R([
  H({ type: te.ObjectIdentifier })
], DB.prototype, "secretTypeId", void 0);
R([
  H({ type: te.Any, context: 0 })
], DB.prototype, "secretValue", void 0);
class hf {
  constructor(e = {}) {
    this.mac = new cy(), this.macSalt = new je(), this.iterations = 1, Object.assign(this, e);
  }
}
R([
  H({ type: cy })
], hf.prototype, "mac", void 0);
R([
  H({ type: je })
], hf.prototype, "macSalt", void 0);
R([
  H({ type: te.Integer, defaultValue: 1 })
], hf.prototype, "iterations", void 0);
class hy {
  constructor(e = {}) {
    this.version = 3, this.authSafe = new vl(), this.macData = new hf(), Object.assign(this, e);
  }
}
R([
  H({ type: te.Integer })
], hy.prototype, "version", void 0);
R([
  H({ type: vl })
], hy.prototype, "authSafe", void 0);
R([
  H({ type: hf, optional: !0 })
], hy.prototype, "macData", void 0);
var f_;
class my {
  constructor(e = {}) {
    this.bagId = "", this.bagValue = new ArrayBuffer(0), Object.assign(this, e);
  }
}
R([
  H({ type: te.ObjectIdentifier })
], my.prototype, "bagId", void 0);
R([
  H({ type: te.Any, context: 0 })
], my.prototype, "bagValue", void 0);
R([
  H({ type: dy, repeated: "set", optional: !0 })
], my.prototype, "bagAttributes", void 0);
let $P = f_ = class extends Ct {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, f_.prototype);
  }
};
$P = f_ = R([
  Se({ type: ge.Sequence, itemType: my })
], $P);
var h_, m_, g_;
const FB = "1.2.840.113549.1.9", OB = `${FB}.7`, S2 = `${FB}.14`;
let gg = class extends ur {
  constructor(e = {}) {
    super(e);
  }
  toString() {
    return this.ia5String || super.toString();
  }
};
R([
  H({ type: te.IA5String })
], gg.prototype, "ia5String", void 0);
gg = R([
  Se({ type: ge.Choice })
], gg);
let GP = class extends vl {
};
GP = R([
  Se({ type: ge.Sequence })
], GP);
let qP = class extends hy {
};
qP = R([
  Se({ type: ge.Sequence })
], qP);
let HP = class extends fy {
};
HP = R([
  Se({ type: ge.Sequence })
], HP);
let y_ = class {
  constructor(e = "") {
    this.value = e;
  }
  toString() {
    return this.value;
  }
};
R([
  H({ type: te.IA5String })
], y_.prototype, "value", void 0);
y_ = R([
  Se({ type: ge.Choice })
], y_);
let WP = class extends gg {
};
WP = R([
  Se({ type: ge.Choice })
], WP);
let zP = class extends ur {
};
zP = R([
  Se({ type: ge.Choice })
], zP);
let v_ = class {
  constructor(e = /* @__PURE__ */ new Date()) {
    this.value = e;
  }
};
R([
  H({ type: te.GeneralizedTime })
], v_.prototype, "value", void 0);
v_ = R([
  Se({ type: ge.Choice })
], v_);
let KP = class extends ur {
};
KP = R([
  Se({ type: ge.Choice })
], KP);
let b_ = class {
  constructor(e = "M") {
    this.value = e;
  }
  toString() {
    return this.value;
  }
};
R([
  H({ type: te.PrintableString })
], b_.prototype, "value", void 0);
b_ = R([
  Se({ type: ge.Choice })
], b_);
let yg = class {
  constructor(e = "") {
    this.value = e;
  }
  toString() {
    return this.value;
  }
};
R([
  H({ type: te.PrintableString })
], yg.prototype, "value", void 0);
yg = R([
  Se({ type: ge.Choice })
], yg);
let VP = class extends yg {
};
VP = R([
  Se({ type: ge.Choice })
], VP);
let YP = class extends ur {
};
YP = R([
  Se({ type: ge.Choice })
], YP);
let x_ = class {
  constructor(e = "") {
    this.value = e;
  }
  toString() {
    return this.value;
  }
};
R([
  H({ type: te.ObjectIdentifier })
], x_.prototype, "value", void 0);
x_ = R([
  Se({ type: ge.Choice })
], x_);
let JP = class extends Hn {
};
JP = R([
  Se({ type: ge.Choice })
], JP);
let w_ = class {
  constructor(e = 0) {
    this.value = e;
  }
  toString() {
    return this.value.toString();
  }
};
R([
  H({ type: te.Integer })
], w_.prototype, "value", void 0);
w_ = R([
  Se({ type: ge.Choice })
], w_);
let XP = class extends Lo {
};
XP = R([
  Se({ type: ge.Sequence })
], XP);
let vg = class extends ur {
};
vg = R([
  Se({ type: ge.Choice })
], vg);
let ZP = h_ = class extends ic {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, h_.prototype);
  }
};
ZP = h_ = R([
  Se({ type: ge.Sequence })
], ZP);
let eD = m_ = class extends Ct {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, m_.prototype);
  }
};
eD = m_ = R([
  Se({ type: ge.Set, itemType: yl })
], eD);
let S_ = class {
  constructor(e = "") {
    this.value = e;
  }
  toString() {
    return this.value;
  }
};
R([
  H({ type: te.BmpString })
], S_.prototype, "value", void 0);
S_ = R([
  Se({ type: ge.Choice })
], S_);
let __ = class extends Fe {
};
__ = R([
  Se({ type: ge.Sequence })
], __);
let tD = g_ = class extends Ct {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, g_.prototype);
  }
};
tD = g_ = R([
  Se({ type: ge.Sequence, itemType: __ })
], tD);
var E_;
let bg = E_ = class extends Ct {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, E_.prototype);
  }
};
bg = E_ = R([
  Se({ type: ge.Sequence, itemType: ms })
], bg);
class wl {
  constructor(e = {}) {
    this.version = 0, this.subject = new Nn(), this.subjectPKInfo = new Co(), this.attributes = new bg(), Object.assign(this, e);
  }
}
R([
  H({ type: te.Integer })
], wl.prototype, "version", void 0);
R([
  H({ type: Nn })
], wl.prototype, "subject", void 0);
R([
  H({ type: Co })
], wl.prototype, "subjectPKInfo", void 0);
R([
  H({ type: bg, implicit: !0, context: 0, optional: !0 })
], wl.prototype, "attributes", void 0);
class md {
  constructor(e = {}) {
    this.certificationRequestInfo = new wl(), this.signatureAlgorithm = new Fe(), this.signature = new ArrayBuffer(0), Object.assign(this, e);
  }
}
R([
  H({ type: wl, raw: !0 })
], md.prototype, "certificationRequestInfo", void 0);
R([
  H({ type: Fe })
], md.prototype, "signatureAlgorithm", void 0);
R([
  H({ type: te.BitString })
], md.prototype, "signature", void 0);
/*!
 * MIT License
 * 
 * Copyright (c) Peculiar Ventures. All rights reserved.
 * 
 * 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.
 * 
 */
const mf = "crypto.algorithm";
class Dpe {
  getAlgorithms() {
    return lr.resolveAll(mf);
  }
  toAsnAlgorithm(e) {
    ({ ...e });
    for (const n of this.getAlgorithms()) {
      const r = n.toAsnAlgorithm(e);
      if (r)
        return r;
    }
    if (/^[0-9.]+$/.test(e.name)) {
      const n = new Fe({ algorithm: e.name });
      if ("parameters" in e) {
        const r = e;
        n.parameters = r.parameters;
      }
      return n;
    }
    throw new Error("Cannot convert WebCrypto algorithm to ASN.1 algorithm");
  }
  toWebAlgorithm(e) {
    for (const r of this.getAlgorithms()) {
      const i = r.toWebAlgorithm(e);
      if (i)
        return i;
    }
    return {
      name: e.algorithm,
      parameters: e.parameters
    };
  }
}
const cc = "crypto.algorithmProvider";
lr.registerSingleton(cc, Dpe);
var cm;
const Yr = "1.3.36.3.3.2.8.1.1", nD = `${Yr}.1`, rD = `${Yr}.2`, iD = `${Yr}.3`, oD = `${Yr}.4`, sD = `${Yr}.5`, aD = `${Yr}.6`, cD = `${Yr}.7`, uD = `${Yr}.8`, lD = `${Yr}.9`, pD = `${Yr}.10`, dD = `${Yr}.11`, fD = `${Yr}.12`, hD = `${Yr}.13`, mD = `${Yr}.14`, gD = "brainpoolP160r1", yD = "brainpoolP160t1", vD = "brainpoolP192r1", bD = "brainpoolP192t1", xD = "brainpoolP224r1", wD = "brainpoolP224t1", SD = "brainpoolP256r1", _D = "brainpoolP256t1", ED = "brainpoolP320r1", AD = "brainpoolP320t1", ID = "brainpoolP384r1", CD = "brainpoolP384t1", TD = "brainpoolP512r1", kD = "brainpoolP512t1", Yt = "ECDSA";
let gd = cm = class {
  toAsnAlgorithm(e) {
    switch (e.name.toLowerCase()) {
      case Yt.toLowerCase():
        if ("hash" in e)
          switch ((typeof e.hash == "string" ? e.hash : e.hash.name).toLowerCase()) {
            case "sha-1":
              return Zle;
            case "sha-256":
              return epe;
            case "sha-384":
              return tpe;
            case "sha-512":
              return npe;
          }
        else if ("namedCurve" in e) {
          let n = "";
          switch (e.namedCurve) {
            case "P-256":
              n = ZS;
              break;
            case "K-256":
              n = cm.SECP256K1;
              break;
            case "P-384":
              n = e_;
              break;
            case "P-521":
              n = MP;
              break;
            case gD:
              n = nD;
              break;
            case yD:
              n = rD;
              break;
            case vD:
              n = iD;
              break;
            case bD:
              n = oD;
              break;
            case xD:
              n = sD;
              break;
            case wD:
              n = aD;
              break;
            case SD:
              n = cD;
              break;
            case _D:
              n = uD;
              break;
            case ED:
              n = lD;
              break;
            case AD:
              n = pD;
              break;
            case ID:
              n = dD;
              break;
            case CD:
              n = fD;
              break;
            case TD:
              n = hD;
              break;
            case kD:
              n = mD;
              break;
          }
          if (n)
            return new Fe({
              algorithm: Ou,
              parameters: Ce.serialize(new vs({ namedCurve: n }))
            });
        }
    }
    return null;
  }
  toWebAlgorithm(e) {
    switch (e.algorithm) {
      case g2:
        return {
          name: Yt,
          hash: { name: "SHA-1" }
        };
      case y2:
        return {
          name: Yt,
          hash: { name: "SHA-256" }
        };
      case v2:
        return {
          name: Yt,
          hash: { name: "SHA-384" }
        };
      case b2:
        return {
          name: Yt,
          hash: { name: "SHA-512" }
        };
      case Ou: {
        if (!e.parameters)
          throw new TypeError("Cannot get required parameters from EC algorithm");
        switch (Ce.parse(e.parameters, vs).namedCurve) {
          case ZS:
            return {
              name: Yt,
              namedCurve: "P-256"
            };
          case cm.SECP256K1:
            return {
              name: Yt,
              namedCurve: "K-256"
            };
          case e_:
            return {
              name: Yt,
              namedCurve: "P-384"
            };
          case MP:
            return {
              name: Yt,
              namedCurve: "P-521"
            };
          case nD:
            return {
              name: Yt,
              namedCurve: gD
            };
          case rD:
            return {
              name: Yt,
              namedCurve: yD
            };
          case iD:
            return {
              name: Yt,
              namedCurve: vD
            };
          case oD:
            return {
              name: Yt,
              namedCurve: bD
            };
          case sD:
            return {
              name: Yt,
              namedCurve: xD
            };
          case aD:
            return {
              name: Yt,
              namedCurve: wD
            };
          case cD:
            return {
              name: Yt,
              namedCurve: SD
            };
          case uD:
            return {
              name: Yt,
              namedCurve: _D
            };
          case lD:
            return {
              name: Yt,
              namedCurve: ED
            };
          case pD:
            return {
              name: Yt,
              namedCurve: AD
            };
          case dD:
            return {
              name: Yt,
              namedCurve: ID
            };
          case fD:
            return {
              name: Yt,
              namedCurve: CD
            };
          case hD:
            return {
              name: Yt,
              namedCurve: TD
            };
          case mD:
            return {
              name: Yt,
              namedCurve: kD
            };
        }
      }
    }
    return null;
  }
};
gd.SECP256K1 = "1.3.132.0.10";
gd = cm = R([
  py()
], gd);
lr.registerSingleton(mf, gd);
const MB = Symbol("name"), RB = Symbol("value");
class It {
  constructor(e, n = {}, r = "") {
    this[MB] = e, this[RB] = r;
    for (const i in n)
      this[i] = n[i];
  }
}
It.NAME = MB;
It.VALUE = RB;
class Fpe {
  static toTextObject(e) {
    const n = new It("Algorithm Identifier", {}, _a.toString(e.algorithm));
    if (e.parameters)
      switch (e.algorithm) {
        case Ou: {
          const r = new gd().toWebAlgorithm(e);
          r && "namedCurve" in r ? n["Named Curve"] = r.namedCurve : n.Parameters = e.parameters;
          break;
        }
        default:
          n.Parameters = e.parameters;
      }
    return n;
  }
}
class _a {
  static toString(e) {
    const n = this.items[e];
    return n || e;
  }
}
_a.items = {
  [dg]: "sha1",
  [SB]: "sha224",
  [fg]: "sha256",
  [hg]: "sha384",
  [mg]: "sha512",
  [ia]: "rsaEncryption",
  [ug]: "sha1WithRSAEncryption",
  [cpe]: "sha224WithRSAEncryption",
  [n_]: "sha256WithRSAEncryption",
  [lg]: "sha384WithRSAEncryption",
  [pg]: "sha512WithRSAEncryption",
  [Ou]: "ecPublicKey",
  [g2]: "ecdsaWithSHA1",
  [bB]: "ecdsaWithSHA224",
  [y2]: "ecdsaWithSHA256",
  [v2]: "ecdsaWithSHA384",
  [b2]: "ecdsaWithSHA512",
  [Hle]: "TLS WWW server authentication",
  [Wle]: "TLS WWW client authentication",
  [zle]: "Code Signing",
  [Kle]: "E-mail Protection",
  [Vle]: "Time Stamping",
  [Yle]: "OCSP Signing",
  [Xle]: "Signed Data"
};
class uc {
  static serialize(e) {
    return this.serializeObj(e).join(`
`);
  }
  static pad(e = 0) {
    return "".padStart(2 * e, " ");
  }
  static serializeObj(e, n = 0) {
    const r = [];
    let i = this.pad(n++), o = "";
    const s = e[It.VALUE];
    s && (o = ` ${s}`), r.push(`${i}${e[It.NAME]}:${o}`), i = this.pad(n);
    for (const a in e) {
      if (typeof a == "symbol")
        continue;
      const c = e[a], u = a ? `${a}: ` : "";
      if (typeof c == "string" || typeof c == "number" || typeof c == "boolean")
        r.push(`${i}${u}${c}`);
      else if (c instanceof Date)
        r.push(`${i}${u}${c.toUTCString()}`);
      else if (Array.isArray(c))
        for (const l of c)
          l[It.NAME] = a, r.push(...this.serializeObj(l, n));
      else if (c instanceof It)
        c[It.NAME] = a, r.push(...this.serializeObj(c, n));
      else if (Ie.isBufferSource(c))
        a ? (r.push(`${i}${u}`), r.push(...this.serializeBufferSource(c, n + 1))) : r.push(...this.serializeBufferSource(c, n));
      else if ("toTextObject" in c) {
        const l = c.toTextObject();
        l[It.NAME] = a, r.push(...this.serializeObj(l, n));
      } else
        throw new TypeError("Cannot serialize data in text format. Unsupported type.");
    }
    return r;
  }
  static serializeBufferSource(e, n = 0) {
    const r = this.pad(n), i = Ie.toUint8Array(e), o = [];
    for (let s = 0; s < i.length; ) {
      const a = [];
      for (let c = 0; c < 16 && s < i.length; c++) {
        c === 8 && a.push("");
        const u = i[s++].toString(16).padStart(2, "0");
        a.push(u);
      }
      o.push(`${r}${a.join(" ")}`);
    }
    return o;
  }
  static serializeAlgorithm(e) {
    return this.algorithmSerializer.toTextObject(e);
  }
}
uc.oidSerializer = _a;
uc.algorithmSerializer = Fpe;
var $c;
class Ts {
  get rawData() {
    return Re(this, $c, "f") || pt(this, $c, Ce.serialize(this.asn), "f"), Re(this, $c, "f");
  }
  constructor(...e) {
    $c.set(this, void 0), Ie.isBufferSource(e[0]) ? (this.asn = Ce.parse(e[0], e[1]), pt(this, $c, Ie.toArrayBuffer(e[0]), "f"), this.onInit(this.asn)) : (this.asn = e[0], this.onInit(this.asn));
  }
  equal(e) {
    return e instanceof Ts ? a5(e.rawData, this.rawData) : !1;
  }
  toString(e = "text") {
    switch (e) {
      case "asn":
        return Ce.toString(this.rawData);
      case "text":
        return uc.serialize(this.toTextObject());
      case "hex":
        return Ue.ToHex(this.rawData);
      case "base64":
        return Ue.ToBase64(this.rawData);
      case "base64url":
        return Ue.ToBase64Url(this.rawData);
      default:
        throw TypeError("Argument 'format' is unsupported value");
    }
  }
  getTextName() {
    return this.constructor.NAME;
  }
  toTextObject() {
    const e = this.toTextObjectEmpty();
    return e[""] = this.rawData, e;
  }
  toTextObjectEmpty(e) {
    return new It(this.getTextName(), {}, e);
  }
}
$c = /* @__PURE__ */ new WeakMap();
Ts.NAME = "ASN";
class mi extends Ts {
  constructor(...e) {
    let n;
    Ie.isBufferSource(e[0]) ? n = Ie.toArrayBuffer(e[0]) : n = Ce.serialize(new co({
      extnID: e[0],
      critical: e[1],
      extnValue: new je(Ie.toArrayBuffer(e[2]))
    })), super(n, co);
  }
  onInit(e) {
    this.type = e.extnID, this.critical = e.critical, this.value = e.extnValue.buffer;
  }
  toTextObject() {
    const e = this.toTextObjectWithoutValue();
    return e[""] = this.value, e;
  }
  toTextObjectWithoutValue() {
    const e = this.toTextObjectEmpty(this.critical ? "critical" : void 0);
    return e[It.NAME] === mi.NAME && (e[It.NAME] = _a.toString(this.type)), e;
  }
}
var BB;
class zs {
  static isCryptoKeyPair(e) {
    return e && e.privateKey && e.publicKey;
  }
  static isCryptoKey(e) {
    return e && e.usages && e.type && e.algorithm && e.extractable !== void 0;
  }
  constructor() {
    this.items = /* @__PURE__ */ new Map(), this[BB] = "CryptoProvider", typeof self < "u" && typeof crypto < "u" ? this.set(zs.DEFAULT, crypto) : typeof global < "u" && global.crypto && global.crypto.subtle && this.set(zs.DEFAULT, global.crypto);
  }
  clear() {
    this.items.clear();
  }
  delete(e) {
    return this.items.delete(e);
  }
  forEach(e, n) {
    return this.items.forEach(e, n);
  }
  has(e) {
    return this.items.has(e);
  }
  get size() {
    return this.items.size;
  }
  entries() {
    return this.items.entries();
  }
  keys() {
    return this.items.keys();
  }
  values() {
    return this.items.values();
  }
  [Symbol.iterator]() {
    return this.items[Symbol.iterator]();
  }
  get(e = zs.DEFAULT) {
    const n = this.items.get(e.toLowerCase());
    if (!n)
      throw new Error(`Cannot get Crypto by name '${e}'`);
    return n;
  }
  set(e, n) {
    if (typeof e == "string") {
      if (!n)
        throw new TypeError("Argument 'value' is required");
      this.items.set(e.toLowerCase(), n);
    } else
      this.items.set(zs.DEFAULT, e);
    return this;
  }
}
BB = Symbol.toStringTag;
zs.DEFAULT = "default";
const $n = new zs(), Ope = /^[0-2](?:\.[1-9][0-9]*)+$/;
function Mpe(t) {
  return new RegExp(Ope).test(t);
}
class UB {
  constructor(e = {}) {
    this.items = {};
    for (const n in e)
      this.register(n, e[n]);
  }
  get(e) {
    return this.items[e] || null;
  }
  findId(e) {
    return Mpe(e) ? e : this.get(e);
  }
  register(e, n) {
    this.items[e] = n, this.items[n] = e;
  }
}
const Wr = new UB();
Wr.register("CN", "2.5.4.3");
Wr.register("L", "2.5.4.7");
Wr.register("ST", "2.5.4.8");
Wr.register("O", "2.5.4.10");
Wr.register("OU", "2.5.4.11");
Wr.register("C", "2.5.4.6");
Wr.register("DC", "0.9.2342.19200300.100.1.25");
Wr.register("E", "1.2.840.113549.1.9.1");
Wr.register("G", "2.5.4.42");
Wr.register("I", "2.5.4.43");
Wr.register("SN", "2.5.4.4");
Wr.register("T", "2.5.4.12");
function Rpe(t, e) {
  return `\\${Ue.ToHex(Ue.FromUtf8String(e)).toUpperCase()}`;
}
function Bpe(t) {
  return t.replace(/([,+"\\<>;])/g, "\\$1").replace(/^([ #])/, "\\$1").replace(/([ ]$)/, "\\$1").replace(/([\r\n\t])/, Rpe);
}
class oa {
  static isASCII(e) {
    for (let n = 0; n < e.length; n++)
      if (e.charCodeAt(n) > 255)
        return !1;
    return !0;
  }
  static isPrintableString(e) {
    return /^[A-Za-z0-9 '()+,-./:=?]*$/g.test(e);
  }
  constructor(e, n = {}) {
    this.extraNames = new UB(), this.asn = new Nn();
    for (const r in n)
      if (Object.prototype.hasOwnProperty.call(n, r)) {
        const i = n[r];
        this.extraNames.register(r, i);
      }
    typeof e == "string" ? this.asn = this.fromString(e) : e instanceof Nn ? this.asn = e : Ie.isBufferSource(e) ? this.asn = Ce.parse(e, Nn) : this.asn = this.fromJSON(e);
  }
  getField(e) {
    const n = this.extraNames.findId(e) || Wr.findId(e), r = [];
    for (const i of this.asn)
      for (const o of i)
        o.type === n && r.push(o.value.toString());
    return r;
  }
  getName(e) {
    return this.extraNames.get(e) || Wr.get(e);
  }
  toString() {
    return this.asn.map((e) => e.map((n) => {
      const r = this.getName(n.type) || n.type, i = n.value.anyValue ? `#${Ue.ToHex(n.value.anyValue)}` : Bpe(n.value.toString());
      return `${r}=${i}`;
    }).join("+")).join(", ");
  }
  toJSON() {
    var e;
    const n = [];
    for (const r of this.asn) {
      const i = {};
      for (const o of r) {
        const s = this.getName(o.type) || o.type;
        (e = i[s]) !== null && e !== void 0 || (i[s] = []), i[s].push(o.value.anyValue ? `#${Ue.ToHex(o.value.anyValue)}` : o.value.toString());
      }
      n.push(i);
    }
    return n;
  }
  fromString(e) {
    const n = new Nn(), r = /(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+"\\](?=[,+]|$))|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g;
    let i = null, o = ",";
    for (; i = r.exec(`${e},`); ) {
      let [, s, a] = i;
      const c = a[a.length - 1];
      (c === "," || c === "+") && (a = a.slice(0, a.length - 1), i[3] = c);
      const u = i[3];
      s = this.getTypeOid(s);
      const l = this.createAttribute(s, a);
      o === "+" ? n[n.length - 1].push(l) : n.push(new Iu([l])), o = u;
    }
    return n;
  }
  fromJSON(e) {
    const n = new Nn();
    for (const r of e) {
      const i = new Iu();
      for (const o in r) {
        const s = this.getTypeOid(o), a = r[o];
        for (const c of a) {
          const u = this.createAttribute(s, c);
          i.push(u);
        }
      }
      n.push(i);
    }
    return n;
  }
  getTypeOid(e) {
    if (/[\d.]+/.test(e) || (e = this.getName(e) || ""), !e)
      throw new Error(`Cannot get OID for name type '${e}'`);
    return e;
  }
  createAttribute(e, n) {
    const r = new G0({ type: e });
    if (typeof n == "object")
      for (const i in n)
        switch (i) {
          case "ia5String":
            r.value.ia5String = n[i];
            break;
          case "utf8String":
            r.value.utf8String = n[i];
            break;
          case "universalString":
            r.value.universalString = n[i];
            break;
          case "bmpString":
            r.value.bmpString = n[i];
            break;
          case "printableString":
            r.value.printableString = n[i];
            break;
        }
    else if (n[0] === "#")
      r.value.anyValue = Ue.FromHex(n.slice(1));
    else {
      const i = this.processStringValue(n);
      e === this.getName("E") || e === this.getName("DC") ? r.value.ia5String = i : oa.isPrintableString(i) ? r.value.printableString = i : r.value.utf8String = i;
    }
    return r;
  }
  processStringValue(e) {
    const n = /"(.*?[^\\])?"/.exec(e);
    return n && (e = n[1]), e.replace(/\\0a/ig, `
`).replace(/\\0d/ig, "\r").replace(/\\0g/ig, "	").replace(/\\(.)/g, "$1");
  }
  toArrayBuffer() {
    return Ce.serialize(this.asn);
  }
  async getThumbprint(...e) {
    var n;
    let r, i = "SHA-1";
    return e.length >= 1 && !(!((n = e[0]) === null || n === void 0) && n.subtle) ? (i = e[0] || i, r = e[1] || $n.get()) : r = e[0] || $n.get(), await r.subtle.digest(i, this.toArrayBuffer());
  }
}
const LB = "Cannot initialize GeneralName from ASN.1 data.", ND = `${LB} Unsupported string format in use.`, Upe = `${LB} Value doesn't match to GUID regular expression.`, PD = /^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i, DD = "1.3.6.1.4.1.311.25.1", FD = "1.3.6.1.4.1.311.20.2.3", Gx = "dns", qx = "dn", Hx = "email", Wx = "ip", zx = "url", Kx = "guid", Vx = "upn", Nh = "id";
class Ks extends Ts {
  constructor(...e) {
    let n;
    if (e.length === 2)
      switch (e[0]) {
        case qx: {
          const r = new oa(e[1]).toArrayBuffer(), i = Ce.parse(r, Nn);
          n = new ot({ directoryName: i });
          break;
        }
        case Gx:
          n = new ot({ dNSName: e[1] });
          break;
        case Hx:
          n = new ot({ rfc822Name: e[1] });
          break;
        case Kx: {
          const r = new RegExp(PD, "i").exec(e[1]);
          if (!r)
            throw new Error("Cannot parse GUID value. Value doesn't match to regular expression");
          const i = r.slice(1).map((o, s) => s < 3 ? Ue.ToHex(new Uint8Array(Ue.FromHex(o)).reverse()) : o).join("");
          n = new ot({
            otherName: new ad({
              typeId: DD,
              value: Ce.serialize(new je(Ue.FromHex(i)))
            })
          });
          break;
        }
        case Wx:
          n = new ot({ iPAddress: e[1] });
          break;
        case Nh:
          n = new ot({ registeredID: e[1] });
          break;
        case Vx: {
          n = new ot({
            otherName: new ad({
              typeId: FD,
              value: Ce.serialize(iB.toASN(e[1]))
            })
          });
          break;
        }
        case zx:
          n = new ot({ uniformResourceIdentifier: e[1] });
          break;
        default:
          throw new Error("Cannot create GeneralName. Unsupported type of the name");
      }
    else Ie.isBufferSource(e[0]) ? n = Ce.parse(e[0], ot) : n = e[0];
    super(n);
  }
  onInit(e) {
    if (e.dNSName != null)
      this.type = Gx, this.value = e.dNSName;
    else if (e.rfc822Name != null)
      this.type = Hx, this.value = e.rfc822Name;
    else if (e.iPAddress != null)
      this.type = Wx, this.value = e.iPAddress;
    else if (e.uniformResourceIdentifier != null)
      this.type = zx, this.value = e.uniformResourceIdentifier;
    else if (e.registeredID != null)
      this.type = Nh, this.value = e.registeredID;
    else if (e.directoryName != null)
      this.type = qx, this.value = new oa(e.directoryName).toString();
    else if (e.otherName != null)
      if (e.otherName.typeId === DD) {
        this.type = Kx;
        const n = Ce.parse(e.otherName.value, je), r = new RegExp(PD, "i").exec(Ue.ToHex(n));
        if (!r)
          throw new Error(Upe);
        this.value = r.slice(1).map((i, o) => o < 3 ? Ue.ToHex(new Uint8Array(Ue.FromHex(i)).reverse()) : i).join("-");
      } else if (e.otherName.typeId === FD)
        this.type = Vx, this.value = Ce.parse(e.otherName.value, ur).toString();
      else
        throw new Error(ND);
    else
      throw new Error(ND);
  }
  toJSON() {
    return {
      type: this.type,
      value: this.value
    };
  }
  toTextObject() {
    let e;
    switch (this.type) {
      case qx:
      case Gx:
      case Kx:
      case Wx:
      case Nh:
      case Vx:
      case zx:
        e = this.type.toUpperCase();
        break;
      case Hx:
        e = "Email";
        break;
      default:
        throw new Error("Unsupported GeneralName type");
    }
    let n = this.value;
    return this.type === Nh && (n = _a.toString(n)), new It(e, void 0, n);
  }
}
class lc extends Ts {
  constructor(e) {
    let n;
    if (e instanceof gr)
      n = e;
    else if (Array.isArray(e)) {
      const r = [];
      for (const i of e)
        if (i instanceof ot)
          r.push(i);
        else {
          const o = Ce.parse(new Ks(i.type, i.value).rawData, ot);
          r.push(o);
        }
      n = new gr(r);
    } else if (Ie.isBufferSource(e))
      n = Ce.parse(e, gr);
    else
      throw new Error("Cannot initialize GeneralNames. Incorrect incoming arguments");
    super(n);
  }
  onInit(e) {
    const n = [];
    for (const r of e) {
      let i = null;
      try {
        i = new Ks(r);
      } catch {
        continue;
      }
      n.push(i);
    }
    this.items = n;
  }
  toJSON() {
    return this.items.map((e) => e.toJSON());
  }
  toTextObject() {
    const e = super.toTextObjectEmpty();
    for (const n of this.items) {
      const r = n.toTextObject();
      let i = e[r[It.NAME]];
      Array.isArray(i) || (i = [], e[r[It.NAME]] = i), i.push(r);
    }
    return e;
  }
}
lc.NAME = "GeneralNames";
const $p = "-{5}", yd = "\\n", Lpe = `[^${yd}]+`, jpe = `${$p}BEGIN (${Lpe}(?=${$p}))${$p}`, Qpe = `${$p}END \\1${$p}`, Ru = "\\n", $pe = `[^:${yd}]+`, Gpe = `(?:[^${yd}]+${Ru}(?: +[^${yd}]+${Ru})*)`, qpe = "[a-zA-Z0-9=+/]+", Hpe = `(?:${qpe}${Ru})+`, OD = `${jpe}${Ru}(?:((?:${$pe}: ${Gpe})+))?${Ru}?(${Hpe})${Qpe}`;
class Br {
  static isPem(e) {
    return typeof e == "string" && new RegExp(OD, "g").test(e.replace(/\r/g, ""));
  }
  static decodeWithHeaders(e) {
    e = e.replace(/\r/g, "");
    const n = new RegExp(OD, "g"), r = [];
    let i = null;
    for (; i = n.exec(e); ) {
      const o = i[3].replace(new RegExp(`[${yd}]+`, "g"), ""), s = {
        type: i[1],
        headers: [],
        rawData: Ue.FromBase64(o)
      }, a = i[2];
      if (a) {
        const c = a.split(new RegExp(Ru, "g"));
        let u = null;
        for (const l of c) {
          const [d, f] = l.split(/:(.*)/);
          if (f === void 0) {
            if (!u)
              throw new Error("Cannot parse PEM string. Incorrect header value");
            u.value += d.trim();
          } else
            u && s.headers.push(u), u = {
              key: d,
              value: f.trim()
            };
        }
        u && s.headers.push(u);
      }
      r.push(s);
    }
    return r;
  }
  static decode(e) {
    return this.decodeWithHeaders(e).map((r) => r.rawData);
  }
  static decodeFirst(e) {
    const n = this.decode(e);
    if (!n.length)
      throw new RangeError("PEM string doesn't contain any objects");
    return n[0];
  }
  static encode(e, n) {
    if (Array.isArray(e)) {
      const r = new Array();
      return n ? e.forEach((i) => {
        if (!Ie.isBufferSource(i))
          throw new TypeError("Cannot encode array of BufferSource in PEM format. Not all items of the array are BufferSource");
        r.push(this.encodeStruct({
          type: n,
          rawData: Ie.toArrayBuffer(i)
        }));
      }) : e.forEach((i) => {
        if (!("type" in i))
          throw new TypeError("Cannot encode array of PemStruct in PEM format. Not all items of the array are PemStrut");
        r.push(this.encodeStruct(i));
      }), r.join(`
`);
    } else {
      if (!n)
        throw new Error("Required argument 'tag' is missed");
      return this.encodeStruct({
        type: n,
        rawData: Ie.toArrayBuffer(e)
      });
    }
  }
  static encodeStruct(e) {
    var n;
    const r = e.type.toLocaleUpperCase(), i = [];
    if (i.push(`-----BEGIN ${r}-----`), !((n = e.headers) === null || n === void 0) && n.length) {
      for (const u of e.headers)
        i.push(`${u.key}: ${u.value}`);
      i.push("");
    }
    const o = Ue.ToBase64(e.rawData);
    let s, a = 0;
    const c = Array();
    for (; a < o.length && (o.length - a < 64 ? s = o.substring(a) : (s = o.substring(a, a + 64), a += 64), s.length !== 0); )
      if (c.push(s), s.length < 64)
        break;
    return i.push(...c), i.push(`-----END ${r}-----`), i.join(`
`);
  }
}
Br.CertificateTag = "CERTIFICATE";
Br.CrlTag = "CRL";
Br.CertificateRequestTag = "CERTIFICATE REQUEST";
Br.PublicKeyTag = "PUBLIC KEY";
Br.PrivateKeyTag = "PRIVATE KEY";
class lo extends Ts {
  static isAsnEncoded(e) {
    return Ie.isBufferSource(e) || typeof e == "string";
  }
  static toArrayBuffer(e) {
    if (typeof e == "string") {
      if (Br.isPem(e))
        return Br.decode(e)[0];
      if (Ue.isHex(e))
        return Ue.FromHex(e);
      if (Ue.isBase64(e))
        return Ue.FromBase64(e);
      if (Ue.isBase64Url(e))
        return Ue.FromBase64Url(e);
      throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url");
    } else {
      const n = Ie.toUint8Array(e);
      if (n.length > 0 && n[0] === 48)
        return Ie.toArrayBuffer(e);
      const r = Ue.ToBinary(e);
      if (Br.isPem(r))
        return Br.decode(r)[0];
      if (Ue.isHex(r))
        return Ue.FromHex(r);
      if (Ue.isBase64(r))
        return Ue.FromBase64(r);
      if (Ue.isBase64Url(r))
        return Ue.FromBase64Url(r);
      throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url");
    }
  }
  constructor(...e) {
    lo.isAsnEncoded(e[0]) ? super(lo.toArrayBuffer(e[0]), e[1]) : super(e[0]);
  }
  toString(e = "pem") {
    switch (e) {
      case "pem":
        return Br.encode(this.rawData, this.tag);
      default:
        return super.toString(e);
    }
  }
}
class Ki extends lo {
  static async create(e, n = $n.get()) {
    if (e instanceof Ki)
      return e;
    if (zs.isCryptoKey(e)) {
      if (e.type !== "public")
        throw new TypeError("Public key is required");
      const r = await n.subtle.exportKey("spki", e);
      return new Ki(r);
    } else {
      if (e.publicKey)
        return e.publicKey;
      if (Ie.isBufferSource(e))
        return new Ki(e);
      throw new TypeError("Unsupported PublicKeyType");
    }
  }
  constructor(e) {
    lo.isAsnEncoded(e) ? super(e, Co) : super(e), this.tag = Br.PublicKeyTag;
  }
  async export(...e) {
    let n, r = ["verify"], i = {
      hash: "SHA-256",
      ...this.algorithm
    };
    e.length > 1 ? (i = e[0] || i, r = e[1] || r, n = e[2] || $n.get()) : n = e[0] || $n.get();
    let o = this.rawData;
    const s = Ce.parse(this.rawData, Co);
    return s.algorithm.algorithm === Qp && (o = Wpe(s, o)), n.subtle.importKey("spki", o, i, !0, r);
  }
  onInit(e) {
    const n = lr.resolve(cc), r = this.algorithm = n.toWebAlgorithm(e.algorithm);
    switch (e.algorithm.algorithm) {
      case ia: {
        const i = Ce.parse(e.subjectPublicKey, ly), o = Ie.toUint8Array(i.modulus);
        r.publicExponent = Ie.toUint8Array(i.publicExponent), r.modulusLength = (o[0] ? o : o.slice(1)).byteLength << 3;
        break;
      }
    }
  }
  async getThumbprint(...e) {
    var n;
    let r, i = "SHA-1";
    return e.length >= 1 && !(!((n = e[0]) === null || n === void 0) && n.subtle) ? (i = e[0] || i, r = e[1] || $n.get()) : r = e[0] || $n.get(), await r.subtle.digest(i, this.rawData);
  }
  async getKeyIdentifier(...e) {
    let n, r = "SHA-1";
    e.length === 1 ? typeof e[0] == "string" ? (r = e[0], n = $n.get()) : n = e[0] : e.length === 2 ? (r = e[0], n = e[1]) : n = $n.get();
    const i = Ce.parse(this.rawData, Co);
    return await n.subtle.digest(r, i.subjectPublicKey);
  }
  toTextObject() {
    const e = this.toTextObjectEmpty(), n = Ce.parse(this.rawData, Co);
    switch (e.Algorithm = uc.serializeAlgorithm(n.algorithm), n.algorithm.algorithm) {
      case Ou:
        e["EC Point"] = n.subjectPublicKey;
        break;
      case ia:
      default:
        e["Raw Data"] = n.subjectPublicKey;
    }
    return e;
  }
}
function Wpe(t, e) {
  return t.algorithm = new Fe({
    algorithm: ia,
    parameters: null
  }), e = Ce.serialize(t), e;
}
class Bu extends mi {
  static async create(e, n = !1, r = $n.get()) {
    if ("name" in e && "serialNumber" in e)
      return new Bu(e, n);
    const o = await (await Ki.create(e, r)).getKeyIdentifier(r);
    return new Bu(Ue.ToHex(o), n);
  }
  constructor(...e) {
    if (Ie.isBufferSource(e[0]))
      super(e[0]);
    else if (typeof e[0] == "string") {
      const n = new ja({ keyIdentifier: new XA(Ue.FromHex(e[0])) });
      super(wS, e[1], Ce.serialize(n));
    } else {
      const n = e[0], r = n.name instanceof lc ? Ce.parse(n.name.rawData, gr) : n.name, i = new ja({
        authorityCertIssuer: r,
        authorityCertSerialNumber: Ue.FromHex(n.serialNumber)
      });
      super(wS, e[1], Ce.serialize(i));
    }
  }
  onInit(e) {
    super.onInit(e);
    const n = Ce.parse(e.extnValue, ja);
    n.keyIdentifier && (this.keyId = Ue.ToHex(n.keyIdentifier)), (n.authorityCertIssuer || n.authorityCertSerialNumber) && (this.certId = {
      name: n.authorityCertIssuer || [],
      serialNumber: n.authorityCertSerialNumber ? Ue.ToHex(n.authorityCertSerialNumber) : ""
    });
  }
  toTextObject() {
    const e = this.toTextObjectWithoutValue(), n = Ce.parse(this.value, ja);
    return n.authorityCertIssuer && (e["Authority Issuer"] = new lc(n.authorityCertIssuer).toTextObject()), n.authorityCertSerialNumber && (e["Authority Serial Number"] = n.authorityCertSerialNumber), n.keyIdentifier && (e[""] = n.keyIdentifier), e;
  }
}
Bu.NAME = "Authority Key Identifier";
class jB extends mi {
  constructor(...e) {
    if (Ie.isBufferSource(e[0])) {
      super(e[0]);
      const n = Ce.parse(this.value, cd);
      this.ca = n.cA, this.pathLength = n.pathLenConstraint;
    } else {
      const n = new cd({
        cA: e[0],
        pathLenConstraint: e[1]
      });
      super(ZA, e[2], Ce.serialize(n)), this.ca = e[0], this.pathLength = e[1];
    }
  }
  toTextObject() {
    const e = this.toTextObjectWithoutValue();
    return this.ca && (e.CA = this.ca), this.pathLength !== void 0 && (e["Path Length"] = this.pathLength), e;
  }
}
jB.NAME = "Basic Constraints";
var MD;
(function(t) {
  t.serverAuth = "1.3.6.1.5.5.7.3.1", t.clientAuth = "1.3.6.1.5.5.7.3.2", t.codeSigning = "1.3.6.1.5.5.7.3.3", t.emailProtection = "1.3.6.1.5.5.7.3.4", t.timeStamping = "1.3.6.1.5.5.7.3.8", t.ocspSigning = "1.3.6.1.5.5.7.3.9";
})(MD || (MD = {}));
class QB extends mi {
  constructor(...e) {
    if (Ie.isBufferSource(e[0])) {
      super(e[0]);
      const n = Ce.parse(this.value, ud);
      this.usages = n.map((r) => r);
    } else {
      const n = new ud(e[0]);
      super(r2, e[1], Ce.serialize(n)), this.usages = e[0];
    }
  }
  toTextObject() {
    const e = this.toTextObjectWithoutValue();
    return e[""] = this.usages.map((n) => _a.toString(n)).join(", "), e;
  }
}
QB.NAME = "Extended Key Usages";
var RD;
(function(t) {
  t[t.digitalSignature = 1] = "digitalSignature", t[t.nonRepudiation = 2] = "nonRepudiation", t[t.keyEncipherment = 4] = "keyEncipherment", t[t.dataEncipherment = 8] = "dataEncipherment", t[t.keyAgreement = 16] = "keyAgreement", t[t.keyCertSign = 32] = "keyCertSign", t[t.cRLSign = 64] = "cRLSign", t[t.encipherOnly = 128] = "encipherOnly", t[t.decipherOnly = 256] = "decipherOnly";
})(RD || (RD = {}));
class $B extends mi {
  constructor(...e) {
    if (Ie.isBufferSource(e[0])) {
      super(e[0]);
      const n = Ce.parse(this.value, Qx);
      this.usages = n.toNumber();
    } else {
      const n = new Qx(e[0]);
      super(uB, e[1], Ce.serialize(n)), this.usages = e[0];
    }
  }
  toTextObject() {
    const e = this.toTextObjectWithoutValue(), n = Ce.parse(this.value, Qx);
    return e[""] = n.toJSON().join(", "), e;
  }
}
$B.NAME = "Key Usages";
class gf extends mi {
  static async create(e, n = !1, r = $n.get()) {
    const o = await (await Ki.create(e, r)).getKeyIdentifier(r);
    return new gf(Ue.ToHex(o), n);
  }
  constructor(...e) {
    if (Ie.isBufferSource(e[0])) {
      super(e[0]);
      const n = Ce.parse(this.value, Xs);
      this.keyId = Ue.ToHex(n);
    } else {
      const n = typeof e[0] == "string" ? Ue.FromHex(e[0]) : e[0], r = new Xs(n);
      super(dB, e[1], Ce.serialize(r)), this.keyId = Ue.ToHex(n);
    }
  }
  toTextObject() {
    const e = this.toTextObjectWithoutValue(), n = Ce.parse(this.value, Xs);
    return e[""] = n, e;
  }
}
gf.NAME = "Subject Key Identifier";
class GB extends mi {
  constructor(...e) {
    Ie.isBufferSource(e[0]) ? super(e[0]) : super(o2, e[1], new lc(e[0] || []).rawData);
  }
  onInit(e) {
    super.onInit(e);
    const n = Ce.parse(e.extnValue, Jm);
    this.names = new lc(n);
  }
  toTextObject() {
    const e = this.toTextObjectWithoutValue(), n = this.names.toTextObject();
    for (const r in n)
      e[r] = n[r];
    return e;
  }
}
GB.NAME = "Subject Alternative Name";
class Pr {
  static register(e, n) {
    this.items.set(e, n);
  }
  static create(e) {
    const n = new mi(e), r = this.items.get(n.type);
    return r ? new r(e) : n;
  }
}
Pr.items = /* @__PURE__ */ new Map();
class qB extends mi {
  constructor(...e) {
    var n;
    if (Ie.isBufferSource(e[0])) {
      super(e[0]);
      const r = Ce.parse(this.value, Wm);
      this.policies = r.map((i) => i.policyIdentifier);
    } else {
      const r = e[0], i = (n = e[1]) !== null && n !== void 0 ? n : !1, o = new Wm(r.map((s) => new H0({ policyIdentifier: s })));
      super(sB, i, Ce.serialize(o)), this.policies = r;
    }
  }
  toTextObject() {
    const e = this.toTextObjectWithoutValue();
    return e.Policy = this.policies.map((n) => new It("", {}, _a.toString(n))), e;
  }
}
qB.NAME = "Certificate Policies";
Pr.register(sB, qB);
class _2 extends mi {
  constructor(...e) {
    var n;
    if (Ie.isBufferSource(e[0]))
      super(e[0]);
    else if (Array.isArray(e[0]) && typeof e[0][0] == "string") {
      const i = e[0].map((s) => new ml({
        distributionPoint: new rc({ fullName: [new ot({ uniformResourceIdentifier: s })] })
      })), o = new cu(i);
      super(IS, e[1], Ce.serialize(o));
    } else {
      const r = new cu(e[0]);
      super(IS, e[1], Ce.serialize(r));
    }
    (n = this.distributionPoints) !== null && n !== void 0 || (this.distributionPoints = []);
  }
  onInit(e) {
    super.onInit(e);
    const n = Ce.parse(e.extnValue, cu);
    this.distributionPoints = n;
  }
  toTextObject() {
    const e = this.toTextObjectWithoutValue();
    return e["Distribution Point"] = this.distributionPoints.map((n) => {
      var r;
      const i = {};
      return n.distributionPoint && (i[""] = (r = n.distributionPoint.fullName) === null || r === void 0 ? void 0 : r.map((o) => new Ks(o).toString()).join(", ")), n.reasons && (i.Reasons = n.reasons.toString()), n.cRLIssuer && (i["CRL Issuer"] = n.cRLIssuer.map((o) => o.toString()).join(", ")), i;
    }), e;
  }
}
_2.NAME = "CRL Distribution Points";
class HB extends mi {
  constructor(...e) {
    var n, r, i, o;
    if (Ie.isBufferSource(e[0]))
      super(e[0]);
    else if (e[0] instanceof nu) {
      const s = new nu(e[0]);
      super(xS, e[1], Ce.serialize(s));
    } else {
      const s = e[0], a = new nu();
      Dh(a, s, vP, "ocsp"), Dh(a, s, bP, "caIssuers"), Dh(a, s, xP, "timeStamping"), Dh(a, s, wP, "caRepository"), super(xS, e[1], Ce.serialize(a));
    }
    (n = this.ocsp) !== null && n !== void 0 || (this.ocsp = []), (r = this.caIssuers) !== null && r !== void 0 || (this.caIssuers = []), (i = this.timeStamping) !== null && i !== void 0 || (this.timeStamping = []), (o = this.caRepository) !== null && o !== void 0 || (this.caRepository = []);
  }
  onInit(e) {
    super.onInit(e), this.ocsp = [], this.caIssuers = [], this.timeStamping = [], this.caRepository = [], Ce.parse(e.extnValue, nu).forEach((r) => {
      switch (r.accessMethod) {
        case vP:
          this.ocsp.push(new Ks(r.accessLocation));
          break;
        case bP:
          this.caIssuers.push(new Ks(r.accessLocation));
          break;
        case xP:
          this.timeStamping.push(new Ks(r.accessLocation));
          break;
        case wP:
          this.caRepository.push(new Ks(r.accessLocation));
          break;
      }
    });
  }
  toTextObject() {
    const e = this.toTextObjectWithoutValue();
    return this.ocsp.length && Ph(e, "OCSP", this.ocsp), this.caIssuers.length && Ph(e, "CA Issuers", this.caIssuers), this.timeStamping.length && Ph(e, "Time Stamping", this.timeStamping), this.caRepository.length && Ph(e, "CA Repository", this.caRepository), e;
  }
}
HB.NAME = "Authority Info Access";
function Ph(t, e, n) {
  if (n.length === 1)
    t[e] = n[0].toTextObject();
  else {
    const r = new It("");
    n.forEach((i, o) => {
      const s = i.toTextObject(), a = `${s[It.NAME]} ${o + 1}`;
      let c = r[a];
      Array.isArray(c) || (c = [], r[a] = c), c.push(s);
    }), t[e] = r;
  }
}
function Dh(t, e, n, r) {
  const i = e[r];
  i && (Array.isArray(i) ? i : [i]).forEach((s) => {
    typeof s == "string" && (s = new Ks("url", s)), t.push(new rf({
      accessMethod: n,
      accessLocation: Ce.parse(s.rawData, ot)
    }));
  });
}
class WB extends mi {
  constructor(...e) {
    Ie.isBufferSource(e[0]) ? super(e[0]) : super(cB, e[1], new lc(e[0] || []).rawData);
  }
  onInit(e) {
    super.onInit(e);
    const n = Ce.parse(e.extnValue, gr);
    this.names = new lc(n);
  }
  toTextObject() {
    const e = this.toTextObjectWithoutValue(), n = this.names.toTextObject();
    for (const r in n)
      e[r] = n[r];
    return e;
  }
}
WB.NAME = "Issuer Alternative Name";
class Sl extends Ts {
  constructor(...e) {
    let n;
    if (Ie.isBufferSource(e[0]))
      n = Ie.toArrayBuffer(e[0]);
    else {
      const r = e[0], i = Array.isArray(e[1]) ? e[1].map((o) => Ie.toArrayBuffer(o)) : [];
      n = Ce.serialize(new ms({
        type: r,
        values: i
      }));
    }
    super(n, ms);
  }
  onInit(e) {
    this.type = e.type, this.values = e.values;
  }
  toTextObject() {
    const e = this.toTextObjectWithoutValue();
    return e.Value = this.values.map((n) => new It("", { "": n })), e;
  }
  toTextObjectWithoutValue() {
    const e = this.toTextObjectEmpty();
    return e[It.NAME] === Sl.NAME && (e[It.NAME] = _a.toString(this.type)), e;
  }
}
Sl.NAME = "Attribute";
class zB extends Sl {
  constructor(...e) {
    var n;
    if (Ie.isBufferSource(e[0]))
      super(e[0]);
    else {
      const r = new vg({ printableString: e[0] });
      super(OB, [Ce.serialize(r)]);
    }
    (n = this.password) !== null && n !== void 0 || (this.password = "");
  }
  onInit(e) {
    if (super.onInit(e), this.values[0]) {
      const n = Ce.parse(this.values[0], vg);
      this.password = n.toString();
    }
  }
  toTextObject() {
    const e = this.toTextObjectWithoutValue();
    return e[It.VALUE] = this.password, e;
  }
}
zB.NAME = "Challenge Password";
class E2 extends Sl {
  constructor(...e) {
    var n;
    if (Ie.isBufferSource(e[0]))
      super(e[0]);
    else {
      const r = e[0], i = new ic();
      for (const o of r)
        i.push(Ce.parse(o.rawData, co));
      super(S2, [Ce.serialize(i)]);
    }
    (n = this.items) !== null && n !== void 0 || (this.items = []);
  }
  onInit(e) {
    if (super.onInit(e), this.values[0]) {
      const n = Ce.parse(this.values[0], ic);
      this.items = n.map((r) => Pr.create(Ce.serialize(r)));
    }
  }
  toTextObject() {
    const e = this.toTextObjectWithoutValue(), n = this.items.map((r) => r.toTextObject());
    for (const r of n)
      e[r[It.NAME]] = r;
    return e;
  }
}
E2.NAME = "Extensions";
class gy {
  static register(e, n) {
    this.items.set(e, n);
  }
  static create(e) {
    const n = new Sl(e), r = this.items.get(n.type);
    return r ? new r(e) : n;
  }
}
gy.items = /* @__PURE__ */ new Map();
const yf = "crypto.signatureFormatter";
class zpe {
  toAsnSignature(e, n) {
    return Ie.toArrayBuffer(n);
  }
  toWebSignature(e, n) {
    return Ie.toArrayBuffer(n);
  }
}
var um;
let A_ = um = class {
  static createPssParams(e, n) {
    const r = um.getHashAlgorithm(e);
    return r ? new ac({
      hashAlgorithm: r,
      maskGenAlgorithm: new Fe({
        algorithm: sy,
        parameters: Ce.serialize(r)
      }),
      saltLength: n
    }) : null;
  }
  static getHashAlgorithm(e) {
    const n = lr.resolve(cc);
    return typeof e == "string" ? n.toAsnAlgorithm({ name: e }) : typeof e == "object" && e && "name" in e ? n.toAsnAlgorithm(e) : null;
  }
  toAsnAlgorithm(e) {
    switch (e.name.toLowerCase()) {
      case "rsassa-pkcs1-v1_5":
        if ("hash" in e) {
          let n;
          if (typeof e.hash == "string")
            n = e.hash;
          else if (e.hash && typeof e.hash == "object" && "name" in e.hash && typeof e.hash.name == "string")
            n = e.hash.name.toUpperCase();
          else
            throw new Error("Cannot get hash algorithm name");
          switch (n.toLowerCase()) {
            case "sha-1":
              return new Fe({
                algorithm: ug,
                parameters: null
              });
            case "sha-256":
              return new Fe({
                algorithm: n_,
                parameters: null
              });
            case "sha-384":
              return new Fe({
                algorithm: lg,
                parameters: null
              });
            case "sha-512":
              return new Fe({
                algorithm: pg,
                parameters: null
              });
          }
        } else
          return new Fe({
            algorithm: ia,
            parameters: null
          });
        break;
      case "rsa-pss":
        if ("hash" in e) {
          if (!("saltLength" in e && typeof e.saltLength == "number"))
            throw new Error("Cannot get 'saltLength' from 'alg' argument");
          const n = um.createPssParams(e.hash, e.saltLength);
          if (!n)
            throw new Error("Cannot create PSS parameters");
          return new Fe({
            algorithm: Qp,
            parameters: Ce.serialize(n)
          });
        } else
          return new Fe({
            algorithm: Qp,
            parameters: null
          });
    }
    return null;
  }
  toWebAlgorithm(e) {
    switch (e.algorithm) {
      case ia:
        return { name: "RSASSA-PKCS1-v1_5" };
      case ug:
        return {
          name: "RSASSA-PKCS1-v1_5",
          hash: { name: "SHA-1" }
        };
      case n_:
        return {
          name: "RSASSA-PKCS1-v1_5",
          hash: { name: "SHA-256" }
        };
      case lg:
        return {
          name: "RSASSA-PKCS1-v1_5",
          hash: { name: "SHA-384" }
        };
      case pg:
        return {
          name: "RSASSA-PKCS1-v1_5",
          hash: { name: "SHA-512" }
        };
      case Qp:
        if (e.parameters) {
          const n = Ce.parse(e.parameters, ac);
          return {
            name: "RSA-PSS",
            hash: lr.resolve(cc).toWebAlgorithm(n.hashAlgorithm),
            saltLength: n.saltLength
          };
        } else
          return { name: "RSA-PSS" };
    }
    return null;
  }
};
A_ = um = R([
  py()
], A_);
lr.registerSingleton(mf, A_);
let I_ = class {
  toAsnAlgorithm(e) {
    switch (e.name.toLowerCase()) {
      case "sha-1":
        return new Fe({ algorithm: dg });
      case "sha-256":
        return new Fe({ algorithm: fg });
      case "sha-384":
        return new Fe({ algorithm: hg });
      case "sha-512":
        return new Fe({ algorithm: mg });
    }
    return null;
  }
  toWebAlgorithm(e) {
    switch (e.algorithm) {
      case dg:
        return { name: "SHA-1" };
      case fg:
        return { name: "SHA-256" };
      case hg:
        return { name: "SHA-384" };
      case mg:
        return { name: "SHA-512" };
    }
    return null;
  }
};
I_ = R([
  py()
], I_);
lr.registerSingleton(mf, I_);
class Ei {
  addPadding(e, n) {
    const r = Ie.toUint8Array(n), i = new Uint8Array(e);
    return i.set(r, e - r.length), i.buffer;
  }
  removePadding(e, n = !1) {
    let r = Ie.toUint8Array(e);
    for (let i = 0; i < r.length; i++)
      if (r[i]) {
        r = r.slice(i);
        break;
      }
    if (n && r[0] > 127) {
      const i = new Uint8Array(r.length + 1);
      return i.set(r, 1), i.buffer;
    }
    return r.buffer;
  }
  toAsnSignature(e, n) {
    if (e.name === "ECDSA") {
      const r = e.namedCurve, i = Ei.namedCurveSize.get(r) || Ei.defaultNamedCurveSize, o = new hd(), s = Ie.toUint8Array(n);
      return o.r = this.removePadding(s.slice(0, i), !0), o.s = this.removePadding(s.slice(i, i + i), !0), Ce.serialize(o);
    }
    return null;
  }
  toWebSignature(e, n) {
    if (e.name === "ECDSA") {
      const r = Ce.parse(n, hd), i = e.namedCurve, o = Ei.namedCurveSize.get(i) || Ei.defaultNamedCurveSize, s = this.addPadding(o, this.removePadding(r.r)), a = this.addPadding(o, this.removePadding(r.s));
      return Zue(s, a);
    }
    return null;
  }
}
Ei.namedCurveSize = /* @__PURE__ */ new Map();
Ei.defaultNamedCurveSize = 32;
const Yx = "1.3.101.110", BD = "1.3.101.111", Jx = "1.3.101.112", UD = "1.3.101.113";
let C_ = class {
  toAsnAlgorithm(e) {
    let n = null;
    switch (e.name.toLowerCase()) {
      case "ed25519":
        n = Jx;
        break;
      case "x25519":
        n = Yx;
        break;
      case "eddsa":
        switch (e.namedCurve.toLowerCase()) {
          case "ed25519":
            n = Jx;
            break;
          case "ed448":
            n = UD;
            break;
        }
        break;
      case "ecdh-es":
        switch (e.namedCurve.toLowerCase()) {
          case "x25519":
            n = Yx;
            break;
          case "x448":
            n = BD;
            break;
        }
    }
    return n ? new Fe({ algorithm: n }) : null;
  }
  toWebAlgorithm(e) {
    switch (e.algorithm) {
      case Jx:
        return { name: "Ed25519" };
      case UD:
        return {
          name: "EdDSA",
          namedCurve: "Ed448"
        };
      case Yx:
        return { name: "X25519" };
      case BD:
        return {
          name: "ECDH-ES",
          namedCurve: "X448"
        };
    }
    return null;
  }
};
C_ = R([
  py()
], C_);
lr.registerSingleton(mf, C_);
var Zl, ep, tp, np, rp, ip, op, Gc;
class Kpe extends lo {
  get subjectName() {
    return Re(this, ep, "f") || pt(this, ep, new oa(this.asn.certificationRequestInfo.subject), "f"), Re(this, ep, "f");
  }
  get subject() {
    return Re(this, tp, "f") || pt(this, tp, this.subjectName.toString(), "f"), Re(this, tp, "f");
  }
  get signatureAlgorithm() {
    if (!Re(this, np, "f")) {
      const e = lr.resolve(cc);
      pt(this, np, e.toWebAlgorithm(this.asn.signatureAlgorithm), "f");
    }
    return Re(this, np, "f");
  }
  get signature() {
    return Re(this, rp, "f") || pt(this, rp, this.asn.signature, "f"), Re(this, rp, "f");
  }
  get publicKey() {
    return Re(this, ip, "f") || pt(this, ip, new Ki(this.asn.certificationRequestInfo.subjectPKInfo), "f"), Re(this, ip, "f");
  }
  get attributes() {
    return Re(this, op, "f") || pt(this, op, this.asn.certificationRequestInfo.attributes.map((e) => gy.create(Ce.serialize(e))), "f"), Re(this, op, "f");
  }
  get extensions() {
    if (!Re(this, Gc, "f")) {
      pt(this, Gc, [], "f");
      const e = this.getAttribute(S2);
      e instanceof E2 && pt(this, Gc, e.items, "f");
    }
    return Re(this, Gc, "f");
  }
  get tbs() {
    return Re(this, Zl, "f") || pt(this, Zl, this.asn.certificationRequestInfoRaw || Ce.serialize(this.asn.certificationRequestInfo), "f"), Re(this, Zl, "f");
  }
  constructor(e) {
    const n = lo.isAsnEncoded(e) ? [e, md] : [e];
    super(n[0], n[1]), Zl.set(this, void 0), ep.set(this, void 0), tp.set(this, void 0), np.set(this, void 0), rp.set(this, void 0), ip.set(this, void 0), op.set(this, void 0), Gc.set(this, void 0), this.tag = Br.CertificateRequestTag;
  }
  onInit(e) {
  }
  getAttribute(e) {
    for (const n of this.attributes)
      if (n.type === e)
        return n;
    return null;
  }
  getAttributes(e) {
    return this.attributes.filter((n) => n.type === e);
  }
  getExtension(e) {
    for (const n of this.extensions)
      if (n.type === e)
        return n;
    return null;
  }
  getExtensions(e) {
    return this.extensions.filter((n) => n.type === e);
  }
  async verify(e = $n.get()) {
    const n = {
      ...this.publicKey.algorithm,
      ...this.signatureAlgorithm
    }, r = await this.publicKey.export(n, ["verify"], e), i = lr.resolveAll(yf).reverse();
    let o = null;
    for (const a of i)
      if (o = a.toWebSignature(n, this.signature), o)
        break;
    if (!o)
      throw Error("Cannot convert WebCrypto signature value to ASN.1 format");
    return await e.subtle.verify(this.signatureAlgorithm, r, o, this.tbs);
  }
  toTextObject() {
    const e = this.toTextObjectEmpty(), n = Ce.parse(this.rawData, md), r = n.certificationRequestInfo, i = new It("", {
      Version: `${Cu[r.version]} (${r.version})`,
      Subject: this.subject,
      "Subject Public Key Info": this.publicKey
    });
    if (this.attributes.length) {
      const o = new It("");
      for (const s of this.attributes) {
        const a = s.toTextObject();
        o[a[It.NAME]] = a;
      }
      i.Attributes = o;
    }
    return e.Data = i, e.Signature = new It("", {
      Algorithm: uc.serializeAlgorithm(n.signatureAlgorithm),
      "": n.signature
    }), e;
  }
}
Zl = /* @__PURE__ */ new WeakMap(), ep = /* @__PURE__ */ new WeakMap(), tp = /* @__PURE__ */ new WeakMap(), np = /* @__PURE__ */ new WeakMap(), rp = /* @__PURE__ */ new WeakMap(), ip = /* @__PURE__ */ new WeakMap(), op = /* @__PURE__ */ new WeakMap(), Gc = /* @__PURE__ */ new WeakMap();
Kpe.NAME = "PKCS#10 Certificate Request";
var sp, ap, cp, up, lp, pp, dp, fp, hp, mp, qc, gp;
class xg extends lo {
  get publicKey() {
    return Re(this, gp, "f") || pt(this, gp, new Ki(this.asn.tbsCertificate.subjectPublicKeyInfo), "f"), Re(this, gp, "f");
  }
  get serialNumber() {
    if (!Re(this, ap, "f")) {
      const e = this.asn.tbsCertificate;
      let n = new Uint8Array(e.serialNumber);
      n.length > 1 && n[0] === 0 && n[1] > 127 && (n = n.slice(1)), pt(this, ap, Ue.ToHex(n), "f");
    }
    return Re(this, ap, "f");
  }
  get subjectName() {
    return Re(this, cp, "f") || pt(this, cp, new oa(this.asn.tbsCertificate.subject), "f"), Re(this, cp, "f");
  }
  get subject() {
    return Re(this, up, "f") || pt(this, up, this.subjectName.toString(), "f"), Re(this, up, "f");
  }
  get issuerName() {
    return Re(this, lp, "f") || pt(this, lp, new oa(this.asn.tbsCertificate.issuer), "f"), Re(this, lp, "f");
  }
  get issuer() {
    return Re(this, pp, "f") || pt(this, pp, this.issuerName.toString(), "f"), Re(this, pp, "f");
  }
  get notBefore() {
    if (!Re(this, dp, "f")) {
      const e = this.asn.tbsCertificate.validity.notBefore.utcTime || this.asn.tbsCertificate.validity.notBefore.generalTime;
      if (!e)
        throw new Error("Cannot get 'notBefore' value");
      pt(this, dp, e, "f");
    }
    return Re(this, dp, "f");
  }
  get notAfter() {
    if (!Re(this, fp, "f")) {
      const e = this.asn.tbsCertificate.validity.notAfter.utcTime || this.asn.tbsCertificate.validity.notAfter.generalTime;
      if (!e)
        throw new Error("Cannot get 'notAfter' value");
      pt(this, fp, e, "f");
    }
    return Re(this, fp, "f");
  }
  get signatureAlgorithm() {
    if (!Re(this, hp, "f")) {
      const e = lr.resolve(cc);
      pt(this, hp, e.toWebAlgorithm(this.asn.signatureAlgorithm), "f");
    }
    return Re(this, hp, "f");
  }
  get signature() {
    return Re(this, mp, "f") || pt(this, mp, this.asn.signatureValue, "f"), Re(this, mp, "f");
  }
  get extensions() {
    return Re(this, qc, "f") || (pt(this, qc, [], "f"), this.asn.tbsCertificate.extensions && pt(this, qc, this.asn.tbsCertificate.extensions.map((e) => Pr.create(Ce.serialize(e))), "f")), Re(this, qc, "f");
  }
  get tbs() {
    return Re(this, sp, "f") || pt(this, sp, this.asn.tbsCertificateRaw || Ce.serialize(this.asn.tbsCertificate), "f"), Re(this, sp, "f");
  }
  constructor(e) {
    const n = lo.isAsnEncoded(e) ? [e, uo] : [e];
    super(n[0], n[1]), sp.set(this, void 0), ap.set(this, void 0), cp.set(this, void 0), up.set(this, void 0), lp.set(this, void 0), pp.set(this, void 0), dp.set(this, void 0), fp.set(this, void 0), hp.set(this, void 0), mp.set(this, void 0), qc.set(this, void 0), gp.set(this, void 0), this.tag = Br.CertificateTag;
  }
  onInit(e) {
  }
  getExtension(e) {
    for (const n of this.extensions)
      if (typeof e == "string") {
        if (n.type === e)
          return n;
      } else if (n instanceof e)
        return n;
    return null;
  }
  getExtensions(e) {
    return this.extensions.filter((n) => typeof e == "string" ? n.type === e : n instanceof e);
  }
  async verify(e = {}, n = $n.get()) {
    let r, i;
    const o = e.publicKey;
    try {
      if (!o)
        r = {
          ...this.publicKey.algorithm,
          ...this.signatureAlgorithm
        }, i = await this.publicKey.export(r, ["verify"], n);
      else if ("publicKey" in o)
        r = {
          ...o.publicKey.algorithm,
          ...this.signatureAlgorithm
        }, i = await o.publicKey.export(r, ["verify"], n);
      else if (o instanceof Ki)
        r = {
          ...o.algorithm,
          ...this.signatureAlgorithm
        }, i = await o.export(r, ["verify"], n);
      else if (Ie.isBufferSource(o)) {
        const u = new Ki(o);
        r = {
          ...u.algorithm,
          ...this.signatureAlgorithm
        }, i = await u.export(r, ["verify"], n);
      } else
        r = {
          ...o.algorithm,
          ...this.signatureAlgorithm
        }, i = o;
    } catch {
      return !1;
    }
    const s = lr.resolveAll(yf).reverse();
    let a = null;
    for (const u of s)
      if (a = u.toWebSignature(r, this.signature), a)
        break;
    if (!a)
      throw Error("Cannot convert ASN.1 signature value to WebCrypto format");
    const c = await n.subtle.verify(this.signatureAlgorithm, i, a, this.tbs);
    if (e.signatureOnly)
      return c;
    {
      const l = (e.date || /* @__PURE__ */ new Date()).getTime();
      return c && this.notBefore.getTime() < l && l < this.notAfter.getTime();
    }
  }
  async getThumbprint(...e) {
    let n, r = "SHA-1";
    return e[0] && (e[0].subtle ? n = e[0] : (r = e[0] || r, n = e[1])), n ?? (n = $n.get()), await n.subtle.digest(r, this.rawData);
  }
  async isSelfSigned(e = $n.get()) {
    return this.subject === this.issuer && await this.verify({ signatureOnly: !0 }, e);
  }
  toTextObject() {
    const e = this.toTextObjectEmpty(), n = Ce.parse(this.rawData, uo), r = n.tbsCertificate, i = new It("", {
      Version: `${Cu[r.version]} (${r.version})`,
      "Serial Number": r.serialNumber,
      "Signature Algorithm": uc.serializeAlgorithm(r.signature),
      Issuer: this.issuer,
      Validity: new It("", {
        "Not Before": r.validity.notBefore.getTime(),
        "Not After": r.validity.notAfter.getTime()
      }),
      Subject: this.subject,
      "Subject Public Key Info": this.publicKey
    });
    if (r.issuerUniqueID && (i["Issuer Unique ID"] = r.issuerUniqueID), r.subjectUniqueID && (i["Subject Unique ID"] = r.subjectUniqueID), this.extensions.length) {
      const o = new It("");
      for (const s of this.extensions) {
        const a = s.toTextObject();
        o[a[It.NAME]] = a;
      }
      i.Extensions = o;
    }
    return e.Data = i, e.Signature = new It("", {
      Algorithm: uc.serializeAlgorithm(n.signatureAlgorithm),
      "": n.signatureValue
    }), e;
  }
}
sp = /* @__PURE__ */ new WeakMap(), ap = /* @__PURE__ */ new WeakMap(), cp = /* @__PURE__ */ new WeakMap(), up = /* @__PURE__ */ new WeakMap(), lp = /* @__PURE__ */ new WeakMap(), pp = /* @__PURE__ */ new WeakMap(), dp = /* @__PURE__ */ new WeakMap(), fp = /* @__PURE__ */ new WeakMap(), hp = /* @__PURE__ */ new WeakMap(), mp = /* @__PURE__ */ new WeakMap(), qc = /* @__PURE__ */ new WeakMap(), gp = /* @__PURE__ */ new WeakMap();
xg.NAME = "Certificate";
function KB(t, e = $n.get()) {
  const n = Ie.toUint8Array(Ue.FromHex(t || ""));
  let r = n && n.length && n.some((o) => o > 0) ? new Uint8Array(n) : void 0;
  r || (r = e.getRandomValues(new Uint8Array(16)));
  let i = 0;
  for (; i < r.length - 1 && r[i] === 0; )
    i++;
  if (r = r.slice(i), r[0] > 127) {
    const o = new Uint8Array(r.length + 1);
    o[0] = 0, o.set(r, 1), r = o;
  }
  return r.buffer;
}
var yp, vp, Hc, Wc, zc, LD;
(function(t) {
  t[t.unspecified = 0] = "unspecified", t[t.keyCompromise = 1] = "keyCompromise", t[t.cACompromise = 2] = "cACompromise", t[t.affiliationChanged = 3] = "affiliationChanged", t[t.superseded = 4] = "superseded", t[t.cessationOfOperation = 5] = "cessationOfOperation", t[t.certificateHold = 6] = "certificateHold", t[t.removeFromCRL = 8] = "removeFromCRL", t[t.privilegeWithdrawn = 9] = "privilegeWithdrawn", t[t.aACompromise = 10] = "aACompromise";
})(LD || (LD = {}));
class jD extends Ts {
  get serialNumber() {
    return Re(this, yp, "f") || pt(this, yp, Ue.ToHex(this.asn.userCertificate), "f"), Re(this, yp, "f");
  }
  get revocationDate() {
    return Re(this, vp, "f") || pt(this, vp, this.asn.revocationDate.getTime(), "f"), Re(this, vp, "f");
  }
  get reason() {
    return Re(this, Hc, "f") === void 0 && this.extensions, Re(this, Hc, "f");
  }
  get invalidity() {
    return Re(this, Wc, "f") === void 0 && this.extensions, Re(this, Wc, "f");
  }
  get extensions() {
    return Re(this, zc, "f") || (pt(this, zc, [], "f"), this.asn.crlEntryExtensions && pt(this, zc, this.asn.crlEntryExtensions.map((e) => {
      const n = Pr.create(Ce.serialize(e));
      switch (n.type) {
        case qle:
          Re(this, Hc, "f") === void 0 && pt(this, Hc, Ce.parse(n.value, Km).reason, "f");
          break;
        case Jle:
          Re(this, Wc, "f") === void 0 && pt(this, Wc, Ce.parse(n.value, Vm).value, "f");
          break;
      }
      return n;
    }), "f")), Re(this, zc, "f");
  }
  constructor(...e) {
    let n;
    if (Ie.isBufferSource(e[0]) ? n = Ie.toArrayBuffer(e[0]) : typeof e[0] == "string" ? n = Ce.serialize(new za({
      userCertificate: KB(e[0]),
      revocationDate: new Hn(e[1]),
      crlEntryExtensions: e[2]
    })) : e[0] instanceof za && (n = e[0]), !n)
      throw new TypeError("Cannot create X509CrlEntry instance. Wrong constructor arguments.");
    super(n, za), yp.set(this, void 0), vp.set(this, void 0), Hc.set(this, void 0), Wc.set(this, void 0), zc.set(this, void 0);
  }
  onInit(e) {
  }
}
yp = /* @__PURE__ */ new WeakMap(), vp = /* @__PURE__ */ new WeakMap(), Hc = /* @__PURE__ */ new WeakMap(), Wc = /* @__PURE__ */ new WeakMap(), zc = /* @__PURE__ */ new WeakMap();
var bp, xp, wp, Sp, _p, Ep, Kc;
class Vpe extends lo {
  get version() {
    return this.asn.tbsCertList.version;
  }
  get signatureAlgorithm() {
    if (!Re(this, xp, "f")) {
      const e = lr.resolve(cc);
      pt(this, xp, e.toWebAlgorithm(this.asn.signatureAlgorithm), "f");
    }
    return Re(this, xp, "f");
  }
  get signature() {
    return this.asn.signature;
  }
  get issuer() {
    return this.issuerName.toString();
  }
  get issuerName() {
    return Re(this, wp, "f") || pt(this, wp, new oa(this.asn.tbsCertList.issuer), "f"), Re(this, wp, "f");
  }
  get thisUpdate() {
    if (!Re(this, Sp, "f")) {
      const e = this.asn.tbsCertList.thisUpdate.getTime();
      if (!e)
        throw new Error("Cannot get 'thisUpdate' value");
      pt(this, Sp, e, "f");
    }
    return Re(this, Sp, "f");
  }
  get nextUpdate() {
    var e;
    return Re(this, _p, "f") === void 0 && pt(this, _p, ((e = this.asn.tbsCertList.nextUpdate) === null || e === void 0 ? void 0 : e.getTime()) || void 0, "f"), Re(this, _p, "f");
  }
  get entries() {
    var e;
    return Re(this, Ep, "f") || pt(this, Ep, ((e = this.asn.tbsCertList.revokedCertificates) === null || e === void 0 ? void 0 : e.map((n) => new jD(n))) || [], "f"), Re(this, Ep, "f");
  }
  get extensions() {
    return Re(this, Kc, "f") || (pt(this, Kc, [], "f"), this.asn.tbsCertList.crlExtensions && pt(this, Kc, this.asn.tbsCertList.crlExtensions.map((e) => Pr.create(Ce.serialize(e))), "f")), Re(this, Kc, "f");
  }
  get tbs() {
    return Re(this, bp, "f") || pt(this, bp, this.asn.tbsCertListRaw || Ce.serialize(this.asn.tbsCertList), "f"), Re(this, bp, "f");
  }
  get tbsCertListSignatureAlgorithm() {
    return this.asn.tbsCertList.signature;
  }
  get certListSignatureAlgorithm() {
    return this.asn.signatureAlgorithm;
  }
  constructor(e) {
    super(e, lo.isAsnEncoded(e) ? K0 : void 0), this.tag = Br.CrlTag, bp.set(this, void 0), xp.set(this, void 0), wp.set(this, void 0), Sp.set(this, void 0), _p.set(this, void 0), Ep.set(this, void 0), Kc.set(this, void 0);
  }
  onInit(e) {
  }
  getExtension(e) {
    for (const n of this.extensions)
      if (typeof e == "string") {
        if (n.type === e)
          return n;
      } else if (n instanceof e)
        return n;
    return null;
  }
  getExtensions(e) {
    return this.extensions.filter((n) => typeof e == "string" ? n.type === e : n instanceof e);
  }
  async verify(e, n = $n.get()) {
    if (!this.certListSignatureAlgorithm.isEqual(this.tbsCertListSignatureAlgorithm))
      throw new Error("algorithm identifier in the sequence tbsCertList and CertificateList mismatch");
    let r, i;
    const o = e.publicKey;
    try {
      o instanceof xg ? (r = {
        ...o.publicKey.algorithm,
        ...o.signatureAlgorithm
      }, i = await o.publicKey.export(r, ["verify"])) : o instanceof Ki ? (r = {
        ...o.algorithm,
        ...this.signatureAlgorithm
      }, i = await o.export(r, ["verify"])) : (r = {
        ...o.algorithm,
        ...this.signatureAlgorithm
      }, i = o);
    } catch {
      return !1;
    }
    const s = lr.resolveAll(yf).reverse();
    let a = null;
    for (const c of s)
      if (a = c.toWebSignature(r, this.signature), a)
        break;
    if (!a)
      throw Error("Cannot convert ASN.1 signature value to WebCrypto format");
    return await n.subtle.verify(this.signatureAlgorithm, i, a, this.tbs);
  }
  async getThumbprint(...e) {
    let n, r = "SHA-1";
    return e[0] && (e[0].subtle ? n = e[0] : (r = e[0] || r, n = e[1])), n ?? (n = $n.get()), await n.subtle.digest(r, this.rawData);
  }
  findRevoked(e) {
    const n = typeof e == "string" ? e : e.serialNumber, r = KB(n);
    for (const i of this.asn.tbsCertList.revokedCertificates || [])
      if (Ie.isEqual(i.userCertificate, r))
        return new jD(Ce.serialize(i));
    return null;
  }
}
bp = /* @__PURE__ */ new WeakMap(), xp = /* @__PURE__ */ new WeakMap(), wp = /* @__PURE__ */ new WeakMap(), Sp = /* @__PURE__ */ new WeakMap(), _p = /* @__PURE__ */ new WeakMap(), Ep = /* @__PURE__ */ new WeakMap(), Kc = /* @__PURE__ */ new WeakMap();
Pr.register(ZA, jB);
Pr.register(r2, QB);
Pr.register(uB, $B);
Pr.register(dB, gf);
Pr.register(wS, Bu);
Pr.register(o2, GB);
Pr.register(IS, _2);
Pr.register(xS, HB);
Pr.register(cB, WB);
gy.register(OB, zB);
gy.register(S2, E2);
lr.registerSingleton(yf, zpe);
lr.registerSingleton(yf, Ei);
Ei.namedCurveSize.set("P-256", 32);
Ei.namedCurveSize.set("K-256", 32);
Ei.namedCurveSize.set("P-384", 48);
Ei.namedCurveSize.set("P-521", 66);
function VB(t) {
  return Ype.stubThis(t);
}
const Ype = {
  stubThis: (t) => globalThis.fetch(t)
}, QD = {};
async function Jpe(t) {
  const { extensions: e } = t;
  if (!e)
    return !1;
  let n, r, i;
  e.forEach((d) => {
    d instanceof Bu ? n = d : d instanceof gf ? r = d : d instanceof _2 && (i = d);
  });
  let o;
  if (n && n.keyId ? o = n.keyId : r && (o = r.keyId), o) {
    const d = QD[o];
    if (d) {
      const f = /* @__PURE__ */ new Date();
      if (!d.nextUpdate || d.nextUpdate > f)
        return d.revokedCerts.indexOf(t.serialNumber) >= 0;
    }
  }
  const s = i?.distributionPoints?.[0].distributionPoint?.fullName?.[0].uniformResourceIdentifier;
  if (!s)
    return !1;
  let a;
  try {
    a = await (await VB(s)).arrayBuffer();
  } catch {
    return !1;
  }
  let c;
  try {
    c = new Vpe(a);
  } catch {
    return !1;
  }
  const u = {
    revokedCerts: [],
    nextUpdate: void 0
  };
  c.nextUpdate && (u.nextUpdate = c.nextUpdate);
  const l = c.entries;
  if (l) {
    for (const d of l) {
      const f = d.serialNumber;
      u.revokedCerts.push(f);
    }
    return o && (QD[o] = u), u.revokedCerts.indexOf(t.serialNumber) >= 0;
  }
  return !1;
}
function Xpe(t) {
  let e;
  try {
    e = _u(t);
  } catch (n) {
    const r = n;
    throw new Error(`Error decoding authenticator extensions: ${r.message}`);
  }
  return YB(e);
}
function YB(t) {
  const e = {};
  for (const [n, r] of t)
    r instanceof Map ? e[n] = YB(r) : e[n] = r;
  return e;
}
function JB(t) {
  if (t.byteLength < 37)
    throw new Error(`Authenticator data was ${t.byteLength} bytes, expected at least 37 bytes`);
  let e = 0;
  const n = Sg(t), r = t.slice(e, e += 32), i = t.slice(e, e += 1), o = i[0], s = {
    up: !!(o & 1),
    // User Presence
    uv: !!(o & 4),
    // User Verified
    be: !!(o & 8),
    // Backup Eligibility
    bs: !!(o & 16),
    // Backup State
    at: !!(o & 64),
    // Attested Credential Data Present
    ed: !!(o & 128),
    // Extension Data Present
    flagsInt: o
  }, a = t.slice(e, e + 4), c = n.getUint32(e, !1);
  e += 4;
  let u, l, d;
  if (s.at) {
    u = t.slice(e, e += 16);
    const h = n.getUint16(e);
    e += 2, l = t.slice(e, e += h);
    const y = ode("a301634f4b500327206745643235353139"), x = t.slice(e, e + y.byteLength);
    let g = !1;
    Hi(y, x) && (g = !0, t[e] = 164);
    const v = _u(t.slice(e)), S = Uint8Array.from(
      /**
       * Casting to `Map` via `as unknown` here because TS doesn't make it possible to define Maps
       * with discrete keys and properties with known types per pair, and CBOR libs typically parse
       * CBOR Major Type 5 to `Map` because you can have numbers for keys. A `COSEPublicKey` can be
       * generalized as "a Map with numbers for keys and either numbers or bytes for values" though.
       * If this presumption falls apart then other parts of verification later on will fail so we
       * should be safe doing this here.
       */
      lP(v)
    );
    g && (t[e] = 163), d = S, e += S.byteLength;
  }
  let f, m;
  if (s.ed) {
    const h = _u(t.slice(e));
    m = Uint8Array.from(lP(h)), f = Xpe(m), e += m.byteLength;
  }
  if (t.byteLength > e)
    throw new Error("Leftover bytes detected while parsing authenticator data");
  return Zpe.stubThis({
    rpIdHash: r,
    flagsBuf: i,
    flags: s,
    counter: c,
    counterBuf: a,
    aaguid: u,
    credentialID: l,
    credentialPublicKey: d,
    extensionsData: f,
    extensionsDataBuffer: m
  });
}
const Zpe = {
  stubThis: (t) => t
};
function pc(t, e = -7) {
  return typeof t == "string" && (t = vf(t)), $ue(t, e);
}
async function Ea(t, e = []) {
  if (e.length === 0)
    return !0;
  const n = await Tc(), r = t.map((a) => new xg(a));
  for (let a = 0; a < r.length; a++) {
    const c = r[a], u = t[a];
    try {
      await $D(c);
    } catch {
      throw new Error(`Found revoked certificate in x5c:
${u}`);
    }
    try {
      GD(c.notBefore, c.notAfter);
    } catch {
      throw new Error(`Found certificate out of validity period in x5c:
${u}`);
    }
  }
  const i = e.map((a) => {
    try {
      return new xg(a);
    } catch (c) {
      const u = c;
      throw new Error(`Could not parse trust anchor certificate:
${a}`, { cause: u });
    }
  }), o = [];
  for (let a = 0; a < i.length; a++) {
    const c = i[a];
    try {
      await $D(c);
    } catch {
      continue;
    }
    try {
      GD(c.notBefore, c.notAfter);
    } catch {
      continue;
    }
    o.push(c);
  }
  if (o.length === 0)
    throw new Error("No specified trust anchor was valid for verifying x5c");
  let s = !1;
  for (const a of i)
    try {
      const c = r.concat([a]);
      if (new Set(c).size !== c.length)
        throw new Error("Invalid certificate path: found duplicate certificates");
      for (let u = 0; u < c.length - 1; u++) {
        const l = c[u], d = c[u + 1];
        if (!await l.verify({ publicKey: d.publicKey, signatureOnly: !0 }, n))
          throw new Fh();
        if (d.subject === d.issuer) {
          if (!await d.verify({ publicKey: d.publicKey, signatureOnly: !0 }, n))
            throw new Fh();
          break;
        }
      }
      s = !1;
      break;
    } catch (c) {
      if (c instanceof Fh)
        s = !0;
      else
        throw new Error("Unexpected error while validating certificate path", { cause: c });
    }
  if (s)
    throw new Fh();
  return !0;
}
async function $D(t) {
  if (await Jpe(t))
    throw new Error("Found revoked certificate in certificate path");
}
function GD(t, e) {
  const n = new Date(Date.now());
  if (t > n || e < n)
    throw new Error("Certificate is not yet valid or expired");
}
class Fh extends Error {
  constructor() {
    super("Subject issuer did not match issuer subject"), this.name = "InvalidSubjectAndIssuer";
  }
}
function qD(t) {
  let e;
  if (t === "1.2.840.10045.4.3.2")
    e = ft.ES256;
  else if (t === "1.2.840.10045.4.3.3")
    e = ft.ES384;
  else if (t === "1.2.840.10045.4.3.4")
    e = ft.ES512;
  else if (t === "1.2.840.113549.1.1.11")
    e = ft.RS256;
  else if (t === "1.2.840.113549.1.1.12")
    e = ft.RS384;
  else if (t === "1.2.840.113549.1.1.13")
    e = ft.RS512;
  else if (t === "1.2.840.113549.1.1.5")
    e = ft.RS1;
  else
    throw new Error(`Unable to map X.509 signature algorithm ${t} to a COSE algorithm`);
  return e;
}
function XB(t) {
  let e = /* @__PURE__ */ new Map();
  const n = Qr.parse(t, uo), { tbsCertificate: r } = n, { subjectPublicKeyInfo: i, signature: o } = r, s = o.algorithm, a = i.algorithm.algorithm;
  if (a === Ou) {
    if (!i.algorithm.parameters)
      throw new Error("Certificate public key was missing parameters (EC2)");
    const c = Qr.parse(new Uint8Array(i.algorithm.parameters), vs);
    let u = -999;
    const { namedCurve: l } = c;
    if (l === ZS)
      u = Ii.P256;
    else if (l === e_)
      u = Ii.P384;
    else
      throw new Error(`Certificate public key contained unexpected namedCurve ${l} (EC2)`);
    const d = new Uint8Array(i.subjectPublicKey);
    let f, m;
    if (d[0] === 4) {
      let y = 1;
      const x = (d.length - 1) / 2;
      f = d.slice(y, y += x), m = d.slice(y);
    } else
      throw new Error('TODO: Figure out how to handle public keys in "compressed form"');
    const h = /* @__PURE__ */ new Map();
    h.set(ut.kty, so.EC2), h.set(ut.alg, qD(s)), h.set(ut.crv, u), h.set(ut.x, f), h.set(ut.y, m), e = h;
  } else if (a === ia) {
    const c = Qr.parse(i.subjectPublicKey, ly), u = /* @__PURE__ */ new Map();
    u.set(ut.kty, so.RSA), u.set(ut.alg, qD(s)), u.set(ut.n, new Uint8Array(c.modulus)), u.set(ut.e, new Uint8Array(c.publicExponent)), e = u;
  } else
    throw new Error(`Certificate public key contained unexpected algorithm ID ${a}`);
  return e;
}
function dc(t) {
  const { signature: e, data: n, credentialPublicKey: r, x509Certificate: i, hashAlgorithm: o } = t;
  if (!i && !r)
    throw new Error('Must declare either "leafCert" or "credentialPublicKey"');
  if (i && r)
    throw new Error('Must not declare both "leafCert" and "credentialPublicKey"');
  let s = /* @__PURE__ */ new Map();
  return r ? s = A0(r) : i && (s = XB(i)), ede.stubThis(ide({
    cosePublicKey: s,
    signature: e,
    data: n,
    shaHashOverride: o
  }));
}
const ede = {
  stubThis: (t) => t
};
async function tde(t) {
  const { cosePublicKey: e, signature: n, data: r } = t, i = await Tc(), o = e.get(ut.alg), s = e.get(ut.crv), a = e.get(ut.x);
  if (!o)
    throw new Error("Public key was missing alg (OKP)");
  if (!Zd(o))
    throw new Error(`Public key had invalid alg ${o} (OKP)`);
  if (!s)
    throw new Error("Public key was missing crv (OKP)");
  if (!a)
    throw new Error("Public key was missing x (OKP)");
  let c;
  if (s === Ii.ED25519)
    c = "Ed25519";
  else
    throw new Error(`Unexpected COSE crv value of ${s} (OKP)`);
  const u = {
    kty: "OKP",
    crv: c,
    alg: "EdDSA",
    x: ki(a),
    ext: !1
  }, d = await MA({
    keyData: u,
    algorithm: {
      name: c,
      namedCurve: c
    }
  }), f = {
    name: c
  };
  return i.subtle.verify(f, d, n, r);
}
function nde(t, e) {
  const n = Qr.parse(t, hd), r = new Uint8Array(n.r), i = new Uint8Array(n.s), o = rde(e), s = HD(r, o), a = HD(i, o);
  return oi([
    s,
    a
  ]);
}
function rde(t) {
  switch (t) {
    case Ii.P256:
      return 32;
    case Ii.P384:
      return 48;
    case Ii.P521:
      return 66;
    default:
      throw new Error(`Unexpected COSE crv value of ${t} (EC2)`);
  }
}
function HD(t, e) {
  let n;
  if (t.length < e)
    n = new Uint8Array(e), n.set(t, e - t.length);
  else if (t.length === e)
    n = t;
  else if (t.length === e + 1 && t[0] === 0 && (t[1] & 128) === 128)
    n = t.subarray(1);
  else
    throw new Error(`Invalid signature component length ${t.length}, expected ${e}`);
  return n;
}
function ide(t) {
  const { cosePublicKey: e, signature: n, data: r, shaHashOverride: i } = t;
  if (E0(e)) {
    const s = e.get(ut.crv);
    if (!Lue(s))
      throw new Error(`unknown COSE curve ${s}`);
    const a = nde(n, s);
    return r5({
      cosePublicKey: e,
      signature: a,
      data: r,
      shaHashOverride: i
    });
  } else {
    if (FA(e))
      return i5({ cosePublicKey: e, signature: n, data: r, shaHashOverride: i });
    if (Uue(e))
      return tde({ cosePublicKey: e, signature: n, data: r });
  }
  const o = e.get(ut.kty);
  throw new Error(`Signature verification with public key of kty ${o} is not supported by this method`);
}
function Hi(t, e) {
  return t.length != e.length ? !1 : t.every((n, r) => n === e[r]);
}
function wg(t) {
  return Array.from(t, (n) => n.toString(16).padStart(2, "0")).join("");
}
function ode(t) {
  if (!(t.length !== 0 && t.length % 2 === 0 && !/[^a-fA-F0-9]/u.test(t)))
    throw new Error("Invalid hex string");
  const n = t.match(/.{1,2}/g) ?? [];
  return Uint8Array.from(n.map((r) => parseInt(r, 16)));
}
function oi(t) {
  let e = 0;
  const n = t.reduce((i, o) => i + o.length, 0), r = new Uint8Array(n);
  return t.forEach((i) => {
    r.set(i, e), e += i.length;
  }), r;
}
function sde(t) {
  return new globalThis.TextDecoder("utf-8").decode(t);
}
function vf(t) {
  return new globalThis.TextEncoder().encode(t);
}
function ade(t) {
  return Uint8Array.from(t.split("").map((e) => e.charCodeAt(0)));
}
function Sg(t) {
  return new DataView(t.buffer, t.byteOffset, t.length);
}
async function ZB() {
  const t = new Uint8Array(32);
  return await n5(t), cde.stubThis(t);
}
const cde = {
  stubThis: (t) => t
}, ude = [
  // EdDSA (In first position to encourage authenticators to use this over ES256)
  -8,
  // ECDSA w/ SHA-256
  -7,
  // ECDSA w/ SHA-512
  -36,
  // RSASSA-PSS w/ SHA-256
  -37,
  // RSASSA-PSS w/ SHA-384
  -38,
  // RSASSA-PSS w/ SHA-512
  -39,
  // RSASSA-PKCS1-v1_5 w/ SHA-256
  -257,
  // RSASSA-PKCS1-v1_5 w/ SHA-384
  -258,
  // RSASSA-PKCS1-v1_5 w/ SHA-512
  -259,
  // RSASSA-PKCS1-v1_5 w/ SHA-1 (Deprecated; here for legacy support)
  -65535
], lde = {
  residentKey: "preferred",
  userVerification: "preferred"
}, pde = [-8, -7, -257];
async function dde(t) {
  const { rpName: e, rpID: n, userName: r, userID: i, challenge: o = await ZB(), userDisplayName: s = "", timeout: a = 6e4, attestationType: c = "none", excludeCredentials: u = [], authenticatorSelection: l = lde, extensions: d, supportedAlgorithmIDs: f = pde, preferredAuthenticatorType: m } = t, h = f.map((v) => ({
    alg: v,
    type: "public-key"
  }));
  l.residentKey === void 0 ? l.requireResidentKey && (l.residentKey = "required") : l.requireResidentKey = l.residentKey === "required";
  let y = o;
  if (typeof y == "string" && (y = vf(y)), typeof i == "string")
    throw new Error("String values for `userID` are no longer supported. See https://simplewebauthn.dev/docs/advanced/server/custom-user-ids");
  let x = i;
  x || (x = await zue());
  const g = [];
  return m && (m === "securityKey" ? (g.push("security-key"), l.authenticatorAttachment = "cross-platform") : m === "localDevice" ? (g.push("client-device"), l.authenticatorAttachment = "platform") : m === "remoteDevice" && (g.push("hybrid"), l.authenticatorAttachment = "cross-platform")), {
    challenge: ki(y),
    rp: {
      name: e,
      id: n
    },
    user: {
      id: ki(x),
      name: r,
      displayName: s
    },
    pubKeyCredParams: h,
    timeout: a,
    attestation: c,
    excludeCredentials: u.map((v) => {
      if (!rd(v.id))
        throw new Error(`excludeCredential id "${v.id}" is not a valid base64url string`);
      return {
        ...v,
        id: DA(v.id),
        type: "public-key"
      };
    }),
    authenticatorSelection: l,
    extensions: {
      ...d,
      credProps: !0
    },
    hints: g
  };
}
function eU({ be: t, bs: e }) {
  const n = e;
  let r = "singleDevice";
  if (t && (r = "multiDevice"), r === "singleDevice" && n)
    throw new fde("Single-device credential indicated that it was backed up, which should be impossible.");
  return { credentialDeviceType: r, credentialBackedUp: n };
}
class fde extends Error {
  constructor(e) {
    super(e), this.name = "InvalidBackupFlags";
  }
}
async function tU(t, e) {
  try {
    return await Promise.any(e.map((r) => new Promise((i, o) => {
      pc(ade(r)).then((s) => {
        Hi(t, s) ? i(r) : o();
      });
    })));
  } catch (n) {
    throw n.name === "AggregateError" ? new hde() : n;
  }
}
class hde extends Error {
  constructor() {
    super("Unexpected RP ID hash"), this.name = "UnexpectedRPIDHash";
  }
}
const mde = `-----BEGIN CERTIFICATE-----
MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG
A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv
b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw
MDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i
YWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT
aWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ
jc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp
xy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp
1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG
snUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ
U26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8
9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E
BTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0B
AQUFAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz
yj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE
38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymP
AbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad
DKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME
HMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==
-----END CERTIFICATE-----
`, gde = `-----BEGIN CERTIFICATE-----
MIIFYDCCA0igAwIBAgIJAOj6GWMU0voYMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV
BAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMTYwNTI2MTYyODUyWhcNMjYwNTI0MTYy
ODUyWjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B
AQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS
Sxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7
tv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj
nar86461qO0rOs2cXjp3kOG1FEJ5MVmFmBGtnrKpa73XpXyTqRxB/M0n1n/W9nGq
C4FSYa04T6N5RIZGBN2z2MT5IKGbFlbC8UrW0DxW7AYImQQcHtGl/m00QLVWutHQ
oVJYnFPlXTcHYvASLu+RhhsbDmxMgJJ0mcDpvsC4PjvB+TxywElgS70vE0XmLD+O
JtvsBslHZvPBKCOdT0MS+tgSOIfga+z1Z1g7+DVagf7quvmag8jfPioyKvxnK/Eg
sTUVi2ghzq8wm27ud/mIM7AY2qEORR8Go3TVB4HzWQgpZrt3i5MIlCaY504LzSRi
igHCzAPlHws+W0rB5N+er5/2pJKnfBSDiCiFAVtCLOZ7gLiMm0jhO2B6tUXHI/+M
RPjy02i59lINMRRev56GKtcd9qO/0kUJWdZTdA2XoS82ixPvZtXQpUpuL12ab+9E
aDK8Z4RHJYYfCT3Q5vNAXaiWQ+8PTWm2QgBR/bkwSWc+NpUFgNPN9PvQi8WEg5Um
AGMCAwEAAaOBpjCBozAdBgNVHQ4EFgQUNmHhAHyIBQlRi0RsR/8aTMnqTxIwHwYD
VR0jBBgwFoAUNmHhAHyIBQlRi0RsR/8aTMnqTxIwDwYDVR0TAQH/BAUwAwEB/zAO
BgNVHQ8BAf8EBAMCAYYwQAYDVR0fBDkwNzA1oDOgMYYvaHR0cHM6Ly9hbmRyb2lk
Lmdvb2dsZWFwaXMuY29tL2F0dGVzdGF0aW9uL2NybC8wDQYJKoZIhvcNAQELBQAD
ggIBACDIw41L3KlXG0aMiS//cqrG+EShHUGo8HNsw30W1kJtjn6UBwRM6jnmiwfB
Pb8VA91chb2vssAtX2zbTvqBJ9+LBPGCdw/E53Rbf86qhxKaiAHOjpvAy5Y3m00m
qC0w/Zwvju1twb4vhLaJ5NkUJYsUS7rmJKHHBnETLi8GFqiEsqTWpG/6ibYCv7rY
DBJDcR9W62BW9jfIoBQcxUCUJouMPH25lLNcDc1ssqvC2v7iUgI9LeoM1sNovqPm
QUiG9rHli1vXxzCyaMTjwftkJLkf6724DFhuKug2jITV0QkXvaJWF4nUaHOTNA4u
JU9WDvZLI1j83A+/xnAJUucIv/zGJ1AMH2boHqF8CY16LpsYgBt6tKxxWH00XcyD
CdW2KlBCeqbQPcsFmWyWugxdcekhYsAWyoSf818NUsZdBWBaR/OukXrNLfkQ79Iy
ZohZbvabO/X+MVT3rriAoKc8oE2Uws6DF+60PV7/WIPjNvXySdqspImSN78mflxD
qwLqRBYkA3I75qppLGG9rp7UCdRjxMl8ZDBld+7yvHVgt1cVzJx9xnyGCC23Uaic
MDSXYrB4I4WHXPGjxhZuCuPBLTdOLU8YRvMYdEvYebWHMpvwGCF6bAx3JBpIeOQ1
wDB5y0USicV3YgYGmi+NZfhA4URSh77Yd6uuJOJENRaNVTzk
-----END CERTIFICATE-----
`, yde = `-----BEGIN CERTIFICATE-----
MIIFHDCCAwSgAwIBAgIJANUP8luj8tazMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV
BAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMTkxMTIyMjAzNzU4WhcNMzQxMTE4MjAz
NzU4WjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B
AQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS
Sxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7
tv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj
nar86461qO0rOs2cXjp3kOG1FEJ5MVmFmBGtnrKpa73XpXyTqRxB/M0n1n/W9nGq
C4FSYa04T6N5RIZGBN2z2MT5IKGbFlbC8UrW0DxW7AYImQQcHtGl/m00QLVWutHQ
oVJYnFPlXTcHYvASLu+RhhsbDmxMgJJ0mcDpvsC4PjvB+TxywElgS70vE0XmLD+O
JtvsBslHZvPBKCOdT0MS+tgSOIfga+z1Z1g7+DVagf7quvmag8jfPioyKvxnK/Eg
sTUVi2ghzq8wm27ud/mIM7AY2qEORR8Go3TVB4HzWQgpZrt3i5MIlCaY504LzSRi
igHCzAPlHws+W0rB5N+er5/2pJKnfBSDiCiFAVtCLOZ7gLiMm0jhO2B6tUXHI/+M
RPjy02i59lINMRRev56GKtcd9qO/0kUJWdZTdA2XoS82ixPvZtXQpUpuL12ab+9E
aDK8Z4RHJYYfCT3Q5vNAXaiWQ+8PTWm2QgBR/bkwSWc+NpUFgNPN9PvQi8WEg5Um
AGMCAwEAAaNjMGEwHQYDVR0OBBYEFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMB8GA1Ud
IwQYMBaAFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMA8GA1UdEwEB/wQFMAMBAf8wDgYD
VR0PAQH/BAQDAgIEMA0GCSqGSIb3DQEBCwUAA4ICAQBOMaBc8oumXb2voc7XCWnu
XKhBBK3e2KMGz39t7lA3XXRe2ZLLAkLM5y3J7tURkf5a1SutfdOyXAmeE6SRo83U
h6WszodmMkxK5GM4JGrnt4pBisu5igXEydaW7qq2CdC6DOGjG+mEkN8/TA6p3cno
L/sPyz6evdjLlSeJ8rFBH6xWyIZCbrcpYEJzXaUOEaxxXxgYz5/cTiVKN2M1G2ok
QBUIYSY6bjEL4aUN5cfo7ogP3UvliEo3Eo0YgwuzR2v0KR6C1cZqZJSTnghIC/vA
D32KdNQ+c3N+vl2OTsUVMC1GiWkngNx1OO1+kXW+YTnnTUOtOIswUP/Vqd5SYgAI
mMAfY8U9/iIgkQj6T2W6FsScy94IN9fFhE1UtzmLoBIuUFsVXJMTz+Jucth+IqoW
Fua9v1R93/k98p41pjtFX+H8DslVgfP097vju4KDlqN64xV1grw3ZLl4CiOe/A91
oeLm2UHOq6wn3esB4r2EIQKb6jTVGu5sYCcdWpXr0AUVqcABPdgL+H7qJguBw09o
jm6xNIrw2OocrDKsudk/okr/AwqEyPKw9WnMlQgLIKw1rODG2NvU9oR3GVGdMkUB
ZutL8VuFkERQGt6vQ2OCw0sV47VMkuYbacK/xyZFiRcrPJPb41zgbQj9XAEyLKCH
ex0SdDrx+tWUDqG8At2JHA==
-----END CERTIFICATE-----
`, vde = `
-----BEGIN CERTIFICATE-----
MIIFHDCCAwSgAwIBAgIJAMNrfES5rhgxMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV
BAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMjExMTE3MjMxMDQyWhcNMzYxMTEzMjMx
MDQyWjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B
AQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS
Sxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7
tv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj
nar86461qO0rOs2cXjp3kOG1FEJ5MVmFmBGtnrKpa73XpXyTqRxB/M0n1n/W9nGq
C4FSYa04T6N5RIZGBN2z2MT5IKGbFlbC8UrW0DxW7AYImQQcHtGl/m00QLVWutHQ
oVJYnFPlXTcHYvASLu+RhhsbDmxMgJJ0mcDpvsC4PjvB+TxywElgS70vE0XmLD+O
JtvsBslHZvPBKCOdT0MS+tgSOIfga+z1Z1g7+DVagf7quvmag8jfPioyKvxnK/Eg
sTUVi2ghzq8wm27ud/mIM7AY2qEORR8Go3TVB4HzWQgpZrt3i5MIlCaY504LzSRi
igHCzAPlHws+W0rB5N+er5/2pJKnfBSDiCiFAVtCLOZ7gLiMm0jhO2B6tUXHI/+M
RPjy02i59lINMRRev56GKtcd9qO/0kUJWdZTdA2XoS82ixPvZtXQpUpuL12ab+9E
aDK8Z4RHJYYfCT3Q5vNAXaiWQ+8PTWm2QgBR/bkwSWc+NpUFgNPN9PvQi8WEg5Um
AGMCAwEAAaNjMGEwHQYDVR0OBBYEFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMB8GA1Ud
IwQYMBaAFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMA8GA1UdEwEB/wQFMAMBAf8wDgYD
VR0PAQH/BAQDAgIEMA0GCSqGSIb3DQEBCwUAA4ICAQBTNNZe5cuf8oiq+jV0itTG
zWVhSTjOBEk2FQvh11J3o3lna0o7rd8RFHnN00q4hi6TapFhh4qaw/iG6Xg+xOan
63niLWIC5GOPFgPeYXM9+nBb3zZzC8ABypYuCusWCmt6Tn3+Pjbz3MTVhRGXuT/T
QH4KGFY4PhvzAyXwdjTOCXID+aHud4RLcSySr0Fq/L+R8TWalvM1wJJPhyRjqRCJ
erGtfBagiALzvhnmY7U1qFcS0NCnKjoO7oFedKdWlZz0YAfu3aGCJd4KHT0MsGiL
Zez9WP81xYSrKMNEsDK+zK5fVzw6jA7cxmpXcARTnmAuGUeI7VVDhDzKeVOctf3a
0qQLwC+d0+xrETZ4r2fRGNw2YEs2W8Qj6oDcfPvq9JySe7pJ6wcHnl5EZ0lwc4xH
7Y4Dx9RA1JlfooLMw3tOdJZH0enxPXaydfAD3YifeZpFaUzicHeLzVJLt9dvGB0b
HQLE4+EqKFgOZv2EoP686DQqbVS1u+9k0p2xbMA105TBIk7npraa8VM0fnrRKi7w
lZKwdH+aNAyhbXRW9xsnODJ+g8eF452zvbiKKngEKirK5LGieoXBX7tZ9D1GNBH2
Ob3bKOwwIWdEFle/YF/h6zWgdeoaNGDqVBrLr2+0DtWoiB1aDEjLWl9FmyIUyUm7
mD/vFDkzF+wm7cyWpQpCVQ==
-----END CERTIFICATE-----
`, bde = `
-----BEGIN CERTIFICATE-----
MIIFHDCCAwSgAwIBAgIJAPHBcqaZ6vUdMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV
BAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMjIwMzIwMTgwNzQ4WhcNNDIwMzE1MTgw
NzQ4WjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B
AQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS
Sxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7
tv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj
nar86461qO0rOs2cXjp3kOG1FEJ5MVmFmBGtnrKpa73XpXyTqRxB/M0n1n/W9nGq
C4FSYa04T6N5RIZGBN2z2MT5IKGbFlbC8UrW0DxW7AYImQQcHtGl/m00QLVWutHQ
oVJYnFPlXTcHYvASLu+RhhsbDmxMgJJ0mcDpvsC4PjvB+TxywElgS70vE0XmLD+O
JtvsBslHZvPBKCOdT0MS+tgSOIfga+z1Z1g7+DVagf7quvmag8jfPioyKvxnK/Eg
sTUVi2ghzq8wm27ud/mIM7AY2qEORR8Go3TVB4HzWQgpZrt3i5MIlCaY504LzSRi
igHCzAPlHws+W0rB5N+er5/2pJKnfBSDiCiFAVtCLOZ7gLiMm0jhO2B6tUXHI/+M
RPjy02i59lINMRRev56GKtcd9qO/0kUJWdZTdA2XoS82ixPvZtXQpUpuL12ab+9E
aDK8Z4RHJYYfCT3Q5vNAXaiWQ+8PTWm2QgBR/bkwSWc+NpUFgNPN9PvQi8WEg5Um
AGMCAwEAAaNjMGEwHQYDVR0OBBYEFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMB8GA1Ud
IwQYMBaAFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMA8GA1UdEwEB/wQFMAMBAf8wDgYD
VR0PAQH/BAQDAgIEMA0GCSqGSIb3DQEBCwUAA4ICAQB8cMqTllHc8U+qCrOlg3H7
174lmaCsbo/bJ0C17JEgMLb4kvrqsXZs01U3mB/qABg/1t5Pd5AORHARs1hhqGIC
W/nKMav574f9rZN4PC2ZlufGXb7sIdJpGiO9ctRhiLuYuly10JccUZGEHpHSYM2G
tkgYbZba6lsCPYAAP83cyDV+1aOkTf1RCp/lM0PKvmxYN10RYsK631jrleGdcdkx
oSK//mSQbgcWnmAEZrzHoF1/0gso1HZgIn0YLzVhLSA/iXCX4QT2h3J5z3znluKG
1nv8NQdxei2DIIhASWfu804CA96cQKTTlaae2fweqXjdN1/v2nqOhngNyz1361mF
mr4XmaKH/ItTwOe72NI9ZcwS1lVaCvsIkTDCEXdm9rCNPAY10iTunIHFXRh+7KPz
lHGewCq/8TOohBRn0/NNfh7uRslOSZ/xKbN9tMBtw37Z8d2vvnXq/YWdsm1+JLVw
n6yYD/yacNJBlwpddla8eaVMjsF6nBnIgQOf9zKSe06nSTqvgwUHosgOECZJZ1Eu
zbH4yswbt02tKtKEFhx+v+OTge/06V+jGsqTWLsfrOCNLuA8H++z+pUENmpqnnHo
vaI47gC+TNpkgYGkkBT6B/m/U01BuOBBTzhIlMEZq9qkDWuM2cA5kW5V3FJUcfHn
w1IdYIg2Wxg7yHcQZemFQg==
-----END CERTIFICATE-----
`, xde = `-----BEGIN CERTIFICATE-----
MIICEjCCAZmgAwIBAgIQaB0BbHo84wIlpQGUKEdXcTAKBggqhkjOPQQDAzBLMR8w
HQYDVQQDDBZBcHBsZSBXZWJBdXRobiBSb290IENBMRMwEQYDVQQKDApBcHBsZSBJ
bmMuMRMwEQYDVQQIDApDYWxpZm9ybmlhMB4XDTIwMDMxODE4MjEzMloXDTQ1MDMx
NTAwMDAwMFowSzEfMB0GA1UEAwwWQXBwbGUgV2ViQXV0aG4gUm9vdCBDQTETMBEG
A1UECgwKQXBwbGUgSW5jLjETMBEGA1UECAwKQ2FsaWZvcm5pYTB2MBAGByqGSM49
AgEGBSuBBAAiA2IABCJCQ2pTVhzjl4Wo6IhHtMSAzO2cv+H9DQKev3//fG59G11k
xu9eI0/7o6V5uShBpe1u6l6mS19S1FEh6yGljnZAJ+2GNP1mi/YK2kSXIuTHjxA/
pcoRf7XkOtO4o1qlcaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUJtdk
2cV4wlpn0afeaxLQG2PxxtcwDgYDVR0PAQH/BAQDAgEGMAoGCCqGSM49BAMDA2cA
MGQCMFrZ+9DsJ1PW9hfNdBywZDsWDbWFp28it1d/5w2RPkRX3Bbn/UbDTNLx7Jr3
jAGGiQIwHFj+dJZYUJR786osByBelJYsVZd2GbHQu209b5RCmGQ21gpSAk9QZW4B
1bWeT0vT
-----END CERTIFICATE-----
`, wde = `-----BEGIN CERTIFICATE-----
MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G
A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp
Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4
MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG
A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI
hvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8
RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT
gHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm
KPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd
QQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ
XriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw
DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o
LkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU
RUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp
jjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK
6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX
mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs
Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH
WD9f
-----END CERTIFICATE-----
 `;
class Sde {
  constructor() {
    Object.defineProperty(this, "pemCertificates", {
      enumerable: !0,
      configurable: !0,
      writable: !0,
      value: void 0
    }), this.pemCertificates = /* @__PURE__ */ new Map();
  }
  setRootCertificates(e) {
    const { identifier: n, certificates: r } = e, i = [];
    for (const o of r)
      o instanceof Uint8Array ? i.push(ao(o)) : i.push(o);
    this.pemCertificates.set(n, i);
  }
  getRootCertificates(e) {
    const { identifier: n } = e;
    return this.pemCertificates.get(n) ?? [];
  }
}
const _l = new Sde();
_l.setRootCertificates({
  identifier: "android-key",
  certificates: [
    gde,
    yde,
    vde,
    bde
  ]
});
_l.setRootCertificates({
  identifier: "android-safetynet",
  certificates: [mde]
});
_l.setRootCertificates({
  identifier: "apple",
  certificates: [xde]
});
_l.setRootCertificates({
  identifier: "mds",
  certificates: [wde]
});
async function _de(t) {
  const { attStmt: e, clientDataHash: n, rpIdHash: r, credentialID: i, credentialPublicKey: o, aaguid: s, rootCertificates: a } = t, c = Uint8Array.from([0]), u = RA(o), l = oi([
    c,
    r,
    n,
    i,
    u
  ]), d = e.get("sig"), f = e.get("x5c");
  if (!f)
    throw new Error("No attestation certificate provided in attestation statement (FIDOU2F)");
  if (!d)
    throw new Error("No attestation signature provided in attestation statement (FIDOU2F)");
  const m = Number.parseInt(wg(s), 16);
  if (m !== 0)
    throw new Error(`AAGUID "${m}" was not expected value`);
  try {
    await Ea(f.map(ao), a);
  } catch (h) {
    const y = h;
    throw new Error(`${y.message} (FIDOU2F)`);
  }
  return dc({
    signature: d,
    data: l,
    x509Certificate: f[0],
    hashAlgorithm: ft.ES256
  });
}
const WD = "1.3.6.1.4.1.45724.1.1.4";
function nU(t, e) {
  if (!t)
    return !0;
  const n = t.find((s) => s.extnID === WD);
  if (!n)
    return !0;
  const r = Qr.parse(n.extnValue, je), i = new Uint8Array(r.buffer);
  if (!Hi(e, i)) {
    const s = wg(i), a = wg(e);
    throw new Error(`Certificate extension id-fido-gen-ce-aaguid (${WD}) value of "${s}" was present but not equal to attestation statement AAGUID value of "${a}"`);
  }
  return !0;
}
function Ede(t) {
  return (e, ...n) => {
  };
}
function Ade(t) {
  const e = t.replace("-----BEGIN CERTIFICATE-----", "").replace("-----END CERTIFICATE-----", "").replace(/[\n ]/g, "");
  return No(e, "base64");
}
function Ide(t) {
  const e = t.split(".");
  return [
    JSON.parse(nd(e[0])),
    JSON.parse(nd(e[1])),
    e[2]
  ];
}
function Cde(t, e) {
  const [n, r, i] = t.split("."), o = XB(e), s = vf(`${n}.${r}`), a = No(i);
  if (E0(o))
    return r5({
      data: s,
      signature: a,
      cosePublicKey: o,
      shaHashOverride: ft.ES256
    });
  if (FA(o))
    return i5({
      data: s,
      signature: a,
      cosePublicKey: o
    });
  const c = o.get(ut.kty);
  throw new Error(`JWT verification with public key of kty ${c} is not supported by this method`);
}
const Tde = "https://mds.fidoalliance.org/";
var ei;
(function(t) {
  t[t.DISABLED = 0] = "DISABLED", t[t.REFRESHING = 1] = "REFRESHING", t[t.READY = 2] = "READY";
})(ei || (ei = {}));
const Lc = Ede();
class kde {
  constructor() {
    Object.defineProperty(this, "mdsCache", {
      enumerable: !0,
      configurable: !0,
      writable: !0,
      value: {}
    }), Object.defineProperty(this, "statementCache", {
      enumerable: !0,
      configurable: !0,
      writable: !0,
      value: {}
    }), Object.defineProperty(this, "state", {
      enumerable: !0,
      configurable: !0,
      writable: !0,
      value: ei.DISABLED
    }), Object.defineProperty(this, "verificationMode", {
      enumerable: !0,
      configurable: !0,
      writable: !0,
      value: "strict"
    });
  }
  async initialize(e = {}) {
    const { mdsServers: n = [Tde], statements: r, verificationMode: i } = e;
    if (this.setState(ei.REFRESHING), r?.length) {
      let o = 0;
      r.forEach((s) => {
        s.aaguid && (this.statementCache[s.aaguid] = {
          entry: {
            metadataStatement: s,
            statusReports: [],
            timeOfLastStatusChange: "1970-01-01"
          },
          url: ""
        }, o += 1);
      }), Lc(`Cached ${o} local statements`);
    }
    if (n?.length) {
      const o = Object.keys(this.statementCache).length;
      let s = n.length;
      for (const u of n)
        try {
          await this.downloadBlob({
            url: u,
            no: 0,
            nextUpdate: /* @__PURE__ */ new Date(0)
          });
        } catch (l) {
          Lc(`Could not download BLOB from ${u}:`, l), s -= 1;
        }
      const c = Object.keys(this.statementCache).length - o;
      Lc(`Cached ${c} statements from ${s} metadata server(s)`);
    }
    i && (this.verificationMode = i), this.setState(ei.READY);
  }
  async getStatement(e) {
    if (this.state === ei.DISABLED || !e)
      return;
    e instanceof Uint8Array && (e = o5(e)), await this.pauseUntilReady();
    const n = this.statementCache[e];
    if (!n) {
      if (this.verificationMode === "strict")
        throw new Error(`No metadata statement found for aaguid "${e}"`);
      return;
    }
    if (n.url) {
      const i = this.mdsCache[n.url];
      if (/* @__PURE__ */ new Date() > i.nextUpdate)
        try {
          this.setState(ei.REFRESHING), await this.downloadBlob(i);
        } finally {
          this.setState(ei.READY);
        }
    }
    const { entry: r } = n;
    for (const i of r.statusReports) {
      const { status: o } = i;
      if (o === "USER_VERIFICATION_BYPASS" || o === "ATTESTATION_KEY_COMPROMISE" || o === "USER_KEY_REMOTE_COMPROMISE" || o === "USER_KEY_PHYSICAL_COMPROMISE")
        throw new Error(`Detected compromised aaguid "${e}"`);
    }
    return r.metadataStatement;
  }
  /**
   * Download and process the latest BLOB from MDS
   */
  async downloadBlob(e) {
    const { url: n, no: r } = e, o = await (await VB(n)).text(), s = Ide(o), a = s[0], c = s[1];
    if (c.no <= r)
      throw new Error(`Latest BLOB no. "${c.no}" is not greater than previous ${r}`);
    const u = a.x5c.map(ao);
    try {
      const y = _l.getRootCertificates({
        identifier: "mds"
      });
      await Ea(u, y);
    } catch (y) {
      const x = y;
      throw new Error("BLOB certificate path could not be validated", { cause: x });
    }
    const l = u[0];
    if (!await Cde(o, Ade(l)))
      throw new Error("BLOB signature could not be verified");
    for (const y of c.entries)
      y.aaguid && (this.statementCache[y.aaguid] = { entry: y, url: n });
    const [f, m, h] = c.nextUpdate.split("-");
    this.mdsCache[n] = {
      ...e,
      // Store the payload `no` to make sure we're getting the next BLOB in the sequence
      no: c.no,
      // Convert the nextUpdate property into a Date so we can determine when to re-download
      nextUpdate: new Date(
        parseInt(f, 10),
        // Months need to be zero-indexed
        parseInt(m, 10) - 1,
        parseInt(h, 10)
      )
    };
  }
  /**
   * A helper method to pause execution until the service is ready
   */
  pauseUntilReady() {
    return this.state === ei.READY ? new Promise((n) => {
      n();
    }) : new Promise((n, r) => {
      let s = 700;
      const a = globalThis.setInterval(() => {
        s < 1 ? (clearInterval(a), r(`State did not become ready in ${7e4 / 1e3} seconds`)) : this.state === ei.READY && (clearInterval(a), n()), s -= 1;
      }, 100);
    });
  }
  /**
   * Report service status on change
   */
  setState(e) {
    this.state = e, e === ei.DISABLED ? Lc("MetadataService is DISABLED") : e === ei.REFRESHING ? Lc("MetadataService is REFRESHING") : e === ei.READY && Lc("MetadataService is READY");
  }
}
const yy = new kde();
async function vy({ statement: t, credentialPublicKey: e, x5c: n, attestationStatementAlg: r }) {
  const { authenticationAlgorithms: i, authenticatorGetInfo: o, attestationRootCertificates: s } = t, a = /* @__PURE__ */ new Set();
  i.forEach((x) => {
    const g = zD[x];
    g && a.add(g);
  });
  const c = A0(e), u = c.get(ut.kty), l = c.get(ut.alg);
  if (!u)
    throw new Error("Credential public key was missing kty");
  if (!l)
    throw new Error("Credential public key was missing alg");
  if (!u)
    throw new Error("Credential public key was missing kty");
  const d = { kty: u, alg: l };
  if (E0(c)) {
    const x = c.get(ut.crv);
    d.crv = x;
  }
  let f = !1;
  for (const x of a)
    if (x.alg === d.alg && x.kty === d.kty && ((x.kty === so.EC2 || x.kty === so.OKP) && (x.crv, d.crv), f = !0), f)
      break;
  if (!f) {
    const x = i.map((S) => `'${S}' (COSE info: ${KD(zD[S])})`), g = JSON.stringify(x, null, 2).replace(/"/g, ""), v = KD(d);
    throw new Error(`Public key parameters ${v} did not match any of the following metadata algorithms:
${g}`);
  }
  if (r !== void 0 && o?.algorithms !== void 0) {
    const x = o.algorithms.map((g) => g.alg);
    if (x.indexOf(r) < 0)
      throw new Error(`Attestation statement alg ${r} did not match one of ${x}`);
  }
  const m = n.map(ao), h = s.map(ao);
  let y = !1;
  if (m.length === 1 && h.indexOf(m[0]) >= 0 && (y = !0), !y)
    try {
      await Ea(m, h);
    } catch (x) {
      const g = x;
      throw new Error(`Could not validate certificate path with any metadata root certificates: ${g.message}`);
    }
  return !0;
}
const zD = {
  secp256r1_ecdsa_sha256_raw: { kty: 2, alg: -7, crv: 1 },
  secp256r1_ecdsa_sha256_der: { kty: 2, alg: -7, crv: 1 },
  rsassa_pss_sha256_raw: { kty: 3, alg: -37 },
  rsassa_pss_sha256_der: { kty: 3, alg: -37 },
  secp256k1_ecdsa_sha256_raw: { kty: 2, alg: -47, crv: 8 },
  secp256k1_ecdsa_sha256_der: { kty: 2, alg: -47, crv: 8 },
  rsassa_pss_sha384_raw: { kty: 3, alg: -38 },
  rsassa_pkcsv15_sha256_raw: { kty: 3, alg: -257 },
  rsassa_pkcsv15_sha384_raw: { kty: 3, alg: -258 },
  rsassa_pkcsv15_sha512_raw: { kty: 3, alg: -259 },
  rsassa_pkcsv15_sha1_raw: { kty: 3, alg: -65535 },
  secp384r1_ecdsa_sha384_raw: { kty: 2, alg: -35, crv: 2 },
  secp512r1_ecdsa_sha256_raw: { kty: 2, alg: -36, crv: 3 },
  ed25519_eddsa_sha512_raw: { kty: 1, alg: -8, crv: 6 }
};
function KD(t) {
  const { kty: e, alg: n, crv: r } = t;
  let i = "";
  return e !== so.RSA ? i = `{ kty: ${e}, alg: ${n}, crv: ${r} }` : i = `{ kty: ${e}, alg: ${n} }`, i;
}
async function Nde(t) {
  const { attStmt: e, clientDataHash: n, authData: r, credentialPublicKey: i, aaguid: o, rootCertificates: s } = t, a = e.get("sig"), c = e.get("x5c"), u = e.get("alg");
  if (!a)
    throw new Error("No attestation signature provided in attestation statement (Packed)");
  if (!u)
    throw new Error("Attestation statement did not contain alg (Packed)");
  if (!Zd(u))
    throw new Error(`Attestation statement contained invalid alg ${u} (Packed)`);
  const l = oi([r, n]);
  let d = !1;
  if (c) {
    const { subject: f, basicConstraintsCA: m, version: h, notBefore: y, notAfter: x, parsedCertificate: g } = s2(c[0]), { OU: v, CN: S, O: E, C: T } = f;
    if (v !== "Authenticator Attestation")
      throw new Error('Certificate OU was not "Authenticator Attestation" (Packed|Full)');
    if (!S)
      throw new Error("Certificate CN was empty (Packed|Full)");
    if (!E)
      throw new Error("Certificate O was empty (Packed|Full)");
    if (!T || T.length !== 2)
      throw new Error("Certificate C was not two-character ISO 3166 code (Packed|Full)");
    if (m)
      throw new Error("Certificate basic constraints CA was not `false` (Packed|Full)");
    if (h !== 2)
      throw new Error("Certificate version was not `3` (ASN.1 value of 2) (Packed|Full)");
    let j = /* @__PURE__ */ new Date();
    if (y > j)
      throw new Error(`Certificate not good before "${y.toString()}" (Packed|Full)`);
    if (j = /* @__PURE__ */ new Date(), x < j)
      throw new Error(`Certificate not good after "${x.toString()}" (Packed|Full)`);
    try {
      await nU(g.tbsCertificate.extensions, o);
    } catch (Y) {
      const W = Y;
      throw new Error(`${W.message} (Packed|Full)`);
    }
    const q = await yy.getStatement(o);
    if (q) {
      if (q.attestationTypes.indexOf("basic_full") < 0)
        throw new Error("Metadata does not indicate support for full attestations (Packed|Full)");
      try {
        await vy({
          statement: q,
          credentialPublicKey: i,
          x5c: c,
          attestationStatementAlg: u
        });
      } catch (Y) {
        const W = Y;
        throw new Error(`${W.message} (Packed|Full)`);
      }
    } else
      try {
        await Ea(c.map(ao), s);
      } catch (Y) {
        const W = Y;
        throw new Error(`${W.message} (Packed|Full)`);
      }
    d = await dc({
      signature: a,
      data: l,
      x509Certificate: c[0]
    });
  } else
    d = await dc({
      signature: a,
      data: l,
      credentialPublicKey: i,
      hashAlgorithm: u
    });
  return d;
}
async function Pde(t) {
  const { attStmt: e, clientDataHash: n, authData: r, aaguid: i, rootCertificates: o, verifyTimestampMS: s = !0, credentialPublicKey: a, attestationSafetyNetEnforceCTSCheck: c } = t, u = e.get("alg"), l = e.get("response");
  if (!e.get("ver"))
    throw new Error("No ver value in attestation (SafetyNet)");
  if (!l)
    throw new Error("No response was included in attStmt by authenticator (SafetyNet)");
  const m = sde(l).split("."), h = JSON.parse(nd(m[0])), y = JSON.parse(nd(m[1])), x = m[2], { nonce: g, ctsProfileMatch: v, timestampMs: S } = y;
  if (s) {
    let X = Date.now();
    if (S > Date.now())
      throw new Error(`Payload timestamp "${S}" was later than "${X}" (SafetyNet)`);
    const V = S + 60 * 1e3;
    if (X = Date.now(), V < X)
      throw new Error(`Payload timestamp "${V}" has expired (SafetyNet)`);
  }
  const E = oi([r, n]), T = await pc(E), j = ki(T, "base64");
  if (g !== j)
    throw new Error("Could not verify payload nonce (SafetyNet)");
  if (c && !v)
    throw new Error("Could not verify device integrity (SafetyNet)");
  const q = No(h.x5c[0], "base64"), Y = s2(q), { subject: W } = Y;
  if (W.CN !== "attest.android.com")
    throw new Error('Certificate common name was not "attest.android.com" (SafetyNet)');
  const G = await yy.getStatement(i);
  if (G)
    try {
      await vy({
        statement: G,
        credentialPublicKey: a,
        x5c: h.x5c,
        attestationStatementAlg: u
      });
    } catch (X) {
      const V = X;
      throw new Error(`${V.message} (SafetyNet)`);
    }
  else
    try {
      await Ea(h.x5c.map(ao), o);
    } catch (X) {
      const V = X;
      throw new Error(`${V.message} (SafetyNet)`);
    }
  const J = vf(`${m[0]}.${m[1]}`), B = No(x);
  return await dc({
    signature: B,
    data: J,
    x509Certificate: q
  });
}
const Dde = {
  196: "TPM_ST_RSP_COMMAND",
  32768: "TPM_ST_NULL",
  32769: "TPM_ST_NO_SESSIONS",
  32770: "TPM_ST_SESSIONS",
  32788: "TPM_ST_ATTEST_NV",
  32789: "TPM_ST_ATTEST_COMMAND_AUDIT",
  32790: "TPM_ST_ATTEST_SESSION_AUDIT",
  32791: "TPM_ST_ATTEST_CERTIFY",
  32792: "TPM_ST_ATTEST_QUOTE",
  32793: "TPM_ST_ATTEST_TIME",
  32794: "TPM_ST_ATTEST_CREATION",
  32801: "TPM_ST_CREATION",
  32802: "TPM_ST_VERIFIED",
  32803: "TPM_ST_AUTH_SECRET",
  32804: "TPM_ST_HASHCHECK",
  32805: "TPM_ST_AUTH_SIGNED",
  32809: "TPM_ST_FU_MANIFEST"
}, js = {
  0: "TPM_ALG_ERROR",
  1: "TPM_ALG_RSA",
  4: "TPM_ALG_SHA",
  // @ts-ignore 2300
  4: "TPM_ALG_SHA1",
  5: "TPM_ALG_HMAC",
  6: "TPM_ALG_AES",
  7: "TPM_ALG_MGF1",
  8: "TPM_ALG_KEYEDHASH",
  10: "TPM_ALG_XOR",
  11: "TPM_ALG_SHA256",
  12: "TPM_ALG_SHA384",
  13: "TPM_ALG_SHA512",
  16: "TPM_ALG_NULL",
  18: "TPM_ALG_SM3_256",
  19: "TPM_ALG_SM4",
  20: "TPM_ALG_RSASSA",
  21: "TPM_ALG_RSAES",
  22: "TPM_ALG_RSAPSS",
  23: "TPM_ALG_OAEP",
  24: "TPM_ALG_ECDSA",
  25: "TPM_ALG_ECDH",
  26: "TPM_ALG_ECDAA",
  27: "TPM_ALG_SM2",
  28: "TPM_ALG_ECSCHNORR",
  29: "TPM_ALG_ECMQV",
  32: "TPM_ALG_KDF1_SP800_56A",
  33: "TPM_ALG_KDF2",
  34: "TPM_ALG_KDF1_SP800_108",
  35: "TPM_ALG_ECC",
  37: "TPM_ALG_SYMCIPHER",
  38: "TPM_ALG_CAMELLIA",
  64: "TPM_ALG_CTR",
  65: "TPM_ALG_OFB",
  66: "TPM_ALG_CBC",
  67: "TPM_ALG_CFB",
  68: "TPM_ALG_ECB"
}, Fde = {
  0: "TPM_ECC_NONE",
  1: "TPM_ECC_NIST_P192",
  2: "TPM_ECC_NIST_P224",
  3: "TPM_ECC_NIST_P256",
  4: "TPM_ECC_NIST_P384",
  5: "TPM_ECC_NIST_P521",
  16: "TPM_ECC_BN_P256",
  17: "TPM_ECC_BN_P638",
  32: "TPM_ECC_SM2_P256"
}, Ode = {
  "id:414D4400": { name: "AMD", id: "AMD" },
  "id:414E5400": { name: "Ant Group", id: "ANT" },
  "id:41544D4C": { name: "Atmel", id: "ATML" },
  "id:4252434D": { name: "Broadcom", id: "BRCM" },
  "id:4353434F": { name: "Cisco", id: "CSCO" },
  "id:464C5953": { name: "Flyslice Technologies", id: "FLYS" },
  "id:524F4343": { name: "Fuzhou Rockchip", id: "ROCC" },
  "id:474F4F47": { name: "Google", id: "GOOG" },
  "id:48504900": { name: "HPI", id: "HPI" },
  "id:48504500": { name: "HPE", id: "HPE" },
  "id:48495349": { name: "Huawei", id: "HISI" },
  "id:49424d00": { name: "IBM", id: "IBM" },
  "id:49424D00": { name: "IBM", id: "IBM" },
  // Same ID for IBM as above, except the "D" is capitalized as per TPM spec
  "id:49465800": { name: "Infineon", id: "IFX" },
  "id:494E5443": { name: "Intel", id: "INTC" },
  "id:4C454E00": { name: "Lenovo", id: "LEN" },
  "id:4D534654": { name: "Microsoft", id: "MSFT" },
  "id:4E534D20": { name: "National Semiconductor", id: "NSM" },
  "id:4E545A00": { name: "Nationz", id: "NTZ" },
  "id:4E534700": { name: "NSING", id: "NSG" },
  "id:4E544300": { name: "Nuvoton Technology", id: "NTC" },
  "id:51434F4D": { name: "Qualcomm", id: "QCOM" },
  "id:534D534E": { name: "Samsung", id: "SMSN" },
  "id:53454345": { name: "SecEdge", id: "SECE" },
  "id:534E5300": { name: "Sinosun", id: "SNS" },
  "id:534D5343": { name: "SMSC", id: "SMSC" },
  "id:53544D20": { name: "STMicroelectronics", id: "STM" },
  "id:54584E00": { name: "Texas Instruments", id: "TXN" },
  "id:57454300": { name: "Winbond", id: "WEC" },
  "id:5345414C": { name: "Wisekey", id: "SEAL" },
  "id:FFFFF1D0": { name: "FIDO Alliance", id: "FIDO" }
  // FIDO Conformance
}, Mde = {
  TPM_ECC_NIST_P256: 1,
  // p256
  TPM_ECC_NIST_P384: 2,
  // p384
  TPM_ECC_NIST_P521: 3,
  // p521
  TPM_ECC_BN_P256: 1,
  // p256
  TPM_ECC_SM2_P256: 1
  // p256
};
function Rde(t) {
  let e = 0;
  const n = Sg(t), r = n.getUint32(e);
  e += 4;
  const i = n.getUint16(e);
  e += 2;
  const o = Dde[i], s = n.getUint16(e);
  e += 2;
  const a = t.slice(e, e += s), c = n.getUint16(e);
  e += 2;
  const u = t.slice(e, e += c), l = t.slice(e, e += 8), d = n.getUint32(e);
  e += 4;
  const f = n.getUint32(e);
  e += 4;
  const m = !!t.slice(e, e += 1), h = { clock: l, resetCount: d, restartCount: f, safe: m }, y = t.slice(e, e += 8), x = n.getUint16(e);
  e += 2;
  const g = t.slice(e, e += x), v = Sg(g), S = n.getUint16(e);
  e += 2;
  const E = t.slice(e, e += S), T = {
    nameAlg: js[v.getUint16(0)],
    nameAlgBuffer: g.slice(0, 2),
    name: g,
    qualifiedName: E
  };
  return {
    magic: r,
    type: o,
    qualifiedSigner: a,
    extraData: u,
    clockInfo: h,
    firmwareVersion: y,
    attested: T
  };
}
function Bde(t) {
  let e = 0;
  const n = Sg(t), r = js[n.getUint16(e)];
  e += 2;
  const i = js[n.getUint16(e)];
  e += 2;
  const o = n.getUint32(e);
  e += 4;
  const s = {
    fixedTPM: !!(o & 1),
    stClear: !!(o & 2),
    fixedParent: !!(o & 8),
    sensitiveDataOrigin: !!(o & 16),
    userWithAuth: !!(o & 32),
    adminWithPolicy: !!(o & 64),
    noDA: !!(o & 512),
    encryptedDuplication: !!(o & 1024),
    restricted: !!(o & 32768),
    decrypt: !!(o & 65536),
    signOrEncrypt: !!(o & 131072)
  }, a = n.getUint16(e);
  e += 2;
  const c = t.slice(e, e += a), u = {};
  let l = Uint8Array.from([]);
  if (r === "TPM_ALG_RSA") {
    const d = js[n.getUint16(e)];
    e += 2;
    const f = js[n.getUint16(e)];
    e += 2;
    const m = n.getUint16(e);
    e += 2;
    const h = n.getUint32(e);
    e += 4, u.rsa = { symmetric: d, scheme: f, keyBits: m, exponent: h };
    const y = n.getUint16(e);
    e += 2, l = t.slice(e, e += y);
  } else if (r === "TPM_ALG_ECC") {
    const d = js[n.getUint16(e)];
    e += 2;
    const f = js[n.getUint16(e)];
    e += 2;
    const m = Fde[n.getUint16(e)];
    e += 2;
    const h = js[n.getUint16(e)];
    e += 2, u.ecc = { symmetric: d, scheme: f, curveID: m, kdf: h };
    const y = n.getUint16(e);
    e += 2;
    const x = t.slice(e, e += y), g = n.getUint16(e);
    e += 2;
    const v = t.slice(e, e += g);
    l = oi([x, v]);
  } else
    throw new Error(`Unexpected type "${r}" (TPM)`);
  return {
    type: r,
    nameAlg: i,
    objectAttributes: s,
    authPolicy: c,
    parameters: u,
    unique: l
  };
}
async function Ude(t) {
  const { aaguid: e, attStmt: n, authData: r, credentialPublicKey: i, clientDataHash: o, rootCertificates: s } = t, a = n.get("ver"), c = n.get("sig"), u = n.get("alg"), l = n.get("x5c"), d = n.get("pubArea"), f = n.get("certInfo");
  if (a !== "2.0")
    throw new Error(`Unexpected ver "${a}", expected "2.0" (TPM)`);
  if (!c)
    throw new Error("No attestation signature provided in attestation statement (TPM)");
  if (!u)
    throw new Error("Attestation statement did not contain alg (TPM)");
  if (!Zd(u))
    throw new Error(`Attestation statement contained invalid alg ${u} (TPM)`);
  if (!l)
    throw new Error("No attestation certificate provided in attestation statement (TPM)");
  if (!d)
    throw new Error("Attestation statement did not contain pubArea (TPM)");
  if (!f)
    throw new Error("Attestation statement did not contain certInfo (TPM)");
  const m = Bde(d), { unique: h, type: y, parameters: x } = m, g = A0(i);
  if (y === "TPM_ALG_RSA") {
    if (!FA(g))
      throw new Error(`Credential public key with kty ${g.get(ut.kty)} did not match ${y}`);
    const M = g.get(ut.n), F = g.get(ut.e);
    if (!M)
      throw new Error("COSE public key missing n (TPM|RSA)");
    if (!F)
      throw new Error("COSE public key missing e (TPM|RSA)");
    if (!Hi(h, M))
      throw new Error("PubArea unique is not same as credentialPublicKey (TPM|RSA)");
    if (!x.rsa)
      throw new Error("Parsed pubArea type is RSA, but missing parameters.rsa (TPM|RSA)");
    const A = F, O = x.rsa.exponent || 65537, Z = A[0] + (A[1] << 8) + (A[2] << 16);
    if (O !== Z)
      throw new Error(`Unexpected public key exp ${Z}, expected ${O} (TPM|RSA)`);
  } else if (y === "TPM_ALG_ECC") {
    if (!E0(g))
      throw new Error(`Credential public key with kty ${g.get(ut.kty)} did not match ${y}`);
    const M = g.get(ut.crv), F = g.get(ut.x), A = g.get(ut.y);
    if (!M)
      throw new Error("COSE public key missing crv (TPM|ECC)");
    if (!F)
      throw new Error("COSE public key missing x (TPM|ECC)");
    if (!A)
      throw new Error("COSE public key missing y (TPM|ECC)");
    if (!Hi(h, oi([F, A])))
      throw new Error("PubArea unique is not same as public key x and y (TPM|ECC)");
    if (!x.ecc)
      throw new Error("Parsed pubArea type is ECC, but missing parameters.ecc (TPM|ECC)");
    const O = x.ecc.curveID, Z = Mde[O];
    if (Z !== M)
      throw new Error(`Public area key curve ID "${O}" mapped to "${Z}" which did not match public key crv of "${M}" (TPM|ECC)`);
  } else
    throw new Error(`Unsupported pubArea.type "${y}"`);
  const v = Rde(f), { magic: S, type: E, attested: T, extraData: j } = v;
  if (S !== 4283712327)
    throw new Error(`Unexpected magic value "${S}", expected "0xff544347" (TPM)`);
  if (E !== "TPM_ST_ATTEST_CERTIFY")
    throw new Error(`Unexpected type "${E}", expected "TPM_ST_ATTEST_CERTIFY" (TPM)`);
  const q = await pc(d, jde(T.nameAlg)), Y = oi([
    T.nameAlgBuffer,
    q
  ]);
  if (!Hi(T.name, Y))
    throw new Error("Attested name comparison failed (TPM)");
  const W = oi([r, o]), G = await pc(W, u);
  if (!Hi(j, G))
    throw new Error("CertInfo extra data did not equal hashed attestation (TPM)");
  if (l.length < 1)
    throw new Error("No certificates present in x5c array (TPM)");
  const J = s2(l[0]), { basicConstraintsCA: B, version: D, subject: X, notAfter: V, notBefore: K } = J;
  if (B)
    throw new Error("Certificate basic constraints CA was not `false` (TPM)");
  if (D !== 2)
    throw new Error("Certificate version was not `3` (ASN.1 value of 2) (TPM)");
  if (X.combined.length > 0)
    throw new Error("Certificate subject was not empty (TPM)");
  let $ = /* @__PURE__ */ new Date();
  if (K > $)
    throw new Error(`Certificate not good before "${K.toString()}" (TPM)`);
  if ($ = /* @__PURE__ */ new Date(), V < $)
    throw new Error(`Certificate not good after "${V.toString()}" (TPM)`);
  const _ = Qr.parse(l[0], uo);
  if (!_.tbsCertificate.extensions)
    throw new Error("Certificate was missing extensions (TPM)");
  let I, N;
  if (_.tbsCertificate.extensions.forEach((M) => {
    M.extnID === o2 ? I = Qr.parse(M.extnValue, Jm) : M.extnID === r2 && (N = Qr.parse(M.extnValue, ud));
  }), !I)
    throw new Error("Certificate did not contain subjectAltName extension (TPM)");
  if (!I[0].directoryName?.[0].length)
    throw new Error("Certificate subjectAltName extension directoryName was empty (TPM)");
  const { tcgAtTpmManufacturer: U, tcgAtTpmModel: C, tcgAtTpmVersion: L } = Lde(I[0].directoryName);
  if (!U || !C || !L)
    throw new Error("Certificate contained incomplete subjectAltName data (TPM)");
  if (!N)
    throw new Error("Certificate did not contain ExtendedKeyUsage extension (TPM)");
  if (!Ode[U])
    throw new Error(`Could not match TPM manufacturer "${U}" (TPM)`);
  if (N[0] !== "2.23.133.8.3")
    throw new Error(`Unexpected extKeyUsage "${N[0]}", expected "2.23.133.8.3" (TPM)`);
  try {
    await nU(_.tbsCertificate.extensions, e);
  } catch (M) {
    const F = M;
    throw new Error(`${F.message} (TPM)`);
  }
  const k = await yy.getStatement(e);
  if (k)
    try {
      await vy({
        statement: k,
        credentialPublicKey: i,
        x5c: l,
        attestationStatementAlg: u
      });
    } catch (M) {
      const F = M;
      throw new Error(`${F.message} (TPM)`);
    }
  else
    try {
      await Ea(l.map(ao), s);
    } catch (M) {
      const F = M;
      throw new Error(`${F.message} (TPM)`);
    }
  return dc({
    signature: c,
    data: f,
    x509Certificate: l[0],
    hashAlgorithm: u
  });
}
function Lde(t) {
  const e = "2.23.133.2.1", n = "2.23.133.2.2", r = "2.23.133.2.3";
  let i, o, s;
  return t.forEach((a) => {
    a.forEach((c) => {
      c.type === e ? i = c.value.toString() : c.type === n ? o = c.value.toString() : c.type === r && (s = c.value.toString());
    });
  }), {
    tcgAtTpmManufacturer: i,
    tcgAtTpmModel: o,
    tcgAtTpmVersion: s
  };
}
function jde(t) {
  if (t === "TPM_ALG_SHA256")
    return ft.ES256;
  if (t === "TPM_ALG_SHA384")
    return ft.ES384;
  if (t === "TPM_ALG_SHA512")
    return ft.ES512;
  throw new Error(`Unexpected TPM attested name alg ${t}`);
}
var T_;
const Qde = "1.3.6.1.4.1.11129.2.1.17";
var k_;
(function(t) {
  t[t.verified = 0] = "verified", t[t.selfSigned = 1] = "selfSigned", t[t.unverified = 2] = "unverified", t[t.failed = 3] = "failed";
})(k_ || (k_ = {}));
class bf {
  constructor(e = {}) {
    this.verifiedBootKey = new je(), this.deviceLocked = !1, this.verifiedBootState = k_.verified, Object.assign(this, e);
  }
}
R([
  H({ type: je })
], bf.prototype, "verifiedBootKey", void 0);
R([
  H({ type: te.Boolean })
], bf.prototype, "deviceLocked", void 0);
R([
  H({ type: te.Enumerated })
], bf.prototype, "verifiedBootState", void 0);
R([
  H({ type: je, optional: !0 })
], bf.prototype, "verifiedBootHash", void 0);
let Uu = T_ = class extends Ct {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, T_.prototype);
  }
};
Uu = T_ = R([
  Se({ type: ge.Set, itemType: te.Integer })
], Uu);
class Ve {
  constructor(e = {}) {
    Object.assign(this, e);
  }
}
R([
  H({ context: 1, type: Uu, optional: !0 })
], Ve.prototype, "purpose", void 0);
R([
  H({ context: 2, type: te.Integer, optional: !0 })
], Ve.prototype, "algorithm", void 0);
R([
  H({ context: 3, type: te.Integer, optional: !0 })
], Ve.prototype, "keySize", void 0);
R([
  H({ context: 5, type: Uu, optional: !0 })
], Ve.prototype, "digest", void 0);
R([
  H({ context: 6, type: Uu, optional: !0 })
], Ve.prototype, "padding", void 0);
R([
  H({ context: 10, type: te.Integer, optional: !0 })
], Ve.prototype, "ecCurve", void 0);
R([
  H({ context: 200, type: te.Integer, optional: !0 })
], Ve.prototype, "rsaPublicExponent", void 0);
R([
  H({ context: 203, type: Uu, optional: !0 })
], Ve.prototype, "mgfDigest", void 0);
R([
  H({ context: 303, type: te.Null, optional: !0 })
], Ve.prototype, "rollbackResistance", void 0);
R([
  H({ context: 305, type: te.Null, optional: !0 })
], Ve.prototype, "earlyBootOnly", void 0);
R([
  H({ context: 400, type: te.Integer, optional: !0 })
], Ve.prototype, "activeDateTime", void 0);
R([
  H({ context: 401, type: te.Integer, optional: !0 })
], Ve.prototype, "originationExpireDateTime", void 0);
R([
  H({ context: 402, type: te.Integer, optional: !0 })
], Ve.prototype, "usageExpireDateTime", void 0);
R([
  H({ context: 405, type: te.Integer, optional: !0 })
], Ve.prototype, "usageCountLimit", void 0);
R([
  H({ context: 503, type: te.Null, optional: !0 })
], Ve.prototype, "noAuthRequired", void 0);
R([
  H({ context: 504, type: te.Integer, optional: !0 })
], Ve.prototype, "userAuthType", void 0);
R([
  H({ context: 505, type: te.Integer, optional: !0 })
], Ve.prototype, "authTimeout", void 0);
R([
  H({ context: 506, type: te.Null, optional: !0 })
], Ve.prototype, "allowWhileOnBody", void 0);
R([
  H({ context: 507, type: te.Null, optional: !0 })
], Ve.prototype, "trustedUserPresenceRequired", void 0);
R([
  H({ context: 508, type: te.Null, optional: !0 })
], Ve.prototype, "trustedConfirmationRequired", void 0);
R([
  H({ context: 509, type: te.Null, optional: !0 })
], Ve.prototype, "unlockedDeviceRequired", void 0);
R([
  H({ context: 600, type: te.Null, optional: !0 })
], Ve.prototype, "allApplications", void 0);
R([
  H({ context: 601, type: je, optional: !0 })
], Ve.prototype, "applicationId", void 0);
R([
  H({ context: 701, type: te.Integer, optional: !0 })
], Ve.prototype, "creationDateTime", void 0);
R([
  H({ context: 702, type: te.Integer, optional: !0 })
], Ve.prototype, "origin", void 0);
R([
  H({ context: 703, type: te.Null, optional: !0 })
], Ve.prototype, "rollbackResistant", void 0);
R([
  H({ context: 704, type: bf, optional: !0 })
], Ve.prototype, "rootOfTrust", void 0);
R([
  H({ context: 705, type: te.Integer, optional: !0 })
], Ve.prototype, "osVersion", void 0);
R([
  H({ context: 706, type: te.Integer, optional: !0 })
], Ve.prototype, "osPatchLevel", void 0);
R([
  H({ context: 709, type: je, optional: !0 })
], Ve.prototype, "attestationApplicationId", void 0);
R([
  H({ context: 710, type: je, optional: !0 })
], Ve.prototype, "attestationIdBrand", void 0);
R([
  H({ context: 711, type: je, optional: !0 })
], Ve.prototype, "attestationIdDevice", void 0);
R([
  H({ context: 712, type: je, optional: !0 })
], Ve.prototype, "attestationIdProduct", void 0);
R([
  H({ context: 713, type: je, optional: !0 })
], Ve.prototype, "attestationIdSerial", void 0);
R([
  H({ context: 714, type: je, optional: !0 })
], Ve.prototype, "attestationIdImei", void 0);
R([
  H({ context: 715, type: je, optional: !0 })
], Ve.prototype, "attestationIdMeid", void 0);
R([
  H({ context: 716, type: je, optional: !0 })
], Ve.prototype, "attestationIdManufacturer", void 0);
R([
  H({ context: 717, type: je, optional: !0 })
], Ve.prototype, "attestationIdModel", void 0);
R([
  H({ context: 718, type: te.Integer, optional: !0 })
], Ve.prototype, "vendorPatchLevel", void 0);
R([
  H({ context: 719, type: te.Integer, optional: !0 })
], Ve.prototype, "bootPatchLevel", void 0);
R([
  H({ context: 720, type: te.Null, optional: !0 })
], Ve.prototype, "deviceUniqueAttestation", void 0);
R([
  H({ context: 723, type: je, optional: !0 })
], Ve.prototype, "attestationIdSecondImei", void 0);
R([
  H({ context: 724, type: je, optional: !0 })
], Ve.prototype, "moduleHash", void 0);
var sa;
(function(t) {
  t[t.software = 0] = "software", t[t.trustedEnvironment = 1] = "trustedEnvironment", t[t.strongBox = 2] = "strongBox";
})(sa || (sa = {}));
var vd;
(function(t) {
  t[t.KM2 = 1] = "KM2", t[t.KM3 = 2] = "KM3", t[t.KM4 = 3] = "KM4", t[t.KM4_1 = 4] = "KM4_1", t[t.keyMint1 = 100] = "keyMint1", t[t.keyMint2 = 200] = "keyMint2", t[t.keyMint3 = 300] = "keyMint3", t[t.keyMint4 = 400] = "keyMint4";
})(vd || (vd = {}));
class Qo {
  constructor(e = {}) {
    this.attestationVersion = vd.KM4, this.attestationSecurityLevel = sa.software, this.keymasterVersion = 0, this.keymasterSecurityLevel = sa.software, this.attestationChallenge = new je(), this.uniqueId = new je(), this.softwareEnforced = new Ve(), this.teeEnforced = new Ve(), Object.assign(this, e);
  }
}
R([
  H({ type: te.Integer })
], Qo.prototype, "attestationVersion", void 0);
R([
  H({ type: te.Enumerated })
], Qo.prototype, "attestationSecurityLevel", void 0);
R([
  H({ type: te.Integer })
], Qo.prototype, "keymasterVersion", void 0);
R([
  H({ type: te.Enumerated })
], Qo.prototype, "keymasterSecurityLevel", void 0);
R([
  H({ type: je })
], Qo.prototype, "attestationChallenge", void 0);
R([
  H({ type: je })
], Qo.prototype, "uniqueId", void 0);
R([
  H({ type: Ve })
], Qo.prototype, "softwareEnforced", void 0);
R([
  H({ type: Ve })
], Qo.prototype, "teeEnforced", void 0);
class $o {
  constructor(e = {}) {
    this.attestationVersion = vd.keyMint4, this.attestationSecurityLevel = sa.software, this.keyMintVersion = 0, this.keyMintSecurityLevel = sa.software, this.attestationChallenge = new je(), this.uniqueId = new je(), this.softwareEnforced = new Ve(), this.hardwareEnforced = new Ve(), Object.assign(this, e);
  }
  toLegacyKeyDescription() {
    return new Qo({
      attestationVersion: this.attestationVersion,
      attestationSecurityLevel: this.attestationSecurityLevel,
      keymasterVersion: this.keyMintVersion,
      keymasterSecurityLevel: this.keyMintSecurityLevel,
      attestationChallenge: this.attestationChallenge,
      uniqueId: this.uniqueId,
      softwareEnforced: this.softwareEnforced,
      teeEnforced: this.hardwareEnforced
    });
  }
  static fromLegacyKeyDescription(e) {
    return new $o({
      attestationVersion: e.attestationVersion,
      attestationSecurityLevel: e.attestationSecurityLevel,
      keyMintVersion: e.keymasterVersion,
      keyMintSecurityLevel: e.keymasterSecurityLevel,
      attestationChallenge: e.attestationChallenge,
      uniqueId: e.uniqueId,
      softwareEnforced: e.softwareEnforced,
      hardwareEnforced: e.teeEnforced
    });
  }
}
R([
  H({ type: te.Integer })
], $o.prototype, "attestationVersion", void 0);
R([
  H({ type: te.Enumerated })
], $o.prototype, "attestationSecurityLevel", void 0);
R([
  H({ type: te.Integer })
], $o.prototype, "keyMintVersion", void 0);
R([
  H({ type: te.Enumerated })
], $o.prototype, "keyMintSecurityLevel", void 0);
R([
  H({ type: je })
], $o.prototype, "attestationChallenge", void 0);
R([
  H({ type: je })
], $o.prototype, "uniqueId", void 0);
R([
  H({ type: Ve })
], $o.prototype, "softwareEnforced", void 0);
R([
  H({ type: Ve })
], $o.prototype, "hardwareEnforced", void 0);
var N_;
let P_ = class extends Ve {
};
P_ = R([
  Se({ type: ge.Choice })
], P_);
let Lu = N_ = class extends Ct {
  constructor(e) {
    super(e), Object.setPrototypeOf(this, N_.prototype);
  }
  findProperty(e) {
    const n = this.find((r) => e in r);
    if (n)
      return n[e];
  }
};
Lu = N_ = R([
  Se({ type: ge.Sequence, itemType: P_ })
], Lu);
class ks {
  get keyMintVersion() {
    return this.keymasterVersion;
  }
  set keyMintVersion(e) {
    this.keymasterVersion = e;
  }
  get keyMintSecurityLevel() {
    return this.keymasterSecurityLevel;
  }
  set keyMintSecurityLevel(e) {
    this.keymasterSecurityLevel = e;
  }
  get hardwareEnforced() {
    return this.teeEnforced;
  }
  set hardwareEnforced(e) {
    this.teeEnforced = e;
  }
  constructor(e = {}) {
    this.attestationVersion = vd.KM4, this.attestationSecurityLevel = sa.software, this.keymasterVersion = 0, this.keymasterSecurityLevel = sa.software, this.attestationChallenge = new je(), this.uniqueId = new je(), this.softwareEnforced = new Lu(), this.teeEnforced = new Lu(), Object.assign(this, e);
  }
}
R([
  H({ type: te.Integer })
], ks.prototype, "attestationVersion", void 0);
R([
  H({ type: te.Enumerated })
], ks.prototype, "attestationSecurityLevel", void 0);
R([
  H({ type: te.Integer })
], ks.prototype, "keymasterVersion", void 0);
R([
  H({ type: te.Enumerated })
], ks.prototype, "keymasterSecurityLevel", void 0);
R([
  H({ type: je })
], ks.prototype, "attestationChallenge", void 0);
R([
  H({ type: je })
], ks.prototype, "uniqueId", void 0);
R([
  H({ type: Lu })
], ks.prototype, "softwareEnforced", void 0);
R([
  H({ type: Lu })
], ks.prototype, "teeEnforced", void 0);
let VD = class extends ks {
  constructor(e = {}) {
    "keymasterVersion" in e && !("keyMintVersion" in e) && (e.keyMintVersion = e.keymasterVersion), "keymasterSecurityLevel" in e && !("keyMintSecurityLevel" in e) && (e.keyMintSecurityLevel = e.keymasterSecurityLevel), "teeEnforced" in e && !("hardwareEnforced" in e) && (e.hardwareEnforced = e.teeEnforced), super(e);
  }
};
VD = R([
  Se({ type: ge.Sequence })
], VD);
class A2 {
  constructor(e = {}) {
    Object.assign(this, e);
  }
}
R([
  H({ type: te.OctetString })
], A2.prototype, "packageName", void 0);
R([
  H({ type: te.Integer })
], A2.prototype, "version", void 0);
class rU {
  constructor(e = {}) {
    Object.assign(this, e);
  }
}
R([
  H({ type: A2, repeated: "set" })
], rU.prototype, "packageInfos", void 0);
R([
  H({ type: te.OctetString, repeated: "set" })
], rU.prototype, "signatureDigests", void 0);
async function $de(t) {
  const { authData: e, clientDataHash: n, attStmt: r, credentialPublicKey: i, aaguid: o, rootCertificates: s } = t, a = r.get("x5c"), c = r.get("sig"), u = r.get("alg");
  if (!a)
    throw new Error("No attestation certificate provided in attestation statement (Android Key)");
  if (!c)
    throw new Error("No attestation signature provided in attestation statement (Android Key)");
  if (!u)
    throw new Error("Attestation statement did not contain alg (Android Key)");
  if (!Zd(u))
    throw new Error(`Attestation statement contained invalid alg ${u} (Android Key)`);
  const l = Qr.parse(a[0], uo), d = new Uint8Array(l.tbsCertificate.subjectPublicKeyInfo.subjectPublicKey), f = RA(i);
  if (!Hi(f, d))
    throw new Error("Credential public key does not equal leaf cert public key (Android Key)");
  const m = l.tbsCertificate.extensions?.find((E) => E.extnID === Qde);
  if (!m)
    throw new Error("Certificate did not contain extKeyStore (Android Key)");
  const h = Qr.parse(m.extnValue, Qo), { attestationChallenge: y, teeEnforced: x, softwareEnforced: g } = h;
  if (!Hi(new Uint8Array(y.buffer), n))
    throw new Error("Attestation challenge was not equal to client data hash (Android Key)");
  if (x.allApplications !== void 0)
    throw new Error('teeEnforced contained "allApplications [600]" tag (Android Key)');
  if (g.allApplications !== void 0)
    throw new Error('teeEnforced contained "allApplications [600]" tag (Android Key)');
  const v = await yy.getStatement(o);
  if (v)
    try {
      await vy({
        statement: v,
        credentialPublicKey: i,
        x5c: a,
        attestationStatementAlg: u
      });
    } catch (E) {
      const T = E;
      throw new Error(`${T.message} (Android Key)`, { cause: T });
    }
  else {
    const E = a.slice(0, -1).map(ao), T = a.slice(-1).map(ao);
    try {
      await Ea(E, T);
    } catch (j) {
      const q = j;
      throw new Error(`${q.message} (Android Key)`, { cause: q });
    }
    if (s.length > 0 && s.indexOf(T[0]) < 0)
      throw new Error("x5c root certificate was not a known root certificate (Android Key)");
  }
  const S = oi([e, n]);
  return dc({
    signature: c,
    data: S,
    x509Certificate: a[0],
    hashAlgorithm: u
  });
}
async function Gde(t) {
  const { attStmt: e, authData: n, clientDataHash: r, credentialPublicKey: i, rootCertificates: o } = t, s = e.get("x5c");
  if (!s)
    throw new Error("No attestation certificate provided in attestation statement (Apple)");
  try {
    await Ea(s.map(ao), o);
  } catch (x) {
    const g = x;
    throw new Error(`${g.message} (Apple)`);
  }
  const a = Qr.parse(s[0], uo), { extensions: c, subjectPublicKeyInfo: u } = a.tbsCertificate;
  if (!c)
    throw new Error("credCert missing extensions (Apple)");
  const l = c.find((x) => x.extnID === "1.2.840.113635.100.8.2");
  if (!l)
    throw new Error('credCert missing "1.2.840.113635.100.8.2" extension (Apple)');
  const d = oi([n, r]), f = await pc(d), m = new Uint8Array(l.extnValue.buffer).slice(6);
  if (!Hi(f, m))
    throw new Error("credCert nonce was not expected value (Apple)");
  const h = RA(i), y = new Uint8Array(u.subjectPublicKey);
  if (!Hi(h, y))
    throw new Error("Credential public key does not equal credCert public key (Apple)");
  return !0;
}
async function qde(t) {
  const { response: e, expectedChallenge: n, expectedOrigin: r, expectedRPID: i, expectedType: o, requireUserPresence: s = !0, requireUserVerification: a = !0, supportedAlgorithmIDs: c = ude, attestationSafetyNetEnforceCTSCheck: u = !0 } = t, { id: l, rawId: d, type: f, response: m } = e;
  if (!l)
    throw new Error("Missing credential ID");
  if (l !== d)
    throw new Error("Credential ID was not base64url-encoded");
  if (f !== "public-key")
    throw new Error(`Unexpected credential type ${f}, expected "public-key"`);
  const h = s5(m.clientDataJSON), { type: y, origin: x, challenge: g, tokenBinding: v } = h;
  if (Array.isArray(o)) {
    if (!o.includes(y)) {
      const M = o.join(", ");
      throw new Error(`Unexpected registration response type "${y}", expected one of: ${M}`);
    }
  } else if (o) {
    if (y !== o)
      throw new Error(`Unexpected registration response type "${y}", expected "${o}"`);
  } else if (y !== "webauthn.create")
    throw new Error(`Unexpected registration response type: ${y}`);
  if (typeof n == "function") {
    if (!await n(g))
      throw new Error(`Custom challenge verifier returned false for registration response challenge "${g}"`);
  } else if (g !== n)
    throw new Error(`Unexpected registration response challenge "${g}", expected "${n}"`);
  if (Array.isArray(r)) {
    if (!r.includes(x))
      throw new Error(`Unexpected registration response origin "${x}", expected one of: ${r.join(", ")}`);
  } else if (x !== r)
    throw new Error(`Unexpected registration response origin "${x}", expected "${r}"`);
  if (v) {
    if (typeof v != "object")
      throw new Error(`Unexpected value for TokenBinding "${v}"`);
    if (["present", "supported", "not-supported"].indexOf(v.status) < 0)
      throw new Error(`Unexpected tokenBinding.status value of "${v.status}"`);
  }
  const S = No(m.attestationObject), E = Gue(S), T = E.get("fmt"), j = E.get("authData"), q = E.get("attStmt"), Y = JB(j), { aaguid: W, rpIdHash: G, flags: J, credentialID: B, counter: D, credentialPublicKey: X, extensionsData: V } = Y;
  let K;
  if (i) {
    let M = [];
    typeof i == "string" ? M = [i] : M = i, K = await tU(G, M);
  }
  if (s && !J.up)
    throw new Error("User presence was required, but user was not present");
  if (a && !J.uv)
    throw new Error("User verification was required, but user could not be verified");
  if (!B)
    throw new Error("No credential ID was provided by authenticator");
  if (!X)
    throw new Error("No public key was provided by authenticator");
  if (!W)
    throw new Error("No AAGUID was present during registration");
  const _ = A0(X).get(ut.alg);
  if (typeof _ != "number")
    throw new Error("Credential public key was missing numeric alg");
  if (!c.includes(_)) {
    const M = c.join(", ");
    throw new Error(`Unexpected public key alg "${_}", expected one of "${M}"`);
  }
  const I = await pc(No(m.clientDataJSON)), N = _l.getRootCertificates({
    identifier: T
  }), U = {
    aaguid: W,
    attStmt: q,
    authData: j,
    clientDataHash: I,
    credentialID: B,
    credentialPublicKey: X,
    rootCertificates: N,
    rpIdHash: G,
    attestationSafetyNetEnforceCTSCheck: u
  };
  let C = !1;
  if (T === "fido-u2f")
    C = await _de(U);
  else if (T === "packed")
    C = await Nde(U);
  else if (T === "android-safetynet")
    C = await Pde(U);
  else if (T === "android-key")
    C = await $de(U);
  else if (T === "tpm")
    C = await Ude(U);
  else if (T === "apple")
    C = await Gde(U);
  else if (T === "none") {
    if (q.size > 0)
      throw new Error("None attestation had unexpected attestation statement");
    C = !0;
  } else
    throw new Error(`Unsupported Attestation Format: ${T}`);
  if (!C)
    return { verified: !1 };
  const { credentialDeviceType: L, credentialBackedUp: k } = eU(J);
  return {
    verified: !0,
    registrationInfo: {
      fmt: T,
      aaguid: o5(W),
      credentialType: f,
      credential: {
        id: ki(B),
        publicKey: X,
        counter: D,
        transports: e.response.transports
      },
      attestationObject: S,
      userVerified: J.uv,
      credentialDeviceType: L,
      credentialBackedUp: k,
      origin: h.origin,
      rpID: K,
      authenticatorExtensionResults: V
    }
  };
}
async function Hde(t) {
  const { allowCredentials: e, challenge: n = await ZB(), timeout: r = 6e4, userVerification: i = "preferred", extensions: o, rpID: s } = t;
  let a = n;
  return typeof a == "string" && (a = vf(a)), {
    rpId: s,
    challenge: ki(a),
    allowCredentials: e?.map((c) => {
      if (!rd(c.id))
        throw new Error(`allowCredential id "${c.id}" is not a valid base64url string`);
      return {
        ...c,
        id: DA(c.id),
        type: "public-key"
      };
    }),
    timeout: r,
    userVerification: i,
    extensions: o
  };
}
async function Wde(t) {
  const { response: e, expectedChallenge: n, expectedOrigin: r, expectedRPID: i, expectedType: o, credential: s, requireUserVerification: a = !0, advancedFIDOConfig: c } = t, { id: u, rawId: l, type: d, response: f } = e;
  if (!u)
    throw new Error("Missing credential ID");
  if (u !== l)
    throw new Error("Credential ID was not base64url-encoded");
  if (d !== "public-key")
    throw new Error(`Unexpected credential type ${d}, expected "public-key"`);
  if (!e)
    throw new Error("Credential missing response");
  if (typeof f?.clientDataJSON != "string")
    throw new Error("Credential response clientDataJSON was not a string");
  const m = s5(f.clientDataJSON), { type: h, origin: y, challenge: x, tokenBinding: g } = m;
  if (Array.isArray(o)) {
    if (!o.includes(h)) {
      const K = o.join(", ");
      throw new Error(`Unexpected authentication response type "${h}", expected one of: ${K}`);
    }
  } else if (o) {
    if (h !== o)
      throw new Error(`Unexpected authentication response type "${h}", expected "${o}"`);
  } else if (h !== "webauthn.get")
    throw new Error(`Unexpected authentication response type: ${h}`);
  if (typeof n == "function") {
    if (!await n(x))
      throw new Error(`Custom challenge verifier returned false for registration response challenge "${x}"`);
  } else if (x !== n)
    throw new Error(`Unexpected authentication response challenge "${x}", expected "${n}"`);
  if (Array.isArray(r)) {
    if (!r.includes(y)) {
      const K = r.join(", ");
      throw new Error(`Unexpected authentication response origin "${y}", expected one of: ${K}`);
    }
  } else if (y !== r)
    throw new Error(`Unexpected authentication response origin "${y}", expected "${r}"`);
  if (!rd(f.authenticatorData))
    throw new Error("Credential response authenticatorData was not a base64url string");
  if (!rd(f.signature))
    throw new Error("Credential response signature was not a base64url string");
  if (f.userHandle && typeof f.userHandle != "string")
    throw new Error("Credential response userHandle was not a string");
  if (g) {
    if (typeof g != "object")
      throw new Error("ClientDataJSON tokenBinding was not an object");
    if (["present", "supported", "notSupported"].indexOf(g.status) < 0)
      throw new Error(`Unexpected tokenBinding status ${g.status}`);
  }
  const v = No(f.authenticatorData), S = JB(v), { rpIdHash: E, flags: T, counter: j, extensionsData: q } = S;
  let Y = [];
  typeof i == "string" ? Y = [i] : Y = i;
  const W = await tU(E, Y);
  if (c !== void 0) {
    const { userVerification: K } = c;
    if (K === "required" && !T.uv)
      throw new Error("User verification required, but user could not be verified");
  } else {
    if (!T.up)
      throw new Error("User not present during authentication");
    if (a && !T.uv)
      throw new Error("User verification required, but user could not be verified");
  }
  const G = await pc(No(f.clientDataJSON)), J = oi([v, G]), B = No(f.signature);
  if ((j > 0 || s.counter > 0) && j <= s.counter)
    throw new Error(`Response counter value ${j} was lower than expected ${s.counter}`);
  const { credentialDeviceType: D, credentialBackedUp: X } = eU(T);
  return {
    verified: await dc({
      signature: B,
      data: J,
      credentialPublicKey: s.publicKey
    }),
    authenticationInfo: {
      newCounter: j,
      credentialID: s.id,
      userVerified: T.uv,
      credentialDeviceType: D,
      credentialBackedUp: X,
      authenticatorExtensionResults: q,
      origin: m.origin,
      rpID: W
    }
  };
}
const zde = "NapCat WebUI";
class bd {
  static getPasskeyFilePath() {
    return be.join(at.configPath, "passkey.json");
  }
  // 内存中存储临时挑战数据
  static challenges = /* @__PURE__ */ new Map();
  static async ensurePasskeyFile() {
    try {
      const e = this.getPasskeyFilePath();
      await $s.mkdir(be.dirname(e), { recursive: !0 });
      try {
        await $s.access(e);
      } catch {
        await $s.writeFile(e, JSON.stringify({}, null, 2));
      }
    } catch {
    }
  }
  static async getAllPasskeys() {
    await this.ensurePasskeyFile();
    try {
      const e = this.getPasskeyFilePath(), n = await $s.readFile(e, "utf-8"), r = JSON.parse(n);
      return typeof r == "object" && r !== null ? r : {};
    } catch (e) {
      return console.error("Failed to read passkey file:", e), {};
    }
  }
  static async saveAllPasskeys(e) {
    await this.ensurePasskeyFile();
    const n = this.getPasskeyFilePath();
    await $s.writeFile(n, JSON.stringify(e, null, 2));
  }
  static async getUserPasskeys(e) {
    return (await this.getAllPasskeys())[e] || [];
  }
  // 持久性存储用户的passkey到统一配置文件
  static async setUserPasskeys(e, n) {
    const r = await this.getAllPasskeys();
    n.length > 0 ? r[e] = n : delete r[e], await this.saveAllPasskeys(r);
  }
  static async generateRegistrationOptions(e, n, r) {
    const i = await this.getUserPasskeys(e), o = await dde({
      rpName: zde,
      rpID: r,
      userID: new TextEncoder().encode(e),
      userName: n,
      attestationType: "none",
      excludeCredentials: i.map((s) => ({
        id: s.id,
        type: "public-key",
        transports: s.transports
      })),
      // Temporarily simplify authenticatorSelection - remove residentKey to avoid conflicts
      authenticatorSelection: {
        userVerification: "preferred"
      }
    });
    return this.challenges.set(`reg_${e}`, o.challenge), setTimeout(() => {
      this.challenges.delete(`reg_${e}`);
    }, 3e5), o;
  }
  static async verifyRegistration(e, n, r, i) {
    const o = this.challenges.get(`reg_${e}`);
    if (!o)
      throw new Error("Challenge not found or expired");
    const s = await qde({
      response: n,
      expectedChallenge: o,
      expectedOrigin: r,
      expectedRPID: i
    });
    if (s.verified && s.registrationInfo) {
      const { registrationInfo: a } = s, c = {
        id: a.credential.id,
        publicKey: ki(a.credential.publicKey),
        counter: a.credential.counter || 0,
        transports: n.response.transports
      }, u = await this.getUserPasskeys(e);
      u.push(c), await this.setUserPasskeys(e, u), this.challenges.delete(`reg_${e}`);
    }
    return s;
  }
  static async generateAuthenticationOptions(e, n) {
    const r = await this.getUserPasskeys(e), i = await Hde({
      rpID: n,
      allowCredentials: r.map((o) => ({
        id: o.id,
        type: "public-key",
        transports: o.transports
      })),
      userVerification: "preferred"
    });
    return this.challenges.set(`auth_${e}`, i.challenge), setTimeout(() => {
      this.challenges.delete(`auth_${e}`);
    }, 3e5), i;
  }
  static async verifyAuthentication(e, n, r, i) {
    const o = this.challenges.get(`auth_${e}`);
    if (!o)
      throw new Error("Challenge not found or expired");
    const s = await this.getUserPasskeys(e), a = s.find((u) => u.id === n.id);
    if (!a)
      throw new Error("Passkey not found");
    const c = await Wde({
      response: n,
      expectedChallenge: o,
      expectedOrigin: r,
      expectedRPID: i,
      credential: {
        id: a.id,
        publicKey: No(a.publicKey),
        counter: a.counter
      }
    });
    return c.verified && c.authenticationInfo && (a.counter = c.authenticationInfo.newCounter, await this.setUserPasskeys(e, s), this.challenges.delete(`auth_${e}`)), c;
  }
  static async hasPasskeys(e) {
    return (await this.getUserPasskeys(e)).length > 0;
  }
}
class xd {
  /**
   * 生成随机密钥（Base32格式）
   * @param length 密钥长度（字节），默认16字节
   * @returns Base32编码的密钥
   */
  static generateSecret(e = 16) {
    const n = Si.randomBytes(e);
    return this.toBase32(n);
  }
  /**
   * 验证一次性密码
   * @param secret Base32编码的密钥
   * @param code 用户输入的验证码
   * @param timeStep 时间步长（秒），默认30秒
   * @param window 允许的时间窗口（前后各多少个时间步长），默认1
   * @returns 是否验证通过
   */
  static verifyTotp(e, n, r = 30, i = 1) {
    const o = Math.floor(Date.now() / 1e3 / r);
    for (let s = -i; s <= i; s++)
      if (this.generateHotp(e, o + s) === n)
        return !0;
    return !1;
  }
  /**
   * 生成 HOTP (HMAC-based One-Time Password)
   * @param secret Base32编码的密钥
   * @param counter 计数器
   * @returns 6位数字验证码
   */
  static generateHotp(e, n) {
    const r = this.base32ToBytes(e), i = Buffer.alloc(8);
    let o = n;
    for (let g = 7; g >= 0; g--)
      i[g] = o & 255, o = Math.floor(o / 256);
    const s = Si.createHmac("sha1", r);
    s.update(i);
    const a = s.digest(), c = a.length, u = a[c - 1];
    if (u === void 0)
      return "000000";
    const l = u & 15, d = a[l] ?? 0, f = a[l + 1] ?? 0, m = a[l + 2] ?? 0, h = a[l + 3] ?? 0;
    return (((d & 127) << 24 | (f & 255) << 16 | (m & 255) << 8 | h & 255) % 1e6).toString().padStart(6, "0");
  }
  /**
   * 生成 QR Code URL
   * @param secret Base32编码的密钥
   * @param account 账户名称
   * @param issuer 发行方名称
   * @returns otpauth:// URL
   */
  static generateQrCodeUrl(e, n, r) {
    const i = encodeURIComponent(r);
    return `otpauth://totp/${encodeURIComponent(`${r}:${n}`)}?secret=${e}&issuer=${i}&algorithm=SHA1&digits=6&period=30`;
  }
  /**
   * 将字节数组转换为 Base32 编码
   * @param buffer 字节数组
   * @returns Base32编码字符串
   */
  static toBase32(e) {
    const n = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
    let r = "";
    for (let i = 0; i < e.length; i += 5) {
      const o = e[i] ?? 0, s = e[i + 1] ?? 0, a = e[i + 2] ?? 0, c = e[i + 3] ?? 0, u = e[i + 4] ?? 0;
      r += n[o >> 3 & 31], r += n[(o << 2 | s >> 6) & 31], r += n[s >> 1 & 31], r += n[(s << 4 | a >> 4) & 31], r += n[(a << 1 | c >> 7) & 31], r += n[c >> 2 & 31], r += n[(c << 3 | u >> 5) & 31], r += n[u & 31];
    }
    return r.replace(/=+$/, "");
  }
  /**
   * 将 Base32 字符串转换为字节数组
   * @param base32 Base32编码字符串
   * @returns 字节数组
   */
  static base32ToBytes(e) {
    const n = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", r = e.toUpperCase().replace(/=+$/, ""), i = [];
    let o = 0, s = 0;
    for (const a of r) {
      const c = n.indexOf(a);
      c !== -1 && (o = o << 5 | c, s += 5, s >= 8 && (i.push(o >> s - 8 & 255), s -= 8));
    }
    return Buffer.from(i);
  }
}
const Kde = async (t, e) => {
  const n = await Et.GetWebUIConfig(), { hash: r, totpCode: i } = t.body, o = t.ip || t.socket.remoteAddress || "";
  if (qn(r))
    return ne(e, "token is empty");
  if (!ve.checkLoginRate(o, n.loginRate))
    return ne(e, "login rate limit");
  const s = ls();
  if (!s)
    return ne(e, "Server token not initialized");
  if (!nn.comparePasswordHash(s, r))
    return ne(e, "token is invalid");
  if (n.enable2FA && n.totpSecret) {
    if (!i)
      return me(e, {
        require2FA: !0,
        message: "Please enter your authenticator code"
      });
    if (!xd.verifyTotp(n.totpSecret, i))
      return ne(e, "Invalid or expired code");
    const c = Buffer.from(JSON.stringify(nn.signCredential(r))).toString("base64");
    return me(e, {
      Credential: c,
      require2FA: !1
    });
  }
  const a = Buffer.from(JSON.stringify(nn.signCredential(r))).toString("base64");
  return me(e, {
    Credential: a
  });
}, Vde = async (t, e) => {
  const n = t.headers.authorization;
  try {
    const r = n?.split(" ")[1], i = JSON.parse(Buffer.from(r, "base64").toString());
    return nn.revokeCredential(i), me(e, "Logged out successfully");
  } catch {
    return ne(e, "Logout failed");
  }
}, Yde = async (t, e) => {
  const n = t.headers.authorization;
  try {
    const r = n?.split(" ")[1], i = JSON.parse(Buffer.from(r, "base64").toString());
    if (nn.isCredentialRevoked(i))
      return ne(e, "Token has been revoked");
    const o = ls();
    return o ? nn.validateCredentialWithinOneHour(o, i) ? me(e, null) : ne(e, "Authorization Failed") : ne(e, "Server token not initialized");
  } catch {
    return ne(e, "Authorization Failed");
  }
}, Jde = async (t, e) => {
  const { oldToken: n, newToken: r } = t.body, i = t.headers.authorization;
  if (qn(r))
    return ne(e, "newToken is empty");
  if (qn(n))
    return ne(e, "oldToken is required");
  if (n === r)
    return ne(e, "新密码不能与旧密码相同");
  if (r.length < 6)
    return ne(e, "新密码至少需要6个字符");
  if (!/[a-zA-Z]/.test(r))
    return ne(e, "新密码必须包含字母");
  if (!/[0-9]/.test(r))
    return ne(e, "新密码必须包含数字");
  try {
    if (i) {
      const s = i.split(" ")[1], a = JSON.parse(Buffer.from(s, "base64").toString());
      nn.revokeCredential(a);
    }
    const o = ls();
    return o ? o !== n ? ne(e, "旧 token 不匹配") : (await Et.UpdateWebUIConfig({ token: r }), CU(r), me(e, "Token updated successfully")) : ne(e, "Server token not initialized");
  } catch (o) {
    return ne(e, `Failed to update token: ${o.message}`);
  }
}, Xde = async (t, e) => {
  try {
    const n = "napcat-user", r = "NapCat User", o = (t.get("host") || "localhost").split(":")[0] || "localhost", s = o === "127.0.0.1" || o === "localhost" ? "localhost" : o, a = await bd.generateRegistrationOptions(n, r, s);
    return me(e, a);
  } catch (n) {
    return ne(e, `Failed to generate registration options: ${n.message}`);
  }
}, Zde = async (t, e) => {
  try {
    const { response: n } = t.body;
    if (!n)
      return ne(e, "Response is required");
    const r = t.get("origin") || t.protocol + "://" + t.get("host"), o = (t.get("host") || "localhost").split(":")[0] || "localhost", s = o === "127.0.0.1" || o === "localhost" ? "localhost" : o;
    return (await bd.verifyRegistration("napcat-user", n, r, s)).verified ? me(e, { verified: !0 }) : ne(e, "Registration failed");
  } catch (n) {
    return ne(e, `Registration verification failed: ${n.message}`);
  }
}, efe = async (t, e) => {
  try {
    const n = "napcat-user";
    if (!await bd.hasPasskeys(n))
      return ne(e, "No passkeys registered");
    const i = (t.get("host") || "localhost").split(":")[0] || "localhost", o = i === "127.0.0.1" || i === "localhost" ? "localhost" : i, s = await bd.generateAuthenticationOptions(n, o);
    return me(e, s);
  } catch (n) {
    return ne(e, `Failed to generate authentication options: ${n.message}`);
  }
}, tfe = async (t, e) => {
  try {
    const { response: n } = t.body;
    if (!n)
      return ne(e, "Response is required");
    const r = await Et.GetWebUIConfig(), i = t.ip || t.socket.remoteAddress || "";
    if (!ve.checkLoginRate(i, r.loginRate))
      return ne(e, "login rate limit");
    const o = t.get("origin") || t.protocol + "://" + t.get("host"), a = (t.get("host") || "localhost").split(":")[0] || "localhost", c = a === "127.0.0.1" || a === "localhost" ? "localhost" : a;
    if ((await bd.verifyAuthentication("napcat-user", n, o, c)).verified) {
      const d = ls();
      if (!d)
        return ne(e, "Server token not initialized");
      const f = Buffer.from(JSON.stringify(nn.signCredential(nn.generatePasswordHash(d)))).toString("base64");
      return me(e, {
        Credential: f
      });
    } else
      return ne(e, "Authentication failed");
  } catch (n) {
    return ne(e, `Authentication verification failed: ${n.message}`);
  }
}, nfe = async (t, e) => {
  try {
    const n = await Et.GetWebUIConfig();
    return me(e, {
      enable2FA: n.enable2FA || !1,
      hasSecret: !!n.totpSecret
    });
  } catch (n) {
    return ne(e, `获取2FA状态失败: ${n.message}`);
  }
}, rfe = async (t, e) => {
  try {
    const n = xd.generateSecret(), r = xd.generateQrCodeUrl(n, "NapCat WebUI", "NapCat");
    return me(e, {
      secret: n,
      qrCodeUrl: r
    });
  } catch (n) {
    return ne(e, `Failed to generate 2FA secret: ${n.message}`);
  }
}, ife = async (t, e) => {
  try {
    const { secret: n, totpCode: r } = t.body;
    return !n || !r ? ne(e, "secret and totpCode are required") : xd.verifyTotp(n, r) ? (await Et.UpdateWebUIConfig({
      enable2FA: !0,
      totpSecret: n
    }), me(e, { message: "2FA enabled" })) : ne(e, "Invalid code");
  } catch (n) {
    return ne(e, `Failed to enable 2FA: ${n.message}`);
  }
}, ofe = async (t, e) => {
  try {
    const { totpCode: n } = t.body;
    if (!n)
      return ne(e, "totpCode is required to disable 2FA");
    const r = await Et.GetWebUIConfig();
    return r.totpSecret ? xd.verifyTotp(r.totpSecret, n) ? (await Et.UpdateWebUIConfig({
      enable2FA: !1,
      totpSecret: ""
    }), me(e, { message: "2FA disabled" })) : ne(e, "Invalid code") : ne(e, "2FA is not enabled");
  } catch (n) {
    return ne(e, `Failed to disable 2FA: ${n.message}`);
  }
}, gi = yr();
gi.post("/login", Kde);
gi.post("/check", Yde);
gi.post("/logout", Vde);
gi.post("/update_token", Jde);
gi.post("/passkey/generate-registration-options", Xde);
gi.post("/passkey/verify-registration", Zde);
gi.post("/passkey/generate-authentication-options", efe);
gi.post("/passkey/verify-authentication", tfe);
gi.get("/2fa/status", nfe);
gi.post("/2fa/generate-secret", rfe);
gi.post("/2fa/enable", ife);
gi.post("/2fa/disable", ofe);
class D_ {
  _listeners = [];
  _event;
  get event() {
    return this._event || (this._event = (e) => (this._listeners.push(e), {
      dispose: () => {
        for (let r = 0; r < this._listeners.length; r++)
          if (this._listeners[r] === e) {
            this._listeners.splice(r, 1);
            return;
          }
      }
    })), this._event;
  }
  fire(e) {
    const n = [];
    for (let r = 0; r < this._listeners.length; r++)
      n.push(this._listeners[r]);
    for (let r = 0; r < n.length; r++)
      n[r].call(void 0, e);
  }
}
const F_ = 80, O_ = 24, sfe = "", afe = "";
class iU {
  _socket;
  // HACK: This is unsafe
  _pid = 0;
  _fd = 0;
  _pty;
  _file;
  // HACK: This is unsafe
  _name;
  // HACK: This is unsafe
  _cols = 0;
  _rows = 0;
  _readable = !1;
  _writable = !1;
  _internalee;
  _flowControlPause;
  _flowControlResume;
  handleFlowControl;
  _onData = new D_();
  get onData() {
    return this._onData.event;
  }
  _onExit = new D_();
  get onExit() {
    return this._onExit.event;
  }
  get pid() {
    return this._pid;
  }
  get cols() {
    return this._cols;
  }
  get rows() {
    return this._rows;
  }
  constructor(e) {
    this._internalee = new RL(), this.handleFlowControl = !!e?.handleFlowControl, this._flowControlPause = e?.flowControlPause || sfe, this._flowControlResume = e?.flowControlResume || afe, e && (this._checkType("name", e.name ? e.name : void 0, "string"), this._checkType("cols", e.cols ? e.cols : void 0, "number"), this._checkType("rows", e.rows ? e.rows : void 0, "number"), this._checkType("cwd", e.cwd ? e.cwd : void 0, "string"), this._checkType("env", e.env ? e.env : void 0, "object"), this._checkType("uid", e.uid ? e.uid : void 0, "number"), this._checkType("gid", e.gid ? e.gid : void 0, "number"), this._checkType("encoding", e.encoding ? e.encoding : void 0, "string"));
  }
  write(e) {
    if (this.handleFlowControl) {
      if (e === this._flowControlPause) {
        this.pause();
        return;
      }
      if (e === this._flowControlResume) {
        this.resume();
        return;
      }
    }
    this._write(e);
  }
  _forwardEvents() {
    this.on("data", (e) => this._onData.fire(e)), this.on("exit", (e, n) => this._onExit.fire({ exitCode: e, signal: n }));
  }
  _checkType(e, n, r, i = !1) {
    if (n !== void 0) {
      if (i && Array.isArray(n)) {
        n.forEach((o, s) => {
          if (typeof o !== r)
            throw new Error(`${e}[${s}] must be a ${r} (not a ${typeof o[s]})`);
        });
        return;
      }
      if (typeof n !== r)
        throw new Error(`${e} must be a ${r} (not a ${typeof n})`);
    }
  }
  /** See net.Socket.end */
  end(e) {
    this._socket.end(e);
  }
  /** See stream.Readable.pipe */
  pipe(e, n) {
    return this._socket.pipe(e, n);
  }
  /** See net.Socket.pause */
  pause() {
    return this._socket.pause();
  }
  /** See net.Socket.resume */
  resume() {
    return this._socket.resume();
  }
  /** See net.Socket.setEncoding */
  setEncoding(e) {
    this._socket._decoder && delete this._socket._decoder, e && this._socket.setEncoding(e);
  }
  addListener(e, n) {
    this.on(e, n);
  }
  on(e, n) {
    if (e === "close") {
      this._internalee.on("close", n);
      return;
    }
    this._socket.on(e, n);
  }
  emit(e, ...n) {
    return e === "close" ? this._internalee.emit.apply(this._internalee, arguments) : this._socket.emit.apply(this._socket, arguments);
  }
  listeners(e) {
    return this._socket.listeners(e);
  }
  removeListener(e, n) {
    this._socket.removeListener(e, n);
  }
  removeAllListeners(e) {
    this._socket.removeAllListeners(e);
  }
  once(e, n) {
    this._socket.once(e, n);
  }
  _close() {
    this._socket.readable = !1, this.write = () => {
    }, this.end = () => {
    }, this._writable = !1, this._readable = !1;
  }
  _parseEnv(e) {
    const n = Object.keys(e || {}), r = [];
    for (let i = 0; i < n.length; i++)
      n[i] !== void 0 && r.push(n[i] + "=" + e[n[i]]);
    return r;
  }
}
const cfe = 1e3;
class ufe {
  constructor(e) {
    this._conoutPipeName = e;
    const n = { conoutPipeName: e }, r = $u(Pg(import.meta.url));
    this._worker = new QL(gm(r, "worker/conoutSocketWorker.mjs"), { workerData: n }), this._worker.on("message", (i) => {
      switch (i) {
        case $L.READY:
          this._onReady.fire();
          return;
        default:
          console.warn("Unexpected ConoutWorkerMessage", i);
      }
    });
  }
  _worker;
  _drainTimeout;
  _isDisposed = !1;
  _onReady = new D_();
  get onReady() {
    return this._onReady.event;
  }
  dispose() {
    this._isDisposed || (this._isDisposed = !0, this._drainDataAndClose());
  }
  connectSocket(e) {
    e.connect(GL(this._conoutPipeName));
  }
  _drainDataAndClose() {
    this._drainTimeout && clearTimeout(this._drainTimeout), this._drainTimeout = setTimeout(() => this._destroySocket(), cfe);
  }
  async _destroySocket() {
    await this._worker.terminate();
  }
}
let Xx, Zx;
const lfe = 1e3;
class pfe {
  constructor(e, n, r, i, o, s, a, c, u = !1, l = !1) {
    this._useConpty = c, this._useConptyDll = u, (this._useConpty === void 0 || this._useConpty === !0) && (this._useConpty = this._getWindowsBuildNumber() >= 18309), this._useConpty ? Xx || (Xx = R_("./native/pty/" + process.platform + "." + process.arch + "/conpty.node")) : Zx || (Zx = R_("./native/pty/" + process.platform + "." + process.arch + "/pty.node")), this._ptyNative = this._useConpty ? Xx : Zx, i = Ze.resolve(i);
    const d = oU(e, n);
    let f;
    this._useConpty ? f = this._ptyNative.startProcess(e, o, s, a, this._generatePipeName(), l, this._useConptyDll) : (f = this._ptyNative.startProcess(e, d, r, i, o, s, a), this._pid = f.pid, this._innerPid = f.innerPid), this._fd = f.fd, this._pty = f.pty, this._outSocket = new Y2(), this._outSocket.setEncoding("utf8"), this._conoutSocketWorker = new ufe(f.conout), this._conoutSocketWorker.onReady(() => {
      this._conoutSocketWorker.connectSocket(this._outSocket);
    }), this._outSocket.on("connect", () => {
      this._outSocket.emit("ready_datapipe");
    });
    const m = Ae.openSync(f.conin, "w");
    if (this._inSocket = new Y2({
      fd: m,
      readable: !1,
      writable: !0
    }), this._inSocket.setEncoding("utf8"), this._useConpty) {
      const h = this._ptyNative.connect(this._pty, d, i, r, (y) => this._$onProcessExit(y));
      this._innerPid = h.pid;
    }
  }
  _inSocket;
  _outSocket;
  _pid = 0;
  _innerPid = 0;
  _closeTimeout;
  _exitCode;
  _conoutSocketWorker;
  _fd;
  _pty;
  _ptyNative;
  get inSocket() {
    return this._inSocket;
  }
  get outSocket() {
    return this._outSocket;
  }
  get fd() {
    return this._fd;
  }
  get innerPid() {
    return this._innerPid;
  }
  get pty() {
    return this._pty;
  }
  resize(e, n) {
    if (this._useConpty) {
      if (this._exitCode !== void 0)
        throw new Error("Cannot resize a pty that has already exited");
      this._ptyNative.resize(this._pty, e, n, this._useConptyDll);
      return;
    }
    this._ptyNative.resize(this._pid, e, n);
  }
  clear() {
    this._useConpty && this._ptyNative.clear(this._pty, this._useConptyDll);
  }
  kill() {
    if (this._inSocket.readable = !1, this._outSocket.readable = !1, this._useConpty)
      this._getConsoleProcessList().then((e) => {
        e.forEach((n) => {
          try {
            process.kill(n);
          } catch {
          }
        }), this._ptyNative.kill(this._pty, this._useConptyDll);
      });
    else {
      const e = this._ptyNative.getProcessList(this._pid);
      this._ptyNative.kill(this._pid, this._innerPid), e.forEach((n) => {
        try {
          process.kill(n);
        } catch {
        }
      });
    }
    this._conoutSocketWorker.dispose();
  }
  _getConsoleProcessList() {
    const e = $u(hc(import.meta.url));
    return new Promise((n) => {
      const r = DL(Ze.join(e, "conpty_console_list_agent"), [this._innerPid.toString()]);
      r.on("message", (o) => {
        clearTimeout(i), n(o.consoleProcessList);
      });
      const i = setTimeout(() => {
        r.kill(), n([this._innerPid]);
      }, 5e3);
    });
  }
  get exitCode() {
    if (this._useConpty)
      return this._exitCode;
    const e = this._ptyNative.getExitCode(this._innerPid);
    return e === -1 ? void 0 : e;
  }
  _getWindowsBuildNumber() {
    const e = Vs.release();
    if (e.length > 50)
      return 0;
    const n = /^(\d{1,5})\.(\d{1,5})\.(\d{1,10})/.exec(e);
    let r = 0;
    return n && n.length === 4 && (r = parseInt(n[3])), r;
  }
  _generatePipeName() {
    return `conpty-${Math.random() * 1e7}`;
  }
  /**
   * Triggered from the native side when a contpy process exits.
   */
  _$onProcessExit(e) {
    this._exitCode = e, this._flushDataAndCleanUp(), this._outSocket.on("data", () => this._flushDataAndCleanUp());
  }
  _flushDataAndCleanUp() {
    this._closeTimeout && clearTimeout(this._closeTimeout), this._closeTimeout = setTimeout(() => this._cleanUpProcess(), lfe);
  }
  _cleanUpProcess() {
    this._inSocket.readable = !1, this._outSocket.readable = !1, this._outSocket.destroy();
  }
}
function oU(t, e) {
  if (dfe(e))
    return e.length === 0 ? t : `${oU(t, [])} ${e}`;
  const n = [t];
  Array.prototype.push.apply(n, e);
  let r = "";
  for (let i = 0; i < n.length; i++) {
    i > 0 && (r += " ");
    const o = n[i], s = ffe(o[0] !== '"', o[o.length - 1] !== '"'), a = o[0] !== '"' && o[o.length - 1] !== '"', c = o === "" || (o.indexOf(" ") !== -1 || o.indexOf("	") !== -1) && o.length > 1 && (s || a);
    c && (r += '"');
    let u = 0;
    for (let l = 0; l < o.length; l++) {
      const d = o[l];
      d === "\\" ? u++ : d === '"' ? (r += Oh("\\", u * 2 + 1), r += '"', u = 0) : (r += Oh("\\", u), u = 0, r += d);
    }
    c ? (r += Oh("\\", u * 2), r += '"') : r += Oh("\\", u);
  }
  return r;
}
function dfe(t) {
  return typeof t == "string";
}
function Oh(t, e) {
  let n = "";
  for (let r = 0; r < e; r++)
    n += t;
  return n;
}
function ffe(t, e) {
  return t && !e || !t && e;
}
function sU(t, ...e) {
  return e.forEach((n) => Object.keys(n).forEach((r) => t[r] = n[r])), t;
}
const hfe = "cmd.exe", mfe = "Windows Shell";
class gfe extends iU {
  _isReady;
  _deferreds;
  _agent;
  constructor(e, n, r) {
    super(r), this._checkType("args", n, "string", !0), n = n || [], e = e || hfe, r = r || {}, r.env = r.env || process.env, r.encoding && console.warn("Setting encoding on Windows is not supported");
    const i = sU({}, r.env);
    this._cols = r.cols || F_, this._rows = r.rows || O_;
    const o = r.cwd || process.cwd(), s = r.name || i.TERM || mfe, a = this._parseEnv(i);
    this._isReady = !1, this._deferreds = [], this._agent = new pfe(e, n, a, o, this._cols, this._rows, !1, r.useConpty, r.useConptyDll, r.conptyInheritCursor), this._socket = this._agent.outSocket, this._pid = this._agent.innerPid, this._fd = this._agent.fd, this._pty = this._agent.pty, this._socket.on("ready_datapipe", () => {
      ["connect", "data", "end", "timeout", "drain"].forEach((c) => {
        this._socket.on(c, () => {
          !this._isReady && c === "data" && (this._isReady = !0, this._deferreds.forEach((u) => {
            u.run();
          }), this._deferreds = []);
        });
      }), this._socket.on("error", (c) => {
        if (this._close(), !(c.code && (~c.code.indexOf("errno 5") || ~c.code.indexOf("EIO"))) && this.listeners("error").length < 2)
          throw c;
      }), this._socket.on("close", () => {
        this.emit("exit", this._agent.exitCode), this._close();
      });
    }), this._file = e, this._name = s, this._readable = !0, this._writable = !0, this._forwardEvents();
  }
  _write(e) {
    this._defer(this._doWrite, e);
  }
  _doWrite(e) {
    this._agent.inSocket.write(e);
  }
  /**
   * openpty
   */
  static open(e) {
    throw new Error("open() not supported on windows, use Fork() instead.");
  }
  /**
   * TTY
   */
  resize(e, n) {
    if (e <= 0 || n <= 0 || isNaN(e) || isNaN(n) || e === 1 / 0 || n === 1 / 0)
      throw new Error("resizing must be done using positive cols and rows");
    this._deferNoArgs(() => {
      this._agent.resize(e, n), this._cols = e, this._rows = n;
    });
  }
  clear() {
    this._deferNoArgs(() => {
      this._agent.clear();
    });
  }
  destroy() {
    this._deferNoArgs(() => {
      this.kill();
    });
  }
  kill(e) {
    this._deferNoArgs(() => {
      if (e)
        throw new Error("Signals not supported on windows.");
      this._close(), this._agent.kill();
    });
  }
  // @ts-expect-error - This is a private method that is not part of the public API.
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  _deferNoArgs(e) {
    if (this._isReady) {
      e.call(this);
      return;
    }
    this._deferreds.push({
      run: () => e.call(this)
    });
  }
  _defer(e, n) {
    if (this._isReady) {
      e.call(this, n);
      return;
    }
    this._deferreds.push({
      run: () => e.call(this, n)
    });
  }
  get process() {
    return this._name;
  }
  get master() {
    throw new Error("master is not supported on Windows");
  }
  get slave() {
    throw new Error("slave is not supported on Windows");
  }
}
function yfe() {
  let t;
  try {
    t = R_("./native/pty/" + process.platform + "." + process.arch + "/pty.node");
  } catch {
    t = void 0;
  }
  return t;
}
let ew;
const Gl = new Proxy({}, {
  get(t, e) {
    return ew || (ew = yfe()), ew[e];
  }
});
let aa;
aa = "../build/Release/spawn-helper";
const vfe = Ze.dirname(hc(import.meta.url));
aa = Ze.resolve(vfe, aa);
aa = aa.replace("app.asar", "app.asar.unpacked");
aa = aa.replace("node_modules.asar", "node_modules.asar.unpacked");
const bfe = "sh", xfe = "xterm", wfe = 200;
class I2 extends iU {
  _fd;
  _pty;
  _file;
  _name;
  _readable;
  _writable;
  _boundClose = !1;
  _emittedClose = !1;
  _master;
  _slave;
  get master() {
    return this._master;
  }
  get slave() {
    return this._slave;
  }
  constructor(e, n, r) {
    if (super(r), typeof n == "string")
      throw new Error("args as a string is not supported on unix.");
    n = n || [], e = e || bfe, r = r || {}, r.env = r.env || process.env, this._cols = r.cols || F_, this._rows = r.rows || O_;
    const i = r.uid ?? -1, o = r.gid ?? -1, s = sU({}, r.env);
    r.env === process.env && this._sanitizeEnv(s);
    const a = r.cwd || process.cwd();
    s.PWD = a;
    const c = r.name || s.TERM || xfe;
    s.TERM = c;
    const u = this._parseEnv(s), l = r.encoding === void 0 ? "utf8" : r.encoding, d = (m, h) => {
      if (!this._emittedClose) {
        if (this._boundClose)
          return;
        this._boundClose = !0;
        let y = setTimeout(() => {
          y = null, this._socket.destroy();
        }, wfe);
        this.once("close", () => {
          y !== null && clearTimeout(y), this.emit("exit", m, h);
        });
        return;
      }
      this.emit("exit", m, h);
    }, f = Gl.fork(e, n, u, a, this._cols, this._rows, i, o, l === "utf8", aa, d);
    this._socket = new Ty.ReadStream(f.fd), l !== null && this._socket.setEncoding(l), this._socket.on("error", (m) => {
      if (!(m.code && ~m.code.indexOf("EAGAIN")) && (this._close(), this._emittedClose || (this._emittedClose = !0, this.emit("close")), !(m.code && (~m.code.indexOf("errno 5") || ~m.code.indexOf("EIO"))) && this.listeners("error").length < 2))
        throw m;
    }), this._pid = f.pid, this._fd = f.fd, this._pty = f.pty, this._file = e, this._name = c, this._readable = !0, this._writable = !0, this._socket.on("close", () => {
      this._emittedClose || (this._emittedClose = !0, this._close(), this.emit("close"));
    }), this._forwardEvents();
  }
  _write(e) {
    this._socket.write(e);
  }
  /* Accessors */
  get fd() {
    return this._fd;
  }
  get ptsName() {
    return this._pty;
  }
  /**
  * openpty
  */
  static open(e) {
    const n = Object.create(I2.prototype);
    e = e || {}, arguments.length > 1 && (e = {
      cols: arguments[1],
      rows: arguments[2]
    });
    const r = e.cols || F_, i = e.rows || O_, o = e.encoding === void 0 ? "utf8" : e.encoding, s = Gl.open(r, i);
    return n._master = new Ty.ReadStream(s.master), o !== null && n._master.setEncoding(o), n._master.resume(), n._slave = new Ty.ReadStream(s.slave), o !== null && n._slave.setEncoding(o), n._slave.resume(), n._socket = n._master, n._pid = -1, n._fd = s.master, n._pty = s.pty, n._file = process.argv[0] || "node", n._name = process.env.TERM || "", n._readable = !0, n._writable = !0, n._socket.on("error", (a) => {
      if (n._close(), n.listeners("error").length < 2)
        throw a;
    }), n._socket.on("close", () => {
      n._close();
    }), n;
  }
  destroy() {
    this._close(), this._socket.once("close", () => {
      this.kill("SIGHUP");
    }), this._socket.destroy();
  }
  kill(e) {
    try {
      process.kill(this.pid, e || "SIGHUP");
    } catch {
    }
  }
  /**
  * Gets the name of the process.
  */
  get process() {
    if (process.platform === "darwin") {
      const e = Gl.process(this._fd);
      return e !== "kernel_task" ? e : this._file;
    }
    return Gl.process(this._fd, this._pty) || this._file;
  }
  /**
  * TTY
  */
  resize(e, n) {
    if (e <= 0 || n <= 0 || isNaN(e) || isNaN(n) || e === 1 / 0 || n === 1 / 0)
      throw new Error("resizing must be done using positive cols and rows");
    Gl.resize(this._fd, e, n), this._cols = e, this._rows = n;
  }
  clear() {
  }
  _sanitizeEnv(e) {
    delete e.TMUX, delete e.TMUX_PANE, delete e.STY, delete e.WINDOW, delete e.WINDOWID, delete e.TERMCAP, delete e.COLUMNS, delete e.LINES;
  }
}
let M_;
process.platform === "win32" ? M_ = gfe : M_ = I2;
function Sfe(t, e, n) {
  return new M_(t, e, n);
}
function R_(t) {
  const e = { exports: {} }, n = H_(Pg(import.meta.url));
  return process.dlopen(e, xe.join(n, t)), e.exports;
}
class _fe {
  terminals = /* @__PURE__ */ new Map();
  wss = null;
  initialize(e, n, r, i) {
    i?.log("[NapCat] [WebUi] terminal websocket initialized"), this.wss = new qp({
      noServer: !0,
      verifyClient: async (o, s) => {
        const a = new URL(o.req.url || "", "ws://localhost"), c = a.searchParams.get("token"), u = a.searchParams.get("id");
        if (!c || !u) {
          s(!1, 401, "Unauthorized");
          return;
        }
        let l;
        try {
          l = JSON.parse(Buffer.from(c, "base64").toString("utf-8"));
        } catch {
          s(!1, 401, "Unauthorized");
          return;
        }
        const d = await Et.GetWebUIConfig();
        if (!nn.validateCredentialWithinOneHour(d.token, l)) {
          s(!1, 401, "Unauthorized");
          return;
        }
        s(!0);
      }
    }), this.wss.handleUpgrade(e, n, r, (o) => {
      this.wss?.emit("connection", o, e);
    }), this.wss.on("connection", async (o, s) => {
      i?.log("建立终端连接");
      try {
        const c = new URL(s.url || "", "ws://localhost").searchParams.get("id"), u = this.terminals.get(c);
        if (!u) {
          o.close();
          return;
        }
        u.sockets.add(o), u.lastAccess = Date.now(), o.readyState === fr.OPEN && o.send(JSON.stringify({ type: "output", data: u.buffer })), o.on("message", (l) => {
          if (u) {
            let d;
            Array.isArray(l) ? d = Buffer.concat(l).toString() : d = l.toString();
            const f = JSON.parse(d);
            f.type === "input" && u.pty.write(f.data), f.type === "resize" && u.pty.resize(f.cols, f.rows);
          }
        }), o.on("close", () => {
          u.sockets.delete(o), u.sockets.size === 0 && !u.isClosing && (u.isClosing = !0, Pn.platform() === "win32" ? process.kill(u.pty.pid) : u.pty.kill());
        });
      } catch (a) {
        console.error("WebSocket authentication failed:", a), o.close();
      }
    });
  }
  // 修改：新增 cols 和 rows 参数，同步 xterm 尺寸，防止错位
  createTerminal(e, n) {
    const r = Do(), i = Pn.platform() === "win32" ? "powershell.exe" : "bash", o = Sfe(i, [], {
      name: "xterm-256color",
      cols: e,
      // 使用客户端传入的 cols
      rows: n,
      // 使用客户端传入的 rows
      cwd: process.cwd(),
      env: {
        ...process.env,
        LANG: Pn.platform() === "win32" ? "chcp 65001" : "zh_CN.UTF-8",
        TERM: "xterm-256color"
      }
    }), s = {
      pty: o,
      lastAccess: Date.now(),
      sockets: /* @__PURE__ */ new Set(),
      isClosing: !1,
      buffer: ""
      // 初始化终端内容缓存
    };
    return o.onData((a) => {
      s.buffer += a, s.sockets.forEach((c) => {
        c.readyState === fr.OPEN && c.send(JSON.stringify({ type: "output", data: a }));
      });
    }), o.onExit(() => {
      this.closeTerminal(r);
    }), this.terminals.set(r, s), { id: r, instance: s };
  }
  closeTerminal(e) {
    const n = this.terminals.get(e);
    n && (n.isClosing || (n.isClosing = !0, Pn.platform() === "win32" ? process.kill(n.pty.pid) : n.pty.kill()), n.sockets.forEach((r) => r.close()), this.terminals.delete(e));
  }
  getTerminal(e) {
    return this.terminals.get(e);
  }
  getTerminalList() {
    return Array.from(this.terminals.keys()).map((e) => ({
      id: e,
      lastAccess: this.terminals.get(e).lastAccess
    }));
  }
}
const by = new _fe(), Efe = process.platform === "darwin", aU = (t) => t.replace(/token=[\w\d]+/gi, "token=***"), Afe = async (t, e) => {
  const n = t.query.id;
  if (!n || typeof n != "string")
    return ne(e, "ID不能为空");
  if (n.includes(".."))
    return ne(e, "ID不合法");
  const r = await Et.GetLogContent(n), i = aU(r);
  return me(e, i);
}, Ife = async (t, e) => {
  const n = await Et.GetLogsList();
  return me(e, n);
}, Cfe = async (t, e) => {
  e.setHeader("Content-Type", "text/event-stream"), e.setHeader("Connection", "keep-alive");
  const n = (r) => {
    try {
      const i = aU(r);
      e.write(`data: ${i}

`);
    } catch (i) {
      console.error("向客户端写入日志数据时出错:", i);
    }
  };
  U_.subscribe(n), t.on("close", () => {
    U_.unsubscribe(n);
  });
}, Tfe = async (t, e) => {
  if (Efe)
    return ne(e, "MacOS不支持终端");
  try {
    const { cols: n, rows: r } = t.body, { id: i } = by.createTerminal(n, r);
    return me(e, { id: i });
  } catch (n) {
    return console.error("Failed to create terminal:", n), ne(e, "创建终端失败");
  }
}, kfe = (t, e) => {
  const n = by.getTerminalList();
  return me(e, n);
}, Nfe = (t, e) => {
  const n = t.params.id;
  return n ? (by.closeTerminal(n), me(e, {})) : ne(e, "ID不能为空");
}, Dc = yr();
Dc.get("/GetLog", Afe);
Dc.get("/GetLogList", Ife);
Dc.get("/GetLogRealTime", Cfe);
Dc.get("/terminal/list", kfe);
Dc.post("/terminal/create", Tfe);
Dc.post("/terminal/:id/close", Nfe);
const Pfe = (t, e) => {
  const n = ve.GetNapCatVersion();
  me(e, { version: n });
}, Dfe = async (t, e) => {
  try {
    const n = await J7();
    me(e, n);
  } catch (n) {
    e.status(500).json({ error: "Failed to fetch latest tag", details: n.message });
  }
}, Ffe = async (t, e) => {
  try {
    const n = parseInt(t.query.page) || 1, r = parseInt(t.query.pageSize) || 20, i = t.query.type, o = (t.query.search || "").toLowerCase().trim(), s = t.query.mirror;
    let a = [], c = [], u = "";
    s && (u = s);
    const l = !i || i === "all" || i === "release", d = i === "action" || i === "all";
    if (l)
      try {
        const v = await k6(s);
        s || (u = v.mirror), a = v.tags.map((S) => {
          const E = /-(alpha|beta|rc|dev|pre|snapshot)/i.test(S);
          return {
            tag: S,
            type: E ? "prerelease" : "release"
          };
        }), a.sort((S, E) => -S6(S.tag, E.tag));
      } catch {
        a = [];
      }
    if (d)
      try {
        const { artifacts: v, mirror: S } = await H7("NapNeko", "NapCatQQ", "build.yml", "main", 10, s), T = ve.getWorkingEnv() === _0.Framework ? "NapCat.Framework" : "NapCat.Shell";
        !s && S && (u = S), c = v.filter((j) => j && j.name === T).map((j) => ({
          tag: `action-${j.id}`,
          type: "action",
          artifactId: j.id,
          artifactName: j.name,
          createdAt: j.created_at,
          expiresAt: j.expires_at,
          size: j.size_in_bytes,
          workflowRunId: j.workflow_run_id,
          headSha: j.head_sha,
          workflowTitle: j.workflow_title
        }));
      } catch {
        c = [];
      }
    let f = [...c, ...a];
    o && (f = f.filter((v) => {
      const S = v.tag.toLowerCase().includes(o), E = v.artifactName?.toLowerCase().includes(o), T = v.workflowTitle?.toLowerCase().includes(o), j = v.headSha?.toLowerCase().includes(o);
      return S || E || T || j;
    }));
    const m = f.length, h = Math.ceil(m / r), y = (n - 1) * r, x = y + r, g = f.slice(y, x);
    me(e, {
      versions: g,
      pagination: {
        page: n,
        pageSize: r,
        total: m,
        totalPages: h
      },
      mirror: u
    });
  } catch {
    e.status(500).json({ error: "Failed to fetch releases" });
  }
}, Ofe = (t, e) => {
  const n = ve.getQQVersion();
  me(e, n);
}, Mfe = async (t, e) => {
  const n = await Et.GetTheme();
  me(e, n);
}, Rfe = async (t, e) => {
  const { theme: n } = t.body;
  await Et.UpdateTheme(n), me(e, { message: "更新成功" });
}, Bfe = (t, e) => {
  const n = _6();
  me(e, { mirrors: n.fileMirrors });
}, Ufe = (t, e) => {
  try {
    const n = be.join(at.binaryPath, "napcat.mjs"), r = de.readFileSync(n), i = Si.createHash("sha512").update(r).digest("hex");
    me(e, { hash: i, file: "napcat.mjs", algorithm: "sha512" });
  } catch (n) {
    ne(e, `无法计算 napcat.mjs 的 hash：${n.message}`);
  }
}, Lfe = async (t, e) => {
  e.setHeader("Content-Type", "text/event-stream"), e.setHeader("Connection", "keep-alive");
  const n = (r) => {
    try {
      e.write(`data: ${JSON.stringify(r)}

`);
    } catch (i) {
      console.error(`An error occurred when writing sendStatus data to client: ${i}`);
    }
  };
  L_.on("statusUpdate", n), t.on("close", () => {
    L_.off("statusUpdate", n), e.end();
  });
}, jfe = async (t, e) => {
  let { url: n } = t.query;
  if (n && typeof n == "string") {
    n = decodeURIComponent(n);
    const r = await ln.HttpGetText(n);
    return me(e, r);
  } else
    return ne(e, "url参数不合法");
}, bo = yr();
bo.get("/QQVersion", Ofe);
bo.get("/GetNapCatVersion", Pfe);
bo.get("/getLatestTag", Dfe);
bo.get("/getAllReleases", Ffe);
bo.get("/getMirrors", Bfe);
bo.get("/GetSysStatusRealTime", Lfe);
bo.get("/proxy", jfe);
bo.get("/Theme", Mfe);
bo.post("/SetTheme", Rfe);
bo.get("/GetNapCatFileHash", Ufe);
var YD = [
  "draft-6",
  "draft-7",
  "draft-8"
], xy = (t, e) => {
  let n;
  if (t) {
    const r = Math.ceil((t.getTime() - Date.now()) / 1e3);
    n = Math.max(0, r);
  } else e && (n = Math.ceil(e / 1e3));
  return n;
}, Qfe = (t) => {
  const e = _d("sha256");
  e.update(t);
  const n = e.digest("hex").slice(0, 12);
  return qL.from(n).toString("base64");
}, $fe = (t, e) => {
  t.headersSent || (t.setHeader("X-RateLimit-Limit", e.limit.toString()), t.setHeader("X-RateLimit-Remaining", e.remaining.toString()), e.resetTime instanceof Date && (t.setHeader("Date", (/* @__PURE__ */ new Date()).toUTCString()), t.setHeader(
    "X-RateLimit-Reset",
    Math.ceil(e.resetTime.getTime() / 1e3).toString()
  )));
}, Gfe = (t, e, n) => {
  if (t.headersSent) return;
  const r = Math.ceil(n / 1e3), i = xy(e.resetTime);
  t.setHeader("RateLimit-Policy", `${e.limit};w=${r}`), t.setHeader("RateLimit-Limit", e.limit.toString()), t.setHeader("RateLimit-Remaining", e.remaining.toString()), i && t.setHeader("RateLimit-Reset", i.toString());
}, qfe = (t, e, n) => {
  if (t.headersSent) return;
  const r = Math.ceil(n / 1e3), i = xy(e.resetTime, n);
  t.setHeader("RateLimit-Policy", `${e.limit};w=${r}`), t.setHeader(
    "RateLimit",
    `limit=${e.limit}, remaining=${e.remaining}, reset=${i}`
  );
}, Hfe = (t, e, n, r, i) => {
  if (t.headersSent) return;
  const o = Math.ceil(n / 1e3), s = xy(e.resetTime, n), a = Qfe(i), c = `q=${e.limit}; w=${o}; pk=:${a}:`, u = `r=${e.remaining}; t=${s}`;
  t.append("RateLimit-Policy", `"${r}"; ${c}`), t.append("RateLimit", `"${r}"; ${u}`);
}, Wfe = (t, e, n) => {
  if (t.headersSent) return;
  const r = xy(e.resetTime, n);
  t.setHeader("Retry-After", r.toString());
}, Xr = class extends Error {
  /**
   * The code must be a string, in snake case and all capital, that starts with
   * the substring `ERR_ERL_`.
   *
   * The message must be a string, starting with an uppercase character,
   * describing the issue in detail.
   */
  constructor(t, e) {
    const n = `https://express-rate-limit.github.io/${t}/`;
    super(`${e} See ${n} for more information.`), this.name = this.constructor.name, this.code = t, this.help = n;
  }
}, lm = class extends Xr {
}, JD = /* @__PURE__ */ new Set(), XD = /* @__PURE__ */ new WeakMap(), zfe = {
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
  enabled: {
    default: !0
  },
  // Should be EnabledValidations type, but that's a circular reference
  disable() {
    for (const t of Object.keys(this.enabled)) this.enabled[t] = !1;
  },
  /**
   * Checks whether the IP address is valid, and that it does not have a port
   * number in it.
   *
   * See https://github.com/express-rate-limit/express-rate-limit/wiki/Error-Codes#err_erl_invalid_ip_address.
   *
   * @param ip {string | undefined} - The IP address provided by Express as request.ip.
   *
   * @returns {void}
   */
  ip(t) {
    if (t === void 0)
      throw new Xr(
        "ERR_ERL_UNDEFINED_IP_ADDRESS",
        "An undefined 'request.ip' was detected. This might indicate a misconfiguration or the connection being destroyed prematurely."
      );
    if (!yO(t))
      throw new Xr(
        "ERR_ERL_INVALID_IP_ADDRESS",
        `An invalid 'request.ip' (${t}) was detected. Consider passing a custom 'keyGenerator' function to the rate limiter.`
      );
  },
  /**
   * Makes sure the trust proxy setting is not set to `true`.
   *
   * See https://github.com/express-rate-limit/express-rate-limit/wiki/Error-Codes#err_erl_permissive_trust_proxy.
   *
   * @param request {Request} - The Express request object.
   *
   * @returns {void}
   */
  trustProxy(t) {
    if (t.app.get("trust proxy") === !0)
      throw new Xr(
        "ERR_ERL_PERMISSIVE_TRUST_PROXY",
        "The Express 'trust proxy' setting is true, which allows anyone to trivially bypass IP-based rate limiting."
      );
  },
  /**
   * Makes sure the trust proxy setting is set in case the `X-Forwarded-For`
   * header is present.
   *
   * See https://github.com/express-rate-limit/express-rate-limit/wiki/Error-Codes#err_erl_unset_trust_proxy.
   *
   * @param request {Request} - The Express request object.
   *
   * @returns {void}
   */
  xForwardedForHeader(t) {
    if (t.headers["x-forwarded-for"] && t.app.get("trust proxy") === !1)
      throw new Xr(
        "ERR_ERL_UNEXPECTED_X_FORWARDED_FOR",
        "The 'X-Forwarded-For' header is set but the Express 'trust proxy' setting is false (default). This could indicate a misconfiguration which would prevent express-rate-limit from accurately identifying users."
      );
  },
  /**
   * Ensures totalHits value from store is a positive integer.
   *
   * @param hits {any} - The `totalHits` returned by the store.
   */
  positiveHits(t) {
    if (typeof t != "number" || t < 1 || t !== Math.round(t))
      throw new Xr(
        "ERR_ERL_INVALID_HITS",
        `The totalHits value returned from the store must be a positive integer, got ${t}`
      );
  },
  /**
   * Ensures a single store instance is not used with multiple express-rate-limit instances
   */
  unsharedStore(t) {
    if (JD.has(t)) {
      const e = t?.localKeys ? "" : " (with a unique prefix)";
      throw new Xr(
        "ERR_ERL_STORE_REUSE",
        `A Store instance must not be shared across multiple rate limiters. Create a new instance of ${t.constructor.name}${e} for each limiter instead.`
      );
    }
    JD.add(t);
  },
  /**
   * Ensures a given key is incremented only once per request.
   *
   * @param request {Request} - The Express request object.
   * @param store {Store} - The store class.
   * @param key {string} - The key used to store the client's hit count.
   *
   * @returns {void}
   */
  singleCount(t, e, n) {
    let r = XD.get(t);
    r || (r = /* @__PURE__ */ new Map(), XD.set(t, r));
    const i = e.localKeys ? e : e.constructor.name;
    let o = r.get(i);
    o || (o = [], r.set(i, o));
    const s = `${e.prefix ?? ""}${n}`;
    if (o.includes(s))
      throw new Xr(
        "ERR_ERL_DOUBLE_COUNT",
        `The hit count for ${n} was incremented more than once for a single request.`
      );
    o.push(s);
  },
  /**
   * Warns the user that the behaviour for `max: 0` / `limit: 0` is
   * changing in the next major release.
   *
   * @param limit {number} - The maximum number of hits per client.
   *
   * @returns {void}
   */
  limit(t) {
    if (t === 0)
      throw new lm(
        "WRN_ERL_MAX_ZERO",
        "Setting limit or max to 0 disables rate limiting in express-rate-limit v6 and older, but will cause all requests to be blocked in v7"
      );
  },
  /**
   * Warns the user that the `draft_polli_ratelimit_headers` option is deprecated
   * and will be removed in the next major release.
   *
   * @param draft_polli_ratelimit_headers {any | undefined} - The now-deprecated setting that was used to enable standard headers.
   *
   * @returns {void}
   */
  draftPolliHeaders(t) {
    if (t)
      throw new lm(
        "WRN_ERL_DEPRECATED_DRAFT_POLLI_HEADERS",
        "The draft_polli_ratelimit_headers configuration option is deprecated and has been removed in express-rate-limit v7, please set standardHeaders: 'draft-6' instead."
      );
  },
  /**
   * Warns the user that the `onLimitReached` option is deprecated and
   * will be removed in the next major release.
   *
   * @param onLimitReached {any | undefined} - The maximum number of hits per client.
   *
   * @returns {void}
   */
  onLimitReached(t) {
    if (t)
      throw new lm(
        "WRN_ERL_DEPRECATED_ON_LIMIT_REACHED",
        "The onLimitReached configuration option is deprecated and has been removed in express-rate-limit v7."
      );
  },
  /**
   * Warns the user when an invalid/unsupported version of the draft spec is passed.
   *
   * @param version {any | undefined} - The version passed by the user.
   *
   * @returns {void}
   */
  headersDraftVersion(t) {
    if (typeof t != "string" || // @ts-expect-error This is fine. If version is not in the array, it will just return false.
    !YD.includes(t)) {
      const e = YD.join(", ");
      throw new Xr(
        "ERR_ERL_HEADERS_UNSUPPORTED_DRAFT_VERSION",
        `standardHeaders: only the following versions of the IETF draft specification are supported: ${e}.`
      );
    }
  },
  /**
   * Warns the user when the selected headers option requires a reset time but
   * the store does not provide one.
   *
   * @param resetTime {Date | undefined} - The timestamp when the client's hit count will be reset.
   *
   * @returns {void}
   */
  headersResetTime(t) {
    if (!t)
      throw new Xr(
        "ERR_ERL_HEADERS_NO_RESET",
        "standardHeaders:  'draft-7' requires a 'resetTime', but the store did not provide one. The 'windowMs' value will be used instead, which may cause clients to wait longer than necessary."
      );
  },
  /**
   * Checks the options.validate setting to ensure that only recognized
   * validations are enabled or disabled.
   *
   * If any unrecognized values are found, an error is logged that
   * includes the list of supported vaidations.
   */
  validationsConfig() {
    const t = Object.keys(this).filter(
      (e) => !["enabled", "disable"].includes(e)
    );
    t.push("default");
    for (const e of Object.keys(this.enabled))
      if (!t.includes(e))
        throw new Xr(
          "ERR_ERL_UNKNOWN_VALIDATION",
          `options.validate.${e} is not recognized. Supported validate options are: ${t.join(
            ", "
          )}.`
        );
  },
  /**
   * Checks to see if the instance was created inside of a request handler,
   * which would prevent it from working correctly, with the default memory
   * store (or any other store with localKeys.)
   */
  creationStack(t) {
    const { stack: e } = new Error(
      "express-rate-limit validation check (set options.validate.creationStack=false to disable)"
    );
    if (e?.includes("Layer.handle [as handle_request]"))
      throw t.localKeys ? new Xr(
        "ERR_ERL_CREATED_IN_REQUEST_HANDLER",
        "express-rate-limit instance should be created at app initialization, not when responding to a request."
      ) : new Xr(
        "ERR_ERL_CREATED_IN_REQUEST_HANDLER",
        "express-rate-limit instance should *usually* be created at app initialization, not when responding to a request."
      );
  }
}, Kfe = (t) => {
  let e;
  typeof t == "boolean" ? e = {
    default: t
  } : e = {
    default: !0,
    ...t
  };
  const n = {
    enabled: e
  };
  for (const [r, i] of Object.entries(zfe))
    typeof i == "function" && (n[r] = (...o) => {
      if (e[r] ?? e.default)
        try {
          i.apply(
            n,
            o
          );
        } catch (s) {
          s instanceof lm ? console.warn(s) : console.error(s);
        }
    });
  return n;
}, Vfe = class {
  constructor() {
    this.previous = /* @__PURE__ */ new Map(), this.current = /* @__PURE__ */ new Map(), this.localKeys = !0;
  }
  /**
   * Method that initializes the store.
   *
   * @param options {Options} - The options used to setup the middleware.
   */
  init(t) {
    this.windowMs = t.windowMs, this.interval && clearInterval(this.interval), this.interval = setInterval(() => {
      this.clearExpired();
    }, this.windowMs), this.interval.unref && this.interval.unref();
  }
  /**
   * Method to fetch a client's hit count and reset time.
   *
   * @param key {string} - The identifier for a client.
   *
   * @returns {ClientRateLimitInfo | undefined} - The number of hits and reset time for that client.
   *
   * @public
   */
  async get(t) {
    return this.current.get(t) ?? this.previous.get(t);
  }
  /**
   * Method to increment a client's hit counter.
   *
   * @param key {string} - The identifier for a client.
   *
   * @returns {ClientRateLimitInfo} - The number of hits and reset time for that client.
   *
   * @public
   */
  async increment(t) {
    const e = this.getClient(t), n = Date.now();
    return e.resetTime.getTime() <= n && this.resetClient(e, n), e.totalHits++, e;
  }
  /**
   * Method to decrement a client's hit counter.
   *
   * @param key {string} - The identifier for a client.
   *
   * @public
   */
  async decrement(t) {
    const e = this.getClient(t);
    e.totalHits > 0 && e.totalHits--;
  }
  /**
   * Method to reset a client's hit counter.
   *
   * @param key {string} - The identifier for a client.
   *
   * @public
   */
  async resetKey(t) {
    this.current.delete(t), this.previous.delete(t);
  }
  /**
   * Method to reset everyone's hit counter.
   *
   * @public
   */
  async resetAll() {
    this.current.clear(), this.previous.clear();
  }
  /**
   * Method to stop the timer (if currently running) and prevent any memory
   * leaks.
   *
   * @public
   */
  shutdown() {
    clearInterval(this.interval), this.resetAll();
  }
  /**
   * Recycles a client by setting its hit count to zero, and reset time to
   * `windowMs` milliseconds from now.
   *
   * NOT to be confused with `#resetKey()`, which removes a client from both the
   * `current` and `previous` maps.
   *
   * @param client {Client} - The client to recycle.
   * @param now {number} - The current time, to which the `windowMs` is added to get the `resetTime` for the client.
   *
   * @return {Client} - The modified client that was passed in, to allow for chaining.
   */
  resetClient(t, e = Date.now()) {
    return t.totalHits = 0, t.resetTime.setTime(e + this.windowMs), t;
  }
  /**
   * Retrieves or creates a client, given a key. Also ensures that the client being
   * returned is in the `current` map.
   *
   * @param key {string} - The key under which the client is (or is to be) stored.
   *
   * @returns {Client} - The requested client.
   */
  getClient(t) {
    if (this.current.has(t)) return this.current.get(t);
    let e;
    return this.previous.has(t) ? (e = this.previous.get(t), this.previous.delete(t)) : (e = { totalHits: 0, resetTime: /* @__PURE__ */ new Date() }, this.resetClient(e)), this.current.set(t, e), e;
  }
  /**
   * Move current clients to previous, create a new map for current.
   *
   * This function is called every `windowMs`.
   */
  clearExpired() {
    this.previous = this.current, this.current = /* @__PURE__ */ new Map();
  }
}, Yfe = (t) => (
  // Check that `incr` exists but `increment` does not - store authors might want
  // to keep both around for backwards compatibility.
  typeof t.incr == "function" && typeof t.increment != "function"
), Jfe = (t) => {
  if (!Yfe(t))
    return t;
  const e = t;
  class n {
    async increment(i) {
      return new Promise((o, s) => {
        e.incr(
          i,
          (a, c, u) => {
            a && s(a), o({ totalHits: c, resetTime: u });
          }
        );
      });
    }
    async decrement(i) {
      return e.decrement(i);
    }
    async resetKey(i) {
      return e.resetKey(i);
    }
    /* istanbul ignore next */
    async resetAll() {
      if (typeof e.resetAll == "function")
        return e.resetAll();
    }
  }
  return new n();
}, Xfe = (t) => {
  const { validations: e, ...n } = t;
  return {
    ...n,
    validate: e.enabled
  };
}, Zfe = (t) => {
  const e = {};
  for (const n of Object.keys(t)) {
    const r = n;
    t[r] !== void 0 && (e[r] = t[r]);
  }
  return e;
}, ehe = (t) => {
  const e = Zfe(t), n = Kfe(e?.validate ?? !0);
  n.validationsConfig(), n.draftPolliHeaders(
    // @ts-expect-error see the note above.
    e.draft_polli_ratelimit_headers
  ), n.onLimitReached(e.onLimitReached);
  let r = e.standardHeaders ?? !1;
  r === !0 && (r = "draft-6");
  const i = {
    windowMs: 60 * 1e3,
    limit: t.max ?? 5,
    // `max` is deprecated, but support it anyways.
    message: "Too many requests, please try again later.",
    statusCode: 429,
    legacyHeaders: t.headers ?? !0,
    identifier(o, s) {
      let a = "";
      const c = i.requestPropertyName, { limit: u } = o[c], l = i.windowMs / 1e3, d = i.windowMs / (1e3 * 60), f = i.windowMs / (1e3 * 60 * 60), m = i.windowMs / (1e3 * 60 * 60 * 24);
      return l < 60 ? a = `${l}sec` : d < 60 ? a = `${d}min` : f < 24 ? a = `${f}hr${f > 1 ? "s" : ""}` : a = `${m}day${m > 1 ? "s" : ""}`, `${u}-in-${a}`;
    },
    requestPropertyName: "rateLimit",
    skipFailedRequests: !1,
    skipSuccessfulRequests: !1,
    requestWasSuccessful: (o, s) => s.statusCode < 400,
    skip: (o, s) => !1,
    keyGenerator(o, s) {
      return n.ip(o.ip), n.trustProxy(o), n.xForwardedForHeader(o), o.ip;
    },
    async handler(o, s, a, c) {
      s.status(i.statusCode);
      const u = typeof i.message == "function" ? await i.message(
        o,
        s
      ) : i.message;
      s.writableEnded || s.send(u);
    },
    passOnStoreError: !1,
    // Allow the default options to be overridden by the passed options.
    ...e,
    // `standardHeaders` is resolved into a draft version above, use that.
    standardHeaders: r,
    // Note that this field is declared after the user's options are spread in,
    // so that this field doesn't get overridden with an un-promisified store!
    store: Jfe(e.store ?? new Vfe()),
    // Print an error to the console if a few known misconfigurations are detected.
    validations: n
  };
  if (typeof i.store.increment != "function" || typeof i.store.decrement != "function" || typeof i.store.resetKey != "function" || i.store.resetAll !== void 0 && typeof i.store.resetAll != "function" || i.store.init !== void 0 && typeof i.store.init != "function")
    throw new TypeError(
      "An invalid store was passed. Please ensure that the store is a class that implements the `Store` interface."
    );
  return i;
}, the = (t) => async (e, n, r) => {
  try {
    await Promise.resolve(t(e, n, r)).catch(r);
  } catch (i) {
    r(i);
  }
}, nhe = (t) => {
  const e = ehe(t ?? {}), n = Xfe(e);
  e.validations.creationStack(e.store), e.validations.unsharedStore(e.store), typeof e.store.init == "function" && e.store.init(n);
  const r = the(
    async (o, s, a) => {
      if (await e.skip(o, s)) {
        a();
        return;
      }
      const u = o, l = await e.keyGenerator(o, s);
      let d = 0, f;
      try {
        const x = await e.store.increment(l);
        d = x.totalHits, f = x.resetTime;
      } catch (x) {
        if (e.passOnStoreError) {
          console.error(
            "express-rate-limit: error from store, allowing request without rate-limiting.",
            x
          ), a();
          return;
        }
        throw x;
      }
      e.validations.positiveHits(d), e.validations.singleCount(o, e.store, l);
      const h = await (typeof e.limit == "function" ? e.limit(o, s) : e.limit);
      e.validations.limit(h);
      const y = {
        limit: h,
        used: d,
        remaining: Math.max(h - d, 0),
        resetTime: f
      };
      if (Object.defineProperty(y, "current", {
        configurable: !1,
        enumerable: !1,
        value: d
      }), u[e.requestPropertyName] = y, e.legacyHeaders && !s.headersSent && $fe(s, y), e.standardHeaders && !s.headersSent)
        switch (e.standardHeaders) {
          case "draft-6": {
            Gfe(s, y, e.windowMs);
            break;
          }
          case "draft-7": {
            e.validations.headersResetTime(y.resetTime), qfe(s, y, e.windowMs);
            break;
          }
          case "draft-8": {
            const g = await (typeof e.identifier == "function" ? e.identifier(o, s) : e.identifier);
            e.validations.headersResetTime(y.resetTime), Hfe(s, y, e.windowMs, g, l);
            break;
          }
          default: {
            e.validations.headersDraftVersion(e.standardHeaders);
            break;
          }
        }
      if (e.skipFailedRequests || e.skipSuccessfulRequests) {
        let x = !1;
        const g = async () => {
          x || (await e.store.decrement(l), x = !0);
        };
        e.skipFailedRequests && (s.on("finish", async () => {
          await e.requestWasSuccessful(o, s) || await g();
        }), s.on("close", async () => {
          s.writableEnded || await g();
        }), s.on("error", async () => {
          await g();
        })), e.skipSuccessfulRequests && s.on("finish", async () => {
          await e.requestWasSuccessful(o, s) && await g();
        });
      }
      if (e.validations.disable(), d > h) {
        (e.legacyHeaders || e.standardHeaders) && Wfe(s, y, e.windowMs), e.handler(o, s, a, n);
        return;
      }
      a();
    }
  ), i = () => {
    throw new Error("The current store does not support the get/getKey method");
  };
  return r.resetKey = e.store.resetKey.bind(e.store), r.getKey = typeof e.store.get == "function" ? e.store.get.bind(e.store) : i, r;
}, rhe = nhe;
const cU = [".woff", ".woff2", ".ttf", ".otf"], ihe = (t) => {
  try {
    if (!de.existsSync(t))
      return;
    const e = de.readdirSync(t);
    for (const n of e) {
      const r = be.extname(n).toLowerCase(), i = be.basename(n, r);
      if (cU.includes(r) && (i === "webui" || i === "CustomFont"))
        try {
          de.unlinkSync(be.join(t, n));
        } catch (o) {
          console.error(`Failed to delete old font file ${n}:`, o);
        }
    }
  } catch (e) {
    console.error("Failed to clean old font files:", e);
  }
}, ohe = ds.diskStorage({
  destination: (t, e, n) => {
    try {
      const r = be.dirname(Et.GetWebUIFontPathSync());
      de.mkdirSync(r, { recursive: !0 }), ihe(r), n(null, r);
    } catch (r) {
      n(new Error(`创建字体目录失败：${r.message}`), "");
    }
  },
  filename: (t, e, n) => {
    const r = be.extname(e.originalname).toLowerCase();
    n(null, `CustomFont${r}`);
  }
}), she = ds({
  storage: ohe,
  fileFilter: (t, e, n) => {
    const r = be.extname(e.originalname).toLowerCase();
    if (!cU.includes(r)) {
      n(new Error("只支持 WOFF/WOFF2/TTF/OTF 格式的字体文件"));
      return;
    }
    n(null, !0);
  },
  limits: {
    fileSize: 40 * 1024 * 1024
    // 限制40MB
  }
}).single("file"), ahe = (t, e) => new Promise((n, r) => {
  she(t, e, (i) => i ? r(i) : n(!0));
}), che = process.platform === "win32", ZD = (t) => {
  try {
    return Buffer.from(t, "binary").toString("utf8");
  } catch {
    return t;
  }
}, uhe = (t) => ds.diskStorage({
  destination: (e, n, r) => {
    try {
      const i = ZD(n.originalname);
      if (!t)
        return r(new Error("上传路径不能为空"), "");
      if (che && t === "\\")
        return r(new Error("根目录不允许上传文件"), "");
      if (i.includes("/") || i.includes("\\")) {
        const o = be.join(t, be.dirname(i));
        de.mkdirSync(o, { recursive: !0 }), r(null, o);
      } else
        r(null, t);
    } catch (i) {
      r(i, "");
    }
  },
  filename: (e, n, r) => {
    try {
      const i = ZD(n.originalname), o = be.basename(i), s = be.join(t, i);
      if (de.existsSync(s)) {
        const a = be.extname(o), c = be.basename(o, a);
        r(null, `${c}-${Do()}${a}`);
      } else
        r(null, o);
    } catch (i) {
      r(i, "");
    }
  }
}), lhe = (t) => ds({
  storage: uhe(t),
  limits: {
    fileSize: 104857600,
    // 100MB 文件大小限制
    files: 20,
    // 最多同时上传20个文件
    fieldSize: 1048576,
    // 1MB 字段大小限制
    fields: 10
    // 最多10个字段
  }
}).array("files"), phe = (t, e) => {
  const n = t.query.path || "";
  return new Promise((r, i) => {
    lhe(n)(t, e, (o) => o ? o.code === "LIMIT_FILE_SIZE" ? i(new Error("文件大小超过限制（最大100MB）")) : o.code === "LIMIT_FILE_COUNT" ? i(new Error("文件数量超过限制（最多20个文件）")) : o.code === "LIMIT_FIELD_VALUE" ? i(new Error("字段值大小超过限制")) : o.code === "LIMIT_FIELD_COUNT" ? i(new Error("字段数量超过限制")) : i(o) : r(!0));
  });
}, wd = Pn.platform() === "win32", C2 = (t) => Array.isArray(t) ? String(t[0] || "") : String(t || ""), dhe = async () => {
  if (!wd) return ["/"];
  const t = [];
  for (let e = 65; e <= 90; e++) {
    const n = String.fromCharCode(e);
    try {
      await Ot.access(`${n}:\\`), t.push(`${n}:`);
    } catch {
      continue;
    }
  }
  return t.length > 0 ? t : ["C:"];
}, kr = (t) => {
  if (!t)
    return wd ? process.env.USERPROFILE || "C:\\" : "/";
  const e = t.replace(/[\x01-\x1f\x7f]/g, "");
  if (wd && /^[A-Z]:[\\/]*$/i.test(e))
    return e.slice(0, 2) + "\\";
  if (eF(e))
    throw new Error("Invalid path: path traversal detected");
  const n = be.resolve(e);
  if (eF(n))
    throw new Error("Invalid path: path traversal detected after normalization");
  return n.replace(/[\\/]+/g, be.sep);
}, eF = (t) => {
  let e = t;
  try {
    e = decodeURIComponent(t);
  } catch {
  }
  const n = e.replace(/\\/g, "/");
  return [
    /\.\.\//,
    // ../ 模式
    /\/\.\./,
    // /.. 模式
    /^\.\./,
    // 以.. 开头
    /\.\.$/,
    // 以.. 结尾
    /\.\.\\/,
    // ..\ 模式（Windows）
    /\\\.\./,
    // \.. 模式（Windows）
    /%2e%2e/i,
    // URL编码的..
    /%252e%252e/i,
    // 双重URL编码的..
    // eslint-disable-next-line no-control-regex
    /\.\.\x00/,
    // null字节攻击
    /\0/
    // null字节
  ].some((i) => i.test(n));
}, fhe = /* @__PURE__ */ new Set(["pagefile.sys", "swapfile.sys", "hiberfil.sys", "System Volume Information"]), uU = (t) => {
  if (!t.includes("webui.json"))
    return !1;
  const e = be.resolve(at.configPath, "webui.json").replace(/\\/g, "/");
  return be.resolve(t).replace(/\\/g, "/") === e;
}, hhe = (t) => {
  try {
    const e = JSON.parse(t);
    return e.token && (e.token = "******"), JSON.stringify(e, null, 4);
  } catch {
    return t;
  }
}, lU = async (t, e) => {
  try {
    return (await Ot.stat(t)).isDirectory() === e;
  } catch {
    return !1;
  }
}, mhe = async (t, e) => {
  try {
    const n = C2(t.query.path) || (wd ? process.env.USERPROFILE || "C:\\" : "/");
    let r;
    try {
      r = kr(n);
    } catch {
      return ne(e, "无效的文件路径");
    }
    const i = t.query.onlyDirectory === "true";
    if (wd && (!n || n === "/" || n === "\\")) {
      const a = await dhe(), c = await Promise.all(
        a.map(async (u) => {
          try {
            const l = await Ot.stat(`${u}\\`);
            return {
              name: u,
              isDirectory: !0,
              size: 0,
              mtime: l.mtime
            };
          } catch {
            return {
              name: u,
              isDirectory: !0,
              size: 0,
              mtime: /* @__PURE__ */ new Date()
            };
          }
        })
      );
      return me(e, c);
    }
    const o = await Ot.readdir(r);
    let s = [];
    for (const a of o)
      if (!fhe.has(a))
        try {
          const c = be.join(r, a), u = await Ot.stat(c);
          s.push({
            name: a,
            isDirectory: u.isDirectory(),
            size: u.size,
            mtime: u.mtime
          });
        } catch {
          continue;
        }
    return i && (s = s.filter((a) => a.isDirectory)), me(e, s);
  } catch (n) {
    return console.error("读取目录失败:", n), ne(e, "读取目录失败");
  }
}, ghe = async (t, e) => {
  try {
    const { path: n } = t.body;
    let r;
    try {
      r = kr(n);
    } catch {
      return ne(e, "无效的文件路径");
    }
    return be.isAbsolute(r) ? await lU(r, !0) ? ne(e, "同名目录已存在") : (await Ot.mkdir(r, { recursive: !0 }), me(e, !0)) : ne(e, "路径必须是绝对路径");
  } catch {
    return ne(e, "创建目录失败");
  }
}, yhe = async (t, e) => {
  try {
    const { path: n } = t.body;
    let r;
    try {
      r = kr(n);
    } catch {
      return ne(e, "无效的文件路径");
    }
    return be.isAbsolute(r) ? ((await Ot.stat(r)).isDirectory() ? await Ot.rm(r, { recursive: !0 }) : await Ot.unlink(r), me(e, !0)) : ne(e, "路径必须是绝对路径");
  } catch {
    return ne(e, "删除失败");
  }
}, vhe = async (t, e) => {
  try {
    const { paths: n } = t.body;
    for (const r of n) {
      let i;
      try {
        i = kr(r);
      } catch {
        return ne(e, "无效的文件路径");
      }
      if (!be.isAbsolute(i))
        return ne(e, "路径必须是绝对路径");
      (await Ot.stat(i)).isDirectory() ? await Ot.rm(i, { recursive: !0 }) : await Ot.unlink(i);
    }
    return me(e, !0);
  } catch {
    return ne(e, "批量删除失败");
  }
}, bhe = async (t, e) => {
  try {
    let n;
    try {
      n = kr(C2(t.query.path));
    } catch {
      return ne(e, "无效的文件路径");
    }
    if (!be.isAbsolute(n))
      return ne(e, "路径必须是绝对路径");
    let r = await Ot.readFile(n, "utf-8");
    return uU(n) && (r = hhe(r)), me(e, r);
  } catch {
    return ne(e, "读取文件失败");
  }
}, xhe = async (t, e) => {
  try {
    const { path: n, content: r } = t.body;
    let i;
    try {
      i = kr(n);
    } catch {
      return ne(e, "无效的文件路径");
    }
    if (!be.isAbsolute(i))
      return ne(e, "路径必须是绝对路径");
    let o = r;
    if (uU(i))
      try {
        const s = JSON.parse(r), a = ls();
        a && (s.token = a, o = JSON.stringify(s, null, 4));
      } catch {
        return ne(e, "写入的WebUI配置文件内容格式错误，必须是合法的JSON");
      }
    return await Ot.writeFile(i, o, "utf-8"), me(e, !0);
  } catch {
    return ne(e, "写入文件失败");
  }
}, whe = async (t, e) => {
  try {
    const { path: n } = t.body;
    let r;
    try {
      r = kr(n);
    } catch {
      return ne(e, "无效的文件路径");
    }
    return be.isAbsolute(r) ? await lU(r, !1) ? ne(e, "同名文件已存在") : (await Ot.writeFile(r, "", "utf-8"), me(e, !0)) : ne(e, "路径必须是绝对路径");
  } catch {
    return ne(e, "创建文件失败");
  }
}, She = async (t, e) => {
  try {
    const { oldPath: n, newPath: r } = t.body;
    let i, o;
    try {
      i = kr(n), o = kr(r);
    } catch {
      return ne(e, "无效的文件路径");
    }
    return !be.isAbsolute(i) || !be.isAbsolute(o) ? ne(e, "路径必须是绝对路径") : (await Ot.rename(i, o), me(e, !0));
  } catch {
    return ne(e, "重命名失败");
  }
}, _he = async (t, e) => {
  try {
    const { sourcePath: n, targetPath: r } = t.body;
    let i, o;
    try {
      i = kr(n), o = kr(r);
    } catch {
      return ne(e, "无效的文件路径");
    }
    return !be.isAbsolute(i) || !be.isAbsolute(o) ? ne(e, "路径必须是绝对路径") : (await Ot.rename(i, o), me(e, !0));
  } catch {
    return ne(e, "移动失败");
  }
}, Ehe = async (t, e) => {
  try {
    const { items: n } = t.body;
    for (const { sourcePath: r, targetPath: i } of n) {
      let o, s;
      try {
        o = kr(r), s = kr(i);
      } catch {
        return ne(e, "无效的文件路径");
      }
      if (!be.isAbsolute(o) || !be.isAbsolute(s))
        return ne(e, "路径必须是绝对路径");
      await Ot.rename(o, s);
    }
    return me(e, !0);
  } catch {
    return ne(e, "批量移动失败");
  }
}, Ahe = async (t, e) => {
  try {
    let n;
    try {
      n = kr(C2(t.query.path));
    } catch {
      return ne(e, "无效的文件路径");
    }
    if (!n)
      return ne(e, "参数错误");
    if (!be.isAbsolute(n))
      return ne(e, "路径必须是绝对路径");
    const r = await Ot.stat(n);
    e.setHeader("Content-Type", "application/octet-stream");
    let i = be.basename(n);
    if (r.isDirectory()) {
      i = be.basename(n) + ".zip", e.setHeader("Content-Disposition", `attachment; filename*=UTF-8''${encodeURIComponent(i)}`);
      const s = new OL();
      zu.zip.compressDir(n, s).catch((a) => {
        console.error("压缩目录失败:", a), e.end();
      }), s.pipe(e);
      return;
    }
    e.setHeader("Content-Length", r.size), e.setHeader("Content-Disposition", `attachment; filename*=UTF-8''${encodeURIComponent(i)}`), de.createReadStream(n).pipe(e);
  } catch {
    return ne(e, "下载失败");
  }
}, Ihe = async (t, e) => {
  try {
    const { paths: n } = t.body;
    if (!n || !Array.isArray(n) || n.length === 0)
      return ne(e, "参数错误");
    e.setHeader("Content-Type", "application/octet-stream"), e.setHeader("Content-Disposition", "attachment; filename=files.zip");
    const r = new zu.zip.Stream();
    for (const i of n) {
      let o;
      try {
        o = kr(i);
      } catch {
        return ne(e, "无效的文件路径");
      }
      if (!be.isAbsolute(o))
        return ne(e, "路径必须是绝对路径");
      if ((await Ot.stat(o)).isDirectory())
        r.addEntry(o, { relativePath: "" });
      else {
        const a = be.basename(o);
        r.addEntry(o, { relativePath: a });
      }
    }
    r.pipe(e), e.on("finish", () => {
      r.destroy();
    });
  } catch {
    return ne(e, "下载失败");
  }
}, Che = async (t, e) => {
  try {
    return await phe(t, e), me(e, !0, "文件上传成功", !0);
  } catch (n) {
    let r = "文件上传失败";
    if (n instanceof ds.MulterError)
      switch (n.code) {
        case "LIMIT_FILE_SIZE":
          r = "文件大小超过限制（40MB）";
          break;
        case "LIMIT_UNEXPECTED_FILE":
          r = "无效的文件上传字段";
          break;
        default:
          r = `上传错误: ${n.message}`;
      }
    else n instanceof Error && (r = n.message);
    return ne(e, r, !0);
  }
}, The = async (t, e) => {
  try {
    return await ahe(t, e), me(e, !0, "字体文件上传成功", !0);
  } catch (n) {
    let r = "字体文件上传失败";
    if (n instanceof ds.MulterError)
      switch (n.code) {
        case "LIMIT_FILE_SIZE":
          r = "字体文件大小超过限制（40MB）";
          break;
        case "LIMIT_UNEXPECTED_FILE":
          r = "无效的文件上传字段";
          break;
        default:
          r = `上传错误: ${n.message}`;
      }
    else n instanceof Error && (r = n.message);
    return ne(e, r, !0);
  }
}, khe = async (t, e) => {
  try {
    const n = await Et.GetWebUIFontPath();
    return !await Et.CheckWebUIFontExist() || !n || await Ot.unlink(n), me(e, !0);
  } catch {
    return ne(e, "删除字体文件失败");
  }
}, Nhe = async (t, e) => {
  try {
    const n = await Et.CheckWebUIFontExist();
    return me(e, n);
  } catch {
    return ne(e, "检查字体文件失败");
  }
}, Jn = yr(), Phe = rhe({
  windowMs: 60 * 1e3,
  // 1分钟内
  max: 60,
  // 最大60个请求
  validate: {
    xForwardedForHeader: !1
  }
});
Jn.use(Phe);
Jn.get("/list", mhe);
Jn.post("/mkdir", ghe);
Jn.post("/delete", yhe);
Jn.get("/read", bhe);
Jn.post("/write", xhe);
Jn.post("/create", whe);
Jn.post("/batchDelete", vhe);
Jn.post("/rename", She);
Jn.post("/move", _he);
Jn.post("/batchMove", Ehe);
Jn.post("/download", Ahe);
Jn.post("/batchDownload", Ihe);
Jn.post("/upload", Che);
Jn.post("/font/upload/webui", The);
Jn.post("/font/delete/webui", khe);
Jn.get("/font/exists/webui", Nhe);
const Dhe = async (t, e) => {
  try {
    const n = await Et.GetWebUIConfig();
    return me(e, {
      host: n.host,
      port: n.port,
      loginRate: n.loginRate,
      disableWebUI: n.disableWebUI,
      accessControlMode: n.accessControlMode || "none",
      ipWhitelist: n.ipWhitelist || [],
      ipBlacklist: n.ipBlacklist || [],
      enableXForwardedFor: n.enableXForwardedFor || !1
    });
  } catch (n) {
    const r = n.message;
    return ne(e, `获取WebUI配置失败: ${r}`);
  }
}, Fhe = async (t, e) => {
  try {
    const n = await Et.GetDisableWebUI();
    return me(e, n);
  } catch (n) {
    const r = n.message;
    return ne(e, `获取WebUI禁用状态失败: ${r}`);
  }
}, Ohe = async (t, e) => {
  try {
    const { disable: n } = t.body;
    return typeof n != "boolean" ? ne(e, "disable参数必须是布尔值") : (await Et.UpdateDisableWebUI(n), me(e, null));
  } catch (n) {
    const r = n.message;
    return ne(e, `更新WebUI禁用状态失败: ${r}`);
  }
}, Mhe = async (t, e) => {
  try {
    const n = await Et.GetWebUIConfig();
    let r;
    if (n.enableXForwardedFor) {
      const o = t.headers["x-forwarded-for"];
      typeof o == "string" ? r = o.split(",")[0]?.trim() || "" : Array.isArray(o) && o.length > 0 ? r = o[0] || "" : r = t.ip || t.socket.remoteAddress || "";
    } else
      r = t.ip || t.socket.remoteAddress || "";
    let i = r;
    if (r.startsWith("::ffff:")) {
      const o = r.substring(7);
      /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(o) && (i = o);
    }
    return me(e, { ip: i });
  } catch (n) {
    const r = n.message;
    return ne(e, `获取客户端IP失败: ${r}`);
  }
}, Rhe = async (t, e) => {
  try {
    const { host: n, port: r, loginRate: i, disableWebUI: o, accessControlMode: s, ipWhitelist: a, ipBlacklist: c, enableXForwardedFor: u } = t.body, l = {};
    if (n !== void 0) {
      if (qn(n))
        return ne(e, "host不能为空");
      l.host = n;
    }
    if (r !== void 0) {
      if (!Number.isInteger(r) || r < 1 || r > 65535)
        return ne(e, "port必须是1-65535之间的整数");
      l.port = r;
    }
    if (i !== void 0) {
      if (!Number.isInteger(i) || i < 1)
        return ne(e, "loginRate必须是大于0的整数");
      l.loginRate = i;
    }
    if (o !== void 0) {
      if (typeof o != "boolean")
        return ne(e, "disableWebUI必须是布尔值");
      l.disableWebUI = o;
    }
    if (s !== void 0) {
      if (!["none", "whitelist", "blacklist"].includes(s))
        return ne(e, "accessControlMode必须是none、whitelist或blacklist");
      l.accessControlMode = s;
    }
    if (a !== void 0) {
      if (!Array.isArray(a))
        return ne(e, "ipWhitelist必须是数组");
      l.ipWhitelist = a;
    }
    if (c !== void 0) {
      if (!Array.isArray(c))
        return ne(e, "ipBlacklist必须是数组");
      l.ipBlacklist = c;
    }
    if (u !== void 0) {
      if (typeof u != "boolean")
        return ne(e, "enableXForwardedFor必须是布尔值");
      l.enableXForwardedFor = u;
    }
    return await Et.UpdateWebUIConfig(l), me(e, null);
  } catch (n) {
    const r = n.message;
    return ne(e, `更新WebUI配置失败: ${r}`);
  }
}, Bhe = async (t, e) => {
  try {
    const n = yn(at.configPath, "cert.pem"), r = yn(at.configPath, "key.pem"), i = sr(n), o = sr(r);
    let s = "", a = "";
    return i && (s = await lu.readFile(n, "utf-8")), o && (a = await lu.readFile(r, "utf-8")), me(e, {
      enabled: i && o,
      certExists: i,
      keyExists: o,
      certContent: s,
      keyContent: a
    });
  } catch (n) {
    const r = n.message;
    return ne(e, `获取SSL状态失败: ${r}`);
  }
}, Uhe = async (t, e) => {
  try {
    const { cert: n, key: r } = t.body;
    if (qn(n) || qn(r))
      return ne(e, "cert和key内容不能为空");
    if (!n.includes("-----BEGIN CERTIFICATE-----") || !n.includes("-----END CERTIFICATE-----"))
      return ne(e, "cert格式不正确，应为PEM格式的证书");
    if (!r.includes("-----BEGIN") || !r.includes("KEY-----"))
      return ne(e, "key格式不正确，应为PEM格式的私钥");
    const i = yn(at.configPath, "cert.pem"), o = yn(at.configPath, "key.pem");
    return await lu.writeFile(i, n, "utf-8"), await lu.writeFile(o, r, "utf-8"), me(e, { message: "SSL证书保存成功，重启后生效" });
  } catch (n) {
    const r = n.message;
    return ne(e, `保存SSL证书失败: ${r}`);
  }
}, Lhe = async (t, e) => {
  try {
    const n = yn(at.configPath, "cert.pem"), r = yn(at.configPath, "key.pem");
    return sr(n) && await lu.unlink(n), sr(r) && await lu.unlink(r), me(e, { message: "SSL证书已删除，重启后生效" });
  } catch (n) {
    const r = n.message;
    return ne(e, `删除SSL证书失败: ${r}`);
  }
}, Ns = yr();
Ns.get("/GetConfig", Dhe);
Ns.post("/UpdateConfig", Rhe);
Ns.get("/GetDisableWebUI", Fhe);
Ns.post("/UpdateDisableWebUI", Ohe);
Ns.get("/GetClientIP", Mhe);
Ns.get("/GetSSLStatus", Bhe);
Ns.post("/UploadSSLCert", Uhe);
Ns.post("/DeleteSSLCert", Lhe);
const jhe = [
  "NapCatWinBootMain.exe",
  "NapCatWinBootHook.dll",
  "quickLoginExample.bat"
], Qhe = /* @__PURE__ */ new Set([
  Ze.normalize("config/napcat.json")
]);
function pU(t, e = t) {
  const n = [], r = Ae.readdirSync(t);
  for (const i of r) {
    const o = Ze.join(t, i), s = Ze.relative(e, o), a = Ae.lstatSync(o);
    a.isSymbolicLink() || (a.isDirectory() ? n.push(...pU(o, e)) : a.isFile() && n.push({
      sourcePath: o,
      relativePath: s
    }));
  }
  return n;
}
async function dU(t, e) {
  jt?.log("[NapCat Update] Starting download from:", t);
  const n = Ae.createWriteStream(e);
  return new Promise((r, i) => {
    W_.get(t, {
      headers: { "User-Agent": "NapCat-WebUI" }
    }, (s) => {
      if (jt?.log("[NapCat Update] Response status:", s.statusCode), jt?.log("[NapCat Update] Content-Type:", s.headers["content-type"]), s.statusCode === 302 || s.statusCode === 301) {
        jt?.log("[NapCat Update] Following redirect to:", s.headers.location), n.close(), Ae.unlinkSync(e), dU(s.headers.location, e).then(r).catch(i);
        return;
      }
      if (s.statusCode !== 200) {
        n.close(), Ae.unlinkSync(e), i(new Error(`HTTP ${s.statusCode}: ${s.statusMessage}`));
        return;
      }
      s.pipe(n), n.on("finish", () => {
        n.close(), jt?.log("[NapCat Update] Download completed"), r();
      });
    }).on("error", (s) => {
      jt?.logError("[NapCat Update] Download error:", s), n.close(), Ae.unlink(e, () => {
      }), i(s);
    });
  });
}
const $he = async (t, e) => {
  try {
    const { targetVersion: n, force: r, mirror: i } = t.body, o = ve.getWorkingEnv() === _0.Framework ? "NapCat.Framework.zip" : "NapCat.Shell.zip", s = n || "latest";
    jt?.log(`[NapCat Update] Target version: ${s}`);
    const a = s.startsWith("action-");
    let c, u;
    if (a) {
      const x = parseInt(s.replace("action-", ""));
      if (isNaN(x))
        throw new Error(`Invalid action version format: ${s}`);
      jt?.log(`[NapCat Update] Downloading action artifact from run: ${x}`);
      const g = o.replace(".zip", ""), v = `https://nightly.link/NapNeko/NapCatQQ/actions/runs/${x}/${g}.zip`;
      u = s, jt?.log(`[NapCat Update] Action artifact URL: ${v}`);
      try {
        c = await Qw(v, {
          validateContent: !0,
          minFileSize: 1024 * 1024,
          timeout: 1e4,
          customMirror: i
        }), jt?.log(`[NapCat Update] Using download URL: ${c}`);
      } catch {
        jt?.logWarn("[NapCat Update] All nightly.link mirrors failed, using original URL"), c = v;
      }
    } else {
      const x = await j7("NapNeko", "NapCatQQ", s, {
        assetNames: [o, "NapCat.Framework.zip", "NapCat.Shell.zip"],
        fetchChangelog: !1,
        // 不需要 changelog，避免 API 调用
        mirror: i
      }), g = x.assets.find((v) => v.name === o);
      if (!g)
        throw new Error(`未找到${o}文件`);
      u = x.tag_name, c = await Qw(g.browser_download_url, {
        validateContent: !0,
        // 验证 Content-Type 和状态码
        minFileSize: 1024 * 1024,
        // 最小 1MB，确保不是错误页面
        timeout: 1e4,
        // 10秒超时
        customMirror: i
      });
    }
    const l = ve.GetNapCatVersion();
    if (jt?.log(`[NapCat Update] Current version: ${l}, Target version: ${u}`), !r && l && !a) {
      const x = (Y) => {
        const W = Y.match(/^v?(\d+)\.(\d+)\.(\d+)/);
        return W ? [parseInt(W[1] || "0"), parseInt(W[2] || "0"), parseInt(W[3] || "0")] : [0, 0, 0];
      }, [g, v, S] = x(l), [E, T, j] = x(u);
      (E < g || E === g && T < v || E === g && T === v && j < S) && jt?.log(`[NapCat Update] Downgrade from ${l} to ${u}, force=${r}`);
    }
    jt?.log(`[NapCat Update] Updating to version: ${u}`);
    const d = Ze.join(at.binaryPath, "./temp");
    Ae.existsSync(d) || Ae.mkdirSync(d, { recursive: !0 }), jt?.log(`[NapCat Update] Using download URL: ${c}`);
    const f = Ze.join(d, "napcat-latest.zip");
    jt?.log("[NapCat Update] Saving to:", f), await dU(c, f);
    const m = Ae.statSync(f);
    jt?.log("[NapCat Update] Downloaded file size:", m.size, "bytes");
    const h = Ze.join(d, "napcat-extract");
    jt?.log("[NapCat Update] Extracting to:", h), await zu.zip.uncompress(f, h);
    const y = h;
    try {
      const x = pU(y), g = [], v = Ze.resolve(at.binaryPath);
      for (const E of x) {
        const T = Ze.resolve(at.binaryPath, E.relativePath);
        if (!T.startsWith(v + Ze.sep)) {
          jt?.logWarn(`[NapCat Update] Skipping suspicious path: ${E.relativePath}`);
          continue;
        }
        const j = Ze.normalize(E.relativePath);
        if (jhe.includes(Ze.basename(E.relativePath))) {
          jt?.log(`[NapCat Update] Skipping update for ${E.relativePath}`);
          continue;
        }
        if (Qhe.has(j) && Ae.existsSync(T)) {
          jt?.log(`[NapCat Update] Preserving existing user config: ${E.relativePath}`);
          continue;
        }
        try {
          const q = Ze.dirname(T);
          Ae.existsSync(q) || Ae.mkdirSync(q, { recursive: !0 }), Ae.existsSync(T) && Ae.unlinkSync(T), Ae.copyFileSync(E.sourcePath, T);
        } catch (q) {
          jt?.logError(`[NapCat Update] Failed to update ${T}, will retry on next startup:`, q), g.push({
            sourcePath: E.sourcePath,
            targetPath: T
          });
        }
      }
      if (g.length > 0) {
        const E = {
          version: u,
          updateTime: (/* @__PURE__ */ new Date()).toISOString(),
          files: g,
          changelog: ""
        }, T = Ze.join(at.configPath, "napcat-update.json");
        Ae.writeFileSync(T, JSON.stringify(E, null, 2)), jt?.log(`[NapCat Update] Update config saved for ${g.length} failed files: ${T}`);
      }
      const S = g.length > 0 ? `更新完成，重启应用以应用剩余${g.length}个文件的更新` : "更新完成";
      me(e, {
        status: "completed",
        message: S,
        newVersion: u,
        failedFilesCount: g.length
      });
    } catch (x) {
      jt?.logError("[NapCat Update] 更新失败:", x), ne(e, "更新失败: " + (x instanceof Error ? x.message : "未知错误"));
    }
  } catch (n) {
    jt?.logError("[NapCat Update] 更新失败:", n), ne(e, "更新失败: " + n.message);
  }
};
async function Ghe(t, e) {
  const n = Ze.join(t.configPath, "napcat-update.json");
  if (Ae.existsSync(n))
    try {
      e.log("[NapCat Update] Applying pending updates...");
      const r = JSON.parse(Ae.readFileSync(n, "utf8")), i = [];
      for (const o of r.files)
        try {
          if (!Ae.existsSync(o.sourcePath)) {
            e.logWarn(`[NapCat Update] Source file not found: ${o.sourcePath}`);
            continue;
          }
          const s = Ze.dirname(o.targetPath);
          Ae.existsSync(s) || Ae.mkdirSync(s, { recursive: !0 }), Ae.existsSync(o.targetPath) && Ae.unlinkSync(o.targetPath), Ae.copyFileSync(o.sourcePath, o.targetPath), e.log(`[NapCat Update] Updated ${Ze.basename(o.targetPath)} on startup`);
        } catch (s) {
          e.logError(`[NapCat Update] Failed to update ${o.targetPath} on startup:`, s), i.push(o);
        }
      if (i.length > 0) {
        const o = {
          ...r,
          files: i
        };
        Ae.writeFileSync(n, JSON.stringify(o, null, 2)), e.log(`[NapCat Update] ${i.length} files still pending update`);
      } else
        Ae.unlinkSync(n), e.log("[NapCat Update] All pending updates applied successfully");
    } catch (r) {
      e.logError("[NapCat Update] Failed to apply pending updates:", r);
    }
}
const fU = yr();
fU.post("/update", $he);
var ju = /* @__PURE__ */ ((t) => (t.META = "meta_event", t.REQUEST = "request", t.NOTICE = "notice", t.MESSAGE = "message", t.MESSAGE_SENT = "message_sent", t))(ju || {});
class T2 {
  time = Math.floor(Date.now() / 1e3);
  self_id;
  constructor(e) {
    this.self_id = parseInt(e.selfInfo.uin);
  }
}
class hU extends T2 {
  post_type = ju.META;
}
var xf = /* @__PURE__ */ ((t) => (t.ENABLE = "enable", t.DISABLE = "disable", t.CONNECT = "connect", t))(xf || {});
class wy extends hU {
  meta_event_type = "lifecycle";
  sub_type;
  constructor(e, n) {
    super(e), this.sub_type = n;
  }
}
class El {
  name;
  isEnable = !1;
  config;
  logger;
  core;
  obContext;
  actions;
  constructor(e, n, r, i, o) {
    this.name = e, this.config = structuredClone(n), this.core = r, this.obContext = i, this.actions = o, this.logger = r.context.logger;
  }
  get isActive() {
    return this.isEnable;
  }
}
class tF extends El {
  async onEvent(e) {
    this.emitEventAsync(e).catch((n) => this.logger.logError("[OneBot] [Http Client] 新消息事件HTTP上报返回快速操作失败", n));
  }
  async emitEventAsync(e) {
    if (!this.isEnable) return;
    const n = {
      "Content-Type": "application/json",
      "x-self-id": this.core.selfInfo.uin
    }, r = JSON.stringify(e);
    if (this.config.token) {
      const s = fL("sha1", this.config.token);
      s.update(r), n["x-signature"] = "sha1=" + s.digest("hex");
    }
    const i = await ln.HttpGetText(this.config.url, "POST", r, n), o = i ? Ci.parse(i) : {};
    await this.obContext.apis.QuickActionApi.handleQuickOperation(e, o);
  }
  open() {
    this.isEnable = !0;
  }
  close() {
    this.isEnable = !1;
  }
  async reload(e) {
    const n = this.isEnable, r = this.config.url;
    return this.config = e, e.enable && !n ? (this.open(), rn.NetWorkOpen) : !e.enable && n ? (this.close(), rn.NetWorkClose) : r !== e.url ? rn.NetWorkReload : rn.Normal;
  }
}
class _g extends hU {
  meta_event_type = "heartbeat";
  status;
  interval;
  constructor(e, n, r, i) {
    super(e), this.interval = n, this.status = {
      online: r,
      good: i
    };
  }
}
class nF extends El {
  connection = null;
  heartbeatRef = null;
  get isActive() {
    return this.isEnable && !!this.connection && this.connection.readyState === fr.OPEN;
  }
  async onEvent(e) {
    this.connection && this.connection.readyState === fr.OPEN && this.connection.send(JSON.stringify(e));
  }
  async open() {
    if (!this.connection) {
      this.config.heartInterval > 0 && (this.heartbeatRef = setInterval(() => {
        this.connection && this.connection.readyState === fr.OPEN && this.connection.send(JSON.stringify(new _g(this.core, this.config.heartInterval, this.core.selfInfo.online ?? !0, !0)));
      }, this.config.heartInterval)), this.isEnable = !0;
      try {
        await this.tryConnect();
      } catch (e) {
        this.logger.logError("[OneBot] [WebSocket Client] TryConnect Error , info -> ", e);
      }
    }
  }
  close() {
    if (!this.isEnable) {
      this.logger.logDebug("Cannot close a closed WebSocket connection");
      return;
    }
    this.isEnable = !1, this.connection && (this.connection.close(), this.connection = null), this.heartbeatRef && (clearInterval(this.heartbeatRef), this.heartbeatRef = null);
  }
  async checkStateAndReply(e) {
    return new Promise((n, r) => {
      this.connection && this.connection.readyState === fr.OPEN ? (this.connection.send(JSON.stringify(e)), n()) : r(new Error("WebSocket is not open"));
    });
  }
  async tryConnect() {
    if (!this.connection && this.isEnable) {
      let e = !1;
      const n = {
        maxPayload: 50 * 1024 * 1024,
        // 50 MB
        handshakeTimeout: 2e3,
        perMessageDeflate: !1,
        headers: {
          "X-Self-ID": this.core.selfInfo.uin,
          Authorization: `Bearer ${this.config.token}`,
          "x-client-role": "Universal",
          // 为koishi adpter适配
          "User-Agent": "OneBot/11"
        }
      };
      this.config.verifyCertificate !== void 0 && (n.rejectUnauthorized = this.config.verifyCertificate), this.connection = new fr(this.config.url, n), this.connection.on("pong", () => {
      }), this.connection.on("open", () => {
        try {
          this.connectEvent(this.core).catch((r) => this.logger.logError("[OneBot] [WebSocket Client] 发送连接生命周期失败", r));
        } catch (r) {
          this.logger.logError("[OneBot] [WebSocket Client] 发送连接生命周期失败", r);
        }
      }), this.connection.on("message", (r) => {
        this.handleMessage(r);
      }), this.connection.once("close", () => {
        e || (this.logger.logError(`[OneBot] [WebSocket Client] 反向WebSocket (${this.config.url}) 连接意外关闭`), this.logger.logError(`[OneBot] [WebSocket Client] 在 ${Math.floor(this.config.reconnectInterval / 1e3)} 秒后尝试重新连接`), this.isEnable && (this.connection = null, setTimeout(() => this.tryConnect(), this.config.reconnectInterval)));
      }), this.connection.on("error", (r) => {
        e = !0, this.logger.logError(`[OneBot] [WebSocket Client] 反向WebSocket (${this.config.url}) 连接错误`, r), this.logger.logError(`[OneBot] [WebSocket Client] 在 ${Math.floor(this.config.reconnectInterval / 1e3)} 秒后尝试重新连接`), this.isEnable && (this.connection = null, setTimeout(() => this.tryConnect(), this.config.reconnectInterval));
      });
    }
  }
  async connectEvent(e) {
    try {
      await this.checkStateAndReply(new wy(e, xf.CONNECT));
    } catch (n) {
      this.logger.logError("[OneBot] [WebSocket Client] 发送生命周期失败", n);
    }
  }
  async handleMessage(e) {
    let n = { action: re.Unknown, params: {} }, r;
    try {
      n = Ci.parse(e.toString()), r = n.echo, this.logger.logDebug("[OneBot] [WebSocket Client] 收到正向Websocket消息", n);
    } catch {
      await this.checkStateAndReply(Rt.error("json解析失败,请检查数据格式", 1400, r));
      return;
    }
    n.params = n?.params ? n.params : {};
    const i = this.actions.get(n.action);
    if (!i) {
      this.logger.logError("[OneBot] [WebSocket Client] 发生错误", "不支持的Api " + n.action), await this.checkStateAndReply(Rt.error("不支持的Api " + n.action, 1404, r));
      return;
    }
    const o = await i.websocketHandle(n.params, r ?? "", this.name, this.config, {
      send: async (s) => {
        await this.checkStateAndReply({ ...Rt.ok(s, r ?? "", !0) });
      }
    });
    await this.checkStateAndReply({ ...o });
  }
  async reload(e) {
    const n = this.isEnable, r = this.config.url, i = this.config.heartInterval;
    return this.config = e, e.enable && !n ? (this.open(), rn.NetWorkOpen) : !e.enable && n ? (this.close(), rn.NetWorkClose) : r !== e.url ? (this.close(), e.enable && this.open(), rn.NetWorkReload) : i !== e.heartInterval ? (this.heartbeatRef && (clearInterval(this.heartbeatRef), this.heartbeatRef = null), e.heartInterval > 0 && this.isEnable && (this.heartbeatRef = setInterval(() => {
      this.connection && this.connection.readyState === fr.OPEN && this.connection.send(JSON.stringify(new _g(this.core, e.heartInterval, this.core.selfInfo.online ?? !0, !0)));
    }, e.heartInterval)), rn.NetWorkReload) : rn.Normal;
  }
}
var tw = { exports: {} }, Mh = { exports: {} };
/*!
 * vary
 * Copyright(c) 2014-2017 Douglas Christopher Wilson
 * MIT Licensed
 */
var rF;
function mU() {
  if (rF) return Mh.exports;
  rF = 1, Mh.exports = r, Mh.exports.append = e;
  var t = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
  function e(i, o) {
    if (typeof i != "string")
      throw new TypeError("header argument is required");
    if (!o)
      throw new TypeError("field argument is required");
    for (var s = Array.isArray(o) ? o : n(String(o)), a = 0; a < s.length; a++)
      if (!t.test(s[a]))
        throw new TypeError("field argument contains an invalid header name");
    if (i === "*")
      return i;
    var c = i, u = n(i.toLowerCase());
    if (s.indexOf("*") !== -1 || u.indexOf("*") !== -1)
      return "*";
    for (var l = 0; l < s.length; l++) {
      var d = s[l].toLowerCase();
      u.indexOf(d) === -1 && (u.push(d), c = c ? c + ", " + s[l] : s[l]);
    }
    return c;
  }
  function n(i) {
    for (var o = 0, s = [], a = 0, c = 0, u = i.length; c < u; c++)
      switch (i.charCodeAt(c)) {
        case 32:
          a === o && (a = o = c + 1);
          break;
        case 44:
          s.push(i.substring(a, o)), a = o = c + 1;
          break;
        default:
          o = c + 1;
          break;
      }
    return s.push(i.substring(a, o)), s;
  }
  function r(i, o) {
    if (!i || !i.getHeader || !i.setHeader)
      throw new TypeError("res argument is required");
    var s = i.getHeader("Vary") || "", a = Array.isArray(s) ? s.join(", ") : String(s);
    (s = e(a, o)) && i.setHeader("Vary", s);
  }
  return Mh.exports;
}
var iF;
function qhe() {
  return iF || (iF = 1, (function() {
    var t = $R(), e = mU(), n = {
      origin: "*",
      methods: "GET,HEAD,PUT,PATCH,POST,DELETE",
      preflightContinue: !1,
      optionsSuccessStatus: 204
    };
    function r(h) {
      return typeof h == "string" || h instanceof String;
    }
    function i(h, y) {
      if (Array.isArray(y)) {
        for (var x = 0; x < y.length; ++x)
          if (i(h, y[x]))
            return !0;
        return !1;
      } else return r(y) ? h === y : y instanceof RegExp ? y.test(h) : !!y;
    }
    function o(h, y) {
      var x = y.headers.origin, g = [], v;
      return !h.origin || h.origin === "*" ? g.push([{
        key: "Access-Control-Allow-Origin",
        value: "*"
      }]) : r(h.origin) ? (g.push([{
        key: "Access-Control-Allow-Origin",
        value: h.origin
      }]), g.push([{
        key: "Vary",
        value: "Origin"
      }])) : (v = i(x, h.origin), g.push([{
        key: "Access-Control-Allow-Origin",
        value: v ? x : !1
      }]), g.push([{
        key: "Vary",
        value: "Origin"
      }])), g;
    }
    function s(h) {
      var y = h.methods;
      return y.join && (y = h.methods.join(",")), {
        key: "Access-Control-Allow-Methods",
        value: y
      };
    }
    function a(h) {
      return h.credentials === !0 ? {
        key: "Access-Control-Allow-Credentials",
        value: "true"
      } : null;
    }
    function c(h, y) {
      var x = h.allowedHeaders || h.headers, g = [];
      return x ? x.join && (x = x.join(",")) : (x = y.headers["access-control-request-headers"], g.push([{
        key: "Vary",
        value: "Access-Control-Request-Headers"
      }])), x && x.length && g.push([{
        key: "Access-Control-Allow-Headers",
        value: x
      }]), g;
    }
    function u(h) {
      var y = h.exposedHeaders;
      if (y)
        y.join && (y = y.join(","));
      else return null;
      return y && y.length ? {
        key: "Access-Control-Expose-Headers",
        value: y
      } : null;
    }
    function l(h) {
      var y = (typeof h.maxAge == "number" || h.maxAge) && h.maxAge.toString();
      return y && y.length ? {
        key: "Access-Control-Max-Age",
        value: y
      } : null;
    }
    function d(h, y) {
      for (var x = 0, g = h.length; x < g; x++) {
        var v = h[x];
        v && (Array.isArray(v) ? d(v, y) : v.key === "Vary" && v.value ? e(y, v.value) : v.value && y.setHeader(v.key, v.value));
      }
    }
    function f(h, y, x, g) {
      var v = [], S = y.method && y.method.toUpperCase && y.method.toUpperCase();
      S === "OPTIONS" ? (v.push(o(h, y)), v.push(a(h)), v.push(s(h)), v.push(c(h, y)), v.push(l(h)), v.push(u(h)), d(v, x), h.preflightContinue ? g() : (x.statusCode = h.optionsSuccessStatus, x.setHeader("Content-Length", "0"), x.end())) : (v.push(o(h, y)), v.push(a(h)), v.push(u(h)), d(v, x), g());
    }
    function m(h) {
      var y = null;
      return typeof h == "function" ? y = h : y = function(x, g) {
        g(null, h);
      }, function(g, v, S) {
        y(g, function(E, T) {
          if (E)
            S(E);
          else {
            var j = t({}, n, T), q = null;
            j.origin && typeof j.origin == "function" ? q = j.origin : j.origin && (q = function(Y, W) {
              W(null, j.origin);
            }), q ? q(g.headers.origin, function(Y, W) {
              Y || !W ? S(Y) : (j.origin = W, f(j, g, v, S));
            }) : S();
          }
        });
      };
    }
    tw.exports = m;
  })()), tw.exports;
}
var Hhe = qhe();
const Whe = /* @__PURE__ */ Bo(Hhe);
var Rh = { exports: {} };
/*!
 * ee-first
 * Copyright(c) 2014 Jonathan Ong
 * MIT Licensed
 */
var nw, oF;
function zhe() {
  if (oF) return nw;
  oF = 1, nw = t;
  function t(n, r) {
    if (!Array.isArray(n))
      throw new TypeError("arg must be an array of [ee, events...] arrays");
    for (var i = [], o = 0; o < n.length; o++) {
      var s = n[o];
      if (!Array.isArray(s) || s.length < 2)
        throw new TypeError("each array member must be [ee, events...]");
      for (var a = s[0], c = 1; c < s.length; c++) {
        var u = s[c], l = e(u, d);
        a.on(u, l), i.push({
          ee: a,
          event: u,
          fn: l
        });
      }
    }
    function d() {
      f(), r.apply(null, arguments);
    }
    function f() {
      for (var h, y = 0; y < i.length; y++)
        h = i[y], h.ee.removeListener(h.event, h.fn);
    }
    function m(h) {
      r = h;
    }
    return m.cancel = f, m;
  }
  function e(n, r) {
    return function(o) {
      for (var s = new Array(arguments.length), a = this, c = n === "error" ? o : null, u = 0; u < s.length; u++)
        s[u] = arguments[u];
      r(c, a, n, s);
    };
  }
  return nw;
}
/*!
 * on-finished
 * Copyright(c) 2013 Jonathan Ong
 * Copyright(c) 2014 Douglas Christopher Wilson
 * MIT Licensed
 */
var sF;
function Khe() {
  if (sF) return Rh.exports;
  sF = 1, Rh.exports = r, Rh.exports.isFinished = i;
  var t = u(), e = zhe(), n = typeof setImmediate == "function" ? setImmediate : function(d) {
    process.nextTick(d.bind.apply(d, arguments));
  };
  function r(d, f) {
    return i(d) !== !1 ? (n(f, null, d), d) : (s(d, l(f)), d);
  }
  function i(d) {
    var f = d.socket;
    if (typeof d.finished == "boolean")
      return !!(d.finished || f && !f.writable);
    if (typeof d.complete == "boolean")
      return !!(d.upgrade || !f || !f.readable || d.complete && !d.readable);
  }
  function o(d, f) {
    var m, h, y = !1;
    function x(v) {
      m.cancel(), h.cancel(), y = !0, f(v);
    }
    m = h = e([[d, "end", "finish"]], x);
    function g(v) {
      d.removeListener("socket", g), !y && m === h && (h = e([[v, "error", "close"]], x));
    }
    if (d.socket) {
      g(d.socket);
      return;
    }
    d.on("socket", g), d.socket === void 0 && c(d, g);
  }
  function s(d, f) {
    var m = d.__onFinished;
    (!m || !m.queue) && (m = d.__onFinished = a(d), o(d, m)), m.queue.push(f);
  }
  function a(d) {
    function f(m) {
      if (d.__onFinished === f && (d.__onFinished = null), !!f.queue) {
        var h = f.queue;
        f.queue = null;
        for (var y = 0; y < h.length; y++)
          h[y](m, d);
      }
    }
    return f.queue = [], f;
  }
  function c(d, f) {
    var m = d.assignSocket;
    typeof m == "function" && (d.assignSocket = function(y) {
      m.call(this, y), f(y);
    });
  }
  function u() {
    try {
      return require("async_hooks");
    } catch {
      return {};
    }
  }
  function l(d) {
    var f;
    return t.AsyncResource && (f = new t.AsyncResource(d.name || "bound-anonymous-fn")), !f || !f.runInAsyncScope ? d : f.runInAsyncScope.bind(f, d, null);
  }
  return Rh.exports;
}
var Vhe = Khe(), Yhe = jR();
const Jhe = /* @__PURE__ */ Bo(Yhe);
class B_ extends El {
  app;
  server;
  wsServer;
  wsClients = [];
  heartbeatIntervalId = null;
  wsClientWithEvent = [];
  get isActive() {
    return this.isEnable && this.wsClientWithEvent.length > 0;
  }
  async onEvent(e) {
    const n = this.wsClientWithEvent.map((r) => new Promise((i, o) => {
      r.readyState === fr.OPEN ? (r.send(JSON.stringify(e)), i()) : o(new Error("WebSocket is not open"));
    }));
    await Promise.allSettled(n);
  }
  open() {
    try {
      if (this.isEnable) {
        this.core.context.logger.logError("Cannot open a closed HTTP server");
        return;
      }
      this.isEnable || (this.initializeServer(), this.isEnable = !0);
    } catch (e) {
      this.core.context.logger.logError(`[OneBot] [HTTP Server Adapter] Boot Error: ${e}`);
    }
  }
  async close() {
    this.isEnable = !1, this.server?.close(), this.app = void 0, this.stopHeartbeat(), this.wsClients.forEach((e) => e.close()), this.wsClients = [], this.wsClientWithEvent = [], this.wsServer?.close();
  }
  initializeServer() {
    this.app = ru(), this.server = fc.createServer(this.app), this.config.enableWebsocket && (this.wsServer = new qp({ server: this.server }), this.createWSServer(this.wsServer)), this.app.use(Whe()), this.app.use(ru.urlencoded({ extended: !0, limit: "5000mb" })), this.app.use((e, n, r) => {
      if (Vhe.isFinished(e)) {
        r();
        return;
      }
      if (!Jhe.hasBody(e)) {
        r();
        return;
      }
      e.headers["content-type"] = "application/json";
      let i = "";
      e.on("data", (o) => {
        i += o;
      }), e.on("end", () => {
        try {
          e.body = { ...Ci.parse(i || "{}"), ...e.body }, r();
        } catch {
          n.status(400).send("Invalid JSON");
        }
      }), e.on("error", () => n.status(400).send("Invalid JSON"));
    }), this.app.use((e, n, r) => this.authorize(this.config.token, e, n, r)), this.app.use(async (e, n) => {
      await this.handleRequest(e, n);
    }), this.server.listen(this.config.port, this.config.host, () => {
      this.core.context.logger.log(`[OneBot] [HTTP Server Adapter] Start On ${this.config.host}:${this.config.port}`);
    });
  }
  authorize(e, n, r, i) {
    if (!e || e.length === 0) return i();
    const o = n.headers.authorization?.split("Bearer ").pop() || "", s = n.query.access_token;
    return (typeof s == "string" && s !== "" ? s : o) === e ? i() : r.status(403).send(JSON.stringify({ message: "token verify failed!" }));
  }
  createWSServer(e) {
    e.on("connection", async (n, r) => {
      if (!this.isEnable) {
        n.close();
        return;
      }
      if (!this.authorizeWS(this.config.token, n, r))
        return;
      const i = r.url?.indexOf("?") !== -1 ? r.url?.substring(0, r.url?.indexOf("?")) : r.url, o = i === "/api" || i === "/api/";
      o || this.connectEvent(this.core, n), n.on("error", (s) => this.logger.log("[OneBot] [HTTP WebSocket] Client Error:", s.message)), n.on("message", (s) => {
        this.handleWSMessage(n, s).then().catch((a) => this.logger.logError(a));
      }), n.on("pong", () => {
      }), n.once("close", () => {
        const s = this.wsClients.indexOf(n);
        s !== -1 && this.wsClients.splice(s, 1);
        const a = this.wsClientWithEvent.indexOf(n);
        a !== -1 && this.wsClientWithEvent.splice(a, 1), this.wsClientWithEvent.length === 0 && this.stopHeartbeat();
      }), o || this.wsClientWithEvent.push(n), this.wsClients.push(n), this.wsClientWithEvent.length > 0 && this.startHeartbeat();
    }).on("error", (n) => this.logger.log("[OneBot] [HTTP WebSocket] Server Error:", n.message));
  }
  connectEvent(e, n) {
    try {
      this.checkStateAndReply(new wy(e, xf.CONNECT), n).catch((r) => this.logger.logError("[OneBot] [HTTP WebSocket] 发送生命周期失败", r));
    } catch (r) {
      this.logger.logError("[OneBot] [HTTP WebSocket] 发送生命周期失败", r);
    }
  }
  startHeartbeat() {
    this.heartbeatIntervalId || (this.heartbeatIntervalId = setInterval(() => {
      this.wsClientWithEvent.forEach((e) => {
        e.readyState === fr.OPEN && e.send(JSON.stringify(new _g(this.core, 3e4, this.core.selfInfo.online ?? !0, !0)));
      });
    }, 3e4));
  }
  stopHeartbeat() {
    this.heartbeatIntervalId && (clearInterval(this.heartbeatIntervalId), this.heartbeatIntervalId = null);
  }
  authorizeWS(e, n, r) {
    if (!e || e.length === 0) return !0;
    const o = new xO(r?.url || "", `http://${r.headers.host}`).searchParams.get("access_token"), s = r.headers.authorization?.split("Bearer ").pop() || "";
    return (typeof o == "string" && o !== "" ? o : s) === e ? !0 : (n.send(JSON.stringify(Rt.res(null, "failed", 1403, "token验证失败"))), n.close(), !1);
  }
  async checkStateAndReply(e, n) {
    return await new Promise((r, i) => {
      n.readyState === fr.OPEN ? (n.send(JSON.stringify(e)), r()) : i(new Error("WebSocket is not open"));
    });
  }
  async handleWSMessage(e, n) {
    let r = { action: re.Unknown, params: {} }, i;
    try {
      r = Ci.parse(n.toString()), i = r.echo;
    } catch {
      await this.checkStateAndReply(Rt.error("json解析失败,请检查数据格式", 1400, i), e);
      return;
    }
    r.params = r?.params ? r.params : {};
    const o = this.actions.get(r.action);
    if (!o) {
      this.logger.logError("[OneBot] [HTTP WebSocket] 发生错误", "不支持的API " + r.action), await this.checkStateAndReply(Rt.error("不支持的API " + r.action, 1404, i), e);
      return;
    }
    const s = await o.websocketHandle(r.params, i ?? "", this.name, this.config, {
      send: async (a) => {
        await this.checkStateAndReply({ ...Rt.ok(a, i ?? "", !0) }, e);
      }
    });
    await this.checkStateAndReply({ ...s }, e);
  }
  async httpApiRequest(e, n, r = !1) {
    let i = e.body;
    if (e.method === "GET" ? i = e.query : e.query && (i = { ...e.body, ...e.query }), e.path === "" || e.path === "/") {
      const u = Rt.ok({});
      return u.message = "NapCat4 Is Running", n.json(u);
    }
    const o = e.path.split("/")[1], a = i.echo ?? Math.random().toString(36).substring(2, 15), c = this.actions.get(o);
    if (c) {
      const u = c.useStream;
      try {
        const l = await c.handle(i, this.name, this.config, {
          send: r ? async (d) => {
            await this.onEvent({ ...Rt.ok(d, a, !0) });
          } : async (d) => new Promise((m, h) => {
            n.write(JSON.stringify({ ...Rt.ok(d, a, !0) }) + `\r
\r
`, () => {
              m();
            });
          })
        }, a);
        return u ? (n.write(JSON.stringify({ ...l }) + `\r
\r
`), n.end()) : n.json(l);
      } catch (l) {
        return n.json(Rt.error(l?.stack?.toString() || l?.message || "Error Handle", 200, a));
      }
    } else
      return n.json(Rt.error("不支持的Api " + o, 200, a));
  }
  async handleRequest(e, n) {
    if (!this.isEnable) {
      this.core.context.logger.log("[OneBot] [HTTP Server Adapter] Server is closed"), n.json(Rt.error("Server is closed", 200));
      return;
    }
    this.httpApiRequest(e, n);
  }
  async reload(e) {
    const n = this.isEnable, r = this.config.port, i = this.config.host, o = this.config.enableWebsocket;
    return this.config = e, e.enable && !n ? (this.open(), rn.NetWorkOpen) : !e.enable && n ? (this.close(), rn.NetWorkClose) : r !== e.port || i !== e.host || o !== e.enableWebsocket ? (this.close(), e.enable && this.open(), rn.NetWorkReload) : rn.Normal;
  }
}
class aF extends El {
  wsServer;
  wsClients = [];
  heartbeatIntervalId = null;
  wsClientWithEvent = [];
  get isActive() {
    return this.isEnable && this.wsClientWithEvent.length > 0;
  }
  constructor(e, n, r, i, o) {
    super(e, n, r, i, o), this.wsServer = new qp({
      port: this.config.port,
      host: this.config.host === "0.0.0.0" ? "" : this.config.host,
      maxPayload: 50 * 1024 * 1024
      // 50 MB
    }), this.createServer(this.wsServer);
  }
  createServer(e) {
    e.on("connection", async (n, r) => {
      if (!this.isEnable) {
        n.close();
        return;
      }
      if (!this.authorize(this.config.token, n, r))
        return;
      const i = r.url?.indexOf("?") !== -1 ? r.url?.substring(0, r.url?.indexOf("?")) : r.url, o = i === "/api" || i === "/api/";
      o || this.connectEvent(this.core, n), n.on("error", (s) => this.logger.log("[OneBot] [WebSocket Server] Client Error:", s.message)), n.on("message", (s) => {
        this.handleMessage(n, s).then().catch((a) => this.logger.logError(a));
      }), n.on("pong", () => {
      }), n.once("close", () => {
        const s = this.wsClients.indexOf(n);
        s !== -1 && this.wsClients.splice(s, 1);
        const a = this.wsClientWithEvent.indexOf(n);
        a !== -1 && this.wsClientWithEvent.splice(a, 1), this.wsClientWithEvent.length === 0 && this.stopHeartbeat();
      }), o || this.wsClientWithEvent.push(n), this.wsClients.push(n), this.wsClientWithEvent.length > 0 && this.startHeartbeat();
    }).on("error", (n) => this.logger.log("[OneBot] [WebSocket Server] Server Error:", n.message));
  }
  connectEvent(e, n) {
    try {
      this.checkStateAndReply(new wy(e, xf.CONNECT), n).catch((r) => this.logger.logError("[OneBot] [WebSocket Server] 发送生命周期失败", r));
    } catch (r) {
      this.logger.logError("[OneBot] [WebSocket Server] 发送生命周期失败", r);
    }
  }
  async onEvent(e) {
    const n = this.wsClientWithEvent.map((r) => new Promise((i, o) => {
      r.readyState === fr.OPEN ? (r.send(JSON.stringify(e)), i()) : o(new Error("WebSocket is not open"));
    }));
    await Promise.allSettled(n);
  }
  open() {
    if (this.isEnable) {
      this.logger.logError("[OneBot] [WebSocket Server] Cannot open a opened WebSocket server");
      return;
    }
    const e = this.wsServer?.address();
    this.logger.log("[OneBot] [WebSocket Server] Server Started", typeof e == "string" ? e : e?.address + ":" + e?.port), this.isEnable = !0;
  }
  async close() {
    this.isEnable = !1, this.wsServer?.close((e) => {
      e ? this.logger.logError("[OneBot] [WebSocket Server] Error closing server:", e.message) : this.logger.log("[OneBot] [WebSocket Server] Server Closed");
    }), this.stopHeartbeat(), this.wsClients.forEach((e) => e.close()), this.wsClients = [], this.wsClientWithEvent = [];
  }
  startHeartbeat() {
    this.heartbeatIntervalId || this.config.heartInterval <= 0 || (this.heartbeatIntervalId = setInterval(() => {
      this.wsClientWithEvent.forEach((e) => {
        e.readyState === fr.OPEN && e.send(JSON.stringify(new _g(this.core, this.config.heartInterval, this.core.selfInfo.online ?? !0, !0)));
      });
    }, this.config.heartInterval));
  }
  stopHeartbeat() {
    this.heartbeatIntervalId && (clearInterval(this.heartbeatIntervalId), this.heartbeatIntervalId = null);
  }
  authorize(e, n, r) {
    if (!e || e.length === 0) return !0;
    const o = new xO(r?.url || "", `http://${r.headers.host}`).searchParams.get("access_token"), s = r.headers.authorization?.split("Bearer ").pop() || "";
    return (typeof o == "string" && o !== "" ? o : s) === e ? !0 : (n.send(JSON.stringify(Rt.res(null, "failed", 1403, "token验证失败"))), n.close(), !1);
  }
  async checkStateAndReply(e, n) {
    return await new Promise((r, i) => {
      n.readyState === fr.OPEN ? (n.send(JSON.stringify(e)), r()) : i(new Error("WebSocket is not open"));
    });
  }
  async handleMessage(e, n) {
    let r = { action: re.Unknown, params: {} }, i;
    try {
      r = Ci.parse(n.toString()), i = r.echo;
    } catch {
      await this.checkStateAndReply(Rt.error("json解析失败,请检查数据格式", 1400, i), e);
      return;
    }
    r.params = r?.params ? r.params : {};
    const o = this.actions.get(r.action);
    if (!o) {
      this.logger.logError("[OneBot] [WebSocket Client] 发生错误", "不支持的API " + r.action), await this.checkStateAndReply(Rt.error("不支持的API " + r.action, 1404, i), e);
      return;
    }
    const s = await o.websocketHandle(r.params, i ?? "", this.name, this.config, {
      send: async (a) => {
        await this.checkStateAndReply({ ...Rt.ok(a, i ?? "", !0) }, e);
      }
    });
    await this.checkStateAndReply({ ...s }, e);
  }
  async reload(e) {
    const n = this.isEnable, r = this.config.port, i = this.config.host, o = this.config.heartInterval;
    return this.config = e, e.enable && !n ? (this.open(), rn.NetWorkOpen) : !e.enable && n ? (this.close(), rn.NetWorkClose) : r !== e.port || i !== e.host ? (this.close(), this.wsServer = new qp({
      port: e.port,
      host: e.host === "0.0.0.0" ? "" : e.host,
      maxPayload: 50 * 1024 * 1024
      // 50 MB
    }), this.createServer(this.wsServer), e.enable && this.open(), rn.NetWorkReload) : o !== e.heartInterval ? (this.stopHeartbeat(), e.heartInterval > 0 && this.isEnable && this.wsClientWithEvent.length > 0 && this.startHeartbeat(), rn.NetWorkReload) : rn.Normal;
  }
}
var rn = /* @__PURE__ */ ((t) => (t[t.Normal = 0] = "Normal", t[t.ConfigChange = 1] = "ConfigChange", t[t.NetWorkReload = 2] = "NetWorkReload", t[t.NetWorkClose = 3] = "NetWorkClose", t[t.NetWorkOpen = 4] = "NetWorkOpen", t))(rn || {});
class Xhe {
  adapters = /* @__PURE__ */ new Map();
  async openAllAdapters() {
    return Promise.all(Array.from(this.adapters.values()).map((e) => e.open()));
  }
  async emitEvent(e) {
    return Promise.all(Array.from(this.adapters.values()).map(async (n) => {
      if (n.isActive)
        return await n.onEvent(e);
    }));
  }
  async emitEvents(e) {
    return Promise.all(e.map((n) => this.emitEvent(n)));
  }
  async emitEventByName(e, n) {
    return Promise.all(e.map(async (r) => {
      const i = this.adapters.get(r);
      if (i && i.isActive)
        return await i.onEvent(n);
    }));
  }
  async emitEventByNames(e) {
    return Promise.all(Array.from(e.entries()).map(async ([n, r]) => {
      const i = this.adapters.get(n);
      if (i && i.isActive)
        return await i.onEvent(r);
    }));
  }
  registerAdapter(e) {
    this.adapters.set(e.name, e);
  }
  async registerAdapterAndOpen(e) {
    this.registerAdapter(e), await e.open();
  }
  async closeSomeAdapters(e) {
    for (const n of e)
      this.adapters.delete(n.name), await n.close();
  }
  async closeSomeAdaterWhenOpen(e) {
    for (const n of e)
      this.adapters.delete(n.name), n.isEnable && await n.close();
  }
  findSomeAdapter(e) {
    return this.adapters.get(e);
  }
  async closeAdapterByPredicate(e) {
    const n = Array.from(this.adapters.values()).filter(e);
    await this.closeSomeAdapters(n);
  }
  async closeAllAdapters() {
    await Promise.all(Array.from(this.adapters.values()).map((e) => e.close())), this.adapters.clear();
  }
  async readloadAdapter(e, n) {
    const r = this.adapters.get(e);
    r && await r.reload(n);
  }
  async readloadSomeAdapters(e) {
    await Promise.all(Array.from(e.entries()).map(([n, r]) => this.readloadAdapter(n, r)));
  }
  hasActiveAdapters() {
    return Array.from(this.adapters.values()).some((e) => e.isActive);
  }
  async getAllConfig() {
    return Array.from(this.adapters.values()).map((e) => e.config);
  }
}
const Al = yr(), Eg = "debug-primary";
Al.get("/schemas", async (t, e) => {
  try {
    const n = ve.getOneBotContext();
    if (!n)
      return ne(e, "OneBot 未初始化");
    const r = {};
    for (const i in re) {
      const o = re[i];
      if (o === re.Unknown) continue;
      const s = n.actions.get(o);
      if (s) {
        const a = s;
        r[o] = {
          description: a.actionSummary || a.actionDescription,
          payload: a.payloadSchema,
          response: a.returnSchema,
          payloadExample: a.payloadExample,
          tags: a.actionTags
        };
      }
    }
    me(e, r);
  } catch (n) {
    ne(e, n.message);
  }
});
class Zhe extends El {
  token;
  wsClients = [];
  wsClientWithEvent = [];
  lastActivityTime = Date.now();
  inactivityTimer = null;
  INACTIVITY_TIMEOUT = 300 * 1e3;
  // 5分钟不活跃
  get isActive() {
    return this.isEnable && this.wsClientWithEvent.length > 0;
  }
  constructor(e, n, r, i) {
    const o = {
      enable: !0,
      name: `debug-${e}`,
      host: "127.0.0.1",
      port: 0,
      messagePostFormat: "array",
      reportSelfMessage: !0,
      token: "",
      enableForcePushEvent: !0,
      debug: !0,
      heartInterval: 0
    };
    super(`debug-${e}`, o, n, r, i), this.token = Math.random().toString(36).substring(2) + Math.random().toString(36).substring(2), this.isEnable = !1, this.startInactivityCheck();
  }
  async open() {
    if (this.isEnable) {
      this.logger.logError("[Debug] Cannot open an already opened adapter");
      return;
    }
    this.logger.log("[Debug] Adapter opened:", this.name), this.isEnable = !0;
  }
  async close() {
    this.isEnable && (this.logger.log("[Debug] Adapter closing:", this.name), this.isEnable = !1, this.inactivityTimer && (clearInterval(this.inactivityTimer), this.inactivityTimer = null), this.wsClients.forEach((e) => {
      try {
        e.removeAllListeners(), e.close();
      } catch (n) {
        this.logger.logError("[Debug] 关闭 WebSocket 失败:", n);
      }
    }), this.wsClients = [], this.wsClientWithEvent = []);
  }
  async reload(e) {
    return rn.NetWorkReload;
  }
  async onEvent(e) {
    this.updateActivity();
    const n = JSON.stringify(e);
    this.wsClientWithEvent.forEach((r) => {
      if (r.readyState === fr.OPEN)
        try {
          r.send(n);
        } catch (i) {
          this.logger.logError("[Debug] 发送事件失败:", i);
        }
    });
  }
  async callApi(e, n) {
    this.updateActivity();
    const r = this.actions.get(e);
    if (!r)
      throw new Error(`不支持的 API: ${e}`);
    return await r.handle(n, this.name, this.config);
  }
  async handleMessage(e, n) {
    this.updateActivity();
    let r = {
      action: re.Unknown,
      params: {}
    }, i;
    try {
      r = Ci.parse(n.toString()), i = r.echo;
    } catch {
      this.sendToClient(e, Rt.error("json解析失败,请检查数据格式", 1400, i));
      return;
    }
    r.params = r?.params || {};
    const o = this.actions.get(r.action);
    if (!o) {
      this.logger.logError("[Debug] 不支持的API:", r.action), this.sendToClient(e, Rt.error("不支持的API " + r.action, 1404, i));
      return;
    }
    try {
      const s = await o.websocketHandle(r.params, i ?? "", this.name, this.config, {
        send: async (a) => {
          this.sendToClient(e, Rt.ok(a, i ?? "", !0));
        }
      });
      this.sendToClient(e, s);
    } catch (s) {
      const a = s;
      this.logger.logError("[Debug] 处理消息失败:", a), this.sendToClient(e, Rt.error(a.message || "内部错误", 1200, i));
    }
  }
  sendToClient(e, n) {
    if (e.readyState === fr.OPEN)
      try {
        e.send(JSON.stringify(n));
      } catch (r) {
        this.logger.logError("[Debug] 发送消息失败:", r);
      }
  }
  async addWsClient(e) {
    this.wsClientWithEvent.push(e), this.wsClients.push(e), this.updateActivity(), this.sendToClient(e, new wy(this.core, xf.CONNECT)), e.on("error", (n) => this.logger.log("[Debug] WebSocket Error:", n.message)), e.on("message", (n) => {
      this.handleMessage(e, n).catch((r) => {
        this.logger.logError("[Debug] handleMessage error:", r);
      });
    }), e.on("ping", () => e.pong()), e.once("close", () => this.removeWsClient(e));
  }
  removeWsClient(e) {
    const n = this.wsClients.indexOf(e);
    n !== -1 && this.wsClients.splice(n, 1);
    const r = this.wsClientWithEvent.indexOf(e);
    r !== -1 && this.wsClientWithEvent.splice(r, 1);
  }
  updateActivity() {
    this.lastActivityTime = Date.now();
  }
  startInactivityCheck() {
    this.inactivityTimer = setInterval(() => {
      if (Date.now() - this.lastActivityTime > this.INACTIVITY_TIMEOUT && this.wsClients.length === 0) {
        this.logger.log(`[Debug] Adapter ${this.name} 不活跃，自动关闭`);
        const n = ve.getOneBotContext();
        n && (ca.removeAdapter(this.name), n.networkManager.closeSomeAdapters([this]).catch((r) => {
          this.logger.logError("[Debug] 自动关闭适配器失败:", r);
        }));
      }
    }, 3e4);
  }
  validateToken(e) {
    return this.token === e;
  }
}
class eme {
  currentAdapter = null;
  getOrCreateAdapter() {
    if (this.currentAdapter)
      return this.currentAdapter.updateActivity(), this.currentAdapter;
    const e = ve.getOneBotContext();
    if (!e)
      throw new Error("OneBot 未初始化，无法创建调试适配器");
    const n = new Zhe("primary", e.core, e, e.actions);
    return this.currentAdapter = n, e.networkManager.registerAdapterAndOpen(n).catch((r) => {
      console.error("[Debug] 注册适配器失败:", r);
    }), n;
  }
  getAdapter(e) {
    if (this.currentAdapter && this.currentAdapter.name === e)
      return this.currentAdapter;
  }
  removeAdapter(e) {
    this.currentAdapter && this.currentAdapter.name === e && (this.currentAdapter = null);
  }
}
const ca = new eme();
Al.post("/create", async (t, e) => {
  try {
    const n = ca.getOrCreateAdapter();
    me(e, {
      adapterName: n.name,
      token: n.token,
      message: "调试适配器已就绪"
    });
  } catch (n) {
    ne(e, n.message);
  }
});
const gU = async (t, e) => {
  try {
    const n = t.params.adapterName || t.body.adapterName || Eg;
    let r = ca.getAdapter(n);
    if (!r && n === Eg && (r = ca.getOrCreateAdapter()), !r)
      return ne(e, "调试适配器不存在");
    const { action: i, params: o } = t.body, s = await r.callApi(i, o || {});
    me(e, s);
  } catch (n) {
    ne(e, n.message);
  }
};
Al.post("/call/:adapterName", gU);
Al.post("/call", gU);
Al.post("/close/:adapterName", async (t, e) => {
  try {
    const { adapterName: n } = t.params;
    if (!n)
      return ne(e, "缺少 adapterName 参数");
    const r = ca.getAdapter(n);
    if (!r)
      return ne(e, "调试适配器不存在");
    ca.removeAdapter(n);
    const i = ve.getOneBotContext();
    i && await i.networkManager.closeSomeAdapters([r]), me(e, { message: "调试适配器已关闭" });
  } catch (n) {
    ne(e, n.message);
  }
});
function tme(t, e, n) {
  const r = new URL(t.url || "", `http://${t.headers.host}`);
  let i = r.searchParams.get("adapterName");
  const o = r.searchParams.get("token") || r.searchParams.get("access_token");
  if (i || (i = Eg), !o) {
    console.log("[Debug] WebSocket 连接被拒绝: 缺少 Token"), e.write(`HTTP/1.1 401 Unauthorized\r
\r
`), e.destroy();
    return;
  }
  let s = ca.getAdapter(i);
  if (!s && i === Eg)
    try {
      s = ca.getOrCreateAdapter();
    } catch (c) {
      console.log("[Debug] WebSocket 连接被拒绝: 无法创建适配器", c), e.write(`HTTP/1.1 500 Internal Server Error\r
\r
`), e.destroy();
      return;
    }
  if (!s) {
    console.log("[Debug] WebSocket 连接被拒绝: 适配器不存在"), e.write(`HTTP/1.1 404 Not Found\r
\r
`), e.destroy();
    return;
  }
  if (!s.validateToken(o)) {
    console.log("[Debug] WebSocket 连接被拒绝: Token 无效"), e.write(`HTTP/1.1 403 Forbidden\r
\r
`), e.destroy();
    return;
  }
  new qp({ noServer: !0 }).handleUpgrade(t, e, n, (c) => {
    s.addWsClient(c).catch((u) => {
      console.error("[Debug] 添加 WebSocket 客户端失败:", u), c.close();
    });
  });
}
async function nme(t, e) {
  try {
    const n = await ve.requestRestartProcess();
    return n.result ? me(e, { message: n.message || "进程重启请求已发送" }) : ne(e, n.message || "进程重启失败");
  } catch (n) {
    return ne(e, "重启进程时发生错误: " + n.message);
  }
}
const yU = yr();
yU.post("/Restart", nme);
class cF {
  static text(e, n, r, i, o) {
    return { key: e, type: "string", label: n, default: r, description: i, reactive: o };
  }
  static number(e, n, r, i, o) {
    return { key: e, type: "number", label: n, default: r, description: i, reactive: o };
  }
  static boolean(e, n, r, i, o) {
    return { key: e, type: "boolean", label: n, default: r, description: i, reactive: o };
  }
  static select(e, n, r, i, o, s) {
    return { key: e, type: "select", label: n, options: r, default: i, description: o, reactive: s };
  }
  static multiSelect(e, n, r, i, o, s) {
    return { key: e, type: "multi-select", label: n, options: r, default: i, description: o, reactive: s };
  }
  static html(e) {
    return { key: `_html_${Math.random().toString(36).slice(2)}`, type: "html", label: "", default: e };
  }
  static plainText(e) {
    return { key: `_text_${Math.random().toString(36).slice(2)}`, type: "text", label: "", default: e };
  }
  static combine(...e) {
    return e;
  }
}
const uF = uO(import.meta.url), rme = /* @__PURE__ */ new Set([
  "napcat-plugin-builtin",
  "napcat-plugin-cleaner",
  "napcat-plugin-ssqq",
  "napcat-plugin-qce"
]), ime = [
  "发卡",
  "卡密",
  "卡网",
  "自动发卡",
  "寄售",
  "代刷",
  "刷单",
  "跑分",
  "四件套",
  "洗钱",
  "黑产",
  "灰产",
  "博彩",
  "赌博",
  "菠菜",
  "涉黄",
  "色情",
  "收款码",
  "代付",
  "担保交易",
  "第三方支付",
  "USDT"
], ome = /* @__PURE__ */ new Set([".js", ".mjs", ".cjs", ".ts"]), sme = /* @__PURE__ */ new Set(["data", "node_modules", ".git"]), ame = 5 * 1024 * 1024;
class cme {
  constructor(e, n, r) {
    this.pluginPath = e, this.configPath = n, this.logger = r;
  }
  /**
   * 加载插件状态配置
   */
  loadPluginStatusConfig() {
    if (de.existsSync(this.configPath))
      try {
        return JSON.parse(de.readFileSync(this.configPath, "utf-8"));
      } catch (e) {
        this.logger.logWarn("[PluginLoader] Error parsing plugins.json", e);
      }
    return {};
  }
  /**
   * 保存插件状态配置
   */
  savePluginStatusConfig(e) {
    try {
      de.writeFileSync(this.configPath, JSON.stringify(e, null, 2), "utf-8");
    } catch (n) {
      this.logger.logError("[PluginLoader] Error saving plugins.json", n);
    }
  }
  /**
   * 扫描插件目录，收集所有有效插件条目（异步版本，验证模块有效性）
   * 只有包含有效 plugin_init 函数的插件才会被收集
   */
  async scanPlugins() {
    const e = [];
    if (!de.existsSync(this.pluginPath))
      return this.logger.logWarn(`[PluginLoader] Plugin directory does not exist: ${this.pluginPath}`), de.mkdirSync(this.pluginPath, { recursive: !0 }), e;
    const n = de.readdirSync(this.pluginPath, { withFileTypes: !0 }), r = this.loadPluginStatusConfig();
    for (const i of n) {
      if (!i.isDirectory())
        continue;
      const o = this.scanDirectoryPlugin(i.name, r);
      if (!o)
        continue;
      if (!o.entryPath) {
        this.logger.logWarn(`[PluginLoader] Skipping ${i.name}: no entry file found`);
        continue;
      }
      if (!o.enable) {
        e.push(o);
        continue;
      }
      const s = await this.validatePluginEntry(o.entryPath);
      if (!s.valid) {
        this.logger.logWarn(`[PluginLoader] Skipping ${i.name}: ${s.error}`);
        continue;
      }
      e.push(o);
    }
    return e;
  }
  /**
   * 扫描单个目录插件
   */
  scanDirectoryPlugin(e, n) {
    const r = be.join(this.pluginPath, e);
    try {
      let i;
      const o = be.join(r, "package.json");
      if (de.existsSync(o))
        try {
          const f = de.readFileSync(o, "utf-8");
          i = JSON.parse(f);
        } catch (f) {
          this.logger.logWarn(`[PluginLoader] Invalid package.json in ${e}:`, f);
        }
      const s = i?.name || e, a = this.getRejectReason(s, r);
      if (a)
        return this.logger.logWarn(`[PluginLoader] Rejected ${s} (${e}): ${a}`), null;
      const c = this.findEntryFile(r, i), u = c ? be.join(r, c) : void 0, l = n[s] ?? s === "napcat-plugin-builtin", d = {
        id: s,
        fileId: e,
        name: i?.name,
        version: i?.version,
        description: i?.description,
        author: i?.author,
        pluginPath: r,
        entryPath: u,
        packageJson: i,
        enable: l,
        loaded: !1,
        runtime: {
          status: "unloaded"
        }
      };
      return u || (d.runtime = {
        status: "error",
        error: `No valid entry file found for plugin directory: ${e}`
      }), d;
    } catch (i) {
      return {
        id: e,
        // 使用目录名作为 ID
        fileId: e,
        pluginPath: be.join(this.pluginPath, e),
        enable: n[e] ?? e === "napcat-plugin-builtin",
        loaded: !1,
        runtime: {
          status: "error",
          error: i.message || "Unknown error during scan"
        }
      };
    }
  }
  /**
   * 查找插件目录的入口文件
   */
  findEntryFile(e, n) {
    const r = [
      n?.main,
      "index.mjs",
      "index.js",
      "main.mjs",
      "main.js"
    ].filter(Boolean);
    for (const i of r) {
      const o = be.resolve(e), s = be.resolve(e, i);
      if (!(s !== o && !s.startsWith(o + be.sep)) && de.existsSync(s) && de.statSync(s).isFile())
        return i;
    }
    return null;
  }
  /** 是否为白名单内的官方插件 */
  isOfficialPlugin(e) {
    return rme.has(e);
  }
  /**
   * 判断插件是否应被拒绝（非官方 / 命中敏感词）。
   * @returns 拒绝原因；通过校验返回 null
   */
  getRejectReason(e, n) {
    const r = this.scanSensitiveWords(n);
    return this.isOfficialPlugin(e) ? null : r ? `sensitive keyword "${r}"` : "not in official plugin whitelist";
  }
  /**
   * 递归扫描插件目录内源码是否命中敏感词（黑灰产 / 支付发卡）。
   * @returns 命中的敏感词；未命中返回 null
   */
  scanSensitiveWords(e) {
    const n = (r) => {
      let i;
      try {
        i = de.readdirSync(r, { withFileTypes: !0 });
      } catch {
        return null;
      }
      for (const o of i) {
        if (o.isDirectory()) {
          if (sme.has(o.name))
            continue;
          const a = n(be.join(r, o.name));
          if (a)
            return a;
          continue;
        }
        if (!o.isFile() || !ome.has(be.extname(o.name).toLowerCase()))
          continue;
        const s = be.join(r, o.name);
        try {
          if (de.statSync(s).size > ame)
            continue;
          const a = de.readFileSync(s, "utf-8");
          for (const c of ime)
            if (a.includes(c))
              return c;
        } catch {
        }
      }
      return null;
    };
    return n(e);
  }
  /**
   * 动态导入模块
   */
  async importModule(e) {
    return await import(`${`file://${e.replace(/\\/g, "/")}`}?t=${Date.now()}`);
  }
  /**
   * 加载插件模块
   */
  async loadPluginModule(e) {
    if (!e.entryPath)
      return e.runtime = {
        status: "error",
        error: "No entry path specified"
      }, null;
    try {
      const n = await this.importModule(e.entryPath);
      return this.isValidPluginModule(n) ? n : (e.runtime = {
        status: "error",
        error: "Invalid plugin module: missing plugin_init function"
      }, null);
    } catch (n) {
      return e.runtime = {
        status: "error",
        error: n.message || "Failed to import module"
      }, null;
    }
  }
  /**
   * 检查模块是否为有效的插件模块
   */
  isValidPluginModule(e) {
    return e && typeof e.plugin_init == "function";
  }
  /**
   * 验证插件入口文件是否包含有效的 plugin_init 函数
   * 用于扫描阶段快速验证
   */
  async validatePluginEntry(e) {
    try {
      const n = await this.importModule(e);
      return this.isValidPluginModule(n) ? { valid: !0 } : { valid: !1, error: "Missing plugin_init function" };
    } catch (n) {
      return { valid: !1, error: n.message || "Failed to import module" };
    }
  }
  /**
   * 重新扫描单个插件
   */
  rescanPlugin(e) {
    const n = this.loadPluginStatusConfig();
    return this.scanDirectoryPlugin(e, n);
  }
  /**
   * 通过 ID 查找插件目录名
   */
  findPluginDirById(e) {
    if (!de.existsSync(this.pluginPath))
      return null;
    const n = de.readdirSync(this.pluginPath, { withFileTypes: !0 });
    for (const r of n) {
      if (!r.isDirectory()) continue;
      const i = be.join(this.pluginPath, r.name, "package.json");
      if (de.existsSync(i))
        try {
          if (JSON.parse(de.readFileSync(i, "utf-8")).name === e)
            return r.name;
        } catch {
        }
      if (r.name === e)
        return r.name;
    }
    return null;
  }
  /**
   * 清除插件文件的 require 缓存
   * 用于确保卸载插件时清理 CJS 模块缓存
   */
  clearCache(e) {
    try {
      const n = be.resolve(e);
      Object.keys(uF.cache).forEach((r) => {
        r.startsWith(n) && (delete uF.cache[r], this.logger.logDebug(`[PluginLoader] Cleared cache for: ${r}`));
      });
    } catch (n) {
      this.logger.logError("[PluginLoader] Error clearing module cache:", n);
    }
  }
}
function ume(t) {
  return {
    path: t.path,
    method: t.method,
    query: t.query,
    body: t.body,
    headers: t.headers,
    params: t.params,
    raw: t
  };
}
function lme(t) {
  const e = {
    status(n) {
      return t.status(n), e;
    },
    json(n) {
      t.json(n);
    },
    send(n) {
      t.send(n);
    },
    setHeader(n, r) {
      return t.setHeader(n, r), e;
    },
    sendFile(n) {
      t.sendFile(n);
    },
    redirect(n) {
      t.redirect(n);
    },
    raw: t
  };
  return e;
}
class pme {
  constructor(e, n) {
    this.pluginId = e, this.pluginPath = n;
  }
  apiRoutes = [];
  apiNoAuthRoutes = [];
  pageDefinitions = [];
  staticRoutes = [];
  memoryStaticRoutes = [];
  // ==================== API 路由注册 ====================
  api(e, n, r) {
    this.apiRoutes.push({ method: e, path: n, handler: r });
  }
  get(e, n) {
    this.api("get", e, n);
  }
  post(e, n) {
    this.api("post", e, n);
  }
  put(e, n) {
    this.api("put", e, n);
  }
  delete(e, n) {
    this.api("delete", e, n);
  }
  // ==================== 无认证 API 路由注册 ====================
  apiNoAuth(e, n, r) {
    this.apiNoAuthRoutes.push({ method: e, path: n, handler: r });
  }
  getNoAuth(e, n) {
    this.apiNoAuth("get", e, n);
  }
  postNoAuth(e, n) {
    this.apiNoAuth("post", e, n);
  }
  putNoAuth(e, n) {
    this.apiNoAuth("put", e, n);
  }
  deleteNoAuth(e, n) {
    this.apiNoAuth("delete", e, n);
  }
  // ==================== 页面注册 ====================
  page(e) {
    this.pageDefinitions.push(e);
  }
  pages(e) {
    this.pageDefinitions.push(...e);
  }
  // ==================== 静态资源 ====================
  static(e, n) {
    const r = be.isAbsolute(n) ? n : be.join(this.pluginPath, n);
    this.staticRoutes.push({ urlPath: e, localPath: r });
  }
  staticOnMem(e, n) {
    this.memoryStaticRoutes.push({ urlPath: e, files: n });
  }
  // ==================== 构建路由 ====================
  /**
   * 构建 Express Router（用于 API 路由）
   * 注意：静态资源路由不在此处挂载，由 webui-backend 直接在不需要鉴权的路径下处理
   */
  buildApiRouter() {
    const e = yr();
    for (const n of this.apiRoutes) {
      const r = this.wrapHandler(n.handler);
      switch (n.method) {
        case "get":
          e.get(n.path, r);
          break;
        case "post":
          e.post(n.path, r);
          break;
        case "put":
          e.put(n.path, r);
          break;
        case "delete":
          e.delete(n.path, r);
          break;
        case "patch":
          e.patch(n.path, r);
          break;
        case "all":
          e.all(n.path, r);
          break;
      }
    }
    return e;
  }
  /**
   * 包装处理器，添加错误处理和请求/响应包装
   */
  wrapHandler(e) {
    return async (n, r, i) => {
      try {
        const o = ume(n), s = lme(r);
        await e(o, s, i);
      } catch (o) {
        console.error(`[Plugin: ${this.pluginId}] Route error:`, o), r.headersSent || r.status(500).json({
          code: -1,
          message: `Plugin error: ${o.message || "Unknown error"}`
        });
      }
    };
  }
  // ==================== 查询方法 ====================
  /**
   * 检查是否有注册的 API 路由（需要认证）
   */
  hasApiRoutes() {
    return this.apiRoutes.length > 0;
  }
  /**
   * 检查是否有注册的无认证 API 路由
   */
  hasApiNoAuthRoutes() {
    return this.apiNoAuthRoutes.length > 0;
  }
  /**
   * 构建无认证 Express Router（用于 /plugin/{pluginId}/api/ 路径）
   */
  buildApiNoAuthRouter() {
    const e = yr();
    for (const n of this.apiNoAuthRoutes) {
      const r = this.wrapHandler(n.handler);
      switch (n.method) {
        case "get":
          e.get(n.path, r);
          break;
        case "post":
          e.post(n.path, r);
          break;
        case "put":
          e.put(n.path, r);
          break;
        case "delete":
          e.delete(n.path, r);
          break;
        case "patch":
          e.patch(n.path, r);
          break;
        case "all":
          e.all(n.path, r);
          break;
      }
    }
    return e;
  }
  /**
   * 检查是否有注册的静态资源路由
   */
  hasStaticRoutes() {
    return this.staticRoutes.length > 0 || this.memoryStaticRoutes.length > 0;
  }
  /**
   * 检查是否有注册的页面
   */
  hasPages() {
    return this.pageDefinitions.length > 0;
  }
  /**
   * 获取所有注册的页面定义
   */
  getPages() {
    return [...this.pageDefinitions];
  }
  /**
   * 获取插件 ID
   */
  getPluginId() {
    return this.pluginId;
  }
  /**
   * 获取插件路径
   */
  getPluginPath() {
    return this.pluginPath;
  }
  /**
   * 获取所有注册的静态路由
   */
  getStaticRoutes() {
    return [...this.staticRoutes];
  }
  /**
   * 获取所有注册的内存静态路由
   */
  getMemoryStaticRoutes() {
    return [...this.memoryStaticRoutes];
  }
  /**
   * 清空路由（用于插件卸载）
   */
  clear() {
    this.apiRoutes = [], this.apiNoAuthRoutes = [], this.pageDefinitions = [], this.staticRoutes = [], this.memoryStaticRoutes = [];
  }
}
class vU extends El {
  pluginPath;
  configPath;
  loader;
  /** 插件注册表: ID -> 插件条目 */
  plugins = /* @__PURE__ */ new Map();
  /** 插件路由注册表: ID -> 路由注册器 */
  pluginRouters = /* @__PURE__ */ new Map();
  NapCatConfig = cF;
  get isActive() {
    return this.isEnable && this.getLoadedPlugins().length > 0;
  }
  constructor(e, n, r, i) {
    const o = {
      name: e,
      messagePostFormat: "array",
      reportSelfMessage: !0,
      enable: !0,
      debug: !0
    };
    super(e, o, n, r, i), this.pluginPath = this.core.context.pathWrapper.pluginPath, this.configPath = be.join(this.core.context.pathWrapper.configPath, "plugins.json"), this.loader = new cme(this.pluginPath, this.configPath, this.logger);
  }
  // ==================== 插件状态配置 ====================
  getPluginConfig() {
    return this.loader.loadPluginStatusConfig();
  }
  savePluginConfig(e) {
    this.loader.savePluginStatusConfig(e);
  }
  // ==================== 插件扫描与加载 ====================
  /**
   * 扫描并加载所有插件
   */
  async scanAndLoadPlugins() {
    const e = await this.loader.scanPlugins();
    this.plugins.clear();
    for (const r of e)
      this.plugins.set(r.id, r);
    this.logger.log(`[PluginManager] Scanned ${this.plugins.size} plugins`);
    for (const r of this.plugins.values())
      r.enable && r.runtime.status !== "error" && await this.loadPlugin(r);
    const n = this.getLoadedPlugins().length;
    this.logger.log(`[PluginManager] Loaded ${n} plugins`);
  }
  /**
   * 加载单个插件
   */
  async loadPlugin(e) {
    if (e.loaded)
      return !0;
    if (e.runtime.status === "error")
      return !1;
    const n = await this.loader.loadPluginModule(e);
    if (!n)
      return !1;
    const r = this.createPluginContext(e);
    try {
      return await n.plugin_init(r), e.loaded = !0, e.runtime = {
        status: "loaded",
        module: n,
        context: r
      }, this.logger.log(`[PluginManager] Initialized plugin: ${e.id}${e.version ? ` v${e.version}` : ""}`), !0;
    } catch (i) {
      return e.loaded = !1, e.runtime = {
        status: "error",
        error: i.message || "Initialization failed"
      }, this.logger.logError(`[PluginManager] Error initializing plugin ${e.id}:`, i), !1;
    }
  }
  /**
   * 卸载单个插件
   */
  async unloadPlugin(e) {
    if (!e.loaded || e.runtime.status !== "loaded")
      return;
    const { module: n, context: r } = e.runtime;
    if (n && r && typeof n.plugin_cleanup == "function")
      try {
        await n.plugin_cleanup(r), this.logger.log(`[PluginManager] Cleaned up plugin: ${e.id}`);
      } catch (o) {
        this.logger.logError(`[PluginManager] Error cleaning up plugin ${e.id}:`, o);
      }
    const i = this.pluginRouters.get(e.id);
    i && (i.clear(), this.pluginRouters.delete(e.id)), this.loader.clearCache(e.pluginPath), e.loaded = !1, e.runtime = {
      status: "unloaded"
    }, this.logger.log(`[PluginManager] Unloaded plugin: ${e.id}`);
  }
  /**
   * 创建插件上下文
   */
  createPluginContext(e) {
    const n = be.join(this.core.context.pathWrapper.configPath, "plugins", e.id), r = be.join(n, "config.json");
    de.existsSync(n) || de.mkdirSync(n, { recursive: !0 });
    const i = `[Plugin: ${e.id}]`, o = this.logger, s = {
      log: (...u) => o.log(i, ...u),
      debug: (...u) => o.logDebug(i, ...u),
      info: (...u) => o.log(i, ...u),
      warn: (...u) => o.logWarn(i, ...u),
      error: (...u) => o.logError(i, ...u)
    }, a = new pme(e.id, e.pluginPath);
    this.pluginRouters.set(e.id, a);
    const c = (u) => {
      const l = this.plugins.get(u);
      if (!(!l || !l.loaded || l.runtime.status !== "loaded"))
        return l.runtime.module;
    };
    return {
      core: this.core,
      oneBot: this.obContext,
      actions: this.actions,
      pluginName: e.id,
      pluginPath: e.pluginPath,
      dataPath: n,
      configPath: r,
      NapCatConfig: cF,
      adapterName: this.name,
      pluginManager: this,
      logger: s,
      router: a,
      getPluginExports: c
    };
  }
  // ==================== 公共 API ====================
  /**
   * 获取插件目录路径
   */
  getPluginPath() {
    return this.pluginPath;
  }
  /**
   * 获取所有插件条目
   */
  getAllPlugins() {
    return Array.from(this.plugins.values());
  }
  /**
   * 获取已加载的插件列表
   */
  getLoadedPlugins() {
    return Array.from(this.plugins.values()).filter((e) => e.loaded);
  }
  /**
   * 通过 ID 获取插件信息
   */
  getPluginInfo(e) {
    return this.plugins.get(e);
  }
  /**
   * 获取插件路由注册器
   */
  getPluginRouter(e) {
    return this.pluginRouters.get(e);
  }
  /**
   * 获取所有插件路由注册器
   */
  getAllPluginRouters() {
    return this.pluginRouters;
  }
  /**
   * 设置插件状态（启用/禁用）
   */
  async setPluginStatus(e, n) {
    const r = this.getPluginConfig();
    r[e] = n, this.savePluginConfig(r);
    const i = this.plugins.get(e);
    i && (i.enable = n, n && !i.loaded ? await this.loadPlugin(i) : !n && i.loaded && await this.unloadPlugin(i));
  }
  /**
   * 通过 ID 加载插件
   */
  async loadPluginById(e) {
    let n = this.plugins.get(e);
    if (!n) {
      const r = this.loader.findPluginDirById(e);
      if (!r)
        return this.logger.logWarn(`[PluginManager] Plugin ${e} not found in filesystem`), !1;
      const i = this.loader.rescanPlugin(r);
      if (!i)
        return !1;
      this.plugins.set(i.id, i), n = i;
    }
    return n.enable ? await this.loadPlugin(n) : (this.logger.log(`[PluginManager] Skipping loading disabled plugin: ${e}`), !1);
  }
  /**
   * 卸载插件（仅从内存卸载）
   */
  async unregisterPlugin(e) {
    const n = this.plugins.get(e);
    n && await this.unloadPlugin(n);
  }
  /**
   * 卸载并删除插件
   */
  async uninstallPlugin(e, n = !1) {
    const r = this.plugins.get(e);
    if (!r)
      throw new Error(`Plugin ${e} not found`);
    const i = r.pluginPath, o = be.join(this.core.context.pathWrapper.configPath, "plugins", e);
    r.loaded && await this.unloadPlugin(r), this.plugins.delete(e), de.existsSync(i) && de.rmSync(i, { recursive: !0, force: !0 }), n && de.existsSync(o) && de.rmSync(o, { recursive: !0, force: !0 });
  }
  /**
   * 重载指定插件
   */
  async reloadPlugin(e) {
    const n = this.plugins.get(e);
    if (!n)
      return this.logger.logWarn(`[PluginManager] Plugin ${e} not found`), !1;
    try {
      await this.unloadPlugin(n);
      const r = this.loader.rescanPlugin(n.fileId);
      return r ? (this.plugins.set(r.id, r), r.enable && await this.loadPlugin(r), this.logger.log(`[PluginManager] Plugin ${e} reloaded successfully`), !0) : !1;
    } catch (r) {
      return this.logger.logError(`[PluginManager] Error reloading plugin ${e}:`, r), !1;
    }
  }
  /**
   * 加载目录插件（用于新安装的插件）
   */
  async loadDirectoryPlugin(e) {
    const n = this.loader.rescanPlugin(e);
    if (n) {
      if (this.plugins.has(n.id)) {
        this.logger.logWarn(`[PluginManager] Plugin ${n.id} already exists`);
        return;
      }
      this.plugins.set(n.id, n), n.enable && n.runtime.status !== "error" && await this.loadPlugin(n);
    }
  }
  /**
   * 获取插件数据目录路径
   */
  getPluginDataPath(e) {
    return be.join(this.core.context.pathWrapper.configPath, "plugins", e);
  }
  /**
   * 获取插件配置文件路径
   */
  getPluginConfigPath(e) {
    return be.join(this.getPluginDataPath(e), "config.json");
  }
  // ==================== 事件处理 ====================
  async onEvent(e) {
    if (this.isEnable)
      try {
        await Promise.allSettled(
          this.getLoadedPlugins().map(
            (n) => this.callPluginEventHandler(n, e)
          )
        );
      } catch (n) {
        this.logger.logError("[PluginManager] Error handling event:", n);
      }
  }
  /**
   * 调用插件的事件处理方法
   */
  async callPluginEventHandler(e, n) {
    if (e.runtime.status !== "loaded" || !e.runtime.module || !e.runtime.context)
      return;
    const { module: r, context: i } = e.runtime;
    try {
      typeof r.plugin_onevent == "function" && await r.plugin_onevent(i, n), n.message_type && typeof r.plugin_onmessage == "function" && await r.plugin_onmessage(i, n);
    } catch (o) {
      this.logger.logError(`[PluginManager] Error calling plugin ${e.id} event handler:`, o);
    }
  }
  // ==================== 生命周期 ====================
  async open() {
    this.isEnable || (this.logger.log("[PluginManager] Opening plugin manager..."), this.isEnable = !0, await this.scanAndLoadPlugins(), this.logger.log(`[PluginManager] Plugin manager opened with ${this.getLoadedPlugins().length} plugins loaded`));
  }
  async close() {
    if (this.isEnable) {
      this.logger.log("[PluginManager] Closing plugin manager..."), this.isEnable = !1;
      for (const e of this.plugins.values())
        e.loaded && await this.unloadPlugin(e);
      this.logger.log("[PluginManager] Plugin manager closed");
    }
  }
  async reload() {
    return this.logger.log("[PluginManager] Reloading plugin manager..."), await this.close(), await this.open(), this.logger.log("[PluginManager] Plugin manager reloaded"), rn.Normal;
  }
}
function dme(t, e, n) {
  if (n) {
    const i = be.join(e, n);
    if (de.existsSync(i))
      return `/api/Plugin/Icon/${encodeURIComponent(t)}`;
  }
  const r = be.join(at.configPath, "plugins", t, "icon.png");
  if (de.existsSync(r))
    return `/api/Plugin/Icon/${encodeURIComponent(t)}`;
}
function fme(t, e, n) {
  if (n) {
    const i = be.join(e, n);
    if (de.existsSync(i))
      return i;
  }
  const r = be.join(at.configPath, "plugins", t, "icon.png");
  if (de.existsSync(r))
    return r;
}
const Aa = () => {
  const t = ve.getOneBotContext();
  return t ? t.networkManager.findSomeAdapter("plugin_manager") : null;
}, hme = () => ve.getOneBotContext(), mme = async (t, e) => {
  const n = hme();
  if (!n)
    return ne(e, "OneBot context not found");
  if (n.networkManager.findSomeAdapter("plugin_manager"))
    return ne(e, "插件管理器已经注册");
  try {
    const i = at.pluginPath;
    de.existsSync(i) || de.mkdirSync(i, { recursive: !0 });
    const o = new vU(
      "plugin_manager",
      n.core,
      n,
      n.actions
    );
    return await n.networkManager.registerAdapterAndOpen(o), me(e, { message: "插件管理器注册成功" });
  } catch (i) {
    return ne(e, "注册插件管理器失败: " + i.message);
  }
}, gme = async (t, e) => {
  const n = Aa();
  if (!n)
    return me(e, { plugins: [], pluginManagerNotFound: !0, extensionPages: [] });
  const r = n.getAllPlugins(), i = [], o = [];
  for (const s of r) {
    let a;
    s.enable ? s.loaded ? a = "active" : a = "stopped" : a = "disabled";
    const c = n.getPluginRouter(s.id), u = c?.hasPages() ?? !1;
    if (i.push({
      name: s.packageJson?.plugin || s.name || "",
      // 优先显示 package.json 的 plugin 字段
      id: s.id,
      // 包名，用于 API 操作
      version: s.version || "0.0.0",
      description: s.packageJson?.description || "",
      author: s.packageJson?.author || "",
      status: a,
      hasConfig: !!(s.runtime.module?.plugin_config_schema || s.runtime.module?.plugin_config_ui),
      hasPages: u,
      homepage: s.packageJson?.homepage,
      repository: typeof s.packageJson?.repository == "string" ? s.packageJson.repository : s.packageJson?.repository?.url,
      icon: dme(s.id, s.pluginPath, s.packageJson?.icon)
    }), u && c) {
      const l = c.getPages();
      for (const d of l)
        o.push({
          pluginId: s.id,
          pluginName: s.packageJson?.plugin || s.name || s.id,
          path: d.path,
          title: d.title,
          icon: d.icon,
          description: d.description
        });
    }
  }
  return me(e, { plugins: i, pluginManagerNotFound: !1, extensionPages: o });
}, yme = async (t, e) => {
  const { enable: n, id: r } = t.body;
  if (!r) return ne(e, "Plugin id is required");
  const i = Aa();
  if (!i)
    return ne(e, "Plugin Manager not found");
  try {
    if (await i.setPluginStatus(r, n), n) {
      const o = i.getPluginInfo(r);
      if (!o || !o.loaded)
        return ne(e, "Plugin load failed: " + r);
    }
    return me(e, { message: "Status updated successfully" });
  } catch (o) {
    return ne(e, "Failed to update status: " + o.message);
  }
}, vme = async (t, e) => {
  const { id: n, cleanData: r } = t.body;
  if (!n) return ne(e, "Plugin id is required");
  const i = Aa();
  if (!i)
    return ne(e, "Plugin Manager not found");
  try {
    return await i.uninstallPlugin(n, r), me(e, { message: "Uninstalled successfully" });
  } catch (o) {
    return ne(e, "Failed to uninstall: " + o.message);
  }
}, bme = async (t, e) => {
  const n = t.query.id;
  if (!n) return ne(e, "Plugin id is required");
  const r = Aa();
  if (!r) return ne(e, "Plugin Manager not found");
  const i = r.getPluginInfo(n);
  if (!i) return ne(e, "Plugin not loaded");
  let o = {};
  if (i.runtime.module?.plugin_get_config && i.runtime.context)
    try {
      o = await i.runtime.module?.plugin_get_config(i.runtime.context);
    } catch {
    }
  else
    try {
      const c = i.runtime.context?.configPath || r.getPluginConfigPath(n);
      de.existsSync(c) && (o = JSON.parse(de.readFileSync(c, "utf-8")));
    } catch {
    }
  const s = i.runtime.module?.plugin_config_schema || i.runtime.module?.plugin_config_ui || [], a = !!(i.runtime.module?.plugin_config_controller || i.runtime.module?.plugin_on_config_change);
  return me(e, { schema: s, config: o, supportReactive: a });
}, Ap = /* @__PURE__ */ new Map(), xme = (t, e) => {
  const n = t.query.id, r = t.query.config;
  if (!n) {
    e.status(400).json({ error: "Plugin id is required" });
    return;
  }
  const i = Aa();
  if (!i) {
    e.status(400).json({ error: "Plugin Manager not found" });
    return;
  }
  const o = i.getPluginInfo(n);
  if (!o) {
    e.status(400).json({ error: "Plugin not loaded" });
    return;
  }
  e.setHeader("Content-Type", "text/event-stream"), e.setHeader("Cache-Control", "no-cache"), e.setHeader("Connection", "keep-alive"), e.setHeader("X-Accel-Buffering", "no"), e.flushHeaders();
  const s = `${n}_${Date.now()}_${Math.random().toString(36).slice(2)}`;
  let a = {};
  if (r)
    try {
      a = JSON.parse(r);
    } catch {
    }
  const c = (d, f) => {
    e.write(`event: ${d}
`), e.write(`data: ${JSON.stringify(f)}

`);
  }, u = {
    updateSchema: (d) => {
      c("schema", { type: "full", schema: d });
    },
    updateField: (d, f) => {
      c("schema", { type: "updateField", key: d, field: f });
    },
    removeField: (d) => {
      c("schema", { type: "removeField", key: d });
    },
    addField: (d, f) => {
      c("schema", { type: "addField", field: d, afterKey: f });
    },
    showField: (d) => {
      c("schema", { type: "showField", key: d });
    },
    hideField: (d) => {
      c("schema", { type: "hideField", key: d });
    },
    getCurrentConfig: () => a
  };
  Ap.set(s, { res: e, currentConfig: a }), c("connected", { sessionId: s }), (async () => {
    let d;
    if (o.runtime.module?.plugin_config_controller && o.runtime.context)
      try {
        const m = await o.runtime.module.plugin_config_controller(
          o.runtime.context,
          u,
          a
        );
        typeof m == "function" && (d = m);
      } catch (m) {
        c("error", { message: m.message });
      }
    const f = Ap.get(s);
    f && (f.cleanup = d);
  })();
  const l = setInterval(() => {
    c("ping", { time: Date.now() });
  }, 3e4);
  t.on("close", () => {
    clearInterval(l);
    const d = Ap.get(s);
    if (d?.cleanup)
      try {
        d.cleanup();
      } catch {
      }
    Ap.delete(s);
  });
}, wme = async (t, e) => {
  const { id: n, sessionId: r, key: i, value: o, currentConfig: s } = t.body;
  if (!n || !r || !i)
    return ne(e, "Missing required parameters");
  const a = Aa();
  if (!a) return ne(e, "Plugin Manager not found");
  const c = a.getPluginInfo(n);
  if (!c) return ne(e, "Plugin not loaded");
  const u = Ap.get(r);
  if (!u)
    return ne(e, "Session not found");
  if (u.currentConfig = s || {}, c.runtime.module?.plugin_on_config_change) {
    const l = {
      updateSchema: (d) => {
        u.res.write(`event: schema
`), u.res.write(`data: ${JSON.stringify({ type: "full", schema: d })}

`);
      },
      updateField: (d, f) => {
        u.res.write(`event: schema
`), u.res.write(`data: ${JSON.stringify({ type: "updateField", key: d, field: f })}

`);
      },
      removeField: (d) => {
        u.res.write(`event: schema
`), u.res.write(`data: ${JSON.stringify({ type: "removeField", key: d })}

`);
      },
      addField: (d, f) => {
        u.res.write(`event: schema
`), u.res.write(`data: ${JSON.stringify({ type: "addField", field: d, afterKey: f })}

`);
      },
      showField: (d) => {
        u.res.write(`event: schema
`), u.res.write(`data: ${JSON.stringify({ type: "showField", key: d })}

`);
      },
      hideField: (d) => {
        u.res.write(`event: schema
`), u.res.write(`data: ${JSON.stringify({ type: "hideField", key: d })}

`);
      },
      getCurrentConfig: () => u.currentConfig
    };
    try {
      c.runtime.context && await c.runtime.module.plugin_on_config_change(
        c.runtime.context,
        l,
        i,
        o,
        s || {}
      );
    } catch (d) {
      u.res.write(`event: error
`), u.res.write(`data: ${JSON.stringify({ message: d.message })}

`);
    }
  }
  return me(e, { message: "Change processed" });
}, Sme = async (t, e) => {
  const { id: n, config: r } = t.body;
  if (!n || !r) return ne(e, "Plugin id and config required");
  const i = Aa();
  if (!i) return ne(e, "Plugin Manager not found");
  const o = i.getPluginInfo(n);
  if (!o) return ne(e, "Plugin not loaded");
  if (o.runtime.module?.plugin_set_config && o.runtime.context)
    try {
      return await o.runtime.module.plugin_set_config(o.runtime.context, r), me(e, { message: "Config updated" });
    } catch (s) {
      return ne(e, "Error updating config: " + s.message);
    }
  else if (o.runtime.module?.plugin_config_schema || o.runtime.module?.plugin_config_ui || o.runtime.module?.plugin_config_controller)
    try {
      const s = o.runtime.context?.configPath || i.getPluginConfigPath(n), a = be.dirname(s);
      return de.existsSync(a) || de.mkdirSync(a, { recursive: !0 }), de.writeFileSync(s, JSON.stringify(r, null, 2), "utf-8"), await i.reloadPlugin(n), me(e, { message: "Config saved and plugin reloaded" });
    } catch (s) {
      return ne(e, "Error saving config: " + s.message);
    }
  else
    return ne(e, "Plugin does not support config update");
}, _me = async (t, e) => {
  const n = t.params.pluginId;
  if (!n) return ne(e, "Plugin ID is required");
  const r = Aa();
  if (!r) return ne(e, "Plugin Manager not found");
  const i = r.getPluginInfo(n);
  if (!i) return ne(e, "Plugin not found");
  const o = fme(n, i.pluginPath, i.packageJson?.icon);
  return o ? e.sendFile(o) : e.status(404).json({ code: -1, message: "Icon not found" });
}, Ag = () => {
  const t = ve.getOneBotContext();
  return t ? t.networkManager.findSomeAdapter("plugin_manager") : null;
}, Eme = [
  "https://raw.githubusercontent.com/NapNeko/napcat-plugin-index/main/plugins.v4.json"
], Sy = () => at.pluginPath;
function _y(t) {
  if (typeof t != "string")
    throw new Error("Invalid plugin ID");
  const e = Ze.basename(t);
  if (!/^[a-zA-Z0-9._-]+$/.test(e) || e !== t)
    throw new Error("Invalid plugin ID format");
  return e;
}
let Bh = null, lF = 0;
const Ame = 600 * 1e3;
async function Ey(t = !1) {
  const e = Date.now();
  if (!t && Bh && e - lF < Ame)
    return Bh;
  const n = [];
  for (const r of Eme)
    for (const i of Ug)
      try {
        const o = i ? `${i}/${r.replace("https://raw.githubusercontent.com/", "")}` : r, s = await fetch(o, {
          headers: {
            "User-Agent": "NapCat-WebUI"
          },
          signal: AbortSignal.timeout(1e4)
          // 10秒超时
        });
        if (!s.ok)
          throw new Error(`HTTP ${s.status}: ${s.statusText}`);
        return Bh = await s.json(), lF = e, Bh;
      } catch (o) {
        const s = `Failed to fetch from ${r} via mirror: ${o.message}`;
        console.warn(s), n.push(s);
      }
  throw new Error(`All plugin sources failed:
${n.join(`
`)}`);
}
async function bU(t, e, n, r, i = 12e4) {
  try {
    let o;
    /^https:\/\/github\.com\/[^/]+\/[^/]+\/releases\/download\//.test(t) ? (console.log(`Detected GitHub Release URL: ${t}`), console.log(`Custom mirror: ${n || "auto"}`), o = await Qw(t, {
      validateContent: !1,
      // 不验证内容，只检查状态码和 Content-Type
      timeout: 5e3,
      // 每个镜像测试5秒超时
      useFastMirrors: !1,
      // 不使用快速镜像列表（避免测速阻塞）
      customMirror: n || void 0
      // 使用用户选择的镜像
    }), console.log(`Selected download URL: ${o}`)) : (console.log(`Direct download URL: ${t}`), o = t), console.log(`Starting download from: ${o}`);
    const a = Ze.dirname(e);
    Ae.existsSync(a) || (Ae.mkdirSync(a, { recursive: !0 }), console.log(`Created directory: ${a}`));
    const c = await fetch(o, {
      headers: {
        "User-Agent": "NapCat-WebUI"
      },
      signal: AbortSignal.timeout(i)
      // 使用传入的超时时间
    });
    if (!c.ok)
      throw new Error(`HTTP ${c.status}: ${c.statusText}`);
    if (!c.body)
      throw new Error("Response body is null");
    const u = Number(c.headers.get("content-length")) || 0;
    r && r(0, 0, u, 0);
    let l = 0, d = Date.now(), f = 0;
    const m = async function* (y) {
      for await (const x of y) {
        l += x.length;
        const g = Date.now(), v = g - d;
        if (v >= 500 || u && l === u) {
          const S = u ? Math.round(l / u * 100) : 0, E = (l - f) / (v / 1e3);
          r && r(S, l, u, E), d = g, f = l;
        }
        yield x;
      }
    }, h = sO(e);
    await V_(m(c.body), h), console.log(`Successfully downloaded to: ${e}`);
  } catch (o) {
    throw Ae.existsSync(e) && Ae.unlinkSync(e), new Error(`Download failed: ${o.message}`);
  }
}
async function xU(t, e) {
  const n = _y(e), r = Sy(), i = Ze.join(r, n), o = Ze.join(i, "data"), s = Ze.join(r, `${n}.data.backup`);
  console.log(`[extractPlugin] PLUGINS_DIR: ${r}`), console.log(`[extractPlugin] pluginId: ${n}`), console.log(`[extractPlugin] Target directory: ${i}`), console.log(`[extractPlugin] Zip file: ${t}`), Ae.existsSync(r) || (Ae.mkdirSync(r, { recursive: !0 }), console.log(`[extractPlugin] Created plugins root directory: ${r}`));
  let a = !1;
  Ae.existsSync(i) && (Ae.existsSync(o) && (console.log(`[extractPlugin] Backing up data directory: ${o}`), Ae.existsSync(s) && Ae.rmSync(s, { recursive: !0, force: !0 }), Ae.renameSync(o, s), a = !0), console.log(`[extractPlugin] Directory exists, removing: ${i}`), Ae.rmSync(i, { recursive: !0, force: !0 })), Ae.mkdirSync(i, { recursive: !0 }), console.log(`[extractPlugin] Created directory: ${i}`);
  try {
    await zu.zip.uncompress(t, i), console.log(`[extractPlugin] Plugin extracted to: ${i}`), a && Ae.existsSync(s) && (Ae.existsSync(o) && Ae.rmSync(o, { recursive: !0, force: !0 }), console.log(`[extractPlugin] Restoring data directory: ${o}`), Ae.renameSync(s, o));
  } catch (u) {
    throw a && Ae.existsSync(s) && (console.log("[extractPlugin] Extract failed, restoring data directory"), Ae.existsSync(i) || Ae.mkdirSync(i, { recursive: !0 }), Ae.existsSync(o) && Ae.rmSync(o, { recursive: !0, force: !0 }), Ae.renameSync(s, o)), u;
  }
  const c = Ae.readdirSync(i);
  console.log("[extractPlugin] Extracted files:", c);
}
async function wU(t, e) {
  const n = Sy(), r = Ze.join(n, t), i = Ze.join(at.configPath, "plugins", t), o = Ze.join(r, "package.json");
  if (Ae.existsSync(o))
    try {
      const a = JSON.parse(Ae.readFileSync(o, "utf-8"));
      if (a.icon) {
        const c = Ze.join(r, a.icon);
        if (Ae.existsSync(c))
          return;
      }
    } catch {
    }
  if (Ae.existsSync(Ze.join(i, "icon.png")))
    return;
  let s;
  if (e.downloadUrl)
    try {
      const a = new URL(e.downloadUrl);
      if (a.hostname === "github.com" || a.hostname === "www.github.com") {
        const c = a.pathname.split("/").filter(Boolean);
        c.length >= 1 && (s = `https://github.com/${c[0]}.png?size=128`);
      }
    } catch {
    }
  if (!s && e.homepage)
    try {
      const a = new URL(e.homepage);
      if (a.hostname === "github.com" || a.hostname === "www.github.com") {
        const c = a.pathname.split("/").filter(Boolean);
        c.length >= 1 && (s = `https://github.com/${c[0]}.png?size=128`);
      }
    } catch {
    }
  if (s)
    try {
      Ae.existsSync(i) || Ae.mkdirSync(i, { recursive: !0 });
      const a = await fetch(s, {
        headers: { "User-Agent": "NapCat-WebUI" },
        signal: AbortSignal.timeout(15e3),
        redirect: "follow"
      });
      if (!a.ok || !a.body) return;
      const c = Ze.join(i, "icon.png"), u = sO(c);
      await V_(a.body, u), console.log(`[cachePluginIcon] Cached icon for ${t} at ${c}`);
    } catch (a) {
      console.warn(`[cachePluginIcon] Failed to cache icon for ${t}:`, a.message);
    }
}
const Ime = async (t, e) => {
  try {
    const n = t.query.forceRefresh === "true", r = await Ey(n);
    return me(e, r);
  } catch (n) {
    return ne(e, "Failed to fetch plugin store list: " + n.message);
  }
}, Cme = async (t, e) => {
  try {
    const n = _y(t.params.id), i = (await Ey()).plugins.find((o) => o.id === n);
    return i ? me(e, i) : ne(e, "Plugin not found");
  } catch (n) {
    return ne(e, "Failed to fetch plugin detail: " + n.message);
  }
}, Tme = async (t, e) => {
  try {
    const { id: n, mirror: r } = t.body;
    if (!n)
      return ne(e, "Plugin ID is required");
    const i = _y(n), s = (await Ey()).plugins.find((l) => l.id === i);
    if (!s)
      return ne(e, "Plugin not found in store");
    const a = Ag();
    if (a) {
      const l = a.getPluginInfo(i);
      if (l && l.version === s.version)
        return ne(e, "该插件已安装且版本相同，无需重复安装");
    }
    const c = Sy(), u = Ze.join(c, `${i}.temp.zip`);
    try {
      await bU(s.downloadUrl, u, r, void 0, 3e5), await xU(u, i), Ae.unlinkSync(u);
      const l = Ag();
      l && (l.getPluginInfo(i) ? await l.reloadPlugin(i) : await l.loadPluginById(i));
      try {
        await wU(i, s);
      } catch (d) {
        console.warn(`[InstallPlugin] Failed to cache icon for ${i}, skipping:`, d.message);
      }
      return me(e, {
        message: "Plugin installed successfully",
        plugin: s,
        installPath: Ze.join(c, i)
      });
    } catch (l) {
      throw Ae.existsSync(u) && Ae.unlinkSync(u), l;
    }
  } catch (n) {
    return ne(e, "Failed to install plugin: " + n.message);
  }
}, kme = async (t, e) => {
  const { id: n, mirror: r } = t.query;
  if (!n || typeof n != "string") {
    e.status(400).json({ error: "Plugin ID is required" });
    return;
  }
  let i;
  try {
    i = _y(n);
  } catch (s) {
    e.status(400).json({ error: s.message });
    return;
  }
  e.setHeader("Content-Type", "text/event-stream"), e.setHeader("Cache-Control", "no-cache"), e.setHeader("Connection", "keep-alive"), e.flushHeaders();
  const o = (s, a, c) => {
    e.write(`data: ${JSON.stringify({ message: s, progress: a, ...c })}

`);
  };
  try {
    o("正在获取插件信息...", 10);
    const a = (await Ey()).plugins.find((d) => d.id === i);
    if (!a) {
      o("错误: 插件不存在", 0), e.write(`data: ${JSON.stringify({ error: "Plugin not found in store" })}

`), e.end();
      return;
    }
    const c = Ag();
    if (c) {
      const d = c.getPluginInfo(i);
      if (d && d.version === a.version) {
        o("错误: 该插件已安装且版本相同", 0), e.write(`data: ${JSON.stringify({ error: "该插件已安装且版本相同，无需重复安装" })}

`), e.end();
        return;
      }
    }
    o(`找到插件: ${a.name} v${a.version}`, 20), o(`下载地址: ${a.downloadUrl}`, 25), r && typeof r == "string" && o(`使用镜像: ${r}`, 28);
    const u = Sy(), l = Ze.join(u, `${i}.temp.zip`);
    try {
      o("正在下载插件...", 30), await bU(a.downloadUrl, l, r, (f, m, h, y) => {
        const x = 30 + Math.round(f * 0.5), g = (m / 1024 / 1024).toFixed(1), v = h ? (h / 1024 / 1024).toFixed(1) : "?", S = (y / 1024 / 1024).toFixed(2), E = h > 0 && y > 0 ? Math.round((h - m) / y) : -1;
        o(`正在下载插件... ${f}%`, x, {
          downloaded: m,
          total: h,
          speed: y,
          eta: E,
          downloadedStr: `${g}MB`,
          totalStr: `${v}MB`,
          speedStr: `${S}MB/s`
        });
      }, 3e5), o("下载完成，正在解压...", 85), await xU(l, i), o("解压完成，正在清理...", 95), Ae.unlinkSync(l);
      const d = Ag();
      d && (d.getPluginInfo(i) ? (o("正在刷新插件信息...", 95), await d.reloadPlugin(i)) : (o("正在注册插件...", 95), await d.loadPluginById(i))), o("安装成功！", 100), wU(i, a).catch((f) => {
        console.warn(`[cachePluginIcon] Failed to cache icon for ${i}:`, f.message);
      }), e.write(`data: ${JSON.stringify({
        success: !0,
        message: "Plugin installed successfully",
        plugin: a,
        installPath: Ze.join(u, i)
      })}

`), e.end();
    } catch (d) {
      Ae.existsSync(l) && Ae.unlinkSync(l), o(`错误: ${d.message}`, 0), e.write(`data: ${JSON.stringify({ error: d.message })}

`), e.end();
    }
  } catch (s) {
    o(`错误: ${s.message}`, 0), e.write(`data: ${JSON.stringify({ error: s.message })}

`), e.end();
  }
}, pF = be.join(Pn.tmpdir(), "napcat-plugin-uploads");
de.existsSync(pF) || de.mkdirSync(pF, { recursive: !0 });
const Sr = yr();
Sr.get("/List", gme);
Sr.post("/SetStatus", yme);
Sr.post("/Uninstall", vme);
Sr.get("/Config", bme);
Sr.post("/Config", Sme);
Sr.get("/Config/SSE", xme);
Sr.post("/Config/Change", wme);
Sr.post("/RegisterManager", mme);
Sr.get("/Icon/:pluginId", _me);
Sr.get("/Store/List", Ime);
Sr.get("/Store/Detail/:id", Cme);
Sr.post("/Store/Install", Tme);
Sr.get("/Store/Install/SSE", kme);
Sr.use("/ext/:pluginId", (t, e, n) => {
  const { pluginId: r } = t.params;
  if (!r) {
    e.status(400).json({ code: -1, message: "Plugin ID is required" });
    return;
  }
  const i = ve.getOneBotContext();
  if (!i) {
    e.status(503).json({ code: -1, message: "OneBot context not available" });
    return;
  }
  const o = i.networkManager.findSomeAdapter("plugin_manager");
  if (!o) {
    e.status(503).json({ code: -1, message: "Plugin manager not available" });
    return;
  }
  const s = o.getPluginRouter(r);
  if (!s || !s.hasApiRoutes()) {
    e.status(404).json({ code: -1, message: `Plugin '${r}' has no registered API routes` });
    return;
  }
  s.buildApiRouter()(t, e, n);
});
Sr.get("/page/:pluginId/:pagePath", (t, e) => {
  const { pluginId: n, pagePath: r } = t.params;
  if (!n) {
    e.status(400).json({ code: -1, message: "Plugin ID is required" });
    return;
  }
  const i = ve.getOneBotContext();
  if (!i) {
    e.status(503).json({ code: -1, message: "OneBot context not available" });
    return;
  }
  const o = i.networkManager.findSomeAdapter("plugin_manager");
  if (!o) {
    e.status(503).json({ code: -1, message: "Plugin manager not available" });
    return;
  }
  const s = o.getPluginRouter(n);
  if (!s || !s.hasPages()) {
    e.status(404).json({ code: -1, message: `Plugin '${n}' has no registered pages` });
    return;
  }
  const c = s.getPages().find((d) => d.path === "/" + r || d.path === r);
  if (!c) {
    e.status(404).json({ code: -1, message: `Page '${r}' not found in plugin '${n}'` });
    return;
  }
  const u = s.getPluginPath();
  if (!u) {
    e.status(500).json({ code: -1, message: "Plugin path not available" });
    return;
  }
  const l = be.join(u, c.htmlFile);
  if (!de.existsSync(l)) {
    e.status(404).json({ code: -1, message: `HTML file not found: ${c.htmlFile}` });
    return;
  }
  e.sendFile(l);
});
async function SU(t, e, n = 5e3) {
  const r = t ? du(e, t) : e, i = Date.now();
  return new Promise((o) => {
    try {
      const s = new URL(r), a = s.protocol === "https:", u = (a ? Gu : fc).request({
        hostname: s.hostname,
        port: s.port || (a ? 443 : 80),
        path: s.pathname + s.search,
        method: "HEAD",
        timeout: n,
        headers: {
          "User-Agent": "NapCat-Mirror-Test"
        }
      }, (l) => {
        const d = l.statusCode || 0, f = d >= 200 && d < 400;
        o({
          mirror: t || "https://github.com",
          latency: Date.now() - i,
          success: f
        });
      });
      u.on("error", (l) => {
        o({
          mirror: t || "https://github.com",
          latency: Date.now() - i,
          success: !1,
          error: l.message
        });
      }), u.on("timeout", () => {
        u.destroy(), o({
          mirror: t || "https://github.com",
          latency: n,
          success: !1,
          error: "Timeout"
        });
      }), u.end();
    } catch (s) {
      o({
        mirror: t || "https://github.com",
        latency: Date.now() - i,
        success: !1,
        error: s.message
      });
    }
  });
}
const Nme = async (t, e) => {
  try {
    const n = _6();
    return me(e, {
      fileMirrors: dE.filter((r) => r),
      rawMirrors: Ug,
      customMirror: n.customMirror,
      timeout: n.timeout
    });
  } catch (n) {
    return ne(e, n.message);
  }
}, Pme = async (t, e) => {
  try {
    const { mirror: n } = t.body;
    return F7(n || ""), D7(), me(e, { message: "Mirror set successfully" });
  } catch (n) {
    return ne(e, n.message);
  }
}, Dme = async (t, e) => {
  const { type: n = "file" } = t.query;
  e.setHeader("Content-Type", "text/event-stream"), e.setHeader("Cache-Control", "no-cache"), e.setHeader("Connection", "keep-alive"), e.flushHeaders();
  const r = (i) => {
    e.write(`data: ${JSON.stringify(i)}

`);
  };
  try {
    let i, o;
    n === "raw" ? (i = Ug, o = "https://raw.githubusercontent.com/NapNeko/NapCatQQ/main/README.md") : (i = dE.filter((l) => l), o = "https://github.com/NapNeko/NapCatQQ/releases/latest"), i.includes("") || (i = ["", ...i]), r({
      type: "start",
      total: i.length,
      message: `开始测试 ${i.length} 个镜像源...`
    });
    const s = [], a = 5e3;
    for (let l = 0; l < i.length; l++) {
      const d = i[l] ?? "", f = d || "https://github.com (原始)";
      r({
        type: "testing",
        index: l,
        total: i.length,
        mirror: f,
        message: `正在测试: ${f}`
      });
      const m = await SU(d, o, a);
      s.push(m), r({
        type: "result",
        index: l,
        total: i.length,
        result: {
          ...m,
          mirror: m.mirror || "https://github.com (原始)"
        }
      });
    }
    const c = s.filter((l) => l.success).sort((l, d) => l.latency - d.latency), u = s.filter((l) => !l.success);
    r({
      type: "complete",
      results: c,
      failed: u,
      fastest: c[0] || null,
      message: `测试完成！${c.length} 个可用，${u.length} 个失败`
    }), e.end();
  } catch (i) {
    r({
      type: "error",
      error: i.message
    }), e.end();
  }
}, Fme = async (t, e) => {
  try {
    const { mirror: n, type: r = "file" } = t.body;
    let i;
    r === "raw" ? i = "https://raw.githubusercontent.com/NapNeko/NapCatQQ/main/README.md" : i = "https://github.com/NapNeko/NapCatQQ/releases/latest";
    const o = await SU(n || "", i, 5e3);
    return me(e, o);
  } catch (n) {
    return ne(e, n.message);
  }
}, wf = yr();
wf.get("/List", Nme);
wf.post("/SetCustom", Pme);
wf.get("/Test/SSE", Dme);
wf.post("/Test", Fme);
function Ig() {
  return Za(AA, {});
}
function Ome() {
  return kn(at.configPath, "./napcat.json");
}
function _U() {
  const t = Ome();
  try {
    if (sr(t)) {
      const e = Fo(t, "utf-8");
      return { ...Ig(), ...Ci.parse(e) };
    }
  } catch {
  }
  return { ...Ig() };
}
function Mme(t) {
  const e = kn(at.configPath, "./napcat.json");
  hO(at.configPath, { recursive: !0 }), z_(e, JSON.stringify(t, null, 2), "utf-8");
}
const Rme = (t, e) => {
  try {
    const n = _U();
    return me(e, n);
  } catch (n) {
    return ne(e, "Config Get Error: " + n.message);
  }
}, Bme = (t, e) => {
  try {
    const n = t.body;
    if (!n || typeof n != "object")
      return ne(e, "config is empty or invalid");
    const i = { ..._U(), ...n };
    if (i.bypass && typeof i.bypass == "object") {
      const o = i.bypass, s = ["hook", "window", "module", "process", "container", "js"];
      for (const a of s)
        if (a in o && typeof o[a] != "boolean")
          return ne(e, `bypass.${a} must be boolean`);
    }
    return Mme(i), me(e, null);
  } catch (n) {
    return ne(e, "Config Set Error: " + n.message);
  }
};
function EU(t) {
  const e = kn(at.configPath, `./napcat_${t}.json`), n = kn(at.configPath, "./napcat.json"), r = sr(e) ? e : n;
  try {
    if (sr(r)) {
      const i = Fo(r, "utf-8");
      return { ...Ig(), ...Ci.parse(i) };
    }
  } catch {
  }
  return { ...Ig() };
}
function Ume(t, e) {
  const n = kn(at.configPath, `./napcat_${t}.json`);
  hO(at.configPath, { recursive: !0 }), z_(n, JSON.stringify(e, null, 2), "utf-8");
}
const Lme = (t, e) => {
  try {
    if (!ve.getQQLoginStatus()) return ne(e, "Not Login");
    const r = ve.getQQLoginUin();
    return me(e, EU(r));
  } catch (n) {
    return ne(e, "Config Get Error: " + n.message);
  }
}, jme = (t, e) => {
  try {
    if (!ve.getQQLoginStatus()) return ne(e, "Not Login");
    const r = ve.getQQLoginUin(), i = t.body;
    if (!i || typeof i != "object")
      return ne(e, "config is empty or invalid");
    const s = { ...EU(r), ...i };
    return Ume(r, s), me(e, null);
  } catch (n) {
    return ne(e, "Config Set Error: " + n.message);
  }
}, Sf = yr();
Sf.get("/GetConfig", Rme);
Sf.post("/SetConfig", Bme);
Sf.get("/GetUinConfig", Lme);
Sf.post("/SetUinConfig", jme);
const _r = yr();
_r.use(Tce);
_r.all("/test", (t, e) => me(e));
_r.use("/base", bo);
_r.use("/auth", gi);
_r.use("/QQLogin", kt);
_r.use("/OB11Config", Jd);
_r.use("/Log", Dc);
_r.use("/File", Jn);
_r.use("/WebUIConfig", Ns);
_r.use("/UpdateNapCat", fU);
_r.use("/Debug", Al);
_r.use("/Process", yU);
_r.use("/Plugin", Sr);
_r.use("/Mirror", wf);
_r.use("/NapCatConfig", Sf);
function dF(t) {
  if (t.startsWith("::ffff:")) {
    const e = t.substring(7);
    if (/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(e))
      return e;
  }
  return t;
}
function fF(t) {
  return t.includes(":");
}
function Qme(t, e) {
  const n = dF(t), r = dF(e);
  return n === r ? !0 : fF(n) || fF(r) ? r.includes("/") ? Gme(n, r) : !1 : r.includes("*") ? new RegExp("^" + r.replace(/\./g, "\\.").replace(/\*/g, "\\d+") + "$").test(n) : r.includes("/") ? $me(n, r) : !1;
}
function $me(t, e) {
  const n = e.split("/");
  if (n.length !== 2) return !1;
  const r = n[0], i = n[1];
  if (!r || !i) return !1;
  const o = parseInt(i);
  if (isNaN(o) || o < 0 || o > 32) return !1;
  const s = o === 0 ? 0 : ~(2 ** (32 - o) - 1), a = hF(t), c = hF(r);
  return a === null || c === null ? !1 : (a & s) === (c & s);
}
function hF(t) {
  const e = t.split(".");
  if (e.length !== 4) return null;
  const n = e.map((r) => parseInt(r));
  return n.some((r) => isNaN(r) || r < 0 || r > 255) ? null : ((n[0] || 0) << 24) + ((n[1] || 0) << 16) + ((n[2] || 0) << 8) + (n[3] || 0);
}
function Gme(t, e) {
  const n = e.split("/");
  if (n.length !== 2) return !1;
  const r = n[0], i = n[1];
  if (!r || !i) return !1;
  const o = parseInt(i);
  if (isNaN(o) || o < 0 || o > 128) return !1;
  try {
    const s = mF(t), a = mF(r);
    if (!s || !a) return !1;
    let c = o;
    for (let u = 0; u < 8 && !(c <= 0); u++) {
      const l = s[u] ?? 0, d = a[u] ?? 0;
      if (c >= 16) {
        if (l !== d) return !1;
        c -= 16;
      } else {
        const f = 65535 << 16 - c & 65535;
        if ((l & f) !== (d & f)) return !1;
        break;
      }
    }
    return !0;
  } catch {
    return !1;
  }
}
function mF(t) {
  try {
    let e = t;
    const n = e.match(/::ffff:(\d+\.\d+\.\d+\.\d+)$/i);
    if (n && n[1]) {
      const o = n[1].split(".").map((s) => parseInt(s));
      if (o.length === 4 && o.every((s) => s >= 0 && s <= 255)) {
        const s = (o[0] ?? 0) << 8 | (o[1] ?? 0), a = (o[2] ?? 0) << 8 | (o[3] ?? 0);
        e = `::ffff:${s.toString(16)}:${a.toString(16)}`;
      }
    }
    if (e.includes("::")) {
      const i = e.split("::");
      if (i.length > 2) return null;
      const o = i[0] ? i[0].split(":") : [], s = i[1] ? i[1].split(":") : [], a = 8 - o.length - s.length;
      return a < 0 ? null : [
        ...o,
        ...Array(a).fill("0"),
        ...s
      ].map((u) => parseInt(u || "0", 16));
    }
    const r = e.split(":");
    return r.length !== 8 ? null : r.map((i) => parseInt(i || "0", 16));
  } catch {
    return null;
  }
}
function gF(t, e) {
  return e.some((n) => Qme(t, n));
}
const qme = async (t, e, n) => {
  const r = await Et.GetWebUIConfig();
  let i;
  if (r.enableXForwardedFor) {
    const s = t.headers["x-forwarded-for"];
    typeof s == "string" ? i = s.split(",")[0]?.trim() || "" : Array.isArray(s) && s.length > 0 ? i = s[0] || "" : i = t.ip || t.socket.remoteAddress || "";
  } else
    i = t.ip || t.socket.remoteAddress || "";
  if (r.accessControlMode === "whitelist") {
    if (!gF(i, r.ipWhitelist || [])) {
      e.status(403).json({ error: "访问被拒绝：IP不在白名单中" });
      return;
    }
  } else if (r.accessControlMode === "blacklist" && gF(i, r.ipBlacklist || [])) {
    e.status(403).json({ error: "访问被拒绝：IP在黑名单中" });
    return;
  }
  const o = t.headers.origin || "*";
  if (e.header("Access-Control-Allow-Origin", o), e.header("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS"), e.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization"), e.header("Access-Control-Allow-Credentials", "true"), t.method === "OPTIONS") {
    e.sendStatus(204);
    return;
  }
  n();
};
var Uh = { exports: {} }, Lh = { exports: {} }, jh = { exports: {} }, yF;
function Hme() {
  if (yF) return jh.exports;
  yF = 1, jh.exports = o, jh.exports.preferredCharsets = o;
  var t = /^\s*([^\s;]+)\s*(?:;(.*))?$/;
  function e(u) {
    for (var l = u.split(","), d = 0, f = 0; d < l.length; d++) {
      var m = n(l[d].trim(), d);
      m && (l[f++] = m);
    }
    return l.length = f, l;
  }
  function n(u, l) {
    var d = t.exec(u);
    if (!d) return null;
    var f = d[1], m = 1;
    if (d[2])
      for (var h = d[2].split(";"), y = 0; y < h.length; y++) {
        var x = h[y].trim().split("=");
        if (x[0] === "q") {
          m = parseFloat(x[1]);
          break;
        }
      }
    return {
      charset: f,
      q: m,
      i: l
    };
  }
  function r(u, l, d) {
    for (var f = { o: -1, q: 0, s: 0 }, m = 0; m < l.length; m++) {
      var h = i(u, l[m], d);
      h && (f.s - h.s || f.q - h.q || f.o - h.o) < 0 && (f = h);
    }
    return f;
  }
  function i(u, l, d) {
    var f = 0;
    if (l.charset.toLowerCase() === u.toLowerCase())
      f |= 1;
    else if (l.charset !== "*")
      return null;
    return {
      i: d,
      o: l.i,
      q: l.q,
      s: f
    };
  }
  function o(u, l) {
    var d = e(u === void 0 ? "*" : u || "");
    if (!l)
      return d.filter(c).sort(s).map(a);
    var f = l.map(function(h, y) {
      return r(h, d, y);
    });
    return f.filter(c).sort(s).map(function(h) {
      return l[f.indexOf(h)];
    });
  }
  function s(u, l) {
    return l.q - u.q || l.s - u.s || u.o - l.o || u.i - l.i || 0;
  }
  function a(u) {
    return u.charset;
  }
  function c(u) {
    return u.q > 0;
  }
  return jh.exports;
}
var Qh = { exports: {} }, vF;
function Wme() {
  if (vF) return Qh.exports;
  vF = 1, Qh.exports = o, Qh.exports.preferredEncodings = o;
  var t = /^\s*([^\s;]+)\s*(?:;(.*))?$/;
  function e(u) {
    for (var l = u.split(","), d = !1, f = 1, m = 0, h = 0; m < l.length; m++) {
      var y = n(l[m].trim(), m);
      y && (l[h++] = y, d = d || i("identity", y), f = Math.min(f, y.q || 1));
    }
    return d || (l[h++] = {
      encoding: "identity",
      q: f,
      i: m
    }), l.length = h, l;
  }
  function n(u, l) {
    var d = t.exec(u);
    if (!d) return null;
    var f = d[1], m = 1;
    if (d[2])
      for (var h = d[2].split(";"), y = 0; y < h.length; y++) {
        var x = h[y].trim().split("=");
        if (x[0] === "q") {
          m = parseFloat(x[1]);
          break;
        }
      }
    return {
      encoding: f,
      q: m,
      i: l
    };
  }
  function r(u, l, d) {
    for (var f = { encoding: u, o: -1, q: 0, s: 0 }, m = 0; m < l.length; m++) {
      var h = i(u, l[m], d);
      h && (f.s - h.s || f.q - h.q || f.o - h.o) < 0 && (f = h);
    }
    return f;
  }
  function i(u, l, d) {
    var f = 0;
    if (l.encoding.toLowerCase() === u.toLowerCase())
      f |= 1;
    else if (l.encoding !== "*")
      return null;
    return {
      encoding: u,
      i: d,
      o: l.i,
      q: l.q,
      s: f
    };
  }
  function o(u, l, d) {
    var f = e(u || ""), m = d ? function(x, g) {
      if (x.q !== g.q)
        return g.q - x.q;
      var v = d.indexOf(x.encoding), S = d.indexOf(g.encoding);
      return v === -1 && S === -1 ? g.s - x.s || x.o - g.o || x.i - g.i : v !== -1 && S !== -1 ? v - S : v === -1 ? 1 : -1;
    } : s;
    if (!l)
      return f.filter(c).sort(m).map(a);
    var h = l.map(function(x, g) {
      return r(x, f, g);
    });
    return h.filter(c).sort(m).map(function(x) {
      return l[h.indexOf(x)];
    });
  }
  function s(u, l) {
    return l.q - u.q || l.s - u.s || u.o - l.o || u.i - l.i;
  }
  function a(u) {
    return u.encoding;
  }
  function c(u) {
    return u.q > 0;
  }
  return Qh.exports;
}
var $h = { exports: {} }, bF;
function zme() {
  if (bF) return $h.exports;
  bF = 1, $h.exports = o, $h.exports.preferredLanguages = o;
  var t = /^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;
  function e(u) {
    for (var l = u.split(","), d = 0, f = 0; d < l.length; d++) {
      var m = n(l[d].trim(), d);
      m && (l[f++] = m);
    }
    return l.length = f, l;
  }
  function n(u, l) {
    var d = t.exec(u);
    if (!d) return null;
    var f = d[1], m = d[2], h = f;
    m && (h += "-" + m);
    var y = 1;
    if (d[3])
      for (var x = d[3].split(";"), g = 0; g < x.length; g++) {
        var v = x[g].split("=");
        v[0] === "q" && (y = parseFloat(v[1]));
      }
    return {
      prefix: f,
      suffix: m,
      q: y,
      i: l,
      full: h
    };
  }
  function r(u, l, d) {
    for (var f = { o: -1, q: 0, s: 0 }, m = 0; m < l.length; m++) {
      var h = i(u, l[m], d);
      h && (f.s - h.s || f.q - h.q || f.o - h.o) < 0 && (f = h);
    }
    return f;
  }
  function i(u, l, d) {
    var f = n(u);
    if (!f) return null;
    var m = 0;
    if (l.full.toLowerCase() === f.full.toLowerCase())
      m |= 4;
    else if (l.prefix.toLowerCase() === f.full.toLowerCase())
      m |= 2;
    else if (l.full.toLowerCase() === f.prefix.toLowerCase())
      m |= 1;
    else if (l.full !== "*")
      return null;
    return {
      i: d,
      o: l.i,
      q: l.q,
      s: m
    };
  }
  function o(u, l) {
    var d = e(u === void 0 ? "*" : u || "");
    if (!l)
      return d.filter(c).sort(s).map(a);
    var f = l.map(function(h, y) {
      return r(h, d, y);
    });
    return f.filter(c).sort(s).map(function(h) {
      return l[f.indexOf(h)];
    });
  }
  function s(u, l) {
    return l.q - u.q || l.s - u.s || u.o - l.o || u.i - l.i || 0;
  }
  function a(u) {
    return u.full;
  }
  function c(u) {
    return u.q > 0;
  }
  return $h.exports;
}
var Gh = { exports: {} }, xF;
function Kme() {
  if (xF) return Gh.exports;
  xF = 1, Gh.exports = o, Gh.exports.preferredMediaTypes = o;
  var t = /^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;
  function e(m) {
    for (var h = d(m), y = 0, x = 0; y < h.length; y++) {
      var g = n(h[y].trim(), y);
      g && (h[x++] = g);
    }
    return h.length = x, h;
  }
  function n(m, h) {
    var y = t.exec(m);
    if (!y) return null;
    var x = /* @__PURE__ */ Object.create(null), g = 1, v = y[2], S = y[1];
    if (y[3])
      for (var E = f(y[3]).map(l), T = 0; T < E.length; T++) {
        var j = E[T], q = j[0].toLowerCase(), Y = j[1], W = Y && Y[0] === '"' && Y[Y.length - 1] === '"' ? Y.slice(1, -1) : Y;
        if (q === "q") {
          g = parseFloat(W);
          break;
        }
        x[q] = W;
      }
    return {
      type: S,
      subtype: v,
      params: x,
      q: g,
      i: h
    };
  }
  function r(m, h, y) {
    for (var x = { o: -1, q: 0, s: 0 }, g = 0; g < h.length; g++) {
      var v = i(m, h[g], y);
      v && (x.s - v.s || x.q - v.q || x.o - v.o) < 0 && (x = v);
    }
    return x;
  }
  function i(m, h, y) {
    var x = n(m), g = 0;
    if (!x)
      return null;
    if (h.type.toLowerCase() == x.type.toLowerCase())
      g |= 4;
    else if (h.type != "*")
      return null;
    if (h.subtype.toLowerCase() == x.subtype.toLowerCase())
      g |= 2;
    else if (h.subtype != "*")
      return null;
    var v = Object.keys(h.params);
    if (v.length > 0)
      if (v.every(function(S) {
        return h.params[S] == "*" || (h.params[S] || "").toLowerCase() == (x.params[S] || "").toLowerCase();
      }))
        g |= 1;
      else
        return null;
    return {
      i: y,
      o: h.i,
      q: h.q,
      s: g
    };
  }
  function o(m, h) {
    var y = e(m === void 0 ? "*/*" : m || "");
    if (!h)
      return y.filter(c).sort(s).map(a);
    var x = h.map(function(v, S) {
      return r(v, y, S);
    });
    return x.filter(c).sort(s).map(function(v) {
      return h[x.indexOf(v)];
    });
  }
  function s(m, h) {
    return h.q - m.q || h.s - m.s || m.o - h.o || m.i - h.i || 0;
  }
  function a(m) {
    return m.type + "/" + m.subtype;
  }
  function c(m) {
    return m.q > 0;
  }
  function u(m) {
    for (var h = 0, y = 0; (y = m.indexOf('"', y)) !== -1; )
      h++, y++;
    return h;
  }
  function l(m) {
    var h = m.indexOf("="), y, x;
    return h === -1 ? y = m : (y = m.slice(0, h), x = m.slice(h + 1)), [y, x];
  }
  function d(m) {
    for (var h = m.split(","), y = 1, x = 0; y < h.length; y++)
      u(h[x]) % 2 == 0 ? h[++x] = h[y] : h[x] += "," + h[y];
    return h.length = x + 1, h;
  }
  function f(m) {
    for (var h = m.split(";"), y = 1, x = 0; y < h.length; y++)
      u(h[x]) % 2 == 0 ? h[++x] = h[y] : h[x] += ";" + h[y];
    h.length = x + 1;
    for (var y = 0; y < h.length; y++)
      h[y] = h[y].trim();
    return h;
  }
  return Gh.exports;
}
/*!
 * negotiator
 * Copyright(c) 2012 Federico Romero
 * Copyright(c) 2012-2014 Isaac Z. Schlueter
 * Copyright(c) 2015 Douglas Christopher Wilson
 * MIT Licensed
 */
var wF;
function Vme() {
  if (wF) return Lh.exports;
  wF = 1;
  var t = Hme(), e = Wme(), n = zme(), r = Kme();
  Lh.exports = i, Lh.exports.Negotiator = i;
  function i(o) {
    if (!(this instanceof i))
      return new i(o);
    this.request = o;
  }
  return i.prototype.charset = function(s) {
    var a = this.charsets(s);
    return a && a[0];
  }, i.prototype.charsets = function(s) {
    return t(this.request.headers["accept-charset"], s);
  }, i.prototype.encoding = function(s, a) {
    var c = this.encodings(s, a);
    return c && c[0];
  }, i.prototype.encodings = function(s, a) {
    return e(this.request.headers["accept-encoding"], s, a);
  }, i.prototype.language = function(s) {
    var a = this.languages(s);
    return a && a[0];
  }, i.prototype.languages = function(s) {
    return n(this.request.headers["accept-language"], s);
  }, i.prototype.mediaType = function(s) {
    var a = this.mediaTypes(s);
    return a && a[0];
  }, i.prototype.mediaTypes = function(s) {
    return r(this.request.headers.accept, s);
  }, i.prototype.preferredCharset = i.prototype.charset, i.prototype.preferredCharsets = i.prototype.charsets, i.prototype.preferredEncoding = i.prototype.encoding, i.prototype.preferredEncodings = i.prototype.encodings, i.prototype.preferredLanguage = i.prototype.language, i.prototype.preferredLanguages = i.prototype.languages, i.prototype.preferredMediaType = i.prototype.mediaType, i.prototype.preferredMediaTypes = i.prototype.mediaTypes, Lh.exports;
}
var ql = { exports: {} };
/*!
 * bytes
 * Copyright(c) 2012-2014 TJ Holowaychuk
 * Copyright(c) 2015 Jed Watson
 * MIT Licensed
 */
var SF;
function Yme() {
  if (SF) return ql.exports;
  SF = 1, ql.exports = i, ql.exports.format = o, ql.exports.parse = s;
  var t = /\B(?=(\d{3})+(?!\d))/g, e = /(?:\.0*|(\.[^0]+)0+)$/, n = {
    b: 1,
    kb: 1024,
    mb: 1 << 20,
    gb: 1 << 30,
    tb: Math.pow(1024, 4),
    pb: Math.pow(1024, 5)
  }, r = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;
  function i(a, c) {
    return typeof a == "string" ? s(a) : typeof a == "number" ? o(a, c) : null;
  }
  function o(a, c) {
    if (!Number.isFinite(a))
      return null;
    var u = Math.abs(a), l = c && c.thousandsSeparator || "", d = c && c.unitSeparator || "", f = c && c.decimalPlaces !== void 0 ? c.decimalPlaces : 2, m = !!(c && c.fixedDecimals), h = c && c.unit || "";
    (!h || !n[h.toLowerCase()]) && (u >= n.pb ? h = "PB" : u >= n.tb ? h = "TB" : u >= n.gb ? h = "GB" : u >= n.mb ? h = "MB" : u >= n.kb ? h = "KB" : h = "B");
    var y = a / n[h.toLowerCase()], x = y.toFixed(f);
    return m || (x = x.replace(e, "$1")), l && (x = x.split(".").map(function(g, v) {
      return v === 0 ? g.replace(t, l) : g;
    }).join(".")), x + d + h;
  }
  function s(a) {
    if (typeof a == "number" && !isNaN(a))
      return a;
    if (typeof a != "string")
      return null;
    var c = r.exec(a), u, l = "b";
    return c ? (u = parseFloat(c[1]), l = c[4].toLowerCase()) : (u = parseInt(a, 10), l = "b"), isNaN(u) ? null : Math.floor(n[l] * u);
  }
  return ql.exports;
}
const Jme = {
  "application/1d-interleaved-parityfec": { source: "iana" },
  "application/3gpdash-qoe-report+xml": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/3gpp-ims+xml": { source: "iana", compressible: !0 },
  "application/3gpphal+json": { source: "iana", compressible: !0 },
  "application/3gpphalforms+json": { source: "iana", compressible: !0 },
  "application/a2l": { source: "iana" },
  "application/ace+cbor": { source: "iana" },
  "application/ace+json": { source: "iana", compressible: !0 },
  "application/ace-groupcomm+cbor": { source: "iana" },
  "application/ace-trl+cbor": { source: "iana" },
  "application/activemessage": { source: "iana" },
  "application/activity+json": { source: "iana", compressible: !0 },
  "application/aif+cbor": { source: "iana" },
  "application/aif+json": { source: "iana", compressible: !0 },
  "application/alto-cdni+json": { source: "iana", compressible: !0 },
  "application/alto-cdnifilter+json": { source: "iana", compressible: !0 },
  "application/alto-costmap+json": { source: "iana", compressible: !0 },
  "application/alto-costmapfilter+json": { source: "iana", compressible: !0 },
  "application/alto-directory+json": { source: "iana", compressible: !0 },
  "application/alto-endpointcost+json": { source: "iana", compressible: !0 },
  "application/alto-endpointcostparams+json": { source: "iana", compressible: !0 },
  "application/alto-endpointprop+json": { source: "iana", compressible: !0 },
  "application/alto-endpointpropparams+json": { source: "iana", compressible: !0 },
  "application/alto-error+json": { source: "iana", compressible: !0 },
  "application/alto-networkmap+json": { source: "iana", compressible: !0 },
  "application/alto-networkmapfilter+json": { source: "iana", compressible: !0 },
  "application/alto-propmap+json": { source: "iana", compressible: !0 },
  "application/alto-propmapparams+json": { source: "iana", compressible: !0 },
  "application/alto-tips+json": { source: "iana", compressible: !0 },
  "application/alto-tipsparams+json": { source: "iana", compressible: !0 },
  "application/alto-updatestreamcontrol+json": { source: "iana", compressible: !0 },
  "application/alto-updatestreamparams+json": { source: "iana", compressible: !0 },
  "application/aml": { source: "iana" },
  "application/andrew-inset": { source: "iana", extensions: ["ez"] },
  "application/appinstaller": { compressible: !1, extensions: ["appinstaller"] },
  "application/applefile": { source: "iana" },
  "application/applixware": { source: "apache", extensions: ["aw"] },
  "application/appx": { compressible: !1, extensions: ["appx"] },
  "application/appxbundle": { compressible: !1, extensions: ["appxbundle"] },
  "application/at+jwt": { source: "iana" },
  "application/atf": { source: "iana" },
  "application/atfx": { source: "iana" },
  "application/atom+xml": { source: "iana", compressible: !0, extensions: ["atom"] },
  "application/atomcat+xml": { source: "iana", compressible: !0, extensions: ["atomcat"] },
  "application/atomdeleted+xml": { source: "iana", compressible: !0, extensions: ["atomdeleted"] },
  "application/atomicmail": { source: "iana" },
  "application/atomsvc+xml": { source: "iana", compressible: !0, extensions: ["atomsvc"] },
  "application/atsc-dwd+xml": { source: "iana", compressible: !0, extensions: ["dwd"] },
  "application/atsc-dynamic-event-message": { source: "iana" },
  "application/atsc-held+xml": { source: "iana", compressible: !0, extensions: ["held"] },
  "application/atsc-rdt+json": { source: "iana", compressible: !0 },
  "application/atsc-rsat+xml": { source: "iana", compressible: !0, extensions: ["rsat"] },
  "application/atxml": { source: "iana" },
  "application/auth-policy+xml": { source: "iana", compressible: !0 },
  "application/automationml-aml+xml": { source: "iana", compressible: !0, extensions: ["aml"] },
  "application/automationml-amlx+zip": { source: "iana", compressible: !1, extensions: ["amlx"] },
  "application/bacnet-xdd+zip": { source: "iana", compressible: !1 },
  "application/batch-smtp": { source: "iana" },
  "application/bdoc": { compressible: !1, extensions: ["bdoc"] },
  "application/beep+xml": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/bufr": { source: "iana" },
  "application/c2pa": { source: "iana" },
  "application/calendar+json": { source: "iana", compressible: !0 },
  "application/calendar+xml": { source: "iana", compressible: !0, extensions: ["xcs"] },
  "application/call-completion": { source: "iana" },
  "application/cals-1840": { source: "iana" },
  "application/captive+json": { source: "iana", compressible: !0 },
  "application/cbor": { source: "iana" },
  "application/cbor-seq": { source: "iana" },
  "application/cccex": { source: "iana" },
  "application/ccmp+xml": { source: "iana", compressible: !0 },
  "application/ccxml+xml": { source: "iana", compressible: !0, extensions: ["ccxml"] },
  "application/cda+xml": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/cdfx+xml": { source: "iana", compressible: !0, extensions: ["cdfx"] },
  "application/cdmi-capability": { source: "iana", extensions: ["cdmia"] },
  "application/cdmi-container": { source: "iana", extensions: ["cdmic"] },
  "application/cdmi-domain": { source: "iana", extensions: ["cdmid"] },
  "application/cdmi-object": { source: "iana", extensions: ["cdmio"] },
  "application/cdmi-queue": { source: "iana", extensions: ["cdmiq"] },
  "application/cdni": { source: "iana" },
  "application/ce+cbor": { source: "iana" },
  "application/cea": { source: "iana" },
  "application/cea-2018+xml": { source: "iana", compressible: !0 },
  "application/cellml+xml": { source: "iana", compressible: !0 },
  "application/cfw": { source: "iana" },
  "application/cid-edhoc+cbor-seq": { source: "iana" },
  "application/city+json": { source: "iana", compressible: !0 },
  "application/city+json-seq": { source: "iana" },
  "application/clr": { source: "iana" },
  "application/clue+xml": { source: "iana", compressible: !0 },
  "application/clue_info+xml": { source: "iana", compressible: !0 },
  "application/cms": { source: "iana" },
  "application/cnrp+xml": { source: "iana", compressible: !0 },
  "application/coap-eap": { source: "iana" },
  "application/coap-group+json": { source: "iana", compressible: !0 },
  "application/coap-payload": { source: "iana" },
  "application/commonground": { source: "iana" },
  "application/concise-problem-details+cbor": { source: "iana" },
  "application/conference-info+xml": { source: "iana", compressible: !0 },
  "application/cose": { source: "iana" },
  "application/cose-key": { source: "iana" },
  "application/cose-key-set": { source: "iana" },
  "application/cose-x509": { source: "iana" },
  "application/cpl+xml": { source: "iana", compressible: !0, extensions: ["cpl"] },
  "application/csrattrs": { source: "iana" },
  "application/csta+xml": { source: "iana", compressible: !0 },
  "application/cstadata+xml": { source: "iana", compressible: !0 },
  "application/csvm+json": { source: "iana", compressible: !0 },
  "application/cu-seeme": { source: "apache", extensions: ["cu"] },
  "application/cwl": { source: "iana", extensions: ["cwl"] },
  "application/cwl+json": { source: "iana", compressible: !0 },
  "application/cwl+yaml": { source: "iana" },
  "application/cwt": { source: "iana" },
  "application/cybercash": { source: "iana" },
  "application/dart": { compressible: !0 },
  "application/dash+xml": { source: "iana", compressible: !0, extensions: ["mpd"] },
  "application/dash-patch+xml": { source: "iana", compressible: !0, extensions: ["mpp"] },
  "application/dashdelta": { source: "iana" },
  "application/davmount+xml": { source: "iana", compressible: !0, extensions: ["davmount"] },
  "application/dca-rft": { source: "iana" },
  "application/dcd": { source: "iana" },
  "application/dec-dx": { source: "iana" },
  "application/dialog-info+xml": { source: "iana", compressible: !0 },
  "application/dicom": { source: "iana", extensions: ["dcm"] },
  "application/dicom+json": { source: "iana", compressible: !0 },
  "application/dicom+xml": { source: "iana", compressible: !0 },
  "application/dii": { source: "iana" },
  "application/dit": { source: "iana" },
  "application/dns": { source: "iana" },
  "application/dns+json": { source: "iana", compressible: !0 },
  "application/dns-message": { source: "iana" },
  "application/docbook+xml": { source: "apache", compressible: !0, extensions: ["dbk"] },
  "application/dots+cbor": { source: "iana" },
  "application/dpop+jwt": { source: "iana" },
  "application/dskpp+xml": { source: "iana", compressible: !0 },
  "application/dssc+der": { source: "iana", extensions: ["dssc"] },
  "application/dssc+xml": { source: "iana", compressible: !0, extensions: ["xdssc"] },
  "application/dvcs": { source: "iana" },
  "application/eat+cwt": { source: "iana" },
  "application/eat+jwt": { source: "iana" },
  "application/eat-bun+cbor": { source: "iana" },
  "application/eat-bun+json": { source: "iana", compressible: !0 },
  "application/eat-ucs+cbor": { source: "iana" },
  "application/eat-ucs+json": { source: "iana", compressible: !0 },
  "application/ecmascript": { source: "apache", compressible: !0, extensions: ["ecma"] },
  "application/edhoc+cbor-seq": { source: "iana" },
  "application/edi-consent": { source: "iana" },
  "application/edi-x12": { source: "iana", compressible: !1 },
  "application/edifact": { source: "iana", compressible: !1 },
  "application/efi": { source: "iana" },
  "application/elm+json": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/elm+xml": { source: "iana", compressible: !0 },
  "application/emergencycalldata.cap+xml": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/emergencycalldata.comment+xml": { source: "iana", compressible: !0 },
  "application/emergencycalldata.control+xml": { source: "iana", compressible: !0 },
  "application/emergencycalldata.deviceinfo+xml": { source: "iana", compressible: !0 },
  "application/emergencycalldata.ecall.msd": { source: "iana" },
  "application/emergencycalldata.legacyesn+json": { source: "iana", compressible: !0 },
  "application/emergencycalldata.providerinfo+xml": { source: "iana", compressible: !0 },
  "application/emergencycalldata.serviceinfo+xml": { source: "iana", compressible: !0 },
  "application/emergencycalldata.subscriberinfo+xml": { source: "iana", compressible: !0 },
  "application/emergencycalldata.veds+xml": { source: "iana", compressible: !0 },
  "application/emma+xml": { source: "iana", compressible: !0, extensions: ["emma"] },
  "application/emotionml+xml": { source: "iana", compressible: !0, extensions: ["emotionml"] },
  "application/encaprtp": { source: "iana" },
  "application/entity-statement+jwt": { source: "iana" },
  "application/epp+xml": { source: "iana", compressible: !0 },
  "application/epub+zip": { source: "iana", compressible: !1, extensions: ["epub"] },
  "application/eshop": { source: "iana" },
  "application/exi": { source: "iana", extensions: ["exi"] },
  "application/expect-ct-report+json": { source: "iana", compressible: !0 },
  "application/express": { source: "iana", extensions: ["exp"] },
  "application/fastinfoset": { source: "iana" },
  "application/fastsoap": { source: "iana" },
  "application/fdf": { source: "iana", extensions: ["fdf"] },
  "application/fdt+xml": { source: "iana", compressible: !0, extensions: ["fdt"] },
  "application/fhir+json": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/fhir+xml": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/fido.trusted-apps+json": { compressible: !0 },
  "application/fits": { source: "iana" },
  "application/flexfec": { source: "iana" },
  "application/font-sfnt": { source: "iana" },
  "application/font-tdpfr": { source: "iana", extensions: ["pfr"] },
  "application/font-woff": { source: "iana", compressible: !1 },
  "application/framework-attributes+xml": { source: "iana", compressible: !0 },
  "application/geo+json": { source: "iana", compressible: !0, extensions: ["geojson"] },
  "application/geo+json-seq": { source: "iana" },
  "application/geopackage+sqlite3": { source: "iana" },
  "application/geopose+json": { source: "iana", compressible: !0 },
  "application/geoxacml+json": { source: "iana", compressible: !0 },
  "application/geoxacml+xml": { source: "iana", compressible: !0 },
  "application/gltf-buffer": { source: "iana" },
  "application/gml+xml": { source: "iana", compressible: !0, extensions: ["gml"] },
  "application/gnap-binding-jws": { source: "iana" },
  "application/gnap-binding-jwsd": { source: "iana" },
  "application/gnap-binding-rotation-jws": { source: "iana" },
  "application/gnap-binding-rotation-jwsd": { source: "iana" },
  "application/gpx+xml": { source: "apache", compressible: !0, extensions: ["gpx"] },
  "application/grib": { source: "iana" },
  "application/gxf": { source: "apache", extensions: ["gxf"] },
  "application/gzip": { source: "iana", compressible: !1, extensions: ["gz"] },
  "application/h224": { source: "iana" },
  "application/held+xml": { source: "iana", compressible: !0 },
  "application/hjson": { extensions: ["hjson"] },
  "application/hl7v2+xml": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/http": { source: "iana" },
  "application/hyperstudio": { source: "iana", extensions: ["stk"] },
  "application/ibe-key-request+xml": { source: "iana", compressible: !0 },
  "application/ibe-pkg-reply+xml": { source: "iana", compressible: !0 },
  "application/ibe-pp-data": { source: "iana" },
  "application/iges": { source: "iana" },
  "application/im-iscomposing+xml": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/index": { source: "iana" },
  "application/index.cmd": { source: "iana" },
  "application/index.obj": { source: "iana" },
  "application/index.response": { source: "iana" },
  "application/index.vnd": { source: "iana" },
  "application/inkml+xml": { source: "iana", compressible: !0, extensions: ["ink", "inkml"] },
  "application/iotp": { source: "iana" },
  "application/ipfix": { source: "iana", extensions: ["ipfix"] },
  "application/ipp": { source: "iana" },
  "application/isup": { source: "iana" },
  "application/its+xml": { source: "iana", compressible: !0, extensions: ["its"] },
  "application/java-archive": { source: "iana", compressible: !1, extensions: ["jar", "war", "ear"] },
  "application/java-serialized-object": { source: "apache", compressible: !1, extensions: ["ser"] },
  "application/java-vm": { source: "apache", compressible: !1, extensions: ["class"] },
  "application/javascript": { source: "apache", charset: "UTF-8", compressible: !0, extensions: ["js"] },
  "application/jf2feed+json": { source: "iana", compressible: !0 },
  "application/jose": { source: "iana" },
  "application/jose+json": { source: "iana", compressible: !0 },
  "application/jrd+json": { source: "iana", compressible: !0 },
  "application/jscalendar+json": { source: "iana", compressible: !0 },
  "application/jscontact+json": { source: "iana", compressible: !0 },
  "application/json": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["json", "map"] },
  "application/json-patch+json": { source: "iana", compressible: !0 },
  "application/json-seq": { source: "iana" },
  "application/json5": { extensions: ["json5"] },
  "application/jsonml+json": { source: "apache", compressible: !0, extensions: ["jsonml"] },
  "application/jsonpath": { source: "iana" },
  "application/jwk+json": { source: "iana", compressible: !0 },
  "application/jwk-set+json": { source: "iana", compressible: !0 },
  "application/jwk-set+jwt": { source: "iana" },
  "application/jwt": { source: "iana" },
  "application/kpml-request+xml": { source: "iana", compressible: !0 },
  "application/kpml-response+xml": { source: "iana", compressible: !0 },
  "application/ld+json": { source: "iana", compressible: !0, extensions: ["jsonld"] },
  "application/lgr+xml": { source: "iana", compressible: !0, extensions: ["lgr"] },
  "application/link-format": { source: "iana" },
  "application/linkset": { source: "iana" },
  "application/linkset+json": { source: "iana", compressible: !0 },
  "application/load-control+xml": { source: "iana", compressible: !0 },
  "application/logout+jwt": { source: "iana" },
  "application/lost+xml": { source: "iana", compressible: !0, extensions: ["lostxml"] },
  "application/lostsync+xml": { source: "iana", compressible: !0 },
  "application/lpf+zip": { source: "iana", compressible: !1 },
  "application/lxf": { source: "iana" },
  "application/mac-binhex40": { source: "iana", extensions: ["hqx"] },
  "application/mac-compactpro": { source: "apache", extensions: ["cpt"] },
  "application/macwriteii": { source: "iana" },
  "application/mads+xml": { source: "iana", compressible: !0, extensions: ["mads"] },
  "application/manifest+json": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["webmanifest"] },
  "application/marc": { source: "iana", extensions: ["mrc"] },
  "application/marcxml+xml": { source: "iana", compressible: !0, extensions: ["mrcx"] },
  "application/mathematica": { source: "iana", extensions: ["ma", "nb", "mb"] },
  "application/mathml+xml": { source: "iana", compressible: !0, extensions: ["mathml"] },
  "application/mathml-content+xml": { source: "iana", compressible: !0 },
  "application/mathml-presentation+xml": { source: "iana", compressible: !0 },
  "application/mbms-associated-procedure-description+xml": { source: "iana", compressible: !0 },
  "application/mbms-deregister+xml": { source: "iana", compressible: !0 },
  "application/mbms-envelope+xml": { source: "iana", compressible: !0 },
  "application/mbms-msk+xml": { source: "iana", compressible: !0 },
  "application/mbms-msk-response+xml": { source: "iana", compressible: !0 },
  "application/mbms-protection-description+xml": { source: "iana", compressible: !0 },
  "application/mbms-reception-report+xml": { source: "iana", compressible: !0 },
  "application/mbms-register+xml": { source: "iana", compressible: !0 },
  "application/mbms-register-response+xml": { source: "iana", compressible: !0 },
  "application/mbms-schedule+xml": { source: "iana", compressible: !0 },
  "application/mbms-user-service-description+xml": { source: "iana", compressible: !0 },
  "application/mbox": { source: "iana", extensions: ["mbox"] },
  "application/media-policy-dataset+xml": { source: "iana", compressible: !0, extensions: ["mpf"] },
  "application/media_control+xml": { source: "iana", compressible: !0 },
  "application/mediaservercontrol+xml": { source: "iana", compressible: !0, extensions: ["mscml"] },
  "application/merge-patch+json": { source: "iana", compressible: !0 },
  "application/metalink+xml": { source: "apache", compressible: !0, extensions: ["metalink"] },
  "application/metalink4+xml": { source: "iana", compressible: !0, extensions: ["meta4"] },
  "application/mets+xml": { source: "iana", compressible: !0, extensions: ["mets"] },
  "application/mf4": { source: "iana" },
  "application/mikey": { source: "iana" },
  "application/mipc": { source: "iana" },
  "application/missing-blocks+cbor-seq": { source: "iana" },
  "application/mmt-aei+xml": { source: "iana", compressible: !0, extensions: ["maei"] },
  "application/mmt-usd+xml": { source: "iana", compressible: !0, extensions: ["musd"] },
  "application/mods+xml": { source: "iana", compressible: !0, extensions: ["mods"] },
  "application/moss-keys": { source: "iana" },
  "application/moss-signature": { source: "iana" },
  "application/mosskey-data": { source: "iana" },
  "application/mosskey-request": { source: "iana" },
  "application/mp21": { source: "iana", extensions: ["m21", "mp21"] },
  "application/mp4": { source: "iana", extensions: ["mp4", "mpg4", "mp4s", "m4p"] },
  "application/mpeg4-generic": { source: "iana" },
  "application/mpeg4-iod": { source: "iana" },
  "application/mpeg4-iod-xmt": { source: "iana" },
  "application/mrb-consumer+xml": { source: "iana", compressible: !0 },
  "application/mrb-publish+xml": { source: "iana", compressible: !0 },
  "application/msc-ivr+xml": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/msc-mixer+xml": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/msix": { compressible: !1, extensions: ["msix"] },
  "application/msixbundle": { compressible: !1, extensions: ["msixbundle"] },
  "application/msword": { source: "iana", compressible: !1, extensions: ["doc", "dot"] },
  "application/mud+json": { source: "iana", compressible: !0 },
  "application/multipart-core": { source: "iana" },
  "application/mxf": { source: "iana", extensions: ["mxf"] },
  "application/n-quads": { source: "iana", extensions: ["nq"] },
  "application/n-triples": { source: "iana", extensions: ["nt"] },
  "application/nasdata": { source: "iana" },
  "application/news-checkgroups": { source: "iana", charset: "US-ASCII" },
  "application/news-groupinfo": { source: "iana", charset: "US-ASCII" },
  "application/news-transmission": { source: "iana" },
  "application/nlsml+xml": { source: "iana", compressible: !0 },
  "application/node": { source: "iana", extensions: ["cjs"] },
  "application/nss": { source: "iana" },
  "application/oauth-authz-req+jwt": { source: "iana" },
  "application/oblivious-dns-message": { source: "iana" },
  "application/ocsp-request": { source: "iana" },
  "application/ocsp-response": { source: "iana" },
  "application/octet-stream": { source: "iana", compressible: !0, extensions: ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"] },
  "application/oda": { source: "iana", extensions: ["oda"] },
  "application/odm+xml": { source: "iana", compressible: !0 },
  "application/odx": { source: "iana" },
  "application/oebps-package+xml": { source: "iana", compressible: !0, extensions: ["opf"] },
  "application/ogg": { source: "iana", compressible: !1, extensions: ["ogx"] },
  "application/ohttp-keys": { source: "iana" },
  "application/omdoc+xml": { source: "apache", compressible: !0, extensions: ["omdoc"] },
  "application/onenote": { source: "apache", extensions: ["onetoc", "onetoc2", "onetmp", "onepkg", "one", "onea"] },
  "application/opc-nodeset+xml": { source: "iana", compressible: !0 },
  "application/oscore": { source: "iana" },
  "application/oxps": { source: "iana", extensions: ["oxps"] },
  "application/p21": { source: "iana" },
  "application/p21+zip": { source: "iana", compressible: !1 },
  "application/p2p-overlay+xml": { source: "iana", compressible: !0, extensions: ["relo"] },
  "application/parityfec": { source: "iana" },
  "application/passport": { source: "iana" },
  "application/patch-ops-error+xml": { source: "iana", compressible: !0, extensions: ["xer"] },
  "application/pdf": { source: "iana", compressible: !1, extensions: ["pdf"] },
  "application/pdx": { source: "iana" },
  "application/pem-certificate-chain": { source: "iana" },
  "application/pgp-encrypted": { source: "iana", compressible: !1, extensions: ["pgp"] },
  "application/pgp-keys": { source: "iana", extensions: ["asc"] },
  "application/pgp-signature": { source: "iana", extensions: ["sig", "asc"] },
  "application/pics-rules": { source: "apache", extensions: ["prf"] },
  "application/pidf+xml": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/pidf-diff+xml": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/pkcs10": { source: "iana", extensions: ["p10"] },
  "application/pkcs12": { source: "iana" },
  "application/pkcs7-mime": { source: "iana", extensions: ["p7m", "p7c"] },
  "application/pkcs7-signature": { source: "iana", extensions: ["p7s"] },
  "application/pkcs8": { source: "iana", extensions: ["p8"] },
  "application/pkcs8-encrypted": { source: "iana" },
  "application/pkix-attr-cert": { source: "iana", extensions: ["ac"] },
  "application/pkix-cert": { source: "iana", extensions: ["cer"] },
  "application/pkix-crl": { source: "iana", extensions: ["crl"] },
  "application/pkix-pkipath": { source: "iana", extensions: ["pkipath"] },
  "application/pkixcmp": { source: "iana", extensions: ["pki"] },
  "application/pls+xml": { source: "iana", compressible: !0, extensions: ["pls"] },
  "application/poc-settings+xml": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/postscript": { source: "iana", compressible: !0, extensions: ["ai", "eps", "ps"] },
  "application/ppsp-tracker+json": { source: "iana", compressible: !0 },
  "application/private-token-issuer-directory": { source: "iana" },
  "application/private-token-request": { source: "iana" },
  "application/private-token-response": { source: "iana" },
  "application/problem+json": { source: "iana", compressible: !0 },
  "application/problem+xml": { source: "iana", compressible: !0 },
  "application/provenance+xml": { source: "iana", compressible: !0, extensions: ["provx"] },
  "application/provided-claims+jwt": { source: "iana" },
  "application/prs.alvestrand.titrax-sheet": { source: "iana" },
  "application/prs.cww": { source: "iana", extensions: ["cww"] },
  "application/prs.cyn": { source: "iana", charset: "7-BIT" },
  "application/prs.hpub+zip": { source: "iana", compressible: !1 },
  "application/prs.implied-document+xml": { source: "iana", compressible: !0 },
  "application/prs.implied-executable": { source: "iana" },
  "application/prs.implied-object+json": { source: "iana", compressible: !0 },
  "application/prs.implied-object+json-seq": { source: "iana" },
  "application/prs.implied-object+yaml": { source: "iana" },
  "application/prs.implied-structure": { source: "iana" },
  "application/prs.mayfile": { source: "iana" },
  "application/prs.nprend": { source: "iana" },
  "application/prs.plucker": { source: "iana" },
  "application/prs.rdf-xml-crypt": { source: "iana" },
  "application/prs.vcfbzip2": { source: "iana" },
  "application/prs.xsf+xml": { source: "iana", compressible: !0, extensions: ["xsf"] },
  "application/pskc+xml": { source: "iana", compressible: !0, extensions: ["pskcxml"] },
  "application/pvd+json": { source: "iana", compressible: !0 },
  "application/qsig": { source: "iana" },
  "application/raml+yaml": { compressible: !0, extensions: ["raml"] },
  "application/raptorfec": { source: "iana" },
  "application/rdap+json": { source: "iana", compressible: !0 },
  "application/rdf+xml": { source: "iana", compressible: !0, extensions: ["rdf", "owl"] },
  "application/reginfo+xml": { source: "iana", compressible: !0, extensions: ["rif"] },
  "application/relax-ng-compact-syntax": { source: "iana", extensions: ["rnc"] },
  "application/remote-printing": { source: "apache" },
  "application/reputon+json": { source: "iana", compressible: !0 },
  "application/resolve-response+jwt": { source: "iana" },
  "application/resource-lists+xml": { source: "iana", compressible: !0, extensions: ["rl"] },
  "application/resource-lists-diff+xml": { source: "iana", compressible: !0, extensions: ["rld"] },
  "application/rfc+xml": { source: "iana", compressible: !0 },
  "application/riscos": { source: "iana" },
  "application/rlmi+xml": { source: "iana", compressible: !0 },
  "application/rls-services+xml": { source: "iana", compressible: !0, extensions: ["rs"] },
  "application/route-apd+xml": { source: "iana", compressible: !0, extensions: ["rapd"] },
  "application/route-s-tsid+xml": { source: "iana", compressible: !0, extensions: ["sls"] },
  "application/route-usd+xml": { source: "iana", compressible: !0, extensions: ["rusd"] },
  "application/rpki-checklist": { source: "iana" },
  "application/rpki-ghostbusters": { source: "iana", extensions: ["gbr"] },
  "application/rpki-manifest": { source: "iana", extensions: ["mft"] },
  "application/rpki-publication": { source: "iana" },
  "application/rpki-roa": { source: "iana", extensions: ["roa"] },
  "application/rpki-signed-tal": { source: "iana" },
  "application/rpki-updown": { source: "iana" },
  "application/rsd+xml": { source: "apache", compressible: !0, extensions: ["rsd"] },
  "application/rss+xml": { source: "apache", compressible: !0, extensions: ["rss"] },
  "application/rtf": { source: "iana", compressible: !0, extensions: ["rtf"] },
  "application/rtploopback": { source: "iana" },
  "application/rtx": { source: "iana" },
  "application/samlassertion+xml": { source: "iana", compressible: !0 },
  "application/samlmetadata+xml": { source: "iana", compressible: !0 },
  "application/sarif+json": { source: "iana", compressible: !0 },
  "application/sarif-external-properties+json": { source: "iana", compressible: !0 },
  "application/sbe": { source: "iana" },
  "application/sbml+xml": { source: "iana", compressible: !0, extensions: ["sbml"] },
  "application/scaip+xml": { source: "iana", compressible: !0 },
  "application/scim+json": { source: "iana", compressible: !0 },
  "application/scvp-cv-request": { source: "iana", extensions: ["scq"] },
  "application/scvp-cv-response": { source: "iana", extensions: ["scs"] },
  "application/scvp-vp-request": { source: "iana", extensions: ["spq"] },
  "application/scvp-vp-response": { source: "iana", extensions: ["spp"] },
  "application/sdp": { source: "iana", extensions: ["sdp"] },
  "application/secevent+jwt": { source: "iana" },
  "application/senml+cbor": { source: "iana" },
  "application/senml+json": { source: "iana", compressible: !0 },
  "application/senml+xml": { source: "iana", compressible: !0, extensions: ["senmlx"] },
  "application/senml-etch+cbor": { source: "iana" },
  "application/senml-etch+json": { source: "iana", compressible: !0 },
  "application/senml-exi": { source: "iana" },
  "application/sensml+cbor": { source: "iana" },
  "application/sensml+json": { source: "iana", compressible: !0 },
  "application/sensml+xml": { source: "iana", compressible: !0, extensions: ["sensmlx"] },
  "application/sensml-exi": { source: "iana" },
  "application/sep+xml": { source: "iana", compressible: !0 },
  "application/sep-exi": { source: "iana" },
  "application/session-info": { source: "iana" },
  "application/set-payment": { source: "iana" },
  "application/set-payment-initiation": { source: "iana", extensions: ["setpay"] },
  "application/set-registration": { source: "iana" },
  "application/set-registration-initiation": { source: "iana", extensions: ["setreg"] },
  "application/sgml": { source: "iana" },
  "application/sgml-open-catalog": { source: "iana" },
  "application/shf+xml": { source: "iana", compressible: !0, extensions: ["shf"] },
  "application/sieve": { source: "iana", extensions: ["siv", "sieve"] },
  "application/simple-filter+xml": { source: "iana", compressible: !0 },
  "application/simple-message-summary": { source: "iana" },
  "application/simplesymbolcontainer": { source: "iana" },
  "application/sipc": { source: "iana" },
  "application/slate": { source: "iana" },
  "application/smil": { source: "apache" },
  "application/smil+xml": { source: "iana", compressible: !0, extensions: ["smi", "smil"] },
  "application/smpte336m": { source: "iana" },
  "application/soap+fastinfoset": { source: "iana" },
  "application/soap+xml": { source: "iana", compressible: !0 },
  "application/sparql-query": { source: "iana", extensions: ["rq"] },
  "application/sparql-results+xml": { source: "iana", compressible: !0, extensions: ["srx"] },
  "application/spdx+json": { source: "iana", compressible: !0 },
  "application/spirits-event+xml": { source: "iana", compressible: !0 },
  "application/sql": { source: "iana", extensions: ["sql"] },
  "application/srgs": { source: "iana", extensions: ["gram"] },
  "application/srgs+xml": { source: "iana", compressible: !0, extensions: ["grxml"] },
  "application/sru+xml": { source: "iana", compressible: !0, extensions: ["sru"] },
  "application/ssdl+xml": { source: "apache", compressible: !0, extensions: ["ssdl"] },
  "application/sslkeylogfile": { source: "iana" },
  "application/ssml+xml": { source: "iana", compressible: !0, extensions: ["ssml"] },
  "application/st2110-41": { source: "iana" },
  "application/stix+json": { source: "iana", compressible: !0 },
  "application/stratum": { source: "iana" },
  "application/swid+cbor": { source: "iana" },
  "application/swid+xml": { source: "iana", compressible: !0, extensions: ["swidtag"] },
  "application/tamp-apex-update": { source: "iana" },
  "application/tamp-apex-update-confirm": { source: "iana" },
  "application/tamp-community-update": { source: "iana" },
  "application/tamp-community-update-confirm": { source: "iana" },
  "application/tamp-error": { source: "iana" },
  "application/tamp-sequence-adjust": { source: "iana" },
  "application/tamp-sequence-adjust-confirm": { source: "iana" },
  "application/tamp-status-query": { source: "iana" },
  "application/tamp-status-response": { source: "iana" },
  "application/tamp-update": { source: "iana" },
  "application/tamp-update-confirm": { source: "iana" },
  "application/tar": { compressible: !0 },
  "application/taxii+json": { source: "iana", compressible: !0 },
  "application/td+json": { source: "iana", compressible: !0 },
  "application/tei+xml": { source: "iana", compressible: !0, extensions: ["tei", "teicorpus"] },
  "application/tetra_isi": { source: "iana" },
  "application/thraud+xml": { source: "iana", compressible: !0, extensions: ["tfi"] },
  "application/timestamp-query": { source: "iana" },
  "application/timestamp-reply": { source: "iana" },
  "application/timestamped-data": { source: "iana", extensions: ["tsd"] },
  "application/tlsrpt+gzip": { source: "iana" },
  "application/tlsrpt+json": { source: "iana", compressible: !0 },
  "application/tm+json": { source: "iana", compressible: !0 },
  "application/tnauthlist": { source: "iana" },
  "application/toc+cbor": { source: "iana" },
  "application/token-introspection+jwt": { source: "iana" },
  "application/toml": { source: "iana", compressible: !0, extensions: ["toml"] },
  "application/trickle-ice-sdpfrag": { source: "iana" },
  "application/trig": { source: "iana", extensions: ["trig"] },
  "application/trust-chain+json": { source: "iana", compressible: !0 },
  "application/trust-mark+jwt": { source: "iana" },
  "application/trust-mark-delegation+jwt": { source: "iana" },
  "application/ttml+xml": { source: "iana", compressible: !0, extensions: ["ttml"] },
  "application/tve-trigger": { source: "iana" },
  "application/tzif": { source: "iana" },
  "application/tzif-leap": { source: "iana" },
  "application/ubjson": { compressible: !1, extensions: ["ubj"] },
  "application/uccs+cbor": { source: "iana" },
  "application/ujcs+json": { source: "iana", compressible: !0 },
  "application/ulpfec": { source: "iana" },
  "application/urc-grpsheet+xml": { source: "iana", compressible: !0 },
  "application/urc-ressheet+xml": { source: "iana", compressible: !0, extensions: ["rsheet"] },
  "application/urc-targetdesc+xml": { source: "iana", compressible: !0, extensions: ["td"] },
  "application/urc-uisocketdesc+xml": { source: "iana", compressible: !0 },
  "application/vc": { source: "iana" },
  "application/vc+cose": { source: "iana" },
  "application/vc+jwt": { source: "iana" },
  "application/vcard+json": { source: "iana", compressible: !0 },
  "application/vcard+xml": { source: "iana", compressible: !0 },
  "application/vemmi": { source: "iana" },
  "application/vividence.scriptfile": { source: "apache" },
  "application/vnd.1000minds.decision-model+xml": { source: "iana", compressible: !0, extensions: ["1km"] },
  "application/vnd.1ob": { source: "iana" },
  "application/vnd.3gpp-prose+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp-prose-pc3a+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp-prose-pc3ach+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp-prose-pc3ch+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp-prose-pc8+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp-v2x-local-service-information": { source: "iana" },
  "application/vnd.3gpp.5gnas": { source: "iana" },
  "application/vnd.3gpp.5gsa2x": { source: "iana" },
  "application/vnd.3gpp.5gsa2x-local-service-information": { source: "iana" },
  "application/vnd.3gpp.5gsv2x": { source: "iana" },
  "application/vnd.3gpp.5gsv2x-local-service-information": { source: "iana" },
  "application/vnd.3gpp.access-transfer-events+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.bsf+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.crs+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.current-location-discovery+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.gmop+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.gtpc": { source: "iana" },
  "application/vnd.3gpp.interworking-data": { source: "iana" },
  "application/vnd.3gpp.lpp": { source: "iana" },
  "application/vnd.3gpp.mc-signalling-ear": { source: "iana" },
  "application/vnd.3gpp.mcdata-affiliation-command+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcdata-info+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcdata-msgstore-ctrl-request+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcdata-payload": { source: "iana" },
  "application/vnd.3gpp.mcdata-regroup+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcdata-service-config+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcdata-signalling": { source: "iana" },
  "application/vnd.3gpp.mcdata-ue-config+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcdata-user-profile+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcptt-affiliation-command+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcptt-floor-request+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcptt-info+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcptt-location-info+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcptt-mbms-usage-info+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcptt-regroup+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcptt-service-config+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcptt-signed+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcptt-ue-config+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcptt-ue-init-config+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcptt-user-profile+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcvideo-affiliation-command+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcvideo-info+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcvideo-location-info+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcvideo-mbms-usage-info+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcvideo-regroup+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcvideo-service-config+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcvideo-transmission-request+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcvideo-ue-config+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mcvideo-user-profile+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.mid-call+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.ngap": { source: "iana" },
  "application/vnd.3gpp.pfcp": { source: "iana" },
  "application/vnd.3gpp.pic-bw-large": { source: "iana", extensions: ["plb"] },
  "application/vnd.3gpp.pic-bw-small": { source: "iana", extensions: ["psb"] },
  "application/vnd.3gpp.pic-bw-var": { source: "iana", extensions: ["pvb"] },
  "application/vnd.3gpp.pinapp-info+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.s1ap": { source: "iana" },
  "application/vnd.3gpp.seal-group-doc+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.seal-info+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.seal-location-info+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.seal-mbms-usage-info+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.seal-network-qos-management-info+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.seal-ue-config-info+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.seal-unicast-info+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.seal-user-profile-info+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.sms": { source: "iana" },
  "application/vnd.3gpp.sms+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.srvcc-ext+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.srvcc-info+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.state-and-event-info+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.ussd+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp.v2x": { source: "iana" },
  "application/vnd.3gpp.vae-info+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp2.bcmcsinfo+xml": { source: "iana", compressible: !0 },
  "application/vnd.3gpp2.sms": { source: "iana" },
  "application/vnd.3gpp2.tcap": { source: "iana", extensions: ["tcap"] },
  "application/vnd.3lightssoftware.imagescal": { source: "iana" },
  "application/vnd.3m.post-it-notes": { source: "iana", extensions: ["pwn"] },
  "application/vnd.accpac.simply.aso": { source: "iana", extensions: ["aso"] },
  "application/vnd.accpac.simply.imp": { source: "iana", extensions: ["imp"] },
  "application/vnd.acm.addressxfer+json": { source: "iana", compressible: !0 },
  "application/vnd.acm.chatbot+json": { source: "iana", compressible: !0 },
  "application/vnd.acucobol": { source: "iana", extensions: ["acu"] },
  "application/vnd.acucorp": { source: "iana", extensions: ["atc", "acutc"] },
  "application/vnd.adobe.air-application-installer-package+zip": { source: "apache", compressible: !1, extensions: ["air"] },
  "application/vnd.adobe.flash.movie": { source: "iana" },
  "application/vnd.adobe.formscentral.fcdt": { source: "iana", extensions: ["fcdt"] },
  "application/vnd.adobe.fxp": { source: "iana", extensions: ["fxp", "fxpl"] },
  "application/vnd.adobe.partial-upload": { source: "iana" },
  "application/vnd.adobe.xdp+xml": { source: "iana", compressible: !0, extensions: ["xdp"] },
  "application/vnd.adobe.xfdf": { source: "apache", extensions: ["xfdf"] },
  "application/vnd.aether.imp": { source: "iana" },
  "application/vnd.afpc.afplinedata": { source: "iana" },
  "application/vnd.afpc.afplinedata-pagedef": { source: "iana" },
  "application/vnd.afpc.cmoca-cmresource": { source: "iana" },
  "application/vnd.afpc.foca-charset": { source: "iana" },
  "application/vnd.afpc.foca-codedfont": { source: "iana" },
  "application/vnd.afpc.foca-codepage": { source: "iana" },
  "application/vnd.afpc.modca": { source: "iana" },
  "application/vnd.afpc.modca-cmtable": { source: "iana" },
  "application/vnd.afpc.modca-formdef": { source: "iana" },
  "application/vnd.afpc.modca-mediummap": { source: "iana" },
  "application/vnd.afpc.modca-objectcontainer": { source: "iana" },
  "application/vnd.afpc.modca-overlay": { source: "iana" },
  "application/vnd.afpc.modca-pagesegment": { source: "iana" },
  "application/vnd.age": { source: "iana", extensions: ["age"] },
  "application/vnd.ah-barcode": { source: "apache" },
  "application/vnd.ahead.space": { source: "iana", extensions: ["ahead"] },
  "application/vnd.airzip.filesecure.azf": { source: "iana", extensions: ["azf"] },
  "application/vnd.airzip.filesecure.azs": { source: "iana", extensions: ["azs"] },
  "application/vnd.amadeus+json": { source: "iana", compressible: !0 },
  "application/vnd.amazon.ebook": { source: "apache", extensions: ["azw"] },
  "application/vnd.amazon.mobi8-ebook": { source: "iana" },
  "application/vnd.americandynamics.acc": { source: "iana", extensions: ["acc"] },
  "application/vnd.amiga.ami": { source: "iana", extensions: ["ami"] },
  "application/vnd.amundsen.maze+xml": { source: "iana", compressible: !0 },
  "application/vnd.android.ota": { source: "iana" },
  "application/vnd.android.package-archive": { source: "apache", compressible: !1, extensions: ["apk"] },
  "application/vnd.anki": { source: "iana" },
  "application/vnd.anser-web-certificate-issue-initiation": { source: "iana", extensions: ["cii"] },
  "application/vnd.anser-web-funds-transfer-initiation": { source: "apache", extensions: ["fti"] },
  "application/vnd.antix.game-component": { source: "iana", extensions: ["atx"] },
  "application/vnd.apache.arrow.file": { source: "iana" },
  "application/vnd.apache.arrow.stream": { source: "iana" },
  "application/vnd.apache.parquet": { source: "iana" },
  "application/vnd.apache.thrift.binary": { source: "iana" },
  "application/vnd.apache.thrift.compact": { source: "iana" },
  "application/vnd.apache.thrift.json": { source: "iana" },
  "application/vnd.apexlang": { source: "iana" },
  "application/vnd.api+json": { source: "iana", compressible: !0 },
  "application/vnd.aplextor.warrp+json": { source: "iana", compressible: !0 },
  "application/vnd.apothekende.reservation+json": { source: "iana", compressible: !0 },
  "application/vnd.apple.installer+xml": { source: "iana", compressible: !0, extensions: ["mpkg"] },
  "application/vnd.apple.keynote": { source: "iana", extensions: ["key"] },
  "application/vnd.apple.mpegurl": { source: "iana", extensions: ["m3u8"] },
  "application/vnd.apple.numbers": { source: "iana", extensions: ["numbers"] },
  "application/vnd.apple.pages": { source: "iana", extensions: ["pages"] },
  "application/vnd.apple.pkpass": { compressible: !1, extensions: ["pkpass"] },
  "application/vnd.arastra.swi": { source: "apache" },
  "application/vnd.aristanetworks.swi": { source: "iana", extensions: ["swi"] },
  "application/vnd.artisan+json": { source: "iana", compressible: !0 },
  "application/vnd.artsquare": { source: "iana" },
  "application/vnd.astraea-software.iota": { source: "iana", extensions: ["iota"] },
  "application/vnd.audiograph": { source: "iana", extensions: ["aep"] },
  "application/vnd.autodesk.fbx": { extensions: ["fbx"] },
  "application/vnd.autopackage": { source: "iana" },
  "application/vnd.avalon+json": { source: "iana", compressible: !0 },
  "application/vnd.avistar+xml": { source: "iana", compressible: !0 },
  "application/vnd.balsamiq.bmml+xml": { source: "iana", compressible: !0, extensions: ["bmml"] },
  "application/vnd.balsamiq.bmpr": { source: "iana" },
  "application/vnd.banana-accounting": { source: "iana" },
  "application/vnd.bbf.usp.error": { source: "iana" },
  "application/vnd.bbf.usp.msg": { source: "iana" },
  "application/vnd.bbf.usp.msg+json": { source: "iana", compressible: !0 },
  "application/vnd.bekitzur-stech+json": { source: "iana", compressible: !0 },
  "application/vnd.belightsoft.lhzd+zip": { source: "iana", compressible: !1 },
  "application/vnd.belightsoft.lhzl+zip": { source: "iana", compressible: !1 },
  "application/vnd.bint.med-content": { source: "iana" },
  "application/vnd.biopax.rdf+xml": { source: "iana", compressible: !0 },
  "application/vnd.blink-idb-value-wrapper": { source: "iana" },
  "application/vnd.blueice.multipass": { source: "iana", extensions: ["mpm"] },
  "application/vnd.bluetooth.ep.oob": { source: "iana" },
  "application/vnd.bluetooth.le.oob": { source: "iana" },
  "application/vnd.bmi": { source: "iana", extensions: ["bmi"] },
  "application/vnd.bpf": { source: "iana" },
  "application/vnd.bpf3": { source: "iana" },
  "application/vnd.businessobjects": { source: "iana", extensions: ["rep"] },
  "application/vnd.byu.uapi+json": { source: "iana", compressible: !0 },
  "application/vnd.bzip3": { source: "iana" },
  "application/vnd.c3voc.schedule+xml": { source: "iana", compressible: !0 },
  "application/vnd.cab-jscript": { source: "iana" },
  "application/vnd.canon-cpdl": { source: "iana" },
  "application/vnd.canon-lips": { source: "iana" },
  "application/vnd.capasystems-pg+json": { source: "iana", compressible: !0 },
  "application/vnd.cendio.thinlinc.clientconf": { source: "iana" },
  "application/vnd.century-systems.tcp_stream": { source: "iana" },
  "application/vnd.chemdraw+xml": { source: "iana", compressible: !0, extensions: ["cdxml"] },
  "application/vnd.chess-pgn": { source: "iana" },
  "application/vnd.chipnuts.karaoke-mmd": { source: "iana", extensions: ["mmd"] },
  "application/vnd.ciedi": { source: "iana" },
  "application/vnd.cinderella": { source: "iana", extensions: ["cdy"] },
  "application/vnd.cirpack.isdn-ext": { source: "iana" },
  "application/vnd.citationstyles.style+xml": { source: "iana", compressible: !0, extensions: ["csl"] },
  "application/vnd.claymore": { source: "iana", extensions: ["cla"] },
  "application/vnd.cloanto.rp9": { source: "iana", extensions: ["rp9"] },
  "application/vnd.clonk.c4group": { source: "iana", extensions: ["c4g", "c4d", "c4f", "c4p", "c4u"] },
  "application/vnd.cluetrust.cartomobile-config": { source: "iana", extensions: ["c11amc"] },
  "application/vnd.cluetrust.cartomobile-config-pkg": { source: "iana", extensions: ["c11amz"] },
  "application/vnd.cncf.helm.chart.content.v1.tar+gzip": { source: "iana" },
  "application/vnd.cncf.helm.chart.provenance.v1.prov": { source: "iana" },
  "application/vnd.cncf.helm.config.v1+json": { source: "iana", compressible: !0 },
  "application/vnd.coffeescript": { source: "iana" },
  "application/vnd.collabio.xodocuments.document": { source: "iana" },
  "application/vnd.collabio.xodocuments.document-template": { source: "iana" },
  "application/vnd.collabio.xodocuments.presentation": { source: "iana" },
  "application/vnd.collabio.xodocuments.presentation-template": { source: "iana" },
  "application/vnd.collabio.xodocuments.spreadsheet": { source: "iana" },
  "application/vnd.collabio.xodocuments.spreadsheet-template": { source: "iana" },
  "application/vnd.collection+json": { source: "iana", compressible: !0 },
  "application/vnd.collection.doc+json": { source: "iana", compressible: !0 },
  "application/vnd.collection.next+json": { source: "iana", compressible: !0 },
  "application/vnd.comicbook+zip": { source: "iana", compressible: !1 },
  "application/vnd.comicbook-rar": { source: "iana" },
  "application/vnd.commerce-battelle": { source: "iana" },
  "application/vnd.commonspace": { source: "iana", extensions: ["csp"] },
  "application/vnd.contact.cmsg": { source: "iana", extensions: ["cdbcmsg"] },
  "application/vnd.coreos.ignition+json": { source: "iana", compressible: !0 },
  "application/vnd.cosmocaller": { source: "iana", extensions: ["cmc"] },
  "application/vnd.crick.clicker": { source: "iana", extensions: ["clkx"] },
  "application/vnd.crick.clicker.keyboard": { source: "iana", extensions: ["clkk"] },
  "application/vnd.crick.clicker.palette": { source: "iana", extensions: ["clkp"] },
  "application/vnd.crick.clicker.template": { source: "iana", extensions: ["clkt"] },
  "application/vnd.crick.clicker.wordbank": { source: "iana", extensions: ["clkw"] },
  "application/vnd.criticaltools.wbs+xml": { source: "iana", compressible: !0, extensions: ["wbs"] },
  "application/vnd.cryptii.pipe+json": { source: "iana", compressible: !0 },
  "application/vnd.crypto-shade-file": { source: "iana" },
  "application/vnd.cryptomator.encrypted": { source: "iana" },
  "application/vnd.cryptomator.vault": { source: "iana" },
  "application/vnd.ctc-posml": { source: "iana", extensions: ["pml"] },
  "application/vnd.ctct.ws+xml": { source: "iana", compressible: !0 },
  "application/vnd.cups-pdf": { source: "iana" },
  "application/vnd.cups-postscript": { source: "iana" },
  "application/vnd.cups-ppd": { source: "iana", extensions: ["ppd"] },
  "application/vnd.cups-raster": { source: "iana" },
  "application/vnd.cups-raw": { source: "iana" },
  "application/vnd.curl": { source: "iana" },
  "application/vnd.curl.car": { source: "apache", extensions: ["car"] },
  "application/vnd.curl.pcurl": { source: "apache", extensions: ["pcurl"] },
  "application/vnd.cyan.dean.root+xml": { source: "iana", compressible: !0 },
  "application/vnd.cybank": { source: "iana" },
  "application/vnd.cyclonedx+json": { source: "iana", compressible: !0 },
  "application/vnd.cyclonedx+xml": { source: "iana", compressible: !0 },
  "application/vnd.d2l.coursepackage1p0+zip": { source: "iana", compressible: !1 },
  "application/vnd.d3m-dataset": { source: "iana" },
  "application/vnd.d3m-problem": { source: "iana" },
  "application/vnd.dart": { source: "iana", compressible: !0, extensions: ["dart"] },
  "application/vnd.data-vision.rdz": { source: "iana", extensions: ["rdz"] },
  "application/vnd.datalog": { source: "iana" },
  "application/vnd.datapackage+json": { source: "iana", compressible: !0 },
  "application/vnd.dataresource+json": { source: "iana", compressible: !0 },
  "application/vnd.dbf": { source: "iana", extensions: ["dbf"] },
  "application/vnd.dcmp+xml": { source: "iana", compressible: !0, extensions: ["dcmp"] },
  "application/vnd.debian.binary-package": { source: "iana" },
  "application/vnd.dece.data": { source: "iana", extensions: ["uvf", "uvvf", "uvd", "uvvd"] },
  "application/vnd.dece.ttml+xml": { source: "iana", compressible: !0, extensions: ["uvt", "uvvt"] },
  "application/vnd.dece.unspecified": { source: "iana", extensions: ["uvx", "uvvx"] },
  "application/vnd.dece.zip": { source: "iana", extensions: ["uvz", "uvvz"] },
  "application/vnd.denovo.fcselayout-link": { source: "iana", extensions: ["fe_launch"] },
  "application/vnd.desmume.movie": { source: "iana" },
  "application/vnd.dir-bi.plate-dl-nosuffix": { source: "iana" },
  "application/vnd.dm.delegation+xml": { source: "iana", compressible: !0 },
  "application/vnd.dna": { source: "iana", extensions: ["dna"] },
  "application/vnd.document+json": { source: "iana", compressible: !0 },
  "application/vnd.dolby.mlp": { source: "apache", extensions: ["mlp"] },
  "application/vnd.dolby.mobile.1": { source: "iana" },
  "application/vnd.dolby.mobile.2": { source: "iana" },
  "application/vnd.doremir.scorecloud-binary-document": { source: "iana" },
  "application/vnd.dpgraph": { source: "iana", extensions: ["dpg"] },
  "application/vnd.dreamfactory": { source: "iana", extensions: ["dfac"] },
  "application/vnd.drive+json": { source: "iana", compressible: !0 },
  "application/vnd.ds-keypoint": { source: "apache", extensions: ["kpxx"] },
  "application/vnd.dtg.local": { source: "iana" },
  "application/vnd.dtg.local.flash": { source: "iana" },
  "application/vnd.dtg.local.html": { source: "iana" },
  "application/vnd.dvb.ait": { source: "iana", extensions: ["ait"] },
  "application/vnd.dvb.dvbisl+xml": { source: "iana", compressible: !0 },
  "application/vnd.dvb.dvbj": { source: "iana" },
  "application/vnd.dvb.esgcontainer": { source: "iana" },
  "application/vnd.dvb.ipdcdftnotifaccess": { source: "iana" },
  "application/vnd.dvb.ipdcesgaccess": { source: "iana" },
  "application/vnd.dvb.ipdcesgaccess2": { source: "iana" },
  "application/vnd.dvb.ipdcesgpdd": { source: "iana" },
  "application/vnd.dvb.ipdcroaming": { source: "iana" },
  "application/vnd.dvb.iptv.alfec-base": { source: "iana" },
  "application/vnd.dvb.iptv.alfec-enhancement": { source: "iana" },
  "application/vnd.dvb.notif-aggregate-root+xml": { source: "iana", compressible: !0 },
  "application/vnd.dvb.notif-container+xml": { source: "iana", compressible: !0 },
  "application/vnd.dvb.notif-generic+xml": { source: "iana", compressible: !0 },
  "application/vnd.dvb.notif-ia-msglist+xml": { source: "iana", compressible: !0 },
  "application/vnd.dvb.notif-ia-registration-request+xml": { source: "iana", compressible: !0 },
  "application/vnd.dvb.notif-ia-registration-response+xml": { source: "iana", compressible: !0 },
  "application/vnd.dvb.notif-init+xml": { source: "iana", compressible: !0 },
  "application/vnd.dvb.pfr": { source: "iana" },
  "application/vnd.dvb.service": { source: "iana", extensions: ["svc"] },
  "application/vnd.dxr": { source: "iana" },
  "application/vnd.dynageo": { source: "iana", extensions: ["geo"] },
  "application/vnd.dzr": { source: "iana" },
  "application/vnd.easykaraoke.cdgdownload": { source: "iana" },
  "application/vnd.ecdis-update": { source: "iana" },
  "application/vnd.ecip.rlp": { source: "iana" },
  "application/vnd.eclipse.ditto+json": { source: "iana", compressible: !0 },
  "application/vnd.ecowin.chart": { source: "iana", extensions: ["mag"] },
  "application/vnd.ecowin.filerequest": { source: "iana" },
  "application/vnd.ecowin.fileupdate": { source: "iana" },
  "application/vnd.ecowin.series": { source: "iana" },
  "application/vnd.ecowin.seriesrequest": { source: "iana" },
  "application/vnd.ecowin.seriesupdate": { source: "iana" },
  "application/vnd.efi.img": { source: "iana" },
  "application/vnd.efi.iso": { source: "iana" },
  "application/vnd.eln+zip": { source: "iana", compressible: !1 },
  "application/vnd.emclient.accessrequest+xml": { source: "iana", compressible: !0 },
  "application/vnd.enliven": { source: "iana", extensions: ["nml"] },
  "application/vnd.enphase.envoy": { source: "iana" },
  "application/vnd.eprints.data+xml": { source: "iana", compressible: !0 },
  "application/vnd.epson.esf": { source: "iana", extensions: ["esf"] },
  "application/vnd.epson.msf": { source: "iana", extensions: ["msf"] },
  "application/vnd.epson.quickanime": { source: "iana", extensions: ["qam"] },
  "application/vnd.epson.salt": { source: "iana", extensions: ["slt"] },
  "application/vnd.epson.ssf": { source: "iana", extensions: ["ssf"] },
  "application/vnd.ericsson.quickcall": { source: "iana" },
  "application/vnd.erofs": { source: "iana" },
  "application/vnd.espass-espass+zip": { source: "iana", compressible: !1 },
  "application/vnd.eszigno3+xml": { source: "iana", compressible: !0, extensions: ["es3", "et3"] },
  "application/vnd.etsi.aoc+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.asic-e+zip": { source: "iana", compressible: !1 },
  "application/vnd.etsi.asic-s+zip": { source: "iana", compressible: !1 },
  "application/vnd.etsi.cug+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.iptvcommand+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.iptvdiscovery+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.iptvprofile+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.iptvsad-bc+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.iptvsad-cod+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.iptvsad-npvr+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.iptvservice+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.iptvsync+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.iptvueprofile+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.mcid+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.mheg5": { source: "iana" },
  "application/vnd.etsi.overload-control-policy-dataset+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.pstn+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.sci+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.simservs+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.timestamp-token": { source: "iana" },
  "application/vnd.etsi.tsl+xml": { source: "iana", compressible: !0 },
  "application/vnd.etsi.tsl.der": { source: "iana" },
  "application/vnd.eu.kasparian.car+json": { source: "iana", compressible: !0 },
  "application/vnd.eudora.data": { source: "iana" },
  "application/vnd.evolv.ecig.profile": { source: "iana" },
  "application/vnd.evolv.ecig.settings": { source: "iana" },
  "application/vnd.evolv.ecig.theme": { source: "iana" },
  "application/vnd.exstream-empower+zip": { source: "iana", compressible: !1 },
  "application/vnd.exstream-package": { source: "iana" },
  "application/vnd.ezpix-album": { source: "iana", extensions: ["ez2"] },
  "application/vnd.ezpix-package": { source: "iana", extensions: ["ez3"] },
  "application/vnd.f-secure.mobile": { source: "iana" },
  "application/vnd.familysearch.gedcom+zip": { source: "iana", compressible: !1 },
  "application/vnd.fastcopy-disk-image": { source: "iana" },
  "application/vnd.fdf": { source: "apache", extensions: ["fdf"] },
  "application/vnd.fdsn.mseed": { source: "iana", extensions: ["mseed"] },
  "application/vnd.fdsn.seed": { source: "iana", extensions: ["seed", "dataless"] },
  "application/vnd.fdsn.stationxml+xml": { source: "iana", charset: "XML-BASED", compressible: !0 },
  "application/vnd.ffsns": { source: "iana" },
  "application/vnd.ficlab.flb+zip": { source: "iana", compressible: !1 },
  "application/vnd.filmit.zfc": { source: "iana" },
  "application/vnd.fints": { source: "iana" },
  "application/vnd.firemonkeys.cloudcell": { source: "iana" },
  "application/vnd.flographit": { source: "iana", extensions: ["gph"] },
  "application/vnd.fluxtime.clip": { source: "iana", extensions: ["ftc"] },
  "application/vnd.font-fontforge-sfd": { source: "iana" },
  "application/vnd.framemaker": { source: "iana", extensions: ["fm", "frame", "maker", "book"] },
  "application/vnd.freelog.comic": { source: "iana" },
  "application/vnd.frogans.fnc": { source: "apache", extensions: ["fnc"] },
  "application/vnd.frogans.ltf": { source: "apache", extensions: ["ltf"] },
  "application/vnd.fsc.weblaunch": { source: "iana", extensions: ["fsc"] },
  "application/vnd.fujifilm.fb.docuworks": { source: "iana" },
  "application/vnd.fujifilm.fb.docuworks.binder": { source: "iana" },
  "application/vnd.fujifilm.fb.docuworks.container": { source: "iana" },
  "application/vnd.fujifilm.fb.jfi+xml": { source: "iana", compressible: !0 },
  "application/vnd.fujitsu.oasys": { source: "iana", extensions: ["oas"] },
  "application/vnd.fujitsu.oasys2": { source: "iana", extensions: ["oa2"] },
  "application/vnd.fujitsu.oasys3": { source: "iana", extensions: ["oa3"] },
  "application/vnd.fujitsu.oasysgp": { source: "iana", extensions: ["fg5"] },
  "application/vnd.fujitsu.oasysprs": { source: "iana", extensions: ["bh2"] },
  "application/vnd.fujixerox.art-ex": { source: "iana" },
  "application/vnd.fujixerox.art4": { source: "iana" },
  "application/vnd.fujixerox.ddd": { source: "iana", extensions: ["ddd"] },
  "application/vnd.fujixerox.docuworks": { source: "iana", extensions: ["xdw"] },
  "application/vnd.fujixerox.docuworks.binder": { source: "iana", extensions: ["xbd"] },
  "application/vnd.fujixerox.docuworks.container": { source: "iana" },
  "application/vnd.fujixerox.hbpl": { source: "iana" },
  "application/vnd.fut-misnet": { source: "iana" },
  "application/vnd.futoin+cbor": { source: "iana" },
  "application/vnd.futoin+json": { source: "iana", compressible: !0 },
  "application/vnd.fuzzysheet": { source: "iana", extensions: ["fzs"] },
  "application/vnd.ga4gh.passport+jwt": { source: "iana" },
  "application/vnd.genomatix.tuxedo": { source: "iana", extensions: ["txd"] },
  "application/vnd.genozip": { source: "iana" },
  "application/vnd.gentics.grd+json": { source: "iana", compressible: !0 },
  "application/vnd.gentoo.catmetadata+xml": { source: "iana", compressible: !0 },
  "application/vnd.gentoo.ebuild": { source: "iana" },
  "application/vnd.gentoo.eclass": { source: "iana" },
  "application/vnd.gentoo.gpkg": { source: "iana" },
  "application/vnd.gentoo.manifest": { source: "iana" },
  "application/vnd.gentoo.pkgmetadata+xml": { source: "iana", compressible: !0 },
  "application/vnd.gentoo.xpak": { source: "iana" },
  "application/vnd.geo+json": { source: "apache", compressible: !0 },
  "application/vnd.geocube+xml": { source: "apache", compressible: !0 },
  "application/vnd.geogebra.file": { source: "iana", extensions: ["ggb"] },
  "application/vnd.geogebra.pinboard": { source: "iana" },
  "application/vnd.geogebra.slides": { source: "iana", extensions: ["ggs"] },
  "application/vnd.geogebra.tool": { source: "iana", extensions: ["ggt"] },
  "application/vnd.geometry-explorer": { source: "iana", extensions: ["gex", "gre"] },
  "application/vnd.geonext": { source: "iana", extensions: ["gxt"] },
  "application/vnd.geoplan": { source: "iana", extensions: ["g2w"] },
  "application/vnd.geospace": { source: "iana", extensions: ["g3w"] },
  "application/vnd.gerber": { source: "iana" },
  "application/vnd.globalplatform.card-content-mgt": { source: "iana" },
  "application/vnd.globalplatform.card-content-mgt-response": { source: "iana" },
  "application/vnd.gmx": { source: "iana", extensions: ["gmx"] },
  "application/vnd.gnu.taler.exchange+json": { source: "iana", compressible: !0 },
  "application/vnd.gnu.taler.merchant+json": { source: "iana", compressible: !0 },
  "application/vnd.google-apps.audio": {},
  "application/vnd.google-apps.document": { compressible: !1, extensions: ["gdoc"] },
  "application/vnd.google-apps.drawing": { compressible: !1, extensions: ["gdraw"] },
  "application/vnd.google-apps.drive-sdk": { compressible: !1 },
  "application/vnd.google-apps.file": {},
  "application/vnd.google-apps.folder": { compressible: !1 },
  "application/vnd.google-apps.form": { compressible: !1, extensions: ["gform"] },
  "application/vnd.google-apps.fusiontable": {},
  "application/vnd.google-apps.jam": { compressible: !1, extensions: ["gjam"] },
  "application/vnd.google-apps.mail-layout": {},
  "application/vnd.google-apps.map": { compressible: !1, extensions: ["gmap"] },
  "application/vnd.google-apps.photo": {},
  "application/vnd.google-apps.presentation": { compressible: !1, extensions: ["gslides"] },
  "application/vnd.google-apps.script": { compressible: !1, extensions: ["gscript"] },
  "application/vnd.google-apps.shortcut": {},
  "application/vnd.google-apps.site": { compressible: !1, extensions: ["gsite"] },
  "application/vnd.google-apps.spreadsheet": { compressible: !1, extensions: ["gsheet"] },
  "application/vnd.google-apps.unknown": {},
  "application/vnd.google-apps.video": {},
  "application/vnd.google-earth.kml+xml": { source: "iana", compressible: !0, extensions: ["kml"] },
  "application/vnd.google-earth.kmz": { source: "iana", compressible: !1, extensions: ["kmz"] },
  "application/vnd.gov.sk.e-form+xml": { source: "apache", compressible: !0 },
  "application/vnd.gov.sk.e-form+zip": { source: "iana", compressible: !1 },
  "application/vnd.gov.sk.xmldatacontainer+xml": { source: "iana", compressible: !0, extensions: ["xdcf"] },
  "application/vnd.gpxsee.map+xml": { source: "iana", compressible: !0 },
  "application/vnd.grafeq": { source: "iana", extensions: ["gqf", "gqs"] },
  "application/vnd.gridmp": { source: "iana" },
  "application/vnd.groove-account": { source: "iana", extensions: ["gac"] },
  "application/vnd.groove-help": { source: "iana", extensions: ["ghf"] },
  "application/vnd.groove-identity-message": { source: "iana", extensions: ["gim"] },
  "application/vnd.groove-injector": { source: "iana", extensions: ["grv"] },
  "application/vnd.groove-tool-message": { source: "iana", extensions: ["gtm"] },
  "application/vnd.groove-tool-template": { source: "iana", extensions: ["tpl"] },
  "application/vnd.groove-vcard": { source: "iana", extensions: ["vcg"] },
  "application/vnd.hal+json": { source: "iana", compressible: !0 },
  "application/vnd.hal+xml": { source: "iana", compressible: !0, extensions: ["hal"] },
  "application/vnd.handheld-entertainment+xml": { source: "iana", compressible: !0, extensions: ["zmm"] },
  "application/vnd.hbci": { source: "iana", extensions: ["hbci"] },
  "application/vnd.hc+json": { source: "iana", compressible: !0 },
  "application/vnd.hcl-bireports": { source: "iana" },
  "application/vnd.hdt": { source: "iana" },
  "application/vnd.heroku+json": { source: "iana", compressible: !0 },
  "application/vnd.hhe.lesson-player": { source: "iana", extensions: ["les"] },
  "application/vnd.hp-hpgl": { source: "iana", extensions: ["hpgl"] },
  "application/vnd.hp-hpid": { source: "iana", extensions: ["hpid"] },
  "application/vnd.hp-hps": { source: "iana", extensions: ["hps"] },
  "application/vnd.hp-jlyt": { source: "iana", extensions: ["jlt"] },
  "application/vnd.hp-pcl": { source: "iana", extensions: ["pcl"] },
  "application/vnd.hp-pclxl": { source: "iana", extensions: ["pclxl"] },
  "application/vnd.hsl": { source: "iana" },
  "application/vnd.httphone": { source: "iana" },
  "application/vnd.hydrostatix.sof-data": { source: "iana", extensions: ["sfd-hdstx"] },
  "application/vnd.hyper+json": { source: "iana", compressible: !0 },
  "application/vnd.hyper-item+json": { source: "iana", compressible: !0 },
  "application/vnd.hyperdrive+json": { source: "iana", compressible: !0 },
  "application/vnd.hzn-3d-crossword": { source: "iana" },
  "application/vnd.ibm.afplinedata": { source: "apache" },
  "application/vnd.ibm.electronic-media": { source: "iana" },
  "application/vnd.ibm.minipay": { source: "iana", extensions: ["mpy"] },
  "application/vnd.ibm.modcap": { source: "apache", extensions: ["afp", "listafp", "list3820"] },
  "application/vnd.ibm.rights-management": { source: "iana", extensions: ["irm"] },
  "application/vnd.ibm.secure-container": { source: "iana", extensions: ["sc"] },
  "application/vnd.iccprofile": { source: "iana", extensions: ["icc", "icm"] },
  "application/vnd.ieee.1905": { source: "iana" },
  "application/vnd.igloader": { source: "iana", extensions: ["igl"] },
  "application/vnd.imagemeter.folder+zip": { source: "iana", compressible: !1 },
  "application/vnd.imagemeter.image+zip": { source: "iana", compressible: !1 },
  "application/vnd.immervision-ivp": { source: "iana", extensions: ["ivp"] },
  "application/vnd.immervision-ivu": { source: "iana", extensions: ["ivu"] },
  "application/vnd.ims.imsccv1p1": { source: "iana" },
  "application/vnd.ims.imsccv1p2": { source: "iana" },
  "application/vnd.ims.imsccv1p3": { source: "iana" },
  "application/vnd.ims.lis.v2.result+json": { source: "iana", compressible: !0 },
  "application/vnd.ims.lti.v2.toolconsumerprofile+json": { source: "iana", compressible: !0 },
  "application/vnd.ims.lti.v2.toolproxy+json": { source: "iana", compressible: !0 },
  "application/vnd.ims.lti.v2.toolproxy.id+json": { source: "iana", compressible: !0 },
  "application/vnd.ims.lti.v2.toolsettings+json": { source: "iana", compressible: !0 },
  "application/vnd.ims.lti.v2.toolsettings.simple+json": { source: "iana", compressible: !0 },
  "application/vnd.informedcontrol.rms+xml": { source: "iana", compressible: !0 },
  "application/vnd.informix-visionary": { source: "apache" },
  "application/vnd.infotech.project": { source: "iana" },
  "application/vnd.infotech.project+xml": { source: "iana", compressible: !0 },
  "application/vnd.innopath.wamp.notification": { source: "iana" },
  "application/vnd.insors.igm": { source: "iana", extensions: ["igm"] },
  "application/vnd.intercon.formnet": { source: "iana", extensions: ["xpw", "xpx"] },
  "application/vnd.intergeo": { source: "iana", extensions: ["i2g"] },
  "application/vnd.intertrust.digibox": { source: "iana" },
  "application/vnd.intertrust.nncp": { source: "iana" },
  "application/vnd.intu.qbo": { source: "iana", extensions: ["qbo"] },
  "application/vnd.intu.qfx": { source: "iana", extensions: ["qfx"] },
  "application/vnd.ipfs.ipns-record": { source: "iana" },
  "application/vnd.ipld.car": { source: "iana" },
  "application/vnd.ipld.dag-cbor": { source: "iana" },
  "application/vnd.ipld.dag-json": { source: "iana" },
  "application/vnd.ipld.raw": { source: "iana" },
  "application/vnd.iptc.g2.catalogitem+xml": { source: "iana", compressible: !0 },
  "application/vnd.iptc.g2.conceptitem+xml": { source: "iana", compressible: !0 },
  "application/vnd.iptc.g2.knowledgeitem+xml": { source: "iana", compressible: !0 },
  "application/vnd.iptc.g2.newsitem+xml": { source: "iana", compressible: !0 },
  "application/vnd.iptc.g2.newsmessage+xml": { source: "iana", compressible: !0 },
  "application/vnd.iptc.g2.packageitem+xml": { source: "iana", compressible: !0 },
  "application/vnd.iptc.g2.planningitem+xml": { source: "iana", compressible: !0 },
  "application/vnd.ipunplugged.rcprofile": { source: "iana", extensions: ["rcprofile"] },
  "application/vnd.irepository.package+xml": { source: "iana", compressible: !0, extensions: ["irp"] },
  "application/vnd.is-xpr": { source: "iana", extensions: ["xpr"] },
  "application/vnd.isac.fcs": { source: "iana", extensions: ["fcs"] },
  "application/vnd.iso11783-10+zip": { source: "iana", compressible: !1 },
  "application/vnd.jam": { source: "iana", extensions: ["jam"] },
  "application/vnd.japannet-directory-service": { source: "iana" },
  "application/vnd.japannet-jpnstore-wakeup": { source: "iana" },
  "application/vnd.japannet-payment-wakeup": { source: "iana" },
  "application/vnd.japannet-registration": { source: "iana" },
  "application/vnd.japannet-registration-wakeup": { source: "iana" },
  "application/vnd.japannet-setstore-wakeup": { source: "iana" },
  "application/vnd.japannet-verification": { source: "iana" },
  "application/vnd.japannet-verification-wakeup": { source: "iana" },
  "application/vnd.jcp.javame.midlet-rms": { source: "iana", extensions: ["rms"] },
  "application/vnd.jisp": { source: "iana", extensions: ["jisp"] },
  "application/vnd.joost.joda-archive": { source: "iana", extensions: ["joda"] },
  "application/vnd.jsk.isdn-ngn": { source: "iana" },
  "application/vnd.kahootz": { source: "iana", extensions: ["ktz", "ktr"] },
  "application/vnd.kde.karbon": { source: "iana", extensions: ["karbon"] },
  "application/vnd.kde.kchart": { source: "iana", extensions: ["chrt"] },
  "application/vnd.kde.kformula": { source: "iana", extensions: ["kfo"] },
  "application/vnd.kde.kivio": { source: "iana", extensions: ["flw"] },
  "application/vnd.kde.kontour": { source: "iana", extensions: ["kon"] },
  "application/vnd.kde.kpresenter": { source: "iana", extensions: ["kpr", "kpt"] },
  "application/vnd.kde.kspread": { source: "iana", extensions: ["ksp"] },
  "application/vnd.kde.kword": { source: "iana", extensions: ["kwd", "kwt"] },
  "application/vnd.kdl": { source: "iana" },
  "application/vnd.kenameaapp": { source: "iana", extensions: ["htke"] },
  "application/vnd.keyman.kmp+zip": { source: "iana", compressible: !1 },
  "application/vnd.keyman.kmx": { source: "iana" },
  "application/vnd.kidspiration": { source: "iana", extensions: ["kia"] },
  "application/vnd.kinar": { source: "iana", extensions: ["kne", "knp"] },
  "application/vnd.koan": { source: "iana", extensions: ["skp", "skd", "skt", "skm"] },
  "application/vnd.kodak-descriptor": { source: "iana", extensions: ["sse"] },
  "application/vnd.las": { source: "iana" },
  "application/vnd.las.las+json": { source: "iana", compressible: !0 },
  "application/vnd.las.las+xml": { source: "iana", compressible: !0, extensions: ["lasxml"] },
  "application/vnd.laszip": { source: "iana" },
  "application/vnd.ldev.productlicensing": { source: "iana" },
  "application/vnd.leap+json": { source: "iana", compressible: !0 },
  "application/vnd.liberty-request+xml": { source: "iana", compressible: !0 },
  "application/vnd.llamagraphics.life-balance.desktop": { source: "iana", extensions: ["lbd"] },
  "application/vnd.llamagraphics.life-balance.exchange+xml": { source: "iana", compressible: !0, extensions: ["lbe"] },
  "application/vnd.logipipe.circuit+zip": { source: "iana", compressible: !1 },
  "application/vnd.loom": { source: "iana" },
  "application/vnd.lotus-1-2-3": { source: "iana", extensions: ["123"] },
  "application/vnd.lotus-approach": { source: "iana", extensions: ["apr"] },
  "application/vnd.lotus-freelance": { source: "iana", extensions: ["pre"] },
  "application/vnd.lotus-notes": { source: "iana", extensions: ["nsf"] },
  "application/vnd.lotus-organizer": { source: "iana", extensions: ["org"] },
  "application/vnd.lotus-screencam": { source: "iana", extensions: ["scm"] },
  "application/vnd.lotus-wordpro": { source: "iana", extensions: ["lwp"] },
  "application/vnd.macports.portpkg": { source: "iana", extensions: ["portpkg"] },
  "application/vnd.mapbox-vector-tile": { source: "iana", extensions: ["mvt"] },
  "application/vnd.marlin.drm.actiontoken+xml": { source: "iana", compressible: !0 },
  "application/vnd.marlin.drm.conftoken+xml": { source: "iana", compressible: !0 },
  "application/vnd.marlin.drm.license+xml": { source: "iana", compressible: !0 },
  "application/vnd.marlin.drm.mdcf": { source: "iana" },
  "application/vnd.mason+json": { source: "iana", compressible: !0 },
  "application/vnd.maxar.archive.3tz+zip": { source: "iana", compressible: !1 },
  "application/vnd.maxmind.maxmind-db": { source: "iana" },
  "application/vnd.mcd": { source: "iana", extensions: ["mcd"] },
  "application/vnd.mdl": { source: "iana" },
  "application/vnd.mdl-mbsdf": { source: "iana" },
  "application/vnd.medcalcdata": { source: "iana", extensions: ["mc1"] },
  "application/vnd.mediastation.cdkey": { source: "iana", extensions: ["cdkey"] },
  "application/vnd.medicalholodeck.recordxr": { source: "iana" },
  "application/vnd.meridian-slingshot": { source: "iana" },
  "application/vnd.mermaid": { source: "iana" },
  "application/vnd.mfer": { source: "iana", extensions: ["mwf"] },
  "application/vnd.mfmp": { source: "iana", extensions: ["mfm"] },
  "application/vnd.micro+json": { source: "iana", compressible: !0 },
  "application/vnd.micrografx.flo": { source: "iana", extensions: ["flo"] },
  "application/vnd.micrografx.igx": { source: "iana", extensions: ["igx"] },
  "application/vnd.microsoft.portable-executable": { source: "iana" },
  "application/vnd.microsoft.windows.thumbnail-cache": { source: "iana" },
  "application/vnd.miele+json": { source: "iana", compressible: !0 },
  "application/vnd.mif": { source: "iana", extensions: ["mif"] },
  "application/vnd.minisoft-hp3000-save": { source: "iana" },
  "application/vnd.mitsubishi.misty-guard.trustweb": { source: "iana" },
  "application/vnd.mobius.daf": { source: "iana", extensions: ["daf"] },
  "application/vnd.mobius.dis": { source: "iana", extensions: ["dis"] },
  "application/vnd.mobius.mbk": { source: "iana", extensions: ["mbk"] },
  "application/vnd.mobius.mqy": { source: "iana", extensions: ["mqy"] },
  "application/vnd.mobius.msl": { source: "iana", extensions: ["msl"] },
  "application/vnd.mobius.plc": { source: "iana", extensions: ["plc"] },
  "application/vnd.mobius.txf": { source: "iana", extensions: ["txf"] },
  "application/vnd.modl": { source: "iana" },
  "application/vnd.mophun.application": { source: "iana", extensions: ["mpn"] },
  "application/vnd.mophun.certificate": { source: "iana", extensions: ["mpc"] },
  "application/vnd.motorola.flexsuite": { source: "iana" },
  "application/vnd.motorola.flexsuite.adsi": { source: "iana" },
  "application/vnd.motorola.flexsuite.fis": { source: "iana" },
  "application/vnd.motorola.flexsuite.gotap": { source: "iana" },
  "application/vnd.motorola.flexsuite.kmr": { source: "iana" },
  "application/vnd.motorola.flexsuite.ttc": { source: "iana" },
  "application/vnd.motorola.flexsuite.wem": { source: "iana" },
  "application/vnd.motorola.iprm": { source: "iana" },
  "application/vnd.mozilla.xul+xml": { source: "iana", compressible: !0, extensions: ["xul"] },
  "application/vnd.ms-3mfdocument": { source: "iana" },
  "application/vnd.ms-artgalry": { source: "iana", extensions: ["cil"] },
  "application/vnd.ms-asf": { source: "iana" },
  "application/vnd.ms-cab-compressed": { source: "iana", extensions: ["cab"] },
  "application/vnd.ms-color.iccprofile": { source: "apache" },
  "application/vnd.ms-excel": { source: "iana", compressible: !1, extensions: ["xls", "xlm", "xla", "xlc", "xlt", "xlw"] },
  "application/vnd.ms-excel.addin.macroenabled.12": { source: "iana", extensions: ["xlam"] },
  "application/vnd.ms-excel.sheet.binary.macroenabled.12": { source: "iana", extensions: ["xlsb"] },
  "application/vnd.ms-excel.sheet.macroenabled.12": { source: "iana", extensions: ["xlsm"] },
  "application/vnd.ms-excel.template.macroenabled.12": { source: "iana", extensions: ["xltm"] },
  "application/vnd.ms-fontobject": { source: "iana", compressible: !0, extensions: ["eot"] },
  "application/vnd.ms-htmlhelp": { source: "iana", extensions: ["chm"] },
  "application/vnd.ms-ims": { source: "iana", extensions: ["ims"] },
  "application/vnd.ms-lrm": { source: "iana", extensions: ["lrm"] },
  "application/vnd.ms-office.activex+xml": { source: "iana", compressible: !0 },
  "application/vnd.ms-officetheme": { source: "iana", extensions: ["thmx"] },
  "application/vnd.ms-opentype": { source: "apache", compressible: !0 },
  "application/vnd.ms-outlook": { compressible: !1, extensions: ["msg"] },
  "application/vnd.ms-package.obfuscated-opentype": { source: "apache" },
  "application/vnd.ms-pki.seccat": { source: "apache", extensions: ["cat"] },
  "application/vnd.ms-pki.stl": { source: "apache", extensions: ["stl"] },
  "application/vnd.ms-playready.initiator+xml": { source: "iana", compressible: !0 },
  "application/vnd.ms-powerpoint": { source: "iana", compressible: !1, extensions: ["ppt", "pps", "pot"] },
  "application/vnd.ms-powerpoint.addin.macroenabled.12": { source: "iana", extensions: ["ppam"] },
  "application/vnd.ms-powerpoint.presentation.macroenabled.12": { source: "iana", extensions: ["pptm"] },
  "application/vnd.ms-powerpoint.slide.macroenabled.12": { source: "iana", extensions: ["sldm"] },
  "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { source: "iana", extensions: ["ppsm"] },
  "application/vnd.ms-powerpoint.template.macroenabled.12": { source: "iana", extensions: ["potm"] },
  "application/vnd.ms-printdevicecapabilities+xml": { source: "iana", compressible: !0 },
  "application/vnd.ms-printing.printticket+xml": { source: "apache", compressible: !0 },
  "application/vnd.ms-printschematicket+xml": { source: "iana", compressible: !0 },
  "application/vnd.ms-project": { source: "iana", extensions: ["mpp", "mpt"] },
  "application/vnd.ms-tnef": { source: "iana" },
  "application/vnd.ms-visio.viewer": { extensions: ["vdx"] },
  "application/vnd.ms-windows.devicepairing": { source: "iana" },
  "application/vnd.ms-windows.nwprinting.oob": { source: "iana" },
  "application/vnd.ms-windows.printerpairing": { source: "iana" },
  "application/vnd.ms-windows.wsd.oob": { source: "iana" },
  "application/vnd.ms-wmdrm.lic-chlg-req": { source: "iana" },
  "application/vnd.ms-wmdrm.lic-resp": { source: "iana" },
  "application/vnd.ms-wmdrm.meter-chlg-req": { source: "iana" },
  "application/vnd.ms-wmdrm.meter-resp": { source: "iana" },
  "application/vnd.ms-word.document.macroenabled.12": { source: "iana", extensions: ["docm"] },
  "application/vnd.ms-word.template.macroenabled.12": { source: "iana", extensions: ["dotm"] },
  "application/vnd.ms-works": { source: "iana", extensions: ["wps", "wks", "wcm", "wdb"] },
  "application/vnd.ms-wpl": { source: "iana", extensions: ["wpl"] },
  "application/vnd.ms-xpsdocument": { source: "iana", compressible: !1, extensions: ["xps"] },
  "application/vnd.msa-disk-image": { source: "iana" },
  "application/vnd.mseq": { source: "iana", extensions: ["mseq"] },
  "application/vnd.msgpack": { source: "iana" },
  "application/vnd.msign": { source: "iana" },
  "application/vnd.multiad.creator": { source: "iana" },
  "application/vnd.multiad.creator.cif": { source: "iana" },
  "application/vnd.music-niff": { source: "iana" },
  "application/vnd.musician": { source: "iana", extensions: ["mus"] },
  "application/vnd.muvee.style": { source: "iana", extensions: ["msty"] },
  "application/vnd.mynfc": { source: "iana", extensions: ["taglet"] },
  "application/vnd.nacamar.ybrid+json": { source: "iana", compressible: !0 },
  "application/vnd.nato.bindingdataobject+cbor": { source: "iana" },
  "application/vnd.nato.bindingdataobject+json": { source: "iana", compressible: !0 },
  "application/vnd.nato.bindingdataobject+xml": { source: "iana", compressible: !0, extensions: ["bdo"] },
  "application/vnd.nato.openxmlformats-package.iepd+zip": { source: "iana", compressible: !1 },
  "application/vnd.ncd.control": { source: "iana" },
  "application/vnd.ncd.reference": { source: "iana" },
  "application/vnd.nearst.inv+json": { source: "iana", compressible: !0 },
  "application/vnd.nebumind.line": { source: "iana" },
  "application/vnd.nervana": { source: "iana" },
  "application/vnd.netfpx": { source: "iana" },
  "application/vnd.neurolanguage.nlu": { source: "iana", extensions: ["nlu"] },
  "application/vnd.nimn": { source: "iana" },
  "application/vnd.nintendo.nitro.rom": { source: "iana" },
  "application/vnd.nintendo.snes.rom": { source: "iana" },
  "application/vnd.nitf": { source: "iana", extensions: ["ntf", "nitf"] },
  "application/vnd.noblenet-directory": { source: "iana", extensions: ["nnd"] },
  "application/vnd.noblenet-sealer": { source: "iana", extensions: ["nns"] },
  "application/vnd.noblenet-web": { source: "iana", extensions: ["nnw"] },
  "application/vnd.nokia.catalogs": { source: "iana" },
  "application/vnd.nokia.conml+wbxml": { source: "iana" },
  "application/vnd.nokia.conml+xml": { source: "iana", compressible: !0 },
  "application/vnd.nokia.iptv.config+xml": { source: "iana", compressible: !0 },
  "application/vnd.nokia.isds-radio-presets": { source: "iana" },
  "application/vnd.nokia.landmark+wbxml": { source: "iana" },
  "application/vnd.nokia.landmark+xml": { source: "iana", compressible: !0 },
  "application/vnd.nokia.landmarkcollection+xml": { source: "iana", compressible: !0 },
  "application/vnd.nokia.n-gage.ac+xml": { source: "iana", compressible: !0, extensions: ["ac"] },
  "application/vnd.nokia.n-gage.data": { source: "iana", extensions: ["ngdat"] },
  "application/vnd.nokia.n-gage.symbian.install": { source: "apache", extensions: ["n-gage"] },
  "application/vnd.nokia.ncd": { source: "iana" },
  "application/vnd.nokia.pcd+wbxml": { source: "iana" },
  "application/vnd.nokia.pcd+xml": { source: "iana", compressible: !0 },
  "application/vnd.nokia.radio-preset": { source: "iana", extensions: ["rpst"] },
  "application/vnd.nokia.radio-presets": { source: "iana", extensions: ["rpss"] },
  "application/vnd.novadigm.edm": { source: "iana", extensions: ["edm"] },
  "application/vnd.novadigm.edx": { source: "iana", extensions: ["edx"] },
  "application/vnd.novadigm.ext": { source: "iana", extensions: ["ext"] },
  "application/vnd.ntt-local.content-share": { source: "iana" },
  "application/vnd.ntt-local.file-transfer": { source: "iana" },
  "application/vnd.ntt-local.ogw_remote-access": { source: "iana" },
  "application/vnd.ntt-local.sip-ta_remote": { source: "iana" },
  "application/vnd.ntt-local.sip-ta_tcp_stream": { source: "iana" },
  "application/vnd.oai.workflows": { source: "iana" },
  "application/vnd.oai.workflows+json": { source: "iana", compressible: !0 },
  "application/vnd.oai.workflows+yaml": { source: "iana" },
  "application/vnd.oasis.opendocument.base": { source: "iana" },
  "application/vnd.oasis.opendocument.chart": { source: "iana", extensions: ["odc"] },
  "application/vnd.oasis.opendocument.chart-template": { source: "iana", extensions: ["otc"] },
  "application/vnd.oasis.opendocument.database": { source: "apache", extensions: ["odb"] },
  "application/vnd.oasis.opendocument.formula": { source: "iana", extensions: ["odf"] },
  "application/vnd.oasis.opendocument.formula-template": { source: "iana", extensions: ["odft"] },
  "application/vnd.oasis.opendocument.graphics": { source: "iana", compressible: !1, extensions: ["odg"] },
  "application/vnd.oasis.opendocument.graphics-template": { source: "iana", extensions: ["otg"] },
  "application/vnd.oasis.opendocument.image": { source: "iana", extensions: ["odi"] },
  "application/vnd.oasis.opendocument.image-template": { source: "iana", extensions: ["oti"] },
  "application/vnd.oasis.opendocument.presentation": { source: "iana", compressible: !1, extensions: ["odp"] },
  "application/vnd.oasis.opendocument.presentation-template": { source: "iana", extensions: ["otp"] },
  "application/vnd.oasis.opendocument.spreadsheet": { source: "iana", compressible: !1, extensions: ["ods"] },
  "application/vnd.oasis.opendocument.spreadsheet-template": { source: "iana", extensions: ["ots"] },
  "application/vnd.oasis.opendocument.text": { source: "iana", compressible: !1, extensions: ["odt"] },
  "application/vnd.oasis.opendocument.text-master": { source: "iana", extensions: ["odm"] },
  "application/vnd.oasis.opendocument.text-master-template": { source: "iana" },
  "application/vnd.oasis.opendocument.text-template": { source: "iana", extensions: ["ott"] },
  "application/vnd.oasis.opendocument.text-web": { source: "iana", extensions: ["oth"] },
  "application/vnd.obn": { source: "iana" },
  "application/vnd.ocf+cbor": { source: "iana" },
  "application/vnd.oci.image.manifest.v1+json": { source: "iana", compressible: !0 },
  "application/vnd.oftn.l10n+json": { source: "iana", compressible: !0 },
  "application/vnd.oipf.contentaccessdownload+xml": { source: "iana", compressible: !0 },
  "application/vnd.oipf.contentaccessstreaming+xml": { source: "iana", compressible: !0 },
  "application/vnd.oipf.cspg-hexbinary": { source: "iana" },
  "application/vnd.oipf.dae.svg+xml": { source: "iana", compressible: !0 },
  "application/vnd.oipf.dae.xhtml+xml": { source: "iana", compressible: !0 },
  "application/vnd.oipf.mippvcontrolmessage+xml": { source: "iana", compressible: !0 },
  "application/vnd.oipf.pae.gem": { source: "iana" },
  "application/vnd.oipf.spdiscovery+xml": { source: "iana", compressible: !0 },
  "application/vnd.oipf.spdlist+xml": { source: "iana", compressible: !0 },
  "application/vnd.oipf.ueprofile+xml": { source: "iana", compressible: !0 },
  "application/vnd.oipf.userprofile+xml": { source: "iana", compressible: !0 },
  "application/vnd.olpc-sugar": { source: "iana", extensions: ["xo"] },
  "application/vnd.oma-scws-config": { source: "iana" },
  "application/vnd.oma-scws-http-request": { source: "iana" },
  "application/vnd.oma-scws-http-response": { source: "iana" },
  "application/vnd.oma.bcast.associated-procedure-parameter+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.bcast.drm-trigger+xml": { source: "apache", compressible: !0 },
  "application/vnd.oma.bcast.imd+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.bcast.ltkm": { source: "iana" },
  "application/vnd.oma.bcast.notification+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.bcast.provisioningtrigger": { source: "iana" },
  "application/vnd.oma.bcast.sgboot": { source: "iana" },
  "application/vnd.oma.bcast.sgdd+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.bcast.sgdu": { source: "iana" },
  "application/vnd.oma.bcast.simple-symbol-container": { source: "iana" },
  "application/vnd.oma.bcast.smartcard-trigger+xml": { source: "apache", compressible: !0 },
  "application/vnd.oma.bcast.sprov+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.bcast.stkm": { source: "iana" },
  "application/vnd.oma.cab-address-book+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.cab-feature-handler+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.cab-pcc+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.cab-subs-invite+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.cab-user-prefs+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.dcd": { source: "iana" },
  "application/vnd.oma.dcdc": { source: "iana" },
  "application/vnd.oma.dd2+xml": { source: "iana", compressible: !0, extensions: ["dd2"] },
  "application/vnd.oma.drm.risd+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.group-usage-list+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.lwm2m+cbor": { source: "iana" },
  "application/vnd.oma.lwm2m+json": { source: "iana", compressible: !0 },
  "application/vnd.oma.lwm2m+tlv": { source: "iana" },
  "application/vnd.oma.pal+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.poc.detailed-progress-report+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.poc.final-report+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.poc.groups+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.poc.invocation-descriptor+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.poc.optimized-progress-report+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.push": { source: "iana" },
  "application/vnd.oma.scidm.messages+xml": { source: "iana", compressible: !0 },
  "application/vnd.oma.xcap-directory+xml": { source: "iana", compressible: !0 },
  "application/vnd.omads-email+xml": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/vnd.omads-file+xml": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/vnd.omads-folder+xml": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/vnd.omaloc-supl-init": { source: "iana" },
  "application/vnd.onepager": { source: "iana" },
  "application/vnd.onepagertamp": { source: "iana" },
  "application/vnd.onepagertamx": { source: "iana" },
  "application/vnd.onepagertat": { source: "iana" },
  "application/vnd.onepagertatp": { source: "iana" },
  "application/vnd.onepagertatx": { source: "iana" },
  "application/vnd.onvif.metadata": { source: "iana" },
  "application/vnd.openblox.game+xml": { source: "iana", compressible: !0, extensions: ["obgx"] },
  "application/vnd.openblox.game-binary": { source: "iana" },
  "application/vnd.openeye.oeb": { source: "iana" },
  "application/vnd.openofficeorg.extension": { source: "apache", extensions: ["oxt"] },
  "application/vnd.openstreetmap.data+xml": { source: "iana", compressible: !0, extensions: ["osm"] },
  "application/vnd.opentimestamps.ots": { source: "iana" },
  "application/vnd.openvpi.dspx+json": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.custom-properties+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.drawing+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.extended-properties+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.presentationml.presentation": { source: "iana", compressible: !1, extensions: ["pptx"] },
  "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.presentationml.slide": { source: "iana", extensions: ["sldx"] },
  "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { source: "iana", extensions: ["ppsx"] },
  "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.presentationml.template": { source: "iana", extensions: ["potx"] },
  "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { source: "iana", compressible: !1, extensions: ["xlsx"] },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { source: "iana", extensions: ["xltx"] },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.theme+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.themeoverride+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.vmldrawing": { source: "iana" },
  "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { source: "iana", compressible: !1, extensions: ["docx"] },
  "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { source: "iana", extensions: ["dotx"] },
  "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-package.core-properties+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { source: "iana", compressible: !0 },
  "application/vnd.openxmlformats-package.relationships+xml": { source: "iana", compressible: !0 },
  "application/vnd.oracle.resource+json": { source: "iana", compressible: !0 },
  "application/vnd.orange.indata": { source: "iana" },
  "application/vnd.osa.netdeploy": { source: "iana" },
  "application/vnd.osgeo.mapguide.package": { source: "iana", extensions: ["mgp"] },
  "application/vnd.osgi.bundle": { source: "iana" },
  "application/vnd.osgi.dp": { source: "iana", extensions: ["dp"] },
  "application/vnd.osgi.subsystem": { source: "iana", extensions: ["esa"] },
  "application/vnd.otps.ct-kip+xml": { source: "iana", compressible: !0 },
  "application/vnd.oxli.countgraph": { source: "iana" },
  "application/vnd.pagerduty+json": { source: "iana", compressible: !0 },
  "application/vnd.palm": { source: "iana", extensions: ["pdb", "pqa", "oprc"] },
  "application/vnd.panoply": { source: "iana" },
  "application/vnd.paos.xml": { source: "iana" },
  "application/vnd.patentdive": { source: "iana" },
  "application/vnd.patientecommsdoc": { source: "iana" },
  "application/vnd.pawaafile": { source: "iana", extensions: ["paw"] },
  "application/vnd.pcos": { source: "iana" },
  "application/vnd.pg.format": { source: "iana", extensions: ["str"] },
  "application/vnd.pg.osasli": { source: "iana", extensions: ["ei6"] },
  "application/vnd.piaccess.application-licence": { source: "iana" },
  "application/vnd.picsel": { source: "iana", extensions: ["efif"] },
  "application/vnd.pmi.widget": { source: "iana", extensions: ["wg"] },
  "application/vnd.poc.group-advertisement+xml": { source: "iana", compressible: !0 },
  "application/vnd.pocketlearn": { source: "iana", extensions: ["plf"] },
  "application/vnd.powerbuilder6": { source: "iana", extensions: ["pbd"] },
  "application/vnd.powerbuilder6-s": { source: "iana" },
  "application/vnd.powerbuilder7": { source: "iana" },
  "application/vnd.powerbuilder7-s": { source: "iana" },
  "application/vnd.powerbuilder75": { source: "iana" },
  "application/vnd.powerbuilder75-s": { source: "iana" },
  "application/vnd.preminet": { source: "iana" },
  "application/vnd.previewsystems.box": { source: "iana", extensions: ["box"] },
  "application/vnd.procrate.brushset": { extensions: ["brushset"] },
  "application/vnd.procreate.brush": { extensions: ["brush"] },
  "application/vnd.procreate.dream": { extensions: ["drm"] },
  "application/vnd.proteus.magazine": { source: "iana", extensions: ["mgz"] },
  "application/vnd.psfs": { source: "iana" },
  "application/vnd.pt.mundusmundi": { source: "iana" },
  "application/vnd.publishare-delta-tree": { source: "iana", extensions: ["qps"] },
  "application/vnd.pvi.ptid1": { source: "iana", extensions: ["ptid"] },
  "application/vnd.pwg-multiplexed": { source: "iana" },
  "application/vnd.pwg-xhtml-print+xml": { source: "iana", compressible: !0, extensions: ["xhtm"] },
  "application/vnd.qualcomm.brew-app-res": { source: "iana" },
  "application/vnd.quarantainenet": { source: "iana" },
  "application/vnd.quark.quarkxpress": { source: "iana", extensions: ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"] },
  "application/vnd.quobject-quoxdocument": { source: "iana" },
  "application/vnd.radisys.moml+xml": { source: "iana", compressible: !0 },
  "application/vnd.radisys.msml+xml": { source: "iana", compressible: !0 },
  "application/vnd.radisys.msml-audit+xml": { source: "iana", compressible: !0 },
  "application/vnd.radisys.msml-audit-conf+xml": { source: "iana", compressible: !0 },
  "application/vnd.radisys.msml-audit-conn+xml": { source: "iana", compressible: !0 },
  "application/vnd.radisys.msml-audit-dialog+xml": { source: "iana", compressible: !0 },
  "application/vnd.radisys.msml-audit-stream+xml": { source: "iana", compressible: !0 },
  "application/vnd.radisys.msml-conf+xml": { source: "iana", compressible: !0 },
  "application/vnd.radisys.msml-dialog+xml": { source: "iana", compressible: !0 },
  "application/vnd.radisys.msml-dialog-base+xml": { source: "iana", compressible: !0 },
  "application/vnd.radisys.msml-dialog-fax-detect+xml": { source: "iana", compressible: !0 },
  "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { source: "iana", compressible: !0 },
  "application/vnd.radisys.msml-dialog-group+xml": { source: "iana", compressible: !0 },
  "application/vnd.radisys.msml-dialog-speech+xml": { source: "iana", compressible: !0 },
  "application/vnd.radisys.msml-dialog-transform+xml": { source: "iana", compressible: !0 },
  "application/vnd.rainstor.data": { source: "iana" },
  "application/vnd.rapid": { source: "iana" },
  "application/vnd.rar": { source: "iana", extensions: ["rar"] },
  "application/vnd.realvnc.bed": { source: "iana", extensions: ["bed"] },
  "application/vnd.recordare.musicxml": { source: "iana", extensions: ["mxl"] },
  "application/vnd.recordare.musicxml+xml": { source: "iana", compressible: !0, extensions: ["musicxml"] },
  "application/vnd.relpipe": { source: "iana" },
  "application/vnd.renlearn.rlprint": { source: "iana" },
  "application/vnd.resilient.logic": { source: "iana" },
  "application/vnd.restful+json": { source: "iana", compressible: !0 },
  "application/vnd.rig.cryptonote": { source: "iana", extensions: ["cryptonote"] },
  "application/vnd.rim.cod": { source: "apache", extensions: ["cod"] },
  "application/vnd.rn-realmedia": { source: "apache", extensions: ["rm"] },
  "application/vnd.rn-realmedia-vbr": { source: "apache", extensions: ["rmvb"] },
  "application/vnd.route66.link66+xml": { source: "iana", compressible: !0, extensions: ["link66"] },
  "application/vnd.rs-274x": { source: "iana" },
  "application/vnd.ruckus.download": { source: "iana" },
  "application/vnd.s3sms": { source: "iana" },
  "application/vnd.sailingtracker.track": { source: "iana", extensions: ["st"] },
  "application/vnd.sar": { source: "iana" },
  "application/vnd.sbm.cid": { source: "iana" },
  "application/vnd.sbm.mid2": { source: "iana" },
  "application/vnd.scribus": { source: "iana" },
  "application/vnd.sealed.3df": { source: "iana" },
  "application/vnd.sealed.csf": { source: "iana" },
  "application/vnd.sealed.doc": { source: "iana" },
  "application/vnd.sealed.eml": { source: "iana" },
  "application/vnd.sealed.mht": { source: "iana" },
  "application/vnd.sealed.net": { source: "iana" },
  "application/vnd.sealed.ppt": { source: "iana" },
  "application/vnd.sealed.tiff": { source: "iana" },
  "application/vnd.sealed.xls": { source: "iana" },
  "application/vnd.sealedmedia.softseal.html": { source: "iana" },
  "application/vnd.sealedmedia.softseal.pdf": { source: "iana" },
  "application/vnd.seemail": { source: "iana", extensions: ["see"] },
  "application/vnd.seis+json": { source: "iana", compressible: !0 },
  "application/vnd.sema": { source: "iana", extensions: ["sema"] },
  "application/vnd.semd": { source: "iana", extensions: ["semd"] },
  "application/vnd.semf": { source: "iana", extensions: ["semf"] },
  "application/vnd.shade-save-file": { source: "iana" },
  "application/vnd.shana.informed.formdata": { source: "iana", extensions: ["ifm"] },
  "application/vnd.shana.informed.formtemplate": { source: "iana", extensions: ["itp"] },
  "application/vnd.shana.informed.interchange": { source: "iana", extensions: ["iif"] },
  "application/vnd.shana.informed.package": { source: "iana", extensions: ["ipk"] },
  "application/vnd.shootproof+json": { source: "iana", compressible: !0 },
  "application/vnd.shopkick+json": { source: "iana", compressible: !0 },
  "application/vnd.shp": { source: "iana" },
  "application/vnd.shx": { source: "iana" },
  "application/vnd.sigrok.session": { source: "iana" },
  "application/vnd.simtech-mindmapper": { source: "iana", extensions: ["twd", "twds"] },
  "application/vnd.siren+json": { source: "iana", compressible: !0 },
  "application/vnd.sketchometry": { source: "iana" },
  "application/vnd.smaf": { source: "iana", extensions: ["mmf"] },
  "application/vnd.smart.notebook": { source: "iana" },
  "application/vnd.smart.teacher": { source: "iana", extensions: ["teacher"] },
  "application/vnd.smintio.portals.archive": { source: "iana" },
  "application/vnd.snesdev-page-table": { source: "iana" },
  "application/vnd.software602.filler.form+xml": { source: "iana", compressible: !0, extensions: ["fo"] },
  "application/vnd.software602.filler.form-xml-zip": { source: "iana" },
  "application/vnd.solent.sdkm+xml": { source: "iana", compressible: !0, extensions: ["sdkm", "sdkd"] },
  "application/vnd.spotfire.dxp": { source: "iana", extensions: ["dxp"] },
  "application/vnd.spotfire.sfs": { source: "iana", extensions: ["sfs"] },
  "application/vnd.sqlite3": { source: "iana" },
  "application/vnd.sss-cod": { source: "iana" },
  "application/vnd.sss-dtf": { source: "iana" },
  "application/vnd.sss-ntf": { source: "iana" },
  "application/vnd.stardivision.calc": { source: "apache", extensions: ["sdc"] },
  "application/vnd.stardivision.draw": { source: "apache", extensions: ["sda"] },
  "application/vnd.stardivision.impress": { source: "apache", extensions: ["sdd"] },
  "application/vnd.stardivision.math": { source: "apache", extensions: ["smf"] },
  "application/vnd.stardivision.writer": { source: "apache", extensions: ["sdw", "vor"] },
  "application/vnd.stardivision.writer-global": { source: "apache", extensions: ["sgl"] },
  "application/vnd.stepmania.package": { source: "iana", extensions: ["smzip"] },
  "application/vnd.stepmania.stepchart": { source: "iana", extensions: ["sm"] },
  "application/vnd.street-stream": { source: "iana" },
  "application/vnd.sun.wadl+xml": { source: "iana", compressible: !0, extensions: ["wadl"] },
  "application/vnd.sun.xml.calc": { source: "apache", extensions: ["sxc"] },
  "application/vnd.sun.xml.calc.template": { source: "apache", extensions: ["stc"] },
  "application/vnd.sun.xml.draw": { source: "apache", extensions: ["sxd"] },
  "application/vnd.sun.xml.draw.template": { source: "apache", extensions: ["std"] },
  "application/vnd.sun.xml.impress": { source: "apache", extensions: ["sxi"] },
  "application/vnd.sun.xml.impress.template": { source: "apache", extensions: ["sti"] },
  "application/vnd.sun.xml.math": { source: "apache", extensions: ["sxm"] },
  "application/vnd.sun.xml.writer": { source: "apache", extensions: ["sxw"] },
  "application/vnd.sun.xml.writer.global": { source: "apache", extensions: ["sxg"] },
  "application/vnd.sun.xml.writer.template": { source: "apache", extensions: ["stw"] },
  "application/vnd.sus-calendar": { source: "iana", extensions: ["sus", "susp"] },
  "application/vnd.svd": { source: "iana", extensions: ["svd"] },
  "application/vnd.swiftview-ics": { source: "iana" },
  "application/vnd.sybyl.mol2": { source: "iana" },
  "application/vnd.sycle+xml": { source: "iana", compressible: !0 },
  "application/vnd.syft+json": { source: "iana", compressible: !0 },
  "application/vnd.symbian.install": { source: "apache", extensions: ["sis", "sisx"] },
  "application/vnd.syncml+xml": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["xsm"] },
  "application/vnd.syncml.dm+wbxml": { source: "iana", charset: "UTF-8", extensions: ["bdm"] },
  "application/vnd.syncml.dm+xml": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["xdm"] },
  "application/vnd.syncml.dm.notification": { source: "iana" },
  "application/vnd.syncml.dmddf+wbxml": { source: "iana" },
  "application/vnd.syncml.dmddf+xml": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["ddf"] },
  "application/vnd.syncml.dmtnds+wbxml": { source: "iana" },
  "application/vnd.syncml.dmtnds+xml": { source: "iana", charset: "UTF-8", compressible: !0 },
  "application/vnd.syncml.ds.notification": { source: "iana" },
  "application/vnd.tableschema+json": { source: "iana", compressible: !0 },
  "application/vnd.tao.intent-module-archive": { source: "iana", extensions: ["tao"] },
  "application/vnd.tcpdump.pcap": { source: "iana", extensions: ["pcap", "cap", "dmp"] },
  "application/vnd.think-cell.ppttc+json": { source: "iana", compressible: !0 },
  "application/vnd.tmd.mediaflex.api+xml": { source: "iana", compressible: !0 },
  "application/vnd.tml": { source: "iana" },
  "application/vnd.tmobile-livetv": { source: "iana", extensions: ["tmo"] },
  "application/vnd.tri.onesource": { source: "iana" },
  "application/vnd.trid.tpt": { source: "iana", extensions: ["tpt"] },
  "application/vnd.triscape.mxs": { source: "iana", extensions: ["mxs"] },
  "application/vnd.trueapp": { source: "iana", extensions: ["tra"] },
  "application/vnd.truedoc": { source: "iana" },
  "application/vnd.ubisoft.webplayer": { source: "iana" },
  "application/vnd.ufdl": { source: "iana", extensions: ["ufd", "ufdl"] },
  "application/vnd.uic.osdm+json": { source: "iana", compressible: !0 },
  "application/vnd.uiq.theme": { source: "iana", extensions: ["utz"] },
  "application/vnd.umajin": { source: "iana", extensions: ["umj"] },
  "application/vnd.unity": { source: "iana", extensions: ["unityweb"] },
  "application/vnd.uoml+xml": { source: "iana", compressible: !0, extensions: ["uoml", "uo"] },
  "application/vnd.uplanet.alert": { source: "iana" },
  "application/vnd.uplanet.alert-wbxml": { source: "iana" },
  "application/vnd.uplanet.bearer-choice": { source: "iana" },
  "application/vnd.uplanet.bearer-choice-wbxml": { source: "iana" },
  "application/vnd.uplanet.cacheop": { source: "iana" },
  "application/vnd.uplanet.cacheop-wbxml": { source: "iana" },
  "application/vnd.uplanet.channel": { source: "iana" },
  "application/vnd.uplanet.channel-wbxml": { source: "iana" },
  "application/vnd.uplanet.list": { source: "iana" },
  "application/vnd.uplanet.list-wbxml": { source: "iana" },
  "application/vnd.uplanet.listcmd": { source: "iana" },
  "application/vnd.uplanet.listcmd-wbxml": { source: "iana" },
  "application/vnd.uplanet.signal": { source: "iana" },
  "application/vnd.uri-map": { source: "iana" },
  "application/vnd.valve.source.material": { source: "iana" },
  "application/vnd.vcx": { source: "iana", extensions: ["vcx"] },
  "application/vnd.vd-study": { source: "iana" },
  "application/vnd.vectorworks": { source: "iana" },
  "application/vnd.vel+json": { source: "iana", compressible: !0 },
  "application/vnd.veraison.tsm-report+cbor": { source: "iana" },
  "application/vnd.veraison.tsm-report+json": { source: "iana", compressible: !0 },
  "application/vnd.verimatrix.vcas": { source: "iana" },
  "application/vnd.veritone.aion+json": { source: "iana", compressible: !0 },
  "application/vnd.veryant.thin": { source: "iana" },
  "application/vnd.ves.encrypted": { source: "iana" },
  "application/vnd.vidsoft.vidconference": { source: "iana" },
  "application/vnd.visio": { source: "iana", extensions: ["vsd", "vst", "vss", "vsw", "vsdx", "vtx"] },
  "application/vnd.visionary": { source: "iana", extensions: ["vis"] },
  "application/vnd.vividence.scriptfile": { source: "iana" },
  "application/vnd.vocalshaper.vsp4": { source: "iana" },
  "application/vnd.vsf": { source: "iana", extensions: ["vsf"] },
  "application/vnd.wap.sic": { source: "iana" },
  "application/vnd.wap.slc": { source: "iana" },
  "application/vnd.wap.wbxml": { source: "iana", charset: "UTF-8", extensions: ["wbxml"] },
  "application/vnd.wap.wmlc": { source: "iana", extensions: ["wmlc"] },
  "application/vnd.wap.wmlscriptc": { source: "iana", extensions: ["wmlsc"] },
  "application/vnd.wasmflow.wafl": { source: "iana" },
  "application/vnd.webturbo": { source: "iana", extensions: ["wtb"] },
  "application/vnd.wfa.dpp": { source: "iana" },
  "application/vnd.wfa.p2p": { source: "iana" },
  "application/vnd.wfa.wsc": { source: "iana" },
  "application/vnd.windows.devicepairing": { source: "iana" },
  "application/vnd.wmc": { source: "iana" },
  "application/vnd.wmf.bootstrap": { source: "iana" },
  "application/vnd.wolfram.mathematica": { source: "iana" },
  "application/vnd.wolfram.mathematica.package": { source: "iana" },
  "application/vnd.wolfram.player": { source: "iana", extensions: ["nbp"] },
  "application/vnd.wordlift": { source: "iana" },
  "application/vnd.wordperfect": { source: "iana", extensions: ["wpd"] },
  "application/vnd.wqd": { source: "iana", extensions: ["wqd"] },
  "application/vnd.wrq-hp3000-labelled": { source: "iana" },
  "application/vnd.wt.stf": { source: "iana", extensions: ["stf"] },
  "application/vnd.wv.csp+wbxml": { source: "iana" },
  "application/vnd.wv.csp+xml": { source: "iana", compressible: !0 },
  "application/vnd.wv.ssp+xml": { source: "iana", compressible: !0 },
  "application/vnd.xacml+json": { source: "iana", compressible: !0 },
  "application/vnd.xara": { source: "iana", extensions: ["xar"] },
  "application/vnd.xarin.cpj": { source: "iana" },
  "application/vnd.xecrets-encrypted": { source: "iana" },
  "application/vnd.xfdl": { source: "iana", extensions: ["xfdl"] },
  "application/vnd.xfdl.webform": { source: "iana" },
  "application/vnd.xmi+xml": { source: "iana", compressible: !0 },
  "application/vnd.xmpie.cpkg": { source: "iana" },
  "application/vnd.xmpie.dpkg": { source: "iana" },
  "application/vnd.xmpie.plan": { source: "iana" },
  "application/vnd.xmpie.ppkg": { source: "iana" },
  "application/vnd.xmpie.xlim": { source: "iana" },
  "application/vnd.yamaha.hv-dic": { source: "iana", extensions: ["hvd"] },
  "application/vnd.yamaha.hv-script": { source: "iana", extensions: ["hvs"] },
  "application/vnd.yamaha.hv-voice": { source: "iana", extensions: ["hvp"] },
  "application/vnd.yamaha.openscoreformat": { source: "iana", extensions: ["osf"] },
  "application/vnd.yamaha.openscoreformat.osfpvg+xml": { source: "iana", compressible: !0, extensions: ["osfpvg"] },
  "application/vnd.yamaha.remote-setup": { source: "iana" },
  "application/vnd.yamaha.smaf-audio": { source: "iana", extensions: ["saf"] },
  "application/vnd.yamaha.smaf-phrase": { source: "iana", extensions: ["spf"] },
  "application/vnd.yamaha.through-ngn": { source: "iana" },
  "application/vnd.yamaha.tunnel-udpencap": { source: "iana" },
  "application/vnd.yaoweme": { source: "iana" },
  "application/vnd.yellowriver-custom-menu": { source: "iana", extensions: ["cmp"] },
  "application/vnd.zul": { source: "iana", extensions: ["zir", "zirz"] },
  "application/vnd.zzazz.deck+xml": { source: "iana", compressible: !0, extensions: ["zaz"] },
  "application/voicexml+xml": { source: "iana", compressible: !0, extensions: ["vxml"] },
  "application/voucher-cms+json": { source: "iana", compressible: !0 },
  "application/voucher-jws+json": { source: "iana", compressible: !0 },
  "application/vp": { source: "iana" },
  "application/vp+cose": { source: "iana" },
  "application/vp+jwt": { source: "iana" },
  "application/vq-rtcpxr": { source: "iana" },
  "application/wasm": { source: "iana", compressible: !0, extensions: ["wasm"] },
  "application/watcherinfo+xml": { source: "iana", compressible: !0, extensions: ["wif"] },
  "application/webpush-options+json": { source: "iana", compressible: !0 },
  "application/whoispp-query": { source: "iana" },
  "application/whoispp-response": { source: "iana" },
  "application/widget": { source: "iana", extensions: ["wgt"] },
  "application/winhlp": { source: "apache", extensions: ["hlp"] },
  "application/wita": { source: "iana" },
  "application/wordperfect5.1": { source: "iana" },
  "application/wsdl+xml": { source: "iana", compressible: !0, extensions: ["wsdl"] },
  "application/wspolicy+xml": { source: "iana", compressible: !0, extensions: ["wspolicy"] },
  "application/x-7z-compressed": { source: "apache", compressible: !1, extensions: ["7z"] },
  "application/x-abiword": { source: "apache", extensions: ["abw"] },
  "application/x-ace-compressed": { source: "apache", extensions: ["ace"] },
  "application/x-amf": { source: "apache" },
  "application/x-apple-diskimage": { source: "apache", extensions: ["dmg"] },
  "application/x-arj": { compressible: !1, extensions: ["arj"] },
  "application/x-authorware-bin": { source: "apache", extensions: ["aab", "x32", "u32", "vox"] },
  "application/x-authorware-map": { source: "apache", extensions: ["aam"] },
  "application/x-authorware-seg": { source: "apache", extensions: ["aas"] },
  "application/x-bcpio": { source: "apache", extensions: ["bcpio"] },
  "application/x-bdoc": { compressible: !1, extensions: ["bdoc"] },
  "application/x-bittorrent": { source: "apache", extensions: ["torrent"] },
  "application/x-blender": { extensions: ["blend"] },
  "application/x-blorb": { source: "apache", extensions: ["blb", "blorb"] },
  "application/x-bzip": { source: "apache", compressible: !1, extensions: ["bz"] },
  "application/x-bzip2": { source: "apache", compressible: !1, extensions: ["bz2", "boz"] },
  "application/x-cbr": { source: "apache", extensions: ["cbr", "cba", "cbt", "cbz", "cb7"] },
  "application/x-cdlink": { source: "apache", extensions: ["vcd"] },
  "application/x-cfs-compressed": { source: "apache", extensions: ["cfs"] },
  "application/x-chat": { source: "apache", extensions: ["chat"] },
  "application/x-chess-pgn": { source: "apache", extensions: ["pgn"] },
  "application/x-chrome-extension": { extensions: ["crx"] },
  "application/x-cocoa": { source: "nginx", extensions: ["cco"] },
  "application/x-compress": { source: "apache" },
  "application/x-compressed": { extensions: ["rar"] },
  "application/x-conference": { source: "apache", extensions: ["nsc"] },
  "application/x-cpio": { source: "apache", extensions: ["cpio"] },
  "application/x-csh": { source: "apache", extensions: ["csh"] },
  "application/x-deb": { compressible: !1 },
  "application/x-debian-package": { source: "apache", extensions: ["deb", "udeb"] },
  "application/x-dgc-compressed": { source: "apache", extensions: ["dgc"] },
  "application/x-director": { source: "apache", extensions: ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"] },
  "application/x-doom": { source: "apache", extensions: ["wad"] },
  "application/x-dtbncx+xml": { source: "apache", compressible: !0, extensions: ["ncx"] },
  "application/x-dtbook+xml": { source: "apache", compressible: !0, extensions: ["dtb"] },
  "application/x-dtbresource+xml": { source: "apache", compressible: !0, extensions: ["res"] },
  "application/x-dvi": { source: "apache", compressible: !1, extensions: ["dvi"] },
  "application/x-envoy": { source: "apache", extensions: ["evy"] },
  "application/x-eva": { source: "apache", extensions: ["eva"] },
  "application/x-font-bdf": { source: "apache", extensions: ["bdf"] },
  "application/x-font-dos": { source: "apache" },
  "application/x-font-framemaker": { source: "apache" },
  "application/x-font-ghostscript": { source: "apache", extensions: ["gsf"] },
  "application/x-font-libgrx": { source: "apache" },
  "application/x-font-linux-psf": { source: "apache", extensions: ["psf"] },
  "application/x-font-pcf": { source: "apache", extensions: ["pcf"] },
  "application/x-font-snf": { source: "apache", extensions: ["snf"] },
  "application/x-font-speedo": { source: "apache" },
  "application/x-font-sunos-news": { source: "apache" },
  "application/x-font-type1": { source: "apache", extensions: ["pfa", "pfb", "pfm", "afm"] },
  "application/x-font-vfont": { source: "apache" },
  "application/x-freearc": { source: "apache", extensions: ["arc"] },
  "application/x-futuresplash": { source: "apache", extensions: ["spl"] },
  "application/x-gca-compressed": { source: "apache", extensions: ["gca"] },
  "application/x-glulx": { source: "apache", extensions: ["ulx"] },
  "application/x-gnumeric": { source: "apache", extensions: ["gnumeric"] },
  "application/x-gramps-xml": { source: "apache", extensions: ["gramps"] },
  "application/x-gtar": { source: "apache", extensions: ["gtar"] },
  "application/x-gzip": { source: "apache" },
  "application/x-hdf": { source: "apache", extensions: ["hdf"] },
  "application/x-httpd-php": { compressible: !0, extensions: ["php"] },
  "application/x-install-instructions": { source: "apache", extensions: ["install"] },
  "application/x-ipynb+json": { compressible: !0, extensions: ["ipynb"] },
  "application/x-iso9660-image": { source: "apache", extensions: ["iso"] },
  "application/x-iwork-keynote-sffkey": { extensions: ["key"] },
  "application/x-iwork-numbers-sffnumbers": { extensions: ["numbers"] },
  "application/x-iwork-pages-sffpages": { extensions: ["pages"] },
  "application/x-java-archive-diff": { source: "nginx", extensions: ["jardiff"] },
  "application/x-java-jnlp-file": { source: "apache", compressible: !1, extensions: ["jnlp"] },
  "application/x-javascript": { compressible: !0 },
  "application/x-keepass2": { extensions: ["kdbx"] },
  "application/x-latex": { source: "apache", compressible: !1, extensions: ["latex"] },
  "application/x-lua-bytecode": { extensions: ["luac"] },
  "application/x-lzh-compressed": { source: "apache", extensions: ["lzh", "lha"] },
  "application/x-makeself": { source: "nginx", extensions: ["run"] },
  "application/x-mie": { source: "apache", extensions: ["mie"] },
  "application/x-mobipocket-ebook": { source: "apache", extensions: ["prc", "mobi"] },
  "application/x-mpegurl": { compressible: !1 },
  "application/x-ms-application": { source: "apache", extensions: ["application"] },
  "application/x-ms-shortcut": { source: "apache", extensions: ["lnk"] },
  "application/x-ms-wmd": { source: "apache", extensions: ["wmd"] },
  "application/x-ms-wmz": { source: "apache", extensions: ["wmz"] },
  "application/x-ms-xbap": { source: "apache", extensions: ["xbap"] },
  "application/x-msaccess": { source: "apache", extensions: ["mdb"] },
  "application/x-msbinder": { source: "apache", extensions: ["obd"] },
  "application/x-mscardfile": { source: "apache", extensions: ["crd"] },
  "application/x-msclip": { source: "apache", extensions: ["clp"] },
  "application/x-msdos-program": { extensions: ["exe"] },
  "application/x-msdownload": { source: "apache", extensions: ["exe", "dll", "com", "bat", "msi"] },
  "application/x-msmediaview": { source: "apache", extensions: ["mvb", "m13", "m14"] },
  "application/x-msmetafile": { source: "apache", extensions: ["wmf", "wmz", "emf", "emz"] },
  "application/x-msmoney": { source: "apache", extensions: ["mny"] },
  "application/x-mspublisher": { source: "apache", extensions: ["pub"] },
  "application/x-msschedule": { source: "apache", extensions: ["scd"] },
  "application/x-msterminal": { source: "apache", extensions: ["trm"] },
  "application/x-mswrite": { source: "apache", extensions: ["wri"] },
  "application/x-netcdf": { source: "apache", extensions: ["nc", "cdf"] },
  "application/x-ns-proxy-autoconfig": { compressible: !0, extensions: ["pac"] },
  "application/x-nzb": { source: "apache", extensions: ["nzb"] },
  "application/x-perl": { source: "nginx", extensions: ["pl", "pm"] },
  "application/x-pilot": { source: "nginx", extensions: ["prc", "pdb"] },
  "application/x-pkcs12": { source: "apache", compressible: !1, extensions: ["p12", "pfx"] },
  "application/x-pkcs7-certificates": { source: "apache", extensions: ["p7b", "spc"] },
  "application/x-pkcs7-certreqresp": { source: "apache", extensions: ["p7r"] },
  "application/x-pki-message": { source: "iana" },
  "application/x-rar-compressed": { source: "apache", compressible: !1, extensions: ["rar"] },
  "application/x-redhat-package-manager": { source: "nginx", extensions: ["rpm"] },
  "application/x-research-info-systems": { source: "apache", extensions: ["ris"] },
  "application/x-sea": { source: "nginx", extensions: ["sea"] },
  "application/x-sh": { source: "apache", compressible: !0, extensions: ["sh"] },
  "application/x-shar": { source: "apache", extensions: ["shar"] },
  "application/x-shockwave-flash": { source: "apache", compressible: !1, extensions: ["swf"] },
  "application/x-silverlight-app": { source: "apache", extensions: ["xap"] },
  "application/x-sql": { source: "apache", extensions: ["sql"] },
  "application/x-stuffit": { source: "apache", compressible: !1, extensions: ["sit"] },
  "application/x-stuffitx": { source: "apache", extensions: ["sitx"] },
  "application/x-subrip": { source: "apache", extensions: ["srt"] },
  "application/x-sv4cpio": { source: "apache", extensions: ["sv4cpio"] },
  "application/x-sv4crc": { source: "apache", extensions: ["sv4crc"] },
  "application/x-t3vm-image": { source: "apache", extensions: ["t3"] },
  "application/x-tads": { source: "apache", extensions: ["gam"] },
  "application/x-tar": { source: "apache", compressible: !0, extensions: ["tar"] },
  "application/x-tcl": { source: "apache", extensions: ["tcl", "tk"] },
  "application/x-tex": { source: "apache", extensions: ["tex"] },
  "application/x-tex-tfm": { source: "apache", extensions: ["tfm"] },
  "application/x-texinfo": { source: "apache", extensions: ["texinfo", "texi"] },
  "application/x-tgif": { source: "apache", extensions: ["obj"] },
  "application/x-ustar": { source: "apache", extensions: ["ustar"] },
  "application/x-virtualbox-hdd": { compressible: !0, extensions: ["hdd"] },
  "application/x-virtualbox-ova": { compressible: !0, extensions: ["ova"] },
  "application/x-virtualbox-ovf": { compressible: !0, extensions: ["ovf"] },
  "application/x-virtualbox-vbox": { compressible: !0, extensions: ["vbox"] },
  "application/x-virtualbox-vbox-extpack": { compressible: !1, extensions: ["vbox-extpack"] },
  "application/x-virtualbox-vdi": { compressible: !0, extensions: ["vdi"] },
  "application/x-virtualbox-vhd": { compressible: !0, extensions: ["vhd"] },
  "application/x-virtualbox-vmdk": { compressible: !0, extensions: ["vmdk"] },
  "application/x-wais-source": { source: "apache", extensions: ["src"] },
  "application/x-web-app-manifest+json": { compressible: !0, extensions: ["webapp"] },
  "application/x-www-form-urlencoded": { source: "iana", compressible: !0 },
  "application/x-x509-ca-cert": { source: "iana", extensions: ["der", "crt", "pem"] },
  "application/x-x509-ca-ra-cert": { source: "iana" },
  "application/x-x509-next-ca-cert": { source: "iana" },
  "application/x-xfig": { source: "apache", extensions: ["fig"] },
  "application/x-xliff+xml": { source: "apache", compressible: !0, extensions: ["xlf"] },
  "application/x-xpinstall": { source: "apache", compressible: !1, extensions: ["xpi"] },
  "application/x-xz": { source: "apache", extensions: ["xz"] },
  "application/x-zip-compressed": { extensions: ["zip"] },
  "application/x-zmachine": { source: "apache", extensions: ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"] },
  "application/x400-bp": { source: "iana" },
  "application/xacml+xml": { source: "iana", compressible: !0 },
  "application/xaml+xml": { source: "apache", compressible: !0, extensions: ["xaml"] },
  "application/xcap-att+xml": { source: "iana", compressible: !0, extensions: ["xav"] },
  "application/xcap-caps+xml": { source: "iana", compressible: !0, extensions: ["xca"] },
  "application/xcap-diff+xml": { source: "iana", compressible: !0, extensions: ["xdf"] },
  "application/xcap-el+xml": { source: "iana", compressible: !0, extensions: ["xel"] },
  "application/xcap-error+xml": { source: "iana", compressible: !0 },
  "application/xcap-ns+xml": { source: "iana", compressible: !0, extensions: ["xns"] },
  "application/xcon-conference-info+xml": { source: "iana", compressible: !0 },
  "application/xcon-conference-info-diff+xml": { source: "iana", compressible: !0 },
  "application/xenc+xml": { source: "iana", compressible: !0, extensions: ["xenc"] },
  "application/xfdf": { source: "iana", extensions: ["xfdf"] },
  "application/xhtml+xml": { source: "iana", compressible: !0, extensions: ["xhtml", "xht"] },
  "application/xhtml-voice+xml": { source: "apache", compressible: !0 },
  "application/xliff+xml": { source: "iana", compressible: !0, extensions: ["xlf"] },
  "application/xml": { source: "iana", compressible: !0, extensions: ["xml", "xsl", "xsd", "rng"] },
  "application/xml-dtd": { source: "iana", compressible: !0, extensions: ["dtd"] },
  "application/xml-external-parsed-entity": { source: "iana" },
  "application/xml-patch+xml": { source: "iana", compressible: !0 },
  "application/xmpp+xml": { source: "iana", compressible: !0 },
  "application/xop+xml": { source: "iana", compressible: !0, extensions: ["xop"] },
  "application/xproc+xml": { source: "apache", compressible: !0, extensions: ["xpl"] },
  "application/xslt+xml": { source: "iana", compressible: !0, extensions: ["xsl", "xslt"] },
  "application/xspf+xml": { source: "apache", compressible: !0, extensions: ["xspf"] },
  "application/xv+xml": { source: "iana", compressible: !0, extensions: ["mxml", "xhvml", "xvml", "xvm"] },
  "application/yaml": { source: "iana" },
  "application/yang": { source: "iana", extensions: ["yang"] },
  "application/yang-data+cbor": { source: "iana" },
  "application/yang-data+json": { source: "iana", compressible: !0 },
  "application/yang-data+xml": { source: "iana", compressible: !0 },
  "application/yang-patch+json": { source: "iana", compressible: !0 },
  "application/yang-patch+xml": { source: "iana", compressible: !0 },
  "application/yang-sid+json": { source: "iana", compressible: !0 },
  "application/yin+xml": { source: "iana", compressible: !0, extensions: ["yin"] },
  "application/zip": { source: "iana", compressible: !1, extensions: ["zip"] },
  "application/zip+dotlottie": { extensions: ["lottie"] },
  "application/zlib": { source: "iana" },
  "application/zstd": { source: "iana" },
  "audio/1d-interleaved-parityfec": { source: "iana" },
  "audio/32kadpcm": { source: "iana" },
  "audio/3gpp": { source: "iana", compressible: !1, extensions: ["3gpp"] },
  "audio/3gpp2": { source: "iana" },
  "audio/aac": { source: "iana", extensions: ["adts", "aac"] },
  "audio/ac3": { source: "iana" },
  "audio/adpcm": { source: "apache", extensions: ["adp"] },
  "audio/amr": { source: "iana", extensions: ["amr"] },
  "audio/amr-wb": { source: "iana" },
  "audio/amr-wb+": { source: "iana" },
  "audio/aptx": { source: "iana" },
  "audio/asc": { source: "iana" },
  "audio/atrac-advanced-lossless": { source: "iana" },
  "audio/atrac-x": { source: "iana" },
  "audio/atrac3": { source: "iana" },
  "audio/basic": { source: "iana", compressible: !1, extensions: ["au", "snd"] },
  "audio/bv16": { source: "iana" },
  "audio/bv32": { source: "iana" },
  "audio/clearmode": { source: "iana" },
  "audio/cn": { source: "iana" },
  "audio/dat12": { source: "iana" },
  "audio/dls": { source: "iana" },
  "audio/dsr-es201108": { source: "iana" },
  "audio/dsr-es202050": { source: "iana" },
  "audio/dsr-es202211": { source: "iana" },
  "audio/dsr-es202212": { source: "iana" },
  "audio/dv": { source: "iana" },
  "audio/dvi4": { source: "iana" },
  "audio/eac3": { source: "iana" },
  "audio/encaprtp": { source: "iana" },
  "audio/evrc": { source: "iana" },
  "audio/evrc-qcp": { source: "iana" },
  "audio/evrc0": { source: "iana" },
  "audio/evrc1": { source: "iana" },
  "audio/evrcb": { source: "iana" },
  "audio/evrcb0": { source: "iana" },
  "audio/evrcb1": { source: "iana" },
  "audio/evrcnw": { source: "iana" },
  "audio/evrcnw0": { source: "iana" },
  "audio/evrcnw1": { source: "iana" },
  "audio/evrcwb": { source: "iana" },
  "audio/evrcwb0": { source: "iana" },
  "audio/evrcwb1": { source: "iana" },
  "audio/evs": { source: "iana" },
  "audio/flac": { source: "iana" },
  "audio/flexfec": { source: "iana" },
  "audio/fwdred": { source: "iana" },
  "audio/g711-0": { source: "iana" },
  "audio/g719": { source: "iana" },
  "audio/g722": { source: "iana" },
  "audio/g7221": { source: "iana" },
  "audio/g723": { source: "iana" },
  "audio/g726-16": { source: "iana" },
  "audio/g726-24": { source: "iana" },
  "audio/g726-32": { source: "iana" },
  "audio/g726-40": { source: "iana" },
  "audio/g728": { source: "iana" },
  "audio/g729": { source: "iana" },
  "audio/g7291": { source: "iana" },
  "audio/g729d": { source: "iana" },
  "audio/g729e": { source: "iana" },
  "audio/gsm": { source: "iana" },
  "audio/gsm-efr": { source: "iana" },
  "audio/gsm-hr-08": { source: "iana" },
  "audio/ilbc": { source: "iana" },
  "audio/ip-mr_v2.5": { source: "iana" },
  "audio/isac": { source: "apache" },
  "audio/l16": { source: "iana" },
  "audio/l20": { source: "iana" },
  "audio/l24": { source: "iana", compressible: !1 },
  "audio/l8": { source: "iana" },
  "audio/lpc": { source: "iana" },
  "audio/matroska": { source: "iana" },
  "audio/melp": { source: "iana" },
  "audio/melp1200": { source: "iana" },
  "audio/melp2400": { source: "iana" },
  "audio/melp600": { source: "iana" },
  "audio/mhas": { source: "iana" },
  "audio/midi": { source: "apache", extensions: ["mid", "midi", "kar", "rmi"] },
  "audio/midi-clip": { source: "iana" },
  "audio/mobile-xmf": { source: "iana", extensions: ["mxmf"] },
  "audio/mp3": { compressible: !1, extensions: ["mp3"] },
  "audio/mp4": { source: "iana", compressible: !1, extensions: ["m4a", "mp4a", "m4b"] },
  "audio/mp4a-latm": { source: "iana" },
  "audio/mpa": { source: "iana" },
  "audio/mpa-robust": { source: "iana" },
  "audio/mpeg": { source: "iana", compressible: !1, extensions: ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"] },
  "audio/mpeg4-generic": { source: "iana" },
  "audio/musepack": { source: "apache" },
  "audio/ogg": { source: "iana", compressible: !1, extensions: ["oga", "ogg", "spx", "opus"] },
  "audio/opus": { source: "iana" },
  "audio/parityfec": { source: "iana" },
  "audio/pcma": { source: "iana" },
  "audio/pcma-wb": { source: "iana" },
  "audio/pcmu": { source: "iana" },
  "audio/pcmu-wb": { source: "iana" },
  "audio/prs.sid": { source: "iana" },
  "audio/qcelp": { source: "iana" },
  "audio/raptorfec": { source: "iana" },
  "audio/red": { source: "iana" },
  "audio/rtp-enc-aescm128": { source: "iana" },
  "audio/rtp-midi": { source: "iana" },
  "audio/rtploopback": { source: "iana" },
  "audio/rtx": { source: "iana" },
  "audio/s3m": { source: "apache", extensions: ["s3m"] },
  "audio/scip": { source: "iana" },
  "audio/silk": { source: "apache", extensions: ["sil"] },
  "audio/smv": { source: "iana" },
  "audio/smv-qcp": { source: "iana" },
  "audio/smv0": { source: "iana" },
  "audio/sofa": { source: "iana" },
  "audio/sp-midi": { source: "iana" },
  "audio/speex": { source: "iana" },
  "audio/t140c": { source: "iana" },
  "audio/t38": { source: "iana" },
  "audio/telephone-event": { source: "iana" },
  "audio/tetra_acelp": { source: "iana" },
  "audio/tetra_acelp_bb": { source: "iana" },
  "audio/tone": { source: "iana" },
  "audio/tsvcis": { source: "iana" },
  "audio/uemclip": { source: "iana" },
  "audio/ulpfec": { source: "iana" },
  "audio/usac": { source: "iana" },
  "audio/vdvi": { source: "iana" },
  "audio/vmr-wb": { source: "iana" },
  "audio/vnd.3gpp.iufp": { source: "iana" },
  "audio/vnd.4sb": { source: "iana" },
  "audio/vnd.audiokoz": { source: "iana" },
  "audio/vnd.celp": { source: "iana" },
  "audio/vnd.cisco.nse": { source: "iana" },
  "audio/vnd.cmles.radio-events": { source: "iana" },
  "audio/vnd.cns.anp1": { source: "iana" },
  "audio/vnd.cns.inf1": { source: "iana" },
  "audio/vnd.dece.audio": { source: "iana", extensions: ["uva", "uvva"] },
  "audio/vnd.digital-winds": { source: "iana", extensions: ["eol"] },
  "audio/vnd.dlna.adts": { source: "iana" },
  "audio/vnd.dolby.heaac.1": { source: "iana" },
  "audio/vnd.dolby.heaac.2": { source: "iana" },
  "audio/vnd.dolby.mlp": { source: "iana" },
  "audio/vnd.dolby.mps": { source: "iana" },
  "audio/vnd.dolby.pl2": { source: "iana" },
  "audio/vnd.dolby.pl2x": { source: "iana" },
  "audio/vnd.dolby.pl2z": { source: "iana" },
  "audio/vnd.dolby.pulse.1": { source: "iana" },
  "audio/vnd.dra": { source: "iana", extensions: ["dra"] },
  "audio/vnd.dts": { source: "iana", extensions: ["dts"] },
  "audio/vnd.dts.hd": { source: "iana", extensions: ["dtshd"] },
  "audio/vnd.dts.uhd": { source: "iana" },
  "audio/vnd.dvb.file": { source: "iana" },
  "audio/vnd.everad.plj": { source: "iana" },
  "audio/vnd.hns.audio": { source: "iana" },
  "audio/vnd.lucent.voice": { source: "iana", extensions: ["lvp"] },
  "audio/vnd.ms-playready.media.pya": { source: "iana", extensions: ["pya"] },
  "audio/vnd.nokia.mobile-xmf": { source: "iana" },
  "audio/vnd.nortel.vbk": { source: "iana" },
  "audio/vnd.nuera.ecelp4800": { source: "iana", extensions: ["ecelp4800"] },
  "audio/vnd.nuera.ecelp7470": { source: "iana", extensions: ["ecelp7470"] },
  "audio/vnd.nuera.ecelp9600": { source: "iana", extensions: ["ecelp9600"] },
  "audio/vnd.octel.sbc": { source: "iana" },
  "audio/vnd.presonus.multitrack": { source: "iana" },
  "audio/vnd.qcelp": { source: "apache" },
  "audio/vnd.rhetorex.32kadpcm": { source: "iana" },
  "audio/vnd.rip": { source: "iana", extensions: ["rip"] },
  "audio/vnd.rn-realaudio": { compressible: !1 },
  "audio/vnd.sealedmedia.softseal.mpeg": { source: "iana" },
  "audio/vnd.vmx.cvsd": { source: "iana" },
  "audio/vnd.wave": { compressible: !1 },
  "audio/vorbis": { source: "iana", compressible: !1 },
  "audio/vorbis-config": { source: "iana" },
  "audio/wav": { compressible: !1, extensions: ["wav"] },
  "audio/wave": { compressible: !1, extensions: ["wav"] },
  "audio/webm": { source: "apache", compressible: !1, extensions: ["weba"] },
  "audio/x-aac": { source: "apache", compressible: !1, extensions: ["aac"] },
  "audio/x-aiff": { source: "apache", extensions: ["aif", "aiff", "aifc"] },
  "audio/x-caf": { source: "apache", compressible: !1, extensions: ["caf"] },
  "audio/x-flac": { source: "apache", extensions: ["flac"] },
  "audio/x-m4a": { source: "nginx", extensions: ["m4a"] },
  "audio/x-matroska": { source: "apache", extensions: ["mka"] },
  "audio/x-mpegurl": { source: "apache", extensions: ["m3u"] },
  "audio/x-ms-wax": { source: "apache", extensions: ["wax"] },
  "audio/x-ms-wma": { source: "apache", extensions: ["wma"] },
  "audio/x-pn-realaudio": { source: "apache", extensions: ["ram", "ra"] },
  "audio/x-pn-realaudio-plugin": { source: "apache", extensions: ["rmp"] },
  "audio/x-realaudio": { source: "nginx", extensions: ["ra"] },
  "audio/x-tta": { source: "apache" },
  "audio/x-wav": { source: "apache", extensions: ["wav"] },
  "audio/xm": { source: "apache", extensions: ["xm"] },
  "chemical/x-cdx": { source: "apache", extensions: ["cdx"] },
  "chemical/x-cif": { source: "apache", extensions: ["cif"] },
  "chemical/x-cmdf": { source: "apache", extensions: ["cmdf"] },
  "chemical/x-cml": { source: "apache", extensions: ["cml"] },
  "chemical/x-csml": { source: "apache", extensions: ["csml"] },
  "chemical/x-pdb": { source: "apache" },
  "chemical/x-xyz": { source: "apache", extensions: ["xyz"] },
  "font/collection": { source: "iana", extensions: ["ttc"] },
  "font/otf": { source: "iana", compressible: !0, extensions: ["otf"] },
  "font/sfnt": { source: "iana" },
  "font/ttf": { source: "iana", compressible: !0, extensions: ["ttf"] },
  "font/woff": { source: "iana", extensions: ["woff"] },
  "font/woff2": { source: "iana", extensions: ["woff2"] },
  "image/aces": { source: "iana", extensions: ["exr"] },
  "image/apng": { source: "iana", compressible: !1, extensions: ["apng"] },
  "image/avci": { source: "iana", extensions: ["avci"] },
  "image/avcs": { source: "iana", extensions: ["avcs"] },
  "image/avif": { source: "iana", compressible: !1, extensions: ["avif"] },
  "image/bmp": { source: "iana", compressible: !0, extensions: ["bmp", "dib"] },
  "image/cgm": { source: "iana", extensions: ["cgm"] },
  "image/dicom-rle": { source: "iana", extensions: ["drle"] },
  "image/dpx": { source: "iana", extensions: ["dpx"] },
  "image/emf": { source: "iana", extensions: ["emf"] },
  "image/fits": { source: "iana", extensions: ["fits"] },
  "image/g3fax": { source: "iana", extensions: ["g3"] },
  "image/gif": { source: "iana", compressible: !1, extensions: ["gif"] },
  "image/heic": { source: "iana", extensions: ["heic"] },
  "image/heic-sequence": { source: "iana", extensions: ["heics"] },
  "image/heif": { source: "iana", extensions: ["heif"] },
  "image/heif-sequence": { source: "iana", extensions: ["heifs"] },
  "image/hej2k": { source: "iana", extensions: ["hej2"] },
  "image/ief": { source: "iana", extensions: ["ief"] },
  "image/j2c": { source: "iana" },
  "image/jaii": { source: "iana", extensions: ["jaii"] },
  "image/jais": { source: "iana", extensions: ["jais"] },
  "image/jls": { source: "iana", extensions: ["jls"] },
  "image/jp2": { source: "iana", compressible: !1, extensions: ["jp2", "jpg2"] },
  "image/jpeg": { source: "iana", compressible: !1, extensions: ["jpg", "jpeg", "jpe"] },
  "image/jph": { source: "iana", extensions: ["jph"] },
  "image/jphc": { source: "iana", extensions: ["jhc"] },
  "image/jpm": { source: "iana", compressible: !1, extensions: ["jpm", "jpgm"] },
  "image/jpx": { source: "iana", compressible: !1, extensions: ["jpx", "jpf"] },
  "image/jxl": { source: "iana", extensions: ["jxl"] },
  "image/jxr": { source: "iana", extensions: ["jxr"] },
  "image/jxra": { source: "iana", extensions: ["jxra"] },
  "image/jxrs": { source: "iana", extensions: ["jxrs"] },
  "image/jxs": { source: "iana", extensions: ["jxs"] },
  "image/jxsc": { source: "iana", extensions: ["jxsc"] },
  "image/jxsi": { source: "iana", extensions: ["jxsi"] },
  "image/jxss": { source: "iana", extensions: ["jxss"] },
  "image/ktx": { source: "iana", extensions: ["ktx"] },
  "image/ktx2": { source: "iana", extensions: ["ktx2"] },
  "image/naplps": { source: "iana" },
  "image/pjpeg": { compressible: !1, extensions: ["jfif"] },
  "image/png": { source: "iana", compressible: !1, extensions: ["png"] },
  "image/prs.btif": { source: "iana", extensions: ["btif", "btf"] },
  "image/prs.pti": { source: "iana", extensions: ["pti"] },
  "image/pwg-raster": { source: "iana" },
  "image/sgi": { source: "apache", extensions: ["sgi"] },
  "image/svg+xml": { source: "iana", compressible: !0, extensions: ["svg", "svgz"] },
  "image/t38": { source: "iana", extensions: ["t38"] },
  "image/tiff": { source: "iana", compressible: !1, extensions: ["tif", "tiff"] },
  "image/tiff-fx": { source: "iana", extensions: ["tfx"] },
  "image/vnd.adobe.photoshop": { source: "iana", compressible: !0, extensions: ["psd"] },
  "image/vnd.airzip.accelerator.azv": { source: "iana", extensions: ["azv"] },
  "image/vnd.clip": { source: "iana" },
  "image/vnd.cns.inf2": { source: "iana" },
  "image/vnd.dece.graphic": { source: "iana", extensions: ["uvi", "uvvi", "uvg", "uvvg"] },
  "image/vnd.djvu": { source: "iana", extensions: ["djvu", "djv"] },
  "image/vnd.dvb.subtitle": { source: "iana", extensions: ["sub"] },
  "image/vnd.dwg": { source: "iana", extensions: ["dwg"] },
  "image/vnd.dxf": { source: "iana", extensions: ["dxf"] },
  "image/vnd.fastbidsheet": { source: "iana", extensions: ["fbs"] },
  "image/vnd.fpx": { source: "iana", extensions: ["fpx"] },
  "image/vnd.fst": { source: "iana", extensions: ["fst"] },
  "image/vnd.fujixerox.edmics-mmr": { source: "iana", extensions: ["mmr"] },
  "image/vnd.fujixerox.edmics-rlc": { source: "iana", extensions: ["rlc"] },
  "image/vnd.globalgraphics.pgb": { source: "iana" },
  "image/vnd.microsoft.icon": { source: "iana", compressible: !0, extensions: ["ico"] },
  "image/vnd.mix": { source: "iana" },
  "image/vnd.mozilla.apng": { source: "iana" },
  "image/vnd.ms-dds": { compressible: !0, extensions: ["dds"] },
  "image/vnd.ms-modi": { source: "iana", extensions: ["mdi"] },
  "image/vnd.ms-photo": { source: "apache", extensions: ["wdp"] },
  "image/vnd.net-fpx": { source: "iana", extensions: ["npx"] },
  "image/vnd.pco.b16": { source: "iana", extensions: ["b16"] },
  "image/vnd.radiance": { source: "iana" },
  "image/vnd.sealed.png": { source: "iana" },
  "image/vnd.sealedmedia.softseal.gif": { source: "iana" },
  "image/vnd.sealedmedia.softseal.jpg": { source: "iana" },
  "image/vnd.svf": { source: "iana" },
  "image/vnd.tencent.tap": { source: "iana", extensions: ["tap"] },
  "image/vnd.valve.source.texture": { source: "iana", extensions: ["vtf"] },
  "image/vnd.wap.wbmp": { source: "iana", extensions: ["wbmp"] },
  "image/vnd.xiff": { source: "iana", extensions: ["xif"] },
  "image/vnd.zbrush.pcx": { source: "iana", extensions: ["pcx"] },
  "image/webp": { source: "iana", extensions: ["webp"] },
  "image/wmf": { source: "iana", extensions: ["wmf"] },
  "image/x-3ds": { source: "apache", extensions: ["3ds"] },
  "image/x-adobe-dng": { extensions: ["dng"] },
  "image/x-cmu-raster": { source: "apache", extensions: ["ras"] },
  "image/x-cmx": { source: "apache", extensions: ["cmx"] },
  "image/x-emf": { source: "iana" },
  "image/x-freehand": { source: "apache", extensions: ["fh", "fhc", "fh4", "fh5", "fh7"] },
  "image/x-icon": { source: "apache", compressible: !0, extensions: ["ico"] },
  "image/x-jng": { source: "nginx", extensions: ["jng"] },
  "image/x-mrsid-image": { source: "apache", extensions: ["sid"] },
  "image/x-ms-bmp": { source: "nginx", compressible: !0, extensions: ["bmp"] },
  "image/x-pcx": { source: "apache", extensions: ["pcx"] },
  "image/x-pict": { source: "apache", extensions: ["pic", "pct"] },
  "image/x-portable-anymap": { source: "apache", extensions: ["pnm"] },
  "image/x-portable-bitmap": { source: "apache", extensions: ["pbm"] },
  "image/x-portable-graymap": { source: "apache", extensions: ["pgm"] },
  "image/x-portable-pixmap": { source: "apache", extensions: ["ppm"] },
  "image/x-rgb": { source: "apache", extensions: ["rgb"] },
  "image/x-tga": { source: "apache", extensions: ["tga"] },
  "image/x-wmf": { source: "iana" },
  "image/x-xbitmap": { source: "apache", extensions: ["xbm"] },
  "image/x-xcf": { compressible: !1 },
  "image/x-xpixmap": { source: "apache", extensions: ["xpm"] },
  "image/x-xwindowdump": { source: "apache", extensions: ["xwd"] },
  "message/bhttp": { source: "iana" },
  "message/cpim": { source: "iana" },
  "message/delivery-status": { source: "iana" },
  "message/disposition-notification": { source: "iana", extensions: ["disposition-notification"] },
  "message/external-body": { source: "iana" },
  "message/feedback-report": { source: "iana" },
  "message/global": { source: "iana", extensions: ["u8msg"] },
  "message/global-delivery-status": { source: "iana", extensions: ["u8dsn"] },
  "message/global-disposition-notification": { source: "iana", extensions: ["u8mdn"] },
  "message/global-headers": { source: "iana", extensions: ["u8hdr"] },
  "message/http": { source: "iana", compressible: !1 },
  "message/imdn+xml": { source: "iana", compressible: !0 },
  "message/mls": { source: "iana" },
  "message/news": { source: "apache" },
  "message/ohttp-req": { source: "iana" },
  "message/ohttp-res": { source: "iana" },
  "message/partial": { source: "iana", compressible: !1 },
  "message/rfc822": { source: "iana", compressible: !0, extensions: ["eml", "mime", "mht", "mhtml"] },
  "message/s-http": { source: "apache" },
  "message/sip": { source: "iana" },
  "message/sipfrag": { source: "iana" },
  "message/tracking-status": { source: "iana" },
  "message/vnd.si.simp": { source: "apache" },
  "message/vnd.wfa.wsc": { source: "iana", extensions: ["wsc"] },
  "model/3mf": { source: "iana", extensions: ["3mf"] },
  "model/e57": { source: "iana" },
  "model/gltf+json": { source: "iana", compressible: !0, extensions: ["gltf"] },
  "model/gltf-binary": { source: "iana", compressible: !0, extensions: ["glb"] },
  "model/iges": { source: "iana", compressible: !1, extensions: ["igs", "iges"] },
  "model/jt": { source: "iana", extensions: ["jt"] },
  "model/mesh": { source: "iana", compressible: !1, extensions: ["msh", "mesh", "silo"] },
  "model/mtl": { source: "iana", extensions: ["mtl"] },
  "model/obj": { source: "iana", extensions: ["obj"] },
  "model/prc": { source: "iana", extensions: ["prc"] },
  "model/step": { source: "iana", extensions: ["step", "stp", "stpnc", "p21", "210"] },
  "model/step+xml": { source: "iana", compressible: !0, extensions: ["stpx"] },
  "model/step+zip": { source: "iana", compressible: !1, extensions: ["stpz"] },
  "model/step-xml+zip": { source: "iana", compressible: !1, extensions: ["stpxz"] },
  "model/stl": { source: "iana", extensions: ["stl"] },
  "model/u3d": { source: "iana", extensions: ["u3d"] },
  "model/vnd.bary": { source: "iana", extensions: ["bary"] },
  "model/vnd.cld": { source: "iana", extensions: ["cld"] },
  "model/vnd.collada+xml": { source: "iana", compressible: !0, extensions: ["dae"] },
  "model/vnd.dwf": { source: "iana", extensions: ["dwf"] },
  "model/vnd.flatland.3dml": { source: "iana" },
  "model/vnd.gdl": { source: "iana", extensions: ["gdl"] },
  "model/vnd.gs-gdl": { source: "apache" },
  "model/vnd.gs.gdl": { source: "iana" },
  "model/vnd.gtw": { source: "iana", extensions: ["gtw"] },
  "model/vnd.moml+xml": { source: "iana", compressible: !0 },
  "model/vnd.mts": { source: "iana", extensions: ["mts"] },
  "model/vnd.opengex": { source: "iana", extensions: ["ogex"] },
  "model/vnd.parasolid.transmit.binary": { source: "iana", extensions: ["x_b"] },
  "model/vnd.parasolid.transmit.text": { source: "iana", extensions: ["x_t"] },
  "model/vnd.pytha.pyox": { source: "iana", extensions: ["pyo", "pyox"] },
  "model/vnd.rosette.annotated-data-model": { source: "iana" },
  "model/vnd.sap.vds": { source: "iana", extensions: ["vds"] },
  "model/vnd.usda": { source: "iana", extensions: ["usda"] },
  "model/vnd.usdz+zip": { source: "iana", compressible: !1, extensions: ["usdz"] },
  "model/vnd.valve.source.compiled-map": { source: "iana", extensions: ["bsp"] },
  "model/vnd.vtu": { source: "iana", extensions: ["vtu"] },
  "model/vrml": { source: "iana", compressible: !1, extensions: ["wrl", "vrml"] },
  "model/x3d+binary": { source: "apache", compressible: !1, extensions: ["x3db", "x3dbz"] },
  "model/x3d+fastinfoset": { source: "iana", extensions: ["x3db"] },
  "model/x3d+vrml": { source: "apache", compressible: !1, extensions: ["x3dv", "x3dvz"] },
  "model/x3d+xml": { source: "iana", compressible: !0, extensions: ["x3d", "x3dz"] },
  "model/x3d-vrml": { source: "iana", extensions: ["x3dv"] },
  "multipart/alternative": { source: "iana", compressible: !1 },
  "multipart/appledouble": { source: "iana" },
  "multipart/byteranges": { source: "iana" },
  "multipart/digest": { source: "iana" },
  "multipart/encrypted": { source: "iana", compressible: !1 },
  "multipart/form-data": { source: "iana", compressible: !1 },
  "multipart/header-set": { source: "iana" },
  "multipart/mixed": { source: "iana" },
  "multipart/multilingual": { source: "iana" },
  "multipart/parallel": { source: "iana" },
  "multipart/related": { source: "iana", compressible: !1 },
  "multipart/report": { source: "iana" },
  "multipart/signed": { source: "iana", compressible: !1 },
  "multipart/vnd.bint.med-plus": { source: "iana" },
  "multipart/voice-message": { source: "iana" },
  "multipart/x-mixed-replace": { source: "iana" },
  "text/1d-interleaved-parityfec": { source: "iana" },
  "text/cache-manifest": { source: "iana", compressible: !0, extensions: ["appcache", "manifest"] },
  "text/calendar": { source: "iana", extensions: ["ics", "ifb"] },
  "text/calender": { compressible: !0 },
  "text/cmd": { compressible: !0 },
  "text/coffeescript": { extensions: ["coffee", "litcoffee"] },
  "text/cql": { source: "iana" },
  "text/cql-expression": { source: "iana" },
  "text/cql-identifier": { source: "iana" },
  "text/css": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["css"] },
  "text/csv": { source: "iana", compressible: !0, extensions: ["csv"] },
  "text/csv-schema": { source: "iana" },
  "text/directory": { source: "iana" },
  "text/dns": { source: "iana" },
  "text/ecmascript": { source: "apache" },
  "text/encaprtp": { source: "iana" },
  "text/enriched": { source: "iana" },
  "text/fhirpath": { source: "iana" },
  "text/flexfec": { source: "iana" },
  "text/fwdred": { source: "iana" },
  "text/gff3": { source: "iana" },
  "text/grammar-ref-list": { source: "iana" },
  "text/hl7v2": { source: "iana" },
  "text/html": { source: "iana", compressible: !0, extensions: ["html", "htm", "shtml"] },
  "text/jade": { extensions: ["jade"] },
  "text/javascript": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["js", "mjs"] },
  "text/jcr-cnd": { source: "iana" },
  "text/jsx": { compressible: !0, extensions: ["jsx"] },
  "text/less": { compressible: !0, extensions: ["less"] },
  "text/markdown": { source: "iana", compressible: !0, extensions: ["md", "markdown"] },
  "text/mathml": { source: "nginx", extensions: ["mml"] },
  "text/mdx": { compressible: !0, extensions: ["mdx"] },
  "text/mizar": { source: "iana" },
  "text/n3": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["n3"] },
  "text/parameters": { source: "iana", charset: "UTF-8" },
  "text/parityfec": { source: "iana" },
  "text/plain": { source: "iana", compressible: !0, extensions: ["txt", "text", "conf", "def", "list", "log", "in", "ini"] },
  "text/provenance-notation": { source: "iana", charset: "UTF-8" },
  "text/prs.fallenstein.rst": { source: "iana" },
  "text/prs.lines.tag": { source: "iana", extensions: ["dsc"] },
  "text/prs.prop.logic": { source: "iana" },
  "text/prs.texi": { source: "iana" },
  "text/raptorfec": { source: "iana" },
  "text/red": { source: "iana" },
  "text/rfc822-headers": { source: "iana" },
  "text/richtext": { source: "iana", compressible: !0, extensions: ["rtx"] },
  "text/rtf": { source: "iana", compressible: !0, extensions: ["rtf"] },
  "text/rtp-enc-aescm128": { source: "iana" },
  "text/rtploopback": { source: "iana" },
  "text/rtx": { source: "iana" },
  "text/sgml": { source: "iana", extensions: ["sgml", "sgm"] },
  "text/shaclc": { source: "iana" },
  "text/shex": { source: "iana", extensions: ["shex"] },
  "text/slim": { extensions: ["slim", "slm"] },
  "text/spdx": { source: "iana", extensions: ["spdx"] },
  "text/strings": { source: "iana" },
  "text/stylus": { extensions: ["stylus", "styl"] },
  "text/t140": { source: "iana" },
  "text/tab-separated-values": { source: "iana", compressible: !0, extensions: ["tsv"] },
  "text/troff": { source: "iana", extensions: ["t", "tr", "roff", "man", "me", "ms"] },
  "text/turtle": { source: "iana", charset: "UTF-8", extensions: ["ttl"] },
  "text/ulpfec": { source: "iana" },
  "text/uri-list": { source: "iana", compressible: !0, extensions: ["uri", "uris", "urls"] },
  "text/vcard": { source: "iana", compressible: !0, extensions: ["vcard"] },
  "text/vnd.a": { source: "iana" },
  "text/vnd.abc": { source: "iana" },
  "text/vnd.ascii-art": { source: "iana" },
  "text/vnd.curl": { source: "iana", extensions: ["curl"] },
  "text/vnd.curl.dcurl": { source: "apache", extensions: ["dcurl"] },
  "text/vnd.curl.mcurl": { source: "apache", extensions: ["mcurl"] },
  "text/vnd.curl.scurl": { source: "apache", extensions: ["scurl"] },
  "text/vnd.debian.copyright": { source: "iana", charset: "UTF-8" },
  "text/vnd.dmclientscript": { source: "iana" },
  "text/vnd.dvb.subtitle": { source: "iana", extensions: ["sub"] },
  "text/vnd.esmertec.theme-descriptor": { source: "iana", charset: "UTF-8" },
  "text/vnd.exchangeable": { source: "iana" },
  "text/vnd.familysearch.gedcom": { source: "iana", extensions: ["ged"] },
  "text/vnd.ficlab.flt": { source: "iana" },
  "text/vnd.fly": { source: "iana", extensions: ["fly"] },
  "text/vnd.fmi.flexstor": { source: "iana", extensions: ["flx"] },
  "text/vnd.gml": { source: "iana" },
  "text/vnd.graphviz": { source: "iana", extensions: ["gv"] },
  "text/vnd.hans": { source: "iana" },
  "text/vnd.hgl": { source: "iana" },
  "text/vnd.in3d.3dml": { source: "iana", extensions: ["3dml"] },
  "text/vnd.in3d.spot": { source: "iana", extensions: ["spot"] },
  "text/vnd.iptc.newsml": { source: "iana" },
  "text/vnd.iptc.nitf": { source: "iana" },
  "text/vnd.latex-z": { source: "iana" },
  "text/vnd.motorola.reflex": { source: "iana" },
  "text/vnd.ms-mediapackage": { source: "iana" },
  "text/vnd.net2phone.commcenter.command": { source: "iana" },
  "text/vnd.radisys.msml-basic-layout": { source: "iana" },
  "text/vnd.senx.warpscript": { source: "iana" },
  "text/vnd.si.uricatalogue": { source: "apache" },
  "text/vnd.sosi": { source: "iana" },
  "text/vnd.sun.j2me.app-descriptor": { source: "iana", charset: "UTF-8", extensions: ["jad"] },
  "text/vnd.trolltech.linguist": { source: "iana", charset: "UTF-8" },
  "text/vnd.vcf": { source: "iana" },
  "text/vnd.wap.si": { source: "iana" },
  "text/vnd.wap.sl": { source: "iana" },
  "text/vnd.wap.wml": { source: "iana", extensions: ["wml"] },
  "text/vnd.wap.wmlscript": { source: "iana", extensions: ["wmls"] },
  "text/vnd.zoo.kcl": { source: "iana" },
  "text/vtt": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["vtt"] },
  "text/wgsl": { source: "iana", extensions: ["wgsl"] },
  "text/x-asm": { source: "apache", extensions: ["s", "asm"] },
  "text/x-c": { source: "apache", extensions: ["c", "cc", "cxx", "cpp", "h", "hh", "dic"] },
  "text/x-component": { source: "nginx", extensions: ["htc"] },
  "text/x-fortran": { source: "apache", extensions: ["f", "for", "f77", "f90"] },
  "text/x-gwt-rpc": { compressible: !0 },
  "text/x-handlebars-template": { extensions: ["hbs"] },
  "text/x-java-source": { source: "apache", extensions: ["java"] },
  "text/x-jquery-tmpl": { compressible: !0 },
  "text/x-lua": { extensions: ["lua"] },
  "text/x-markdown": { compressible: !0, extensions: ["mkd"] },
  "text/x-nfo": { source: "apache", extensions: ["nfo"] },
  "text/x-opml": { source: "apache", extensions: ["opml"] },
  "text/x-org": { compressible: !0, extensions: ["org"] },
  "text/x-pascal": { source: "apache", extensions: ["p", "pas"] },
  "text/x-processing": { compressible: !0, extensions: ["pde"] },
  "text/x-sass": { extensions: ["sass"] },
  "text/x-scss": { extensions: ["scss"] },
  "text/x-setext": { source: "apache", extensions: ["etx"] },
  "text/x-sfv": { source: "apache", extensions: ["sfv"] },
  "text/x-suse-ymp": { compressible: !0, extensions: ["ymp"] },
  "text/x-uuencode": { source: "apache", extensions: ["uu"] },
  "text/x-vcalendar": { source: "apache", extensions: ["vcs"] },
  "text/x-vcard": { source: "apache", extensions: ["vcf"] },
  "text/xml": { source: "iana", compressible: !0, extensions: ["xml"] },
  "text/xml-external-parsed-entity": { source: "iana" },
  "text/yaml": { compressible: !0, extensions: ["yaml", "yml"] },
  "video/1d-interleaved-parityfec": { source: "iana" },
  "video/3gpp": { source: "iana", extensions: ["3gp", "3gpp"] },
  "video/3gpp-tt": { source: "iana" },
  "video/3gpp2": { source: "iana", extensions: ["3g2"] },
  "video/av1": { source: "iana" },
  "video/bmpeg": { source: "iana" },
  "video/bt656": { source: "iana" },
  "video/celb": { source: "iana" },
  "video/dv": { source: "iana" },
  "video/encaprtp": { source: "iana" },
  "video/evc": { source: "iana" },
  "video/ffv1": { source: "iana" },
  "video/flexfec": { source: "iana" },
  "video/h261": { source: "iana", extensions: ["h261"] },
  "video/h263": { source: "iana", extensions: ["h263"] },
  "video/h263-1998": { source: "iana" },
  "video/h263-2000": { source: "iana" },
  "video/h264": { source: "iana", extensions: ["h264"] },
  "video/h264-rcdo": { source: "iana" },
  "video/h264-svc": { source: "iana" },
  "video/h265": { source: "iana" },
  "video/h266": { source: "iana" },
  "video/iso.segment": { source: "iana", extensions: ["m4s"] },
  "video/jpeg": { source: "iana", extensions: ["jpgv"] },
  "video/jpeg2000": { source: "iana" },
  "video/jpm": { source: "apache", extensions: ["jpm", "jpgm"] },
  "video/jxsv": { source: "iana" },
  "video/lottie+json": { source: "iana", compressible: !0 },
  "video/matroska": { source: "iana" },
  "video/matroska-3d": { source: "iana" },
  "video/mj2": { source: "iana", extensions: ["mj2", "mjp2"] },
  "video/mp1s": { source: "iana" },
  "video/mp2p": { source: "iana" },
  "video/mp2t": { source: "iana", extensions: ["ts", "m2t", "m2ts", "mts"] },
  "video/mp4": { source: "iana", compressible: !1, extensions: ["mp4", "mp4v", "mpg4"] },
  "video/mp4v-es": { source: "iana" },
  "video/mpeg": { source: "iana", compressible: !1, extensions: ["mpeg", "mpg", "mpe", "m1v", "m2v"] },
  "video/mpeg4-generic": { source: "iana" },
  "video/mpv": { source: "iana" },
  "video/nv": { source: "iana" },
  "video/ogg": { source: "iana", compressible: !1, extensions: ["ogv"] },
  "video/parityfec": { source: "iana" },
  "video/pointer": { source: "iana" },
  "video/quicktime": { source: "iana", compressible: !1, extensions: ["qt", "mov"] },
  "video/raptorfec": { source: "iana" },
  "video/raw": { source: "iana" },
  "video/rtp-enc-aescm128": { source: "iana" },
  "video/rtploopback": { source: "iana" },
  "video/rtx": { source: "iana" },
  "video/scip": { source: "iana" },
  "video/smpte291": { source: "iana" },
  "video/smpte292m": { source: "iana" },
  "video/ulpfec": { source: "iana" },
  "video/vc1": { source: "iana" },
  "video/vc2": { source: "iana" },
  "video/vnd.cctv": { source: "iana" },
  "video/vnd.dece.hd": { source: "iana", extensions: ["uvh", "uvvh"] },
  "video/vnd.dece.mobile": { source: "iana", extensions: ["uvm", "uvvm"] },
  "video/vnd.dece.mp4": { source: "iana" },
  "video/vnd.dece.pd": { source: "iana", extensions: ["uvp", "uvvp"] },
  "video/vnd.dece.sd": { source: "iana", extensions: ["uvs", "uvvs"] },
  "video/vnd.dece.video": { source: "iana", extensions: ["uvv", "uvvv"] },
  "video/vnd.directv.mpeg": { source: "iana" },
  "video/vnd.directv.mpeg-tts": { source: "iana" },
  "video/vnd.dlna.mpeg-tts": { source: "iana" },
  "video/vnd.dvb.file": { source: "iana", extensions: ["dvb"] },
  "video/vnd.fvt": { source: "iana", extensions: ["fvt"] },
  "video/vnd.hns.video": { source: "iana" },
  "video/vnd.iptvforum.1dparityfec-1010": { source: "iana" },
  "video/vnd.iptvforum.1dparityfec-2005": { source: "iana" },
  "video/vnd.iptvforum.2dparityfec-1010": { source: "iana" },
  "video/vnd.iptvforum.2dparityfec-2005": { source: "iana" },
  "video/vnd.iptvforum.ttsavc": { source: "iana" },
  "video/vnd.iptvforum.ttsmpeg2": { source: "iana" },
  "video/vnd.motorola.video": { source: "iana" },
  "video/vnd.motorola.videop": { source: "iana" },
  "video/vnd.mpegurl": { source: "iana", extensions: ["mxu", "m4u"] },
  "video/vnd.ms-playready.media.pyv": { source: "iana", extensions: ["pyv"] },
  "video/vnd.nokia.interleaved-multimedia": { source: "iana" },
  "video/vnd.nokia.mp4vr": { source: "iana" },
  "video/vnd.nokia.videovoip": { source: "iana" },
  "video/vnd.objectvideo": { source: "iana" },
  "video/vnd.planar": { source: "iana" },
  "video/vnd.radgamettools.bink": { source: "iana" },
  "video/vnd.radgamettools.smacker": { source: "apache" },
  "video/vnd.sealed.mpeg1": { source: "iana" },
  "video/vnd.sealed.mpeg4": { source: "iana" },
  "video/vnd.sealed.swf": { source: "iana" },
  "video/vnd.sealedmedia.softseal.mov": { source: "iana" },
  "video/vnd.uvvu.mp4": { source: "iana", extensions: ["uvu", "uvvu"] },
  "video/vnd.vivo": { source: "iana", extensions: ["viv"] },
  "video/vnd.youtube.yt": { source: "iana" },
  "video/vp8": { source: "iana" },
  "video/vp9": { source: "iana" },
  "video/webm": { source: "apache", compressible: !1, extensions: ["webm"] },
  "video/x-f4v": { source: "apache", extensions: ["f4v"] },
  "video/x-fli": { source: "apache", extensions: ["fli"] },
  "video/x-flv": { source: "apache", compressible: !1, extensions: ["flv"] },
  "video/x-m4v": { source: "apache", extensions: ["m4v"] },
  "video/x-matroska": { source: "apache", compressible: !1, extensions: ["mkv", "mk3d", "mks"] },
  "video/x-mng": { source: "apache", extensions: ["mng"] },
  "video/x-ms-asf": { source: "apache", extensions: ["asf", "asx"] },
  "video/x-ms-vob": { source: "apache", extensions: ["vob"] },
  "video/x-ms-wm": { source: "apache", extensions: ["wm"] },
  "video/x-ms-wmv": { source: "apache", compressible: !1, extensions: ["wmv"] },
  "video/x-ms-wmx": { source: "apache", extensions: ["wmx"] },
  "video/x-ms-wvx": { source: "apache", extensions: ["wvx"] },
  "video/x-msvideo": { source: "apache", extensions: ["avi"] },
  "video/x-sgi-movie": { source: "apache", extensions: ["movie"] },
  "video/x-smv": { source: "apache", extensions: ["smv"] },
  "x-conference/x-cooltalk": { source: "apache", extensions: ["ice"] },
  "x-shader/x-fragment": { compressible: !0 },
  "x-shader/x-vertex": { compressible: !0 }
};
/*!
 * mime-db
 * Copyright(c) 2014 Jonathan Ong
 * Copyright(c) 2015-2022 Douglas Christopher Wilson
 * MIT Licensed
 */
var rw, _F;
function Xme() {
  return _F || (_F = 1, rw = Jme), rw;
}
/*!
 * compressible
 * Copyright(c) 2013 Jonathan Ong
 * Copyright(c) 2014 Jeremiah Senkpiel
 * Copyright(c) 2015 Douglas Christopher Wilson
 * MIT Licensed
 */
var iw, EF;
function Zme() {
  if (EF) return iw;
  EF = 1;
  var t = Xme(), e = /^text\/|\+(?:json|text|xml)$/i, n = /^\s*([^;\s]*)(?:;|\s|$)/;
  iw = r;
  function r(i) {
    if (!i || typeof i != "string")
      return !1;
    var o = n.exec(i), s = o && o[1].toLowerCase(), a = t[s];
    return a && a.compressible !== void 0 ? a.compressible : e.test(s) || void 0;
  }
  return iw;
}
var qh = { exports: {} }, Hh = { exports: {} }, ow, AF;
function ege() {
  if (AF) return ow;
  AF = 1;
  var t = 1e3, e = t * 60, n = e * 60, r = n * 24, i = r * 365.25;
  ow = function(u, l) {
    l = l || {};
    var d = typeof u;
    if (d === "string" && u.length > 0)
      return o(u);
    if (d === "number" && isNaN(u) === !1)
      return l.long ? a(u) : s(u);
    throw new Error(
      "val is not a non-empty string or a valid number. val=" + JSON.stringify(u)
    );
  };
  function o(u) {
    if (u = String(u), !(u.length > 100)) {
      var l = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
        u
      );
      if (l) {
        var d = parseFloat(l[1]), f = (l[2] || "ms").toLowerCase();
        switch (f) {
          case "years":
          case "year":
          case "yrs":
          case "yr":
          case "y":
            return d * i;
          case "days":
          case "day":
          case "d":
            return d * r;
          case "hours":
          case "hour":
          case "hrs":
          case "hr":
          case "h":
            return d * n;
          case "minutes":
          case "minute":
          case "mins":
          case "min":
          case "m":
            return d * e;
          case "seconds":
          case "second":
          case "secs":
          case "sec":
          case "s":
            return d * t;
          case "milliseconds":
          case "millisecond":
          case "msecs":
          case "msec":
          case "ms":
            return d;
          default:
            return;
        }
      }
    }
  }
  function s(u) {
    return u >= r ? Math.round(u / r) + "d" : u >= n ? Math.round(u / n) + "h" : u >= e ? Math.round(u / e) + "m" : u >= t ? Math.round(u / t) + "s" : u + "ms";
  }
  function a(u) {
    return c(u, r, "day") || c(u, n, "hour") || c(u, e, "minute") || c(u, t, "second") || u + " ms";
  }
  function c(u, l, d) {
    if (!(u < l))
      return u < l * 1.5 ? Math.floor(u / l) + " " + d : Math.ceil(u / l) + " " + d + "s";
  }
  return ow;
}
var IF;
function tge() {
  return IF || (IF = 1, (function(t, e) {
    e = t.exports = i.debug = i.default = i, e.coerce = c, e.disable = s, e.enable = o, e.enabled = a, e.humanize = ege(), e.names = [], e.skips = [], e.formatters = {};
    var n;
    function r(u) {
      var l = 0, d;
      for (d in u)
        l = (l << 5) - l + u.charCodeAt(d), l |= 0;
      return e.colors[Math.abs(l) % e.colors.length];
    }
    function i(u) {
      function l() {
        if (l.enabled) {
          var d = l, f = +/* @__PURE__ */ new Date(), m = f - (n || f);
          d.diff = m, d.prev = n, d.curr = f, n = f;
          for (var h = new Array(arguments.length), y = 0; y < h.length; y++)
            h[y] = arguments[y];
          h[0] = e.coerce(h[0]), typeof h[0] != "string" && h.unshift("%O");
          var x = 0;
          h[0] = h[0].replace(/%([a-zA-Z%])/g, function(v, S) {
            if (v === "%%") return v;
            x++;
            var E = e.formatters[S];
            if (typeof E == "function") {
              var T = h[x];
              v = E.call(d, T), h.splice(x, 1), x--;
            }
            return v;
          }), e.formatArgs.call(d, h);
          var g = l.log || e.log || console.log.bind(console);
          g.apply(d, h);
        }
      }
      return l.namespace = u, l.enabled = e.enabled(u), l.useColors = e.useColors(), l.color = r(u), typeof e.init == "function" && e.init(l), l;
    }
    function o(u) {
      e.save(u), e.names = [], e.skips = [];
      for (var l = (typeof u == "string" ? u : "").split(/[\s,]+/), d = l.length, f = 0; f < d; f++)
        l[f] && (u = l[f].replace(/\*/g, ".*?"), u[0] === "-" ? e.skips.push(new RegExp("^" + u.substr(1) + "$")) : e.names.push(new RegExp("^" + u + "$")));
    }
    function s() {
      e.enable("");
    }
    function a(u) {
      var l, d;
      for (l = 0, d = e.skips.length; l < d; l++)
        if (e.skips[l].test(u))
          return !1;
      for (l = 0, d = e.names.length; l < d; l++)
        if (e.names[l].test(u))
          return !0;
      return !1;
    }
    function c(u) {
      return u instanceof Error ? u.stack || u.message : u;
    }
  })(Hh, Hh.exports)), Hh.exports;
}
var CF;
function nge() {
  return CF || (CF = 1, (function(t, e) {
    e = t.exports = tge(), e.log = i, e.formatArgs = r, e.save = o, e.load = s, e.useColors = n, e.storage = typeof chrome < "u" && typeof chrome.storage < "u" ? chrome.storage.local : a(), e.colors = [
      "lightseagreen",
      "forestgreen",
      "goldenrod",
      "dodgerblue",
      "darkorchid",
      "crimson"
    ];
    function n() {
      return typeof window < "u" && window.process && window.process.type === "renderer" ? !0 : typeof document < "u" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // is firebug? http://stackoverflow.com/a/398120/376773
      typeof window < "u" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // is firefox >= v31?
      // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
      typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // double check webkit in userAgent just in case we are in a worker
      typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
    }
    e.formatters.j = function(c) {
      try {
        return JSON.stringify(c);
      } catch (u) {
        return "[UnexpectedJSONParseError]: " + u.message;
      }
    };
    function r(c) {
      var u = this.useColors;
      if (c[0] = (u ? "%c" : "") + this.namespace + (u ? " %c" : " ") + c[0] + (u ? "%c " : " ") + "+" + e.humanize(this.diff), !!u) {
        var l = "color: " + this.color;
        c.splice(1, 0, l, "color: inherit");
        var d = 0, f = 0;
        c[0].replace(/%[a-zA-Z%]/g, function(m) {
          m !== "%%" && (d++, m === "%c" && (f = d));
        }), c.splice(f, 0, l);
      }
    }
    function i() {
      return typeof console == "object" && console.log && Function.prototype.apply.call(console.log, console, arguments);
    }
    function o(c) {
      try {
        c == null ? e.storage.removeItem("debug") : e.storage.debug = c;
      } catch {
      }
    }
    function s() {
      var c;
      try {
        c = e.storage.debug;
      } catch {
      }
      return !c && typeof process < "u" && "env" in process && (c = process.env.DEBUG), c;
    }
    e.enable(s());
    function a() {
      try {
        return window.localStorage;
      } catch {
      }
    }
  })(qh, qh.exports)), qh.exports;
}
/*!
 * on-headers
 * Copyright(c) 2014 Douglas Christopher Wilson
 * MIT Licensed
 */
var sw, TF;
function rge() {
  if (TF) return sw;
  TF = 1, sw = i;
  var t = fc, e = typeof t.ServerResponse.prototype.appendHeader == "function", n = e ? u : l;
  function r(d, f) {
    var m = !1;
    return function(y) {
      var x = a.apply(this, arguments);
      return m || (m = !0, f.call(this), typeof x[0] == "number" && this.statusCode !== x[0] && (x[0] = this.statusCode, x.length = 1)), d.apply(this, x);
    };
  }
  function i(d, f) {
    if (!d)
      throw new TypeError("argument res is required");
    if (typeof f != "function")
      throw new TypeError("argument listener must be a function");
    d.writeHead = r(d.writeHead, f);
  }
  function o(d, f) {
    if (f.length && Array.isArray(f[0]))
      c(d, f);
    else {
      if (f.length % 2 !== 0)
        throw new TypeError("headers array is malformed");
      n(d, f);
    }
  }
  function s(d, f) {
    for (var m = Object.keys(f), h = 0; h < m.length; h++) {
      var y = m[h];
      y && d.setHeader(y, f[y]);
    }
  }
  function a(d) {
    var f = arguments.length, m = f > 1 && typeof arguments[1] == "string" ? 2 : 1, h = f >= m + 1 ? arguments[m] : void 0;
    this.statusCode = d, Array.isArray(h) ? o(this, h) : h && s(this, h);
    for (var y = new Array(Math.min(f, m)), x = 0; x < y.length; x++)
      y[x] = arguments[x];
    return y;
  }
  function c(d, f) {
    for (var m, h = 0; h < f.length; h++)
      m = f[h][0], m && d.setHeader(m, f[h][1]);
  }
  function u(d, f) {
    for (var m = 0; m < f.length; m += 2)
      d.removeHeader(f[m]);
    for (var h, y = 0; y < f.length; y += 2)
      h = f[y], h && d.appendHeader(h, f[y + 1]);
  }
  function l(d, f) {
    for (var m, h = 0; h < f.length; h += 2)
      m = f[h], m && d.setHeader(m, f[h + 1]);
  }
  return sw;
}
/*!
 * compression
 * Copyright(c) 2010 Sencha Inc.
 * Copyright(c) 2011 TJ Holowaychuk
 * Copyright(c) 2014 Jonathan Ong
 * Copyright(c) 2014-2015 Douglas Christopher Wilson
 * MIT Licensed
 */
var kF;
function ige() {
  if (kF) return Uh.exports;
  kF = 1;
  var t = Vme(), e = Wg().Buffer, n = Yme(), r = Zme(), i = nge()("compression"), o = rge(), s = mU(), a = qu;
  Uh.exports = m, Uh.exports.filter = x;
  var c = "createBrotliCompress" in a, u = /(?:^|,)\s*?no-transform\s*?(?:,|$)/, l = c ? ["br", "gzip", "deflate", "identity"] : ["gzip", "deflate", "identity"], d = c ? ["br", "gzip"] : ["gzip"], f = ["gzip", "deflate", "identity", "br"];
  function m(E) {
    var T = E || {}, j = {};
    if (c) {
      Object.assign(j, T.brotli);
      var q = {};
      q[a.constants.BROTLI_PARAM_QUALITY] = 4, j.params = Object.assign(q, j.params);
    }
    var Y = T.filter || x, W = n.parse(T.threshold), G = T.enforceEncoding || "identity";
    return W == null && (W = 1024), function(B, D, X) {
      var V = !1, K, $ = [], _, I = D.end, N = D.on, U = D.write;
      D.flush = function() {
        _ && _.flush();
      }, D.write = function(k, M) {
        return V ? !1 : (S(D) || this.writeHead(this.statusCode), _ ? _.write(v(k, M)) : U.call(this, k, M));
      }, D.end = function(k, M) {
        return V ? !1 : (S(D) || (this.getHeader("Content-Length") || (K = y(k, M)), this.writeHead(this.statusCode)), _ ? (V = !0, k ? _.end(v(k, M)) : _.end()) : I.call(this, k, M));
      }, D.on = function(k, M) {
        return !$ || k !== "drain" ? N.call(this, k, M) : _ ? _.on(k, M) : ($.push([k, M]), this);
      };
      function C(L) {
        i("no compression: %s", L), h(D, N, $), $ = null;
      }
      o(D, function() {
        if (!Y(B, D)) {
          C("filtered");
          return;
        }
        if (!g(B, D)) {
          C("no transform");
          return;
        }
        if (s(D, "Accept-Encoding"), Number(D.getHeader("Content-Length")) < W || K < W) {
          C("size below threshold");
          return;
        }
        var k = D.getHeader("Content-Encoding") || "identity";
        if (k !== "identity") {
          C("already encoded");
          return;
        }
        if (B.method === "HEAD") {
          C("HEAD request");
          return;
        }
        var M = new t(B), F = M.encoding(l, d);
        if (!B.headers["accept-encoding"] && f.indexOf(G) !== -1 && (F = G), !F || F === "identity") {
          C("not acceptable");
          return;
        }
        i("%s compression", F), _ = F === "gzip" ? a.createGzip(T) : F === "br" ? a.createBrotliCompress(j) : a.createDeflate(T), h(_, _.on, $), D.setHeader("Content-Encoding", F), D.removeHeader("Content-Length"), _.on("data", function(O) {
          U.call(D, O) === !1 && _.pause();
        }), _.on("end", function() {
          I.call(D);
        }), N.call(D, "drain", function() {
          _.resume();
        });
      }), X();
    };
  }
  function h(E, T, j) {
    for (var q = 0; q < j.length; q++)
      T.apply(E, j[q]);
  }
  function y(E, T) {
    return E ? e.isBuffer(E) ? E.length : e.byteLength(E, T) : 0;
  }
  function x(E, T) {
    var j = T.getHeader("Content-Type");
    return j === void 0 || !r(j) ? (i("%s not compressible", j), !1) : !0;
  }
  function g(E, T) {
    var j = T.getHeader("Cache-Control");
    return !j || !u.test(j);
  }
  function v(E, T) {
    return e.isBuffer(E) ? E : e.from(E, T);
  }
  function S(E) {
    return typeof E.headersSent != "boolean" ? !!E._header : E.headersSent;
  }
  return Uh.exports;
}
var oge = ige();
const NF = /* @__PURE__ */ Bo(oge), sge = Pg(import.meta.url), PF = H_(sge), Bn = ru();
let Et, at, U_, L_, jt = null;
const DF = 100;
let AU = 6099, j_ = null, IU = "";
function CU(t) {
  IU = t;
}
function ls() {
  return IU;
}
function age(t) {
  j_ = t;
}
async function cge(t) {
  try {
    await pge(t.host);
    const e = parseInt(process.env.NAPCAT_WEBUI_PREFERRED_PORT || "", 10);
    let n;
    if (e > 0)
      try {
        n = await pm(e, t.host, 0, !0);
      } catch {
        n = await pm(t.port, t.host);
      }
    else
      n = await pm(t.port, t.host);
    return [t.host, n, t.token];
  } catch (e) {
    return console.log("host或port不可用", e), ["", 0, CL()];
  }
}
async function uge(t) {
  try {
    const e = yn(at.configPath, "cert.pem"), n = yn(at.configPath, "key.pem");
    if (sr(e) && sr(n)) {
      const r = Fo(e, "utf8"), i = Fo(n, "utf8");
      return t.log("[NapCat] [WebUi] 找到SSL证书，将启用HTTPS模式"), { cert: r, key: i };
    }
    return null;
  } catch (e) {
    return t.log("[NapCat] [WebUi] 检查SSL证书时出错: " + e), null;
  }
}
async function lge(t, e, n, r) {
  at = e, U_ = n, L_ = r, jt = t, Et = new qae();
  let i = await Et.GetWebUIConfig();
  if (i.disableWebUI) {
    t.log("[NapCat] [WebUi] WebUI is disabled by configuration.");
    return;
  }
  if (process.env.NAPCAT_WEBUI_SECRET_KEY && i.token !== process.env.NAPCAT_WEBUI_SECRET_KEY)
    await Et.UpdateWebUIConfig({ token: process.env.NAPCAT_WEBUI_SECRET_KEY }), t.log(`[NapCat] [WebUi] 检测到环境变量配置，已更新 WebUI Token 为 ${process.env.NAPCAT_WEBUI_SECRET_KEY}`), i = await Et.GetWebUIConfig();
  else if (i.token === "napcat" || !i.token) {
    const f = LR(8);
    await Et.UpdateWebUIConfig({ token: f }), t.log("[NapCat] [WebUi] 检测到默认密码，已自动更新为安全密码"), age(f), t.log("[NapCat] [WebUi] 新密码将在QQ登录成功后发送给用户"), i = await Et.GetWebUIConfig();
  }
  CU(i.token);
  const [o, s, a] = await cge(i);
  if (AU = s, s === 0) {
    t.log("[NapCat] [WebUi] Current WebUi is not run.");
    return;
  }
  ve.setWebUiConfigQuickFunction(
    async () => {
      const f = process.env.NAPCAT_QUICK_ACCOUNT || Et.getAutoLoginAccount(), m = () => {
        const y = process.env.NAPCAT_QUICK_PASSWORD_MD5?.trim();
        if (y) {
          if (/^[a-fA-F0-9]{32}$/.test(y))
            return y.toLowerCase();
          console.log("[NapCat] [WebUi] NAPCAT_QUICK_PASSWORD_MD5 格式无效（需为 32 位 MD5）");
        }
        const x = process.env.NAPCAT_QUICK_PASSWORD;
        if (typeof x == "string" && x.length > 0)
          return console.log("[NapCat] [WebUi] 检测到 NAPCAT_QUICK_PASSWORD，已在内存中计算 MD5 用于回退登录"), _d("md5").update(x, "utf8").digest("hex");
      };
      if (!f)
        return;
      const h = m();
      try {
        const { result: y, message: x } = await ve.requestQuickLogin(f);
        if (y) {
          console.log(`[NapCat] [WebUi] 自动快速登录成功: ${f}`);
          return;
        }
        console.log(`[NapCat] [WebUi] 自动快速登录失败: ${x || "未知错误"}`);
      } catch (y) {
        console.log("[NapCat] [WebUi] 自动快速登录异常:" + y);
      }
      if (!h) {
        console.log(`[NapCat] [WebUi] QQ ${f} 未配置回退密码环境变量，建议优先使用 ACCOUNT + NAPCAT_QUICK_PASSWORD（NAPCAT_QUICK_PASSWORD_MD5 作为备用），保持二维码登录兜底`);
        return;
      }
      try {
        const { result: y, message: x, needCaptcha: g, needNewDevice: v } = await ve.requestPasswordLogin(f, h);
        if (y) {
          console.log(`[NapCat] [WebUi] 自动密码回退登录成功: ${f}`);
          return;
        }
        if (g) {
          console.log(`[NapCat] [WebUi] 自动密码回退登录需要验证码，请在登录页面继续完成: ${f}`);
          return;
        }
        if (v) {
          console.log(`[NapCat] [WebUi] 自动密码回退登录需要新设备验证，请在登录页面继续完成: ${f}`);
          return;
        }
        console.log(`[NapCat] [WebUi] 自动密码回退登录失败: ${x || "未知错误"}`);
      } catch (y) {
        console.log("[NapCat] [WebUi] 自动密码回退登录异常:" + y);
      }
    }
  ), Bn.use(ru.json()), Bn.use(NF({
    level: 6,
    // 压缩级别 1-9，6 是性能和压缩率的平衡点
    threshold: 1024,
    // 只压缩大于 1KB 的响应
    filter: (f, m) => f.headers.accept === "text/event-stream" ? !1 : NF.filter(f, m)
  })), Bn.use(qme), Bn.use("/webui/fonts/CustomFont.woff", async (f, m) => {
    const h = await Et.GetWebUIFontPath();
    h ? m.sendFile(h) : m.status(404).send("Custom font not found");
  }), Bn.use("/files/theme.css", async (f, m) => {
    const h = await Et.GetTheme(), y = h.fontMode || "system";
    let x = "";
    y === "aacute" ? x += `
@font-face {
  font-family: 'Aa偷吃可爱长大的';
  src: url('/webui/fonts/AaCute.woff') format('woff');
  font-display: swap;
}
` : y === "custom" && (x += `
@font-face {
  font-family: 'CustomFont';
  src: url('/webui/fonts/CustomFont.woff') format('woff');
  font-display: swap;
}
`), x += ':root, .light, [data-theme="light"] {';
    for (const g in h.light)
      x += `${g}: ${h.light[g]};`;
    y === "aacute" ? (x += "--font-family-base: 'Aa偷吃可爱长大的', var(--font-family-fallbacks) !important;", x += "--font-family-mono: 'Aa偷吃可爱长大的', var(--font-family-fallbacks) !important;") : y === "custom" ? (x += "--font-family-base: 'CustomFont', var(--font-family-fallbacks) !important;", x += "--font-family-mono: 'CustomFont', var(--font-family-fallbacks) !important;") : (x += "--font-family-base: var(--font-family-fallbacks) !important;", x += '--font-family-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;'), x += "}", x += '.dark, [data-theme="dark"] {';
    for (const g in h.dark)
      x += `${g}: ${h.dark[g]};`;
    y === "aacute" ? (x += "--font-family-base: 'Aa偷吃可爱长大的', var(--font-family-fallbacks) !important;", x += "--font-family-mono: 'Aa偷吃可爱长大的', var(--font-family-fallbacks) !important;") : y === "custom" ? (x += "--font-family-base: 'CustomFont', var(--font-family-fallbacks) !important;", x += "--font-family-mono: 'CustomFont', var(--font-family-fallbacks) !important;") : (x += "--font-family-base: var(--font-family-fallbacks) !important;", x += '--font-family-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;'), x += "}", m.send(x);
  }), Bn.get("/webui/sw.js", async (f, m) => {
    try {
      let h = kn(PF, "static", "sw_template.js");
      sr(h) || (h = kn(PF, "src", "assets", "sw_template.js"));
      let y = Fo(h, "utf-8");
      y = y.replace("{{VERSION}}", Hu), m.header("Content-Type", "application/javascript"), m.header("Service-Worker-Allowed", "/webui/"), m.header("Cache-Control", "no-cache, no-store, must-revalidate"), m.send(y);
    } catch (h) {
      console.error("[NapCat] [WebUi] Error generating sw.js", h), m.status(500).send("Error generating service worker");
    }
  }), Bn.use("/webui", ru.static(e.staticPath, {
    maxAge: "1d"
  })), Bn.use("/plugin/:pluginId/mem", async (f, m) => {
    const { pluginId: h } = f.params;
    if (!h) return m.status(400).json({ code: -1, message: "Plugin ID is required" });
    const y = ve.getOneBotContext();
    if (!y) return m.status(503).json({ code: -1, message: "OneBot context not available" });
    const x = y.networkManager.findSomeAdapter("plugin_manager");
    if (!x) return m.status(503).json({ code: -1, message: "Plugin manager not available" });
    const v = x.getPluginRouter(h)?.getMemoryStaticRoutes() || [];
    for (const { urlPath: S, files: E } of v) {
      const T = S.startsWith("/") ? S : "/" + S;
      if (f.path.startsWith(T)) {
        const j = "/" + (f.path.substring(T.length).replace(/^\//, "") || ""), q = E.find((Y) => "/" + Y.path.replace(/^\//, "") === j);
        if (q)
          try {
            const Y = typeof q.content == "function" ? await q.content() : q.content;
            return m.setHeader("Content-Type", q.contentType || "application/octet-stream"), m.send(Y);
          } catch (Y) {
            return console.error(`[Plugin: ${h}] Error serving memory file:`, Y), m.status(500).json({ code: -1, message: "Error serving memory file" });
          }
      }
    }
    return m.status(404).json({ code: -1, message: "Memory file not found" });
  }), Bn.use("/plugin/:pluginId/api", (f, m, h) => {
    const { pluginId: y } = f.params;
    if (!y) return m.status(400).json({ code: -1, message: "Plugin ID is required" });
    const x = ve.getOneBotContext();
    if (!x) return m.status(503).json({ code: -1, message: "OneBot context not available" });
    const g = x.networkManager.findSomeAdapter("plugin_manager");
    if (!g) return m.status(503).json({ code: -1, message: "Plugin manager not available" });
    const v = g.getPluginRouter(y);
    return !v || !v.hasApiNoAuthRoutes() ? m.status(404).json({ code: -1, message: `Plugin '${y}' has no registered no-auth API routes` }) : v.buildApiNoAuthRouter()(f, m, h);
  }), Bn.get("/plugin/:pluginId/page/:pagePath", (f, m) => {
    const { pluginId: h, pagePath: y } = f.params;
    if (!h) return m.status(400).json({ code: -1, message: "Plugin ID is required" });
    const x = ve.getOneBotContext();
    if (!x) return m.status(503).json({ code: -1, message: "OneBot context not available" });
    const g = x.networkManager.findSomeAdapter("plugin_manager");
    if (!g) return m.status(503).json({ code: -1, message: "Plugin manager not available" });
    const v = g.getPluginRouter(h);
    if (!v || !v.hasPages())
      return m.status(404).json({ code: -1, message: `Plugin '${h}' has no registered pages` });
    const E = v.getPages().find((q) => q.path === "/" + y || q.path === y);
    if (!E)
      return m.status(404).json({ code: -1, message: `Page '${y}' not found in plugin '${h}'` });
    const T = v.getPluginPath();
    if (!T)
      return m.status(500).json({ code: -1, message: "Plugin path not available" });
    const j = yn(T, E.htmlFile);
    return sr(j) ? m.sendFile(j) : m.status(404).json({ code: -1, message: `HTML file not found: ${E.htmlFile}` });
  }), Bn.use("/plugin/:pluginId/files", (f, m, h) => {
    const { pluginId: y } = f.params;
    if (!y) return m.status(400).json({ code: -1, message: "Plugin ID is required" });
    const x = ve.getOneBotContext();
    if (!x) return m.status(503).json({ code: -1, message: "OneBot context not available" });
    const g = x.networkManager.findSomeAdapter("plugin_manager");
    if (!g) return m.status(503).json({ code: -1, message: "Plugin manager not available" });
    const S = g.getPluginRouter(y)?.getStaticRoutes() || [];
    for (const { urlPath: E, localPath: T } of S) {
      const j = E.startsWith("/") ? E : "/" + E;
      if (f.path.startsWith(j) || f.path === j.slice(0, -1)) {
        const q = ru.static(T, { maxAge: "1d" }), Y = f.url;
        return f.url = "/" + (f.path.substring(j.length).replace(/^\//, "") || ""), q(f, m, (W) => {
          f.url = Y, W ? h(W) : h();
        });
      }
    }
    m.status(404).json({ code: -1, message: "Static resource not found" });
  });
  const c = await uge(t), l = !!c && c ? yL(c, Bn) : vL(Bn);
  l.on("upgrade", (f, m, h) => {
    new URL(f.url || "", `http://${f.headers.host}`).pathname.startsWith("/api/Debug/ws") ? tme(f, m, h) : by.initialize(f, m, h, t);
  }), Bn.use("/api", _r);
  const d = yn(e.staticPath, "index.html");
  Bn.all(/\/webui\/(.*)/, (f, m) => {
    m.sendFile(d);
  }), Bn.all("/", (f, m) => {
    m.status(301).header("Location", "/webui").send();
  }), Bn.use((f, m, h, y) => {
    if (f instanceof ds.MulterError)
      return ne(h, f.message, !0);
    y(f);
  }), Bn.use((f, m, h, y) => {
    ne(h, "An unknown error occurred.", !0);
  }), l.listen(s, o, async () => {
    const f = { token: a };
    t.log(`[NapCat] [WebUi] WebUi Token: ${a}`), t.log(
      `[NapCat] [WebUi] WebUi User Panel Url: ${MN("127.0.0.1", s.toString(), "/webui", f)}`
    ), o !== "" && t.log(
      `[NapCat] [WebUi] WebUi User Panel Url: ${MN(o, s.toString(), "/webui", f)}`
    );
  });
}
async function pge(t) {
  return new Promise((e, n) => {
    try {
      const r = gO.createServer();
      r.on("listening", () => {
        r.close(), e(t);
      }), r.on("error", (i) => {
        i.code === "EADDRNOTAVAIL" ? n(new Error("主机地址验证失败，可能为非本机地址")) : n(new Error(`遇到错误: ${i.code}`));
      }), r.listen(0, t);
    } catch (r) {
      n(new Error(`服务器启动时发生错误: ${r}`));
    }
  });
}
async function pm(t, e, n = 0, r = !1) {
  return new Promise((i, o) => {
    try {
      const s = gO.createServer();
      s.on("listening", () => {
        s.close(), i(t);
      }), s.on("error", (a) => {
        a.code === "EADDRINUSE" ? r ? o(new Error(`端口 ${t} 已被占用`)) : n < DF ? i(pm(t + 1, e, n + 1, !1)) : o(new Error(`端口尝试失败，达到最大尝试次数: ${DF}`)) : o(new Error(`遇到错误: ${a.code}`));
      }), s.listen(t, e);
    } catch (s) {
      o(new Error(`服务器启动时发生错误: ${s}`));
    }
  });
}
class Ps extends T2 {
  post_type = ju.NOTICE;
}
class TU extends Ps {
  notice_type = "notify";
  sub_type = "poke";
  target_id = 0;
  user_id = 0;
}
class dge extends TU {
  raw_info;
  sender_id;
  // raw_message nb等框架标准为string
  constructor(e, n, r, i, o) {
    super(e), this.target_id = i, this.user_id = n, this.sender_id = r, this.raw_info = o;
  }
}
class fge extends TU {
  group_id;
  raw_info;
  // raw_message nb等框架标准为string
  constructor(e, n, r, i, o) {
    super(e), this.group_id = n, this.target_id = i, this.user_id = r, this.raw_info = o;
  }
}
class hge {
  obContext;
  core;
  constructor(e, n) {
    this.obContext = e, this.core = n;
  }
  // 使用前预先判断 busiId 1061
  async parsePrivatePokeEvent(e, n) {
    const i = JSON.parse(e.jsonGrayTipElement.jsonStr).items, o = i.filter((s) => s.uid);
    if (o.length === 2 && o[0]?.uid && o[1]?.uid)
      return new dge(
        this.core,
        n,
        parseInt(await this.core.apis.UserApi.getUinByUidV2(o[0].uid)),
        parseInt(await this.core.apis.UserApi.getUinByUidV2(o[1].uid)),
        i
      );
  }
}
class xo extends Ps {
  group_id;
  user_id;
  constructor(e, n, r) {
    super(e), this.group_id = n, this.user_id = r;
  }
}
class mge extends xo {
  notice_type = "group_ban";
  operator_id;
  duration;
  sub_type;
  constructor(e, n, r, i, o, s) {
    super(e, n, r), this.group_id = n, this.operator_id = i, this.user_id = r, this.duration = o, this.sub_type = s;
  }
}
var aw = {}, cw = {}, FF;
function k2() {
  return FF || (FF = 1, (function(t) {
    const e = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", n = e + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040", r = "[" + e + "][" + n + "]*", i = new RegExp("^" + r + "$"), o = function(a, c) {
      const u = [];
      let l = c.exec(a);
      for (; l; ) {
        const d = [];
        d.startIndex = c.lastIndex - l[0].length;
        const f = l.length;
        for (let m = 0; m < f; m++)
          d.push(l[m]);
        u.push(d), l = c.exec(a);
      }
      return u;
    }, s = function(a) {
      const c = i.exec(a);
      return !(c === null || typeof c > "u");
    };
    t.isExist = function(a) {
      return typeof a < "u";
    }, t.isEmptyObject = function(a) {
      return Object.keys(a).length === 0;
    }, t.merge = function(a, c, u) {
      if (c) {
        const l = Object.keys(c), d = l.length;
        for (let f = 0; f < d; f++)
          u === "strict" ? a[l[f]] = [c[l[f]]] : a[l[f]] = c[l[f]];
      }
    }, t.getValue = function(a) {
      return t.isExist(a) ? a : "";
    }, t.isName = s, t.getAllMatches = o, t.nameRegexp = r;
  })(cw)), cw;
}
var OF;
function kU() {
  if (OF) return aw;
  OF = 1;
  const t = k2(), e = {
    allowBooleanAttributes: !1,
    //A tag can have attributes without any value
    unpairedTags: []
  };
  aw.validate = function(g, v) {
    v = Object.assign({}, e, v);
    const S = [];
    let E = !1, T = !1;
    g[0] === "\uFEFF" && (g = g.substr(1));
    for (let j = 0; j < g.length; j++)
      if (g[j] === "<" && g[j + 1] === "?") {
        if (j += 2, j = r(g, j), j.err) return j;
      } else if (g[j] === "<") {
        let q = j;
        if (j++, g[j] === "!") {
          j = i(g, j);
          continue;
        } else {
          let Y = !1;
          g[j] === "/" && (Y = !0, j++);
          let W = "";
          for (; j < g.length && g[j] !== ">" && g[j] !== " " && g[j] !== "	" && g[j] !== `
` && g[j] !== "\r"; j++)
            W += g[j];
          if (W = W.trim(), W[W.length - 1] === "/" && (W = W.substring(0, W.length - 1), j--), !h(W)) {
            let B;
            return W.trim().length === 0 ? B = "Invalid space after '<'." : B = "Tag '" + W + "' is an invalid name.", f("InvalidTag", B, y(g, j));
          }
          const G = a(g, j);
          if (G === !1)
            return f("InvalidAttr", "Attributes for '" + W + "' have open quote.", y(g, j));
          let J = G.value;
          if (j = G.index, J[J.length - 1] === "/") {
            const B = j - J.length;
            J = J.substring(0, J.length - 1);
            const D = u(J, v);
            if (D === !0)
              E = !0;
            else
              return f(D.err.code, D.err.msg, y(g, B + D.err.line));
          } else if (Y)
            if (G.tagClosed) {
              if (J.trim().length > 0)
                return f("InvalidTag", "Closing tag '" + W + "' can't have attributes or invalid starting.", y(g, q));
              if (S.length === 0)
                return f("InvalidTag", "Closing tag '" + W + "' has not been opened.", y(g, q));
              {
                const B = S.pop();
                if (W !== B.tagName) {
                  let D = y(g, B.tagStartPos);
                  return f(
                    "InvalidTag",
                    "Expected closing tag '" + B.tagName + "' (opened in line " + D.line + ", col " + D.col + ") instead of closing tag '" + W + "'.",
                    y(g, q)
                  );
                }
                S.length == 0 && (T = !0);
              }
            } else return f("InvalidTag", "Closing tag '" + W + "' doesn't have proper closing.", y(g, j));
          else {
            const B = u(J, v);
            if (B !== !0)
              return f(B.err.code, B.err.msg, y(g, j - J.length + B.err.line));
            if (T === !0)
              return f("InvalidXml", "Multiple possible root nodes found.", y(g, j));
            v.unpairedTags.indexOf(W) !== -1 || S.push({ tagName: W, tagStartPos: q }), E = !0;
          }
          for (j++; j < g.length; j++)
            if (g[j] === "<")
              if (g[j + 1] === "!") {
                j++, j = i(g, j);
                continue;
              } else if (g[j + 1] === "?") {
                if (j = r(g, ++j), j.err) return j;
              } else
                break;
            else if (g[j] === "&") {
              const B = d(g, j);
              if (B == -1)
                return f("InvalidChar", "char '&' is not expected.", y(g, j));
              j = B;
            } else if (T === !0 && !n(g[j]))
              return f("InvalidXml", "Extra text at the end", y(g, j));
          g[j] === "<" && j--;
        }
      } else {
        if (n(g[j]))
          continue;
        return f("InvalidChar", "char '" + g[j] + "' is not expected.", y(g, j));
      }
    if (E) {
      if (S.length == 1)
        return f("InvalidTag", "Unclosed tag '" + S[0].tagName + "'.", y(g, S[0].tagStartPos));
      if (S.length > 0)
        return f("InvalidXml", "Invalid '" + JSON.stringify(S.map((j) => j.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 });
    } else return f("InvalidXml", "Start tag expected.", 1);
    return !0;
  };
  function n(g) {
    return g === " " || g === "	" || g === `
` || g === "\r";
  }
  function r(g, v) {
    const S = v;
    for (; v < g.length; v++)
      if (g[v] == "?" || g[v] == " ") {
        const E = g.substr(S, v - S);
        if (v > 5 && E === "xml")
          return f("InvalidXml", "XML declaration allowed only at the start of the document.", y(g, v));
        if (g[v] == "?" && g[v + 1] == ">") {
          v++;
          break;
        } else
          continue;
      }
    return v;
  }
  function i(g, v) {
    if (g.length > v + 5 && g[v + 1] === "-" && g[v + 2] === "-") {
      for (v += 3; v < g.length; v++)
        if (g[v] === "-" && g[v + 1] === "-" && g[v + 2] === ">") {
          v += 2;
          break;
        }
    } else if (g.length > v + 8 && g[v + 1] === "D" && g[v + 2] === "O" && g[v + 3] === "C" && g[v + 4] === "T" && g[v + 5] === "Y" && g[v + 6] === "P" && g[v + 7] === "E") {
      let S = 1;
      for (v += 8; v < g.length; v++)
        if (g[v] === "<")
          S++;
        else if (g[v] === ">" && (S--, S === 0))
          break;
    } else if (g.length > v + 9 && g[v + 1] === "[" && g[v + 2] === "C" && g[v + 3] === "D" && g[v + 4] === "A" && g[v + 5] === "T" && g[v + 6] === "A" && g[v + 7] === "[") {
      for (v += 8; v < g.length; v++)
        if (g[v] === "]" && g[v + 1] === "]" && g[v + 2] === ">") {
          v += 2;
          break;
        }
    }
    return v;
  }
  const o = '"', s = "'";
  function a(g, v) {
    let S = "", E = "", T = !1;
    for (; v < g.length; v++) {
      if (g[v] === o || g[v] === s)
        E === "" ? E = g[v] : E !== g[v] || (E = "");
      else if (g[v] === ">" && E === "") {
        T = !0;
        break;
      }
      S += g[v];
    }
    return E !== "" ? !1 : {
      value: S,
      index: v,
      tagClosed: T
    };
  }
  const c = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g");
  function u(g, v) {
    const S = t.getAllMatches(g, c), E = {};
    for (let T = 0; T < S.length; T++) {
      if (S[T][1].length === 0)
        return f("InvalidAttr", "Attribute '" + S[T][2] + "' has no space in starting.", x(S[T]));
      if (S[T][3] !== void 0 && S[T][4] === void 0)
        return f("InvalidAttr", "Attribute '" + S[T][2] + "' is without value.", x(S[T]));
      if (S[T][3] === void 0 && !v.allowBooleanAttributes)
        return f("InvalidAttr", "boolean attribute '" + S[T][2] + "' is not allowed.", x(S[T]));
      const j = S[T][2];
      if (!m(j))
        return f("InvalidAttr", "Attribute '" + j + "' is an invalid name.", x(S[T]));
      if (!E.hasOwnProperty(j))
        E[j] = 1;
      else
        return f("InvalidAttr", "Attribute '" + j + "' is repeated.", x(S[T]));
    }
    return !0;
  }
  function l(g, v) {
    let S = /\d/;
    for (g[v] === "x" && (v++, S = /[\da-fA-F]/); v < g.length; v++) {
      if (g[v] === ";")
        return v;
      if (!g[v].match(S))
        break;
    }
    return -1;
  }
  function d(g, v) {
    if (v++, g[v] === ";")
      return -1;
    if (g[v] === "#")
      return v++, l(g, v);
    let S = 0;
    for (; v < g.length; v++, S++)
      if (!(g[v].match(/\w/) && S < 20)) {
        if (g[v] === ";")
          break;
        return -1;
      }
    return v;
  }
  function f(g, v, S) {
    return {
      err: {
        code: g,
        msg: v,
        line: S.line || S,
        col: S.col
      }
    };
  }
  function m(g) {
    return t.isName(g);
  }
  function h(g) {
    return t.isName(g);
  }
  function y(g, v) {
    const S = g.substring(0, v).split(/\r?\n/);
    return {
      line: S.length,
      // column number is last line's length + 1, because column numbering starts at 1:
      col: S[S.length - 1].length + 1
    };
  }
  function x(g) {
    return g.startIndex + g[1].length;
  }
  return aw;
}
var Wh = {}, MF;
function gge() {
  if (MF) return Wh;
  MF = 1;
  const t = {
    preserveOrder: !1,
    attributeNamePrefix: "@_",
    attributesGroupName: !1,
    textNodeName: "#text",
    ignoreAttributes: !0,
    removeNSPrefix: !1,
    // remove NS from tag name or attribute name if true
    allowBooleanAttributes: !1,
    //a tag can have attributes without any value
    //ignoreRootElement : false,
    parseTagValue: !0,
    parseAttributeValue: !1,
    trimValues: !0,
    //Trim string values of tag and attributes
    cdataPropName: !1,
    numberParseOptions: {
      hex: !0,
      leadingZeros: !0,
      eNotation: !0
    },
    tagValueProcessor: function(n, r) {
      return r;
    },
    attributeValueProcessor: function(n, r) {
      return r;
    },
    stopNodes: [],
    //nested tags will not be parsed even for errors
    alwaysCreateTextNode: !1,
    isArray: () => !1,
    commentPropName: !1,
    unpairedTags: [],
    processEntities: !0,
    htmlEntities: !1,
    ignoreDeclaration: !1,
    ignorePiTags: !1,
    transformTagName: !1,
    transformAttributeName: !1,
    updateTag: function(n, r, i) {
      return n;
    }
    // skipEmptyListItem: false
  }, e = function(n) {
    return Object.assign({}, t, n);
  };
  return Wh.buildOptions = e, Wh.defaultOptions = t, Wh;
}
var uw, RF;
function yge() {
  if (RF) return uw;
  RF = 1;
  class t {
    constructor(n) {
      this.tagname = n, this.child = [], this[":@"] = {};
    }
    add(n, r) {
      n === "__proto__" && (n = "#__proto__"), this.child.push({ [n]: r });
    }
    addChild(n) {
      n.tagname === "__proto__" && (n.tagname = "#__proto__"), n[":@"] && Object.keys(n[":@"]).length > 0 ? this.child.push({ [n.tagname]: n.child, ":@": n[":@"] }) : this.child.push({ [n.tagname]: n.child });
    }
  }
  return uw = t, uw;
}
var lw, BF;
function vge() {
  if (BF) return lw;
  BF = 1;
  const t = k2();
  function e(u, l) {
    const d = {};
    if (u[l + 3] === "O" && u[l + 4] === "C" && u[l + 5] === "T" && u[l + 6] === "Y" && u[l + 7] === "P" && u[l + 8] === "E") {
      l = l + 9;
      let f = 1, m = !1, h = !1, y = "";
      for (; l < u.length; l++)
        if (u[l] === "<" && !h) {
          if (m && i(u, l)) {
            l += 7;
            let x, g;
            [x, g, l] = n(u, l + 1), g.indexOf("&") === -1 && (d[c(x)] = {
              regx: RegExp(`&${x};`, "g"),
              val: g
            });
          } else if (m && o(u, l)) l += 8;
          else if (m && s(u, l)) l += 8;
          else if (m && a(u, l)) l += 9;
          else if (r) h = !0;
          else throw new Error("Invalid DOCTYPE");
          f++, y = "";
        } else if (u[l] === ">") {
          if (h ? u[l - 1] === "-" && u[l - 2] === "-" && (h = !1, f--) : f--, f === 0)
            break;
        } else u[l] === "[" ? m = !0 : y += u[l];
      if (f !== 0)
        throw new Error("Unclosed DOCTYPE");
    } else
      throw new Error("Invalid Tag instead of DOCTYPE");
    return { entities: d, i: l };
  }
  function n(u, l) {
    let d = "";
    for (; l < u.length && u[l] !== "'" && u[l] !== '"'; l++)
      d += u[l];
    if (d = d.trim(), d.indexOf(" ") !== -1) throw new Error("External entites are not supported");
    const f = u[l++];
    let m = "";
    for (; l < u.length && u[l] !== f; l++)
      m += u[l];
    return [d, m, l];
  }
  function r(u, l) {
    return u[l + 1] === "!" && u[l + 2] === "-" && u[l + 3] === "-";
  }
  function i(u, l) {
    return u[l + 1] === "!" && u[l + 2] === "E" && u[l + 3] === "N" && u[l + 4] === "T" && u[l + 5] === "I" && u[l + 6] === "T" && u[l + 7] === "Y";
  }
  function o(u, l) {
    return u[l + 1] === "!" && u[l + 2] === "E" && u[l + 3] === "L" && u[l + 4] === "E" && u[l + 5] === "M" && u[l + 6] === "E" && u[l + 7] === "N" && u[l + 8] === "T";
  }
  function s(u, l) {
    return u[l + 1] === "!" && u[l + 2] === "A" && u[l + 3] === "T" && u[l + 4] === "T" && u[l + 5] === "L" && u[l + 6] === "I" && u[l + 7] === "S" && u[l + 8] === "T";
  }
  function a(u, l) {
    return u[l + 1] === "!" && u[l + 2] === "N" && u[l + 3] === "O" && u[l + 4] === "T" && u[l + 5] === "A" && u[l + 6] === "T" && u[l + 7] === "I" && u[l + 8] === "O" && u[l + 9] === "N";
  }
  function c(u) {
    if (t.isName(u))
      return u;
    throw new Error(`Invalid entity name ${u}`);
  }
  return lw = e, lw;
}
var pw, UF;
function bge() {
  if (UF) return pw;
  UF = 1;
  const t = /^[-+]?0x[a-fA-F0-9]+$/, e = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, n = {
    hex: !0,
    // oct: false,
    leadingZeros: !0,
    decimalPoint: ".",
    eNotation: !0
    //skipLike: /regex/
  };
  function r(s, a = {}) {
    if (a = Object.assign({}, n, a), !s || typeof s != "string") return s;
    let c = s.trim();
    if (a.skipLike !== void 0 && a.skipLike.test(c)) return s;
    if (s === "0") return 0;
    if (a.hex && t.test(c))
      return o(c, 16);
    if (c.search(/[eE]/) !== -1) {
      const u = c.match(/^([-\+])?(0*)([0-9]*(\.[0-9]*)?[eE][-\+]?[0-9]+)$/);
      if (u) {
        if (a.leadingZeros)
          c = (u[1] || "") + u[3];
        else if (!(u[2] === "0" && u[3][0] === ".")) return s;
        return a.eNotation ? Number(c) : s;
      } else
        return s;
    } else {
      const u = e.exec(c);
      if (u) {
        const l = u[1], d = u[2];
        let f = i(u[3]);
        if (!a.leadingZeros && d.length > 0 && l && c[2] !== ".") return s;
        if (!a.leadingZeros && d.length > 0 && !l && c[1] !== ".") return s;
        if (a.leadingZeros && d === s) return 0;
        {
          const m = Number(c), h = "" + m;
          return h.search(/[eE]/) !== -1 ? a.eNotation ? m : s : c.indexOf(".") !== -1 ? h === "0" && f === "" || h === f || l && h === "-" + f ? m : s : d ? f === h || l + f === h ? m : s : c === h || c === l + h ? m : s;
        }
      } else
        return s;
    }
  }
  function i(s) {
    return s && s.indexOf(".") !== -1 && (s = s.replace(/0+$/, ""), s === "." ? s = "0" : s[0] === "." ? s = "0" + s : s[s.length - 1] === "." && (s = s.substr(0, s.length - 1))), s;
  }
  function o(s, a) {
    if (parseInt) return parseInt(s, a);
    if (Number.parseInt) return Number.parseInt(s, a);
    if (window && window.parseInt) return window.parseInt(s, a);
    throw new Error("parseInt, Number.parseInt, window.parseInt are not supported");
  }
  return pw = r, pw;
}
var dw, LF;
function NU() {
  if (LF) return dw;
  LF = 1;
  function t(e) {
    return typeof e == "function" ? e : Array.isArray(e) ? (n) => {
      for (const r of e)
        if (typeof r == "string" && n === r || r instanceof RegExp && r.test(n))
          return !0;
    } : () => !1;
  }
  return dw = t, dw;
}
var fw, jF;
function xge() {
  if (jF) return fw;
  jF = 1;
  const t = k2(), e = yge(), n = vge(), r = bge(), i = NU();
  class o {
    constructor(j) {
      this.options = j, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = {
        apos: { regex: /&(apos|#39|#x27);/g, val: "'" },
        gt: { regex: /&(gt|#62|#x3E);/g, val: ">" },
        lt: { regex: /&(lt|#60|#x3C);/g, val: "<" },
        quot: { regex: /&(quot|#34|#x22);/g, val: '"' }
      }, this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }, this.htmlEntities = {
        space: { regex: /&(nbsp|#160);/g, val: " " },
        // "lt" : { regex: /&(lt|#60);/g, val: "<" },
        // "gt" : { regex: /&(gt|#62);/g, val: ">" },
        // "amp" : { regex: /&(amp|#38);/g, val: "&" },
        // "quot" : { regex: /&(quot|#34);/g, val: "\"" },
        // "apos" : { regex: /&(apos|#39);/g, val: "'" },
        cent: { regex: /&(cent|#162);/g, val: "¢" },
        pound: { regex: /&(pound|#163);/g, val: "£" },
        yen: { regex: /&(yen|#165);/g, val: "¥" },
        euro: { regex: /&(euro|#8364);/g, val: "€" },
        copyright: { regex: /&(copy|#169);/g, val: "©" },
        reg: { regex: /&(reg|#174);/g, val: "®" },
        inr: { regex: /&(inr|#8377);/g, val: "₹" },
        num_dec: { regex: /&#([0-9]{1,7});/g, val: (q, Y) => String.fromCharCode(Number.parseInt(Y, 10)) },
        num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (q, Y) => String.fromCharCode(Number.parseInt(Y, 16)) }
      }, this.addExternalEntities = s, this.parseXml = d, this.parseTextData = a, this.resolveNameSpace = c, this.buildAttributesMap = l, this.isItStopNode = y, this.replaceEntitiesValue = m, this.readStopNodeData = S, this.saveTextToParentTag = h, this.addChild = f, this.ignoreAttributesFn = i(this.options.ignoreAttributes);
    }
  }
  function s(T) {
    const j = Object.keys(T);
    for (let q = 0; q < j.length; q++) {
      const Y = j[q];
      this.lastEntities[Y] = {
        regex: new RegExp("&" + Y + ";", "g"),
        val: T[Y]
      };
    }
  }
  function a(T, j, q, Y, W, G, J) {
    if (T !== void 0 && (this.options.trimValues && !Y && (T = T.trim()), T.length > 0)) {
      J || (T = this.replaceEntitiesValue(T));
      const B = this.options.tagValueProcessor(j, T, q, W, G);
      return B == null ? T : typeof B != typeof T || B !== T ? B : this.options.trimValues ? E(T, this.options.parseTagValue, this.options.numberParseOptions) : T.trim() === T ? E(T, this.options.parseTagValue, this.options.numberParseOptions) : T;
    }
  }
  function c(T) {
    if (this.options.removeNSPrefix) {
      const j = T.split(":"), q = T.charAt(0) === "/" ? "/" : "";
      if (j[0] === "xmlns")
        return "";
      j.length === 2 && (T = q + j[1]);
    }
    return T;
  }
  const u = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
  function l(T, j, q) {
    if (this.options.ignoreAttributes !== !0 && typeof T == "string") {
      const Y = t.getAllMatches(T, u), W = Y.length, G = {};
      for (let J = 0; J < W; J++) {
        const B = this.resolveNameSpace(Y[J][1]);
        if (this.ignoreAttributesFn(B, j))
          continue;
        let D = Y[J][4], X = this.options.attributeNamePrefix + B;
        if (B.length)
          if (this.options.transformAttributeName && (X = this.options.transformAttributeName(X)), X === "__proto__" && (X = "#__proto__"), D !== void 0) {
            this.options.trimValues && (D = D.trim()), D = this.replaceEntitiesValue(D);
            const V = this.options.attributeValueProcessor(B, D, j);
            V == null ? G[X] = D : typeof V != typeof D || V !== D ? G[X] = V : G[X] = E(
              D,
              this.options.parseAttributeValue,
              this.options.numberParseOptions
            );
          } else this.options.allowBooleanAttributes && (G[X] = !0);
      }
      if (!Object.keys(G).length)
        return;
      if (this.options.attributesGroupName) {
        const J = {};
        return J[this.options.attributesGroupName] = G, J;
      }
      return G;
    }
  }
  const d = function(T) {
    T = T.replace(/\r\n?/g, `
`);
    const j = new e("!xml");
    let q = j, Y = "", W = "";
    for (let G = 0; G < T.length; G++)
      if (T[G] === "<")
        if (T[G + 1] === "/") {
          const B = g(T, ">", G, "Closing Tag is not closed.");
          let D = T.substring(G + 2, B).trim();
          if (this.options.removeNSPrefix) {
            const K = D.indexOf(":");
            K !== -1 && (D = D.substr(K + 1));
          }
          this.options.transformTagName && (D = this.options.transformTagName(D)), q && (Y = this.saveTextToParentTag(Y, q, W));
          const X = W.substring(W.lastIndexOf(".") + 1);
          if (D && this.options.unpairedTags.indexOf(D) !== -1)
            throw new Error(`Unpaired tag can not be used as closing tag: </${D}>`);
          let V = 0;
          X && this.options.unpairedTags.indexOf(X) !== -1 ? (V = W.lastIndexOf(".", W.lastIndexOf(".") - 1), this.tagsNodeStack.pop()) : V = W.lastIndexOf("."), W = W.substring(0, V), q = this.tagsNodeStack.pop(), Y = "", G = B;
        } else if (T[G + 1] === "?") {
          let B = v(T, G, !1, "?>");
          if (!B) throw new Error("Pi Tag is not closed.");
          if (Y = this.saveTextToParentTag(Y, q, W), !(this.options.ignoreDeclaration && B.tagName === "?xml" || this.options.ignorePiTags)) {
            const D = new e(B.tagName);
            D.add(this.options.textNodeName, ""), B.tagName !== B.tagExp && B.attrExpPresent && (D[":@"] = this.buildAttributesMap(B.tagExp, W, B.tagName)), this.addChild(q, D, W);
          }
          G = B.closeIndex + 1;
        } else if (T.substr(G + 1, 3) === "!--") {
          const B = g(T, "-->", G + 4, "Comment is not closed.");
          if (this.options.commentPropName) {
            const D = T.substring(G + 4, B - 2);
            Y = this.saveTextToParentTag(Y, q, W), q.add(this.options.commentPropName, [{ [this.options.textNodeName]: D }]);
          }
          G = B;
        } else if (T.substr(G + 1, 2) === "!D") {
          const B = n(T, G);
          this.docTypeEntities = B.entities, G = B.i;
        } else if (T.substr(G + 1, 2) === "![") {
          const B = g(T, "]]>", G, "CDATA is not closed.") - 2, D = T.substring(G + 9, B);
          Y = this.saveTextToParentTag(Y, q, W);
          let X = this.parseTextData(D, q.tagname, W, !0, !1, !0, !0);
          X == null && (X = ""), this.options.cdataPropName ? q.add(this.options.cdataPropName, [{ [this.options.textNodeName]: D }]) : q.add(this.options.textNodeName, X), G = B + 2;
        } else {
          let B = v(T, G, this.options.removeNSPrefix), D = B.tagName;
          const X = B.rawTagName;
          let V = B.tagExp, K = B.attrExpPresent, $ = B.closeIndex;
          this.options.transformTagName && (D = this.options.transformTagName(D)), q && Y && q.tagname !== "!xml" && (Y = this.saveTextToParentTag(Y, q, W, !1));
          const _ = q;
          if (_ && this.options.unpairedTags.indexOf(_.tagname) !== -1 && (q = this.tagsNodeStack.pop(), W = W.substring(0, W.lastIndexOf("."))), D !== j.tagname && (W += W ? "." + D : D), this.isItStopNode(this.options.stopNodes, W, D)) {
            let I = "";
            if (V.length > 0 && V.lastIndexOf("/") === V.length - 1)
              D[D.length - 1] === "/" ? (D = D.substr(0, D.length - 1), W = W.substr(0, W.length - 1), V = D) : V = V.substr(0, V.length - 1), G = B.closeIndex;
            else if (this.options.unpairedTags.indexOf(D) !== -1)
              G = B.closeIndex;
            else {
              const U = this.readStopNodeData(T, X, $ + 1);
              if (!U) throw new Error(`Unexpected end of ${X}`);
              G = U.i, I = U.tagContent;
            }
            const N = new e(D);
            D !== V && K && (N[":@"] = this.buildAttributesMap(V, W, D)), I && (I = this.parseTextData(I, D, W, !0, K, !0, !0)), W = W.substr(0, W.lastIndexOf(".")), N.add(this.options.textNodeName, I), this.addChild(q, N, W);
          } else {
            if (V.length > 0 && V.lastIndexOf("/") === V.length - 1) {
              D[D.length - 1] === "/" ? (D = D.substr(0, D.length - 1), W = W.substr(0, W.length - 1), V = D) : V = V.substr(0, V.length - 1), this.options.transformTagName && (D = this.options.transformTagName(D));
              const I = new e(D);
              D !== V && K && (I[":@"] = this.buildAttributesMap(V, W, D)), this.addChild(q, I, W), W = W.substr(0, W.lastIndexOf("."));
            } else {
              const I = new e(D);
              this.tagsNodeStack.push(q), D !== V && K && (I[":@"] = this.buildAttributesMap(V, W, D)), this.addChild(q, I, W), q = I;
            }
            Y = "", G = $;
          }
        }
      else
        Y += T[G];
    return j.child;
  };
  function f(T, j, q) {
    const Y = this.options.updateTag(j.tagname, q, j[":@"]);
    Y === !1 || (typeof Y == "string" && (j.tagname = Y), T.addChild(j));
  }
  const m = function(T) {
    if (this.options.processEntities) {
      for (let j in this.docTypeEntities) {
        const q = this.docTypeEntities[j];
        T = T.replace(q.regx, q.val);
      }
      for (let j in this.lastEntities) {
        const q = this.lastEntities[j];
        T = T.replace(q.regex, q.val);
      }
      if (this.options.htmlEntities)
        for (let j in this.htmlEntities) {
          const q = this.htmlEntities[j];
          T = T.replace(q.regex, q.val);
        }
      T = T.replace(this.ampEntity.regex, this.ampEntity.val);
    }
    return T;
  };
  function h(T, j, q, Y) {
    return T && (Y === void 0 && (Y = j.child.length === 0), T = this.parseTextData(
      T,
      j.tagname,
      q,
      !1,
      j[":@"] ? Object.keys(j[":@"]).length !== 0 : !1,
      Y
    ), T !== void 0 && T !== "" && j.add(this.options.textNodeName, T), T = ""), T;
  }
  function y(T, j, q) {
    const Y = "*." + q;
    for (const W in T) {
      const G = T[W];
      if (Y === G || j === G) return !0;
    }
    return !1;
  }
  function x(T, j, q = ">") {
    let Y, W = "";
    for (let G = j; G < T.length; G++) {
      let J = T[G];
      if (Y)
        J === Y && (Y = "");
      else if (J === '"' || J === "'")
        Y = J;
      else if (J === q[0])
        if (q[1]) {
          if (T[G + 1] === q[1])
            return {
              data: W,
              index: G
            };
        } else
          return {
            data: W,
            index: G
          };
      else J === "	" && (J = " ");
      W += J;
    }
  }
  function g(T, j, q, Y) {
    const W = T.indexOf(j, q);
    if (W === -1)
      throw new Error(Y);
    return W + j.length - 1;
  }
  function v(T, j, q, Y = ">") {
    const W = x(T, j + 1, Y);
    if (!W) return;
    let G = W.data;
    const J = W.index, B = G.search(/\s/);
    let D = G, X = !0;
    B !== -1 && (D = G.substring(0, B), G = G.substring(B + 1).trimStart());
    const V = D;
    if (q) {
      const K = D.indexOf(":");
      K !== -1 && (D = D.substr(K + 1), X = D !== W.data.substr(K + 1));
    }
    return {
      tagName: D,
      tagExp: G,
      closeIndex: J,
      attrExpPresent: X,
      rawTagName: V
    };
  }
  function S(T, j, q) {
    const Y = q;
    let W = 1;
    for (; q < T.length; q++)
      if (T[q] === "<")
        if (T[q + 1] === "/") {
          const G = g(T, ">", q, `${j} is not closed`);
          if (T.substring(q + 2, G).trim() === j && (W--, W === 0))
            return {
              tagContent: T.substring(Y, q),
              i: G
            };
          q = G;
        } else if (T[q + 1] === "?")
          q = g(T, "?>", q + 1, "StopNode is not closed.");
        else if (T.substr(q + 1, 3) === "!--")
          q = g(T, "-->", q + 3, "StopNode is not closed.");
        else if (T.substr(q + 1, 2) === "![")
          q = g(T, "]]>", q, "StopNode is not closed.") - 2;
        else {
          const G = v(T, q, ">");
          G && ((G && G.tagName) === j && G.tagExp[G.tagExp.length - 1] !== "/" && W++, q = G.closeIndex);
        }
  }
  function E(T, j, q) {
    if (j && typeof T == "string") {
      const Y = T.trim();
      return Y === "true" ? !0 : Y === "false" ? !1 : r(T, q);
    } else
      return t.isExist(T) ? T : "";
  }
  return fw = o, fw;
}
var hw = {}, QF;
function wge() {
  if (QF) return hw;
  QF = 1;
  function t(o, s) {
    return e(o, s);
  }
  function e(o, s, a) {
    let c;
    const u = {};
    for (let l = 0; l < o.length; l++) {
      const d = o[l], f = n(d);
      let m = "";
      if (a === void 0 ? m = f : m = a + "." + f, f === s.textNodeName)
        c === void 0 ? c = d[f] : c += "" + d[f];
      else {
        if (f === void 0)
          continue;
        if (d[f]) {
          let h = e(d[f], s, m);
          const y = i(h, s);
          d[":@"] ? r(h, d[":@"], m, s) : Object.keys(h).length === 1 && h[s.textNodeName] !== void 0 && !s.alwaysCreateTextNode ? h = h[s.textNodeName] : Object.keys(h).length === 0 && (s.alwaysCreateTextNode ? h[s.textNodeName] = "" : h = ""), u[f] !== void 0 && u.hasOwnProperty(f) ? (Array.isArray(u[f]) || (u[f] = [u[f]]), u[f].push(h)) : s.isArray(f, m, y) ? u[f] = [h] : u[f] = h;
        }
      }
    }
    return typeof c == "string" ? c.length > 0 && (u[s.textNodeName] = c) : c !== void 0 && (u[s.textNodeName] = c), u;
  }
  function n(o) {
    const s = Object.keys(o);
    for (let a = 0; a < s.length; a++) {
      const c = s[a];
      if (c !== ":@") return c;
    }
  }
  function r(o, s, a, c) {
    if (s) {
      const u = Object.keys(s), l = u.length;
      for (let d = 0; d < l; d++) {
        const f = u[d];
        c.isArray(f, a + "." + f, !0, !0) ? o[f] = [s[f]] : o[f] = s[f];
      }
    }
  }
  function i(o, s) {
    const { textNodeName: a } = s, c = Object.keys(o).length;
    return !!(c === 0 || c === 1 && (o[a] || typeof o[a] == "boolean" || o[a] === 0));
  }
  return hw.prettify = t, hw;
}
var mw, $F;
function Sge() {
  if ($F) return mw;
  $F = 1;
  const { buildOptions: t } = gge(), e = xge(), { prettify: n } = wge(), r = kU();
  class i {
    constructor(s) {
      this.externalEntities = {}, this.options = t(s);
    }
    /**
     * Parse XML dats to JS object 
     * @param {string|Buffer} xmlData 
     * @param {boolean|Object} validationOption 
     */
    parse(s, a) {
      if (typeof s != "string") if (s.toString)
        s = s.toString();
      else
        throw new Error("XML data is accepted in String or Bytes[] form.");
      if (a) {
        a === !0 && (a = {});
        const l = r.validate(s, a);
        if (l !== !0)
          throw Error(`${l.err.msg}:${l.err.line}:${l.err.col}`);
      }
      const c = new e(this.options);
      c.addExternalEntities(this.externalEntities);
      const u = c.parseXml(s);
      return this.options.preserveOrder || u === void 0 ? u : n(u, this.options);
    }
    /**
     * Add Entity which is not by default supported by this library
     * @param {string} key 
     * @param {string} value 
     */
    addEntity(s, a) {
      if (a.indexOf("&") !== -1)
        throw new Error("Entity value can't have '&'");
      if (s.indexOf("&") !== -1 || s.indexOf(";") !== -1)
        throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");
      if (a === "&")
        throw new Error("An entity with value '&' is not permitted");
      this.externalEntities[s] = a;
    }
  }
  return mw = i, mw;
}
var gw, GF;
function _ge() {
  if (GF) return gw;
  GF = 1;
  const t = `
`;
  function e(a, c) {
    let u = "";
    return c.format && c.indentBy.length > 0 && (u = t), n(a, c, "", u);
  }
  function n(a, c, u, l) {
    let d = "", f = !1;
    for (let m = 0; m < a.length; m++) {
      const h = a[m], y = r(h);
      if (y === void 0) continue;
      let x = "";
      if (u.length === 0 ? x = y : x = `${u}.${y}`, y === c.textNodeName) {
        let T = h[y];
        o(x, c) || (T = c.tagValueProcessor(y, T), T = s(T, c)), f && (d += l), d += T, f = !1;
        continue;
      } else if (y === c.cdataPropName) {
        f && (d += l), d += `<![CDATA[${h[y][0][c.textNodeName]}]]>`, f = !1;
        continue;
      } else if (y === c.commentPropName) {
        d += l + `<!--${h[y][0][c.textNodeName]}-->`, f = !0;
        continue;
      } else if (y[0] === "?") {
        const T = i(h[":@"], c), j = y === "?xml" ? "" : l;
        let q = h[y][0][c.textNodeName];
        q = q.length !== 0 ? " " + q : "", d += j + `<${y}${q}${T}?>`, f = !0;
        continue;
      }
      let g = l;
      g !== "" && (g += c.indentBy);
      const v = i(h[":@"], c), S = l + `<${y}${v}`, E = n(h[y], c, x, g);
      c.unpairedTags.indexOf(y) !== -1 ? c.suppressUnpairedNode ? d += S + ">" : d += S + "/>" : (!E || E.length === 0) && c.suppressEmptyNode ? d += S + "/>" : E && E.endsWith(">") ? d += S + `>${E}${l}</${y}>` : (d += S + ">", E && l !== "" && (E.includes("/>") || E.includes("</")) ? d += l + c.indentBy + E + l : d += E, d += `</${y}>`), f = !0;
    }
    return d;
  }
  function r(a) {
    const c = Object.keys(a);
    for (let u = 0; u < c.length; u++) {
      const l = c[u];
      if (a.hasOwnProperty(l) && l !== ":@")
        return l;
    }
  }
  function i(a, c) {
    let u = "";
    if (a && !c.ignoreAttributes)
      for (let l in a) {
        if (!a.hasOwnProperty(l)) continue;
        let d = c.attributeValueProcessor(l, a[l]);
        d = s(d, c), d === !0 && c.suppressBooleanAttributes ? u += ` ${l.substr(c.attributeNamePrefix.length)}` : u += ` ${l.substr(c.attributeNamePrefix.length)}="${d}"`;
      }
    return u;
  }
  function o(a, c) {
    a = a.substr(0, a.length - c.textNodeName.length - 1);
    let u = a.substr(a.lastIndexOf(".") + 1);
    for (let l in c.stopNodes)
      if (c.stopNodes[l] === a || c.stopNodes[l] === "*." + u) return !0;
    return !1;
  }
  function s(a, c) {
    if (a && a.length > 0 && c.processEntities)
      for (let u = 0; u < c.entities.length; u++) {
        const l = c.entities[u];
        a = a.replace(l.regex, l.val);
      }
    return a;
  }
  return gw = e, gw;
}
var yw, qF;
function Ege() {
  if (qF) return yw;
  qF = 1;
  const t = _ge(), e = NU(), n = {
    attributeNamePrefix: "@_",
    attributesGroupName: !1,
    textNodeName: "#text",
    ignoreAttributes: !0,
    cdataPropName: !1,
    format: !1,
    indentBy: "  ",
    suppressEmptyNode: !1,
    suppressUnpairedNode: !0,
    suppressBooleanAttributes: !0,
    tagValueProcessor: function(a, c) {
      return c;
    },
    attributeValueProcessor: function(a, c) {
      return c;
    },
    preserveOrder: !1,
    commentPropName: !1,
    unpairedTags: [],
    entities: [
      { regex: new RegExp("&", "g"), val: "&amp;" },
      //it must be on top
      { regex: new RegExp(">", "g"), val: "&gt;" },
      { regex: new RegExp("<", "g"), val: "&lt;" },
      { regex: new RegExp("'", "g"), val: "&apos;" },
      { regex: new RegExp('"', "g"), val: "&quot;" }
    ],
    processEntities: !0,
    stopNodes: [],
    // transformTagName: false,
    // transformAttributeName: false,
    oneListGroup: !1
  };
  function r(a) {
    this.options = Object.assign({}, n, a), this.options.ignoreAttributes === !0 || this.options.attributesGroupName ? this.isAttribute = function() {
      return !1;
    } : (this.ignoreAttributesFn = e(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = s), this.processTextOrObjNode = i, this.options.format ? (this.indentate = o, this.tagEndChar = `>
`, this.newLine = `
`) : (this.indentate = function() {
      return "";
    }, this.tagEndChar = ">", this.newLine = "");
  }
  r.prototype.build = function(a) {
    return this.options.preserveOrder ? t(a, this.options) : (Array.isArray(a) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (a = {
      [this.options.arrayNodeName]: a
    }), this.j2x(a, 0, []).val);
  }, r.prototype.j2x = function(a, c, u) {
    let l = "", d = "";
    const f = u.join(".");
    for (let m in a)
      if (Object.prototype.hasOwnProperty.call(a, m))
        if (typeof a[m] > "u")
          this.isAttribute(m) && (d += "");
        else if (a[m] === null)
          this.isAttribute(m) || m === this.options.cdataPropName ? d += "" : m[0] === "?" ? d += this.indentate(c) + "<" + m + "?" + this.tagEndChar : d += this.indentate(c) + "<" + m + "/" + this.tagEndChar;
        else if (a[m] instanceof Date)
          d += this.buildTextValNode(a[m], m, "", c);
        else if (typeof a[m] != "object") {
          const h = this.isAttribute(m);
          if (h && !this.ignoreAttributesFn(h, f))
            l += this.buildAttrPairStr(h, "" + a[m]);
          else if (!h)
            if (m === this.options.textNodeName) {
              let y = this.options.tagValueProcessor(m, "" + a[m]);
              d += this.replaceEntitiesValue(y);
            } else
              d += this.buildTextValNode(a[m], m, "", c);
        } else if (Array.isArray(a[m])) {
          const h = a[m].length;
          let y = "", x = "";
          for (let g = 0; g < h; g++) {
            const v = a[m][g];
            if (!(typeof v > "u")) if (v === null)
              m[0] === "?" ? d += this.indentate(c) + "<" + m + "?" + this.tagEndChar : d += this.indentate(c) + "<" + m + "/" + this.tagEndChar;
            else if (typeof v == "object")
              if (this.options.oneListGroup) {
                const S = this.j2x(v, c + 1, u.concat(m));
                y += S.val, this.options.attributesGroupName && v.hasOwnProperty(this.options.attributesGroupName) && (x += S.attrStr);
              } else
                y += this.processTextOrObjNode(v, m, c, u);
            else if (this.options.oneListGroup) {
              let S = this.options.tagValueProcessor(m, v);
              S = this.replaceEntitiesValue(S), y += S;
            } else
              y += this.buildTextValNode(v, m, "", c);
          }
          this.options.oneListGroup && (y = this.buildObjectNode(y, m, x, c)), d += y;
        } else if (this.options.attributesGroupName && m === this.options.attributesGroupName) {
          const h = Object.keys(a[m]), y = h.length;
          for (let x = 0; x < y; x++)
            l += this.buildAttrPairStr(h[x], "" + a[m][h[x]]);
        } else
          d += this.processTextOrObjNode(a[m], m, c, u);
    return { attrStr: l, val: d };
  }, r.prototype.buildAttrPairStr = function(a, c) {
    return c = this.options.attributeValueProcessor(a, "" + c), c = this.replaceEntitiesValue(c), this.options.suppressBooleanAttributes && c === "true" ? " " + a : " " + a + '="' + c + '"';
  };
  function i(a, c, u, l) {
    const d = this.j2x(a, u + 1, l.concat(c));
    return a[this.options.textNodeName] !== void 0 && Object.keys(a).length === 1 ? this.buildTextValNode(a[this.options.textNodeName], c, d.attrStr, u) : this.buildObjectNode(d.val, c, d.attrStr, u);
  }
  r.prototype.buildObjectNode = function(a, c, u, l) {
    if (a === "")
      return c[0] === "?" ? this.indentate(l) + "<" + c + u + "?" + this.tagEndChar : this.indentate(l) + "<" + c + u + this.closeTag(c) + this.tagEndChar;
    {
      let d = "</" + c + this.tagEndChar, f = "";
      return c[0] === "?" && (f = "?", d = ""), (u || u === "") && a.indexOf("<") === -1 ? this.indentate(l) + "<" + c + u + f + ">" + a + d : this.options.commentPropName !== !1 && c === this.options.commentPropName && f.length === 0 ? this.indentate(l) + `<!--${a}-->` + this.newLine : this.indentate(l) + "<" + c + u + f + this.tagEndChar + a + this.indentate(l) + d;
    }
  }, r.prototype.closeTag = function(a) {
    let c = "";
    return this.options.unpairedTags.indexOf(a) !== -1 ? this.options.suppressUnpairedNode || (c = "/") : this.options.suppressEmptyNode ? c = "/" : c = `></${a}`, c;
  }, r.prototype.buildTextValNode = function(a, c, u, l) {
    if (this.options.cdataPropName !== !1 && c === this.options.cdataPropName)
      return this.indentate(l) + `<![CDATA[${a}]]>` + this.newLine;
    if (this.options.commentPropName !== !1 && c === this.options.commentPropName)
      return this.indentate(l) + `<!--${a}-->` + this.newLine;
    if (c[0] === "?")
      return this.indentate(l) + "<" + c + u + "?" + this.tagEndChar;
    {
      let d = this.options.tagValueProcessor(c, a);
      return d = this.replaceEntitiesValue(d), d === "" ? this.indentate(l) + "<" + c + u + this.closeTag(c) + this.tagEndChar : this.indentate(l) + "<" + c + u + ">" + d + "</" + c + this.tagEndChar;
    }
  }, r.prototype.replaceEntitiesValue = function(a) {
    if (a && a.length > 0 && this.options.processEntities)
      for (let c = 0; c < this.options.entities.length; c++) {
        const u = this.options.entities[c];
        a = a.replace(u.regex, u.val);
      }
    return a;
  };
  function o(a) {
    return this.options.indentBy.repeat(a);
  }
  function s(a) {
    return a.startsWith(this.options.attributeNamePrefix) && a !== this.options.textNodeName ? a.substr(this.attrPrefixLen) : !1;
  }
  return yw = r, yw;
}
var vw, HF;
function Age() {
  if (HF) return vw;
  HF = 1;
  const t = kU(), e = Sge(), n = Ege();
  return vw = {
    XMLParser: e,
    XMLValidator: t,
    XMLBuilder: n
  }, vw;
}
var Ige = Age();
const Cge = /* @__PURE__ */ Bo(Ige);
class Tge extends xo {
  notice_type = "group_msg_emoji_like";
  message_id;
  likes;
  is_add;
  message_seq;
  constructor(e, n, r, i, o, s, a) {
    super(e, n, r), this.group_id = n, this.user_id = r, this.message_id = i, this.likes = o, this.is_add = s;
  }
}
class kge extends xo {
  notice_type = "group_card";
  card_new;
  card_old;
  constructor(e, n, r, i, o) {
    super(e, n, r), this.group_id = n, this.user_id = r, this.card_new = i, this.card_old = o;
  }
}
class Nge extends xo {
  notice_type = "essence";
  message_id;
  sender_id;
  operator_id;
  sub_type = "add";
  constructor(e, n, r, i, o) {
    super(e, n, i), this.group_id = n, this.operator_id = o, this.message_id = r, this.sender_id = i;
  }
}
class Pge extends xo {
  notice_type = "notify";
  sub_type = "title";
  title;
  constructor(e, n, r, i) {
    super(e, n, r), this.group_id = n, this.user_id = r, this.title = i;
  }
}
class Dge extends Ps {
  notice_type = "notify";
  sub_type = "gray_tip";
  group_id;
  user_id;
  // 真实发送者QQ（如果是伪造的灰条，这就是攻击者）
  message_id;
  // 消息ID，可用于撤回
  busi_id;
  // 业务ID
  content;
  // 灰条内容（JSON字符串）
  raw_info;
  // 原始信息
  constructor(e, n, r, i, o, s, a) {
    super(e), this.group_id = n, this.user_id = r, this.message_id = i, this.busi_id = o, this.content = s, this.raw_info = a;
  }
}
class Fge extends xo {
  notice_type = "group_upload";
  file;
  constructor(e, n, r, i) {
    super(e, n, r), this.group_id = n, this.user_id = r, this.file = i;
  }
}
class Oge extends xo {
  notice_type = "notify";
  sub_type = "group_name";
  name_new;
  constructor(e, n, r, i) {
    super(e, n, r), this.name_new = i;
  }
}
class Mge {
  constructor(e, n = 30 * 1e3 * 60, r = 10) {
    this.maxCapacity = e, this.ttl = n, this.cleanupCount = r;
  }
  cache = /* @__PURE__ */ new Map();
  keyList = /* @__PURE__ */ new Set();
  operationCount = 0;
  put(e, n) {
    const r = Date.now(), i = { value: n, timestamp: r, frequency: 1 };
    this.cache.set(e, i), this.keyList.add(e), this.operationCount++, this.keyList.size > this.maxCapacity && this.evict(), this.operationCount >= this.cleanupCount && this.cleanup(this.cleanupCount);
  }
  get(e) {
    const n = this.cache.get(e);
    if (n && Date.now() - n.timestamp < this.ttl)
      return n.timestamp = Date.now(), n.frequency++, this.operationCount++, this.operationCount >= this.cleanupCount && this.cleanup(this.cleanupCount), n.value;
    this.deleteKey(e);
  }
  cleanup(e) {
    const n = Date.now();
    let r = 0;
    for (const i of this.keyList) {
      if (r >= e) break;
      const o = this.cache.get(i);
      o && n - o.timestamp >= this.ttl && (this.deleteKey(i), r++);
    }
    this.operationCount = 0;
  }
  deleteKey(e) {
    this.cache.delete(e), this.keyList.delete(e);
  }
  evict() {
    for (; this.keyList.size > this.maxCapacity; ) {
      let e, n = 1 / 0;
      for (const r of this.keyList) {
        const i = this.cache.get(r);
        i && i.frequency < n && (n = i.frequency, e = r);
      }
      e !== void 0 && this.deleteKey(e);
    }
  }
}
class Rge {
  cache;
  constructor(e) {
    this.cache = new Mge(5e3, e);
  }
  encode(e, n = "", r) {
    const i = r || Do().replace(/-/g, "") + n;
    return this.cache.put(i, e), i;
  }
  decode(e) {
    return this.cache.get(e);
  }
}
class Bge {
  manager;
  constructor(e = 864e5) {
    this.manager = new Rge(e);
  }
  encodeModelId(e, n, r, i = "", o = "", s) {
    return this.manager.encode({ peer: e, modelId: n, fileId: r, fileUUID: i }, o, s);
  }
  decodeModelId(e) {
    return this.manager.decode(e);
  }
  encode(e, n, r, i = "", o) {
    return this.manager.encode({ peer: e, msgId: n, elementId: r, fileUUID: i }, "", o);
  }
  decode(e) {
    return this.manager.decode(e);
  }
}
const Jt = new Bge();
class dm extends xo {
  notice_type = "group_increase";
  operator_id;
  sub_type;
  constructor(e, n, r, i, o = "approve") {
    super(e, n, r), this.group_id = n, this.operator_id = i, this.user_id = r, this.sub_type = o;
  }
}
class Uge {
  obContext;
  core;
  constructor(e, n) {
    this.obContext = e, this.core = n;
  }
  async parseGroupBanEvent(e, n) {
    const r = n?.groupElement;
    if (!r?.shutUp) return;
    const i = r.shutUp.member.uid, o = r.shutUp.admin.uid;
    let s, a = parseInt(r.shutUp.duration);
    const c = a > 0 ? "ban" : "lift_ban";
    i ? s = (await this.core.apis.GroupApi.getGroupMember(e, i))?.uin ?? "" : (s = "0", a > 0 && (a = -1)), await this.core.apis.GroupApi.refreshGroupMemberCachePartial(e, i);
    const u = (await this.core.apis.GroupApi.getGroupMember(e, o))?.uin;
    if (s && u)
      return new mge(
        this.core,
        parseInt(e),
        parseInt(s),
        parseInt(u),
        a,
        c
      );
  }
  async parseGroupEmojiLikeEventByGrayTip(e, n) {
    if (this.core.apis.PacketApi.packetStatus === !0)
      return;
    const r = new Cge.XMLParser({
      ignoreAttributes: !1,
      attributeNamePrefix: ""
    }).parse(n.xmlElement.content);
    this.core.context.logger.logDebug("收到表情回应我的消息", r);
    const i = r.gtip.qq.jp, o = r.gtip.url.msgseq, s = r.gtip.face.id;
    return await this.createGroupEmojiLikeEvent(e, i, o, s, !0, 1);
  }
  async createGroupEmojiLikeEvent(e, n, r, i, o = !0, s = 1) {
    const a = {
      chatType: Ne.KCHATTYPEGROUP,
      guildId: "",
      peerUid: e
    }, c = (await this.core.apis.MsgApi.queryFirstMsgBySeq(a, r)).msgList;
    if (c.length < 1)
      return;
    const u = c[0];
    if (!u) {
      this.core.context.logger.logError("解析表情回应消息失败: 未找到回应消息");
      return;
    }
    return new Tge(
      this.core,
      parseInt(e),
      parseInt(n),
      rt.createUniqueMsgId({ chatType: Ne.KCHATTYPEGROUP, guildId: "", peerUid: e }, u.msgId),
      [{
        emoji_id: i,
        count: s
      }],
      o,
      r
    );
  }
  async parseCardChangedEvent(e) {
    if (e.senderUin && e.senderUin !== "0") {
      const n = await this.core.apis.GroupApi.getGroupMember(e.peerUid, e.senderUin);
      if (n && n.cardName !== e.sendMemberName) {
        const r = e.sendMemberName ?? "", i = new kge(this.core, parseInt(e.peerUid), parseInt(e.senderUin), r, n.cardName);
        return n.cardName = r, i;
      }
      n && n.nick !== e.sendNickName && await this.core.apis.GroupApi.refreshGroupMemberCachePartial(e.peerUid, e.senderUid);
    }
  }
  async registerParseGroupReactEvent() {
    this.obContext.core.context.packetHandler.onCmd("trpc.msg.olpush.OlPushService.MsgPush", async (e) => {
      const n = new fe(U6).decode(Buffer.from(e.hex_data, "hex"));
      if (n.message.contentHead.type === 732 && n.message.contentHead.subType === 16) {
        const r = n.message.body?.msgContent?.slice(7);
        if (!r)
          return;
        const i = new fe(L6).decode(r);
        if ((i.field13 ?? 0) === 35) {
          const o = i.groupUin?.toString() ?? "", s = i.groupReactionData?.data?.data?.groupReactionDataContent?.operatorUid ?? "", a = i.groupReactionData?.data?.data?.groupReactionDataContent?.type ?? 0, c = i.groupReactionData?.data?.data?.groupReactionTarget?.seq?.toString() ?? "", u = i.groupReactionData?.data?.data?.groupReactionDataContent?.code ?? "", l = await this.core.apis.UserApi.getUinByUidV2(s), d = await this.createGroupEmojiLikeEvent(
            o,
            l,
            c,
            u,
            a === 1,
            1
          );
          d && this.obContext.networkManager.emitEvent(d);
        }
      }
    });
  }
  async registerParseGroupReactEventByCore() {
    this.core.event.on("event:emoji_like", async (e) => {
      const n = await this.createGroupEmojiLikeEvent(
        e.groupId,
        e.senderUin,
        e.msgSeq,
        e.emojiId,
        e.isAdd,
        e.count
      );
      n && this.obContext.networkManager.emitEvent(n);
    });
  }
  async parsePaiYiPai(e, n) {
    const i = JSON.parse(n).items, o = i.filter((s) => s.uid);
    if (o.length === 2 && o[0]?.uid && o[1]?.uid)
      return new fge(
        this.core,
        parseInt(e.peerUid),
        +await this.core.apis.UserApi.getUinByUidV2(o[0].uid),
        +await this.core.apis.UserApi.getUinByUidV2(o[1].uid),
        i
      );
  }
  async parseOtherJsonEvent(e, n, r) {
    let i;
    try {
      i = JSON.parse(n.jsonStr);
    } catch (s) {
      r.logger.logWarn("灰条消息JSON解析失败", n.jsonStr, s);
      return;
    }
    const o = i.items?.[i.items.length - 1]?.txt;
    if (await this.core.apis.GroupApi.refreshGroupMemberCachePartial(e.peerUid, e.senderUid), o === "头衔") {
      const s = i.items?.[1]?.param?.[0], a = i.items?.[3]?.txt;
      if (r.logger.logDebug("收到群成员新头衔消息", i), s == null || a == null) {
        r.logger.logWarn("收到格式异常的群成员新头衔灰条消息", i);
        return;
      }
      return new Pge(
        this.core,
        +e.peerUid,
        +s,
        a
      );
    } else if (o === "移出")
      r.logger.logDebug("收到机器人被踢消息", i);
    else {
      r.logger.logWarn("收到未知的灰条消息", i);
      const s = Number(e.senderUin) || 0;
      if (s !== 0) {
        const a = { chatType: Ne.KCHATTYPEGROUP, guildId: "", peerUid: e.peerUid }, c = rt.createUniqueMsgId(a, e.msgId);
        return new Dge(
          this.core,
          +e.peerUin,
          s,
          c,
          n.busiId,
          n.jsonStr,
          {
            msgSeq: e.msgSeq,
            msgTime: e.msgTime,
            msgId: e.msgId,
            json: i
          }
        );
      }
    }
  }
  async parseEssenceMsg(e, n) {
    const r = JSON.parse(n), i = new URL(r.items[0].jp).searchParams, o = i.get("msgSeq"), s = i.get("groupCode");
    if (!s) return;
    const a = {
      guildId: "",
      chatType: Ne.KCHATTYPEGROUP,
      peerUid: s
    }, c = await this.core.apis.MsgApi.getMsgsBySeqAndCount(a, o.toString(), 1, !0, !0), l = (await this.core.apis.WebApi.getGroupEssenceMsgAll(s)).flatMap((d) => d.data.msg_list).find((d) => d.msg_seq.toString() === o);
    if (c.msgList[0])
      return new Nge(
        this.core,
        parseInt(e.peerUid),
        rt.getShortIdByMsgId(c.msgList[0].msgId),
        parseInt(c.msgList[0].senderUin ?? await this.core.apis.UserApi.getUinByUidV2(c.msgList[0].senderUid)),
        parseInt(l?.add_digest_uin ?? "0")
      );
  }
  async parseGroupUploadFileEvene(e, n, r) {
    return new Fge(
      this.core,
      parseInt(e.peerUid),
      parseInt(e.senderUin || ""),
      {
        id: Jt.encode({
          chatType: Ne.KCHATTYPEGROUP,
          peerUid: e.peerUid
        }, e.msgId, r.elementId, r?.fileElement?.fileUuid, n.fileMd5 ?? n.fileUuid),
        name: n.fileName,
        size: parseInt(n.fileSize),
        busid: n.fileBizId ?? 0
      }
    );
  }
  async parseGroupElement(e, n, r) {
    if (n.type === Vh.KGROUPNAMEMODIFIED)
      return this.core.context.logger.logDebug("收到群名称变更事件", n), new Oge(
        this.core,
        parseInt(e.peerUid),
        parseInt(await this.core.apis.UserApi.getUinByUidV2(n.memberUid)),
        n.groupName
      );
    if (n.type === Vh.KSHUTUP)
      return await this.parseGroupBanEvent(e.peerUid, r);
    if (n.type === Vh.KMEMBERADD && n.memberUid === this.core.selfInfo.uid)
      return await this.core.apis.GroupApi.refreshGroupMemberCache(e.peerUid, !0), new dm(
        this.core,
        parseInt(e.peerUid),
        +this.core.selfInfo.uin,
        n.adminUid ? +await this.core.apis.UserApi.getUinByUidV2(n.adminUid) : 0,
        "approve"
      );
  }
  async parseSelfInviteEvent(e, n, r) {
    return new dm(
      this.core,
      parseInt(e.peerUid),
      +r,
      +n,
      "invite"
    );
  }
  async parse51TypeEvent(e, n) {
    if (n.jsonGrayTipElement.jsonStr) {
      const r = JSON.parse(n.jsonGrayTipElement.jsonStr);
      if (r.items.length === 1 && r.items[0]?.txt.endsWith("加入群")) {
        const i = structuredClone(this.core.apis.GroupApi.groupMemberCache.get(e.peerUid));
        if (!i) return;
        const o = await this.core.apis.GroupApi.refreshGroupMemberCache(e.peerUid, !0);
        if (!o) return;
        const a = Array.from(o.values()).find((c) => i.get(c.uid) === void 0);
        return a ? new dm(
          this.core,
          +e.peerUid,
          +a.uin,
          0,
          "invite"
        ) : void 0;
      }
    }
  }
  async parseGrayTipElement(e, n) {
    if (n.subElementType === Pp.GRAYTIP_ELEMENT_SUBTYPE_GROUP)
      return await this.parseGroupElement(e, n.groupElement, n);
    if (n.subElementType === Pp.GRAYTIP_ELEMENT_SUBTYPE_XMLMSG) {
      if (n.xmlElement?.templId === "10382")
        return await this.obContext.apis.GroupApi.parseGroupEmojiLikeEventByGrayTip(e.peerUid, n);
    } else if (n.subElementType === Pp.GRAYTIP_ELEMENT_SUBTYPE_JSON)
      return n.jsonGrayTipElement.busiId === "1061" ? await this.parsePaiYiPai(e, n.jsonGrayTipElement.jsonStr) : n.jsonGrayTipElement.busiId === o6.AIO_GROUP_ESSENCE_MSG_TIP.toString() ? await this.parseEssenceMsg(e, n.jsonGrayTipElement.jsonStr) : n.jsonGrayTipElement.busiId === "51" ? await this.parse51TypeEvent(e, n) : (console.log("Unknown JSON event:", n.jsonGrayTipElement, JSON.stringify(n)), await this.parseOtherJsonEvent(e, n.jsonGrayTipElement, this.core.context));
  }
}
class Lge extends Ps {
  notice_type = "notify";
  sub_type = "profile_like";
  operator_id;
  operator_nick;
  times;
  time;
  constructor(e, n, r, i, o) {
    super(e), this.operator_id = n, this.operator_nick = r, this.times = i, this.time = o;
  }
}
const jge = {
  txt: b(1, w.STRING),
  uin: b(3, w.INT64),
  nickname: b(5, w.STRING)
}, Qge = {
  times: b(1, w.INT32),
  time: b(2, w.INT32),
  detail: b(3, () => jge)
}, $ge = {
  msg: b(14, () => Qge)
}, Gge = {
  msgType: b(1, w.INT32),
  subType: b(2, w.INT32),
  content: b(203, () => $ge)
};
b(1, w.UINT32), b(2, w.STRING), b(5, w.UINT32), b(6, w.STRING, !0);
b(1, w.UINT32), b(2, w.UINT32), b(3, w.UINT32), b(5, w.UINT32), b(6, w.UINT32), b(12, w.UINT64), b(13, w.UINT32);
b(2, w.BYTES);
function qge(t) {
  return new fe(Gge).decode(t);
}
class Hge {
  obContext;
  core;
  constructor(e, n) {
    this.obContext = e, this.core = n;
  }
  async parseLikeEvent(e) {
    const n = qge(e);
    if (n?.msgType !== 0 || n?.subType !== 203) return;
    this.core.context.logger.logDebug("收到点赞通知消息");
    const r = n.content.msg;
    if (!r) return;
    const i = r.detail;
    if (!i) return;
    const o = i.txt.match(/\d+/) ?? "0";
    return new Lge(
      this.core,
      Number(i.uin),
      i.nickname,
      parseInt(o[0], 10),
      r.time
    );
  }
}
const Wge = /* @__PURE__ */ JSON.parse('[{"QSid":"392","QDes":"/龙年快乐","IQLid":"392","AQLid":"392","EMCode":"10392","AniStickerType":3,"AniStickerPackId":"1","AniStickerId":"38"},{"QSid":"393","QDes":"/新年中龙","IQLid":"393","AQLid":"393","EMCode":"10393","QHide":"1","AniStickerType":3,"AniStickerPackId":"1","AniStickerId":"39"},{"QSid":"364","QDes":"/超级赞","IQLid":"364","AQLid":"364","EMCode":"10364","QHide":"1","AniStickerType":1,"AniStickerId":"1","AniStickerPackId":"2","AniStickerPackName":"汪汪"},{"QSid":"366","QDes":"/芒狗","IQLid":"366","AQLid":"366","EMCode":"10366","QHide":"1","AniStickerType":1,"AniStickerId":"2","AniStickerPackId":"2","AniStickerPackName":"汪汪"},{"QSid":"362","QDes":"/好兄弟","IQLid":"362","AQLid":"362","EMCode":"10362","QHide":"1","AniStickerType":1,"AniStickerId":"3","AniStickerPackId":"2","AniStickerPackName":"汪汪"},{"QSid":"397","QDes":"/抛媚眼","IQLid":"397","AQLid":"397","EMCode":"10397","QHide":"1","AniStickerType":1,"AniStickerId":"4","AniStickerPackId":"2","AniStickerPackName":"汪汪"},{"QSid":"396","QDes":"/狼狗","IQLid":"396","AQLid":"396","EMCode":"10396","QHide":"1","AniStickerType":1,"AniStickerId":"5","AniStickerPackId":"2","AniStickerPackName":"汪汪"},{"QSid":"360","QDes":"/亲亲","IQLid":"360","AQLid":"360","EMCode":"10360","QHide":"1","AniStickerType":1,"AniStickerId":"6","AniStickerPackId":"2","AniStickerPackName":"汪汪"},{"QSid":"361","QDes":"/狗狗笑哭","IQLid":"361","AQLid":"361","EMCode":"10361","QHide":"1","AniStickerType":1,"AniStickerId":"7","AniStickerPackId":"2","AniStickerPackName":"汪汪"},{"QSid":"363","QDes":"/狗狗可怜","IQLid":"363","AQLid":"363","EMCode":"10363","QHide":"1","AniStickerType":1,"AniStickerId":"8","AniStickerPackId":"2","AniStickerPackName":"汪汪"},{"QSid":"365","QDes":"/狗狗生气","IQLid":"365","AQLid":"365","EMCode":"10365","QHide":"1","AniStickerType":1,"AniStickerId":"9","AniStickerPackId":"2","AniStickerPackName":"汪汪"},{"QSid":"367","QDes":"/狗狗疑问","IQLid":"367","AQLid":"367","EMCode":"10367","QHide":"1","AniStickerType":1,"AniStickerId":"10","AniStickerPackId":"2","AniStickerPackName":"汪汪"},{"QSid":"399","QDes":"/tui","IQLid":"399","AQLid":"399","EMCode":"10399","QHide":"1","AniStickerType":1,"AniStickerId":"1","AniStickerPackId":"6","AniStickerPackName":"噗噗星人"},{"QSid":"398","QDes":"/超级ok","IQLid":"398","AQLid":"398","EMCode":"10398","QHide":"1","AniStickerType":1,"AniStickerId":"2","AniStickerPackId":"6","AniStickerPackName":"噗噗星人"},{"QSid":"373","QDes":"/忙","IQLid":"373","AQLid":"373","EMCode":"10373","QHide":"1","AniStickerType":1,"AniStickerId":"3","AniStickerPackId":"6","AniStickerPackName":"噗噗星人"},{"QSid":"370","QDes":"/祝贺","IQLid":"370","AQLid":"370","EMCode":"10370","QHide":"1","AniStickerType":1,"AniStickerId":"4","AniStickerPackId":"6","AniStickerPackName":"噗噗星人"},{"QSid":"375","QDes":"/超级鼓掌","IQLid":"375","AQLid":"375","EMCode":"10375","QHide":"1","AniStickerType":1,"AniStickerId":"5","AniStickerPackId":"6","AniStickerPackName":"噗噗星人"},{"QSid":"368","QDes":"/奥特笑哭","IQLid":"368","AQLid":"368","EMCode":"10368","QHide":"1","AniStickerType":1,"AniStickerId":"6","AniStickerPackId":"6","AniStickerPackName":"噗噗星人"},{"QSid":"369","QDes":"/彩虹","IQLid":"369","AQLid":"369","EMCode":"10369","QHide":"1","AniStickerType":1,"AniStickerId":"7","AniStickerPackId":"6","AniStickerPackName":"噗噗星人"},{"QSid":"371","QDes":"/冒泡","IQLid":"371","AQLid":"371","EMCode":"10371","QHide":"1","AniStickerType":1,"AniStickerId":"8","AniStickerPackId":"6","AniStickerPackName":"噗噗星人"},{"QSid":"372","QDes":"/气呼呼","IQLid":"372","AQLid":"372","EMCode":"10372","QHide":"1","AniStickerType":1,"AniStickerId":"9","AniStickerPackId":"6","AniStickerPackName":"噗噗星人"},{"QSid":"374","QDes":"/波波流泪","IQLid":"374","AQLid":"374","EMCode":"10374","QHide":"1","AniStickerType":1,"AniStickerId":"10","AniStickerPackId":"6","AniStickerPackName":"噗噗星人"},{"QSid":"382","QDes":"/emo","IQLid":"382","AQLid":"382","EMCode":"10382","QHide":"1","AniStickerType":1,"AniStickerId":"1","AniStickerPackId":"5","AniStickerPackName":"企鹅"},{"QSid":"383","QDes":"/企鹅爱心","IQLid":"383","AQLid":"383","EMCode":"10383","QHide":"1","AniStickerType":1,"AniStickerId":"2","AniStickerPackId":"5","AniStickerPackName":"企鹅"},{"QSid":"401","QDes":"/超级转圈","IQLid":"401","AQLid":"401","EMCode":"10401","QHide":"1","AniStickerType":1,"AniStickerId":"3","AniStickerPackId":"5","AniStickerPackName":"企鹅"},{"QSid":"400","QDes":"/快乐","IQLid":"400","AQLid":"400","EMCode":"10400","QHide":"1","AniStickerType":1,"AniStickerId":"4","AniStickerPackId":"5","AniStickerPackName":"企鹅"},{"QSid":"380","QDes":"/真棒","IQLid":"380","AQLid":"380","EMCode":"10380","QHide":"1","AniStickerType":1,"AniStickerId":"5","AniStickerPackId":"5","AniStickerPackName":"企鹅"},{"QSid":"381","QDes":"/路过","IQLid":"381","AQLid":"381","EMCode":"10381","QHide":"1","AniStickerType":1,"AniStickerId":"6","AniStickerPackId":"5","AniStickerPackName":"企鹅"},{"QSid":"379","QDes":"/企鹅流泪","IQLid":"379","AQLid":"379","EMCode":"10379","QHide":"1","AniStickerType":1,"AniStickerId":"7","AniStickerPackId":"5","AniStickerPackName":"企鹅"},{"QSid":"376","QDes":"/跺脚","IQLid":"376","AQLid":"376","EMCode":"10376","QHide":"1","AniStickerType":1,"AniStickerId":"8","AniStickerPackId":"5","AniStickerPackName":"企鹅"},{"QSid":"378","QDes":"/企鹅笑哭","IQLid":"378","AQLid":"378","EMCode":"10378","QHide":"1","AniStickerType":1,"AniStickerId":"9","AniStickerPackId":"5","AniStickerPackName":"企鹅"},{"QSid":"377","QDes":"/嗨","IQLid":"377","AQLid":"377","EMCode":"10377","QHide":"1","AniStickerType":1,"AniStickerId":"10","AniStickerPackId":"5","AniStickerPackName":"企鹅"},{"QSid":"403","QDes":"/出去玩","IQLid":"403","AQLid":"403","EMCode":"10403","QHide":"1","AniStickerType":1,"AniStickerId":"1","AniStickerPackId":"4","AniStickerPackName":"QQ黄脸"},{"QSid":"402","QDes":"/别说话","IQLid":"402","AQLid":"402","EMCode":"10402","QHide":"1","AniStickerType":1,"AniStickerId":"2","AniStickerPackId":"4","AniStickerPackName":"QQ黄脸"},{"QSid":"390","QDes":"/太头秃","IQLid":"390","AQLid":"390","EMCode":"10390","QHide":"1","AniStickerType":1,"AniStickerId":"3","AniStickerPackId":"4","AniStickerPackName":"QQ黄脸"},{"QSid":"391","QDes":"/太沧桑","IQLid":"391","AQLid":"391","EMCode":"10391","QHide":"1","AniStickerType":1,"AniStickerId":"4","AniStickerPackId":"4","AniStickerPackName":"QQ黄脸"},{"QSid":"388","QDes":"/太头疼","IQLid":"388","AQLid":"388","EMCode":"10388","QHide":"1","AniStickerType":1,"AniStickerId":"5","AniStickerPackId":"4","AniStickerPackName":"QQ黄脸"},{"QSid":"389","QDes":"/太赞了","IQLid":"389","AQLid":"389","EMCode":"10389","QHide":"1","AniStickerType":1,"AniStickerId":"6","AniStickerPackId":"4","AniStickerPackName":"QQ黄脸"},{"QSid":"386","QDes":"/呜呜呜","IQLid":"386","AQLid":"386","EMCode":"10386","QHide":"1","AniStickerType":1,"AniStickerId":"7","AniStickerPackId":"4","AniStickerPackName":"QQ黄脸"},{"QSid":"385","QDes":"/太气了","IQLid":"385","AQLid":"385","EMCode":"10385","QHide":"1","AniStickerType":1,"AniStickerId":"8","AniStickerPackId":"4","AniStickerPackName":"QQ黄脸"},{"QSid":"384","QDes":"/晚安","IQLid":"384","AQLid":"384","EMCode":"10384","QHide":"1","AniStickerType":1,"AniStickerId":"9","AniStickerPackId":"4","AniStickerPackName":"QQ黄脸"},{"QSid":"387","QDes":"/太好笑","IQLid":"387","AQLid":"387","EMCode":"10387","QHide":"1","AniStickerType":1,"AniStickerId":"10","AniStickerPackId":"4","AniStickerPackName":"QQ黄脸"},{"QSid":"413","QDes":"/摇起来","IQLid":"413","AQLid":"413","EMCode":"10413","QHide":"1","AniStickerType":1,"AniStickerId":"1","AniStickerPackId":"3","AniStickerPackName":"喜花妮"},{"QSid":"405","QDes":"/好运来","IQLid":"405","AQLid":"405","EMCode":"10405","QHide":"1","AniStickerType":1,"AniStickerId":"2","AniStickerPackId":"3","AniStickerPackName":"喜花妮"},{"QSid":"404","QDes":"/闪亮登场","IQLid":"404","AQLid":"404","EMCode":"10404","QHide":"1","AniStickerType":1,"AniStickerId":"3","AniStickerPackId":"3","AniStickerPackName":"喜花妮"},{"QSid":"406","QDes":"/姐是女王","IQLid":"406","AQLid":"406","EMCode":"10406","QHide":"1","AniStickerType":1,"AniStickerId":"4","AniStickerPackId":"3","AniStickerPackName":"喜花妮"},{"QSid":"410","QDes":"/么么哒","IQLid":"410","AQLid":"410","EMCode":"10410","QHide":"1","AniStickerType":1,"AniStickerId":"5","AniStickerPackId":"3","AniStickerPackName":"喜花妮"},{"QSid":"411","QDes":"/一起嗨","IQLid":"411","AQLid":"411","EMCode":"10411","QHide":"1","AniStickerType":1,"AniStickerId":"6","AniStickerPackId":"3","AniStickerPackName":"喜花妮"},{"QSid":"407","QDes":"/我听听","IQLid":"407","AQLid":"407","EMCode":"10407","QHide":"1","AniStickerType":1,"AniStickerId":"7","AniStickerPackId":"3","AniStickerPackName":"喜花妮"},{"QSid":"408","QDes":"/臭美","IQLid":"408","AQLid":"408","EMCode":"10408","QHide":"1","AniStickerType":1,"AniStickerId":"8","AniStickerPackId":"3","AniStickerPackName":"喜花妮"},{"QSid":"412","QDes":"/开心","IQLid":"412","AQLid":"412","EMCode":"10412","QHide":"1","AniStickerType":1,"AniStickerId":"9","AniStickerPackId":"3","AniStickerPackName":"喜花妮"},{"QSid":"409","QDes":"/送你花花","IQLid":"409","AQLid":"409","EMCode":"10409","QHide":"1","AniStickerType":1,"AniStickerId":"10","AniStickerPackId":"3","AniStickerPackName":"喜花妮"},{"QSid":"394","QDes":"/新年大龙","IQLid":"394","AQLid":"394","EMCode":"10394","QHide":"1","AniStickerType":3,"AniStickerPackId":"1","AniStickerId":"40"},{"QSid":"14","QDes":"/微笑","IQLid":"23","AQLid":"23","EMCode":"100"},{"QSid":"1","QDes":"/撇嘴","IQLid":"40","AQLid":"40","EMCode":"101"},{"QSid":"2","QDes":"/色","IQLid":"19","AQLid":"19","EMCode":"102"},{"QSid":"3","QDes":"/发呆","IQLid":"43","AQLid":"43","EMCode":"103"},{"QSid":"4","QDes":"/得意","IQLid":"21","AQLid":"21","EMCode":"104"},{"QSid":"6","QDes":"/害羞","IQLid":"20","AQLid":"20","EMCode":"106"},{"QSid":"7","QDes":"/闭嘴","IQLid":"104","AQLid":"106","EMCode":"107"},{"QSid":"8","QDes":"/睡","IQLid":"35","AQLid":"35","EMCode":"108"},{"QSid":"9","QDes":"/大哭","IQLid":"10","AQLid":"10","EMCode":"109"},{"QSid":"5","QDes":"/流泪","IQLid":"9","AQLid":"9","EMCode":"105","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"16"},{"QSid":"10","QDes":"/尴尬","IQLid":"25","AQLid":"25","EMCode":"110"},{"QSid":"11","QDes":"/发怒","IQLid":"24","AQLid":"24","EMCode":"111"},{"QSid":"12","QDes":"/调皮","IQLid":"1","AQLid":"1","EMCode":"112"},{"QSid":"13","QDes":"/呲牙","IQLid":"0","AQLid":"0","EMCode":"113"},{"QSid":"0","QDes":"/惊讶","IQLid":"33","AQLid":"33","EMCode":"114"},{"QSid":"15","QDes":"/难过","IQLid":"32","AQLid":"32","EMCode":"115"},{"QSid":"16","QDes":"/酷","IQLid":"12","AQLid":"12","EMCode":"116"},{"QSid":"96","QDes":"/冷汗","IQLid":"27","AQLid":"27","EMCode":"117"},{"QSid":"18","QDes":"/抓狂","IQLid":"13","AQLid":"13","EMCode":"118"},{"QSid":"19","QDes":"/吐","IQLid":"22","AQLid":"22","EMCode":"119"},{"QSid":"20","QDes":"/偷笑","IQLid":"3","AQLid":"3","EMCode":"120"},{"QSid":"21","QDes":"/可爱","IQLid":"18","AQLid":"18","EMCode":"121"},{"QSid":"22","QDes":"/白眼","IQLid":"30","AQLid":"30","EMCode":"122"},{"QSid":"23","QDes":"/傲慢","IQLid":"31","AQLid":"31","EMCode":"123"},{"QSid":"24","QDes":"/饥饿","IQLid":"79","AQLid":"81","EMCode":"124"},{"QSid":"25","QDes":"/困","IQLid":"80","AQLid":"82","EMCode":"125"},{"QSid":"26","QDes":"/惊恐","IQLid":"26","AQLid":"26","EMCode":"126"},{"QSid":"27","QDes":"/流汗","IQLid":"2","AQLid":"2","EMCode":"127"},{"QSid":"28","QDes":"/憨笑","IQLid":"37","AQLid":"37","EMCode":"128"},{"QSid":"29","QDes":"/悠闲","IQLid":"50","AQLid":"50","EMCode":"129"},{"QSid":"30","QDes":"/奋斗","IQLid":"42","AQLid":"42","EMCode":"130"},{"QSid":"31","QDes":"/咒骂","IQLid":"81","AQLid":"83","EMCode":"131"},{"QSid":"32","QDes":"/疑问","IQLid":"34","AQLid":"34","EMCode":"132"},{"QSid":"33","QDes":"/嘘","IQLid":"11","AQLid":"11","EMCode":"133"},{"QSid":"34","QDes":"/晕","IQLid":"49","AQLid":"49","EMCode":"134"},{"QSid":"35","QDes":"/折磨","IQLid":"82","AQLid":"84","EMCode":"135"},{"QSid":"36","QDes":"/衰","IQLid":"39","AQLid":"39","EMCode":"136"},{"QSid":"37","QDes":"/骷髅","isStatic":"1","IQLid":"76","AQLid":"78","EMCode":"137"},{"QSid":"38","QDes":"/敲打","IQLid":"5","AQLid":"5","EMCode":"138"},{"QSid":"39","QDes":"/再见","IQLid":"4","AQLid":"4","EMCode":"139"},{"QSid":"97","QDes":"/擦汗","IQLid":"6","AQLid":"6","EMCode":"140"},{"QSid":"98","QDes":"/抠鼻","IQLid":"83","AQLid":"85","EMCode":"141"},{"QSid":"99","QDes":"/鼓掌","IQLid":"84","AQLid":"86","EMCode":"142"},{"QSid":"100","QDes":"/糗大了","IQLid":"85","AQLid":"87","EMCode":"143"},{"QSid":"101","QDes":"/坏笑","IQLid":"46","AQLid":"46","EMCode":"144"},{"QSid":"102","QDes":"/左哼哼","IQLid":"86","AQLid":"88","EMCode":"145"},{"QSid":"103","QDes":"/右哼哼","IQLid":"44","AQLid":"44","EMCode":"146"},{"QSid":"104","QDes":"/哈欠","IQLid":"87","AQLid":"89","EMCode":"147"},{"QSid":"105","QDes":"/鄙视","IQLid":"48","AQLid":"48","EMCode":"148"},{"QSid":"106","QDes":"/委屈","IQLid":"14","AQLid":"14","EMCode":"149"},{"QSid":"107","QDes":"/快哭了","IQLid":"88","AQLid":"90","EMCode":"150"},{"QSid":"108","QDes":"/阴险","IQLid":"41","AQLid":"41","EMCode":"151"},{"QSid":"305","QDes":"/右亲亲","IQLid":"305","AQLid":"305","EMCode":"10305"},{"QSid":"109","QDes":"/左亲亲","IQLid":"36","AQLid":"36","EMCode":"152"},{"QSid":"110","QDes":"/吓","IQLid":"89","AQLid":"91","EMCode":"153"},{"QSid":"111","QDes":"/可怜","IQLid":"51","AQLid":"51","EMCode":"154"},{"QSid":"172","QDes":"/眨眼睛","IQLid":"142","AQLid":"164","EMCode":"242"},{"QSid":"182","QDes":"/笑哭","IQLid":"152","AQLid":"174","EMCode":"252"},{"QSid":"179","QDes":"/doge","IQLid":"149","AQLid":"171","EMCode":"249"},{"QSid":"173","QDes":"/泪奔","IQLid":"143","AQLid":"165","EMCode":"243"},{"QSid":"174","QDes":"/无奈","IQLid":"144","AQLid":"166","EMCode":"244"},{"QSid":"212","QDes":"/托腮","IQLid":"182","AQLid":"161","EMCode":"282"},{"QSid":"175","QDes":"/卖萌","IQLid":"145","AQLid":"167","EMCode":"245"},{"QSid":"178","QDes":"/斜眼笑","IQLid":"148","AQLid":"170","EMCode":"248"},{"QSid":"177","QDes":"/喷血","IQLid":"147","AQLid":"169","EMCode":"247"},{"QSid":"176","QDes":"/小纠结","IQLid":"146","AQLid":"168","EMCode":"246"},{"QSid":"183","QDes":"/我最美","IQLid":"153","AQLid":"175","EMCode":"253"},{"QSid":"262","QDes":"/脑阔疼","IQLid":"262","AQLid":"262","EMCode":"10262"},{"QSid":"263","QDes":"/沧桑","IQLid":"263","AQLid":"263","EMCode":"10263"},{"QSid":"264","QDes":"/捂脸","IQLid":"264","AQLid":"264","EMCode":"10264"},{"QSid":"265","QDes":"/辣眼睛","IQLid":"265","AQLid":"265","EMCode":"10265"},{"QSid":"266","QDes":"/哦哟","IQLid":"266","AQLid":"266","EMCode":"10266"},{"QSid":"267","QDes":"/头秃","IQLid":"267","AQLid":"267","EMCode":"10267"},{"QSid":"268","QDes":"/问号脸","IQLid":"268","AQLid":"268","EMCode":"10268"},{"QSid":"269","QDes":"/暗中观察","IQLid":"269","AQLid":"269","EMCode":"10269"},{"QSid":"270","QDes":"/emm","IQLid":"270","AQLid":"270","EMCode":"10270"},{"QSid":"271","QDes":"/吃瓜","IQLid":"271","AQLid":"271","EMCode":"10271"},{"QSid":"272","QDes":"/呵呵哒","IQLid":"272","AQLid":"272","EMCode":"10272"},{"QSid":"277","QDes":"/汪汪","IQLid":"277","AQLid":"277","EMCode":"10277"},{"QSid":"307","QDes":"/喵喵","IQLid":"307","AQLid":"307","EMCode":"10307"},{"QSid":"306","QDes":"/牛气冲天","isStatic":"1","IQLid":"306","AQLid":"306","EMCode":"10306"},{"QSid":"281","QDes":"/无眼笑","IQLid":"281","AQLid":"281","EMCode":"10281"},{"QSid":"282","QDes":"/敬礼","IQLid":"282","AQLid":"282","EMCode":"10282"},{"QSid":"283","QDes":"/狂笑","IQLid":"283","AQLid":"283","EMCode":"10283"},{"QSid":"284","QDes":"/面无表情","IQLid":"284","AQLid":"284","EMCode":"10284"},{"QSid":"285","QDes":"/摸鱼","IQLid":"285","AQLid":"285","EMCode":"10285"},{"QSid":"293","QDes":"/摸锦鲤","IQLid":"293","AQLid":"293","EMCode":"10293"},{"QSid":"286","QDes":"/魔鬼笑","IQLid":"286","AQLid":"286","EMCode":"10286"},{"QSid":"287","QDes":"/哦","IQLid":"287","AQLid":"287","EMCode":"10287"},{"QSid":"289","QDes":"/睁眼","IQLid":"289","AQLid":"289","EMCode":"10289"},{"QSid":"294","QDes":"/期待","IQLid":"294","AQLid":"294","EMCode":"10294"},{"QSid":"297","QDes":"/拜谢","IQLid":"297","AQLid":"297","EMCode":"10297"},{"QSid":"298","QDes":"/元宝","IQLid":"298","AQLid":"298","EMCode":"10298"},{"QSid":"299","QDes":"/牛啊","IQLid":"299","AQLid":"299","EMCode":"10299"},{"QSid":"300","QDes":"/胖三斤","IQLid":"300","AQLid":"300","EMCode":"10300"},{"QSid":"323","QDes":"/嫌弃","IQLid":"323","AQLid":"323","EMCode":"10323"},{"QSid":"332","QDes":"/举牌牌","IQLid":"332","AQLid":"332","EMCode":"10332"},{"QSid":"336","QDes":"/豹富","IQLid":"336","AQLid":"336","EMCode":"10336"},{"QSid":"353","QDes":"/拜托","IQLid":"353","AQLid":"353","EMCode":"10353"},{"QSid":"355","QDes":"/耶","IQLid":"355","AQLid":"355","EMCode":"10355"},{"QSid":"356","QDes":"/666","IQLid":"356","AQLid":"356","EMCode":"10356"},{"QSid":"354","QDes":"/尊嘟假嘟","IQLid":"354","AQLid":"354","EMCode":"10354"},{"QSid":"352","QDes":"/咦","IQLid":"352","AQLid":"352","EMCode":"10352"},{"QSid":"357","QDes":"/裂开","IQLid":"357","AQLid":"357","EMCode":"10357"},{"QSid":"334","QDes":"/虎虎生威","IQLid":"334","AQLid":"334","EMCode":"10334"},{"QSid":"347","QDes":"/大展宏兔","IQLid":"347","AQLid":"347","EMCode":"10347"},{"QSid":"303","QDes":"/右拜年","IQLid":"303","AQLid":"303","EMCode":"10303"},{"QSid":"302","QDes":"/左拜年","IQLid":"302","AQLid":"302","EMCode":"10302"},{"QSid":"295","QDes":"/拿到红包","IQLid":"295","AQLid":"295","EMCode":"10295"},{"QSid":"311","QDes":"/打call","IQLid":"311","AQLid":"311","EMCode":"10311","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"1"},{"QSid":"312","QDes":"/变形","IQLid":"312","AQLid":"312","EMCode":"10312","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"2"},{"QSid":"314","QDes":"/仔细分析","IQLid":"314","AQLid":"314","EMCode":"10314","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"4"},{"QSid":"317","QDes":"/菜汪","IQLid":"317","AQLid":"317","EMCode":"10317","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"7"},{"QSid":"318","QDes":"/崇拜","IQLid":"318","AQLid":"318","EMCode":"10318","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"8"},{"QSid":"319","QDes":"/比心","IQLid":"319","AQLid":"319","EMCode":"10319","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"9"},{"QSid":"320","QDes":"/庆祝","IQLid":"320","AQLid":"320","EMCode":"10320","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"10"},{"QSid":"324","QDes":"/吃糖","IQLid":"324","AQLid":"324","EMCode":"10324","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"12"},{"QSid":"325","QDes":"/惊吓","IQLid":"325","AQLid":"325","EMCode":"10325","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"14"},{"QSid":"337","QDes":"/花朵脸","IQLid":"337","AQLid":"337","EMCode":"10337","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"22"},{"QSid":"338","QDes":"/我想开了","IQLid":"338","AQLid":"338","EMCode":"10338","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"20"},{"QSid":"339","QDes":"/舔屏","IQLid":"339","AQLid":"339","EMCode":"10339","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"21"},{"QSid":"341","QDes":"/打招呼","IQLid":"341","AQLid":"341","EMCode":"10341","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"24"},{"QSid":"342","QDes":"/酸Q","IQLid":"342","AQLid":"342","EMCode":"10342","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"26"},{"QSid":"343","QDes":"/我方了","IQLid":"343","AQLid":"343","EMCode":"10343","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"27"},{"QSid":"344","QDes":"/大怨种","IQLid":"344","AQLid":"344","EMCode":"10344","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"28"},{"QSid":"345","QDes":"/红包多多","IQLid":"345","AQLid":"345","EMCode":"10345","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"29"},{"QSid":"346","QDes":"/你真棒棒","IQLid":"346","AQLid":"346","EMCode":"10346","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"25"},{"QSid":"181","QDes":"/戳一戳","IQLid":"151","AQLid":"173","EMCode":"251","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"37"},{"QSid":"74","QDes":"/太阳","isStatic":"1","IQLid":"73","AQLid":"75","EMCode":"176","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"35"},{"QSid":"75","QDes":"/月亮","isStatic":"1","IQLid":"67","AQLid":"68","EMCode":"175","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"36"},{"QSid":"351","QDes":"/敲敲","IQLid":"351","AQLid":"351","EMCode":"10351","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"30"},{"QSid":"349","QDes":"/坚强","IQLid":"349","AQLid":"349","EMCode":"10349","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"32"},{"QSid":"350","QDes":"/贴贴","IQLid":"350","AQLid":"350","EMCode":"10350","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"31"},{"QSid":"395","QDes":"/略略略","IQLid":"395","AQLid":"395","EMCode":"10395","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"41"},{"QSid":"114","QDes":"/篮球","IQLid":"90","AQLid":"92","EMCode":"158","AniStickerType":2,"AniStickerPackId":"1","AniStickerId":"13"},{"QSid":"358","QDes":"/骰子","IQLid":"358","AQLid":"358","QHide":"1","EMCode":"10358","AniStickerType":2,"AniStickerPackId":"1","AniStickerId":"33"},{"QSid":"359","QDes":"/包剪锤","IQLid":"359","AQLid":"359","QHide":"1","EMCode":"10359","AniStickerType":2,"AniStickerPackId":"1","AniStickerId":"34"},{"QSid":"326","QDes":"/生气","IQLid":"326","AQLid":"326","EMCode":"10326","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"15"},{"QSid":"53","QDes":"/蛋糕","IQLid":"59","AQLid":"59","EMCode":"168","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"17"},{"QSid":"49","QDes":"/拥抱","IQLid":"45","AQLid":"45","EMCode":"178"},{"QSid":"66","QDes":"/爱心","IQLid":"28","AQLid":"28","EMCode":"166"},{"QSid":"63","QDes":"/玫瑰","IQLid":"8","AQLid":"8","EMCode":"163"},{"QSid":"64","QDes":"/凋谢","IQLid":"57","AQLid":"57","EMCode":"164"},{"QSid":"187","QDes":"/幽灵","IQLid":"157","AQLid":"179","EMCode":"257"},{"QSid":"146","QDes":"/爆筋","IQLid":"116","AQLid":"118","EMCode":"121011"},{"QSid":"116","QDes":"/示爱","IQLid":"29","AQLid":"29","EMCode":"165"},{"QSid":"67","QDes":"/心碎","IQLid":"72","AQLid":"74","EMCode":"167"},{"QSid":"60","QDes":"/咖啡","IQLid":"66","AQLid":"66","EMCode":"160"},{"QSid":"185","QDes":"/羊驼","IQLid":"155","AQLid":"177","EMCode":"255"},{"QSid":"137","QDes":"/鞭炮","isStatic":"1","IQLid":"107","AQLid":"109","EMCode":"121002","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"18"},{"QSid":"333","QDes":"/烟花","isStatic":"1","IQLid":"333","AQLid":"333","EMCode":"10333","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"19"},{"QSid":"76","QDes":"/赞","IQLid":"52","AQLid":"52","EMCode":"179"},{"QSid":"124","QDes":"/OK","IQLid":"64","AQLid":"64","EMCode":"189"},{"QSid":"118","QDes":"/抱拳","IQLid":"56","AQLid":"56","EMCode":"183"},{"QSid":"78","QDes":"/握手","IQLid":"54","AQLid":"54","EMCode":"181"},{"QSid":"119","QDes":"/勾引","IQLid":"63","AQLid":"63","EMCode":"184"},{"QSid":"79","QDes":"/胜利","IQLid":"55","AQLid":"55","EMCode":"182"},{"QSid":"120","QDes":"/拳头","IQLid":"71","AQLid":"73","EMCode":"185"},{"QSid":"121","QDes":"/差劲","IQLid":"70","AQLid":"72","EMCode":"186"},{"QSid":"77","QDes":"/踩","IQLid":"53","AQLid":"53","EMCode":"180"},{"QSid":"123","QDes":"/NO","IQLid":"92","AQLid":"94","EMCode":"188"},{"QSid":"201","QDes":"/点赞","IQLid":"171","AQLid":"150","EMCode":"271"},{"QSid":"273","QDes":"/我酸了","isStatic":"1","IQLid":"273","AQLid":"273","EMCode":"10273"},{"QSid":"46","QDes":"/猪头","isStatic":"1","IQLid":"7","AQLid":"7","EMCode":"162"},{"QSid":"112","QDes":"/菜刀","IQLid":"17","AQLid":"17","EMCode":"155"},{"QSid":"56","QDes":"/刀","IQLid":"68","AQLid":"70","EMCode":"171"},{"QSid":"169","QDes":"/手枪","isStatic":"1","IQLid":"139","AQLid":"141","EMCode":"121034"},{"QSid":"171","QDes":"/茶","IQLid":"141","AQLid":"163","EMCode":"241"},{"QSid":"59","QDes":"/便便","IQLid":"15","AQLid":"15","EMCode":"174"},{"QSid":"144","QDes":"/喝彩","isStatic":"1","IQLid":"114","AQLid":"116","EMCode":"121009"},{"QSid":"147","QDes":"/棒棒糖","isStatic":"1","IQLid":"117","AQLid":"119","EMCode":"121012"},{"QSid":"89","QDes":"/西瓜","isStatic":"1","IQLid":"60","AQLid":"60","EMCode":"156"},{"QSid":"148","QDes":"/喝奶","isStatic":"1","IQLid":"118","AQLid":"120","QHide":"1","EMCode":"121013"},{"QSid":"55","QDes":"/炸弹","isStatic":"1","IQLid":"16","AQLid":"16","QHide":"1","EMCode":"170"},{"QSid":"41","QDes":"/发抖","isStatic":"1","IQLid":"69","AQLid":"71","EMCode":"193"},{"QSid":"125","QDes":"/转圈","IQLid":"95","AQLid":"97","EMCode":"195"},{"QSid":"42","QDes":"/爱情","IQLid":"38","AQLid":"38","EMCode":"190"},{"QSid":"43","QDes":"/跳跳","IQLid":"93","AQLid":"95","EMCode":"192"},{"QSid":"86","QDes":"/怄火","IQLid":"94","AQLid":"96","EMCode":"194"},{"QSid":"129","QDes":"/挥手","IQLid":"77","AQLid":"79","EMCode":"199"},{"QSid":"226","QDes":"/拍桌","IQLid":"196","isCMEmoji":"1","AQLid":"198","QHide":"1","EMCode":"297"},{"QSid":"85","QDes":"/飞吻","isStatic":"1","IQLid":"47","AQLid":"47","EMCode":"191"},{"QSid":"215","QDes":"/糊脸","IQLid":"185","isCMEmoji":"1","AQLid":"187","QHide":"1","EMCode":"285"},{"QSid":"214","QDes":"/啵啵","IQLid":"184","isCMEmoji":"1","AQLid":"186","QHide":"1","EMCode":"284"},{"QSid":"222","QDes":"/抱抱","IQLid":"192","isCMEmoji":"1","AQLid":"194","QHide":"1","EMCode":"292"},{"QSid":"203","QDes":"/托脸","IQLid":"173","AQLid":"152","QHide":"1","EMCode":"273"},{"QSid":"235","QDes":"/颤抖","IQLid":"205","isCMEmoji":"1","AQLid":"207","QHide":"1","EMCode":"305"},{"QSid":"241","QDes":"/生日快乐","IQLid":"211","isCMEmoji":"1","AQLid":"213","QHide":"1","EMCode":"311"},{"QSid":"237","QDes":"/偷看","IQLid":"207","isCMEmoji":"1","AQLid":"209","QHide":"1","EMCode":"307"},{"QSid":"218","QDes":"/舔一舔","IQLid":"188","isCMEmoji":"1","AQLid":"190","QHide":"1","EMCode":"288"},{"QSid":"233","QDes":"/掐一掐","IQLid":"203","isCMEmoji":"1","AQLid":"205","QHide":"1","EMCode":"303"},{"QSid":"232","QDes":"/佛系","IQLid":"202","isCMEmoji":"1","AQLid":"204","QHide":"1","EMCode":"302"},{"QSid":"238","QDes":"/扇脸","IQLid":"208","isCMEmoji":"1","AQLid":"210","QHide":"1","EMCode":"308"},{"QSid":"217","QDes":"/扯一扯","IQLid":"187","isCMEmoji":"1","AQLid":"189","QHide":"1","EMCode":"287"},{"QSid":"225","QDes":"/撩一撩","IQLid":"195","isCMEmoji":"1","AQLid":"197","QHide":"1","EMCode":"296"},{"QSid":"230","QDes":"/嘲讽","IQLid":"200","isCMEmoji":"1","AQLid":"202","QHide":"1","EMCode":"300"},{"QSid":"194","QDes":"/不开心","IQLid":"164","AQLid":"143","QHide":"1","EMCode":"264"},{"QSid":"210","QDes":"/飙泪","IQLid":"180","AQLid":"159","QHide":"1","EMCode":"280"},{"QSid":"193","QDes":"/大笑","IQLid":"163","AQLid":"185","QHide":"1","EMCode":"263"},{"QSid":"204","QDes":"/吃","IQLid":"174","AQLid":"153","QHide":"1","EMCode":"274"},{"QSid":"200","QDes":"/求求","IQLid":"170","AQLid":"149","QHide":"1","EMCode":"270"},{"QSid":"290","QDes":"/敲开心","IQLid":"290","isCMEmoji":"1","AQLid":"290","QHide":"1","EMCode":"20240"},{"QSid":"224","QDes":"/开枪","IQLid":"194","isCMEmoji":"1","AQLid":"196","QHide":"1","EMCode":"295"},{"QSid":"229","QDes":"/干杯","IQLid":"199","isCMEmoji":"1","AQLid":"201","QHide":"1","EMCode":"299"},{"QSid":"221","QDes":"/顶呱呱","IQLid":"191","isCMEmoji":"1","AQLid":"193","QHide":"1","EMCode":"291"},{"QSid":"219","QDes":"/蹭一蹭","IQLid":"189","isCMEmoji":"1","AQLid":"191","QHide":"1","EMCode":"289"},{"QSid":"227","QDes":"/拍手","IQLid":"197","isCMEmoji":"1","AQLid":"199","QHide":"1","EMCode":"294"},{"QSid":"216","QDes":"/拍头","IQLid":"186","isCMEmoji":"1","AQLid":"188","QHide":"1","EMCode":"286"},{"QSid":"231","QDes":"/哼","IQLid":"201","isCMEmoji":"1","AQLid":"203","QHide":"1","EMCode":"301"},{"QSid":"244","QDes":"/扔狗","IQLid":"214","isCMEmoji":"1","AQLid":"216","QHide":"1","EMCode":"312"},{"QSid":"223","QDes":"/暴击","IQLid":"193","isCMEmoji":"1","AQLid":"195","QHide":"1","EMCode":"293"},{"QSid":"243","QDes":"/甩头","IQLid":"213","isCMEmoji":"1","AQLid":"215","QHide":"1","EMCode":"313"},{"QSid":"211","QDes":"/我不看","IQLid":"181","AQLid":"160","QHide":"1","EMCode":"281"},{"QSid":"292","QDes":"/让我康康","IQLid":"292","isCMEmoji":"1","AQLid":"292","QHide":"1","EMCode":"20242"},{"QSid":"240","QDes":"/喷脸","IQLid":"210","isCMEmoji":"1","AQLid":"212","QHide":"1","EMCode":"310"},{"QSid":"180","QDes":"/惊喜","IQLid":"150","AQLid":"172","QHide":"1","EMCode":"250"},{"QSid":"122","QDes":"/爱你","IQLid":"65","AQLid":"65","QHide":"1","EMCode":"187"},{"QSid":"202","QDes":"/无聊","IQLid":"172","AQLid":"151","QHide":"1","EMCode":"272"},{"QSid":"278","QDes":"/汗","IQLid":"278","isCMEmoji":"1","AQLid":"278","QHide":"1","EMCode":"20237"},{"QSid":"301","QDes":"/好闪","IQLid":"301","AQLid":"301","QHide":"1","EMCode":"10301"},{"QSid":"288","QDes":"/请","IQLid":"288","AQLid":"288","QHide":"1","EMCode":"10288"},{"QSid":"322","QDes":"/拒绝","IQLid":"322","AQLid":"322","QHide":"1","EMCode":"10322"},{"QSid":"198","QDes":"/呃","IQLid":"168","AQLid":"147","QHide":"1","EMCode":"268"},{"QSid":"348","QDes":"/福萝卜","IQLid":"348","AQLid":"348","QHide":"1","EMCode":"10348"},{"QSid":"206","QDes":"/害怕","IQLid":"176","AQLid":"155","QHide":"1","EMCode":"276"},{"QSid":"239","QDes":"/原谅","IQLid":"209","isCMEmoji":"1","AQLid":"211","QHide":"1","EMCode":"309"},{"QSid":"424","QDes":"/续标识","IQLid":"424","AQLid":"424","EMCode":"10424","QHide":"0","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"52"},{"QSid":"415","QDes":"/划龙舟","IQLid":"415","AQLid":"415","EMCode":"10415","QHide":"0","AniStickerType":3,"AniStickerPackId":"1","AniStickerId":"43"},{"QSid":"416","QDes":"/中龙舟","IQLid":"416","AQLid":"416","EMCode":"10416","QHide":"1","AniStickerType":3,"AniStickerPackId":"1","AniStickerId":"44"},{"QSid":"417","QDes":"/大龙舟","IQLid":"417","AQLid":"417","EMCode":"10417","QHide":"1","AniStickerType":3,"AniStickerPackId":"1","AniStickerId":"45"},{"QSid":"425","QDes":"/求放过","IQLid":"425","AQLid":"425","EMCode":"10425","QHide":"0","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"53"},{"QSid":"427","QDes":"/偷感","IQLid":"427","AQLid":"427","EMCode":"10427","QHide":"0","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"55"},{"QSid":"426","QDes":"/玩火","IQLid":"426","AQLid":"426","EMCode":"10426","QHide":"0","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"54"},{"QSid":"419","QDes":"/火车","IQLid":"419","AQLid":"419","EMCode":"10419","QHide":"0","AniStickerType":3,"AniStickerPackId":"1","AniStickerId":"47"},{"QSid":"420","QDes":"/中火车","IQLid":"420","AQLid":"420","EMCode":"10420","QHide":"1","AniStickerType":3,"AniStickerPackId":"1","AniStickerId":"48"},{"QSid":"421","QDes":"/大火车","IQLid":"421","AQLid":"421","EMCode":"10421","QHide":"1","AniStickerType":3,"AniStickerPackId":"1","AniStickerId":"49"},{"QSid":"429","QDes":"/蛇年快乐","IQLid":"429","AQLid":"429","EMCode":"10429","QHide":"0","AniStickerType":3,"AniStickerPackId":"1","AniStickerId":"56"},{"QSid":"430","QDes":"/蛇身","IQLid":"430","AQLid":"430","EMCode":"10430","QHide":"1","AniStickerType":3,"AniStickerPackId":"1","AniStickerId":"57"},{"QSid":"431","QDes":"/蛇尾","IQLid":"431","AQLid":"431","EMCode":"10431","QHide":"1","AniStickerType":3,"AniStickerPackId":"1","AniStickerId":"56"},{"QSid":"428","QDes":"/收到","IQLid":"428","AQLid":"428","EMCode":"10428","QHide":"0","AniStickerType":0,"AniStickerPackId":"0","AniStickerId":"0"},{"QSid":"422","QDes":"/粽于等到你","IQLid":"422","AQLid":"422","EMCode":"10422","QHide":"1","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"50"},{"QSid":"423","QDes":"/复兴号","IQLid":"423","AQLid":"423","EMCode":"10423","QHide":"1","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"51"},{"QSid":"432","QDes":"/灵蛇献瑞","IQLid":"432","AQLid":"432","EMCode":"10432","QHide":"1","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"59"}]'), zge = {
  sysface: Wge
};
var Qs = /* @__PURE__ */ ((t) => (t.male = "male", t.female = "female", t.unknown = "unknown", t))(Qs || {}), fm = /* @__PURE__ */ ((t) => (t.owner = "owner", t.admin = "admin", t.member = "member", t))(fm || {}), ze = /* @__PURE__ */ ((t) => (t.text = "text", t.image = "image", t.music = "music", t.video = "video", t.voice = "record", t.file = "file", t.at = "at", t.reply = "reply", t.json = "json", t.face = "face", t.mface = "mface", t.markdown = "markdown", t.node = "node", t.forward = "forward", t.xml = "xml", t.poke = "poke", t.dice = "dice", t.rps = "rps", t.miniapp = "miniapp", t.contact = "contact", t.location = "location", t.onlinefile = "onlinefile", t.flashtransfer = "flashtransfer", t))(ze || {});
const Kge = p.Object({
  type: p.Literal(
    "text"
    /* text */
  ),
  data: p.Object({
    text: p.String({ description: "纯文本内容" })
  })
}, { $id: "OB11MessageText", description: "纯文本消息段" }), Vge = p.Object({
  type: p.Literal(
    "face"
    /* face */
  ),
  data: p.Object({
    id: p.String({ description: "表情ID" }),
    resultId: p.Optional(p.String({ description: "结果ID" })),
    chainCount: p.Optional(p.Number({ description: "连击数" }))
  })
}, { $id: "OB11MessageFace", description: "QQ表情消息段" }), Yge = p.Object({
  type: p.Literal(
    "mface"
    /* mface */
  ),
  data: p.Object({
    emoji_package_id: p.Number({ description: "表情包ID" }),
    emoji_id: p.String({ description: "表情ID" }),
    key: p.String({ description: "表情key" }),
    summary: p.String({ description: "表情摘要" })
  })
}, { $id: "OB11MessageMFace", description: "商城表情消息段" }), Jge = p.Object({
  type: p.Literal(
    "at"
    /* at */
  ),
  data: p.Object({
    qq: p.String({ description: "QQ号或all" }),
    name: p.Optional(p.String({ description: "显示名称" }))
  })
}, { $id: "OB11MessageAt", description: "@消息段" }), Xge = p.Object({
  type: p.Literal(
    "reply"
    /* reply */
  ),
  data: p.Object({
    id: p.Optional(p.String({ description: "消息ID的短ID映射" })),
    seq: p.Optional(p.Number({ description: "消息序列号，优先使用" }))
  })
}, { $id: "OB11MessageReply", description: "回复消息段" }), _f = p.Object({
  file: p.String({ description: "文件路径/URL/file:///" }),
  path: p.Optional(p.String({ description: "文件路径" })),
  url: p.Optional(p.String({ description: "文件URL" })),
  name: p.Optional(p.String({ description: "文件名" })),
  thumb: p.Optional(p.String({ description: "缩略图" }))
}, { $id: "FileBaseData", description: "文件消息段基础数据" });
p.Object({
  data: _f
}, { $id: "OB11MessageFileBase", description: "文件消息基础接口" });
const Zge = p.Object({
  type: p.Literal(
    "image"
    /* image */
  ),
  data: p.Intersect([
    p.Omit(_f, []),
    p.Object({
      summary: p.Optional(p.String({ description: "图片摘要" })),
      sub_type: p.Optional(p.Number({ description: "图片子类型" }))
    })
  ])
}, { $id: "OB11MessageImage", description: "图片消息段" }), e0e = p.Object({
  type: p.Literal(
    "record"
    /* voice */
  ),
  data: _f
}, { $id: "OB11MessageRecord", description: "语音消息段" }), t0e = p.Object({
  type: p.Literal(
    "video"
    /* video */
  ),
  data: _f
}, { $id: "OB11MessageVideo", description: "视频消息段" }), n0e = p.Object({
  type: p.Literal(
    "file"
    /* file */
  ),
  data: _f
}, { $id: "OB11MessageFile", description: "文件消息段" }), r0e = p.Object({
  type: p.Union([
    p.Literal("qq"),
    p.Literal("163"),
    p.Literal("kugou"),
    p.Literal("migu"),
    p.Literal("kuwo")
  ], { description: "音乐平台类型" }),
  id: p.Union([p.String(), p.Number()], { description: "音乐ID" })
}), i0e = p.Object({
  type: p.Union([
    p.Literal("qq"),
    p.Literal("163"),
    p.Literal("kugou"),
    p.Literal("migu"),
    p.Literal("kuwo"),
    p.Literal("custom")
  ], { description: "音乐平台类型" }),
  id: p.Undefined(),
  url: p.String({ description: "点击后跳转URL" }),
  audio: p.Optional(p.String({ description: "音频URL" })),
  title: p.Optional(p.String({ description: "音乐标题" })),
  image: p.String({ description: "封面图片URL" }),
  content: p.Optional(p.String({ description: "音乐简介" }))
}), o0e = p.Object({
  type: p.Literal(
    "music"
    /* music */
  ),
  data: r0e
}, { $id: "OB11MessageIdMusic", description: "ID音乐消息段" }), s0e = p.Object({
  type: p.Literal(
    "music"
    /* music */
  ),
  data: i0e
}, { $id: "OB11MessageCustomMusic", description: "自定义音乐消息段" }), a0e = p.Object({
  type: p.Literal(
    "poke"
    /* poke */
  ),
  data: p.Object({
    type: p.String({ description: "戳一戳类型" }),
    id: p.String({ description: "戳一戳ID" })
  })
}, { $id: "OB11MessagePoke", description: "戳一戳消息段" }), c0e = p.Object({
  type: p.Literal(
    "dice"
    /* dice */
  ),
  data: p.Object({
    result: p.Union([p.Number(), p.String()], { description: "骰子结果" })
  })
}, { $id: "OB11MessageDice", description: "骰子消息段" }), u0e = p.Object({
  type: p.Literal(
    "rps"
    /* rps */
  ),
  data: p.Object({
    result: p.Union([p.Number(), p.String()], { description: "猜拳结果" })
  })
}, { $id: "OB11MessageRPS", description: "猜拳消息段" }), l0e = p.Object({
  type: p.Literal(
    "contact"
    /* contact */
  ),
  data: p.Object({
    type: p.Union([p.Literal("qq"), p.Literal("group")], { description: "联系人类型" }),
    id: p.String({ description: "联系人ID" })
  })
}, { $id: "OB11MessageContact", description: "联系人消息段" }), p0e = p.Object({
  type: p.Literal(
    "location"
    /* location */
  ),
  data: p.Object({
    lat: p.Union([p.String(), p.Number()], { description: "纬度" }),
    lon: p.Union([p.String(), p.Number()], { description: "经度" }),
    title: p.Optional(p.String({ description: "标题" })),
    content: p.Optional(p.String({ description: "内容" }))
  })
}, { $id: "OB11MessageLocation", description: "位置消息段" }), d0e = p.Object({
  type: p.Literal(
    "json"
    /* json */
  ),
  data: p.Object({
    data: p.Union([p.String(), p.Object({})], { description: "JSON数据" }),
    config: p.Optional(p.Object({
      token: p.String({ description: "token" })
    }))
  })
}, { $id: "OB11MessageJson", description: "JSON消息段" }), f0e = p.Object({
  type: p.Literal(
    "xml"
    /* xml */
  ),
  data: p.Object({
    data: p.String({ description: "XML数据" })
  })
}, { $id: "OB11MessageXml", description: "XML消息段" }), h0e = p.Object({
  type: p.Literal(
    "markdown"
    /* markdown */
  ),
  data: p.Object({
    content: p.String({ description: "Markdown内容" })
  })
}, { $id: "OB11MessageMarkdown", description: "Markdown消息段" }), m0e = p.Object({
  type: p.Literal(
    "miniapp"
    /* miniapp */
  ),
  data: p.Object({
    data: p.String({ description: "小程序数据" })
  })
}, { $id: "OB11MessageMiniApp", description: "小程序消息段" }), g0e = p.Object({
  type: p.Literal(
    "onlinefile"
    /* onlinefile */
  ),
  data: p.Object({
    msgId: p.String({ description: "消息ID" }),
    elementId: p.String({ description: "元素ID" }),
    fileName: p.String({ description: "文件名" }),
    fileSize: p.String({ description: "文件大小" }),
    isDir: p.Boolean({ description: "是否为目录" })
  })
}, { $id: "OB11MessageOnlineFile", description: "在线文件消息段" }), y0e = p.Object({
  type: p.Literal(
    "flashtransfer"
    /* flashtransfer */
  ),
  data: p.Object({
    fileSetId: p.String({ description: "文件集ID" })
  })
}, { $id: "OB11MessageFlashTransfer", description: "QQ闪传消息段" }), v0e = p.Object({
  type: p.Literal(
    "node"
    /* node */
  ),
  data: p.Object({
    id: p.Optional(p.String({ description: "转发消息ID" })),
    user_id: p.Optional(p.Union([p.Number(), p.String()], { description: "发送者QQ号" })),
    uin: p.Optional(p.Union([p.Number(), p.String()], { description: "发送者QQ号(兼容go-cqhttp)" })),
    nickname: p.String({ description: "发送者昵称" }),
    name: p.Optional(p.String({ description: "发送者昵称(兼容go-cqhttp)" })),
    // content 使用 Any 以支持循环引用，实际类型是 OB11MessageMixType
    content: p.Any({ description: "消息内容 (OB11MessageMixType)" }),
    source: p.Optional(p.String({ description: "消息来源" })),
    news: p.Optional(p.Array(p.Object({
      text: p.String({ description: "新闻文本" })
    }))),
    summary: p.Optional(p.String({ description: "摘要" })),
    prompt: p.Optional(p.String({ description: "提示" })),
    time: p.Optional(p.String({ description: "时间" }))
  })
}, { $id: "OB11MessageNode", description: "合并转发消息节点" }), b0e = p.Object({
  type: p.Literal(
    "forward"
    /* forward */
  ),
  data: p.Object({
    id: p.String({ description: "合并转发ID" }),
    // content 使用 Any 以支持类型兼容，实际类型是 OB11Message[]
    content: p.Optional(p.Any({ description: "消息内容 (OB11Message[])" }))
  })
}, { $id: "OB11MessageForward", description: "合并转发消息段" }), Q_ = p.Union([
  Kge,
  Vge,
  Yge,
  Jge,
  Xge,
  Zge,
  e0e,
  t0e,
  n0e,
  o0e,
  s0e,
  a0e,
  c0e,
  u0e,
  l0e,
  p0e,
  d0e,
  f0e,
  h0e,
  m0e,
  v0e,
  b0e,
  g0e,
  y0e
], { $id: "OB11MessageData", description: "OneBot 11 消息段" }), Cg = p.Union([
  p.Array(Q_),
  p.String(),
  Q_
], { $id: "OB11MessageMixType", description: "OneBot 11 消息混合类型" });
p.Object({
  message_type: p.Optional(p.Union([p.Literal("private"), p.Literal("group")], { description: "消息类型" })),
  user_id: p.Optional(p.String({ description: "用户QQ号" })),
  group_id: p.Optional(p.String({ description: "群号" })),
  message: Cg,
  messages: p.Optional(Cg),
  auto_escape: p.Optional(p.Union([p.Boolean(), p.String()], { description: "是否作为纯文本发送" })),
  source: p.Optional(p.String({ description: "消息来源" })),
  news: p.Optional(p.Array(p.Object({
    text: p.String({ description: "文本" })
  }))),
  summary: p.Optional(p.String({ description: "摘要" })),
  prompt: p.Optional(p.String({ description: "提示" })),
  time: p.Optional(p.String({ description: "时间" }))
}, { $id: "OB11PostSendMsg", description: "OneBot 11 发送消息请求" });
const x0e = p.Object({
  user_id: p.Union([p.Number(), p.String()], { description: "发送者QQ号" }),
  nickname: p.String({ description: "发送者昵称" }),
  card: p.Optional(p.String({ description: "群名片" })),
  role: p.Optional(p.String({ description: "角色" })),
  sex: p.Optional(p.String({ description: "性别" })),
  age: p.Optional(p.Number({ description: "年龄" })),
  area: p.Optional(p.String({ description: "地区" })),
  level: p.Optional(p.String({ description: "等级" })),
  title: p.Optional(p.String({ description: "头衔" }))
}, { $id: "OB11Sender", description: "OneBot 11 发送者信息" });
p.Object({
  real_seq: p.Optional(p.String({ description: "真实序列号" })),
  temp_source: p.Optional(p.Number({ description: "临时会话来源" })),
  message_sent_type: p.Optional(p.String({ description: "消息发送类型" })),
  target_id: p.Optional(p.Number({ description: "目标ID" })),
  self_id: p.Optional(p.Number({ description: "机器人QQ号" })),
  time: p.Number({ description: "消息时间戳" }),
  message_id: p.Number({ description: "消息ID" }),
  message_seq: p.Number({ description: "消息序列号" }),
  real_id: p.Number({ description: "真实ID" }),
  user_id: p.Union([p.Number(), p.String()], { description: "发送者QQ号" }),
  group_id: p.Optional(p.Union([p.Number(), p.String()], { description: "群号" })),
  group_name: p.Optional(p.String({ description: "群名称" })),
  message_type: p.Union([p.Literal("private"), p.Literal("group")], { description: "消息类型" }),
  sub_type: p.Optional(p.Union([
    p.Literal("friend"),
    p.Literal("group"),
    p.Literal("normal")
  ], { description: "消息子类型" })),
  sender: x0e,
  message: p.Union([p.Array(Q_), p.String()], { description: "消息内容" }),
  message_format: p.Union([p.Literal("array"), p.Literal("string")], { description: "消息格式" }),
  raw_message: p.String({ description: "原始消息" }),
  font: p.Number({ description: "字体" }),
  post_type: p.Optional(p.String({ description: "上报类型" })),
  raw: p.Optional(p.Unknown({ description: "原始消息对象" })),
  emoji_likes_list: p.Optional(p.Array(p.Object({
    emoji_id: p.String({ description: "表情ID" }),
    emoji_type: p.String({ description: "表情类型" }),
    likes_cnt: p.String({ description: "点赞数" })
  }), { description: "表情点赞列表" }))
}, { $id: "OB11Message", description: "OneBot 11 完整消息对象" });
class Ni {
  static selfInfo(e) {
    return {
      user_id: +e.uin,
      nickname: e.nick
    };
  }
  static friends(e) {
    return e.map((n) => ({
      birthday_year: n.baseInfo.birthday_year,
      birthday_month: n.baseInfo.birthday_month,
      birthday_day: n.baseInfo.birthday_day,
      user_id: parseInt(n.coreInfo.uin),
      age: n.baseInfo.age,
      phone_num: n.baseInfo.phoneNum,
      email: n.baseInfo.eMail,
      category_id: n.baseInfo.categoryId,
      nickname: n.coreInfo.nick ?? "",
      remark: n.coreInfo.remark ?? n.coreInfo.nick,
      sex: this.sex(n.baseInfo.sex),
      level: n.qqLevel && $w(n.qqLevel) || 0
    }));
  }
  static friend(e) {
    return {
      birthday_year: e.baseInfo.birthday_year,
      birthday_month: e.baseInfo.birthday_month,
      birthday_day: e.baseInfo.birthday_day,
      user_id: parseInt(e.coreInfo.uin),
      age: e.baseInfo.age,
      phone_num: e.baseInfo.phoneNum,
      email: e.baseInfo.eMail,
      category_id: e.baseInfo.categoryId,
      nickname: e.coreInfo.nick ?? "",
      remark: e.coreInfo.remark ?? e.coreInfo.nick,
      sex: this.sex(e.baseInfo.sex),
      level: 0
    };
  }
  static groupMemberRole(e) {
    return {
      4: fm.owner,
      3: fm.admin,
      2: fm.member
    }[e];
  }
  static sex(e) {
    return e && {
      [Wl.GENDER_MALE]: Qs.male,
      [Wl.GENDER_FEMALE]: Qs.female,
      [Wl.GENDER_UNKOWN]: Qs.unknown,
      [Wl.GENDER_PRIVACY]: Qs.unknown
    }[e] || Qs.unknown;
  }
  static groupMember(e, n) {
    return {
      group_id: +e,
      user_id: +n.uin,
      nickname: n.nick,
      card: n.cardName,
      sex: this.sex(n.sex),
      age: n.age ?? 0,
      area: "",
      level: n.memberRealLevel?.toString() ?? "0",
      qq_level: n.qqLevel && $w(n.qqLevel) || 0,
      join_time: +n.joinTime,
      last_sent_time: +n.lastSpeakTime,
      title_expire_time: 0,
      unfriendly: !1,
      card_changeable: !0,
      is_robot: n.isRobot,
      shut_up_timestamp: n.shutUpTime,
      role: this.groupMemberRole(n.role),
      title: n.memberSpecialTitle ?? ""
    };
  }
  static group(e) {
    return {
      group_all_shut: +e.groupShutupExpireTime > 0 ? -1 : 0,
      group_remark: e.remarkName,
      group_id: +e.groupCode,
      group_name: e.groupName,
      member_count: e.memberCount,
      max_member_count: e.maxMember
    };
  }
  static groups(e) {
    return e.map(this.group);
  }
  static file(e, n) {
    return {
      group_id: +e,
      file_id: Jt.encodeModelId({ chatType: 2, peerUid: e }, n.fileModelId, n.fileId, n.fileId ?? ""),
      file_name: n.fileName,
      busid: n.busId,
      size: +n.fileSize,
      file_size: +n.fileSize,
      upload_time: n.uploadTime,
      dead_time: n.deadTime,
      modify_time: n.modifyTime,
      download_times: n.downloadTimes,
      uploader: +n.uploaderUin,
      uploader_name: n.uploaderName
    };
  }
  static folder(e, n) {
    return {
      group_id: +e,
      folder_id: n.folderId,
      folder: n.folderId,
      folder_name: n.folderName,
      create_time: n.createTime,
      creator: +n.createUin,
      creator_name: n.creatorName,
      total_file_count: n.totalFileCount
    };
  }
}
const w0e = /\[CQ:(\w+)((,\w+=[^,\]]*)*)]/;
function $_(t) {
  return String(t).replace(/&#91;/g, "[").replace(/&#93;/g, "]").replace(/&#44;/g, ",").replace(/&amp;/g, "&");
}
function S0e(t) {
  const e = w0e.exec(t);
  if (!e) return null;
  const [, n, r] = e, i = {};
  return r && r.slice(1).split(",").forEach((o) => {
    const s = o.indexOf("=");
    i[o.slice(0, s)] = $_(o.slice(s + 1));
  }), { type: n, data: i, capture: e };
}
function bw(t, e) {
  return {
    type: t,
    data: e
  };
}
function _0e(t) {
  const e = [];
  let n;
  for (; n = S0e(t); ) {
    const { type: r, data: i, capture: o } = n;
    r && (o.index && e.push(bw("text", { text: $_(t.slice(0, o.index)) })), e.push(bw(r, i)), t = t.slice(o.index + o[0].length));
  }
  return t && e.push(bw("text", { text: $_(t) })), e;
}
function E0e(t) {
  return t.replace(/&/g, "&amp;").replace(/\[/g, "&#91;").replace(/]/g, "&#93;");
}
function A0e(t) {
  return t.replace(/&/g, "&amp;").replace(/\[/g, "&#91;").replace(/]/g, "&#93;").replace(/,/g, "&#44;");
}
function I0e(t) {
  if (t.type === "text")
    return E0e(t.data.text);
  let e = "[CQ:" + t.type;
  for (const n in t.data) {
    const r = t.data[n];
    if (r !== void 0)
      try {
        let i;
        typeof r == "object" && r?.toString === Object.prototype.toString ? i = JSON.stringify(r) : i = r?.toString(), i && (e += `,${n}=${A0e(i)}`);
      } catch (i) {
        console.error(`Error encoding CQCode for ${n}:`, i);
      }
  }
  return e += "]", e;
}
class C0e extends Ps {
  notice_type = "friend_add";
  user_id;
  constructor(e, n) {
    super(e), this.user_id = n;
  }
}
class T0e extends xo {
  notice_type = "group_decrease";
  sub_type = "leave";
  operator_id;
  constructor(e, n, r, i, o = "leave") {
    super(e, n, r), this.group_id = n, this.operator_id = i, this.user_id = r, this.sub_type = o;
  }
}
const WF = {
  adminUid: b(1, w.STRING),
  isPromote: b(2, w.BOOL)
}, k0e = {
  extraDisable: b(1, () => WF),
  extraEnable: b(2, () => WF)
}, N0e = {
  groupUin: b(1, w.UINT32),
  flag: b(2, w.UINT32),
  isPromote: b(3, w.BOOL),
  body: b(4, () => k0e)
};
class P0e extends xo {
  notice_type = "group_admin";
  sub_type;
  constructor(e, n, r, i) {
    super(e, n, r), this.sub_type = i;
  }
}
class PU extends T2 {
  post_type = ju.REQUEST;
}
class hm extends PU {
  request_type = "group";
  group_id;
  user_id;
  comment;
  flag;
  sub_type;
  constructor(e, n, r, i, o, s) {
    super(e), this.group_id = n, this.user_id = r, this.sub_type = i, this.comment = o, this.flag = s;
  }
}
class D0e {
  capacity;
  cache;
  constructor(e) {
    this.capacity = e, this.cache = /* @__PURE__ */ new Map();
  }
  get(e) {
    const n = this.cache.get(e);
    return n !== void 0 && (this.cache.delete(e), this.cache.set(e, n)), n;
  }
  put(e, n) {
    if (this.cache.has(e))
      this.cache.delete(e);
    else if (this.cache.size >= this.capacity) {
      const r = this.cache.keys().next().value;
      r !== void 0 && this.cache.delete(r);
    }
    this.cache.set(e, n);
  }
  resetCapacity(e) {
    for (this.capacity = e; this.cache.size > this.capacity; ) {
      const n = this.cache.keys().next().value;
      n !== void 0 && this.cache.delete(n);
    }
  }
}
class F0e {
  tasks = /* @__PURE__ */ new Map();
  MAX_RETRIES = 3;
  isProcessing = !1;
  pendingOperations = [];
  /**
     * 执行队列中的待处理操作，确保异步安全
     */
  executeNextOperation() {
    if (this.pendingOperations.length === 0) {
      this.isProcessing = !1;
      return;
    }
    this.isProcessing = !0, this.pendingOperations.shift()?.(), setImmediate(() => this.executeNextOperation());
  }
  /**
     * 安全执行操作，防止竞态条件
     * @param operation 要执行的操作
     */
  safeExecute(e) {
    this.pendingOperations.push(e), this.isProcessing || this.executeNextOperation();
  }
  /**
     * 检查文件是否存在
     * @param filePath 文件路径
     * @returns 文件是否存在
     */
  fileExists(e) {
    try {
      return de.existsSync(e);
    } catch {
      return !1;
    }
  }
  /**
     * 添加文件到清理队列
     * @param filePath 文件路径
     * @param cleanupDelay 清理延迟时间(毫秒)
     */
  addFile(e, n) {
    this.safeExecute(() => {
      this.tasks.has(e) && this.cancelCleanup(e);
      const r = {
        filePath: e,
        addedTime: Date.now(),
        retries: 0
      }, i = setTimeout(() => {
        this.cleanupFile(r, n);
      }, n);
      this.tasks.set(e, { fileRecord: r, timer: i });
    });
  }
  /**
     * 批量添加文件到清理队列
     * @param filePaths 文件路径数组
     * @param cleanupDelay 清理延迟时间(毫秒)
     */
  addFiles(e, n) {
    this.safeExecute(() => {
      for (const r of e) {
        if (this.tasks.has(r)) {
          const s = this.tasks.get(r);
          s && clearTimeout(s.timer);
        }
        const i = {
          filePath: r,
          addedTime: Date.now(),
          retries: 0
        }, o = setTimeout(() => {
          this.cleanupFile(i, n);
        }, n);
        this.tasks.set(r, { fileRecord: i, timer: o });
      }
    });
  }
  /**
     * 清理文件
     * @param record 文件记录
     * @param delay 延迟时间，用于重试
     */
  cleanupFile(e, n) {
    this.safeExecute(() => {
      if (!this.fileExists(e.filePath)) {
        this.tasks.delete(e.filePath);
        return;
      }
      try {
        de.unlinkSync(e.filePath), this.tasks.delete(e.filePath);
      } catch (r) {
        const i = r;
        if (i.code === "ENOENT") {
          this.tasks.delete(e.filePath);
          return;
        }
        if (i.code === "EACCES" || i.code, e.retries < this.MAX_RETRIES - 1) {
          e.retries++;
          const o = setTimeout(() => {
            this.cleanupFile(e, n);
          }, n);
          this.tasks.set(e.filePath, { fileRecord: e, timer: o });
        } else
          this.tasks.delete(e.filePath);
      }
    });
  }
  /**
     * 取消文件的清理任务
     * @param filePath 文件路径
     * @returns 是否成功取消
     */
  cancelCleanup(e) {
    let n = !1;
    return this.safeExecute(() => {
      const r = this.tasks.get(e);
      r && (clearTimeout(r.timer), this.tasks.delete(e), n = !0);
    }), n;
  }
  /**
     * 获取队列中的文件数量
     * @returns 文件数量
     */
  getQueueSize() {
    return this.tasks.size;
  }
  /**
     * 获取所有待清理的文件
     * @returns 文件路径数组
     */
  getPendingFiles() {
    return Array.from(this.tasks.keys());
  }
  /**
     * 清空所有清理任务
     */
  clearAll() {
    this.safeExecute(() => {
      for (const e of this.tasks.values())
        clearTimeout(e.timer);
      this.tasks.clear();
    });
  }
}
const O0e = new F0e();
class M0e {
  resourceTypes = /* @__PURE__ */ new Map();
  destroyed = !1;
  /**
     * 调用资源（自动注册或复用已有配置）
     */
  async callResource(e, n, ...r) {
    if (this.destroyed)
      throw new Error("ResourceManager has been destroyed");
    let i = this.resourceTypes.get(e);
    if (i || (i = {
      config: {
        resourceFn: n.resourceFn,
        healthCheckFn: n.healthCheckFn,
        disableTime: n.disableTime ?? 3e4,
        maxRetries: n.maxRetries ?? 3,
        healthCheckInterval: n.healthCheckInterval ?? 6e4,
        maxHealthCheckFailures: n.maxHealthCheckFailures ?? 20,
        testArgs: n.testArgs
      },
      isEnabled: !0,
      disableUntil: 0,
      currentRetries: 0,
      healthCheckFailureCount: 0,
      isPermanentlyDisabled: !1,
      lastHealthCheckTime: 0,
      successCount: 0,
      failureCount: 0
    }, this.resourceTypes.set(e, i)), await this.checkAndPerformHealthCheck(i), i.isPermanentlyDisabled)
      throw new Error(`Resource type '${e}' is permanently disabled (success: ${i.successCount}, failure: ${i.failureCount})`);
    if (!this.isResourceAvailable(e)) {
      const o = new Date(i.disableUntil).toISOString();
      throw new Error(`Resource type '${e}' is currently disabled until ${o} (success: ${i.successCount}, failure: ${i.failureCount})`);
    }
    try {
      const o = await n.resourceFn(...r);
      return this.onResourceSuccess(i), o;
    } catch (o) {
      throw this.onResourceFailure(i), o;
    }
  }
  /**
     * 检查资源类型是否可用
     */
  isResourceAvailable(e) {
    const n = this.resourceTypes.get(e);
    return n ? n.isPermanentlyDisabled || !n.isEnabled ? !1 : Date.now() >= n.disableUntil : !0;
  }
  /**
     * 获取资源类型统计信息
     */
  getResourceStats(e) {
    const n = this.resourceTypes.get(e);
    return n ? {
      successCount: n.successCount,
      failureCount: n.failureCount,
      isEnabled: n.isEnabled,
      isPermanentlyDisabled: n.isPermanentlyDisabled
    } : null;
  }
  /**
     * 获取所有资源类型统计
     */
  getAllResourceStats() {
    const e = /* @__PURE__ */ new Map();
    for (const [n, r] of this.resourceTypes)
      e.set(n, {
        successCount: r.successCount,
        failureCount: r.failureCount,
        isEnabled: r.isEnabled,
        isPermanentlyDisabled: r.isPermanentlyDisabled
      });
    return e;
  }
  /**
     * 注销资源类型
     */
  unregister(e) {
    return this.resourceTypes.delete(e);
  }
  /**
     * 销毁管理器
     */
  destroy() {
    this.destroyed || (this.resourceTypes.clear(), this.destroyed = !0);
  }
  /**
     * 检查并执行健康检查（如果需要）
     */
  async checkAndPerformHealthCheck(e) {
    if (e.isEnabled && Date.now() >= e.disableUntil || e.isPermanentlyDisabled)
      return;
    const n = Date.now();
    n < e.disableUntil || n - e.lastHealthCheckTime < e.config.healthCheckInterval || await this.performHealthCheck(e);
  }
  async performHealthCheck(e) {
    e.lastHealthCheckTime = Date.now();
    try {
      let n;
      if (e.config.healthCheckFn) {
        const r = e.config.testArgs || [];
        n = await e.config.healthCheckFn(...r);
      } else {
        const r = e.config.testArgs || [];
        await e.config.resourceFn(...r), n = !0;
      }
      if (n)
        e.isEnabled = !0, e.disableUntil = 0, e.currentRetries = 0, e.healthCheckFailureCount = 0;
      else
        throw new Error("Health check function returned false");
    } catch {
      e.healthCheckFailureCount++, e.healthCheckFailureCount >= e.config.maxHealthCheckFailures ? (e.isPermanentlyDisabled = !0, e.disableUntil = 0) : e.disableUntil = Date.now() + e.config.disableTime;
    }
  }
  onResourceSuccess(e) {
    e.currentRetries = 0, e.disableUntil = 0, e.healthCheckFailureCount = 0, e.successCount++;
  }
  onResourceFailure(e) {
    e.currentRetries++, e.failureCount++, e.currentRetries >= e.config.maxRetries && (e.disableUntil = Date.now() + e.config.disableTime, e.currentRetries = 0);
  }
}
const R0e = new M0e();
async function xw(t, e, ...n) {
  return R0e.callResource(t, e, ...n);
}
class DU extends Ps {
  peer_id;
  constructor(e, n) {
    super(e), this.peer_id = n;
  }
}
class zF extends DU {
  notice_type;
  sub_type;
  constructor(e, n) {
    super(e, n), this.notice_type = "online_file_receive", this.sub_type = "cancel";
  }
}
class ww extends DU {
  notice_type = "online_file_send";
  sub_type;
  constructor(e, n, r) {
    super(e, n), this.sub_type = r;
  }
}
function B0e(t, e) {
  return t in e;
}
class U0e {
  obContext;
  core;
  notifyGroupInvite = new D0e(50);
  // seq -> notify
  rawToOb11Converters = {
    textElement: async (e) => {
      if (e.atType === Mr.ATTYPEUNKNOWN) {
        let n = e.content;
        return n.indexOf(`
`) === -1 && n.indexOf(`\r
`) === -1 && (n = n.replace(/\r/g, `
`)), {
          type: ze.text,
          data: { text: n }
        };
      } else {
        let n = "all";
        if (e.atType !== Mr.ATTYPEALL) {
          const { atNtUid: r, atUid: i } = e;
          n = !i || i === "0" ? await this.core.apis.UserApi.getUinByUidV2(r) : String(Number(i) >>> 0);
        }
        return {
          type: ze.at,
          data: {
            qq: n
            // name: content.slice(1);
          }
        };
      }
    },
    picElement: async (e, n, r, { disableGetUrl: i }) => {
      try {
        const o = {
          chatType: n.chatType,
          peerUid: n.peerUid,
          guildId: ""
        };
        return Jt.encode(
          o,
          n.msgId,
          r.elementId,
          e.fileUuid,
          e.fileName
        ), {
          type: ze.image,
          data: {
            summary: e.summary,
            file: e.fileName,
            sub_type: e.picSubType,
            url: i ? e.filePath ?? "" : await this.core.apis.FileApi.getImageUrl(e),
            file_size: e.fileSize
          }
        };
      } catch (o) {
        return this.core.context.logger.logError("获取图片url失败", o.stack), null;
      }
    },
    fileElement: async (e, n, r, { disableGetUrl: i }) => {
      if (+r.elementType == 23 || +r.elementType == 30)
        return {
          type: ze.onlinefile,
          data: {
            msgId: n.msgId,
            elementId: r.elementId,
            fileName: e.fileName,
            fileSize: e.fileSize,
            isDir: r.elementType === 30
          }
        };
      const o = {
        chatType: n.chatType,
        peerUid: n.peerUid,
        guildId: ""
      };
      if (Jt.encode(o, n.msgId, r.elementId, e.fileUuid, e.fileUuid), Jt.encode(o, n.msgId, r.elementId, e.fileUuid, e.fileName), this.core.apis.PacketApi.packetStatus && !i) {
        let s;
        try {
          s = await xw(
            "file-url-get",
            {
              resourceFn: async () => await this.core.apis.FileApi.getFileUrl(n.chatType, n.peerUid, e.fileUuid, e.file10MMd5, 1500),
              healthCheckFn: async () => await this.core.apis.PacketApi.pkt.operation.FetchRkey().then(() => !0).catch(() => !1),
              testArgs: [],
              healthCheckInterval: 3e4,
              maxHealthCheckFailures: 3
            }
          );
        } catch {
          s = "";
        }
        if (s)
          return {
            type: ze.file,
            data: {
              file: e.fileName,
              file_id: e.fileUuid,
              file_size: e.fileSize,
              url: s
            }
          };
      }
      return {
        type: ze.file,
        data: {
          file: e.fileName,
          file_id: e.fileUuid,
          file_size: e.fileSize
        }
      };
    },
    faceElement: async (e) => {
      const n = e.faceIndex;
      return e.faceType === qs.Poke ? {
        type: ze.poke,
        data: {
          type: e?.pokeType?.toString() ?? "0",
          id: n.toString()
        }
      } : n === Vl.DICE ? {
        type: ze.dice,
        data: {
          result: e.resultId
        }
      } : n === Vl.RPS ? {
        type: ze.rps,
        data: {
          result: e.resultId
        }
      } : {
        type: ze.face,
        data: {
          id: e.faceIndex.toString(),
          raw: e,
          resultId: e.resultId,
          chainCount: e.chainCount
        }
      };
    },
    marketFaceElement: async (e, n, r) => {
      const i = {
        chatType: n.chatType,
        peerUid: n.peerUid,
        guildId: ""
      }, { emojiId: o } = e, s = o.substring(0, 2), a = `https://gxh.vip.qq.com/club/item/parcel/item/${s}/${o}/raw300.gif`, c = `${s}-${o}.gif`;
      return Jt.encode(i, n.msgId, r.elementId, "", c), {
        type: ze.image,
        data: {
          summary: e.faceName,
          // 商城表情名称
          file: c,
          url: a,
          key: e.key,
          emoji_id: e.emojiId,
          emoji_package_id: e.emojiPackageId
        }
      };
    },
    replyElement: async (e, n, r, { quick_reply: i }) => {
      const o = {
        chatType: n.chatType,
        peerUid: n.peerUid,
        guildId: ""
      }, s = (u) => ({
        type: ze.reply,
        data: {
          id: rt.createUniqueMsgId(o, u).toString()
        }
      }), a = n.records.find((u) => u.msgId === e?.sourceMsgIdInRecords);
      if (a && (a.peerUin === "284840486" || a.peerUin === "1094950020"))
        return s(a.msgId);
      const c = async (u, l, d, f) => {
        try {
          if (l && d) {
            const y = (await this.core.apis.MsgApi.queryMsgsWithFilterExWithSeqV2(
              o,
              u,
              d,
              [l]
            )).msgList, x = y.find(
              (g) => f && g.msgRandom === f || g.msgSeq === u
            );
            if (x) return x;
            if (i) {
              this.core.context.logger.logWarn(`快速回复，跳过方法1查询，序号: ${u}, 消息数: ${y.length}`);
              return;
            }
            this.core.context.logger.logWarn(`方法1查询失败，序号: ${u}, 消息数: ${y.length}`);
          }
          const m = (await this.core.apis.MsgApi.getMsgsBySeqAndCount(
            o,
            u,
            1,
            !0,
            !0
          )).msgList, h = m.find(
            (y) => f && y.msgRandom === f || y.msgSeq === u
          );
          if (h) return h;
          if (this.core.context.logger.logWarn(`方法2查询失败，序号: ${u}, 消息数: ${m.length}`), l) {
            const y = (await this.core.apis.MsgApi.queryMsgsWithFilterExWithSeqV3(
              o,
              u,
              [l]
            )).msgList, x = y.find(
              (g) => f && g.msgRandom === f || g.msgSeq === u
            );
            if (x) return x;
            this.core.context.logger.logWarn(`方法3查询失败，序号: ${u}, 消息数: ${y.length}`);
          }
          return;
        } catch (m) {
          this.core.context.logger.logError("查询回复消息出错", m);
          return;
        }
      };
      if (a && e.replyMsgTime && e.senderUidStr) {
        const u = await c(
          e.replayMsgSeq,
          e.senderUidStr,
          a.msgTime,
          a.msgRandom
        );
        if (u)
          return s(u.msgId);
        this.core.context.logger.logError("所有查找方法均失败，获取不到带记录的引用消息", e.replayMsgSeq);
      } else {
        this.core.context.logger.logWarn("似乎是旧版客户端，尝试仅通过序号获取引用消息", e.replayMsgSeq);
        const u = await c(e.replayMsgSeq);
        if (u)
          return s(u.msgId);
        this.core.context.logger.logError("所有查找方法均失败，获取不到旧客户端的引用消息", e.replayMsgSeq);
      }
      if (this.core.apis.PacketApi.packetStatus)
        try {
          const u = +e.replayMsgSeq, d = (n.chatType === Ne.KCHATTYPEGROUP ? await this.core.apis.PacketApi.pkt.operation.FetchGroupMessage(+n.peerUin, u, u) : await this.core.apis.PacketApi.pkt.operation.FetchC2CMessage(n.peerUid, u, u)).find((f) => (f.contentHead.sequence ?? 0) === u);
          if (d?.contentHead?.newId) {
            const f = String(d.contentHead.newId);
            return this.core.context.logger.logWarn("通过协议兜底成功获取引用消息", f), s(f);
          }
          this.core.context.logger.logWarn("协议兜底未找到匹配的引用消息");
        } catch (u) {
          this.core.context.logger.logError("协议兜底获取引用消息失败", u.stack);
        }
      return null;
    },
    videoElement: async (e, n, r, { disableGetUrl: i }) => {
      const o = {
        chatType: n.chatType,
        peerUid: n.peerUid,
        guildId: ""
      };
      let s;
      if (n.peerUin === "284840486" || n.peerUin === "1094950020")
        try {
          s = await this.core.apis.FileApi.getVideoUrl({
            chatType: n.chatType,
            peerUid: n.peerUid,
            guildId: "0"
          }, n.parentMsgIdList[0] ?? n.msgId, r.elementId);
        } catch {
          this.core.context.logger.logWarn("合并获取视频 URL 失败");
        }
      else
        try {
          s = await this.core.apis.FileApi.getVideoUrl({
            chatType: n.chatType,
            peerUid: n.peerUid,
            guildId: "0"
          }, n.msgId, r.elementId);
        } catch {
          this.core.context.logger.logWarn("获取视频 URL 失败");
        }
      let a;
      if (s) {
        const u = s.find((l) => !!l.url);
        u && (a = u.url);
      }
      if (!a && !i)
        if (this.core.apis.PacketApi.packetStatus)
          try {
            a = await xw(
              "video-url-get",
              {
                resourceFn: async () => await this.core.apis.FileApi.getVideoUrlPacket(n.peerUid, e.fileUuid, 1500),
                healthCheckFn: async () => await this.core.apis.PacketApi.pkt.operation.FetchRkey().then(() => !0).catch(() => !1),
                testArgs: [],
                healthCheckInterval: 3e4,
                maxHealthCheckFailures: 3
              }
            );
          } catch (u) {
            this.core.context.logger.logError("获取视频url失败", u.stack), a = e.filePath;
          }
        else
          a = e.filePath;
      const c = Jt.encode(o, n.msgId, r.elementId, e.fileUuid, e.fileName);
      return {
        type: ze.video,
        data: {
          file: c,
          url: a,
          file_size: e.fileSize
        }
      };
    },
    pttElement: async (e, n, r, { disableGetUrl: i }) => {
      const o = {
        chatType: n.chatType,
        peerUid: n.peerUid,
        guildId: ""
      }, s = Jt.encode(o, n.msgId, r.elementId, "", e.fileName);
      let a = "";
      if (this.core.apis.PacketApi.packetStatus && !i)
        try {
          a = await xw(
            "ptt-url-get",
            {
              resourceFn: async () => await this.core.apis.FileApi.getPttUrl(n.peerUid, e.fileUuid, 1500),
              healthCheckFn: async () => await this.core.apis.PacketApi.pkt.operation.FetchRkey().then(() => !0).catch(() => !1),
              testArgs: [],
              healthCheckInterval: 3e4,
              maxHealthCheckFailures: 3
            }
          );
        } catch (c) {
          this.core.context.logger.logError("获取语音url失败", c.stack), a = e.filePath;
        }
      else
        a = e.filePath;
      return a ? {
        type: ze.voice,
        data: {
          file: s,
          path: e.filePath,
          url: a,
          file_size: e.fileSize
        }
      } : {
        type: ze.voice,
        data: {
          file: s,
          file_size: e.fileSize,
          path: e.filePath
        }
      };
    },
    multiForwardMsgElement: async (e, n, r, i) => {
      const o = n.parentMsgPeer ?? {
        chatType: n.chatType,
        guildId: "",
        peerUid: n.peerUid
      };
      let s = await this.getMultiMessages(n, o);
      if (!s || s.length === 0)
        try {
          s = await this.core.apis.PacketApi.pkt.operation.FetchForwardMsg(e.resId);
        } catch (c) {
          return this.core.context.logger.logError(`Protocol FetchForwardMsg fallback failed! 
                    element = ${JSON.stringify(e)} , error=${c})`), null;
        }
      const a = {
        type: ze.forward,
        data: { id: n.msgId }
      };
      return i.parseMultMsg && (a.data.content = await this.parseMultiMessageContent(
        s,
        o,
        n.parentMsgIdList
      )), a;
    },
    arkElement: async (e) => ({
      type: ze.json,
      data: {
        data: e.bytesData
      }
    }),
    markdownElement: async (e) => e?.mdExtInfo?.flashTransferInfo?.filesetId ? {
      type: ze.flashtransfer,
      data: {
        fileSetId: e.mdExtInfo.flashTransferInfo.filesetId
      }
    } : {
      type: ze.markdown,
      data: {
        content: e.content
      }
    }
  };
  ob11ToRawConverters = {
    [ze.text]: async ({ data: { text: e } }) => ({
      elementType: _e.TEXT,
      elementId: "",
      textElement: {
        content: e,
        atType: Mr.ATTYPEUNKNOWN,
        atUid: "",
        atTinyId: "",
        atNtUid: ""
      }
    }),
    [ze.at]: async ({ data: { qq: e } }, n) => {
      function r(a, c, u, l) {
        return {
          elementType: _e.TEXT,
          elementId: "",
          textElement: {
            content: `@${l}`,
            atType: u,
            atUid: a,
            atTinyId: "",
            atNtUid: c
          }
        };
      }
      if (!n.peer || !e || n.peer.chatType === Ne.KCHATTYPEC2C) return;
      if (e === "all") return r(e, e, Mr.ATTYPEALL, "全体成员");
      const i = await this.core.apis.GroupApi.getGroupMember(n.peer.peerUid, e);
      if (i)
        return r(e, i.uid, Mr.ATTYPEONE, i.nick || i.cardName);
      const o = await this.core.apis.UserApi.getUidByUinV2(`${e}`);
      if (!o) throw new Error("Get Uid Error");
      const s = await this.core.apis.UserApi.getUserDetailInfo(o);
      return r(e, o, Mr.ATTYPEONE, s.nick || "");
    },
    [ze.reply]: async ({ data: { id: e, seq: n } }, r) => {
      let i, o;
      if (n)
        i = (await this.core.apis.MsgApi.getMsgsBySeqAndCount(
          r.peer,
          n.toString(),
          1,
          !0,
          !0
        )).msgList[0], o = r.peer;
      else if (e) {
        const s = rt.getMsgIdAndPeerByShortId(parseInt(e));
        if (!s) {
          this.core.context.logger.logWarn("回复消息不存在", e);
          return;
        }
        i = (await this.core.apis.MsgApi.getMsgsByMsgId(
          s.Peer,
          [s.MsgId]
        )).msgList[0], o = s.Peer;
      } else {
        this.core.context.logger.logWarn("回复消息缺少id或seq参数");
        return;
      }
      return i && o ? {
        elementType: _e.REPLY,
        elementId: "",
        replyElement: {
          replayMsgSeq: i.msgSeq,
          // raw.msgSeq
          replayMsgId: i.msgId,
          // raw.msgId
          senderUin: i.senderUin,
          senderUinStr: i.senderUin,
          replyMsgClientSeq: i.clientSeq,
          _replyMsgPeer: o
        }
      } : void 0;
    },
    [ze.face]: async ({ data: { id: e, resultId: n, chainCount: r } }) => {
      const i = +e, s = zge.sysface.find((c) => c.QSid === i.toString());
      if (!s) {
        this.core.context.logger.logError("不支持的ID", e);
        return;
      }
      let a = 1;
      return i >= 222 && (a = 2), s.AniStickerType && (a = 3), {
        elementType: _e.FACE,
        elementId: "",
        faceElement: {
          faceIndex: i,
          faceType: a,
          faceText: s.QDes,
          stickerId: s.AniStickerId,
          stickerType: s.AniStickerType,
          packId: s.AniStickerPackId,
          sourceType: 1,
          resultId: n?.toString(),
          chainCount: r
        }
      };
    },
    [ze.mface]: async ({
      data: {
        emoji_package_id: e,
        emoji_id: n,
        key: r,
        summary: i
      }
    }) => ({
      elementType: _e.MFACE,
      elementId: "",
      marketFaceElement: {
        emojiPackageId: e,
        emojiId: n,
        key: r,
        faceName: i || "[商城表情]"
      }
    }),
    // File service
    [ze.image]: async (e, n) => {
      const r = await this.handleOb11FileLikeMessage(e, n);
      return await this.obContext.apis.FileApi.createValidSendPicElement(
        n,
        r.path,
        e.data.summary,
        e.data.sub_type,
        r.isLocal
      );
    },
    [ze.file]: async (e, n) => {
      const { path: r, fileName: i, isLocal: o } = await this.handleOb11FileLikeMessage(e, n);
      return await this.obContext.apis.FileApi.createValidSendFileElement(n, r, i, "", !1, o);
    },
    [ze.video]: async (e, n) => {
      const { path: r, fileName: i, isLocal: o } = await this.handleOb11FileLikeMessage(e, n);
      let s = e.data.thumb;
      if (s) {
        const a = await Ji(this.core.NapCatTempPath, s);
        a.success && (s = a.path, a.isLocal || n.deleteAfterSentFiles.push(s));
      }
      return await this.obContext.apis.FileApi.createValidSendVideoElement(n, r, i, s, o);
    },
    [ze.voice]: async (e, n) => this.obContext.apis.FileApi.createValidSendPttElement(
      n,
      (await this.handleOb11FileLikeMessage(e, n)).path
    ),
    [ze.json]: async ({ data: { data: e } }) => ({
      elementType: _e.ARK,
      elementId: "",
      arkElement: {
        bytesData: typeof e == "string" ? e : JSON.stringify(e),
        linkInfo: null,
        subElementType: null
      }
    }),
    [ze.dice]: async () => ({
      elementType: _e.FACE,
      elementId: "",
      faceElement: {
        faceIndex: Vl.DICE,
        faceType: qs.AniSticke,
        faceText: "[骰子]",
        packId: "1",
        stickerId: "33",
        sourceType: 1,
        stickerType: 2,
        surpriseId: ""
        // "randomType": 1,
      }
    }),
    [ze.rps]: async () => ({
      elementType: _e.FACE,
      elementId: "",
      faceElement: {
        faceIndex: Vl.RPS,
        faceText: "[包剪锤]",
        faceType: qs.AniSticke,
        packId: "1",
        stickerId: "34",
        sourceType: 1,
        stickerType: 2,
        surpriseId: ""
        // "randomType": 1,
      }
    }),
    // Need signing
    [ze.markdown]: async ({ data: { content: e } }) => ({
      elementType: _e.MARKDOWN,
      elementId: "",
      markdownElement: { content: e }
    }),
    [ze.music]: async ({ data: e }, n) => {
      const r = ["qq", "163", "kugou", "kuwo", "migu"], i = [...r, "custom"];
      if (e.id !== void 0) {
        if (!r.includes(e.type)) {
          this.core.context.logger.logError(`[音乐卡片] type参数错误: "${e.type}"，仅支持: ${r.join("、")}`);
          return;
        }
      } else {
        if (!i.includes(e.type)) {
          this.core.context.logger.logError(`[音乐卡片] type参数错误: "${e.type}"，仅支持: ${i.join("、")}`);
          return;
        }
        if (!e.url) {
          this.core.context.logger.logError("[音乐卡片] 自定义音乐卡片缺少必需参数: url");
          return;
        }
        if (!e.image) {
          this.core.context.logger.logError("[音乐卡片] 自定义音乐卡片缺少必需参数: image");
          return;
        }
      }
      let o;
      if (e.id === void 0 && e.content) {
        const { content: a, ...c } = e;
        o = { singer: a, ...c };
      } else
        o = e;
      let s = this.obContext.configLoader.configData.musicSignUrl;
      s || (s = "https://ss.xingzhige.com/music_card/card");
      try {
        const a = await ln.HttpGetJson(s, "POST", o);
        return this.ob11ToRawConverters.json({
          data: { data: a },
          type: ze.json
        }, n);
      } catch (a) {
        const c = a instanceof Error ? a.message : String(a);
        this.core.context.logger.logError(
          `[音乐卡片签名失败] 签名服务请求出错!
  ├─ 音乐类型: ${e.type}
  ├─ 音乐ID: ${e.id ?? "自定义"}
  ├─ 错误信息: ${c}
  └─ 提示: 请检查网络连接，或尝试在配置中更换其他音乐签名服务地址(musicSignUrl)`
        );
        return;
      }
    },
    [ze.node]: async () => {
    },
    [ze.forward]: async ({ data: e }, n) => {
      const r = bE.fromResId(e.id);
      return this.ob11ToRawConverters.json({
        data: { data: JSON.stringify(r) },
        type: ze.json
      }, n);
    },
    [ze.xml]: async () => {
    },
    [ze.poke]: async () => {
    },
    [ze.location]: async () => ({
      elementType: _e.SHARELOCATION,
      elementId: "",
      shareLocationElement: {
        text: "测试",
        ext: ""
      }
    }),
    [ze.miniapp]: async () => {
    },
    [ze.contact]: async ({ data: { type: e = "qq", id: n } }, r) => {
      if (e === "qq") {
        const i = await this.core.apis.UserApi.getBuddyRecommendContactArkJson(n.toString(), "");
        return this.ob11ToRawConverters.json({
          data: { data: i.arkMsg },
          type: ze.json
        }, r);
      } else if (e === "group") {
        const i = await this.core.apis.GroupApi.getGroupRecommendContactArkJson(n.toString());
        return this.ob11ToRawConverters.json({
          data: { data: i.arkJson },
          type: ze.json
        }, r);
      }
    },
    // 不需要支持发送
    [ze.onlinefile]: async () => {
    },
    [ze.flashtransfer]: async () => {
    }
  };
  constructor(e, n) {
    this.obContext = e, this.core = n;
  }
  /**
     * 解析带有JSON标记的文本
     * @param text 要解析的文本
     * @returns 解析后的结果数组，每个元素包含类型(text或json)和内容
     */
  parseTextWithJson(e) {
    const n = /<(\{.*?\})>/g, r = [];
    let i = 0, o;
    for (; (o = n.exec(e)) !== null; ) {
      o.index > i && r.push({
        type: "text",
        content: e.substring(i, o.index)
      });
      try {
        const s = JSON.parse(o[1] ?? "");
        r.push({
          type: "json",
          content: s
        });
      } catch {
        r.push({
          type: "text",
          content: o[0]
        });
      }
      i = n.lastIndex;
    }
    return i < e.length && r.push({
      type: "text",
      content: e.substring(i)
    }), r;
  }
  async parsePrivateMsgEvent(e, n) {
    if (n.subElementType === Pp.GRAYTIP_ELEMENT_SUBTYPE_JSON) {
      if (n.jsonGrayTipElement.busiId.toString() === "1061") {
        const r = await this.obContext.apis.FriendApi.parsePrivatePokeEvent(n, Number(await this.core.apis.UserApi.getUinByUidV2(e.peerUid)));
        if (r)
          return r;
      } else if (n.jsonGrayTipElement.busiId.toString() === "19324" && e.peerUid !== "")
        return new C0e(this.core, Number(await this.core.apis.UserApi.getUinByUidV2(e.peerUid)));
    }
  }
  async getMultiMessages(e, n) {
    if (e.parentMsgIdList = e.parentMsgIdList ?? [], e.parentMsgIdList.push(e.msgId), e.parentMsgIdList[0])
      return (await this.core.apis.MsgApi.getMultiMsg(
        n,
        e.parentMsgIdList[0],
        e.msgId
      ))?.msgList;
  }
  async parseMultiMessageContent(e, n, r) {
    return (await Promise.all(e.map(async (o) => (o.parentMsgPeer = n, o.parentMsgIdList = r, o.id = rt.createUniqueMsgId(n, o.msgId), await this.parseMessage(o, "array", !0))))).filter((o) => o !== void 0);
  }
  async parseMessage(e, n, r = !0, i = !1, o = !1) {
    return n === "string" ? (await this.parseMessageV2(e, r, i, o))?.stringMsg : (await this.parseMessageV2(e, r, i, o))?.arrayMsg;
  }
  async parseMessageV2(e, n = !0, r = !1, i = !1) {
    if (e.senderUin === "0" || e.senderUin === "")
      if (e.senderUid && e.senderUid !== "" && e.senderUid !== "0")
        e.senderUin = await this.core.apis.UserApi.getUinByUidV2(e.senderUid);
      else
        return;
    if (e.peerUin === "0" || e.peerUin === "")
      if (e.peerUid && e.peerUid !== "" && e.peerUid !== "0")
        e.peerUin = await this.core.apis.UserApi.getUinByUidV2(e.peerUid);
      else
        return;
    const o = this.initializeMessage(e);
    if (this.core.selfInfo.uin === e.senderUin && (o.message_sent_type = "self"), e.chatType === Ne.KCHATTYPEGROUP)
      await this.handleGroupMessage(o, e);
    else if (e.chatType === Ne.KCHATTYPEC2C)
      await this.handlePrivateMessage(o, e);
    else if (e.chatType === Ne.KCHATTYPETEMPC2CFROMGROUP)
      await this.handleTempGroupMessage(o, e);
    else
      return;
    const s = await this.parseMessageSegments(e, n, r, i);
    return o.message = s, o.raw_message = s.map((c) => I0e(c)).join("").trim(), { stringMsg: await this.convertArrayToStringMessage(o), arrayMsg: o };
  }
  initializeMessage(e) {
    return {
      self_id: parseInt(this.core.selfInfo.uin),
      user_id: parseInt(e.senderUin),
      time: parseInt(e.msgTime) || Date.now(),
      message_id: e.id,
      message_seq: e.id,
      real_id: e.id,
      real_seq: e.msgSeq,
      message_type: e.chatType === Ne.KCHATTYPEGROUP ? "group" : "private",
      sender: {
        user_id: +(e.senderUin ?? 0),
        nickname: e.sendNickName,
        card: e.sendMemberName ?? ""
      },
      raw_message: "",
      font: 14,
      sub_type: "friend",
      message: [],
      message_format: "array",
      post_type: this.core.selfInfo.uin === e.senderUin ? ju.MESSAGE_SENT : ju.MESSAGE
    };
  }
  async handleGroupMessage(e, n) {
    e.sub_type = "normal", e.group_id = parseInt(n.peerUin), e.group_name = n.peerName;
    let r = await this.core.apis.GroupApi.getGroupMember(n.peerUin, n.senderUin);
    r || (r = await this.core.apis.GroupApi.getGroupMember(n.peerUin, n.senderUin)), r && (e.sender.role = Ni.groupMemberRole(r.role), e.sender.nickname = r.nick);
  }
  async handlePrivateMessage(e, n) {
    if (e.sub_type = "friend", await this.core.apis.FriendApi.isBuddy(n.senderUid)) {
      const r = (await this.core.apis.UserApi.getCoreAndBaseInfo([n.senderUid])).get(n.senderUid)?.coreInfo.nick;
      if (r) {
        e.sender.nickname = r;
        return;
      }
    }
    e.sender.nickname = (await this.core.apis.UserApi.getUserDetailInfo(n.senderUid)).nick;
  }
  async handleTempGroupMessage(e, n) {
    e.sub_type = "group";
    const r = await this.core.apis.MsgApi.getTempChatInfo(Ne.KCHATTYPETEMPC2CFROMGROUP, n.senderUid);
    if (r.result === 0) {
      const i = await this.core.apis.GroupApi.getGroupMember(n.peerUin, await this.core.apis.UserApi.getUinByUidV2(n.senderUid));
      e.group_id = parseInt(r.tmpChatInfo.groupCode), e.sender.nickname = i?.nick ?? i?.cardName ?? "临时会话", e.temp_source = 0;
    } else
      e.group_id = 284840486, e.temp_source = 0, e.sender.nickname = "临时会话";
  }
  async parseMessageSegments(e, n, r = !1, i = !1) {
    return (await Promise.allSettled(e.elements.map(
      async (s) => {
        for (const a in s)
          if (B0e(a, this.rawToOb11Converters) && s[a]) {
            const c = this.rawToOb11Converters[a], u = await c?.(
              s[a],
              e,
              s,
              { parseMultMsg: n, disableGetUrl: r, quick_reply: i }
            );
            return a === "faceElement" && !u ? null : u;
          }
        return null;
      }
    ))).filter((s) => s.status === "fulfilled" ? !!s.value : (this.core.context.logger.logError("消息段解析失败", s.reason), !1)).map((s) => s.value).filter((s) => s != null);
  }
  async convertArrayToStringMessage(e) {
    const n = structuredClone(e);
    return n.message_format = "string", n.message = n.raw_message, n;
  }
  async importArrayTostringMsg(e) {
    const n = structuredClone(e);
    return n.message_format = "string", n.message = n.raw_message, n;
  }
  async createSendElements(e, n, r = []) {
    const i = [], o = [];
    for (const c of e) {
      if (r.includes(c.type))
        continue;
      const u = this.ob11ToRawConverters[c.type];
      if (u === void 0)
        throw new Error("未知的消息类型：" + c.type);
      const l = u(
        c,
        { peer: n, deleteAfterSentFiles: i }
      )?.catch(void 0);
      o.push(l);
    }
    return { sendElements: (await Promise.all(o)).filter((c) => !!c), deleteAfterSentFiles: i };
  }
  async sendMsgWithOb11UniqueId(e, n, r, i) {
    if (!n.length)
      throw new Error("消息体无法解析, 请检查是否发送了不支持的消息类型");
    const o = this.obContext.configLoader.configData.timeout;
    let s;
    if (i !== void 0 && i > 0)
      s = jae(o, i);
    else {
      const a = n.reduce((c, u) => {
        switch (u.elementType) {
          case _e.PTT:
            return c + +(u.pttElement.fileSize || "3000");
          case _e.FILE:
            return c + +(u.fileElement.fileSize || "3000");
          case _e.VIDEO:
            return c + +(u.videoElement.fileSize || "3000");
          case _e.PIC:
            return c + +(u.picElement.fileSize || "3000");
          default:
            return c;
        }
      }, 0);
      s = TA(o, a, o.uploadSpeedKBps);
    }
    try {
      const a = await this.core.apis.MsgApi.sendMsg(e, n, s);
      if (!a) throw new Error("发送消息失败");
      return a.id = rt.createUniqueMsgId({
        chatType: e.chatType,
        guildId: "",
        peerUid: e.peerUid
      }, a.msgId), a;
    } finally {
      O0e.addFiles(r, s);
    }
  }
  async handleOb11FileLikeMessage({ data: e }, { deleteAfterSentFiles: n }) {
    let r = [e.url, e.file, e.path].find((i) => i && i.trim()) ?? "";
    if (!r)
      throw this.core.context.logger.logError("文件消息缺少参数", e), new Error("文件消息缺少参数");
    r = await this.handleObfuckName(r) ?? r;
    try {
      const i = this.obContext.configLoader.configData.imageDownloadProxy || void 0, { path: o, fileName: s, errMsg: a, success: c, isLocal: u } = await Ji(this.core.NapCatTempPath, r, void 0, void 0, i);
      if (!c)
        throw this.core.context.logger.logError("文件处理失败", a), new Error("文件处理失败: " + a);
      return u || n.push(o), { path: o, fileName: e.name ?? s, isLocal: u };
    } catch (i) {
      throw new Error(i.message);
    }
  }
  async handleObfuckName(e) {
    const n = Jt.decode(e);
    if (n && n.msgId && n.elementId) {
      const { peer: r, msgId: i, elementId: o } = n, s = (await this.core.apis.MsgApi.getMsgsByMsgId(r, [i]))?.msgList.find((l) => l.msgId === i), a = s?.elements.find((l) => l.elementId === o);
      if (!(a?.videoElement ?? a?.fileElement ?? a?.pttElement ?? a?.picElement)) throw new Error("element not found");
      let u = "";
      return a?.picElement && s && (u = (await this.obContext.apis.MsgApi.rawToOb11Converters.picElement?.(a?.picElement, s, a, { parseMultMsg: !1, disableGetUrl: !1, quick_reply: !1 }))?.data.url ?? ""), a?.videoElement && s && (u = (await this.obContext.apis.MsgApi.rawToOb11Converters.videoElement?.(a?.videoElement, s, a, { parseMultMsg: !1, disableGetUrl: !1, quick_reply: !1 }))?.data.url ?? ""), u !== "" ? u : await this.core.apis.FileApi.downloadMedia(i, r.chatType, r.peerUid, o, "", "");
    }
  }
  groupChangDecreseType2String(e) {
    switch (e) {
      case 130:
        return "leave";
      case 131:
        return "kick";
      case 3:
        return "kick_me";
      case 129:
        return "disband";
      default:
        return "kick";
    }
  }
  async waitGroupNotify(e, n, r) {
    const i = this.core.apis.GroupApi.groupMemberCache.get(e)?.get(this.core.selfInfo.uid.toString())?.role;
    if ((i === 3 || i === 4) && !r) {
      let s;
      if (await this.core.eventWrapper.registerListen(
        "NodeIKernelGroupListener/onGroupNotifiesUpdated",
        (a, c) => {
          for (const u of c)
            if (u.group.groupCode === e && u.user1.uid === n)
              return s = u, !0;
          return !1;
        },
        1,
        1e3
      ).catch(() => {
      }), s)
        return s.actionUser.uid ? s.actionUser.uid : s.user2.uid;
    }
    return r;
  }
  async parseSysMessage(e) {
    const n = new fe(Wu).decode(Uint8Array.from(e));
    if (n.contentHead.type === 33 && n.body?.msgContent) {
      const r = new fe(tC).decode(n.body.msgContent);
      await this.core.apis.GroupApi.refreshGroupMemberCache(r.groupUin.toString(), !0);
      const i = await this.waitGroupNotify(
        r.groupUin.toString(),
        r.memberUid,
        r.operatorInfo ? new TextDecoder("utf-8").decode(r.operatorInfo) : void 0
      );
      return new dm(
        this.core,
        r.groupUin,
        r.memberUid ? +await this.core.apis.UserApi.getUinByUidV2(r.memberUid) : 0,
        i ? +await this.core.apis.UserApi.getUinByUidV2(i) : 0,
        r.decreaseType === 131 ? "invite" : "approve"
      );
    } else if (n.contentHead.type === 34 && n.body?.msgContent) {
      const r = new fe(tC).decode(n.body.msgContent);
      let i;
      if (r.operatorInfo)
        if (r.decreaseType === 3 || Buffer.from(r.operatorInfo).toString("hex").startsWith("0a"))
          try {
            i = new fe(q$).decode(r.operatorInfo).operator?.operatorUid;
          } catch {
            try {
              const a = new TextDecoder("utf-8").decode(r.operatorInfo);
              i = [...a].every((u) => u.charCodeAt(0) >= 32 && u.charCodeAt(0) <= 126) ? a : "";
            } catch {
              i = "";
            }
          }
        else
          try {
            const s = new TextDecoder("utf-8").decode(r.operatorInfo);
            i = [...s].every((c) => c.charCodeAt(0) >= 32 && c.charCodeAt(0) <= 126) ? s : "";
          } catch {
            i = "";
          }
      const o = await this.waitGroupNotify(
        r.groupUin.toString(),
        r.memberUid,
        i
      );
      return r.memberUid === this.core.selfInfo.uid ? setTimeout(() => {
        this.core.apis.GroupApi.groupMemberCache.delete(r.groupUin.toString());
      }, 5e3) : await this.core.apis.GroupApi.refreshGroupMemberCache(r.groupUin.toString(), !0), new T0e(
        this.core,
        r.groupUin,
        r.memberUid ? +await this.core.apis.UserApi.getUinByUidV2(r.memberUid) : 0,
        o ? +await this.core.apis.UserApi.getUinByUidV2(o) : 0,
        this.groupChangDecreseType2String(r.decreaseType)
      );
    } else if (n.contentHead.type === 44 && n.body?.msgContent) {
      const r = new fe(N0e).decode(n.body.msgContent);
      await this.core.apis.GroupApi.refreshGroupMemberCache(r.groupUin.toString(), !0);
      let i = !1, o = "";
      return r.body.extraEnable != null ? (o = r.body.extraEnable.adminUid, i = !0) : r.body.extraDisable != null && (o = r.body.extraDisable.adminUid, i = !1), new P0e(
        this.core,
        r.groupUin,
        +await this.core.apis.UserApi.getUinByUidV2(o),
        i ? "set" : "unset"
      );
    } else if (n.contentHead.type === 87 && n.body?.msgContent) {
      const r = new fe(J$).decode(n.body.msgContent);
      let i = "";
      try {
        await this.core.eventWrapper.registerListen("NodeIKernelMsgListener/onRecvMsg", (o) => {
          for (const s of o)
            if (s.senderUid === r.invitorUid && s.msgType === 11) {
              const a = JSON.parse(s.elements.find((f) => f.elementType === 10)?.arkElement?.bytesData ?? "").meta?.news?.jumpUrl, c = new URLSearchParams(a), u = c.get("groupcode"), l = c.get("receiveruin");
              if (i = c.get("msgseq") ?? "", u === r.groupUin.toString() && l === this.core.selfInfo.uin)
                return !0;
            }
          return !1;
        }, 1, 1e3);
      } catch {
        i = "";
      }
      return i === "" ? void 0 : (this.notifyGroupInvite.put(i, {
        seq: i,
        type: 1,
        group: {
          groupCode: r.groupUin.toString(),
          groupName: ""
        },
        user1: {
          uid: r.invitorUid,
          nickName: ""
        },
        user2: {
          uid: this.core.selfInfo.uid,
          nickName: ""
        },
        actionUser: {
          uid: r.invitorUid,
          nickName: ""
        },
        actionTime: Date.now().toString(),
        postscript: "",
        repeatSeqs: [],
        warningTips: "",
        invitationExt: {
          srcType: 1,
          groupCode: r.groupUin.toString(),
          waitStatus: 1
        },
        status: 1
      }), new hm(
        this.core,
        +r.groupUin,
        +await this.core.apis.UserApi.getUinByUidV2(r.invitorUid),
        "invite",
        "",
        i
      ));
    } else {
      if (n.contentHead.type === 528 && n.contentHead.subType === 39 && n.body?.msgContent)
        return await this.obContext.apis.UserApi.parseLikeEvent(n.body?.msgContent);
      if (n.contentHead.type === 166 && n.contentHead.c2CCmd === 133 && n.body?.msgContent) {
        this.core.context.logger.logDebug("在线文件通道断开");
        const r = n.body.msgContent[15], i = n.body.msgContent[17];
        if (r === 101) {
          if (i === 225)
            return this.core.context.logger.log(`好友：${n.responseHead.fromUin}取消了在线文件的传输（或转离线）`), new zF(
              this.core,
              +n.responseHead.fromUin
            );
          if (i === 230)
            return this.core.context.logger.log(`好友：${n.responseHead.fromUin}拒绝了你的在线文件传输`), new ww(
              this.core,
              +n.responseHead.fromUin,
              "refuse"
            );
        } else if (r === 136) {
          if (i === 225)
            return this.core.context.logger.log(`好友：${n.responseHead.fromUin}取消了在线文件夹的传输（或转离线）`), new zF(
              this.core,
              +n.responseHead.fromUin
            );
          if (i === 230)
            return this.core.context.logger.log(`好友：${n.responseHead.fromUin}拒绝了你的在线文件夹传输`), new ww(
              this.core,
              +n.responseHead.fromUin,
              "refuse"
            );
        }
        this.core.context.logger.logDebug("未知的系统消息事件:", r, i);
        return;
      } else if (n.contentHead.type === 166 && n.contentHead.c2CCmd === 131 && n.body?.msgContent) {
        const r = n.body.msgContent[15];
        return r === 101 ? this.core.context.logger.log("在线文件传输成功！") : r === 136 && this.core.context.logger.log("在线文件夹传输成功！"), new ww(
          this.core,
          +n.responseHead.fromUin,
          "receive"
        );
      }
    }
  }
}
const Qu = {
  GetMsg: {
    payload: { message_id: 123456 },
    response: {
      time: 171e7,
      message_type: "group",
      message_id: 123456,
      real_id: 123456,
      sender: { user_id: 123456789, nickname: "昵称" },
      message: "hello"
    }
  },
  FetchPttText: {
    payload: { message_id: 123456 },
    response: {
      text: "hello"
    }
  },
  SendMsg: {
    payload: { message_type: "group", group_id: "123456", message: "hello" },
    response: { message_id: 123456 }
  }
}, L0e = p.Object({
  message_type: p.Optional(p.Union([p.Literal("private"), p.Literal("group")], { description: "消息类型 (private/group)" })),
  user_id: p.Optional(p.String({ description: "用户QQ" })),
  group_id: p.Optional(p.String({ description: "群号" })),
  message: Cg,
  auto_escape: p.Optional(p.Union([p.Boolean(), p.String()], { description: "是否作为纯文本发送" })),
  // 以下为扩展字段
  source: p.Optional(p.String({ description: "合并转发来源" })),
  news: p.Optional(p.Array(p.Object({ text: p.String() }), { description: "合并转发新闻" })),
  summary: p.Optional(p.String({ description: "合并转发摘要" })),
  prompt: p.Optional(p.String({ description: "合并转发提示" })),
  timeout: p.Optional(p.Number({ description: "自定义发送超时(毫秒)，覆盖自动计算值" }))
}), j0e = p.Object({
  message_id: p.Number({ description: "消息ID" }),
  res_id: p.Optional(p.String({ description: "转发消息的 res_id" })),
  forward_id: p.Optional(p.String({ description: "转发消息的 forward_id" }))
});
var ua = /* @__PURE__ */ ((t) => (t[t.Normal = 0] = "Normal", t[t.Private = 1] = "Private", t[t.Group = 2] = "Group", t))(ua || {});
function Qa(t, e = !1) {
  return typeof t == "string" ? e ? [{ type: ze.text, data: { text: t } }] : _0e(t) : Array.isArray(t) ? t : [t];
}
async function N2(t, e, n = 0) {
  if (!e)
    throw new Error("请传递请求内容");
  if ((n === 2 || n === 0) && e.group_id)
    return {
      chatType: Ne.KCHATTYPEGROUP,
      peerUid: e.group_id.toString()
    };
  if ((n === 1 || n === 0) && e.user_id) {
    const r = await t.apis.UserApi.getUidByUinV2(e.user_id.toString());
    if (!r) {
      if (e.group_id)
        return {
          chatType: Ne.KCHATTYPEGROUP,
          peerUid: e.group_id.toString(),
          guildId: ""
        };
      throw new Error("无法获取用户信息");
    }
    return await t.apis.FriendApi.isBuddy(r) ? {
      chatType: Ne.KCHATTYPEC2C,
      peerUid: r,
      guildId: ""
    } : (await t.apis.MsgApi.getTempChatInfo(Ne.KCHATTYPETEMPC2CFROMGROUP, r)).tmpChatInfo?.groupCode ? {
      chatType: Ne.KCHATTYPETEMPC2CFROMGROUP,
      peerUid: r,
      guildId: ""
    } : e.group_id ? {
      chatType: Ne.KCHATTYPETEMPC2CFROMGROUP,
      peerUid: r,
      guildId: e.group_id.toString()
    } : {
      chatType: Ne.KCHATTYPEC2C,
      peerUid: r,
      guildId: ""
    };
  }
  throw n === 1 && e.group_id ? new Error("当前私聊发送,请指定 user_id 而不是 group_id") : n === 2 && e.user_id ? new Error("当前群聊发送,请指定 group_id 而不是 user_id") : new Error("请指定正确的 group_id 或 user_id");
}
function Q0e(t, e) {
  return t.filter((n) => n.type === e).length;
}
function Sw(t) {
  return t.type === ze.node;
}
class Ay extends le {
  payloadSchema = L0e;
  returnSchema = j0e;
  actionTags = ["消息接口"];
  async check(e) {
    const n = Qa(e.message), r = Q0e(n, ze.node);
    return r > 0 && r !== n.length ? {
      valid: !1,
      message: "转发消息不能和普通消息混在一起发送,转发需要保证message只有type为node的元素"
    } : { valid: !0 };
  }
  async _handle(e) {
    return this.base_handle(e);
  }
  async base_handle(e, n = 0) {
    e.message_type === "group" && (n = 2), e.message_type === "private" && (n = 1);
    const r = await N2(this.core, {
      message_type: e.message_type,
      user_id: e.user_id?.toString(),
      group_id: e.group_id?.toString()
    }, n), i = Qa(
      e.message,
      typeof e.auto_escape == "string" ? e.auto_escape === "true" : !!e.auto_escape
    ), o = i.filter(Sw);
    if (o.length > 0) {
      const u = this.core.apis.PacketApi.packetStatus;
      let l;
      try {
        l = u ? await this.handleForwardedNodesPacket(r, o, e.source, e.news, e.summary, e.prompt) : await this.handleForwardedNodes(r, o);
      } catch (d) {
        throw Error(u ? `发送伪造合并转发消息失败: ${d?.stack}` : `发送合并转发消息失败: ${d?.stack}`);
      }
      if (!l)
        throw Error("发送合并转发消息失败：returnMsgAndResId 为空！");
      if (l.message) {
        const d = rt.createUniqueMsgId({
          guildId: "",
          peerUid: r.peerUid,
          chatType: r.chatType
        }, l.message.msgId), f = l.res_id;
        return { message_id: d, res_id: f, forward_id: f };
      } else if (l.res_id && !l.message)
        throw Error(`发送转发消息（res_id：${l.res_id} 失败`);
    }
    const { sendElements: s, deleteAfterSentFiles: a } = await this.obContext.apis.MsgApi.createSendElements(i, r);
    return { message_id: (await this.obContext.apis.MsgApi.sendMsgWithOb11UniqueId(r, s, a, e.timeout)).id };
  }
  async uploadForwardedNodesPacket(e, n, r, i, o, s, a, c = 0) {
    const u = [], l = [], d = [];
    for (const x of n) {
      if (c >= 3) {
        this.core.context.logger.logWarn("转发消息深度超过3层，将停止解析！");
        break;
      }
      if (x.data.id)
        if (x.data.id) {
          const g = x.data.id, v = rt.getMsgIdAndPeerByShortId(+g) || rt.getPeerByMsgId(g);
          if (!v) {
            this.core.context.logger.logError("转发消息失败，未找到消息", g);
            continue;
          }
          const S = (await this.core.apis.MsgApi.getMsgsByMsgId(v.Peer, [v.MsgId])).msgList[0];
          if (this.core.context.logger.logDebug(`handleForwardedNodesPacket[PureRaw] 开始转换 ${Pl(S)}`), S) {
            const E = await this.core.apis.FileApi.downloadRawMsgMedia([S]);
            l.push(...E);
            const T = this.core.apis.PacketApi.pkt.msgConverter.rawMsgToPacketMsg(S, e);
            for (const j of S.elements) {
              let q, Y;
              if (j.multiForwardMsgElement?.resId)
                q = j.multiForwardMsgElement.resId, Y = j.multiForwardMsgElement.fileName;
              else if (j.arkElement?.bytesData)
                try {
                  const W = JSON.parse(j.arkElement.bytesData);
                  W.app === "com.tencent.multimsg" && (q = W.meta?.detail?.resid, Y = W.meta?.detail?.uniseq || W.extra?.filename);
                } catch {
                }
              if (q && Y)
                try {
                  const W = await this.core.apis.PacketApi.pkt.operation.FetchForwardMsgRaw(q);
                  for (const G of W)
                    G.actionCommand === "MultiMsg" ? d.push({ uuid: Y, actionMsgBody: G.actionData.msgBody }) : d.push({ uuid: G.actionCommand, actionMsgBody: G.actionData.msgBody });
                } catch (W) {
                  this.core.context.logger.logError(`获取合并转发内层消息失败: ${W?.stack}`);
                }
            }
            this.core.context.logger.logDebug(`handleForwardedNodesPacket[PureRaw] 转换为 ${Pl(T)}`), u.push(T);
          }
        } else
          this.core.context.logger.logDebug(`handleForwardedNodesPacket 跳过元素 ${Pl(x)}`);
      else {
        const g = Qa(x.type === ze.node ? x.data.content : x);
        let v;
        const S = g.filter(Sw);
        if (S.length > 0) {
          const j = await this.uploadForwardedNodesPacket(e, S, x.data.source, x.data.news, x.data.summary, x.data.prompt, {
            user_id: (x.data.user_id ?? x.data.uin)?.toString() ?? a?.user_id ?? this.core.selfInfo.uin,
            nickname: (x.data.nickname || x.data.name) ?? a?.nickname ?? "QQ用户"
          }, c + 1);
          v = j?.finallySendElements ? [j.finallySendElements] : [], l.push(...j?.deleteAfterSentFiles || []), j?.uuid && (d.push({ uuid: j.uuid, packetMsg: j.packetMsg }), j.innerPacketMsg?.forEach((q) => {
            d.push(q);
          }));
        } else {
          const j = await this.obContext.apis.MsgApi.createSendElements(g, e);
          v = j.sendElements, l.push(...j.deleteAfterSentFiles);
        }
        const E = {
          senderUin: Number(x.data.user_id ?? x.data.uin ?? a?.user_id) || +this.core.selfInfo.uin,
          senderName: (x.data.nickname || x.data.name) ?? a?.nickname ?? "QQ用户",
          groupId: e.chatType === Ne.KCHATTYPEGROUP ? +e.peerUid : 0,
          time: Number(x.data.time) || Date.now(),
          msg: v
        };
        this.core.context.logger.logDebug(`handleForwardedNodesPacket[SendRaw] 开始转换 ${Pl(E)}`);
        const T = this.core.apis.PacketApi.pkt.msgConverter.rawMsgWithSendMsgToPacketMsg(E);
        this.core.context.logger.logDebug(`handleForwardedNodesPacket[SendRaw] 转换为 ${Pl(T)}`), u.push(T);
      }
    }
    if (u.length === 0)
      return this.core.context.logger.logWarn("handleForwardedNodesPacket 元素为空！"), null;
    const f = [{
      actionCommand: "MultiMsg",
      actionMsg: u
    }];
    d.forEach(({ uuid: x, packetMsg: g, actionMsgBody: v }) => {
      f.push({
        actionCommand: x,
        actionMsg: g,
        actionMsgBody: v
      });
    });
    const m = await this.core.apis.PacketApi.pkt.operation.UploadForwardMsgV2(f, e.chatType === Ne.KCHATTYPEGROUP ? +e.peerUid : 0), h = crypto.randomUUID(), y = bE.fromPacketMsg(m, u, r, i, o, s, h);
    return {
      deleteAfterSentFiles: l,
      finallySendElements: {
        elementType: _e.ARK,
        elementId: "",
        arkElement: {
          bytesData: JSON.stringify(y)
        }
      },
      res_id: m,
      uuid: h,
      packetMsg: u,
      innerPacketMsg: d
    };
  }
  async handleForwardedNodesPacket(e, n, r, i, o, s) {
    const a = await this.uploadForwardedNodesPacket(e, n, r, i, o, s), c = a?.res_id, u = a?.finallySendElements;
    if (!u) throw Error("转发消息失败，生成节点为空");
    return { message: await this.obContext.apis.MsgApi.sendMsgWithOb11UniqueId(e, [u], a.deleteAfterSentFiles || []).catch(() => {
    }) ?? null, res_id: c };
  }
  async handleForwardedNodes(e, n) {
    const r = {
      chatType: Ne.KCHATTYPEC2C,
      peerUid: this.core.selfInfo.uid
    };
    let i = [];
    for (const u of n) {
      const l = u.data.id;
      if (l) {
        const d = rt.getMsgIdAndPeerByShortId(parseInt(l)) || rt.getPeerByMsgId(l);
        if (!d) {
          this.core.context.logger.logError("转发消息失败，未找到消息", l);
          continue;
        }
        i.push(d.MsgId);
      } else
        try {
          const d = Qa(u.data.content), f = d.filter(Sw);
          if (f.length !== 0) {
            if (f.length !== d.length) {
              this.core.context.logger.logError("子消息中包含非node消息 跳过不合法部分");
              continue;
            }
            const v = await this.handleForwardedNodes(r, f);
            v && (i.push(v.message.msgId), rt.createUniqueMsgId(r, v.message.msgId));
            continue;
          }
          const { sendElements: m } = await this.obContext.apis.MsgApi.createSendElements(d, e), h = m.filter(
            (v) => v.elementType !== _e.FILE && v.elementType !== _e.VIDEO && v.elementType !== _e.ARK && v.elementType !== _e.PTT
          ), y = m.filter(
            (v) => v.elementType === _e.FILE || v.elementType === _e.VIDEO || v.elementType === _e.ARK || v.elementType === _e.PTT
          ).map((v) => [v]), x = [h, ...y].filter((v) => v !== void 0 && v.length !== 0), g = [];
          for (const v of x)
            g.push(this.obContext.apis.MsgApi.sendMsgWithOb11UniqueId(r, v, []).catch(() => {
            }));
          (await Promise.allSettled(g)).map((v) => (v.status === "fulfilled" && v.value && (i.push(v.value.msgId), rt.createUniqueMsgId(r, v.value.msgId)), v));
        } catch (d) {
          this.core.context.logger.logDebug("生成转发消息节点失败", d.stack);
        }
    }
    const o = [];
    let s, a = !1;
    for (const u of i) {
      const l = rt.getPeerByMsgId(u);
      if (!l) {
        this.core.context.logger.logError("转发消息失败，未找到消息", u);
        continue;
      }
      const d = (await this.core.apis.MsgApi.getMsgsByMsgId(l.Peer, [u])).msgList[0];
      d && (s = s ?? { chatType: d.chatType, peerUid: d.peerUid }, s.peerUid !== d.peerUid && (a = !0), o.push(d));
    }
    i = o.map((u) => u.msgId);
    let c = [];
    if (a)
      for (const [, u] of o.entries()) {
        if (u.peerUid === this.core.selfInfo.uid) {
          c.push(u.msgId);
          continue;
        }
        const l = await this.cloneMsg(u);
        l && c.push(l.msgId);
      }
    else
      c = i;
    if (c.length === 0) throw Error("转发消息失败，生成节点为空");
    try {
      return this.core.context.logger.logDebug("开发转发", s, e, c), {
        message: await this.core.apis.MsgApi.multiForwardMsg(s, e, c)
      };
    } catch (u) {
      return this.core.context.logger.logError("forward failed", u?.stack), {
        message: null
      };
    }
  }
  async cloneMsg(e) {
    const n = {
      chatType: Ne.KCHATTYPEC2C,
      peerUid: this.core.selfInfo.uid
    }, r = [];
    for (const i of e.elements)
      r.push(i);
    r.length === 0 && this.core.context.logger.logDebug("需要clone的消息无法解析，将会忽略掉", e);
    try {
      return await this.core.apis.MsgApi.sendMsg(n, r);
    } catch (i) {
      this.core.context.logger.logError(i?.stack, "克隆转发消息失败,将忽略本条消息", e);
      return;
    }
  }
}
class $0e extends Ay {
  actionName = re.SendMsg;
  actionSummary = "发送消息";
  actionDescription = "发送私聊或群聊消息";
  actionTags = ["消息接口"];
  payloadExample = Qu.SendMsg.payload;
  returnExample = Qu.SendMsg.response;
}
class G0e {
  obContext;
  core;
  constructor(e, n) {
    this.obContext = e, this.core = n;
  }
  async handleQuickOperation(e, n) {
    if (e.post_type === "message" && await this.handleMsg(e, n).catch((r) => this.core.context.logger.logError(r)), e.post_type === "request") {
      const r = e, i = e;
      r.request_type === "friend" ? await this.handleFriendRequest(r, n).catch((o) => this.core.context.logger.logError(o)) : i.request_type === "group" && await this.handleGroupRequest(i, n).catch((o) => this.core.context.logger.logError(o));
    }
  }
  async handleMsg(e, n) {
    const r = n.reply, i = e.message_type === "private" ? ua.Private : ua.Group, o = await N2(this.core, {
      group_id: e.group_id?.toString(),
      user_id: e.user_id?.toString()
    }, i);
    if (r) {
      let s = [];
      e.message_type === "group" && (s.push({
        type: "reply",
        data: {
          id: e.message_id.toString()
        }
      }), n.at_sender && s.push({
        type: "at",
        data: {
          qq: e.user_id.toString()
        }
      })), s = s.concat(Qa(r, n.auto_escape));
      const {
        sendElements: a,
        deleteAfterSentFiles: c
      } = await this.obContext.apis.MsgApi.createSendElements(s, o);
      this.obContext.apis.MsgApi.sendMsgWithOb11UniqueId(o, a, c).then().catch((u) => this.core.context.logger.logError(u));
    }
  }
  async findNotify(e) {
    let n = (await this.core.apis.GroupApi.getSingleScreenNotifies(!1, 100)).find((r) => r.seq === e);
    return n ? { doubt: !1, notify: n } : (n = (await this.core.apis.GroupApi.getSingleScreenNotifies(!0, 100)).find((r) => r.seq === e), { doubt: !0, notify: n });
  }
  async handleGroupRequest(e, n) {
    const r = this.obContext.apis.MsgApi.notifyGroupInvite.get(e.flag), { doubt: i, notify: o } = r ? { doubt: !1, notify: r } : await this.findNotify(e.flag);
    !HI(n.approve) && o && this.core.apis.GroupApi.handleGroupRequest(
      i,
      o,
      n.approve ? zp.KAGREE : zp.KREFUSE,
      n.reason
    ).catch((s) => this.core.context.logger.logError(s));
  }
  async handleFriendRequest(e, n) {
    const r = (await this.core.apis.FriendApi.getBuddyReq()).buddyReqs.find((i) => i.reqTime === e.flag.toString());
    !HI(n.approve) && r && this.core.apis.FriendApi.handleFriendRequest(r, !!n.approve).then().catch((i) => this.core.context.logger.logError(i));
  }
}
async function q0e(t, e) {
  const n = await Ot.stat(t), r = Math.max(1, Math.floor(n.size / 1024 / 3));
  return e.log("通过文件大小估算语音的时长:", r), r;
}
async function H0e(t, e, n) {
  try {
    const r = xe.join(e, Do());
    if (await ns.isSilk(t)) {
      let i = 0;
      try {
        i = await ns.getDuration(t);
      } catch (o) {
        n.log("获取语音文件时长失败, 使用文件大小推测时长", t, o.stack), i = await q0e(t, n);
      }
      return {
        converted: !1,
        path: t,
        duration: i
      };
    } else {
      n.log(`语音文件${t}需要转换成silk`), await ns.convertToNTSilkTct(t, r);
      const i = await ns.getDuration(t);
      return n.log(`语音文件${t}转换成功!`, r, "时长:", i), {
        converted: !0,
        path: r,
        duration: i
      };
    }
  } catch (r) {
    return n.logError("convert silk failed", r), {};
  }
}
async function W0e(t) {
  const e = (await Cd(t))?.ext ?? "jpg";
  return {
    // 'webp': PicType.NEWPIC_WEBP,
    gif: Wp.NEWPIC_GIF
    // 'png': PicType.NEWPIC_APNG,
    // 'jpg': PicType.NEWPIC_JPEG,
    // 'jpeg': PicType.NEWPIC_JPEG,
    // 'bmp': PicType.NEWPIC_BMP,
  }[e] ?? Wp.NEWPIC_JPEG;
}
class z0e {
  obContext;
  core;
  constructor(e, n) {
    this.obContext = e, this.core = n;
  }
  async createValidSendFileElement(e, n, r = "", i = "", o = !1, s = !1) {
    const {
      fileName: a,
      path: c,
      fileSize: u
    } = await this.core.apis.FileApi.uploadFile(n, _e.FILE, 0, o);
    if (u === 0)
      throw new Error("文件异常，大小为0");
    return o && e.deleteAfterSentFiles.push(c), {
      elementType: _e.FILE,
      elementId: "",
      fileElement: {
        fileName: r || a,
        folderId: i,
        filePath: c,
        fileSize: u.toString()
      }
    };
  }
  async createValidSendPicElement(e, n, r = "", i = 0, o = !1) {
    const { md5: s, fileName: a, path: c, fileSize: u } = await this.core.apis.FileApi.uploadFile(n, _e.PIC, i);
    if (u === 0)
      throw new Error("文件异常，大小为0");
    const l = await wE(n);
    return e.deleteAfterSentFiles.push(c), {
      elementType: _e.PIC,
      elementId: "",
      picElement: {
        md5HexStr: s,
        fileSize: u.toString(),
        picWidth: l.width,
        picHeight: l.height,
        fileName: a,
        sourcePath: c,
        original: !0,
        picType: await W0e(n),
        picSubType: i,
        fileUuid: "",
        fileSubId: "",
        thumbFileSize: 0,
        summary: r
      }
    };
  }
  async createValidSendVideoElement(e, n, r = "", i = "", o = !1) {
    let s = {
      width: 1920,
      height: 1080,
      time: 15,
      format: "mp4",
      size: 0,
      filePath: n
    }, a = "mp4";
    try {
      const S = (await Cd(n))?.ext;
      S && (a = S);
    } catch (S) {
      this.core.context.logger.logError("获取文件类型失败", S);
    }
    if (xe.extname(n).slice(1).toLowerCase() !== a.toLowerCase())
      if (o) {
        const S = xe.join(this.core.NapCatTempPath, `${Do()}.${a}`);
        de.copyFileSync(n, S), e.deleteAfterSentFiles.push(S), n = S;
      } else {
        const S = `${n}.${a}`;
        de.copyFileSync(n, S), e.deleteAfterSentFiles.push(S), n = S;
      }
    const { fileName: l, path: d, fileSize: f, md5: m } = await this.core.apis.FileApi.uploadFile(n, _e.VIDEO);
    if (e.deleteAfterSentFiles.push(d), f === 0)
      throw new Error("文件异常，大小为0");
    const h = d.replace(`${xe.sep}Ori${xe.sep}`, `${xe.sep}Thumb${xe.sep}`);
    de.mkdirSync(xe.dirname(h), { recursive: !0 });
    const y = xe.join(xe.dirname(h), `${m}_0.png`);
    try {
      if (s = await ns.getVideoInfo(n, y), !de.existsSync(y))
        throw this.core.context.logger.logError("获取视频缩略图失败", new Error("缩略图不存在")), new Error("获取视频缩略图失败");
    } catch (S) {
      this.core.context.logger.logError("获取视频信息失败", S), de.writeFileSync(y, Buffer.from(A8, "base64"));
    }
    if (i)
      try {
        await this.core.apis.FileApi.copyFile(i, y);
      } catch (S) {
        this.core.context.logger.logError("复制自定义缩略图失败", S);
      }
    e.deleteAfterSentFiles.push(y);
    const x = (await Ot.stat(y)).size, g = await Lg(y);
    e.deleteAfterSentFiles.push(y);
    const v = (r || l).toLocaleLowerCase().endsWith(`.${a.toLocaleLowerCase()}`) ? r || l : `${r || l}.${a}`;
    return {
      elementType: _e.VIDEO,
      elementId: "",
      videoElement: {
        fileName: v,
        filePath: d,
        videoMd5: m,
        thumbMd5: g,
        fileTime: s.time,
        thumbPath: /* @__PURE__ */ new Map([[0, y]]),
        thumbSize: x,
        thumbWidth: s.width,
        thumbHeight: s.height,
        fileSize: f.toString()
      }
    };
  }
  async createValidSendPttElement(e, n) {
    const { converted: r, path: i, duration: o } = await H0e(n, this.core.NapCatTempPath, this.core.context.logger);
    if (!i)
      throw new Error("语音转换失败, 请检查语音文件是否正常");
    const { md5: s, fileName: a, path: c, fileSize: u } = await this.core.apis.FileApi.uploadFile(i, _e.PTT);
    if (u === 0)
      throw new Error("文件异常，大小为0");
    return r && Ot.unlink(i).then().catch((l) => this.core.context.logger.logError("删除临时文件失败", l)), {
      elementType: _e.PTT,
      elementId: "",
      pttElement: {
        fileName: a,
        filePath: c,
        md5HexStr: s,
        fileSize: u.toString(),
        duration: o ?? 1,
        formatType: 1,
        voiceType: 1,
        voiceChangeType: 0,
        canConvert2Text: !0,
        waveAmplitudes: [
          0,
          18,
          9,
          23,
          16,
          17,
          16,
          15,
          44,
          17,
          24,
          20,
          14,
          15,
          17
        ],
        fileSubId: "",
        playState: 1,
        autoConvertText: 0,
        storeID: 0,
        otherBusinessInfo: {
          aiVoiceType: 0
        }
      }
    };
  }
}
const K0e = p.Object({
  message_id: p.Union([p.Number(), p.String()], { description: "消息ID" })
}), V0e = p.Object({
  time: p.Number({ description: "发送时间" }),
  message_type: p.String({ description: "消息类型" }),
  message_id: p.Number({ description: "消息ID" }),
  real_id: p.Number({ description: "真实ID" }),
  message_seq: p.Number({ description: "消息序号" }),
  sender: p.Any({ description: "发送者" }),
  message: p.Any({ description: "消息内容" }),
  raw_message: p.String({ description: "原始消息内容" }),
  font: p.Number({ description: "字体" }),
  group_id: p.Optional(p.Union([p.Number(), p.String()], { description: "群号" })),
  user_id: p.Union([p.Number(), p.String()], { description: "发送者QQ号" }),
  emoji_likes_list: p.Optional(p.Array(p.Any(), { description: "表情回应列表" }))
}, { description: "OneBot 11 消息" });
class Y0e extends le {
  actionName = re.GetMsg;
  payloadSchema = K0e;
  returnSchema = V0e;
  actionSummary = "获取消息";
  actionDescription = "根据消息 ID 获取消息详细信息";
  actionTags = ["消息接口"];
  payloadExample = Qu.GetMsg.payload;
  returnExample = Qu.GetMsg.response;
  async _handle(e, n, r) {
    if (!e.message_id)
      throw Error("参数message_id不能为空");
    const i = rt.getShortIdByMsgId(e.message_id.toString()), o = rt.getMsgIdAndPeerByShortId(i ?? +e.message_id);
    if (!o)
      throw new Error("消息不存在");
    const s = { guildId: "", peerUid: o?.Peer.peerUid, chatType: o.Peer.chatType }, a = this.obContext.configLoader.configData.timeout.baseTimeout, u = (await Ys(
      this.core.apis.MsgApi.getMsgsByMsgId(s, [o?.MsgId || e.message_id.toString()]),
      a
    ).catch((d) => {
      throw d instanceof Error && d.message.startsWith("PromiseTimer:") ? new Error(`消息不存在或已被撤回: ${d.message || String(d)}`) : d;
    })).msgList[0];
    if (!u) throw Error("消息不存在或已被撤回");
    const l = await this.obContext.apis.MsgApi.parseMessage(u, r.messagePostFormat);
    if (!l) throw Error("消息为空");
    l.emoji_likes_list = [], u.emojiLikesList?.forEach((d) => {
      l.emoji_likes_list?.push({
        emoji_id: d.emojiId,
        emoji_type: d.emojiType,
        likes_cnt: d.likesCnt
      });
    });
    try {
      l.message_id = rt.createUniqueMsgId(s, u.msgId), l.message_seq = l.message_id, l.real_id = l.message_id;
    } catch {
    }
    return l;
  }
}
const P2 = p.Object({
  birthday_year: p.Optional(p.Number({ description: "出生年份" })),
  birthday_month: p.Optional(p.Number({ description: "出生月份" })),
  birthday_day: p.Optional(p.Number({ description: "出生日期" })),
  phone_num: p.Optional(p.String({ description: "手机号" })),
  email: p.Optional(p.String({ description: "邮箱" })),
  category_id: p.Optional(p.Number({ description: "分组ID" })),
  user_id: p.Number({ description: "QQ号" }),
  nickname: p.String({ description: "昵称" }),
  remark: p.Optional(p.String({ description: "备注" })),
  sex: p.Optional(p.String({ description: "性别" })),
  level: p.Optional(p.Number({ description: "等级" })),
  age: p.Optional(p.Number({ description: "年龄" })),
  qid: p.Optional(p.String({ description: "QID" })),
  login_days: p.Optional(p.Number({ description: "登录天数" })),
  categoryName: p.Optional(p.String({ description: "分组名称" })),
  categoryId: p.Optional(p.Number({ description: "分组ID" }))
}, { $id: "OB11User", description: "OneBot 11 用户信息" }), FU = p.Object({
  group_all_shut: p.Number({ description: "是否全员禁言" }),
  group_remark: p.String({ description: "群备注" }),
  group_id: p.Number({ description: "群号" }),
  group_name: p.String({ description: "群名称" }),
  member_count: p.Optional(p.Number({ description: "成员人数" })),
  max_member_count: p.Optional(p.Number({ description: "最大成员人数" }))
}, { $id: "OB11Group", description: "OneBot 11 群信息" }), J0e = p.Object({
  group_id: p.Number({ description: "群号" }),
  user_id: p.Number({ description: "QQ号" }),
  nickname: p.String({ description: "昵称" }),
  card: p.Optional(p.String({ description: "名片" })),
  sex: p.Optional(p.String({ description: "性别" })),
  age: p.Optional(p.Number({ description: "年龄" })),
  join_time: p.Optional(p.Number({ description: "入群时间戳" })),
  last_sent_time: p.Optional(p.Number({ description: "最后发言时间戳" })),
  level: p.Optional(p.String({ description: "等级" })),
  qq_level: p.Optional(p.Number({ description: "QQ等级" })),
  role: p.Optional(p.String({ description: "角色 (owner/admin/member)" })),
  title: p.Optional(p.String({ description: "头衔" })),
  area: p.Optional(p.String({ description: "地区" })),
  unfriendly: p.Optional(p.Boolean({ description: "是否不良记录" })),
  title_expire_time: p.Optional(p.Number({ description: "头衔过期时间" })),
  card_changeable: p.Optional(p.Boolean({ description: "是否允许修改名片" })),
  shut_up_timestamp: p.Optional(p.Number({ description: "禁言截止时间戳" })),
  is_robot: p.Optional(p.Boolean({ description: "是否为机器人" })),
  qage: p.Optional(p.Number({ description: "Q龄" }))
}, { $id: "OB11GroupMember", description: "OneBot 11 群成员信息" }), _w = p.Object({
  request_id: p.Number({ description: "请求ID" }),
  invitor_uin: p.Number({ description: "邀请者QQ" }),
  invitor_nick: p.String({ description: "邀请者昵称" }),
  group_id: p.Number({ description: "群号" }),
  group_name: p.String({ description: "群名称" }),
  message: p.String({ description: "附言" }),
  checked: p.Boolean({ description: "是否已处理" }),
  actor: p.Number({ description: "操作者QQ" }),
  requester_nick: p.String({ description: "申请者昵称" })
}, { $id: "OB11Notify", description: "OneBot 11 通知信息" }), X0e = p.Object({
  self_id: p.Number({ description: "发送者QQ号" }),
  user_id: p.Number({ description: "接收者QQ号" }),
  time: p.Number({ description: "时间戳" }),
  real_seq: p.String({ description: "消息序号" }),
  message_type: p.String({ description: "消息类型" }),
  sender: p.Object({
    user_id: p.Number({ description: "用户QQ号" }),
    nickname: p.String({ description: "用户昵称" }),
    card: p.Optional(p.String({ description: "用户名片" })),
    role: p.Optional(p.String({ description: "用户角色" }))
  }),
  raw_message: p.String({ description: "原始消息" }),
  font: p.Number({ description: "字体大小" }),
  sub_type: p.String({ description: "子类型" }),
  message: p.Unknown({ description: "消息内容" }),
  message_format: p.String({ description: "消息格式" }),
  post_type: p.String({ description: "发布类型" }),
  group_id: p.Number({ description: "群号" }),
  group_name: p.String({ description: "群名称" })
}, { $id: "OB11LatestMessage", description: "最后一条消息" });
p.Intersect([
  p.Omit(X0e, []),
  p.Object({
    message_id: p.Number({ description: "消息ID" }),
    message_seq: p.Number({ description: "消息序列号" }),
    emoji_likes_list: p.Array(p.Object({
      emoji_id: p.String({ description: "表情符号ID" }),
      emoji_type: p.String({ description: "表情符号类型" }),
      likes_cnt: p.String({ description: "点赞数" })
    }))
  }, { description: "OneBot 11 消息信息" })
], { $id: "OB11ActionMessage", description: "OneBot 11 消息信息" });
const KF = {
  GetLoginInfo: {
    payload: {},
    response: { user_id: 123456789, nickname: "机器人" }
  }
};
class Z0e extends le {
  actionName = re.GetLoginInfo;
  payloadSchema = p.Object({});
  returnSchema = P2;
  actionSummary = "获取登录号信息";
  actionDescription = "获取当前登录帐号的信息";
  actionTags = ["系统接口"];
  payloadExample = KF.GetLoginInfo.payload;
  returnExample = KF.GetLoginInfo.response;
  async _handle() {
    return Ni.selfInfo(this.core.selfInfo);
  }
}
const VF = {
  GetFriendList: {
    payload: {},
    response: [{ user_id: 123456789, nickname: "昵称", remark: "备注" }]
  }
}, eye = p.Object({
  no_cache: p.Optional(p.Union([p.Boolean(), p.String()], { description: "是否不使用缓存" }))
}), tye = p.Array(P2, { description: "好友列表" });
class nye extends le {
  actionName = re.GetFriendList;
  payloadSchema = eye;
  returnSchema = tye;
  actionSummary = "获取好友列表";
  actionDescription = "获取当前帐号的好友列表";
  actionTags = ["用户接口"];
  payloadExample = VF.GetFriendList.payload;
  returnExample = VF.GetFriendList.response;
  async _handle(e) {
    const n = await this.core.apis.FriendApi.getBuddyV2SimpleInfoMap(), r = typeof e.no_cache == "string" ? e.no_cache === "true" : !!e.no_cache;
    return await Promise.all(
      Array.from(n.values()).map(async (i) => {
        try {
          const o = await this.core.apis.UserApi.getUserDetailInfo(i.coreInfo.uid, r), s = n.get(i.coreInfo.uid);
          s && (s.qqLevel = o.qqLevel);
        } catch (o) {
          this.core.context.logger.logError("获取好友详细信息失败", o);
        }
      })
    ), Ni.friends(Array.from(n.values()));
  }
}
const ht = {
  DelEssenceMsg: {
    payload: { message_id: 123456 },
    response: null
  },
  DelGroupNotice: {
    payload: { group_id: "123456", notice_id: "notice_123" },
    response: null
  },
  GetGroupDetailInfo: {
    payload: { group_id: "123456" },
    response: { group_id: 123456, group_name: "测试群", member_count: 100, max_member_count: 500 }
  },
  GetGroupEssence: {
    payload: { group_id: "123456" },
    response: [{ message_id: 123456, sender_id: 123456, sender_nick: "昵称", operator_id: 123456, operator_nick: "昵称", operator_time: 171e7, content: "精华内容" }]
  },
  GetGroupInfo: {
    payload: { group_id: "123456" },
    response: { group_id: 123456, group_name: "测试群", member_count: 100, max_member_count: 500 }
  },
  GetGroupList: {
    payload: {},
    response: [{ group_id: 123456, group_name: "测试群", member_count: 100, max_member_count: 500 }]
  },
  GetGroupMemberInfo: {
    payload: { group_id: "123456", user_id: "123456789" },
    response: { group_id: 123456, user_id: 123456789, nickname: "昵称", card: "名片", role: "member" }
  },
  GetGroupMemberList: {
    payload: { group_id: "123456" },
    response: [{ group_id: 123456, user_id: 123456789, nickname: "昵称", card: "名片", role: "member" }]
  },
  GetGroupNotice: {
    payload: { group_id: "123456" },
    response: [{ notice_id: "notice_123", sender_id: 123456, publish_time: 171e7, message: { text: "公告内容", image: [] } }]
  },
  SendGroupMsg: {
    payload: { group_id: "123456", message: "hello" },
    response: { message_id: 123456 }
  },
  SetEssenceMsg: {
    payload: { message_id: 123456 },
    response: null
  },
  SetGroupAddRequest: {
    payload: { flag: "flag_123", sub_type: "add", approve: !0 },
    response: null
  },
  SetGroupAdmin: {
    payload: { group_id: "123456", user_id: "123456789", enable: !0 },
    response: null
  },
  SetGroupBan: {
    payload: { group_id: "123456", user_id: "123456789", duration: 1800 },
    response: null
  },
  SetGroupCard: {
    payload: { group_id: "123456", user_id: "123456789", card: "新名片" },
    response: null
  },
  SetGroupKick: {
    payload: { group_id: "123456", user_id: "123456789", reject_add_request: !1 },
    response: null
  },
  SetGroupLeave: {
    payload: { group_id: "123456", is_dismiss: !1 },
    response: null
  },
  SetGroupName: {
    payload: { group_id: "123456", group_name: "新群名" },
    response: null
  },
  SetGroupWholeBan: {
    payload: { group_id: "123456", enable: !0 },
    response: null
  }
}, rye = p.Object({
  no_cache: p.Optional(p.Union([p.Boolean(), p.String()], { description: "是否不使用缓存" }))
}), iye = p.Array(FU, { description: "群列表" });
class oye extends le {
  actionName = re.GetGroupList;
  payloadSchema = rye;
  returnSchema = iye;
  actionSummary = "获取群列表";
  actionDescription = "获取当前帐号的群聊列表";
  actionTags = ["群组接口"];
  payloadExample = ht.GetGroupList.payload;
  returnExample = ht.GetGroupList.response;
  async _handle(e) {
    return Ni.groups(
      await this.core.apis.GroupApi.getGroups(
        typeof e.no_cache == "string" ? e.no_cache === "true" : !!e.no_cache
      )
    );
  }
}
const sye = p.Object({
  group_id: p.String({ description: "群号" })
}), aye = FU;
class cye extends le {
  actionName = re.GetGroupInfo;
  payloadSchema = sye;
  returnSchema = aye;
  actionSummary = "获取群信息";
  actionDescription = "获取群聊的基本信息";
  actionTags = ["群组接口"];
  payloadExample = ht.GetGroupInfo.payload;
  returnExample = ht.GetGroupInfo.response;
  async _handle(e) {
    const n = (await this.core.apis.GroupApi.getGroups()).find((r) => r.groupCode === e.group_id.toString());
    if (!n) {
      const r = await this.core.apis.GroupApi.fetchGroupDetail(e.group_id.toString());
      return r.ownerUid && r.ownerUin === "0" && (r.ownerUin = await this.core.apis.UserApi.getUinByUidV2(r.ownerUid)), {
        ...r,
        group_all_shut: r.shutUpAllTimestamp > 0 ? -1 : 0,
        group_remark: "",
        group_id: +e.group_id,
        group_name: r.groupName,
        member_count: r.memberNum,
        max_member_count: r.maxMemberNum
      };
    }
    return Ni.group(n);
  }
}
const uye = p.Object({
  group_id: p.String({ description: "群号" }),
  user_id: p.String({ description: "QQ号" }),
  no_cache: p.Optional(p.Union([p.Boolean(), p.String()], { description: "是否不使用缓存" }))
}), lye = J0e;
class pye extends le {
  actionName = re.GetGroupMemberInfo;
  payloadSchema = uye;
  returnSchema = lye;
  actionSummary = "获取群成员信息";
  actionDescription = "获取群聊中指定成员的信息";
  actionTags = ["群组接口"];
  payloadExample = ht.GetGroupMemberInfo.payload;
  returnExample = ht.GetGroupMemberInfo.response;
  parseBoolean(e) {
    return typeof e == "string" ? e === "true" : e;
  }
  async getUid(e) {
    const n = await this.core.apis.UserApi.getUidByUinV2(e.toString());
    if (!n) throw new Error(`Uin2Uid Error: 用户ID ${e} 不存在`);
    return n;
  }
  async getGroupMemberInfo(e, n, r) {
    const o = this.core.apis.GroupApi.groupMemberCache.get(e.group_id.toString())?.get(n), [s, a] = await Promise.all([
      this.core.apis.GroupApi.getGroupMemberEx(e.group_id.toString(), n, r),
      this.core.apis.UserApi.getUserDetailInfo(n, r)
    ]);
    if (!s || !o) throw new Error(`群(${e.group_id})成员${e.user_id}不存在`);
    return a ? { ...o, ...s, ...a } : s;
  }
  async _handle(e) {
    const n = this.parseBoolean(e.no_cache ?? !0), r = await this.getUid(e.user_id), i = await this.getGroupMemberInfo(e, r, n);
    return i || this.core.context.logger.logDebug("获取群成员详细信息失败, 只能返回基础信息"), Ni.groupMember(e.group_id.toString(), i);
  }
}
class dye extends Ay {
  actionName = re.SendGroupMsg;
  actionSummary = "发送群消息";
  actionDescription = "发送群消息";
  actionTags = ["群组接口"];
  payloadExample = ht.SendGroupMsg.payload;
  returnExample = ht.SendGroupMsg.response;
  async check(e) {
    return delete e.user_id, e.message_type = "group", super.check(e);
  }
  async _handle(e) {
    return this.base_handle(e, ua.Group);
  }
}
class fye extends Ay {
  actionName = re.SendPrivateMsg;
  actionSummary = "发送私聊消息";
  actionDescription = "发送私聊消息";
  actionTags = ["消息接口"];
  payloadExample = {
    user_id: "123456789",
    message: "hello"
  };
  returnExample = {
    message_id: 123456
  };
  async check(e) {
    return e.message_type = "private", super.check(e);
  }
  async _handle(e) {
    return this.base_handle(e, ua.Private);
  }
}
const hye = p.Object({
  message_id: p.Union([p.Number(), p.String()], { description: "消息ID" })
}), mye = p.Null({ description: "操作结果" });
class gye extends le {
  actionName = re.DeleteMsg;
  payloadSchema = hye;
  returnSchema = mye;
  actionSummary = "撤回消息";
  actionDescription = "撤回已发送的消息";
  actionTags = ["消息接口"];
  payloadExample = {
    message_id: 12345
  };
  returnExample = null;
  async _handle(e) {
    const n = rt.getMsgIdAndPeerByShortId(Number(e.message_id));
    if (n)
      return this.obContext.recallEventCache.set(n.MsgId, setTimeout(() => {
        this.obContext.recallEventCache.delete(n.MsgId);
      }, 5e3)), await this.core.apis.MsgApi.recallMsg(n.Peer, n.MsgId), null;
    throw new Error("Recall failed");
  }
}
const yye = p.Object({
  app_name: p.String({ description: "应用名称" }),
  protocol_version: p.String({ description: "协议版本" }),
  app_version: p.String({ description: "应用版本" })
}, { description: "版本信息" });
class vye extends le {
  actionName = re.GetVersionInfo;
  returnSchema = yye;
  actionSummary = "获取版本信息";
  actionDescription = "获取版本信息";
  actionTags = ["系统接口"];
  payloadExample = {};
  returnExample = {
    app_name: "NapCat.Onebot",
    protocol_version: "v11",
    app_version: "1.0.0"
  };
  async _handle() {
    return {
      app_name: "NapCat.Onebot",
      protocol_version: "v11",
      app_version: Hu
    };
  }
}
const bye = p.Object({
  yes: p.Boolean({ description: "是否可以发送" })
});
class OU extends le {
  payloadSchema = p.Object({});
  returnSchema = bye;
  actionTags = ["系统接口"];
  async _handle() {
    return {
      yes: !0
    };
  }
}
class xye extends OU {
  actionName = re.CanSendRecord;
  actionSummary = "是否可以发送语音";
  actionDescription = "检查是否可以发送语音";
  actionTags = ["系统接口"];
  payloadExample = {};
  returnExample = { yes: !0 };
}
class wye extends OU {
  actionName = re.CanSendImage;
  actionSummary = "是否可以发送图片";
  actionDescription = "检查是否可以发送图片";
  actionTags = ["系统接口"];
  payloadExample = {};
  returnExample = { yes: !0 };
}
const Sye = p.Object({
  online: p.Boolean({ description: "是否在线" }),
  good: p.Boolean({ description: "状态是否良好" }),
  stat: p.Unknown({ description: "统计信息" })
});
class _ye extends le {
  actionName = re.GetStatus;
  payloadSchema = p.Object({});
  returnSchema = Sye;
  actionSummary = "获取运行状态";
  actionDescription = "获取运行状态";
  actionTags = ["系统接口"];
  payloadExample = {};
  returnExample = {
    online: !0,
    good: !0,
    stat: {}
  };
  async _handle() {
    return {
      online: !!this.core.selfInfo.online,
      good: !0,
      stat: {}
    };
  }
}
class D2 extends Ay {
  async check(e) {
    return e.messages && (e.message = Qa(e.messages)), super.check(e);
  }
}
class Eye extends D2 {
  actionName = re.GoCQHTTP_SendForwardMsg;
  actionSummary = "发送合并转发消息";
  actionDescription = "发送合并转发消息";
  actionTags = ["Go-CQHTTP"];
  payloadExample = {
    group_id: "123456789",
    messages: []
  };
  returnExample = {
    message_id: 123456
  };
  async check(e) {
    return e.messages && (e.message = Qa(e.messages)), super.check(e);
  }
}
class Aye extends D2 {
  actionName = re.GoCQHTTP_SendPrivateForwardMsg;
  actionSummary = "发送私聊合并转发消息";
  actionTags = ["Go-CQHTTP"];
  payloadExample = {
    user_id: "123456789",
    messages: []
  };
  returnExample = {
    message_id: 123456
  };
  async _handle(e) {
    return this.base_handle(e, ua.Private);
  }
}
class Iye extends D2 {
  actionName = re.GoCQHTTP_SendGroupForwardMsg;
  actionSummary = "发送群合并转发消息";
  actionTags = ["Go-CQHTTP"];
  payloadExample = {
    group_id: "123456789",
    messages: []
  };
  returnExample = {
    message_id: 123456
  };
  async _handle(e) {
    return this.base_handle(e, ua.Group);
  }
}
const tt = {
  GetStrangerInfo: {
    payload: { user_id: "123456789" },
    response: { user_id: 123456789, nickname: "昵称", sex: "unknown" }
  },
  GetGroupHonorInfo: {
    payload: { group_id: "123456", type: "all" },
    response: { group_id: 123456, current_talkative: {}, talkative_list: [] }
  },
  GetForwardMsg: {
    payload: { message_id: "123456" },
    response: { messages: [] }
  },
  GetGroupAtAllRemain: {
    payload: { group_id: "123456" },
    response: { can_at_all: !0, remain_at_all_count_for_group: 10, remain_at_all_count_for_self: 10 }
  },
  DeleteGroupFile: {
    payload: { group_id: "123456", file_id: "file_uuid_123" },
    response: {}
  },
  DeleteGroupFileFolder: {
    payload: { group_id: "123456", folder_id: "folder_uuid_123" },
    response: {}
  },
  DownloadFile: {
    payload: { url: "https://example.com/file.png", thread_count: 1, headers: "User-Agent: NapCat" },
    response: { file: "/path/to/downloaded/file" }
  },
  GetFriendMsgHistory: {
    payload: { user_id: "123456789", message_seq: 0, count: 20 },
    response: { messages: [] }
  },
  GetGroupFilesByFolder: {
    payload: { group_id: "123456", folder_id: "folder_id" },
    response: { files: [], folders: [] }
  },
  GetGroupFileSystemInfo: {
    payload: { group_id: "123456" },
    response: { file_count: 10, limit_count: 1e4, used_space: 1024, total_space: 10737418240 }
  },
  GetGroupMsgHistory: {
    payload: { group_id: "123456", message_seq: 0, count: 20 },
    response: { messages: [] }
  },
  GetGroupRootFiles: {
    payload: { group_id: "123456" },
    response: { files: [], folders: [] }
  },
  GetOnlineClient: {
    payload: { no_cache: !1 },
    response: []
  },
  GoCQHTTPCheckUrlSafely: {
    payload: { url: "https://example.com" },
    response: { level: 1 }
  },
  GoCQHTTPDeleteFriend: {
    payload: { user_id: "123456789" },
    response: {}
  },
  GoCQHTTPGetModelShow: {
    payload: { model: "iPhone 13" },
    response: { variants: [] }
  },
  GoCQHTTPSetModelShow: {
    payload: { model: "iPhone 13", model_show: "iPhone 13" },
    response: {}
  },
  QuickAction: {
    payload: { context: {}, operation: {} },
    response: {}
  },
  SendGroupNotice: {
    payload: { group_id: "123456", content: "公告内容", image: "base64://..." },
    response: {}
  },
  SetGroupPortrait: {
    payload: { group_id: "123456", file: "base64://..." },
    response: { result: 0, errMsg: "" }
  },
  SetQQProfile: {
    payload: { nickname: "新昵称", personal_note: "个性签名" },
    response: {}
  },
  UploadGroupFile: {
    payload: { group_id: "123456", file: "/path/to/file", name: "test.txt" },
    response: { file_id: "file_uuid_123" }
  },
  UploadPrivateFile: {
    payload: { user_id: "123456789", file: "/path/to/file", name: "test.txt" },
    response: { file_id: "file_uuid_123" }
  }
}, Cye = p.Object({
  user_id: p.String({ description: "用户QQ" }),
  no_cache: p.Union([p.Boolean(), p.String()], { default: !1, description: "是否不使用缓存" })
}), Tye = p.Object({
  user_id: p.Number({ description: "用户QQ" }),
  uid: p.String({ description: "UID" }),
  nickname: p.String({ description: "昵称" }),
  age: p.Number({ description: "年龄" }),
  qid: p.String({ description: "QID" }),
  qqLevel: p.Number({ description: "QQ等级" }),
  sex: p.String({ description: "性别" }),
  long_nick: p.String({ description: "个性签名" }),
  reg_time: p.Number({ description: "注册时间" }),
  is_vip: p.Boolean({ description: "是否VIP" }),
  is_years_vip: p.Boolean({ description: "是否年费VIP" }),
  vip_level: p.Number({ description: "VIP等级" }),
  remark: p.String({ description: "备注" }),
  status: p.Number({ description: "状态" }),
  login_days: p.Number({ description: "登录天数" })
}, { description: "陌生人信息" });
class kye extends le {
  actionName = re.GoCQHTTP_GetStrangerInfo;
  payloadSchema = Cye;
  returnSchema = Tye;
  actionSummary = "获取陌生人信息";
  actionDescription = "获取指定非好友用户的信息";
  actionTags = ["Go-CQHTTP"];
  payloadExample = tt.GetStrangerInfo.payload;
  returnExample = tt.GetStrangerInfo.response;
  async _handle(e) {
    const n = e.user_id.toString(), r = typeof e.no_cache == "string" ? e.no_cache === "true" : !!e.no_cache, i = await this.core.apis.UserApi.getUserDetailInfoByUin(n);
    let o = await this.core.apis.UserApi.getUidByUinV2(n);
    o || (o = i.detail.uid);
    const s = await this.core.apis.UserApi.getUserDetailInfo(o, r);
    return {
      ...i.detail.simpleInfo.coreInfo,
      ...i.detail.commonExt ?? {},
      ...i.detail.simpleInfo.baseInfo,
      ...i.detail.simpleInfo.relationFlags ?? {},
      ...i.detail.simpleInfo.status ?? {},
      user_id: parseInt(i.detail.uin) ?? 0,
      uid: s.uid ?? o,
      nickname: i.detail.simpleInfo.coreInfo.nick ?? "",
      age: i.detail.simpleInfo.baseInfo.age ?? s.age,
      qid: i.detail.simpleInfo.baseInfo.qid,
      qqLevel: $w(i.detail.commonExt?.qqLevel ?? s.qqLevel),
      sex: Ni.sex(i.detail.simpleInfo.baseInfo.sex) ?? Qs.unknown,
      long_nick: i.detail.simpleInfo.baseInfo.longNick ?? s.longNick,
      reg_time: i.detail.commonExt?.regTime ?? s.regTime,
      is_vip: i.detail.simpleInfo.vasInfo?.svipFlag ?? !1,
      is_years_vip: i.detail.simpleInfo.vasInfo?.yearVipFlag ?? !1,
      vip_level: i.detail.simpleInfo.vasInfo?.vipLevel ?? 0,
      remark: i.detail.simpleInfo.coreInfo.remark ?? s.remark ?? "",
      status: i.detail.simpleInfo.status?.status ?? s.status ?? 0,
      login_days: 0
      // 失效
    };
  }
}
const Nye = p.Object({
  user_id: p.String({ description: "对方 QQ 号" }),
  times: p.Union([p.Number(), p.String()], { default: 1, description: "点赞次数" })
});
class Pye extends le {
  actionName = re.SendLike;
  payloadSchema = Nye;
  returnSchema = p.Null();
  actionSummary = "点赞";
  actionDescription = "给指定用户点赞";
  actionTags = ["用户接口"];
  payloadExample = {
    user_id: "123456",
    times: 10
  };
  returnExample = {};
  errorExamples = [
    { code: 1400, description: "点赞失败（频率过快或用户不存在）" }
  ];
  async _handle(e) {
    const n = e.user_id.toString(), r = await this.core.apis.UserApi.getUidByUinV2(n) ?? "", i = await this.core.apis.UserApi.like(r, +e.times);
    if (i.result !== 0)
      throw new Error(`点赞失败 ${i.errMsg}`);
  }
}
const Dye = p.Object({
  flag: p.String({ description: "请求flag" }),
  approve: p.Optional(p.Union([p.Boolean(), p.String()], { description: "是否同意" })),
  reason: p.Optional(p.Union([p.String({ default: " " }), p.Null()], { description: "拒绝理由" })),
  count: p.Optional(p.Number({ default: 100, description: "搜索通知数量" }))
}), Fye = p.Null({ description: "操作结果" });
class Oye extends le {
  actionName = re.SetGroupAddRequest;
  payloadSchema = Dye;
  returnSchema = Fye;
  actionSummary = "处理加群请求";
  actionDescription = "同意或拒绝加群请求或邀请";
  actionTags = ["群组接口"];
  payloadExample = ht.SetGroupAddRequest.payload;
  returnExample = ht.SetGroupAddRequest.response;
  async _handle(e) {
    const n = e.flag.toString(), r = e.approve?.toString() !== "false", i = e.reason ?? " ", o = e.count, s = this.obContext.apis.MsgApi.notifyGroupInvite.get(n), { doubt: a, notify: c } = s ? {
      doubt: !1,
      notify: s
    } : await this.findNotify(n, o);
    if (!c)
      throw new Error("No such request");
    return await this.core.apis.GroupApi.handleGroupRequest(
      a,
      c,
      r ? zp.KAGREE : zp.KREFUSE,
      i
    ), null;
  }
  async findNotify(e, n = 100) {
    let r = (await this.core.apis.GroupApi.getSingleScreenNotifies(!1, n)).find((i) => i.seq === e);
    return r ? { doubt: !1, notify: r } : (r = (await this.core.apis.GroupApi.getSingleScreenNotifies(!0, n)).find((i) => i.seq === e), { doubt: !0, notify: r });
  }
}
const Mye = p.Object({
  group_id: p.String({ description: "群号" }),
  is_dismiss: p.Optional(p.Union([p.Boolean(), p.String()], { description: "是否解散" }))
}), Rye = p.Null({ description: "操作结果" });
class Bye extends le {
  actionName = re.SetGroupLeave;
  payloadSchema = Mye;
  returnSchema = Rye;
  actionSummary = "退出群组";
  actionDescription = "退出或解散指定群聊";
  actionTags = ["群组接口"];
  payloadExample = ht.SetGroupLeave.payload;
  returnExample = ht.SetGroupLeave.response;
  async _handle(e) {
    return await this.core.apis.GroupApi.quitGroup(e.group_id.toString()), null;
  }
}
const Uye = p.Object({
  flag: p.String({ description: "加好友请求的 flag (需从上报中获取)" }),
  approve: p.Optional(p.Union([p.String(), p.Boolean()], { description: "是否同意请求" })),
  remark: p.Optional(p.String({ description: "添加后的好友备注" }))
});
class Lye extends le {
  actionName = re.SetFriendAddRequest;
  payloadSchema = Uye;
  returnSchema = p.Null();
  actionSummary = "处理加好友请求";
  actionDescription = "同意或拒绝加好友请求";
  actionTags = ["用户接口"];
  payloadExample = {
    flag: "flag_12345",
    approve: !0,
    remark: "新朋友"
  };
  returnExample = {};
  async _handle(e) {
    const n = e.approve?.toString() !== "false", r = (await this.core.apis.FriendApi.getBuddyReq()).buddyReqs.find((i) => i.reqTime === e.flag.toString());
    if (!r)
      throw new Error("No such request");
    await this.core.apis.FriendApi.handleFriendRequest(r, n), e.remark && await this.core.apis.FriendApi.setBuddyRemark(r.friendUid, e.remark);
  }
}
const jye = p.Object({
  group_id: p.String({ description: "群号" }),
  enable: p.Optional(p.Union([p.Boolean(), p.String()], { description: "是否开启全员禁言" }))
}), Qye = p.Null({ description: "操作结果" });
class $ye extends le {
  actionName = re.SetGroupWholeBan;
  payloadSchema = jye;
  returnSchema = Qye;
  actionSummary = "全员禁言";
  actionDescription = "开启或关闭指定群聊的全员禁言";
  actionTags = ["群组接口"];
  payloadExample = ht.SetGroupWholeBan.payload;
  returnExample = ht.SetGroupWholeBan.response;
  async _handle(e) {
    const n = e.enable?.toString() !== "false", r = await this.core.apis.GroupApi.banGroup(e.group_id.toString(), n);
    if (r.result !== 0)
      throw new Error(`SetGroupWholeBan failed: ${r.errMsg} ${r.result}`);
    return null;
  }
}
const Gye = p.Object({
  group_id: p.String({ description: "群号" }),
  group_name: p.String({ description: "群名称" })
}), qye = p.Null({ description: "操作结果" });
class Hye extends le {
  actionName = re.SetGroupName;
  payloadSchema = Gye;
  returnSchema = qye;
  actionSummary = "设置群名称";
  actionDescription = "修改指定群聊的名称";
  actionTags = ["群组接口"];
  payloadExample = ht.SetGroupName.payload;
  returnExample = ht.SetGroupName.response;
  async _handle(e) {
    let n = await this.core.apis.GroupApi.setGroupName(e.group_id.toString(), e.group_name);
    if (n.result.toString() === "1287" && (n = await this.core.apis.GroupApi.setGroupName(e.group_id.toString(), e.group_name, !0)), n.result !== 0)
      throw new Error(`设置群名称失败 ErrCode: ${n.result} ErrMsg: ${n.errMsg}`);
    return null;
  }
}
const Wye = p.Object({
  group_id: p.String({ description: "群号" }),
  user_id: p.String({ description: "用户QQ" }),
  duration: p.Union([p.Number(), p.String()], { default: 0, description: "禁言时长(秒)" })
}), zye = p.Null({ description: "操作结果" });
class Kye extends le {
  actionName = re.SetGroupBan;
  payloadSchema = Wye;
  returnSchema = zye;
  actionSummary = "群组禁言";
  actionDescription = "禁言群聊中的指定成员";
  actionTags = ["群组接口"];
  payloadExample = ht.SetGroupBan.payload;
  returnExample = ht.SetGroupBan.response;
  async _handle(e) {
    const n = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString());
    if (!n) throw new Error("uid error");
    const r = (await this.core.apis.GroupApi.getGroupMemberEx(e.group_id.toString(), n, !0))?.role;
    if (r === void 0) throw new Error("user not in group");
    if (r === iu.KOWNER) throw new Error("cannot ban owner");
    if (r === iu.KADMIN) {
      const o = (await this.core.apis.GroupApi.getGroupMemberEx(e.group_id.toString(), this.core.selfInfo.uid, !0))?.role;
      if (o === void 0) throw new Error("failed to fetch bot role");
      if (o !== iu.KOWNER) throw new Error("cannot ban admin");
    }
    const i = await this.core.apis.GroupApi.banMember(
      e.group_id.toString(),
      [{ uid: n, timeStamp: +e.duration }]
    );
    if (i.result !== 0) throw new Error(i.errMsg);
    return null;
  }
}
const Vye = p.Object({
  group_id: p.String({ description: "群号" }),
  user_id: p.String({ description: "用户QQ" }),
  reject_add_request: p.Optional(p.Union([p.Boolean(), p.String()], { description: "是否拒绝加群请求" }))
}), Yye = p.Null({ description: "操作结果" });
class Jye extends le {
  actionName = re.SetGroupKick;
  payloadSchema = Vye;
  returnSchema = Yye;
  actionSummary = "群组踢人";
  actionDescription = "将指定成员踢出群聊";
  actionTags = ["群组接口"];
  payloadExample = ht.SetGroupKick.payload;
  returnExample = ht.SetGroupKick.response;
  async _handle(e) {
    const n = e.reject_add_request?.toString() === "true", r = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString());
    if (!r) throw new Error("get Uid Error");
    return await this.core.apis.GroupApi.kickMember(e.group_id.toString(), [r], n), null;
  }
}
const Xye = p.Object({
  group_id: p.String({ description: "群号" }),
  user_id: p.String({ description: "用户QQ" }),
  enable: p.Optional(p.Union([p.Boolean(), p.String()], { description: "是否设置为管理员" }))
}), Zye = p.Null({ description: "操作结果" });
class e1e extends le {
  actionName = re.SetGroupAdmin;
  payloadSchema = Xye;
  returnSchema = Zye;
  actionSummary = "设置群管理员";
  actionDescription = "设置或取消群聊中的管理员";
  actionTags = ["群组接口"];
  payloadExample = ht.SetGroupAdmin.payload;
  returnExample = ht.SetGroupAdmin.response;
  async _handle(e) {
    const n = typeof e.enable == "string" ? e.enable === "true" : !!e.enable, r = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString());
    if (!r) throw new Error("get Uid Error");
    return await this.core.apis.GroupApi.setMemberRole(e.group_id.toString(), r, n ? iu.KADMIN : iu.KMEMBER), null;
  }
}
const t1e = p.Object({
  group_id: p.String({ description: "群号" }),
  user_id: p.String({ description: "用户QQ" }),
  card: p.Optional(p.String({ description: "群名片" }))
}), n1e = p.Null({ description: "操作结果" });
class r1e extends le {
  actionName = re.SetGroupCard;
  payloadSchema = t1e;
  returnSchema = n1e;
  actionSummary = "设置群名片";
  actionDescription = "设置群聊中指定成员的群名片";
  actionTags = ["群组接口"];
  payloadExample = ht.SetGroupCard.payload;
  returnExample = ht.SetGroupCard.response;
  async _handle(e) {
    const n = e.group_id.toString(), r = e.user_id.toString(), i = e.card || "", o = await this.core.apis.GroupApi.getGroupMember(n, r);
    if (!o)
      throw new Error(`群(${n})成员${r}不存在`);
    await this.core.apis.GroupApi.setMemberCard(n, o.uid, i);
    for (let s = 0; s < 3; s++)
      if (await Kp(1e3), (await this.core.apis.GroupApi.refreshGroupMemberCachePartial(n, o.uid))?.cardName === i)
        return null;
    throw new Error("设置群名片未生效");
  }
}
const Ro = {
  GetFile: {
    payload: { file: "file_id_123" },
    response: { file: "/path/to/file", url: "http://...", file_size: 1024, file_name: "test.jpg" }
  },
  GetGroupFileUrl: {
    payload: { group_id: "123456", file_id: "file_id_123", busid: 102 },
    response: { url: "http://..." }
  },
  GetImage: {
    payload: { file: "image_id_123" },
    response: { file: "/path/to/image", url: "http://..." }
  },
  GetPrivateFileUrl: {
    payload: { user_id: "123456789", file_id: "file_id_123" },
    response: { url: "http://..." }
  },
  GetRecord: {
    payload: { file: "record_id_123", out_format: "mp3" },
    response: { file: "/path/to/record", url: "http://..." }
  }
}, i1e = p.Object({
  file: p.Optional(p.String({ description: "文件路径、URL或Base64" })),
  file_id: p.Optional(p.String({ description: "文件ID" }))
}), o1e = p.Object({
  file: p.Optional(p.String({ description: "本地路径" })),
  url: p.Optional(p.String({ description: "下载URL" })),
  file_size: p.Optional(p.String({ description: "文件大小" })),
  file_name: p.Optional(p.String({ description: "文件名" })),
  base64: p.Optional(p.String({ description: "Base64编码" }))
}, { description: "文件信息" });
class F2 extends le {
  payloadSchema = i1e;
  returnSchema = o1e;
  actionTags = ["文件接口"];
  async _handle(e) {
    e.file ||= e.file_id || "";
    const n = Jt.decode(e.file);
    if (n && n.msgId && n.elementId) {
      const { peer: o, msgId: s, elementId: a } = n, c = await this.core.apis.FileApi.downloadMedia(s, o.chatType, o.peerUid, a, "", ""), u = (await this.core.apis.MsgApi.getMsgsByMsgId(o, [s]))?.msgList.find((x) => x.msgId === s), l = u?.elements.find((x) => x.elementId === a), d = l?.videoElement ?? l?.fileElement ?? l?.pttElement ?? l?.picElement;
      if (!d) throw new Error("element not found");
      const f = d.fileSize?.toString() ?? "", m = d.fileName ?? "";
      let h = "";
      l?.picElement && u && (h = (await this.obContext.apis.MsgApi.rawToOb11Converters.picElement?.(l?.picElement, u, l, { parseMultMsg: !1, disableGetUrl: !1, quick_reply: !0 }))?.data.url ?? ""), l?.videoElement && u && (h = (await this.obContext.apis.MsgApi.rawToOb11Converters.videoElement?.(l?.videoElement, u, l, { parseMultMsg: !1, disableGetUrl: !1, quick_reply: !0 }))?.data.url ?? "");
      const y = {
        file: c,
        url: h !== "" ? h : c,
        file_size: f,
        file_name: m
      };
      if (this.obContext.configLoader.configData.enableLocalFile2Url && c)
        try {
          y.base64 = await Ot.readFile(c, "base64");
        } catch (x) {
          throw new Error("文件下载失败. " + x);
        }
      return y;
    }
    const r = Jt.decodeModelId(e.file);
    if (r && r.modelId) {
      const { peer: o, modelId: s } = r, a = await this.core.apis.FileApi.downloadFileForModelId(o, s, ""), c = {
        file: a,
        url: a,
        file_size: "",
        file_name: ""
      };
      if (this.obContext.configLoader.configData.enableLocalFile2Url && a)
        try {
          c.base64 = await Ot.readFile(a, "base64");
        } catch (u) {
          throw new Error("文件下载失败. " + u);
        }
      return c;
    }
    const i = await this.core.apis.FileApi.searchForFile([e.file]);
    if (i) {
      const o = parseInt(i.fileSize), s = this.obContext.configLoader.configData.timeout, a = TA(s, o, s.downloadSpeedKBps), c = await this.core.apis.FileApi.downloadFileById(i.id, o, a), u = {
        file: c,
        url: c,
        file_size: i.fileSize.toString(),
        file_name: i.fileName
      };
      if (this.obContext.configLoader.configData.enableLocalFile2Url && c)
        try {
          u.base64 = await Ot.readFile(c, "base64");
        } catch (l) {
          throw new Error("文件下载失败. " + l);
        }
      return u;
    }
    throw new Error("file not found");
  }
}
class s1e extends F2 {
  actionName = re.GetFile;
  actionSummary = "获取文件";
  actionDescription = "获取指定文件的详细信息及下载路径";
  actionTags = ["文件接口"];
  payloadExample = Ro.GetFile.payload;
  returnExample = Ro.GetFile.response;
}
class a1e extends F2 {
  actionName = re.GetImage;
  actionSummary = "获取图片";
  actionDescription = "获取指定图片的信息及路径";
  actionTags = ["文件接口"];
  payloadExample = Ro.GetImage.payload;
  returnExample = Ro.GetImage.response;
}
const c1e = ["mp3", "amr", "wma", "m4a", "spx", "ogg", "wav", "flac"], u1e = p.Object({
  file: p.Optional(p.String({ description: "文件路径、URL或Base64" })),
  file_id: p.Optional(p.String({ description: "文件ID" })),
  out_format: p.String({ description: "输出格式" })
});
class l1e extends F2 {
  actionName = re.GetRecord;
  payloadSchema = u1e;
  actionSummary = "获取语音";
  actionDescription = "获取指定语音文件的信息，并支持格式转换";
  actionTags = ["文件接口"];
  payloadExample = Ro.GetRecord.payload;
  returnExample = Ro.GetRecord.response;
  async _handle(e) {
    const n = await super._handle(e);
    if (e.out_format && typeof e.out_format == "string") {
      const r = n.file;
      if (!r) throw new Error("file not found");
      if (!c1e.includes(e.out_format))
        throw new Error("转换失败 out_format 字段可能格式不正确");
      const i = `${r}.${e.out_format}`;
      try {
        await $s.access(r);
        try {
          await $s.access(i);
        } catch {
          await ns.convertAudioFmt(r, i, e.out_format);
        }
        const o = await $s.readFile(i, { encoding: "base64" });
        n.file = i, n.url = i, n.base64 = o;
      } catch (o) {
        throw console.error("Error processing file:", o), o;
      }
    }
    return n;
  }
}
const O2 = p.Object({
  user_id: p.Optional(p.Union([p.String(), p.Number()], { description: "用户QQ" })),
  group_id: p.Optional(p.String({ description: "群号" })),
  message_id: p.Optional(p.String({ description: "消息ID" }))
}), M2 = p.Null({ description: "操作结果" });
class R2 extends le {
  actionSummary = "标记消息已读";
  actionDescription = "标记指定渠道的消息为已读";
  actionTags = ["消息接口"];
  payloadExample = {
    message_id: 12345
  };
  returnExample = null;
  async getPeer(e) {
    if (e.message_id) {
      const n = rt.getMsgIdAndPeerByShortId(+e.message_id)?.Peer;
      if (n)
        return n;
      const r = rt.getPeerByMsgId(e.message_id.toString())?.Peer;
      if (r)
        return r;
    }
    if (e.user_id) {
      const n = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString());
      if (!n)
        throw new Error(`私聊${e.user_id}不存在`);
      return { chatType: await this.core.apis.FriendApi.isBuddy(n) ? Ne.KCHATTYPEC2C : Ne.KCHATTYPETEMPC2CFROMGROUP, peerUid: n };
    }
    if (!e.group_id)
      throw new Error("缺少参数 group_id 或 user_id");
    return { chatType: Ne.KCHATTYPEGROUP, peerUid: e.group_id.toString() };
  }
  async _handle(e) {
    const n = await this.core.apis.MsgApi.setMsgRead(await this.getPeer(e));
    if (n.result !== 0)
      throw new Error("设置已读失败," + n.errMsg);
    return null;
  }
}
class p1e extends R2 {
  payloadSchema = O2;
  returnSchema = M2;
  actionName = re.MarkPrivateMsgAsRead;
  actionSummary = "标记私聊已读";
}
class d1e extends R2 {
  payloadSchema = O2;
  returnSchema = M2;
  actionName = re.MarkGroupMsgAsRead;
  actionSummary = "标记群聊已读";
}
class f1e extends R2 {
  payloadSchema = O2;
  returnSchema = M2;
  actionName = re.GoCQHTTP_MarkMsgAsRead;
  actionSummary = "标记消息已读 (Go-CQHTTP)";
}
class h1e extends le {
  actionName = re._MarkAllMsgAsRead;
  actionSummary = "标记所有消息已读";
  actionTags = ["消息接口"];
  payloadExample = {};
  returnExample = null;
  async _handle() {
    return await this.core.apis.MsgApi.markAllMsgAsRead(), null;
  }
}
const m1e = p.Object({
  group_id: p.String({ description: "群号" }),
  file: p.String({ description: "资源路径或URL" }),
  name: p.String({ description: "文件名" }),
  folder: p.Optional(p.String({ description: "父目录 ID" })),
  folder_id: p.Optional(p.String({ description: "父目录 ID (兼容性字段)" })),
  // 临时扩展
  upload_file: p.Boolean({ default: !0, description: "是否执行上传" })
}), g1e = p.Object({
  file_id: p.Union([p.String(), p.Null()], { description: "文件 ID" })
});
class y1e extends le {
  actionName = re.GoCQHTTP_UploadGroupFile;
  payloadSchema = m1e;
  returnSchema = g1e;
  actionSummary = "上传群文件";
  actionDescription = "上传资源路径或URL指定的文件到指定群聊的文件系统中";
  actionTags = ["Go-CQHTTP"];
  payloadExample = tt.UploadGroupFile.payload;
  returnExample = tt.UploadGroupFile.response;
  async _handle(e) {
    let n = e.file;
    de.existsSync(n) && (n = `file://${n}`);
    const r = await Ji(this.core.NapCatTempPath, n), i = {
      chatType: Ne.KCHATTYPEGROUP,
      peerUid: e.group_id.toString()
    };
    if (!r.success)
      throw new Error(r.errMsg);
    const o = {
      peer: i,
      deleteAfterSentFiles: []
    }, s = await this.obContext.apis.FileApi.createValidSendFileElement(o, r.path, e.name, e.folder ?? e.folder_id, e.upload_file, r.isLocal);
    return r.isLocal || o.deleteAfterSentFiles.push(r.path), {
      file_id: (await this.obContext.apis.MsgApi.sendMsgWithOb11UniqueId(i, [s], o.deleteAfterSentFiles)).elements.find((u) => u.elementType === _e.FILE)?.fileElement?.fileUuid || null
    };
  }
}
const xr = {
  OCRImage: {
    payload: { image: "image_id_123" },
    response: { texts: [{ text: "识别内容", coordinates: [] }] }
  },
  GetAiCharacters: {
    payload: { group_id: "123456" },
    response: [
      {
        type: "string",
        characters: [
          { character_id: "id", character_name: "name", preview_url: "url" }
        ]
      }
    ]
  },
  GetClientkey: {
    payload: {},
    response: { clientkey: "abcdef123456" }
  },
  SetQQAvatar: {
    payload: { file: "base64://..." },
    response: null
  },
  SetGroupKickMembers: {
    payload: { group_id: "123456", user_id: ["123456789"], reject_add_request: !1 },
    response: null
  },
  TranslateEnWordToZn: {
    payload: { words: ["hello"] },
    response: { words: ["你好"] }
  },
  SetLongNick: {
    payload: { longNick: "个性签名" },
    response: null
  },
  SetSpecialTitle: {
    payload: { group_id: "123456", user_id: "123456789", special_title: "头衔" },
    response: null
  }
}, v1e = p.Object({
  file: p.String({ description: "图片路径、URL或Base64" })
}), b1e = p.Null({ description: "设置结果" });
class x1e extends le {
  actionName = re.SetQQAvatar;
  payloadSchema = v1e;
  returnSchema = b1e;
  actionSummary = "设置QQ头像";
  actionDescription = "修改当前账号的QQ头像";
  actionTags = ["扩展接口"];
  payloadExample = xr.SetQQAvatar.payload;
  returnExample = xr.SetQQAvatar.response;
  async _handle(e) {
    const { path: n, success: r, isLocal: i } = await Ji(this.core.NapCatTempPath, e.file);
    if (!r)
      throw new Error(`头像${e.file}设置失败,file字段可能格式不正确`);
    if (n) {
      await hE(n, 5e3);
      const o = await this.core.apis.UserApi.setQQAvatar(n);
      if (i || Un.unlink(n).catch(() => {
      }), !o)
        throw new Error(`头像${e.file}设置失败,api无返回`);
      if (Number(o.result) === 1004022)
        throw new Error(`头像${e.file}设置失败，文件可能不是图片格式`);
      if (o.result !== 0)
        throw new Error(`头像${e.file}设置失败,未知的错误,${o.result}:${o.errMsg}`);
    } else
      throw new Error(`头像${e.file}设置失败,无法获取头像,文件可能不存在`);
    return null;
  }
}
const w1e = p.Object({
  url: p.Optional(p.String({ description: "下载链接" })),
  base64: p.Optional(p.String({ description: "base64数据" })),
  name: p.Optional(p.String({ description: "文件名" })),
  headers: p.Optional(p.Union([p.String(), p.Array(p.String())], { description: "请求头" }))
}), S1e = p.Object({
  file: p.String({ description: "文件路径" })
}, { description: "下载结果" });
class _1e extends le {
  actionName = re.GoCQHTTP_DownloadFile;
  payloadSchema = w1e;
  returnSchema = S1e;
  actionSummary = "下载文件";
  actionDescription = "下载网络文件到本地临时目录";
  actionTags = ["Go-CQHTTP"];
  payloadExample = tt.DownloadFile.payload;
  returnExample = tt.DownloadFile.response;
  async _handle(e) {
    const n = !e.name, r = e.name || Do();
    let i;
    if (e.base64)
      i = await Ji(this.core.NapCatTempPath, `base64://${e.base64}`, r);
    else if (e.url) {
      const s = this.getHeaders(e.headers);
      i = await Ji(this.core.NapCatTempPath, e.url, r, s);
    } else
      throw new Error("不存在任何文件, 无法下载");
    if (!i.success)
      throw new Error(i.errMsg);
    const o = i.path;
    if (de.existsSync(o)) {
      if (n) {
        const s = await Lg(o), a = yn(this.core.NapCatTempPath, s);
        return de.renameSync(o, a), { file: a };
      }
      return { file: o };
    } else
      throw new Error("文件写入失败, 检查权限");
  }
  getHeaders(e) {
    const n = {};
    if (typeof e == "string" && (e = e.split("[\\r\\n]")), Array.isArray(e))
      for (const r of e) {
        const i = r.indexOf("=");
        if (i < 0)
          n[r] = "";
        else {
          const o = r.substring(0, i);
          n[o] = r.substring(i + 1);
        }
      }
    return n["Content-Type"] || (n["Content-Type"] = "application/octet-stream"), n;
  }
}
const E1e = p.Object({
  group_id: p.String({ description: "群号" }),
  message_seq: p.Optional(p.String({ description: "起始消息序号" })),
  count: p.Number({ default: 20, description: "获取消息数量" }),
  reverse_order: p.Boolean({ default: !1, description: "是否反向排序" }),
  disable_get_url: p.Boolean({ default: !1, description: "是否禁用获取URL" }),
  parse_mult_msg: p.Boolean({ default: !0, description: "是否解析合并消息" }),
  quick_reply: p.Boolean({ default: !1, description: "是否快速回复" }),
  reverseOrder: p.Boolean({ default: !1, description: "是否反向排序(旧版本兼容)" })
}), A1e = p.Object({
  messages: p.Array(p.Any(), { description: "消息列表" })
}, { description: "群历史消息" });
class I1e extends le {
  actionName = re.GoCQHTTP_GetGroupMsgHistory;
  payloadSchema = E1e;
  returnSchema = A1e;
  actionSummary = "获取群历史消息";
  actionDescription = "获取指定群聊的历史聊天记录";
  actionTags = ["Go-CQHTTP"];
  payloadExample = tt.GetGroupMsgHistory.payload;
  returnExample = tt.GetGroupMsgHistory.response;
  async _handle(e, n, r) {
    const i = { chatType: Ne.KCHATTYPEGROUP, peerUid: e.group_id.toString() }, o = e.message_seq ? !(e.message_seq?.toString() === "" || e.message_seq?.toString() === "0") : !!e.message_seq, s = o ? rt.getMsgIdAndPeerByShortId(+e.message_seq)?.MsgId ?? e.message_seq.toString() : "0", a = o ? (await this.core.apis.MsgApi.getMsgHistory(i, s, +e.count, e.reverse_order || e.reverseOrder)).msgList : (await this.core.apis.MsgApi.getAioFirstViewLatestMsgs(i, +e.count)).msgList;
    if (a.length === 0) throw new Error(`消息${e.message_seq}不存在`);
    return await Promise.all(a.map(async (u) => {
      u.id = rt.createUniqueMsgId({ guildId: "", chatType: u.chatType, peerUid: u.peerUid }, u.msgId);
    })), { messages: (await Promise.all(
      a.map((u) => this.obContext.apis.MsgApi.parseMessage(u, r.messagePostFormat, e.parse_mult_msg, e.disable_get_url, e.quick_reply))
    )).filter((u) => u !== void 0) };
  }
}
const C1e = p.Object({
  message_id: p.Optional(p.String({ description: "消息ID" })),
  id: p.Optional(p.String({ description: "消息ID" }))
}), T1e = p.Object({
  messages: p.Optional(p.Array(p.Unknown(), { description: "消息列表" }))
}, { description: "合并转发消息" });
function Ew(t) {
  return typeof t != "string" && t.type === ze.forward;
}
class k1e extends le {
  actionName = re.GoCQHTTP_GetForwardMsg;
  payloadSchema = C1e;
  returnSchema = T1e;
  actionSummary = "获取合并转发消息";
  actionDescription = "获取合并转发消息的具体内容";
  actionTags = ["Go-CQHTTP"];
  payloadExample = tt.GetForwardMsg.payload;
  returnExample = tt.GetForwardMsg.response;
  createTemplateNode(e) {
    return {
      type: ze.node,
      data: {
        user_id: e.user_id,
        nickname: e.sender.nickname,
        message: [],
        content: []
      }
    };
  }
  async parseForward(e) {
    const n = [];
    for (const r of e) {
      const i = this.createTemplateNode(r);
      for (const o of r.message)
        if (Ew(o)) {
          const s = this.createTemplateNode(r);
          s.data.message = await this.parseForward(o.data.content ?? []), i.data.message.push(s);
        } else if (typeof o == "string") {
          const s = { type: ze.text, data: { text: o } };
          i.data.message.push(s);
        } else
          i.data.message.push(o);
      n.push(i);
    }
    return n;
  }
  async _handle(e) {
    const n = e.message_id || e.id;
    if (!n)
      throw new Error("message_id is required");
    const r = (a) => ({
      chatType: Ne.KCHATTYPEGROUP,
      elements: [{
        elementType: _e.MULTIFORWARD,
        elementId: "",
        multiForwardMsgElement: {
          resId: a,
          fileName: "",
          xmlContent: ""
        }
      }],
      guildId: "",
      isOnlineMsg: !1,
      msgId: "",
      // TODO: no necessary
      msgRandom: "0",
      msgSeq: "",
      msgTime: "",
      msgType: Gs.KMSGTYPEMIX,
      parentMsgIdList: [],
      parentMsgPeer: {
        chatType: Ne.KCHATTYPEGROUP,
        peerUid: ""
      },
      peerName: "",
      peerUid: "284840486",
      peerUin: "284840486",
      recallTime: "0",
      records: [],
      sendNickName: "",
      sendRemarkName: "",
      senderUid: "",
      senderUin: "1094950020",
      sourceType: iE.K_DOWN_SOURCETYPE_UNKNOWN,
      subMsgType: 1
    }), i = async (a) => {
      const u = (await this.obContext.apis.MsgApi.parseMessageV2(r(a), !0))?.arrayMsg?.message?.[0];
      if (u && Ew(u))
        return {
          messages: u.data.content
        };
      throw new Error("protocolFallbackLogic: 找不到相关的聊天记录");
    };
    if (!C6(n)) {
      const a = await i(n);
      if (a.messages)
        return a;
      throw new Error("ResId无效: 找不到相关的聊天记录");
    }
    const o = rt.getShortIdByMsgId(n.toString()), s = rt.getMsgIdAndPeerByShortId(o ?? +n);
    if (s) {
      const a = await this.core.apis.MsgApi.getMsgHistory(s.Peer, s.MsgId, 1);
      if (a && a.result === 0 && a.msgList.length > 0) {
        const c = a.msgList[0];
        if (!c)
          throw new Error("消息不存在或已过期");
        const l = (await this.obContext.apis.MsgApi.parseMessage(c, "array", !0))?.message?.[0];
        if (l && Ew(l)) {
          const d = l.data.content;
          if (d)
            return { messages: d };
        }
      }
    }
    throw new Error("消息已过期或者为内层消息，无法获取转发消息");
  }
}
const N1e = p.Object({
  user_id: p.String({ description: "用户QQ" }),
  message_seq: p.Optional(p.String({ description: "起始消息序号" })),
  count: p.Number({ default: 20, description: "获取消息数量" }),
  reverse_order: p.Boolean({ default: !1, description: "是否反向排序" }),
  disable_get_url: p.Boolean({ default: !1, description: "是否禁用获取URL" }),
  parse_mult_msg: p.Boolean({ default: !0, description: "是否解析合并消息" }),
  quick_reply: p.Boolean({ default: !1, description: "是否快速回复" }),
  reverseOrder: p.Boolean({ default: !1, description: "是否反向排序(旧版本兼容)" })
}), P1e = p.Object({
  messages: p.Array(p.Any(), { description: "消息列表" })
}, { description: "好友历史消息" });
class D1e extends le {
  actionName = re.GetFriendMsgHistory;
  payloadSchema = N1e;
  returnSchema = P1e;
  actionSummary = "获取好友历史消息";
  actionDescription = "获取指定好友的历史聊天记录";
  actionTags = ["Go-CQHTTP"];
  payloadExample = tt.GetFriendMsgHistory.payload;
  returnExample = tt.GetFriendMsgHistory.response;
  async _handle(e, n, r) {
    const i = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString());
    if (!i) throw new Error(`记录${e.user_id}不存在`);
    const s = { chatType: await this.core.apis.FriendApi.isBuddy(i) ? Ne.KCHATTYPEC2C : Ne.KCHATTYPETEMPC2CFROMGROUP, peerUid: i }, a = e.message_seq ? !(e.message_seq?.toString() === "" || e.message_seq?.toString() === "0") : !!e.message_seq, c = a ? rt.getMsgIdAndPeerByShortId(+e.message_seq)?.MsgId ?? e.message_seq.toString() : "0", u = a ? (await this.core.apis.MsgApi.getMsgHistory(s, c, +e.count, e.reverse_order || e.reverseOrder)).msgList : (await this.core.apis.MsgApi.getAioFirstViewLatestMsgs(s, +e.count)).msgList;
    if (u.length === 0) throw new Error(`消息${e.message_seq}不存在`);
    return await Promise.all(u.map(async (d) => {
      d.id = rt.createUniqueMsgId({ guildId: "", chatType: d.chatType, peerUid: d.peerUid }, d.msgId);
    })), { messages: (await Promise.all(
      u.map((d) => this.obContext.apis.MsgApi.parseMessage(d, r.messagePostFormat, e.parse_mult_msg, e.disable_get_url))
    )).filter((d) => d !== void 0) };
  }
}
const F1e = p.Object({
  domain: p.String({ description: "需要获取 cookies 的域名" })
}), O1e = p.Object({
  cookies: p.String({ description: "Cookies" }),
  bkn: p.String({ description: "CSRF Token" })
});
class M1e extends le {
  actionName = re.GetCookies;
  payloadSchema = F1e;
  returnSchema = O1e;
  actionSummary = "获取 Cookies";
  actionDescription = "获取指定域名的 Cookies";
  actionTags = ["用户接口"];
  payloadExample = {
    domain: "qun.qq.com"
  };
  returnExample = {
    cookies: "uin=o123456789; skey=@abc12345;",
    bkn: "123456789"
  };
  async _handle(e) {
    const n = await this.core.apis.UserApi.getCookies(e.domain), r = Object.entries(n).map(([o, s]) => `${o}=${s}`).join("; ");
    let i = "";
    return e.domain.includes("qzone.qq.com") ? n?.p_skey ? i = this.core.apis.WebApi.getBknFromPSKey(n.p_skey) : i = n?.skey ? this.core.apis.WebApi.getBknFromCookie(n) : "" : i = n?.skey ? this.core.apis.WebApi.getBknFromCookie(n) : "", { cookies: r, bkn: i };
  }
}
const R1e = p.Object({
  message_id: p.Union([p.Number(), p.String()], { description: "消息ID" }),
  emoji_id: p.Union([p.Number(), p.String()], { description: "表情ID" }),
  set: p.Optional(p.Union([p.Boolean(), p.String()], { description: "是否设置" }))
}), B1e = p.Any({ description: "操作结果" });
class U1e extends le {
  actionName = re.SetMsgEmojiLike;
  actionSummary = "设置消息表情点赞";
  actionTags = ["消息扩展"];
  payloadExample = {
    message_id: 12345,
    emoji_id: "123",
    set: !0
  };
  returnExample = {
    result: !0
  };
  payloadSchema = R1e;
  returnSchema = B1e;
  async _handle(e) {
    const n = rt.getMsgIdAndPeerByShortId(+e.message_id);
    if (!n)
      throw new Error("msg not found");
    if (!e.emoji_id)
      throw new Error("emojiId not found");
    e.set = e.set ?? !0;
    const r = (await this.core.apis.MsgApi.getMsgsByMsgId(n.Peer, [n.MsgId])).msgList;
    if (!r || r.length === 0 || !r[0]?.msgSeq)
      throw new Error("find msg by msgid error");
    return await this.core.apis.MsgApi.setEmojiLike(
      n.Peer,
      r[0].msgSeq,
      e.emoji_id.toString(),
      typeof e.set == "string" ? e.set === "true" : !!e.set
    );
  }
}
const L1e = p.Array(p.Any(), { description: "机器人Uin范围列表" });
class j1e extends le {
  actionName = re.GetRobotUinRange;
  actionSummary = "获取机器人 UIN 范围";
  actionTags = ["系统扩展"];
  payloadExample = {};
  returnExample = [
    { minUin: "12345678", maxUin: "87654321" }
  ];
  payloadSchema = p.Object({});
  returnSchema = L1e;
  async _handle() {
    return await this.core.apis.UserApi.getRobotUinRange();
  }
}
const Q1e = p.Object({
  status: p.Union([p.Number(), p.String()], { description: "在线状态" }),
  ext_status: p.Union([p.Number(), p.String()], { description: "扩展状态" }),
  battery_status: p.Union([p.Number(), p.String()], { description: "电量状态" })
}), $1e = p.Null({ description: "设置结果" });
class G1e extends le {
  actionName = re.SetOnlineStatus;
  payloadSchema = Q1e;
  returnSchema = $1e;
  actionSummary = "设置在线状态";
  actionDescription = q1e;
  actionTags = ["系统扩展"];
  payloadExample = {
    status: 11,
    ext_status: 0,
    battery_status: 100
  };
  returnExample = null;
  async _handle(e) {
    if ((await this.core.apis.UserApi.setSelfOnlineStatus(
      +e.status,
      +e.ext_status,
      +e.battery_status
    )).result !== 0)
      throw new Error("设置在线状态失败");
    return null;
  }
}
const q1e = '\n## 状态列表\n\n### 在线\n```json5;\n{ "status": 10, "ext_status": 0, "battery_status": 0; }\n```\n\n### Q我吧\n```json5;\n{ "status": 60, "ext_status": 0, "battery_status": 0; }\n```\n\n### 离开\n```json5;\n{ "status": 30, "ext_status": 0, "battery_status": 0; }\n```\n\n### 忙碌\n```json5;\n{ "status": 50, "ext_status": 0, "battery_status": 0; }\n```\n\n### 请勿打扰\n```json5;\n{ "status": 70, "ext_status": 0, "battery_status": 0; }\n```\n\n### 隐身\n```json5;\n{ "status": 40, "ext_status": 0, "battery_status": 0; }\n```\n\n### 听歌中\n```json5;\n{ "status": 10, "ext_status": 1028, "battery_status": 0; }\n```\n\n### 春日限定\n```json5;\n{ "status": 10, "ext_status": 2037, "battery_status": 0; }\n```\n\n### 一起元梦\n```json5;\n{ "status": 10, "ext_status": 2025, "battery_status": 0; }\n```\n\n### 求星搭子\n```json5;\n{ "status": 10, "ext_status": 2026, "battery_status": 0; }\n```\n\n### 被掏空\n```json5;\n{ "status": 10, "ext_status": 2014, "battery_status": 0; }\n```\n\n### 今日天气\n```json5;\n{ "status": 10, "ext_status": 1030, "battery_status": 0; }\n```\n\n### 我crash了\n```json5;\n{ "status": 10, "ext_status": 2019, "battery_status": 0; }\n```\n\n### 爱你\n```json5;\n{ "status": 10, "ext_status": 2006, "battery_status": 0; }\n```\n\n### 恋爱中\n```json5;\n{ "status": 10, "ext_status": 1051, "battery_status": 0; }\n```\n\n### 好运锦鲤\n```json5;\n{ "status": 10, "ext_status": 1071, "battery_status": 0; }\n```\n\n### 水逆退散\n```json5;\n{ "status": 10, "ext_status": 1201, "battery_status": 0; }\n```\n\n### 嗨到飞起\n```json5;\n{ "status": 10, "ext_status": 1056, "battery_status": 0; }\n```\n\n### 元气满满\n```json5;\n{ "status": 10, "ext_status": 1058, "battery_status": 0; }\n```\n\n### 宝宝认证\n```json5;\n{ "status": 10, "ext_status": 1070, "battery_status": 0; }\n```\n\n### 一言难尽\n```json5;\n{ "status": 10, "ext_status": 1063, "battery_status": 0; }\n```\n\n### 难得糊涂\n```json5;\n{ "status": 10, "ext_status": 2001, "battery_status": 0; }\n```\n\n### emo中\n```json5;\n{ "status": 10, "ext_status": 1401, "battery_status": 0; }\n```\n\n### 我太难了\n```json5;\n{ "status": 10, "ext_status": 1062, "battery_status": 0; }\n```\n\n### 我想开了\n```json5;\n{ "status": 10, "ext_status": 2013, "battery_status": 0; }\n```\n\n### 我没事\n```json5;\n{ "status": 10, "ext_status": 1052, "battery_status": 0; }\n```\n\n### 想静静\n```json5;\n{ "status": 10, "ext_status": 1061, "battery_status": 0; }\n```\n\n### 悠哉哉\n```json5;\n{ "status": 10, "ext_status": 1059, "battery_status": 0; }\n```\n\n### 去旅行\n```json5;\n{ "status": 10, "ext_status": 2015, "battery_status": 0; }\n```\n\n### 信号弱\n```json5;\n{ "status": 10, "ext_status": 1011, "battery_status": 0; }\n```\n\n### 出去浪\n```json5;\n{ "status": 10, "ext_status": 2003, "battery_status": 0; }\n```\n\n### 肝作业\n```json5;\n{ "status": 10, "ext_status": 2012, "battery_status": 0; }\n```\n\n### 学习中\n```json5;\n{ "status": 10, "ext_status": 1018, "battery_status": 0; }\n```\n\n### 搬砖中\n```json5;\n{ "status": 10, "ext_status": 2023, "battery_status": 0; }\n```\n\n### 摸鱼中\n```json5;\n{ "status": 10, "ext_status": 1300, "battery_status": 0; }\n```\n\n### 无聊中\n```json5;\n{ "status": 10, "ext_status": 1060, "battery_status": 0; }\n```\n\n### timi中\n```json5;\n{ "status": 10, "ext_status": 1027, "battery_status": 0; }\n```\n\n### 睡觉中\n```json5;\n{ "status": 10, "ext_status": 1016, "battery_status": 0; }\n```\n\n### 熬夜中\n```json5;\n{ "status": 10, "ext_status": 1032, "battery_status": 0; }\n```\n\n### 追剧中\n```json5;\n{ "status": 10, "ext_status": 1021, "battery_status": 0; }\n```\n\n### 我的电量\n```json5;\n{\n  "status": 10,\n    "ext_status": 1000,\n      "battery_status": 0;\n}\n```\n', H1e = p.Object({
  group_id: p.String({ description: "群号" })
}), W1e = p.Array(p.Object({
  sender_id: p.Number({ description: "发送者QQ" }),
  publish_time: p.Number({ description: "发布时间" }),
  notice_id: p.String({ description: "公告ID" }),
  message: p.Object({
    text: p.String({ description: "文本内容" }),
    image: p.Array(p.Any(), { description: "图片列表" }),
    images: p.Array(p.Any(), { description: "图片列表" })
  }, { description: "公告内容" }),
  settings: p.Optional(p.Any({ description: "设置项" })),
  read_num: p.Optional(p.Number({ description: "阅读数" }))
}), { description: "群公告列表" });
class z1e extends le {
  actionName = re.GoCQHTTP_GetGroupNotice;
  payloadSchema = H1e;
  returnSchema = W1e;
  actionSummary = "获取群公告";
  actionDescription = "获取指定群聊中的公告列表";
  actionTags = ["群组接口"];
  payloadExample = ht.GetGroupNotice.payload;
  returnExample = ht.GetGroupNotice.response;
  async _handle(e) {
    const n = e.group_id.toString(), r = await this.core.apis.WebApi.getGroupNotice(n);
    if (!r)
      throw new Error("获取公告失败");
    const i = [];
    for (const o in r.feeds) {
      if (!r.feeds[o])
        continue;
      const s = r.feeds[o], a = s.msg.pics?.map((u) => ({ id: u.id, height: u.h, width: u.w })) || [], c = {
        notice_id: s.fid,
        sender_id: s.u,
        publish_time: s.pubt,
        message: {
          text: s.msg.text,
          image: a,
          images: a
        },
        settings: s.settings,
        read_num: s.read_num
      };
      i.push(c);
    }
    return i;
  }
}
const K1e = p.Object({
  group_id: p.String({ description: "群号" })
}), V1e = p.Array(p.Object({
  msg_seq: p.Number({ description: "消息序号" }),
  msg_random: p.Number({ description: "消息随机数" }),
  sender_id: p.Number({ description: "发送者QQ" }),
  sender_nick: p.String({ description: "发送者昵称" }),
  operator_id: p.Number({ description: "操作者QQ" }),
  operator_nick: p.String({ description: "操作者昵称" }),
  message_id: p.Number({ description: "消息ID" }),
  operator_time: p.Number({ description: "操作时间" }),
  content: p.Array(p.Any(), { description: "消息内容" })
}), { description: "精华消息列表" });
class Y1e extends le {
  actionName = re.GoCQHTTP_GetEssenceMsg;
  payloadSchema = K1e;
  returnSchema = V1e;
  actionSummary = "获取群精华消息";
  actionDescription = "获取指定群聊中的精华消息列表";
  actionTags = ["群组接口"];
  payloadExample = ht.GetGroupEssence.payload;
  returnExample = ht.GetGroupEssence.response;
  async msgSeqToMsgId(e, n, r) {
    const i = (await this.core.apis.MsgApi.getMsgsBySeqAndCount(e, n, 1, !0, !0)).msgList.find((o) => o.msgSeq === n && o.msgRandom === r);
    if (i)
      return {
        id: rt.createUniqueMsgId(e, i.msgId),
        msg: i
      };
  }
  async _handle(e, n, r) {
    const i = (await this.core.apis.WebApi.getGroupEssenceMsgAll(e.group_id.toString())).flatMap((o) => o?.data?.msg_list).filter(Boolean);
    if (!i)
      throw new Error("获取失败");
    return await Promise.all(i.map(async (o) => {
      const s = await this.msgSeqToMsgId({
        chatType: Ne.KCHATTYPEGROUP,
        peerUid: e.group_id.toString()
      }, o.msg_seq.toString(), o.msg_random.toString());
      if (s) {
        const { id: l, msg: d } = s, f = await this.obContext.apis.MsgApi.parseMessage(d, r.messagePostFormat);
        let m = [];
        return f && (Array.isArray(f.message) ? m = f.message : m = [{ type: ze.text, data: { text: f.message } }]), {
          msg_seq: o.msg_seq,
          msg_random: o.msg_random,
          sender_id: +o.sender_uin,
          sender_nick: o.sender_nick,
          operator_id: +o.add_digest_uin,
          operator_nick: o.add_digest_nick,
          message_id: l,
          operator_time: o.add_digest_time,
          content: m
        };
      }
      const a = JSON.stringify({
        msg_seq: o.msg_seq.toString(),
        msg_random: o.msg_random.toString(),
        group_id: e.group_id.toString()
      }), c = Si.createHash("md5").update(a).digest();
      c[0] && (c[0] &= 127);
      const u = c.readInt32BE(0);
      return this.core.apis.GroupApi.essenceLRU.set(u, a), {
        msg_seq: o.msg_seq,
        msg_random: o.msg_random,
        sender_id: +o.sender_uin,
        sender_nick: o.sender_nick,
        operator_id: +o.add_digest_uin,
        operator_nick: o.add_digest_nick,
        message_id: u,
        operator_time: o.add_digest_time,
        content: o.msg_content.map((l) => {
          if (l.msg_type === 1)
            return {
              type: ze.text,
              data: {
                text: l?.text ?? ""
              }
            };
          if (l.msg_type === 3)
            return {
              type: ze.image,
              data: {
                file: "",
                url: l?.image_url
              }
            };
        }).filter((l) => l !== void 0)
      };
    }));
  }
}
const MU = p.Object({
  message_id: p.Union([p.Number(), p.String()], { description: "消息ID" }),
  group_id: p.Optional(p.String({ description: "目标群号" })),
  user_id: p.Optional(p.String({ description: "目标用户QQ" }))
}), RU = p.Null({ description: "操作结果" });
class BU extends le {
  actionSummary = "转发单条消息";
  actionDescription = "转发单条消息";
  actionTags = ["消息接口"];
  payloadExample = {
    message_id: 12345,
    group_id: "123456"
  };
  returnExample = null;
  async getTargetPeer(e) {
    if (e.user_id) {
      const n = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString());
      if (!n)
        throw new Error(`无法找到私聊对象${e.user_id}`);
      return { chatType: Ne.KCHATTYPEC2C, peerUid: n };
    }
    return { chatType: Ne.KCHATTYPEGROUP, peerUid: e.group_id.toString() };
  }
  async _handle(e) {
    const n = rt.getMsgIdAndPeerByShortId(+e.message_id);
    if (!n)
      throw new Error(`无法找到消息${e.message_id}`);
    const r = await this.getTargetPeer(e), i = await this.core.apis.MsgApi.forwardMsg(
      n.Peer,
      r,
      [n.MsgId]
    );
    if (i.result !== 0)
      throw new Error(`转发消息失败 ${i.errMsg}`);
    return null;
  }
}
class J1e extends BU {
  payloadSchema = MU;
  returnSchema = RU;
  actionName = re.ForwardFriendSingleMsg;
}
class X1e extends BU {
  payloadSchema = MU;
  returnSchema = RU;
  actionName = re.ForwardGroupSingleMsg;
}
const Z1e = p.Array(
  p.Object({
    categoryId: p.Number({ description: "分组ID" }),
    categoryName: p.String({ description: "分组名称" }),
    categoryMbCount: p.Number({ description: "分组内好友数量" }),
    buddyList: p.Array(P2, { description: "好友列表" })
  }),
  { description: "带分组的好友列表" }
);
class eve extends le {
  actionName = re.GetFriendsWithCategory;
  payloadSchema = p.Object({});
  returnSchema = Z1e;
  actionSummary = "获取带分组的好友列表";
  actionTags = ["用户扩展"];
  payloadExample = {};
  returnExample = [
    {
      categoryId: 1,
      categoryName: "我的好友",
      categoryMbCount: 1,
      buddyList: []
    }
  ];
  async _handle() {
    return (await this.core.apis.FriendApi.getBuddyV2ExWithCate()).map((n) => ({
      ...n,
      buddyList: Ni.friends(n.buddyList)
    }));
  }
}
const tve = p.Object({
  group_id: p.String({ description: "群号" }),
  content: p.String({ description: "公告内容" }),
  image: p.Optional(p.String({ description: "公告图片路径或 URL" })),
  pinned: p.Union([p.Number(), p.String()], { default: 0, description: "是否置顶 (0/1)" }),
  type: p.Union([p.Number(), p.String()], { default: 1, description: "类型 (默认为 1)" }),
  confirm_required: p.Union([p.Number(), p.String()], { default: 1, description: "是否需要确认 (0/1)" }),
  is_show_edit_card: p.Union([p.Number(), p.String()], { default: 0, description: "是否显示修改群名片引导 (0/1)" }),
  tip_window_type: p.Union([p.Number(), p.String()], { default: 0, description: "弹窗类型 (默认为 0)" })
});
class nve extends le {
  actionName = re.GoCQHTTP_SendGroupNotice;
  payloadSchema = tve;
  returnSchema = p.Null();
  actionSummary = "发送群公告";
  actionDescription = "在指定群聊中发布新的公告";
  actionTags = ["Go-CQHTTP"];
  payloadExample = tt.SendGroupNotice.payload;
  returnExample = tt.SendGroupNotice.response;
  async _handle(e) {
    let n;
    if (e.image) {
      const {
        path: i,
        success: o,
        isLocal: s
      } = await Ji(this.core.NapCatTempPath, e.image);
      if (!o)
        throw new Error(`群公告${e.image}设置失败,image字段可能格式不正确`);
      if (!i)
        throw new Error(`群公告${e.image}设置失败,获取资源失败`);
      await hE(i, 5e3);
      const a = await this.core.apis.GroupApi.uploadGroupBulletinPic(e.group_id.toString(), i);
      if (a.errCode !== 0)
        throw new Error(`群公告${e.image}设置失败,图片上传失败 ， 错误信息:${a.errMsg}`);
      s || q_(i).catch(() => {
      }), n = a.picInfo;
    }
    const r = await this.core.apis.WebApi.setGroupNotice(
      e.group_id.toString(),
      e.content,
      +e.pinned,
      +e.type,
      +e.is_show_edit_card,
      +e.tip_window_type,
      +e.confirm_required,
      n?.id,
      n?.width,
      n?.height
    );
    if (!r || r.ec !== 0)
      throw new Error(`设置群公告失败,错误信息:${r?.em}`);
  }
}
const rve = p.Object({
  group_id: p.String({ description: "群号" }),
  type: p.Optional(p.Enum(ti, { description: "荣誉类型" }))
}), ive = p.Object({
  group_id: p.Number({ description: "群号" }),
  current_talkative: p.Record(p.String(), p.Unknown(), { description: "当前龙王" }),
  talkative_list: p.Array(p.Unknown(), { description: "龙王列表" }),
  performer_list: p.Array(p.Unknown(), { description: "群聊之火列表" }),
  legend_list: p.Array(p.Unknown(), { description: "群聊炽热列表" }),
  emotion_list: p.Array(p.Unknown(), { description: "快乐源泉列表" }),
  strong_newbie_list: p.Array(p.Unknown(), { description: "冒尖小春笋列表" })
}, { description: "群荣誉信息" });
class ove extends le {
  actionName = re.GetGroupHonorInfo;
  payloadSchema = rve;
  returnSchema = ive;
  actionSummary = "获取群荣誉信息";
  actionDescription = "获取指定群聊的荣誉信息，如龙王等";
  actionTags = ["Go-CQHTTP"];
  payloadExample = tt.GetGroupHonorInfo.payload;
  returnExample = tt.GetGroupHonorInfo.response;
  async _handle(e) {
    return e.type || (e.type = ti.ALL), await this.core.apis.WebApi.getGroupHonorInfo(e.group_id.toString(), e.type);
  }
}
const sve = p.Object({
  user_id: p.String({ description: "用户ID" }),
  nickname: p.String({ description: "昵称" }),
  sex: p.Optional(p.String({ description: "性别" })),
  age: p.Optional(p.Number({ description: "年龄" })),
  card: p.Optional(p.String({ description: "群名片" })),
  level: p.Optional(p.String({ description: "群等级" })),
  role: p.Optional(p.String({ description: "群角色" }))
}), ave = p.Object({
  reply: p.Optional(Cg),
  auto_escape: p.Optional(p.Boolean({ description: "是否作为纯文本发送" })),
  at_sender: p.Optional(p.Boolean({ description: "是否 @ 发送者" })),
  delete: p.Optional(p.Boolean({ description: "是否撤回该消息" })),
  kick: p.Optional(p.Boolean({ description: "是否踢出发送者" })),
  ban: p.Optional(p.Boolean({ description: "是否禁言发送者" })),
  ban_duration: p.Optional(p.Number({ description: "禁言时长" })),
  approve: p.Optional(p.Boolean({ description: "是否同意请求/加群" })),
  remark: p.Optional(p.String({ description: "好友备注" })),
  reason: p.Optional(p.String({ description: "拒绝理由" }))
}, { description: "快速操作内容" }), cve = p.Object({
  time: p.Number({ description: "事件发生时间" }),
  self_id: p.Number({ description: "收到事件的机器人 QQ 号" }),
  post_type: p.String({ description: "上报类型" }),
  message_type: p.Optional(p.String({ description: "消息类型" })),
  sub_type: p.Optional(p.String({ description: "消息子类型" })),
  user_id: p.String({ description: "发送者 QQ 号" }),
  group_id: p.Optional(p.String({ description: "群号" })),
  message_id: p.Optional(p.Number({ description: "消息 ID" })),
  message_seq: p.Optional(p.Number({ description: "消息序列号" })),
  real_id: p.Optional(p.Number({ description: "真实消息 ID" })),
  sender: p.Optional(sve),
  message: p.Optional(p.Any({ description: "消息内容" })),
  message_format: p.Optional(p.String({ description: "消息格式" })),
  raw_message: p.Optional(p.String({ description: "原始消息内容" })),
  font: p.Optional(p.Number({ description: "字体" })),
  notice_type: p.Optional(p.String({ description: "通知类型" })),
  meta_event_type: p.Optional(p.String({ description: "元事件类型" }))
}, { description: "事件上下文" }), uve = p.Object({
  context: cve,
  operation: ave
});
class lve extends le {
  actionName = re.GoCQHTTP_HandleQuickAction;
  payloadSchema = uve;
  returnSchema = p.Null();
  actionSummary = "处理快速操作";
  actionDescription = "处理来自事件上报的快速操作请求";
  actionTags = ["Go-CQHTTP"];
  payloadExample = tt.QuickAction.payload;
  returnExample = tt.QuickAction.response;
  async _handle(e) {
    this.obContext.apis.QuickActionApi.handleQuickOperation(e.context, e.operation).catch((n) => this.core.context.logger.logError(n));
  }
}
const pve = p.Object({}, { description: "群忽略通知负载" }), dve = p.Object({
  invited_requests: p.Array(p.Any(), { description: "邀请请求列表" }),
  InvitedRequest: p.Array(p.Any(), { description: "邀请请求列表" }),
  join_requests: p.Array(p.Any(), { description: "加入请求列表" })
}, { description: "群忽略通知结果" });
class fve extends le {
  actionName = re.GetGroupIgnoredNotifies;
  payloadSchema = pve;
  returnSchema = dve;
  actionSummary = "获取群忽略通知";
  actionDescription = "获取被忽略的入群申请和邀请通知";
  actionTags = ["群组接口"];
  payloadExample = {};
  returnExample = {
    invited_requests: [],
    InvitedRequest: [],
    join_requests: []
  };
  async _handle() {
    const e = await this.core.apis.GroupApi.getSingleScreenNotifies(!1, 50), n = { invited_requests: [], InvitedRequest: [], join_requests: [] }, r = e.map(async (i) => {
      const o = i.user1?.uid ? +await this.core.apis.UserApi.getUinByUidV2(i.user1.uid) : 0, s = i.user2?.uid ? +await this.core.apis.UserApi.getUinByUidV2(i.user2.uid) : 0, a = {
        request_id: +i.seq,
        invitor_uin: o,
        invitor_nick: i.user1?.nickName,
        group_id: +i.group?.groupCode,
        message: i?.postscript,
        group_name: i.group?.groupName,
        checked: i.status !== Ga.KUNHANDLE,
        actor: s,
        requester_nick: i.user1?.nickName
      };
      i.type === 1 ? n.InvitedRequest.push(a) : i.type === 7 && n.join_requests.push(a);
    });
    return await Promise.all(r), n.invited_requests = n.InvitedRequest, n;
  }
}
const hve = p.Object({}, { description: "在线客户端负载" }), mve = p.Array(p.Any(), { description: "在线客户端列表" });
class gve extends le {
  actionName = re.GetOnlineClient;
  payloadSchema = hve;
  returnSchema = mve;
  actionSummary = "获取在线客户端";
  actionDescription = "获取当前登录账号的在线客户端列表";
  actionTags = ["Go-CQHTTP"];
  payloadExample = tt.GetOnlineClient.payload;
  returnExample = tt.GetOnlineClient.response;
  async _handle() {
    return this.core.apis.SystemApi.getOnlineDev(), await Kp(500), [];
  }
}
const yve = p.Object({
  image: p.String({ description: "图片路径、URL或Base64" })
}), vve = p.Any({ description: "OCR结果" });
class UU extends le {
  payloadSchema = yve;
  returnSchema = vve;
  actionSummary = "图片 OCR 识别";
  actionDescription = "识别图片中的文字内容(仅Windows端支持)";
  actionTags = ["扩展接口"];
  payloadExample = xr.OCRImage.payload;
  returnExample = xr.OCRImage.response;
  async _handle(e) {
    const { path: n, success: r, isLocal: i } = await Ji(this.core.NapCatTempPath, e.image);
    if (!r)
      throw new Error(`OCR ${e.image}失败, image字段可能格式不正确`);
    if (n)
      try {
        await hE(n, 5e3);
        const o = await this.core.apis.SystemApi.ocrImage(n);
        if (!o)
          throw new Error(`OCR ${e.image}失败`);
        return o.result;
      } finally {
        i || de.unlink(n, () => {
        });
      }
    throw new Error(`OCR ${e.image}失败, 文件可能不存在`);
  }
}
class bve extends UU {
  actionName = re.OCRImage;
  actionSummary = "图片 OCR 识别";
}
class xve extends UU {
  actionName = re.IOCRImage;
  actionSummary = "图片 OCR 识别 (内部)";
}
const wve = p.Object({
  words: p.Array(p.String(), { description: "待翻译单词列表" })
}), Sve = p.Object({
  words: p.Array(p.String(), { description: "翻译结果列表" })
}, { description: "翻译结果" });
class _ve extends le {
  actionName = re.TranslateEnWordToZn;
  payloadSchema = wve;
  returnSchema = Sve;
  actionSummary = "英文单词翻译";
  actionDescription = "将英文单词列表翻译为中文";
  actionTags = ["扩展接口"];
  payloadExample = xr.TranslateEnWordToZn.payload;
  returnExample = xr.TranslateEnWordToZn.response;
  async _handle(e) {
    const n = await this.core.apis.SystemApi.translateEnWordToZn(e.words);
    if (n.result !== 0)
      throw new Error("翻译失败");
    return {
      words: n.words
    };
  }
}
const Eve = p.Object({
  nickname: p.String({ description: "昵称" }),
  personal_note: p.Optional(p.String({ description: "个性签名" })),
  sex: p.Optional(p.Union([p.Number(), p.String()], { description: "性别 (0: 未知, 1: 男, 2: 女)" }))
  // 传Sex值？建议传0
});
class Ave extends le {
  actionName = re.SetQQProfile;
  payloadSchema = Eve;
  returnSchema = p.Any({ description: "设置结果" });
  actionSummary = "设置QQ资料";
  actionDescription = "修改当前账号的昵称、个性签名等资料";
  actionTags = ["Go-CQHTTP"];
  payloadExample = tt.SetQQProfile.payload;
  returnExample = tt.SetQQProfile.response;
  async _handle(e) {
    const n = this.core.selfInfo, r = await this.core.apis.UserApi.getUserDetailInfo(n.uid);
    return await this.core.apis.UserApi.modifySelfProfile({
      nick: e.nickname,
      longNick: (e?.personal_note ?? r?.longNick) || "",
      sex: parseInt(e?.sex ? e?.sex.toString() : r?.sex.toString()),
      birthday: {
        birthday_year: r?.birthday_year.toString(),
        birthday_month: r?.birthday_month.toString(),
        birthday_day: r?.birthday_day.toString()
      },
      location: void 0
    });
  }
}
const Ive = p.Object({
  user_id: p.Optional(p.String({ description: "QQ号" })),
  group_id: p.Optional(p.String({ description: "群号" })),
  phone_number: p.String({ default: "", description: "手机号" })
}), Cve = p.Any({ description: "分享结果" });
class LU extends le {
  payloadSchema = Ive;
  returnSchema = Cve;
  actionSummary = "分享用户 (Ark)";
  actionDescription = "获取用户推荐的 Ark 内容";
  actionTags = ["消息扩展"];
  payloadExample = {
    user_id: "123456",
    phone_number: ""
  };
  returnExample = {
    ark: "..."
  };
  async _handle(e) {
    if (e.group_id)
      return await this.core.apis.GroupApi.getGroupRecommendContactArkJson(e.group_id.toString());
    if (e.user_id)
      return await this.core.apis.UserApi.getBuddyRecommendContactArkJson(e.user_id.toString(), e.phone_number);
    throw new Error("group_id or user_id is required");
  }
}
const Tve = p.Object({
  group_id: p.String({ description: "群号" })
});
class kve extends LU {
  actionName = re.SharePeer;
}
const Nve = p.String({ description: "Ark Json内容" });
class jU extends le {
  payloadSchema = Tve;
  returnSchema = Nve;
  actionSummary = "分享群 (Ark)";
  actionDescription = "获取群分享的 Ark 内容";
  actionTags = ["消息扩展"];
  payloadExample = {
    group_id: "123456"
  };
  returnExample = '{"app": "com.tencent.structmsg", ...}';
  async _handle(e) {
    return await this.core.apis.GroupApi.getArkJsonGroupShare(e.group_id.toString());
  }
}
class Pve extends jU {
  actionName = re.ShareGroupEx;
}
class Dve extends jU {
  actionName = re.SendGroupArkShare;
}
class Fve extends LU {
  actionName = re.SendArkShare;
}
const Ove = p.Object({
  rawData: p.String({ description: "原始数据" }),
  brief: p.String({ description: "简要描述" })
}), Mve = p.Any({ description: "创建结果" });
class Rve extends le {
  actionName = re.CreateCollection;
  payloadSchema = Ove;
  returnSchema = Mve;
  actionSummary = "创建收藏";
  actionTags = ["扩展接口"];
  payloadExample = {
    rawData: "收藏内容",
    brief: "收藏标题"
  };
  returnExample = {
    result: 0,
    errMsg: ""
  };
  async _handle(e) {
    return await this.core.apis.CollectionApi.createCollection(
      this.core.selfInfo.uin,
      this.core.selfInfo.uid,
      this.core.selfInfo.nick,
      e.brief,
      e.rawData
    );
  }
}
const Bve = p.Object({
  longNick: p.String({ description: "签名内容" })
}), Uve = p.Any({ description: "设置结果" });
class Lve extends le {
  actionName = re.SetLongNick;
  payloadSchema = Bve;
  returnSchema = Uve;
  actionSummary = "设置个性签名";
  actionDescription = "修改当前登录帐号的个性签名";
  actionTags = ["扩展接口"];
  payloadExample = xr.SetLongNick.payload;
  returnExample = xr.SetLongNick.response;
  async _handle(e) {
    return await this.core.apis.UserApi.setLongNick(e.longNick);
  }
}
const jve = p.Object({
  message_id: p.Optional(p.Union([p.Number(), p.String()], { description: "消息ID" })),
  msg_seq: p.Optional(p.String({ description: "消息序号" })),
  msg_random: p.Optional(p.String({ description: "消息随机数" })),
  group_id: p.Optional(p.String({ description: "群号" }))
}), Qve = p.Any({ description: "操作结果" });
class $ve extends le {
  actionName = re.DelEssenceMsg;
  payloadSchema = jve;
  returnSchema = Qve;
  actionSummary = "移出精华消息";
  actionDescription = "将一条消息从群精华消息列表中移出";
  actionTags = ["群组接口"];
  payloadExample = ht.DelEssenceMsg.payload;
  returnExample = ht.DelEssenceMsg.response;
  async _handle(e) {
    if (e.msg_seq && e.msg_random && e.group_id)
      return await this.core.apis.GroupApi.removeGroupEssenceBySeq(
        e.group_id,
        e.msg_random,
        e.msg_seq
      );
    if (!e.message_id)
      throw new Error("必须提供 message_id 或者同时提供 msg_seq, msg_random, group_id");
    const n = rt.getMsgIdAndPeerByShortId(+e.message_id);
    if (!n) {
      const r = this.core.apis.GroupApi.essenceLRU.getValue(+e.message_id);
      if (!r) throw new Error("消息不存在");
      const { msg_seq: i, msg_random: o, group_id: s } = JSON.parse(r);
      return await this.core.apis.GroupApi.removeGroupEssenceBySeq(s, i, o);
    }
    return await this.core.apis.GroupApi.removeGroupEssence(
      n.Peer.peerUid,
      n.MsgId
    );
  }
}
const Gve = p.Object({
  message_id: p.Union([p.Number(), p.String()], { description: "消息ID" })
}), qve = p.Any({ description: "操作结果" });
class Hve extends le {
  actionName = re.SetEssenceMsg;
  payloadSchema = Gve;
  returnSchema = qve;
  actionSummary = "设置精华消息";
  actionDescription = "将一条消息设置为群精华消息";
  actionTags = ["群组接口"];
  payloadExample = ht.SetEssenceMsg.payload;
  returnExample = ht.SetEssenceMsg.response;
  async _handle(e) {
    const n = rt.getMsgIdAndPeerByShortId(+e.message_id);
    if (!n)
      throw new Error("msg not found");
    return await this.core.apis.GroupApi.addGroupEssence(
      n.Peer.peerUid,
      n.MsgId
    );
  }
}
const Wve = p.Object({
  count: p.Union([p.Number(), p.String()], { default: 10, description: "获取的数量" })
}), zve = p.Array(p.Object({
  lastestMsg: p.Any({ description: "最后一条消息" }),
  peerUin: p.String({ description: "对象QQ" }),
  remark: p.String({ description: "备注" }),
  msgTime: p.String({ description: "消息时间" }),
  chatType: p.Number({ description: "聊天类型" }),
  msgId: p.String({ description: "消息ID" }),
  sendNickName: p.String({ description: "发送者昵称" }),
  sendMemberName: p.String({ description: "发送者群名片" }),
  peerName: p.String({ description: "对象名称" })
}), { description: "最近会话列表" });
class Kve extends le {
  actionName = re.GetRecentContact;
  payloadSchema = Wve;
  returnSchema = zve;
  actionSummary = "获取最近会话";
  actionDescription = "获取最近会话";
  actionTags = ["用户接口"];
  payloadExample = {
    count: 10
  };
  returnExample = [
    {
      peerUin: "123456",
      peerName: "测试",
      msgTime: "1734567890",
      msgId: "12345",
      lastestMsg: {}
    }
  ];
  async _handle(e, n, r) {
    const i = await this.core.apis.UserApi.getRecentContactListSnapShot(+e.count);
    return await Promise.all(i.info.changedList.map(async (s) => {
      const a = await this.core.apis.MsgApi.getMsgsByMsgId({ chatType: s.chatType, peerUid: s.peerUid }, [s.msgId]);
      return a.msgList.length > 0 && a.msgList[0] ? {
        lastestMsg: await this.obContext.apis.MsgApi.parseMessage(a.msgList[0], r.messagePostFormat),
        peerUin: s.peerUin,
        remark: String(s.remark ?? ""),
        msgTime: s.msgTime,
        chatType: s.chatType,
        msgId: s.msgId,
        sendNickName: String(s.sendNickName ?? ""),
        sendMemberName: String(s.sendMemberName ?? ""),
        peerName: String(s.peerName ?? "")
      } : {
        lastestMsg: void 0,
        peerUin: s.peerUin,
        remark: String(s.remark ?? ""),
        msgTime: s.msgTime,
        chatType: s.chatType,
        msgId: s.msgId,
        sendNickName: String(s.sendNickName ?? ""),
        sendMemberName: String(s.sendMemberName ?? ""),
        peerName: String(s.peerName ?? "")
      };
    }));
  }
}
const Vve = p.Object({
  user_id: p.Optional(p.String({ description: "QQ号" })),
  start: p.Union([p.Number(), p.String()], { default: 0, description: "起始位置" }),
  count: p.Union([p.Number(), p.String()], { default: 10, description: "获取数量" })
}), Yve = p.Object({
  uid: p.String({ description: "用户UID" }),
  time: p.String({ description: "时间" }),
  favoriteInfo: p.Object({
    userInfos: p.Array(p.Any(), { description: "点赞用户信息" }),
    total_count: p.Number({ description: "总点赞数" }),
    last_time: p.Number({ description: "最后点赞时间" }),
    today_count: p.Number({ description: "今日点赞数" })
  }),
  voteInfo: p.Object({
    total_count: p.Number({ description: "总点赞数" }),
    new_count: p.Number({ description: "新增点赞数" }),
    new_nearby_count: p.Number({ description: "新增附近点赞数" }),
    last_visit_time: p.Number({ description: "最后访问时间" }),
    userInfos: p.Array(p.Any(), { description: "点赞用户信息" })
  })
}, { description: "点赞详情" });
class Jve extends le {
  actionName = re.GetProfileLike;
  payloadSchema = Vve;
  returnSchema = Yve;
  actionSummary = "获取资料点赞";
  actionTags = ["用户扩展"];
  payloadExample = {
    user_id: "123456789",
    start: 0,
    count: 10
  };
  returnExample = {
    uid: "u_123",
    time: "1734567890",
    favoriteInfo: {
      userInfos: [],
      total_count: 10,
      last_time: 1734567890,
      today_count: 5
    },
    voteInfo: {
      total_count: 100,
      new_count: 2,
      new_nearby_count: 0,
      last_visit_time: 1734567890,
      userInfos: []
    }
  };
  async _handle(e) {
    const n = this.core.selfInfo.uin === e.user_id || !e.user_id, r = n || !e.user_id ? this.core.selfInfo.uid : await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString()), i = n ? 2 : 1, s = (await this.core.apis.UserApi.getProfileLike(r ?? this.core.selfInfo.uid, +e.start, +e.count, i)).info.userLikeInfos[0];
    if (!s)
      throw new Error("get info error");
    for (const a of s.voteInfo.userInfos)
      a.uin = +(await this.core.apis.UserApi.getUinByUidV2(a.uid) ?? "");
    for (const a of s.favoriteInfo.userInfos)
      a.uin = +(await this.core.apis.UserApi.getUinByUidV2(a.uid) ?? "");
    return s;
  }
}
const Xve = p.Object({
  file: p.String({ description: "头像文件路径或 URL" }),
  group_id: p.String({ description: "群号" })
}), Zve = p.Object({
  result: p.Number(),
  errMsg: p.String()
}, { description: "设置结果" });
class ebe extends le {
  actionName = re.SetGroupPortrait;
  payloadSchema = Xve;
  returnSchema = Zve;
  actionSummary = "设置群头像";
  actionDescription = "修改指定群聊的头像";
  actionTags = ["Go-CQHTTP"];
  payloadExample = tt.SetGroupPortrait.payload;
  returnExample = tt.SetGroupPortrait.response;
  async _handle(e) {
    const { path: n, success: r, isLocal: i } = await Ji(this.core.NapCatTempPath, e.file);
    if (!r)
      throw new Error(`头像${e.file}设置失败,file字段可能格式不正确`);
    if (n) {
      await X7(n, 5e3);
      const o = await this.core.apis.GroupApi.setGroupAvatar(e.group_id.toString(), n);
      if (i || Un.unlink(n).catch(() => {
      }), !o)
        throw new Error(`头像${e.file}设置失败,api无返回`);
      if (Number(o.result) === 1004022)
        throw new Error(`头像${e.file}设置失败，文件可能不是图片格式或权限不足`);
      if (Number(o.result) !== 0)
        throw new Error(`头像${e.file}设置失败,未知的错误,${o.result}:${o.errMsg}`);
      return {
        result: Number(o.result),
        errMsg: o.errMsg
      };
    } else
      throw new Error(`头像${e.file}设置失败,无法获取头像,文件可能不存在`);
  }
}
const tbe = p.Object({
  count: p.Union([p.Number(), p.String()], { default: 48, description: "获取数量" })
}), nbe = p.Array(p.String(), { description: "表情URL列表" });
class rbe extends le {
  actionName = re.FetchCustomFace;
  payloadSchema = tbe;
  returnSchema = nbe;
  actionSummary = "获取自定义表情";
  actionTags = ["系统扩展"];
  payloadExample = {
    count: 10
  };
  returnExample = [
    "http://example.com/face1.png"
  ];
  async _handle(e) {
    return (await this.core.apis.MsgApi.fetchFavEmojiList(+e.count)).emojiInfoList.map((r) => r.url);
  }
}
const ibe = p.Object({
  count: p.Union([p.Number(), p.String()], { default: 48, description: "获取数量" })
}), obe = p.Any({ description: "自定义表情详情列表" });
class sbe extends le {
  actionName = re.FetchCustomFaceDetail;
  payloadSchema = ibe;
  returnSchema = obe;
  actionSummary = "获取自定义表情详情";
  actionTags = ["系统扩展"];
  payloadExample = {
    count: 10
  };
  returnExample = null;
  async _handle(e) {
    return (await this.core.apis.MsgApi.fetchFavEmojiList(+e.count)).emojiInfoList;
  }
}
const abe = p.Object({
  file: p.String({ description: "本地表情文件路径" }),
  emoji_id: p.Optional(p.Union([p.String(), p.Number()], { description: "表情ID，未提供时传空字符串" })),
  package_id: p.Optional(p.Union([p.String(), p.Number()], { description: "表情包ID，未提供时传0" })),
  file_name: p.Optional(p.String({ description: "文件名，未提供时从file路径取basename" })),
  file_size: p.Optional(p.Union([p.String(), p.Number()], { description: "文件大小，未提供时读取本地文件" })),
  md5: p.Optional(p.String({ description: "文件MD5，未提供时读取本地文件计算" })),
  is_mark_face: p.Optional(p.Boolean({ description: "是否商城表情" })),
  is_origin: p.Optional(p.Boolean({ description: "是否原图" }))
}), cbe = p.Any({ description: "添加结果" });
class ube extends le {
  actionName = re.AddCustomFace;
  payloadSchema = abe;
  returnSchema = cbe;
  actionSummary = "添加自定义表情";
  actionTags = ["系统扩展"];
  payloadExample = {
    file: "C:\\Users\\Public\\face.png",
    is_origin: !0
  };
  returnExample = null;
  async _handle(e) {
    const n = await cO(e.file), r = e.md5 ?? _d("md5").update(await pL(e.file)).digest("hex");
    return await this.core.apis.MsgApi.addFavEmoji({
      emojiId: e.emoji_id?.toString() ?? "",
      packageId: e.package_id === void 0 ? 0 : Number(e.package_id),
      emojiPath: e.file,
      fileSize: e.file_size?.toString() ?? n.size.toString(),
      fileName: e.file_name ?? lO(e.file),
      md5: r,
      isMarkFace: e.is_mark_face ?? !1,
      isOrigin: e.is_origin ?? !0
    });
  }
}
const lbe = p.Object({
  res_id: p.Optional(p.Union([
    p.String({ description: "fetch_custom_face_detail返回的resId" }),
    p.Array(p.String({ description: "fetch_custom_face_detail返回的resId" }))
  ])),
  id: p.Optional(p.Union([
    p.String({ description: "native deleteFavEmoji字符串ID，通常为resId" }),
    p.Array(p.String({ description: "native deleteFavEmoji字符串ID，通常为resId" }))
  ])),
  ids: p.Optional(p.Array(p.String({ description: "native deleteFavEmoji字符串ID列表，通常为resId列表" }))),
  md5: p.Optional(p.Union([
    p.String({ description: "表情MD5，不能直接删除，请先通过fetch_custom_face_detail获取resId" }),
    p.Array(p.String({ description: "表情MD5，不能直接删除，请先通过fetch_custom_face_detail获取resId" }))
  ]))
}), pbe = p.Any({ description: "删除结果" });
class dbe extends le {
  actionName = re.DeleteCustomFace;
  payloadSchema = lbe;
  returnSchema = pbe;
  actionSummary = "删除自定义表情";
  actionTags = ["系统扩展"];
  payloadExample = {
    res_id: "2707600964_0_0_0_D8EAA70984B402EE10B0F33DB88F4173_0_0"
  };
  returnExample = null;
  async _handle(e) {
    const n = e.ids ?? (Array.isArray(e.res_id) ? e.res_id : e.res_id ? [e.res_id] : void 0) ?? (Array.isArray(e.id) ? e.id : e.id ? [e.id] : void 0) ?? [];
    if (n.length === 0) throw new Error("res_id or ids is required");
    return await this.core.apis.MsgApi.deleteFavEmoji(n);
  }
}
const fbe = p.Object({
  emoji_id: p.Union([p.Number(), p.String()], { description: "表情ID" }),
  res_id: p.String({ description: "资源ID" }),
  md5: p.String({ description: "表情MD5" }),
  desc: p.String({ description: "新的表情描述" })
}), hbe = p.Any({ description: "修改结果" });
class mbe extends le {
  actionName = re.SetCustomFaceDesc;
  payloadSchema = fbe;
  returnSchema = hbe;
  actionSummary = "修改自定义表情描述";
  actionTags = ["系统扩展"];
  payloadExample = {
    emoji_id: 1,
    res_id: "resource-id",
    md5: "d41d8cd98f00b204e9800998ecf8427e",
    desc: "新的描述"
  };
  returnExample = null;
  async _handle(e) {
    return await this.core.apis.MsgApi.modifyFavEmojiDesc([{
      emojiId: Number(e.emoji_id),
      resId: e.res_id,
      md5: e.md5,
      desc: e.desc
    }]);
  }
}
const gbe = p.Object({
  user_id: p.String({ description: "用户 QQ" }),
  file: p.String({ description: "资源路径或URL" }),
  name: p.String({ description: "文件名" }),
  upload_file: p.Boolean({ default: !0, description: "是否执行上传" })
}), ybe = p.Object({
  file_id: p.Union([p.String(), p.Null()], { description: "文件 ID" })
});
class vbe extends le {
  actionName = re.GOCQHTTP_UploadPrivateFile;
  payloadSchema = gbe;
  returnSchema = ybe;
  actionSummary = "上传私聊文件";
  actionDescription = "上传本地文件到指定私聊会话中";
  actionTags = ["Go-CQHTTP"];
  payloadExample = tt.UploadPrivateFile.payload;
  returnExample = tt.UploadPrivateFile.response;
  async getPeer(e) {
    if (e.user_id) {
      const n = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString());
      if (!n)
        throw new Error(`私聊${e.user_id}不存在`);
      return { chatType: await this.core.apis.FriendApi.isBuddy(n) ? Ne.KCHATTYPEC2C : Ne.KCHATTYPETEMPC2CFROMGROUP, peerUid: n };
    }
    throw new Error("缺少参数 user_id");
  }
  async _handle(e) {
    let n = e.file;
    de.existsSync(n) && (n = `file://${n}`);
    const r = await Ji(this.core.NapCatTempPath, n);
    if (!r.success)
      throw new Error(r.errMsg);
    const i = {
      peer: await N2(this.core, {
        user_id: e.user_id.toString()
      }, ua.Private),
      deleteAfterSentFiles: []
    }, o = await this.obContext.apis.FileApi.createValidSendFileElement(i, r.path, e.name, "", e.upload_file, r.isLocal);
    return r.isLocal || i.deleteAfterSentFiles.push(r.path), {
      file_id: (await this.obContext.apis.MsgApi.sendMsgWithOb11UniqueId(await this.getPeer(e), [o], i.deleteAfterSentFiles)).elements.find((c) => c.elementType === _e.FILE)?.fileElement?.fileUuid || null
    };
  }
}
const bbe = p.Object({
  message_id: p.Union([p.Number(), p.String()], { description: "消息ID" }),
  emojiId: p.Union([p.Number(), p.String()], { description: "表情ID" }),
  emojiType: p.Union([p.Number(), p.String()], { description: "表情类型" }),
  count: p.Union([p.Number(), p.String()], { default: 20, description: "获取数量" }),
  cookie: p.String({ default: "", description: "分页Cookie" })
}), xbe = p.Object({
  emojiLikesList: p.Array(p.Object({
    tinyId: p.String({ description: "TinyID" }),
    nickName: p.String({ description: "昵称" }),
    headUrl: p.String({ description: "头像URL" })
  }), { description: "表情回应列表" }),
  cookie: p.String({ description: "分页Cookie" }),
  isLastPage: p.Boolean({ description: "是否最后一页" }),
  isFirstPage: p.Boolean({ description: "是否第一页" }),
  result: p.Number({ description: "结果状态码" }),
  errMsg: p.String({ description: "错 误信息" })
}, { description: "表情回应详情" });
class wbe extends le {
  actionName = re.FetchEmojiLike;
  actionSummary = "获取表情点赞详情";
  actionTags = ["消息扩展"];
  payloadExample = {
    message_id: 12345,
    emojiId: "123",
    emojiType: 1,
    count: 10,
    cookie: ""
  };
  returnExample = {
    emojiLikesList: [
      {
        tinyId: "123456",
        nickName: "测试用户",
        headUrl: "http://example.com/avatar.png"
      }
    ],
    cookie: "",
    isLastPage: !0,
    isFirstPage: !0,
    result: 0,
    errMsg: ""
  };
  payloadSchema = bbe;
  returnSchema = xbe;
  async _handle(e) {
    const n = rt.getMsgIdAndPeerByShortId(+e.message_id);
    if (!n) throw new Error("消息不存在");
    const r = (await this.core.apis.MsgApi.getMsgsByMsgId(n.Peer, [n.MsgId])).msgList[0];
    if (!r) throw new Error("消息不存在");
    return await this.core.apis.MsgApi.getMsgEmojiLikesList(
      n.Peer,
      r.msgSeq,
      e.emojiId.toString(),
      e.emojiType.toString(),
      e.cookie,
      +e.count
    );
  }
}
const Sbe = p.Object({
  group_id: p.Optional(p.String({ description: "群号，短ID可不传" })),
  message_id: p.String({ description: "消息ID，可以传递长ID或短ID" }),
  emoji_id: p.String({ description: "表情ID" }),
  emoji_type: p.Optional(p.String({ description: "表情类型" })),
  count: p.Number({ default: 0, description: "数量，0代表全部" })
}), _be = p.Object({
  emoji_like_list: p.Array(
    p.Object({
      user_id: p.String({ description: "点击者QQ号" }),
      nick_name: p.String({ description: "昵称?" })
    }),
    { description: "表情回应列表" }
  )
});
class Ebe extends le {
  actionName = re.GetEmojiLikes;
  actionSummary = "获取消息表情点赞列表";
  actionTags = ["消息扩展"];
  payloadExample = {
    message_id: "12345",
    emoji_id: "123"
  };
  returnExample = {
    emoji_like_list: [
      {
        user_id: "654321",
        nick_name: "测试用户"
      }
    ]
  };
  payloadSchema = Sbe;
  returnSchema = _be;
  async _handle(e) {
    let n, r;
    if (rt.isShortId(e.message_id)) {
      const u = rt.getMsgIdAndPeerByShortId(+e.message_id);
      if (!u) throw new Error("消息不存在");
      n = u.Peer, r = u.MsgId;
    } else {
      if (!e.group_id) throw new Error("长ID模式下必须提供群号");
      n = { chatType: Ne.KCHATTYPEGROUP, peerUid: e.group_id }, r = e.message_id;
    }
    const i = (await this.core.apis.MsgApi.getMsgsByMsgId(n, [r])).msgList[0];
    if (!i) throw new Error("消息不存在");
    const o = e.emoji_type ?? (e.emoji_id.length > 3 ? "2" : "1"), s = [];
    let a = "";
    const c = e.count === 0 ? 200 : Math.ceil(e.count / 15);
    for (let u = 0; u < c; u++) {
      const l = await this.core.apis.MsgApi.getMsgEmojiLikesList(
        n,
        i.msgSeq,
        e.emoji_id.toString(),
        o,
        a,
        15
      );
      if (Array.isArray(l.emojiLikesList))
        for (const d of l.emojiLikesList)
          s.push({ user_id: d.tinyId, nick_name: d.nickName });
      if (l.isLastPage || !l.cookie) break;
      a = l.cookie;
    }
    return e.count > 0 && s.splice(e.count), { emoji_like_list: s };
  }
}
const Abe = p.Object({
  user_id: p.String({ description: "QQ号" }),
  event_type: p.Number({ description: "事件类型" })
}), Ibe = p.Any({ description: "设置结果" });
class Cbe extends le {
  actionName = re.SetInputStatus;
  payloadSchema = Abe;
  returnSchema = Ibe;
  actionSummary = "设置输入状态";
  actionTags = ["系统扩展"];
  payloadExample = {
    user_id: "123456789",
    event_type: 1
  };
  returnExample = null;
  async _handle(e) {
    const n = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString());
    if (!n) throw new Error("uid is empty");
    const r = {
      chatType: Ne.KCHATTYPEC2C,
      peerUid: n
    };
    return await this.core.apis.MsgApi.sendShowInputStatusReq(r, e.event_type);
  }
}
const Tbe = p.Object({
  token: p.Number({ description: "CSRF Token" })
});
class kbe extends le {
  actionName = re.GetCSRF;
  payloadSchema = p.Object({});
  returnSchema = Tbe;
  actionSummary = "获取 CSRF Token";
  actionDescription = "获取 CSRF Token";
  actionTags = ["系统接口"];
  payloadExample = {};
  returnExample = {
    token: 123456789
  };
  async _handle() {
    const e = await this.core.apis.UserApi.getSKey();
    if (!e)
      throw new Error("SKey is undefined");
    return {
      token: +this.core.apis.WebApi.getBknFromSKey(e)
    };
  }
}
const Nbe = p.Object({
  group_id: p.String({ description: "群号" }),
  notice_id: p.String({ description: "公告ID" })
}), Pbe = p.Any({ description: "操作结果" });
class Dbe extends le {
  actionName = re.DelGroupNotice;
  payloadSchema = Nbe;
  returnSchema = Pbe;
  actionSummary = "删除群公告";
  actionDescription = "删除群聊中的公告";
  actionTags = ["群组接口"];
  payloadExample = ht.DelGroupNotice.payload;
  returnExample = ht.DelGroupNotice.response;
  async _handle(e) {
    const n = e.group_id.toString(), r = e.notice_id;
    return await this.core.apis.GroupApi.deleteGroupBulletin(n, r);
  }
}
const Fbe = p.Object({
  group_id: p.String({ description: "群号" })
}), Obe = p.Any({ description: "群扩展信息" });
class Mbe extends le {
  actionName = re.GetGroupInfoEx;
  actionSummary = "获取群详细信息 (扩展)";
  actionTags = ["群组扩展"];
  payloadExample = {
    group_id: "123456"
  };
  returnExample = {};
  payloadSchema = Fbe;
  returnSchema = Obe;
  async _handle(e) {
    return (await this.core.apis.GroupApi.getGroupExtFE0Info([e.group_id.toString()])).result.groupExtInfos.get(e.group_id.toString());
  }
}
const Rbe = p.Object({
  group_id: p.String({ description: "群号" }),
  file_id: p.String({ description: "文件ID" })
}), Bbe = p.Any({ description: "删除结果" });
class Ube extends le {
  actionName = re.GOCQHTTP_DeleteGroupFile;
  payloadSchema = Rbe;
  returnSchema = Bbe;
  actionSummary = "删除群文件";
  actionDescription = "在群文件系统中删除指定的文件";
  actionTags = ["Go-CQHTTP"];
  payloadExample = tt.DeleteGroupFile.payload;
  returnExample = tt.DeleteGroupFile.response;
  async _handle(e) {
    const n = Jt.decodeModelId(e.file_id);
    if (!n || !n.fileId) throw new Error("Invalid file_id");
    return await this.core.apis.GroupApi.delGroupFile(e.group_id.toString(), [n.fileId]);
  }
}
const Lbe = p.Object({
  group_id: p.String({ description: "群号" }),
  // 兼容gocq 与name二选一
  folder_name: p.Optional(p.String({ description: "文件夹名称" })),
  // 兼容gocq 与folder_name二选一
  name: p.Optional(p.String({ description: "文件夹名称" }))
}), jbe = p.Object({
  result: p.Any({ description: "操作结果" }),
  groupItem: p.Any({ description: "群项信息" })
}, { description: "创建文件夹结果" });
class Qbe extends le {
  actionName = re.GoCQHTTP_CreateGroupFileFolder;
  payloadSchema = Lbe;
  returnSchema = jbe;
  actionSummary = "创建群文件目录";
  actionDescription = "在群文件系统中创建新的文件夹";
  actionTags = ["Go-CQHTTP"];
  payloadExample = {
    group_id: "123456789",
    folder_name: "新建文件夹"
  };
  returnExample = {
    result: {},
    groupItem: {}
  };
  async _handle(e) {
    const n = e.folder_name || e.name;
    return (await this.core.apis.GroupApi.creatGroupFileFolder(e.group_id.toString(), n)).resultWithGroupItem;
  }
}
const $be = p.Object({
  group_id: p.String({ description: "群号" }),
  folder_id: p.Optional(p.String({ description: "文件夹ID" })),
  folder: p.Optional(p.String({ description: "文件夹ID" }))
}), Gbe = p.Any({ description: "删除结果" });
class qbe extends le {
  actionName = re.GoCQHTTP_DeleteGroupFileFolder;
  payloadSchema = $be;
  returnSchema = Gbe;
  actionSummary = "删除群文件目录";
  actionDescription = "在群文件系统中删除指定的文件夹";
  actionTags = ["Go-CQHTTP"];
  payloadExample = tt.DeleteGroupFileFolder.payload;
  returnExample = tt.DeleteGroupFileFolder.response;
  async _handle(e) {
    return (await this.core.apis.GroupApi.delGroupFileFolder(
      e.group_id.toString(),
      e.folder ?? e.folder_id ?? ""
    )).groupFileCommonResult;
  }
}
const Hbe = p.Object({
  group_id: p.String({ description: "群号" })
}), Wbe = p.Object({
  file_count: p.Number({ description: "文件总数" }),
  limit_count: p.Number({ description: "文件上限" }),
  used_space: p.Number({ description: "已使用空间" }),
  total_space: p.Number({ description: "总空间" })
}, { description: "群文件系统信息" });
class zbe extends le {
  actionName = re.GoCQHTTP_GetGroupFileSystemInfo;
  payloadSchema = Hbe;
  returnSchema = Wbe;
  actionSummary = "获取群文件系统信息";
  actionDescription = "获取群聊文件系统的空间及状态信息";
  actionTags = ["Go-CQHTTP"];
  payloadExample = tt.GetGroupFileSystemInfo.payload;
  returnExample = tt.GetGroupFileSystemInfo.response;
  async _handle(e) {
    const n = e.group_id.toString(), [r, i] = await Promise.all([
      this.core.apis.GroupApi.getGroupFileCount([n]),
      this.core.apis.GroupApi.getGroupFileSpace(n)
    ]), o = r.groupFileCounts[0];
    if (o === void 0)
      throw new Error("Group not found");
    return {
      file_count: o,
      limit_count: 1e4,
      // Real values from the kernel's groupSpaceResult; fall back to the old
      // placeholders if the field is unexpectedly absent.
      used_space: i?.usedSpace ?? 0,
      total_space: i?.totalSpace ?? 10 * 1024 * 1024 * 1024
    };
  }
}
const Kbe = p.Object({
  group_id: p.String({ description: "群号" }),
  file_count: p.Union([p.Number(), p.String()], { default: 50, description: "文件数量" })
}), Vbe = p.Object({
  files: p.Array(p.Any(), { description: "文件列表" }),
  folders: p.Array(p.Any(), { description: "文件夹列表" })
}, { description: "群根目录文件列表" });
class Ybe extends le {
  actionName = re.GoCQHTTP_GetGroupRootFiles;
  payloadSchema = Kbe;
  returnSchema = Vbe;
  actionSummary = "获取群根目录文件列表";
  actionDescription = "获取群文件根目录下的所有文件和文件夹";
  actionTags = ["Go-CQHTTP"];
  payloadExample = tt.GetGroupRootFiles.payload;
  returnExample = tt.GetGroupRootFiles.response;
  async _handle(e) {
    const n = await this.core.apis.MsgApi.getGroupFileList(e.group_id.toString(), {
      sortType: 1,
      fileCount: +e.file_count,
      startIndex: 0,
      sortOrder: 2,
      showOnlinedocFolder: 0
    });
    return {
      files: n.filter((r) => r.fileInfo).map((r) => Ni.file(r.peerId, r.fileInfo)),
      folders: n.filter((r) => r.folderInfo).map((r) => Ni.folder(r.peerId, r.folderInfo))
    };
  }
}
const Jbe = p.Object({
  group_id: p.String({ description: "群号" }),
  folder_id: p.Optional(p.String({ description: "文件夹ID" })),
  folder: p.Optional(p.String({ description: "文件夹ID" })),
  file_count: p.Union([p.Number(), p.String()], { default: 50, description: "文件数量" })
}), Xbe = p.Object({
  files: p.Array(p.Unknown(), { description: "文件列表" }),
  folders: p.Array(p.Unknown(), { description: "文件夹列表" })
}, { description: "群文件夹文件列表" });
class Zbe extends le {
  actionName = re.GoCQHTTP_GetGroupFilesByFolder;
  payloadSchema = Jbe;
  returnSchema = Xbe;
  actionSummary = "获取群文件夹文件列表";
  actionDescription = "获取指定群文件夹下的文件及子文件夹列表";
  actionTags = ["Go-CQHTTP"];
  payloadExample = tt.GetGroupFilesByFolder.payload;
  returnExample = tt.GetGroupFilesByFolder.response;
  async _handle(e) {
    const n = await this.core.apis.MsgApi.getGroupFileList(e.group_id.toString(), {
      sortType: 1,
      fileCount: +e.file_count,
      startIndex: 0,
      sortOrder: 2,
      showOnlinedocFolder: 0,
      folderId: e.folder ?? e.folder_id ?? ""
    });
    return {
      files: (Array.isArray(n) ? n : []).filter((i) => i.fileInfo).map((i) => Ni.file(i.peerId, i.fileInfo)),
      folders: []
    };
  }
}
const exe = p.Object({
  count: p.Union([p.Number(), p.String()], { default: 50, description: "获取的消息数量" })
}), txe = p.Object({
  invited_requests: p.Array(_w, { description: "进群邀请列表" }),
  InvitedRequest: p.Array(_w, { description: "进群邀请列表 (兼容)" }),
  join_requests: p.Array(_w, { description: "进群申请列表" })
});
class nxe extends le {
  actionName = re.GetGroupSystemMsg;
  payloadSchema = exe;
  returnSchema = txe;
  actionSummary = "获取群系统消息";
  actionDescription = "获取群系统消息";
  actionTags = ["系统接口"];
  payloadExample = {
    count: 50
  };
  returnExample = {
    invited_requests: [],
    InvitedRequest: [],
    join_requests: []
  };
  async _handle(e) {
    const n = await this.core.apis.GroupApi.getSingleScreenNotifies(!1, +e.count), r = { invited_requests: [], InvitedRequest: [], join_requests: [] }, i = n.map(async (o) => {
      const s = o.user1?.uid ? +await this.core.apis.UserApi.getUinByUidV2(o.user1.uid) : 0, a = o.user2?.uid ? +await this.core.apis.UserApi.getUinByUidV2(o.user2.uid) : 0, c = {
        request_id: +o.seq,
        invitor_uin: s,
        invitor_nick: o.user1?.nickName || "",
        group_id: +o.group?.groupCode,
        message: o?.postscript || "",
        group_name: o.group?.groupName || "",
        checked: o.status !== Ga.KUNHANDLE,
        actor: a,
        requester_nick: o.user1?.nickName || ""
      };
      o.type === 1 ? r.InvitedRequest.push(c) : o.type === 7 && r.join_requests.push(c);
    });
    return await Promise.all(i), r.invited_requests = r.InvitedRequest, r;
  }
}
class Xn extends le {
  async check(e) {
    const n = await super.check(e);
    return n.valid ? this.core.apis.PacketApi.packetStatus ? { valid: !0 } : {
      valid: !1,
      message: "packetBackend不可用，请参照文档 https://napneko.github.io/config/advanced 和启动日志检查packetBackend状态或进行配置！错误堆栈信息：" + this.core.apis.PacketApi.clientLogStack
    } : n;
  }
}
class rxe extends le {
  async check(e) {
    const n = await super.check(e);
    return n.valid ? this.core.apis.PacketApi.available ? { valid: !0 } : {
      valid: !1,
      message: "packetBackend发包能力不可用，请参照文档 https://napneko.github.io/config/advanced 和启动日志检查packetBackend状态或进行配置！错误堆栈信息：" + this.core.apis.PacketApi.clientLogStack
    } : n;
  }
}
class ixe extends Xn {
  actionName = re.GetPacketStatus;
  payloadSchema = p.Object({});
  returnSchema = p.Null();
  actionSummary = "获取Packet状态";
  actionDescription = "获取底层Packet服务的运行状态";
  actionTags = ["系统接口"];
  payloadExample = {};
  returnExample = null;
  async _handle() {
  }
}
const oxe = p.Object({
  user_id: p.String({ description: "QQ号" })
}), sxe = p.Object({
  status: p.Number({ description: "在线状态" }),
  ext_status: p.Number({ description: "扩展状态" })
}, { description: "用户状态" });
class axe extends Xn {
  actionName = re.GetUserStatus;
  payloadSchema = oxe;
  returnSchema = sxe;
  actionSummary = "获取用户在线状态";
  actionTags = ["系统扩展"];
  payloadExample = {
    user_id: "123456789"
  };
  returnExample = {
    status: 10,
    ext_status: 0
  };
  async _handle(e) {
    const n = await this.core.apis.PacketApi.pkt.operation.GetStrangerStatus(+e.user_id);
    if (!n)
      throw new Error("无法获取用户状态");
    return n;
  }
}
const cxe = p.Array(p.Any(), { description: "Rkey列表" });
class uxe extends Xn {
  actionName = re.GetRkey;
  payloadSchema = p.Object({});
  returnSchema = cxe;
  actionSummary = "获取 RKey";
  actionTags = ["系统扩展"];
  payloadExample = {};
  returnExample = [
    {
      key: "rkey_value",
      expired: 1734567890
    }
  ];
  async _handle() {
    return await this.core.apis.PacketApi.pkt.operation.FetchRkey();
  }
}
const lxe = p.Object({
  group_id: p.String({ description: "群号" }),
  user_id: p.String({ description: "QQ号" }),
  special_title: p.String({ default: "", description: "专属头衔" })
}), pxe = p.Void({ description: "设置结果" });
class dxe extends Xn {
  actionName = re.SetSpecialTitle;
  payloadSchema = lxe;
  returnSchema = pxe;
  actionSummary = "设置专属头衔";
  actionDescription = "设置群聊中指定成员的专属头衔";
  actionTags = ["扩展接口"];
  payloadExample = xr.SetSpecialTitle.payload;
  returnExample = xr.SetSpecialTitle.response;
  async _handle(e) {
    const n = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString());
    if (!n) throw new Error("User not found");
    await this.core.apis.PacketApi.pkt.operation.SetGroupSpecialTitle(+e.group_id, n, e.special_title);
  }
}
const fxe = p.Object({
  group_id: p.String({ description: "群号" })
}), hxe = p.Array(p.Any(), { description: "禁言成员列表" });
class mxe extends le {
  actionName = re.GetGroupShutList;
  payloadSchema = fxe;
  returnSchema = hxe;
  actionSummary = "获取群禁言列表";
  actionTags = ["群组接口"];
  payloadExample = {
    group_id: "123456789"
  };
  returnExample = [
    {
      user_id: 123456789,
      nickname: "禁言用户",
      shut_up_time: 1734567890
    }
  ];
  async _handle(e) {
    return await this.core.apis.GroupApi.getGroupShutUpMemberList(e.group_id.toString());
  }
}
const gxe = p.Object({
  group_id: p.String({ description: "群号" }),
  no_cache: p.Optional(p.Union([p.Boolean(), p.String()], { description: "是否不使用缓存" }))
}), yxe = p.Array(p.Any(), { description: "群成员列表" });
class vxe extends le {
  actionName = re.GetGroupMemberList;
  payloadSchema = gxe;
  returnSchema = yxe;
  actionSummary = "获取群成员列表";
  actionDescription = "获取群聊中的所有成员列表";
  actionTags = ["群组接口"];
  payloadExample = ht.GetGroupMemberList.payload;
  returnExample = ht.GetGroupMemberList.response;
  async _handle(e) {
    const n = e.group_id.toString(), r = this.parseBoolean(e.no_cache ?? !1), i = await this.getGroupMembers(n, r), o = await Promise.all(
      Array.from(i.values()).map(
        (s) => Ni.groupMember(n, s)
      )
    );
    return Array.from(new Map(o.map((s) => [s.user_id, s])).values());
  }
  parseBoolean(e) {
    return typeof e == "string" ? e === "true" : e;
  }
  async getGroupMembers(e, n) {
    const r = this.core.apis.GroupApi.groupMemberCache;
    let i = r.get(e);
    if (n || !i) {
      const o = this.core.apis.GroupApi.refreshGroupMemberCache(e, !0).then().catch();
      if (i = r.get(e) || await o, !i)
        throw new Error(`Failed to get group member list for group ${e}`);
    }
    return i;
  }
}
const bxe = p.Object({
  group_id: p.String({ description: "群号" }),
  file_id: p.String({ description: "文件ID" })
}), xxe = p.Object({
  url: p.Optional(p.String({ description: "文件下载链接" }))
}, { description: "群文件URL信息" });
class wxe extends Xn {
  actionName = re.GOCQHTTP_GetGroupFileUrl;
  payloadSchema = bxe;
  returnSchema = xxe;
  actionSummary = "获取群文件URL";
  actionDescription = "获取指定群文件的下载链接";
  actionTags = ["文件接口"];
  payloadExample = Ro.GetGroupFileUrl.payload;
  returnExample = Ro.GetGroupFileUrl.response;
  async _handle(e) {
    const n = Jt.decode(e.file_id) || Jt.decodeModelId(e.file_id);
    if (n?.fileUUID)
      return {
        url: await this.core.apis.PacketApi.pkt.operation.GetGroupFileUrl(+e.group_id, n.fileUUID)
      };
    throw new Error("real fileUUID not found!");
  }
}
const Sxe = p.Object({
  domain: p.String({ description: "需要获取 cookies 的域名" })
}), _xe = p.Object({
  cookies: p.String({ description: "Cookies" }),
  token: p.Number({ description: "CSRF Token" })
});
class Exe extends le {
  actionName = re.GetCredentials;
  payloadSchema = Sxe;
  returnSchema = _xe;
  actionSummary = "获取登录凭证";
  actionDescription = "获取登录凭证";
  actionTags = ["系统接口"];
  payloadExample = {
    domain: "qun.qq.com"
  };
  returnExample = {
    cookies: "uin=o123456789; skey=@abc12345;",
    token: 123456789
  };
  async _handle(e) {
    const n = await this.core.apis.UserApi.getCookies(e.domain), r = Object.entries(n).map(([o, s]) => `${o}=${s}`).join("; "), i = n?.skey ? this.core.apis.WebApi.getBknFromCookie(n) : "";
    return { cookies: r, token: +i };
  }
}
class Axe extends le {
  actionName = re.Reboot;
  payloadSchema = p.Object({});
  returnSchema = p.Null();
  actionSummary = "重启服务";
  actionDescription = "重启服务";
  actionTags = ["系统接口"];
  payloadExample = {};
  returnExample = null;
  async _handle() {
    const e = await ve.requestRestartProcess();
    if (!e.result)
      throw new Error(e.message || "进程重启失败");
  }
}
const Ixe = p.Object({
  group_id: p.String({ description: "群号" })
}), Cxe = p.Void({ description: "打卡结果" });
class QU extends Xn {
  payloadSchema = Ixe;
  returnSchema = Cxe;
  actionSummary = "群打卡";
  actionTags = ["群组扩展"];
  payloadExample = {
    group_id: "123456789"
  };
  returnExample = null;
  async _handle(e) {
    return await this.core.apis.PacketApi.pkt.operation.GroupSign(+e.group_id);
  }
}
class Txe extends QU {
  actionName = re.SetGroupSign;
}
class kxe extends QU {
  actionName = re.SendGroupSign;
}
const Nxe = p.Object({
  group_id: p.String({ description: "群号" })
}), Pxe = p.Object({
  can_at_all: p.Boolean({ description: "是否可以艾特全体" }),
  remain_at_all_count_for_group: p.Number({ description: "群艾特全体剩余次数" }),
  remain_at_all_count_for_uin: p.Number({ description: "个人艾特全体剩余次数" })
}, { description: "群艾特全体剩余次数" });
class Dxe extends le {
  actionName = re.GoCQHTTP_GetGroupAtAllRemain;
  payloadSchema = Nxe;
  returnSchema = Pxe;
  actionSummary = "获取群艾特全体剩余次数";
  actionDescription = "获取指定群聊中艾特全体成员的剩余次数";
  actionTags = ["Go-CQHTTP"];
  payloadExample = tt.GetGroupAtAllRemain.payload;
  returnExample = tt.GetGroupAtAllRemain.response;
  async _handle(e) {
    const n = await this.core.apis.GroupApi.getGroupRemainAtTimes(e.group_id.toString());
    return {
      can_at_all: n.atInfo.canAtAll,
      remain_at_all_count_for_group: n.atInfo.RemainAtAllCountForGroup,
      remain_at_all_count_for_uin: n.atInfo.RemainAtAllCountForUin
    };
  }
}
const Fxe = p.Object({
  url: p.String({ description: "要检查的 URL" })
}), Oxe = p.Object({
  level: p.Number({ description: "安全等级 (1: 安全, 2: 未知, 3: 危险)" })
});
class YF extends le {
  actionName = re.GoCQHTTP_CheckUrlSafely;
  payloadSchema = Fxe;
  returnSchema = Oxe;
  actionSummary = "检查URL安全性";
  actionDescription = "检查指定URL的安全等级";
  actionTags = ["Go-CQHTTP"];
  payloadExample = tt.GoCQHTTPCheckUrlSafely.payload;
  returnExample = tt.GoCQHTTPCheckUrlSafely.response;
  async _handle() {
    return { level: 1 };
  }
}
const Mxe = p.Object({
  model: p.Optional(p.String({ description: "模型名称" }))
}), Rxe = p.Array(p.Object({
  variants: p.Object({
    model_show: p.String({ description: "显示名称" }),
    need_pay: p.Boolean({ description: "是否需要付费" })
  })
}), { description: "机型显示列表" });
class Bxe extends le {
  actionName = re.GoCQHTTP_GetModelShow;
  payloadSchema = Mxe;
  returnSchema = Rxe;
  actionSummary = "获取机型显示";
  actionDescription = "获取当前账号可用的设备机型显示名称列表";
  actionTags = ["Go-CQHTTP"];
  payloadExample = tt.GoCQHTTPGetModelShow.payload;
  returnExample = tt.GoCQHTTPGetModelShow.response;
  async _handle(e) {
    return e.model || (e.model = "napcat"), [{
      variants: {
        model_show: "napcat",
        need_pay: !1
      }
    }];
  }
}
class Uxe extends le {
  actionName = re.GoCQHTTP_SetModelShow;
  payloadSchema = p.Object({});
  returnSchema = p.Null();
  actionSummary = "设置机型";
  actionDescription = "设置当前账号的设备机型名称";
  actionTags = ["Go-CQHTTP"];
  payloadExample = tt.GoCQHTTPSetModelShow.payload;
  returnExample = tt.GoCQHTTPSetModelShow.response;
  async _handle() {
  }
}
const Lxe = p.Object({
  friend_id: p.Optional(p.Union([p.String(), p.Number()], { description: "好友 QQ 号" })),
  user_id: p.Optional(p.Union([p.String(), p.Number()], { description: "用户 QQ 号" })),
  temp_block: p.Optional(p.Boolean({ description: "是否加入黑名单" })),
  temp_both_del: p.Optional(p.Boolean({ description: "是否双向删除" }))
});
class jxe extends le {
  actionName = re.GoCQHTTP_DeleteFriend;
  payloadSchema = Lxe;
  returnSchema = p.Any();
  actionSummary = "删除好友";
  actionDescription = "从好友列表中删除指定用户";
  actionTags = ["Go-CQHTTP"];
  payloadExample = tt.GoCQHTTPDeleteFriend.payload;
  returnExample = tt.GoCQHTTPDeleteFriend.response;
  async _handle(e) {
    const n = e.friend_id ?? e.user_id ?? "", r = await this.core.apis.UserApi.getUidByUinV2(n.toString());
    return r ? await this.core.apis.FriendApi.isBuddy(r) ? await this.core.apis.FriendApi.delBuddy(r, e.temp_block, e.temp_both_del) : {
      valid: !1,
      message: "不是好友"
    } : {
      valid: !1,
      message: "好友不存在"
    };
  }
}
class Xo {
  static sdkId = "V1_PC_MINISDK_99.99.99_1_APP_A";
  template;
  static appMap = /* @__PURE__ */ new Map();
  constructor(e) {
    this.template = e;
  }
  static get(e) {
    return this.appMap.get(e);
  }
  static Bili = new class extends Xo {
    constructor() {
      super({
        sdkId: Xo.sdkId,
        appId: "1109937557",
        scene: 1,
        templateType: 1,
        businessType: 0,
        verType: 3,
        shareType: 0,
        versionId: "cfc5f7b05b44b5956502edaecf9d2240",
        withShareTicket: 0,
        iconUrl: "https://miniapp.gtimg.cn/public/appicon/51f90239b78a2e4994c11215f4c4ba15_200.jpg"
      }), Xo.appMap.set("bili", this);
    }
  }();
  static WeiBo = new class extends Xo {
    constructor() {
      super({
        sdkId: Xo.sdkId,
        appId: "1109224783",
        scene: 1,
        templateType: 1,
        businessType: 0,
        verType: 3,
        shareType: 0,
        versionId: "e482a3cc4e574d9b772e96ba6eec9ba2",
        withShareTicket: 0,
        iconUrl: "https://miniapp.gtimg.cn/public/appicon/35bbb44dc68e65194cfacfb206b8f1f7_200.jpg"
      }), Xo.appMap.set("weibo", this);
    }
  }();
}
class Aw {
  static generateReq(e, n) {
    return {
      ...e,
      ...n
    };
  }
  static RawToSend(e) {
    return {
      ver: e.ver,
      prompt: e.prompt,
      config: e.config,
      app: e.appName,
      view: e.appView,
      meta: e.metaData,
      miniappShareOrigin: 3,
      miniappOpenRefer: "10002"
    };
  }
  static SendToRaw(e) {
    return {
      appName: e.app,
      appView: e.view,
      ver: e.ver,
      desc: e.meta.detail_1.desc,
      prompt: e.prompt,
      metaData: e.meta,
      config: e.config
    };
  }
}
const Qxe = p.Union([
  p.Object({
    type: p.Union([p.Literal("bili"), p.Literal("weibo")], { description: "模板类型" }),
    title: p.String({ description: "标题" }),
    desc: p.String({ description: "描述" }),
    picUrl: p.String({ description: "图片URL" }),
    jumpUrl: p.String({ description: "跳转URL" }),
    webUrl: p.Optional(p.String({ description: "网页URL" })),
    rawArkData: p.Optional(p.Union([p.String()], { description: "是否返回原始Ark数据" }))
  }),
  p.Object({
    title: p.String({ description: "标题" }),
    desc: p.String({ description: "描述" }),
    picUrl: p.String({ description: "图片URL" }),
    jumpUrl: p.String({ description: "跳转URL" }),
    iconUrl: p.String({ description: "图标URL" }),
    webUrl: p.Optional(p.String({ description: "网页URL" })),
    appId: p.String({ description: "小程序AppID" }),
    scene: p.String({ description: "场景ID" }),
    templateType: p.String({ description: "模板类型" }),
    businessType: p.String({ description: "业务类型" }),
    verType: p.String({ description: "版本类型" }),
    shareType: p.String({ description: "分享类型" }),
    versionId: p.String({ description: "版本ID" }),
    sdkId: p.String({ description: "SDK ID" }),
    withShareTicket: p.String({ description: "是否携带分享票据" }),
    rawArkData: p.Optional(p.String({ description: "是否返回原始Ark数据" }))
  })
], { description: "小程序Ark参数" }), $xe = p.Object({
  data: p.Any({ description: "Ark数据" })
}, { description: "获取小程序Ark结果" });
class Gxe extends Xn {
  actionName = re.GetMiniAppArk;
  payloadSchema = Qxe;
  returnSchema = $xe;
  actionSummary = "获取小程序 Ark";
  actionTags = ["系统扩展"];
  payloadExample = {
    type: "bili",
    title: "测试标题",
    desc: "测试描述",
    picUrl: "http://example.com/pic.jpg",
    jumpUrl: "http://example.com"
  };
  returnExample = {
    data: {
      ark: "ark_content"
    }
  };
  async _handle(e) {
    let n;
    const r = {
      title: e.title,
      desc: e.desc,
      picUrl: e.picUrl,
      jumpUrl: e.jumpUrl,
      webUrl: e.webUrl ?? ""
    };
    if ("type" in e) {
      const o = Xo.get(e.type)?.template;
      if (!o)
        throw new Error("未知的模板类型");
      n = Aw.generateReq(r, o);
    } else {
      const { appId: o, scene: s, iconUrl: a, templateType: c, businessType: u, verType: l, shareType: d, versionId: f, withShareTicket: m } = e;
      n = Aw.generateReq(
        r,
        {
          sdkId: e.sdkId ?? Xo.sdkId,
          appId: o,
          scene: +s,
          iconUrl: a,
          templateType: +c,
          businessType: +u,
          verType: +l,
          shareType: +d,
          versionId: f,
          withShareTicket: +m
        }
      );
    }
    const i = await this.core.apis.PacketApi.pkt.operation.GetMiniAppAdaptShareInfo(n);
    return {
      data: e.rawArkData === "true" ? i : Aw.RawToSend(i)
    };
  }
}
var B2 = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.Sound = 1] = "Sound", t[t.Sing = 2] = "Sing", t))(B2 || {});
const qxe = p.Object({
  character: p.String({ description: "角色ID" }),
  group_id: p.String({ description: "群号" }),
  text: p.String({ description: "语音文本内容" })
}), Hxe = p.String({ description: "语音URL" });
class Wxe extends Xn {
  actionName = re.GetAiRecord;
  payloadSchema = qxe;
  returnSchema = Hxe;
  actionSummary = "获取 AI 语音";
  actionDescription = "通过 AI 语音引擎获取指定文本的语音 URL";
  actionTags = ["AI 扩展"];
  payloadExample = {
    character: "ai_char_1",
    group_id: "123456",
    text: "你好"
  };
  returnExample = "http://example.com/ai_voice.silk";
  async _handle(e) {
    const n = await this.core.apis.PacketApi.pkt.operation.GetAiVoice(+e.group_id, e.character, e.text, B2.Sound);
    if (!n.msgInfoBody[0])
      throw new Error("No voice data");
    return await this.core.apis.PacketApi.pkt.operation.GetGroupPttUrl(+e.group_id, n.msgInfoBody[0].index);
  }
}
const zxe = p.Object({
  character: p.String({ description: "角色ID" }),
  group_id: p.String({ description: "群号" }),
  text: p.String({ description: "语音文本内容" })
}), Kxe = p.Object({
  message_id: p.Number({ description: "消息ID" })
}, { description: "发送结果" });
class Vxe extends Xn {
  actionName = re.SendGroupAiRecord;
  payloadSchema = zxe;
  returnSchema = Kxe;
  actionSummary = "发送群 AI 语音";
  actionDescription = "发送 AI 生成的语音到指定群聊";
  actionTags = ["AI 扩展"];
  payloadExample = {
    character: "ai_char_1",
    group_id: "123456",
    text: "你好"
  };
  returnExample = {};
  async _handle(e) {
    return await this.core.apis.PacketApi.pkt.operation.GetAiVoice(+e.group_id, e.character, e.text, B2.Sound), {
      message_id: 0
      // can't get message_id from GetAiVoice
    };
  }
}
const Yxe = p.Object({
  group_id: p.String({ description: "群号" }),
  chat_type: p.Union([p.Number(), p.String()], { default: 1, description: "聊天类型" })
}), Jxe = p.Array(
  p.Object({
    type: p.String({ description: "角色类型" }),
    characters: p.Array(
      p.Object({
        character_id: p.String({ description: "角色ID" }),
        character_name: p.String({ description: "角色名称" }),
        preview_url: p.String({ description: "预览URL" })
      }),
      { description: "角色列表" }
    )
  }),
  { description: "AI角色列表" }
);
class Xxe extends Xn {
  actionName = re.GetAiCharacters;
  payloadSchema = Yxe;
  returnSchema = Jxe;
  actionSummary = "获取AI角色列表";
  actionDescription = "获取群聊中的AI角色列表";
  actionTags = ["扩展接口"];
  payloadExample = xr.GetAiCharacters.payload;
  returnExample = xr.GetAiCharacters.response;
  async _handle(e) {
    const n = Number(e.chat_type);
    return (await this.core.apis.PacketApi.pkt.operation.FetchAiVoiceList(+e.group_id, n))?.map((i) => ({
      type: i.category,
      characters: i.voices.map((o) => ({
        character_id: o.voiceId,
        character_name: o.voiceDisplayName,
        preview_url: o.voiceExampleUrl
      }))
    })) ?? [];
  }
}
const Tg = {
  GetGuildList: {
    payload: {},
    response: [{ guild_id: "123456", guild_name: "测试频道" }]
  },
  GetGuildProfile: {
    payload: { guild_id: "123456" },
    response: { guild_id: "123456", guild_name: "测试频道", guild_display_id: "123" }
  }
};
class Zxe extends le {
  actionName = re.GetGuildList;
  payloadSchema = p.Object({});
  returnSchema = p.Null();
  actionSummary = "获取频道列表";
  actionDescription = "获取当前帐号已加入的频道列表";
  actionTags = ["频道接口"];
  payloadExample = Tg.GetGuildList.payload;
  returnExample = Tg.GetGuildList.response;
  async _handle() {
  }
}
class ewe extends le {
  actionName = re.GetGuildProfile;
  payloadSchema = p.Object({});
  returnSchema = p.Null();
  actionSummary = "获取频道个人信息";
  actionDescription = "获取当前帐号在频道中的个人资料";
  actionTags = ["频道接口"];
  payloadExample = Tg.GetGuildProfile.payload;
  returnExample = Tg.GetGuildProfile.response;
  async _handle() {
  }
}
const twe = p.Object({
  clientkey: p.Optional(p.String({ description: "客户端Key" }))
}, { description: "获取ClientKey结果" });
class nwe extends le {
  actionName = re.GetClientkey;
  payloadSchema = p.Object({});
  returnSchema = twe;
  actionSummary = "获取ClientKey";
  actionDescription = "获取当前登录帐号的ClientKey";
  actionTags = ["扩展接口"];
  payloadExample = xr.GetClientkey.payload;
  returnExample = xr.GetClientkey.response;
  async _handle() {
    return { clientkey: (await this.core.apis.UserApi.forceFetchClientKey()).clientKey };
  }
}
const rwe = p.Object({
  cmd: p.String({ description: "命令字" }),
  data: p.String({ description: "十六进制数据" }),
  rsp: p.Union([p.String(), p.Boolean()], { default: !0, description: "是否等待响应" })
}), iwe = p.Union([p.String({ description: "响应十六进制数据" }), p.Undefined()], { description: "发包结果" });
class owe extends Xn {
  payloadSchema = rwe;
  returnSchema = iwe;
  actionName = re.SendPacket;
  actionSummary = "发送原始数据包";
  actionTags = ["系统扩展"];
  payloadExample = {
    cmd: "Example.Cmd",
    data: "123456",
    rsp: !0
  };
  returnExample = "123456";
  async _handle(e) {
    const n = typeof e.rsp == "boolean" ? e.rsp : e.rsp === "true", r = Buffer.from(e.data, "hex"), i = await this.core.apis.PacketApi.pkt.operation.sendPacket({ cmd: e.cmd, data: r }, n);
    return typeof i == "object" ? i.toString("hex") : void 0;
  }
}
const la = {
  SendPoke: {
    payload: { user_id: "123456789" },
    response: {}
  },
  SetGroupTodo: {
    payload: { group_id: "123456", message_id: "123456789" },
    response: {}
  },
  CompleteGroupTodo: {
    payload: { group_id: "123456", message_id: "123456789" },
    response: {}
  },
  CancelGroupTodo: {
    payload: { group_id: "123456", message_id: "123456789" },
    response: {}
  }
}, swe = p.Object({
  group_id: p.Optional(p.String({ description: "群号" })),
  user_id: p.String({ description: "用户QQ" }),
  target_id: p.Optional(p.String({ description: "目标QQ" }))
});
class U2 extends rxe {
  payloadSchema = swe;
  returnSchema = p.Null();
  actionSummary = "发送戳一戳";
  actionDescription = "在群聊或私聊中发送戳一戳动作";
  actionTags = ["核心接口"];
  payloadExample = la.SendPoke.payload;
  returnExample = la.SendPoke.response;
  async _handle(e) {
    const n = e.target_id?.toString() || e.user_id?.toString(), r = e.group_id?.toString() || e.user_id?.toString(), i = !!e.group_id;
    if (!n || !r)
      throw new Error("请检查参数，缺少 user_id 或 group_id");
    await this.core.apis.PacketApi.pkt.operation.SendPoke(i, +r, +n);
  }
}
class awe extends U2 {
  actionName = re.SendPoke;
}
class cwe extends U2 {
  actionName = re.GroupPoke;
}
class uwe extends U2 {
  actionName = re.FriendPoke;
}
const lwe = p.Object({
  face_id: p.Union([p.Number(), p.String()], { description: "图标ID" }),
  // 参考 face_config.json 的 QSid
  face_type: p.Union([p.Number(), p.String()], { default: "1", description: "图标类型" }),
  wording: p.String({ default: " ", description: "状态文字内容" })
}), pwe = p.String({ description: "错误信息（如果有）" });
class dwe extends le {
  actionName = re.SetDiyOnlineStatus;
  payloadSchema = lwe;
  returnSchema = pwe;
  actionSummary = "设置自定义在线状态";
  actionDescription = "设置自定义在线状态";
  actionTags = ["用户扩展"];
  payloadExample = {
    face_id: "123",
    face_type: "1",
    wording: "自定义状态"
  };
  returnExample = "";
  async _handle(e) {
    const n = await this.core.apis.UserApi.setDiySelfOnlineStatus(
      e.face_id.toString(),
      e.wording,
      e.face_type.toString()
    );
    if (n.result !== 0)
      throw new Error("设置在线状态失败");
    return n.errMsg;
  }
}
class fwe extends le {
  actionName = re.Exit;
  payloadSchema = p.Object({});
  returnSchema = p.Object({});
  actionSummary = "退出登录";
  actionTags = ["系统扩展"];
  payloadExample = {};
  returnExample = null;
  async _handle() {
    process.exit(0);
  }
}
const hwe = p.Object({
  group_id: p.String({ description: "群号" }),
  bot_appid: p.String({ description: "机器人AppID" }),
  button_id: p.String({ default: "", description: "按钮ID" }),
  callback_data: p.String({ default: "", description: "回调数据" }),
  msg_seq: p.String({ default: "10086", description: "消息序列号" })
}), mwe = p.Any({ description: "点击结果" });
class gwe extends le {
  actionName = re.ClickInlineKeyboardButton;
  payloadSchema = hwe;
  returnSchema = mwe;
  actionSummary = "点击内联键盘按钮";
  actionTags = ["消息扩展"];
  payloadExample = {
    group_id: "123456",
    bot_appid: "1234567890",
    button_id: "btn_1",
    callback_data: "",
    msg_seq: "10086"
  };
  returnExample = {};
  async _handle(e) {
    return await this.core.apis.MsgApi.clickInlineKeyboardButton({
      buttonId: e.button_id,
      peerId: e.group_id.toString(),
      botAppid: e.bot_appid,
      msgSeq: e.msg_seq,
      callback_data: e.callback_data,
      dmFlag: 0,
      chatType: 2
    });
  }
}
const ywe = p.Object({
  file_id: p.String({ description: "文件ID" })
}), vwe = p.Object({
  url: p.Optional(p.String({ description: "文件下载链接" }))
}, { description: "私聊文件URL信息" });
class bwe extends Xn {
  actionName = re.NapCat_GetPrivateFileUrl;
  payloadSchema = ywe;
  returnSchema = vwe;
  actionSummary = "获取私聊文件URL";
  actionDescription = "获取指定私聊文件的下载链接";
  actionTags = ["文件接口"];
  payloadExample = Ro.GetPrivateFileUrl.payload;
  returnExample = Ro.GetPrivateFileUrl.response;
  async _handle(e) {
    const n = Jt.decode(e.file_id);
    if (n?.fileUUID && n.msgId) {
      const r = await this.core.apis.MsgApi.getMsgsByMsgId(n.peer, [n.msgId]), i = this.core.selfInfo.uid, o = r.msgList[0]?.elements.map((s) => s.fileElement?.file10MMd5)[0];
      if (o)
        return {
          url: await this.core.apis.PacketApi.pkt.operation.GetPrivateFileUrl(i, n.fileUUID, o)
        };
    }
    throw new Error("real fileUUID not found!");
  }
}
var xwe = Object.defineProperty, wwe = (t, e, n) => e in t ? xwe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Ip = (t, e, n) => wwe(t, typeof e != "symbol" ? e + "" : e, n);
class Zs {
  constructor(e, n, r, i) {
    Ip(this, "_value"), Ip(this, "_fieldId"), Ip(this, "_opt"), Ip(this, "_callback"), this._value = n, this._fieldId = e, this._opt = r, this._callback = i;
  }
  get value() {
    return this._value;
  }
  set value(e) {
    this._value = e;
  }
  getTypeName() {
    return this.constructor.name;
  }
  getFieldId() {
    return this._fieldId;
  }
  getField(e) {
    return Iwe(e, this);
  }
}
class Swe extends Zs {
  getTypeName() {
    return "StringWrapper";
  }
}
class _we extends Zs {
  getTypeName() {
    return "UInt32Wrapper";
  }
}
const Tn = {
  UInt32Wrapper: "UInt32Wrapper",
  Int32Wrapper: "Int32Wrapper",
  Int64Wrapper: "Int64Wrapper",
  UInt64Wrapper: "UInt64Wrapper",
  StringWrapper: "StringWrapper",
  ArrayWrapper: "ArrayWrapper",
  BoolWrapper: "BoolWrapper",
  BytesWrapper: "BytesWrapper",
  DoubleWrapper: "DoubleWrapper",
  FloatWrapper: "FloatWrapper",
  Fixed64Wrapper: "Fixed64Wrapper",
  Fixed32Wrapper: "Fixed32Wrapper",
  SFixed32Wrapper: "SFixed32Wrapper",
  SFixed64Wrapper: "SFixed64Wrapper",
  SInt32Wrapper: "SInt32Wrapper",
  SInt64Wrapper: "SInt64Wrapper",
  UnknownWrapper: "UnknownWrapper"
}, Ewe = {
  [Tn.UInt32Wrapper]: w.UINT32,
  [Tn.Int32Wrapper]: w.INT32,
  [Tn.Int64Wrapper]: w.INT64,
  [Tn.UInt64Wrapper]: w.UINT64,
  [Tn.StringWrapper]: w.STRING,
  [Tn.BytesWrapper]: w.BYTES,
  [Tn.BoolWrapper]: w.BOOL,
  [Tn.DoubleWrapper]: w.DOUBLE,
  [Tn.FloatWrapper]: w.FLOAT,
  [Tn.Fixed64Wrapper]: w.FIXED64,
  [Tn.Fixed32Wrapper]: w.FIXED32,
  [Tn.SFixed32Wrapper]: w.SFIXED32,
  [Tn.SFixed64Wrapper]: w.SFIXED64,
  [Tn.SInt32Wrapper]: w.SINT32,
  [Tn.SInt64Wrapper]: w.SINT64,
  [Tn.UnknownWrapper]: w.BYTES
};
function JF(t) {
  return Ewe[t] || w.BYTES;
}
function XF(t = 0, e = !1, n = "") {
  return new Swe(t, n, e);
}
function Awe(t = 0, e = !1, n = 0) {
  return new _we(t, n, e);
}
function Iwe(t, e) {
  var n;
  const r = e.getTypeName(), i = e.getFieldId(), o = e._opt;
  if (r === Tn.ArrayWrapper) {
    const s = (n = e._callback) == null ? void 0 : n.call(e);
    if (s instanceof Ka)
      return {
        no: i,
        name: t,
        kind: "message",
        T: () => new Tp(t, s.generateFields()),
        opt: o || !1,
        repeat: Rr.PACKED
      };
    if (s instanceof Zs) {
      const a = s.getTypeName();
      return {
        no: i,
        name: t,
        kind: "scalar",
        T: JF(a),
        opt: o || !1,
        repeat: a === Tn.StringWrapper || a === Tn.BytesWrapper ? Rr.UNPACKED : Rr.PACKED
      };
    }
    throw new Error("ArrayWrapper item type error");
  }
  return {
    no: i,
    name: t,
    kind: "scalar",
    T: JF(r),
    opt: o || !1,
    repeat: Rr.NO
  };
}
class Ka {
  constructor() {
    Ip(this, "_fieldId", 0);
  }
  //默认标记类
  generateFields() {
    const e = [];
    for (const n of Object.keys(this)) {
      const r = "_" + n, i = this[r];
      i instanceof Zs && e.push(i.getField(n)), i instanceof Ka && e.push({
        no: i._fieldId,
        name: n,
        kind: "message",
        T: () => new Tp(r, i.generateFields()),
        repeat: Rr.NO,
        opt: !1
      });
    }
    return e;
  }
  assignFields(e) {
    for (const n of Object.keys(this)) {
      const r = "_" + n;
      let i = this[r];
      if (i instanceof Zs) {
        const o = e[n];
        o !== void 0 && (i.value = o);
      } else if (i instanceof Ka) {
        const o = e[n];
        o !== void 0 && i.assignFields(o);
      } else {
        const o = e[n];
        o !== void 0 && (this[r] = o);
      }
    }
  }
  toObject() {
    const e = {};
    for (const n of Object.keys(this)) {
      const r = "_" + n, i = this[r];
      i && (i instanceof Zs && (e[n] = i.value), i instanceof Ka && (e[n] = i.toObject()));
    }
    return e;
  }
  encode() {
    return new Tp("message", this.generateFields()).toBinary(this.toObject());
  }
  decode(e) {
    const n = new Tp("message", this.generateFields()).fromBinary(e);
    return this.assignFields(n), this;
  }
  then(e) {
    e(this);
  }
}
function Cwe(t) {
  return new Proxy(t, {
    set(e, n, r) {
      return e[n] instanceof Zs ? (e[n].value = r, !0) : (e[n] = r, !0);
    },
    get(e, n) {
      if (typeof n == "string" && n.startsWith("_")) {
        const i = n.slice(1);
        if (e[i])
          return e[i];
      }
      const r = e[n];
      return r instanceof Zs ? r.value : r;
    }
  });
}
function ZF(t, e) {
  const n = Cwe(new t());
  return n._fieldId = typeof t == "number" ? t : 0, n;
}
const Twe = p.Array(
  p.Object({
    uin: p.Number({ description: "QQ号" }),
    uid: p.String({ description: "用户UID" }),
    nick_name: p.String({ description: "昵称" }),
    age: p.Number({ description: "年龄" }),
    source: p.String({ description: "来源" })
  }),
  { description: "单向好友列表" }
);
class kwe extends le {
  actionName = re.GetUnidirectionalFriendList;
  payloadSchema = p.Object({});
  returnSchema = Twe;
  actionSummary = "获取单向好友列表";
  actionTags = ["用户扩展"];
  payloadExample = {};
  returnExample = [
    {
      uin: 123456789,
      uid: "u_123",
      nick_name: "单向好友",
      age: 20,
      source: "来源"
    }
  ];
  async pack_data(e) {
    return ZF(class extends Ka {
      type = Awe(2, !1, 0);
      data = XF(3, !1, e);
    }).encode();
  }
  async _handle() {
    const n = {
      uint64_uin: this.core.selfInfo.uin,
      uint64_top: 0,
      uint32_req_num: 99,
      bytes_cookies: ""
    }, r = await this.pack_data(JSON.stringify(n)), o = { cmd: "MQUpdateSvc_com_qq_ti.web.OidbSvc.0xe17_0", data: Buffer.from(r) }, s = await this.core.apis.PacketApi.pkt.operation.sendPacket(o, !0), a = ZF(class extends Ka {
      data = XF(4);
    }).decode(s);
    return JSON.parse(a.data).rpt_block_list.map((l) => ({
      uin: l.uint64_uin,
      uid: l.str_uid,
      nick_name: Buffer.from(l.bytes_nick, "base64").toString(),
      age: l.uint32_age,
      source: Buffer.from(l.bytes_source, "base64").toString()
    }));
  }
}
const Nwe = p.Object({
  group_id: p.String({ description: "群号" }),
  remark: p.String({ description: "备注" })
}), Pwe = p.Null({ description: "返回结果" });
class Dwe extends le {
  actionName = re.SetGroupRemark;
  payloadSchema = Nwe;
  returnSchema = Pwe;
  actionSummary = "设置群备注";
  actionDescription = "设置群备注";
  actionTags = ["群组扩展"];
  payloadExample = {
    group_id: "123456",
    remark: "测试群备注"
  };
  returnExample = null;
  async _handle(e) {
    const n = await this.core.apis.GroupApi.setGroupRemark(e.group_id, e.remark);
    if (n.result !== 0)
      throw new Error(`设置群备注失败, ${n.result}:${n.errMsg}`);
    return null;
  }
}
const Fwe = p.Object({
  group_id: p.String({ description: "群号" }),
  file_id: p.String({ description: "文件ID" }),
  current_parent_directory: p.String({ description: "当前父目录" }),
  target_parent_directory: p.String({ description: "目标父目录" })
}), Owe = p.Object({
  ok: p.Boolean({ description: "是否成功" })
}, { description: "移动文件结果" });
class Mwe extends Xn {
  actionName = re.MoveGroupFile;
  actionSummary = "移动群文件";
  actionTags = ["文件扩展"];
  payloadExample = {
    group_id: "123456",
    file_id: "/file_id",
    current_parent_directory: "/current_folder_id",
    target_parent_directory: "/target_folder_id"
  };
  returnExample = {
    ok: !0
  };
  payloadSchema = Fwe;
  returnSchema = Owe;
  async _handle(e) {
    const n = Jt.decode(e.file_id) || Jt.decodeModelId(e.file_id);
    if (n?.fileUUID)
      return await this.core.apis.PacketApi.pkt.operation.MoveGroupFile(+e.group_id, n.fileUUID, e.current_parent_directory, e.target_parent_directory), {
        ok: !0
      };
    throw new Error("real fileUUID not found!");
  }
}
const Rwe = p.Object({
  group_id: p.String({ description: "群号" }),
  file_id: p.String({ description: "文件ID" })
}), Bwe = p.Object({
  ok: p.Boolean({ description: "是否成功" })
}, { description: "转发文件结果" });
class Uwe extends Xn {
  actionName = re.TransGroupFile;
  actionSummary = "传输群文件";
  actionTags = ["文件扩展"];
  payloadExample = {
    group_id: "123456",
    file_id: "/file_id"
  };
  returnExample = {
    ok: !0
  };
  payloadSchema = Rwe;
  returnSchema = Bwe;
  async _handle(e) {
    const n = Jt.decode(e.file_id) || Jt.decodeModelId(e.file_id);
    if (n?.fileUUID) {
      const r = await this.core.apis.GroupApi.transGroupFile(e.group_id.toString(), n.fileUUID);
      if (r.transGroupFileResult.result.retCode === 0)
        return {
          ok: !0
        };
      throw new Error(r.transGroupFileResult.result.retMsg);
    }
    throw new Error("real fileUUID not found!");
  }
}
const Lwe = p.Object({
  group_id: p.String({ description: "群号" }),
  file_id: p.String({ description: "文件ID" }),
  current_parent_directory: p.String({ description: "当前父目录" }),
  new_name: p.String({ description: "新文件名" })
}), jwe = p.Object({
  ok: p.Boolean({ description: "是否成功" })
}, { description: "重命名文件结果" });
class Qwe extends Xn {
  actionName = re.RenameGroupFile;
  actionSummary = "重命名群文件";
  actionTags = ["文件扩展"];
  payloadExample = {
    group_id: "123456",
    file_id: "/file_id",
    current_parent_directory: "/",
    new_name: "new_name.jpg"
  };
  returnExample = {
    ok: !0
  };
  payloadSchema = Lwe;
  returnSchema = jwe;
  async _handle(e) {
    const n = Jt.decode(e.file_id) || Jt.decodeModelId(e.file_id);
    if (n?.fileUUID)
      return await this.core.apis.PacketApi.pkt.operation.RenameGroupFile(+e.group_id, n.fileUUID, e.current_parent_directory, e.new_name), {
        ok: !0
      };
    throw new Error("real fileUUID not found!");
  }
}
const $we = p.Object({
  private_rkey: p.Optional(p.String({ description: "私聊 RKey" })),
  group_rkey: p.Optional(p.String({ description: "群聊 RKey" })),
  expired_time: p.Optional(p.Number({ description: "过期时间" })),
  name: p.String({ description: "名称" })
});
class Gwe extends Xn {
  actionName = re.GetRkeyServer;
  actionSummary = "获取 RKey 服务器";
  actionTags = ["系统扩展"];
  payloadExample = {};
  returnExample = {
    private_rkey: "&rkey=123456789",
    group_rkey: "&rkey=123456789",
    expired_time: 169456e4,
    name: "NapCat 4"
  };
  payloadSchema = p.Object({});
  returnSchema = $we;
  rkeyCache = null;
  expiryTime = null;
  async _handle() {
    if (this.expiryTime && this.expiryTime > Math.floor(Date.now() / 1e3) && this.rkeyCache)
      return this.rkeyCache;
    const e = await this.core.apis.PacketApi.pkt.operation.FetchRkey(), n = e.filter((i) => i.type === 10)[0], r = e.filter((i) => i.type === 20)[0];
    return this.expiryTime = Math.floor(Date.now() / 1e3) + Math.min(+r.ttl.toString(), +n.ttl.toString()), this.rkeyCache = {
      private_rkey: n ? n.rkey : void 0,
      group_rkey: r ? r.rkey : void 0,
      expired_time: this.expiryTime,
      name: "NapCat 4"
    }, this.rkeyCache;
  }
}
const qwe = p.Array(p.Object({
  type: p.String({ description: "类型 (private/group)" }),
  rkey: p.String({ description: "RKey" }),
  created_at: p.Number({ description: "创建时间" }),
  ttl: p.Number({ description: "有效期" })
}), { description: "RKey 列表" });
class Hwe extends Xn {
  actionName = re.GetRkeyEx;
  payloadSchema = p.Object({});
  returnSchema = qwe;
  actionSummary = "获取扩展 RKey";
  actionTags = ["系统扩展"];
  payloadExample = {};
  returnExample = [
    {
      type: "private",
      rkey: "rkey_123",
      created_at: 1734567890,
      ttl: 3600
    }
  ];
  async _handle() {
    return (await this.core.apis.PacketApi.pkt.operation.FetchRkey()).map((n) => ({
      type: n.type === 10 ? "private" : "group",
      rkey: n.rkey,
      created_at: Number(n.time),
      ttl: Number(n.ttl)
    }));
  }
}
class Wwe extends le {
  actionName = re.CleanCache;
  payloadSchema = p.Object({});
  returnSchema = p.Null();
  actionSummary = "清理缓存";
  actionDescription = "清理缓存";
  actionTags = ["系统接口"];
  payloadExample = {};
  returnExample = null;
  async _handle() {
    try {
      const e = this.core.NapCatTempPath, r = (await G2(e)).map(async (s) => {
        const a = gm(e, s);
        try {
          await q2(a), this.core.context.logger.log(`已删除文件: ${a}`);
        } catch (c) {
          this.core.context.logger.log(`删除文件 ${a} 失败: ${c.message}`);
        }
      });
      await Promise.all(r);
      const i = be.join(this.core.dataPath, this.core.selfInfo.uin || "10001", "nt_qq", "nt_data"), o = ["Pic", "Ptt", "Video", "File", "log"];
      for (const s of o) {
        const a = be.join(i, s);
        try {
          const c = await G2(a).catch(() => null);
          if (c) {
            const u = c.map(async (l) => {
              const d = be.join(a, l);
              try {
                await q2(d), this.core.context.logger.log(`已删除文件: ${d}`);
              } catch (f) {
                this.core.context.logger.log(`删除文件 ${d} 失败: ${f.message}`);
              }
            });
            await Promise.all(u), this.core.context.logger.log(`目录清理完成: ${a}`);
          }
        } catch (c) {
          this.core.context.logger.log(`清理目录 ${a} 失败: ${c.message}`);
        }
      }
      this.core.context.logger.log(`临时文件夹清理完成: ${e}`);
    } catch (e) {
      throw this.core.context.logger.log(`清理缓存失败: ${e.message}`), e;
    }
  }
}
const zwe = p.Object({
  user_id: p.String({ description: "对方 QQ 号" }),
  remark: p.String({ description: "备注内容" })
});
class Kwe extends le {
  actionName = re.SetFriendRemark;
  payloadSchema = zwe;
  returnSchema = p.Null();
  actionSummary = "设置好友备注";
  actionDescription = "设置好友备注";
  actionTags = ["用户接口"];
  payloadExample = {
    user_id: "123456",
    remark: "测试备注"
  };
  returnExample = null;
  errorExamples = [
    { code: 1400, description: "备注设置失败（好友不存在或非法输入）" }
  ];
  async _handle(e) {
    const n = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString());
    if (!await this.core.apis.FriendApi.isBuddy(n))
      throw new Error(`用户 ${e.user_id} 不是好友`);
    await this.core.apis.FriendApi.setBuddyRemark(n, e.remark);
  }
}
const Vwe = p.Object({
  flag: p.String({ description: "请求 flag" }),
  // 注意强制String 非isNumeric 不遵守则不符合设计
  approve: p.Boolean({ default: !0, description: "是否同意 (强制为 true)" })
  // 该字段没有语义 仅做保留 强制为True
});
class Ywe extends le {
  actionName = re.SetDoubtFriendsAddRequest;
  payloadSchema = Vwe;
  returnSchema = p.Any();
  actionSummary = "处理可疑好友申请";
  actionDescription = "同意或拒绝系统的可疑好友申请";
  actionTags = ["系统接口"];
  payloadExample = {
    flag: "12345",
    approve: !0
  };
  returnExample = null;
  async _handle(e) {
    return await this.core.apis.FriendApi.handleDoubtFriendRequest(e.flag);
  }
}
const eO = {
  GetDoubtFriendsAddRequest: {
    payload: { count: 10 },
    response: [{ user_id: 123456789, nickname: "昵称", age: 20, sex: "male", reason: "申请理由", flag: "flag_123" }]
  }
}, Jwe = p.Object({
  count: p.Number({ default: 50, description: "获取数量" })
});
class Xwe extends le {
  actionName = re.GetDoubtFriendsAddRequest;
  payloadSchema = Jwe;
  returnSchema = p.Any({ description: "可疑好友申请列表" });
  actionSummary = "获取可疑好友申请";
  actionDescription = "获取系统的可疑好友申请列表";
  actionTags = ["系统接口"];
  payloadExample = eO.GetDoubtFriendsAddRequest.payload;
  returnExample = eO.GetDoubtFriendsAddRequest.response;
  async _handle(e) {
    return await this.core.apis.FriendApi.getDoubtFriendRequest(e.count);
  }
}
const Zwe = p.Object({
  group_id: p.String({ description: "群号" }),
  add_type: p.Number({ description: "加群方式" }),
  group_question: p.Optional(p.String({ description: "加群问题" })),
  group_answer: p.Optional(p.String({ description: "加群答案" }))
}), eSe = p.Null({ description: "返回结果" });
class tSe extends le {
  actionName = re.SetGroupAddOption;
  actionSummary = "设置群加群选项";
  actionTags = ["群组扩展"];
  payloadExample = {
    group_id: "123456",
    add_type: 1
  };
  returnExample = null;
  payloadSchema = Zwe;
  returnSchema = eSe;
  async _handle(e) {
    const n = await this.core.apis.GroupApi.setGroupAddOption(e.group_id, {
      addOption: e.add_type,
      groupQuestion: e.group_question,
      groupAnswer: e.group_answer
    });
    if (n.result !== 0)
      throw new Error(`设置群添加选项失败, ${n.result}:${n.errMsg}`);
    return null;
  }
}
const nSe = p.Object({
  group_id: p.String({ description: "群号" }),
  no_code_finger_open: p.Optional(p.Number({ description: "未知" })),
  no_finger_open: p.Optional(p.Number({ description: "未知" }))
}), rSe = p.Null({ description: "返回结果" });
class iSe extends le {
  actionName = re.SetGroupSearch;
  actionSummary = "设置群搜索选项";
  actionTags = ["群组扩展"];
  payloadExample = {
    group_id: "123456"
  };
  returnExample = null;
  payloadSchema = nSe;
  returnSchema = rSe;
  async _handle(e) {
    const n = await this.core.apis.GroupApi.setGroupSearch(e.group_id, {
      noCodeFingerOpenFlag: e.no_code_finger_open,
      noFingerOpenFlag: e.no_finger_open
    });
    if (n.result !== 0)
      throw new Error(`设置群搜索失败, ${n.result}:${n.errMsg}`);
    return null;
  }
}
const oSe = p.Object({
  group_id: p.String({ description: "群号" }),
  robot_member_switch: p.Optional(p.Number({ description: "机器人成员开关" })),
  robot_member_examine: p.Optional(p.Number({ description: "机器人成员审核" }))
}), sSe = p.Null({ description: "返回结果" });
class aSe extends le {
  actionName = re.SetGroupRobotAddOption;
  actionSummary = "设置群机器人加群选项";
  actionTags = ["群组扩展"];
  payloadExample = {
    group_id: "123456"
  };
  returnExample = null;
  payloadSchema = oSe;
  returnSchema = sSe;
  async _handle(e) {
    const n = await this.core.apis.GroupApi.setGroupRobotAddOption(
      e.group_id,
      e.robot_member_switch,
      e.robot_member_examine
    );
    if (n.result !== 0)
      throw new Error(`设置群机器人添加选项失败, ${n.result}:${n.errMsg}`);
    return null;
  }
}
const cSe = p.Object({
  group_id: p.String({ description: "群号" }),
  user_id: p.Array(p.String(), { description: "QQ号列表" }),
  reject_add_request: p.Optional(p.Union([p.Boolean(), p.String()], { description: "是否拒绝加群请求" }))
}), uSe = p.Null({ description: "返回结果" });
class lSe extends le {
  actionName = re.SetGroupKickMembers;
  payloadSchema = cSe;
  returnSchema = uSe;
  actionSummary = "批量踢出群成员";
  actionDescription = "从指定群聊中批量踢出多个成员";
  actionTags = ["扩展接口"];
  payloadExample = xr.SetGroupKickMembers.payload;
  returnExample = xr.SetGroupKickMembers.response;
  async _handle(e) {
    const n = e.reject_add_request?.toString() === "true", r = await Promise.all(e.user_id.map(async (i) => await this.core.apis.UserApi.getUidByUinV2(i)));
    return await this.core.apis.GroupApi.kickMember(e.group_id.toString(), r.filter((i) => !!i), n), null;
  }
}
const pSe = p.Object({
  group_id: p.String({ description: "群号" })
}), dSe = p.Object({
  group_id: p.Number({ description: "群号" }),
  group_name: p.String({ description: "群名称" }),
  member_count: p.Number({ description: "成员数量" }),
  max_member_count: p.Number({ description: "最大成员数量" }),
  group_all_shut: p.Number({ description: "全员禁言状态" }),
  group_remark: p.String({ description: "群备注" })
}, { description: "群详细信息" });
class fSe extends le {
  actionName = re.GetGroupDetailInfo;
  payloadSchema = pSe;
  returnSchema = dSe;
  actionSummary = "获取群详细信息";
  actionDescription = "获取群聊的详细信息，包括成员数、最大成员数等";
  actionTags = ["群组接口"];
  payloadExample = ht.GetGroupDetailInfo.payload;
  returnExample = ht.GetGroupDetailInfo.response;
  async _handle(e) {
    const n = await this.core.apis.GroupApi.fetchGroupDetail(e.group_id.toString());
    return {
      ...n,
      group_all_shut: n.shutUpAllTimestamp > 0 ? -1 : 0,
      group_remark: "",
      group_id: +e.group_id,
      group_name: n.groupName,
      member_count: n.memberNum,
      max_member_count: n.maxMemberNum
    };
  }
}
const hSe = p.Array(
  p.Object({
    request_id: p.Number({ description: "请求ID" }),
    invitor_uin: p.Number({ description: "邀请者QQ" }),
    invitor_nick: p.Optional(p.String({ description: "邀请者昵称" })),
    group_id: p.Number({ description: "群号" }),
    message: p.Optional(p.String({ description: "验证信息" })),
    group_name: p.Optional(p.String({ description: "群名称" })),
    checked: p.Boolean({ description: "是否已处理" }),
    actor: p.Number({ description: "处理者QQ" }),
    requester_nick: p.Optional(p.String({ description: "请求者昵称" }))
  }),
  { description: "群通知列表" }
);
class mSe extends le {
  actionName = re.GetGroupIgnoreAddRequest;
  payloadSchema = p.Object({});
  returnSchema = hSe;
  actionSummary = "获取群被忽略的加群请求";
  actionTags = ["群组接口"];
  payloadExample = {};
  returnExample = [
    {
      request_id: 12345,
      invitor_uin: 123456789,
      invitor_nick: "邀请者",
      group_id: 123456789,
      message: "加群请求",
      group_name: "群名称",
      checked: !1,
      actor: 0,
      requester_nick: "请求者"
    }
  ];
  async _handle() {
    const e = this.core.apis.UserApi, r = await this.core.apis.GroupApi.getSingleScreenNotifies(!0, 10), i = [], o = r.filter((s) => s.type === 7).map(async (s) => {
      const a = s.user1?.uid ? +await e.getUinByUidV2(s.user1.uid) : 0, c = s.user2?.uid ? +await e.getUinByUidV2(s.user2.uid) : 0;
      i.push({
        request_id: +s.seq,
        invitor_uin: a,
        invitor_nick: s.user1?.nickName,
        group_id: +s.group?.groupCode,
        message: s?.postscript,
        group_name: s.group?.groupName,
        checked: s.status !== Ga.KUNHANDLE,
        actor: c,
        requester_nick: s.user1?.nickName
      });
    });
    return await Promise.all(o), i;
  }
}
const gSe = p.Object({
  category: p.String({ description: "分类ID" }),
  count: p.String({ default: "50", description: "获取数量" })
}), ySe = p.Any({ description: "收藏列表" });
class vSe extends le {
  actionName = re.GetCollectionList;
  payloadSchema = gSe;
  returnSchema = ySe;
  actionSummary = "获取收藏列表";
  actionTags = ["系统扩展"];
  payloadExample = {
    category: "0",
    count: "50"
  };
  returnExample = {
    errCode: 0,
    errMsg: "",
    collectionSearchList: {
      collectionItemList: [
        {
          cid: "123456",
          type: 8,
          status: 1,
          author: {
            type: 2,
            numId: "123456",
            strId: "昵称",
            groupId: "123456",
            groupName: "群名",
            uid: "123456"
          },
          bid: 1,
          category: 1,
          createTime: "1769169157000",
          collectTime: "1769413477691",
          modifyTime: "1769413477691",
          sequence: "1769413476735",
          shareUrl: "",
          customGroupId: 0,
          securityBeat: !1,
          summary: {
            textSummary: null,
            linkSummary: null,
            gallerySummary: null,
            audioSummary: null,
            videoSummary: null,
            fileSummary: null,
            locationSummary: null,
            richMediaSummary: {
              title: "",
              subTitle: "",
              brief: "text",
              picList: [],
              contentType: 1,
              originalUri: "",
              publisher: "",
              richMediaVersion: 0
            }
          }
        }
      ],
      hasMore: !1,
      bottomTimeStamp: "1769413477691"
    }
  };
  async _handle(e) {
    return await this.core.apis.CollectionApi.getAllCollection(+e.category, +e.count);
  }
}
const bSe = p.Object({
  group_id: p.Union([p.String(), p.Number()], { description: "群号" }),
  message_id: p.Optional(p.String({ description: "消息ID" })),
  message_seq: p.Optional(p.String({ description: "消息Seq (可选)" }))
});
class L2 extends Xn {
  payloadSchema = bSe;
  returnSchema = p.Null();
  actionTags = ["核心接口"];
  async _handle(e) {
    const n = +e.group_id;
    if (e.message_seq)
      return await this.handleGroupTodo(n, e.message_seq.toString());
    if (!e.message_id)
      throw new Error("缺少参数 message_id 或 message_seq");
    const r = {
      chatType: Ne.KCHATTYPEGROUP,
      peerUid: e.group_id.toString()
    }, { MsgId: i, Peer: o } = rt.getMsgIdAndPeerByShortId(+e.message_id) ?? { Peer: r, MsgId: e.message_id.toString() }, s = (await this.core.apis.MsgApi.getMsgsByMsgId(o, [i])).msgList[0];
    if (!s)
      throw new Error("消息不存在");
    await this.handleGroupTodo(n, s.msgSeq);
  }
}
class xSe extends L2 {
  actionName = re.CompleteGroupTodo;
  actionSummary = "完成群待办";
  actionDescription = "将指定消息对应的群待办标记为已完成";
  payloadExample = la.CompleteGroupTodo.payload;
  returnExample = la.CompleteGroupTodo.response;
  async handleGroupTodo(e, n) {
    await this.core.apis.PacketApi.pkt.operation.CompleteGroupTodo(e, n);
  }
}
class wSe extends L2 {
  actionName = re.CancelGroupTodo;
  actionSummary = "取消群待办";
  actionDescription = "将指定消息对应的群待办取消";
  payloadExample = la.CancelGroupTodo.payload;
  returnExample = la.CancelGroupTodo.response;
  async handleGroupTodo(e, n) {
    await this.core.apis.PacketApi.pkt.operation.CancelGroupTodo(e, n);
  }
}
class SSe extends L2 {
  actionName = re.SetGroupTodo;
  actionSummary = "设置群待办";
  actionDescription = "将指定消息设置为群待办";
  payloadExample = la.SetGroupTodo.payload;
  returnExample = la.SetGroupTodo.response;
  async handleGroupTodo(e, n) {
    await this.core.apis.PacketApi.pkt.operation.SetGroupTodo(e, n);
  }
}
const _Se = p.Object({
  group_id: p.String({ description: "群号" }),
  attach_info: p.Optional(p.String({ default: "", description: "附加信息（用于分页，从上一次返回结果中获取）" }))
}), ESe = p.Object({
  album_list: p.Array(p.Any(), { description: "群相册列表" }),
  attach_info: p.String({ description: "分页附加信息，传入下一次请求以获取更多数据" }),
  has_more: p.Boolean({ description: "是否有更多数据" })
}, { description: "群相册列表响应" });
class ASe extends le {
  actionName = re.GetQunAlbumList;
  actionSummary = "获取群相册列表";
  actionTags = ["群组扩展"];
  payloadExample = {
    group_id: "123456",
    attach_info: ""
  };
  returnExample = {
    album_list: [
      {
        album_id: "album_1",
        album_name: "测试相册",
        cover_url: "http://example.com/cover.jpg",
        create_time: 1734567890
      }
    ],
    attach_info: "",
    has_more: !1
  };
  payloadSchema = _Se;
  returnSchema = ESe;
  async _handle(e) {
    const n = (await this.core.apis.WebApi.getAlbumListByNTQQ(e.group_id, e.attach_info)).response;
    return {
      album_list: n.album_list,
      attach_info: n.attach_info,
      has_more: n.has_more
    };
  }
}
const ISe = p.Object({
  group_id: p.String({ description: "群号" }),
  album_id: p.String({ description: "相册ID" }),
  album_name: p.String({ description: "相册名称" }),
  file: p.String({ description: "图片路径、URL或Base64" })
}), CSe = p.Any({ description: "上传结果" });
class TSe extends le {
  actionName = re.UploadImageToQunAlbum;
  actionSummary = "上传图片到群相册";
  actionTags = ["群组扩展"];
  payloadExample = {
    group_id: "123456",
    album_id: "album_id_1",
    album_name: "相册1",
    file: "/path/to/image.jpg"
  };
  returnExample = {
    result: null
  };
  payloadSchema = ISe;
  returnSchema = CSe;
  async _handle(e) {
    const n = await Ji(this.core.NapCatTempPath, e.file);
    try {
      return await this.core.apis.WebApi.uploadImageToQunAlbum(e.group_id, e.album_id, e.album_name, n.path);
    } finally {
      !n.isLocal && n.path && sr(n.path) && await q_(n.path);
    }
  }
}
const kSe = p.Object({
  group_id: p.String({ description: "群号" }),
  album_id: p.String({ description: "相册 ID" }),
  lloc: p.String({ description: "图片 ID" }),
  content: p.String({ description: "评论内容" })
});
class NSe extends le {
  actionName = re.DoGroupAlbumComment;
  actionSummary = "发表群相册评论";
  actionTags = ["群组扩展"];
  payloadExample = {
    group_id: "123456",
    album_id: "album_id_1",
    lloc: "media_id_1",
    content: "很有意思"
  };
  returnExample = {
    result: {}
  };
  payloadSchema = kSe;
  returnSchema = p.Any({ description: "评论结果" });
  async _handle(e) {
    return await this.core.apis.WebApi.doAlbumMediaPlainCommentByNTQQ(
      e.group_id,
      e.album_id,
      e.lloc,
      e.content
    );
  }
}
const PSe = p.Object({
  group_id: p.String({ description: "群号" }),
  album_id: p.String({ description: "相册ID" }),
  attach_info: p.Optional(p.String({ default: "", description: "附加信息（用于分页）" }))
}), DSe = p.Any({ description: "相册媒体列表" });
class FSe extends le {
  actionName = re.GetGroupAlbumMediaList;
  actionSummary = "获取群相册媒体列表";
  actionTags = ["群组扩展"];
  payloadExample = {
    group_id: "123456",
    album_id: "album_id_1"
  };
  returnExample = {
    media_list: [
      { media_id: "media_id_1", url: "http://example.com/1.jpg" }
    ]
  };
  payloadSchema = PSe;
  returnSchema = DSe;
  async _handle(e) {
    return await this.core.apis.WebApi.getAlbumMediaListByNTQQ(
      e.group_id,
      e.album_id,
      e.attach_info
    );
  }
}
const $U = p.Object({
  group_id: p.String({ description: "群号" }),
  album_id: p.String({ description: "相册ID" }),
  batch_id: p.String({ description: "batch_id" }),
  lloc: p.Optional(p.String({ description: "lloc，若对整个上传操作则不填" }))
}), GU = p.Any({ description: "操作结果" });
class OSe extends le {
  actionName = re.SetGroupAlbumMediaLike;
  actionSummary = "点赞群相册媒体";
  actionTags = ["群组扩展"];
  payloadExample = {
    group_id: "123456",
    album_id: "album_id_123",
    batch_id: "112233",
    lloc: "aabbcc12213123"
  };
  returnExample = {
    result: {}
  };
  payloadSchema = $U;
  returnSchema = GU;
  async _handle(e) {
    return await this.core.apis.WebApi.doAlbumMediaLikeByNTQQ(
      e.group_id,
      e.album_id,
      e.batch_id,
      e.lloc,
      !0
      // isLike = true
    );
  }
}
class MSe extends le {
  actionName = re.CancelGroupAlbumMediaLike;
  // 注意：需要在 router/index.ts 的 ActionName 枚举中补充该定义
  actionSummary = "取消点赞群相册媒体";
  actionTags = ["群组扩展"];
  payloadExample = {
    group_id: "123456",
    album_id: "album_id",
    batch_id: "112233",
    lloc: "aabbcc"
  };
  returnExample = {
    result: {}
  };
  payloadSchema = $U;
  returnSchema = GU;
  async _handle(e) {
    return await this.core.apis.WebApi.doAlbumMediaLikeByNTQQ(
      e.group_id,
      e.album_id,
      e.batch_id,
      e.lloc,
      !1
    );
  }
}
const RSe = p.Object({
  group_id: p.String({ description: "群号" }),
  album_id: p.String({ description: "相册ID" }),
  lloc: p.String({ description: "媒体ID (lloc)" })
}), BSe = p.Any({ description: "删除结果" });
class USe extends le {
  actionName = re.DelGroupAlbumMedia;
  actionSummary = "删除群相册媒体";
  actionTags = ["群组扩展"];
  payloadExample = {
    group_id: "123456",
    album_id: "album_id_1",
    lloc: "media_id_1"
  };
  returnExample = {
    result: {}
  };
  payloadSchema = RSe;
  returnSchema = BSe;
  async _handle(e) {
    return await this.core.apis.WebApi.deleteAlbumMediaByNTQQ(
      e.group_id,
      e.album_id,
      e.lloc
    );
  }
}
class LSe extends le {
  actionName = re.CleanStreamTempFile;
  actionSummary = "清理流式传输临时文件";
  actionTags = ["流式传输扩展"];
  payloadExample = {};
  returnExample = {
    message: "success"
  };
  payloadSchema = p.Object({});
  returnSchema = p.Null();
  async _handle(e) {
    try {
      const n = this.core.NapCatTempPath, i = (await dL(n)).map(async (o) => {
        const s = yn(n, o);
        try {
          await q_(s), this.core.context.logger.log(`已删除文件: ${s}`);
        } catch (a) {
          this.core.context.logger.log(`删除文件 ${s} 失败: ${a.message}`);
        }
      });
      await Promise.all(i);
    } catch (n) {
      this.core.context.logger.log(`清理流临时文件失败: ${n.message}`);
    }
  }
}
class j2 extends le {
  async resolveDownload(e) {
    const n = e || "";
    let r = "", i = "", o = 0;
    const s = Jt.decode(n);
    if (s && s.msgId && s.elementId) {
      const { peer: u, msgId: l, elementId: d } = s;
      r = await this.core.apis.FileApi.downloadMedia(l, u.chatType, u.peerUid, d, "", "");
      const m = (await this.core.apis.MsgApi.getMsgsByMsgId(u, [l]))?.msgList.find((y) => y.msgId === l)?.elements.find((y) => y.elementId === d), h = m?.videoElement ?? m?.fileElement ?? m?.pttElement ?? m?.picElement;
      if (!h) throw new Error("element not found");
      return o = parseInt(h.fileSize?.toString() ?? "0"), i = h.fileName ?? "", { downloadPath: r, fileName: i, fileSize: o };
    }
    const a = Jt.decodeModelId(n);
    if (a && a.modelId) {
      const { peer: u, modelId: l } = a;
      return r = await this.core.apis.FileApi.downloadFileForModelId(u, l, ""), { downloadPath: r, fileName: i, fileSize: o };
    }
    const c = await this.core.apis.FileApi.searchForFile([n]);
    if (c) {
      const u = parseInt(c.fileSize), l = this.obContext.configLoader.configData.timeout, d = TA(l, u, l.downloadSpeedKBps);
      return r = await this.core.apis.FileApi.downloadFileById(c.id, u, d), o = u, i = c.fileName, { downloadPath: r, fileName: i, fileSize: o };
    }
    throw new Error("file not found");
  }
  async streamFileChunks(e, n, r, i) {
    const s = (await de.promises.stat(n)).size, a = de.createReadStream(n, { highWaterMark: r });
    let c = 0, u = 0;
    for await (const l of a) {
      const d = l.toString("base64");
      u += l.length, await e.send({
        type: jr.Stream,
        data_type: i,
        index: c,
        data: d,
        size: l.length,
        progress: Math.round(u / s * 100),
        base64_size: d.length
      }), c++;
    }
    return { totalChunks: c, totalBytes: u };
  }
}
const jSe = p.Object({
  file: p.Optional(p.String({ description: "文件路径或 URL" })),
  file_id: p.Optional(p.String({ description: "文件 ID" })),
  chunk_size: p.Optional(p.Number({ default: 64 * 1024, description: "分块大小 (字节)" }))
  // 默认64KB分块
});
class QSe extends j2 {
  actionName = re.DownloadFileStream;
  payloadSchema = jSe;
  returnSchema = p.Any({ description: "下载结果 (流式)" });
  actionSummary = "下载文件流";
  actionDescription = "以流式方式从网络或本地下载文件";
  actionTags = ["流式接口"];
  payloadExample = {
    file: "http://example.com/file.png"
  };
  returnExample = {
    type: "stream",
    data_type: "file_info",
    file_name: "file.png",
    file_size: 1024
  };
  useStream = !0;
  async _handle(e, n, r, i) {
    try {
      e.file ||= e.file_id || "";
      const o = e.chunk_size || 64 * 1024, { downloadPath: s, fileName: a, fileSize: c } = await this.resolveDownload(e.file), u = await de.promises.stat(s), l = c || u.size;
      await i.send({
        type: jr.Stream,
        data_type: "file_info",
        file_name: a,
        file_size: l,
        chunk_size: o
      });
      const { totalChunks: d, totalBytes: f } = await this.streamFileChunks(i, s, o, "file_chunk");
      return {
        type: jr.Response,
        data_type: "file_complete",
        total_chunks: d,
        total_bytes: f,
        message: "Download completed"
      };
    } catch (o) {
      throw new Error(`Download failed: ${o.message}`);
    }
  }
}
const $Se = ["mp3", "amr", "wma", "m4a", "spx", "ogg", "wav", "flac"], GSe = p.Object({
  file: p.Optional(p.String({ description: "文件路径或 URL" })),
  file_id: p.Optional(p.String({ description: "文件 ID" })),
  chunk_size: p.Optional(p.Number({ default: 64 * 1024, description: "分块大小 (字节)" })),
  // 默认64KB分块
  out_format: p.Optional(p.String({ description: "输出格式" }))
});
class qSe extends j2 {
  actionName = re.DownloadFileRecordStream;
  actionSummary = "下载语音文件流";
  actionTags = ["流式传输扩展"];
  payloadExample = {
    file: "record_file_id"
  };
  returnExample = {
    file: "temp_record_path"
  };
  payloadSchema = GSe;
  returnSchema = p.Any({ description: "下载结果 (流式)" });
  useStream = !0;
  async _handle(e, n, r, i) {
    try {
      e.file ||= e.file_id || "";
      const o = e.chunk_size || 64 * 1024, { downloadPath: s, fileName: a, fileSize: c } = await this.resolveDownload(e.file);
      let u = s;
      if (e.out_format && typeof e.out_format == "string") {
        if (!$Se.includes(e.out_format))
          throw new Error("转换失败 out_format 字段可能格式不正确");
        const h = `${s}.${e.out_format}`;
        try {
          await de.promises.access(h), u = h;
        } catch {
          await ns.convertAudioFmt(s, h, e.out_format), u = h;
        }
      }
      const l = await de.promises.stat(u), d = c || l.size;
      await i.send({
        type: jr.Stream,
        data_type: "file_info",
        file_name: a,
        file_size: d,
        chunk_size: o,
        out_format: e.out_format
      });
      const { totalChunks: f, totalBytes: m } = await this.streamFileChunks(i, u, o, "file_chunk");
      return {
        type: jr.Response,
        data_type: "file_complete",
        total_chunks: f,
        total_bytes: m,
        message: "Download completed"
      };
    } catch (o) {
      throw new Error(`Download failed: ${o.message}`);
    }
  }
}
const HSe = p.Object({
  file: p.Optional(p.String({ description: "文件路径或 URL" })),
  file_id: p.Optional(p.String({ description: "文件 ID" })),
  chunk_size: p.Optional(p.Number({ default: 64 * 1024, description: "分块大小 (字节)" }))
  // 默认64KB分块
});
class WSe extends j2 {
  actionName = re.DownloadFileImageStream;
  actionSummary = "下载图片文件流";
  actionTags = ["流式传输扩展"];
  payloadExample = {
    file: "image_file_id"
  };
  returnExample = {
    file: "temp_image_path"
  };
  payloadSchema = HSe;
  returnSchema = p.Any({ description: "下载结果 (流式)" });
  useStream = !0;
  async _handle(e, n, r, i) {
    try {
      e.file ||= e.file_id || "";
      const o = e.chunk_size || 64 * 1024, { downloadPath: s, fileName: a, fileSize: c } = await this.resolveDownload(e.file), u = await de.promises.stat(s), l = c || u.size, { width: d, height: f } = await wE(s);
      await i.send({
        type: jr.Stream,
        data_type: "file_info",
        file_name: a,
        file_size: l,
        chunk_size: o,
        width: d,
        height: f
      });
      const { totalChunks: m, totalBytes: h } = await this.streamFileChunks(i, s, o, "file_chunk");
      return {
        type: jr.Response,
        data_type: "file_complete",
        total_chunks: m,
        total_bytes: h,
        message: "Download completed"
      };
    } catch (o) {
      throw new Error(`Download failed: ${o.message}`);
    }
  }
}
const zSe = p.Object({
  error: p.Optional(p.Boolean({ default: !1, description: "是否触发测试错误" }))
});
class KSe extends le {
  actionName = re.TestDownloadStream;
  actionSummary = "测试下载流";
  actionTags = ["流式传输扩展"];
  payloadExample = {
    url: "http://example.com/file"
  };
  returnExample = {
    success: !0
  };
  payloadSchema = zSe;
  returnSchema = p.Any({ description: "测试流数据" });
  useStream = !0;
  async _handle(e, n, r, i) {
    for (let o = 0; o < 10; o++)
      await i.send({ type: jr.Stream, data: `Index-> ${o + 1}`, data_type: "data_chunk" }), await new Promise((s) => setTimeout(s, 100));
    if (e.error)
      throw new Error("This is a test error");
    return {
      type: jr.Response,
      data_type: "data_complete",
      data: "Stream transmission complete"
    };
  }
}
const Iw = {
  TIMEOUT: 600 * 1e3,
  // 10分钟超时
  MEMORY_THRESHOLD: 10 * 1024 * 1024,
  // 10MB，超过使用磁盘
  MEMORY_LIMIT: 100 * 1024 * 1024
  // 100MB内存总限制
}, VSe = p.Object({
  stream_id: p.String({ description: "流 ID" }),
  chunk_data: p.Optional(p.String({ description: "分块数据 (Base64)" })),
  chunk_index: p.Optional(p.Number({ description: "分块索引" })),
  total_chunks: p.Optional(p.Number({ description: "总分块数" })),
  file_size: p.Optional(p.Number({ description: "文件总大小" })),
  expected_sha256: p.Optional(p.String({ description: "期望的 SHA256" })),
  is_complete: p.Optional(p.Boolean({ description: "是否完成" })),
  filename: p.Optional(p.String({ description: "文件名" })),
  reset: p.Optional(p.Boolean({ description: "是否重置" })),
  verify_only: p.Optional(p.Boolean({ description: "是否仅验证" })),
  file_retention: p.Number({ default: 300 * 1e3, description: "文件保留时间 (毫秒)" })
  // 默认5分钟 回收 不设置或0为不回收
});
class Qi extends le {
  actionName = re.UploadFileStream;
  payloadSchema = VSe;
  returnSchema = p.Any({ description: "上传结果 (流式)" });
  actionSummary = "上传文件流";
  actionDescription = "以流式方式上传文件数据到机器人";
  actionTags = ["流式接口"];
  payloadExample = {
    stream_id: "uuid-1234-5678",
    chunk_data: "SGVsbG8gV29ybGQ=",
    chunk_index: 0,
    total_chunks: 1,
    file_size: 11
  };
  returnExample = {
    type: "stream",
    stream_id: "uuid-1234-5678",
    status: "chunk_received",
    received_chunks: 1,
    total_chunks: 1
  };
  useStream = !0;
  static streams = /* @__PURE__ */ new Map();
  static memoryUsage = 0;
  async _handle(e, n, r) {
    const { stream_id: i, reset: o, verify_only: s } = e;
    if (o)
      throw this.cleanupStream(i), new Error("Stream reset completed");
    if (s) {
      const c = Qi.streams.get(i);
      if (!c) throw new Error("Stream not found");
      return this.getStreamStatus(c);
    }
    const a = this.getOrCreateStream(e);
    return e.chunk_data && e.chunk_index !== void 0 ? await this.processChunk(a, e.chunk_data, e.chunk_index) : e.is_complete || a.receivedChunks === a.totalChunks ? await this.completeStream(a) : this.getStreamStatus(a);
  }
  getOrCreateStream(e) {
    let n = Qi.streams.get(e.stream_id);
    if (!n) {
      if (!e.total_chunks)
        throw new Error("total_chunks required for new stream");
      n = this.createStream(e);
    }
    return n;
  }
  createStream(e) {
    const { stream_id: n, total_chunks: r, file_size: i, filename: o, expected_sha256: s } = e, a = this.shouldUseMemory(i);
    if (a && i && Qi.memoryUsage + i > Iw.MEMORY_LIMIT)
      throw new Error("Memory limit exceeded");
    const c = {
      id: n,
      filename: o || `upload_${Do()}`,
      totalChunks: r,
      receivedChunks: 0,
      missingChunks: new Set(Array.from({ length: r }, (u, l) => l)),
      fileSize: i,
      expectedSha256: s,
      useMemory: a,
      createdAt: Date.now(),
      timeoutId: this.setupTimeout(n),
      fileRetention: e.file_retention
    };
    try {
      return a ? (c.memoryChunks = /* @__PURE__ */ new Map(), i && (Qi.memoryUsage += i)) : this.setupDiskStorage(c), Qi.streams.set(n, c), c;
    } catch (u) {
      if (clearTimeout(c.timeoutId), c.tempDir && de.existsSync(c.tempDir))
        try {
          de.rmSync(c.tempDir, { recursive: !0, force: !0 });
        } catch (l) {
          console.error("Failed to cleanup temp dir during creation error:", l);
        }
      throw u;
    }
  }
  shouldUseMemory(e) {
    return e !== void 0 && e <= Iw.MEMORY_THRESHOLD;
  }
  setupDiskStorage(e) {
    const n = yn(this.core.NapCatTempPath, `upload_${e.id}`), r = yn(this.core.NapCatTempPath, e.filename);
    de.mkdirSync(n, { recursive: !0 }), e.tempDir = n, e.finalPath = r;
  }
  setupTimeout(e) {
    return setTimeout(() => {
      console.log(`Stream ${e} timeout`), this.cleanupStream(e);
    }, Iw.TIMEOUT);
  }
  async processChunk(e, n, r) {
    if (r < 0 || r >= e.totalChunks)
      throw new Error(`Invalid chunk index: ${r}`);
    if (!e.missingChunks.has(r))
      return this.getStreamStatus(e);
    const i = Buffer.from(n, "base64");
    if (e.useMemory)
      e.memoryChunks.set(r, i);
    else {
      const o = yn(e.tempDir, `${r}.chunk`);
      await de.promises.writeFile(o, i);
    }
    return e.missingChunks.delete(r), e.receivedChunks++, this.refreshTimeout(e), {
      type: jr.Stream,
      stream_id: e.id,
      status: "chunk_received",
      received_chunks: e.receivedChunks,
      total_chunks: e.totalChunks
    };
  }
  refreshTimeout(e) {
    clearTimeout(e.timeoutId), e.timeoutId = this.setupTimeout(e.id);
  }
  getStreamStatus(e) {
    return {
      type: jr.Stream,
      stream_id: e.id,
      status: "file_created",
      received_chunks: e.receivedChunks,
      total_chunks: e.totalChunks
    };
  }
  async completeStream(e) {
    const n = e.useMemory ? await this.mergeMemoryChunks(e) : await this.mergeDiskChunks(e), r = this.validateSha256(e, n), i = e.finalPath || yn(this.core.NapCatTempPath, e.filename);
    return await de.promises.writeFile(i, n), this.cleanupStream(e.id, !1), e.fileRetention && e.fileRetention > 0 && setTimeout(() => {
      EL(i, (o) => {
        o && this.core.context.logger.logError(`Failed to delete retained file ${i}:`, o);
      });
    }, e.fileRetention), {
      type: jr.Response,
      stream_id: e.id,
      status: "file_complete",
      received_chunks: e.receivedChunks,
      total_chunks: e.totalChunks,
      file_path: i,
      file_size: n.length,
      sha256: r
    };
  }
  async mergeMemoryChunks(e) {
    const n = [];
    for (let r = 0; r < e.totalChunks; r++) {
      const i = e.memoryChunks.get(r);
      if (!i) throw new Error(`Missing memory chunk ${r}`);
      n.push(i);
    }
    return Buffer.concat(n);
  }
  async mergeDiskChunks(e) {
    const n = [];
    for (let r = 0; r < e.totalChunks; r++) {
      const i = yn(e.tempDir, `${r}.chunk`);
      if (!de.existsSync(i)) throw new Error(`Missing chunk file ${r}`);
      n.push(await de.promises.readFile(i));
    }
    return Buffer.concat(n);
  }
  validateSha256(e, n) {
    if (!e.expectedSha256) return;
    const r = hL("sha256").update(n).digest("hex");
    if (r !== e.expectedSha256)
      throw new Error(`SHA256 mismatch. Expected: ${e.expectedSha256}, Got: ${r}`);
    return r;
  }
  cleanupStream(e, n = !0) {
    const r = Qi.streams.get(e);
    if (r)
      try {
        if (clearTimeout(r.timeoutId), r.useMemory && (r.fileSize && (Qi.memoryUsage = Math.max(0, Qi.memoryUsage - r.fileSize)), r.memoryChunks?.clear()), r.tempDir)
          try {
            de.existsSync(r.tempDir) && (de.rmSync(r.tempDir, { recursive: !0, force: !0 }), console.log(`Cleaned up temp directory: ${r.tempDir}`));
          } catch (i) {
            console.error(`Failed to cleanup temp directory ${r.tempDir}:`, i);
          }
        if (n && r.finalPath)
          try {
            de.existsSync(r.finalPath) && (de.unlinkSync(r.finalPath), console.log(`Deleted final file: ${r.finalPath}`));
          } catch (i) {
            console.error(`Failed to delete final file ${r.finalPath}:`, i);
          }
      } catch (i) {
        console.error(`Cleanup error for stream ${e}:`, i);
      } finally {
        Qi.streams.delete(e), console.log(`Stream ${e} cleaned up`);
      }
  }
}
const YSe = [
  ".mp4",
  ".mov",
  ".avi",
  ".wmv",
  ".mpeg",
  ".mpg",
  ".flv",
  ".mkv",
  ".png",
  ".gif",
  ".jpg",
  ".jpeg",
  ".webp",
  ".bmp"
], JSe = p.Object({
  files: p.Union([
    p.Array(p.String()),
    p.String()
  ], { description: "文件列表或单个文件路径" }),
  name: p.Optional(p.String({ description: "任务名称" })),
  thumb_path: p.Optional(p.String({ description: "缩略图路径" }))
});
class XSe extends le {
  actionName = re.CreateFlashTask;
  payloadSchema = JSe;
  returnSchema = p.Any({ description: "任务创建结果" });
  actionSummary = "创建闪传任务";
  actionTags = ["文件扩展"];
  payloadExample = {
    files: "C:\\test.jpg",
    name: "test_task"
  };
  returnExample = {
    task_id: "task_123"
  };
  async _handle(e) {
    const n = Array.isArray(e.files) ? e.files : [e.files];
    let r = "";
    if (n.length === 1) {
      const s = n[0];
      if (s === void 0)
        return {};
      const a = xe.extname(s).toLowerCase();
      if (YSe.includes(a))
        try {
          const c = await this.core.apis.FlashApi.createFileThumbnail(s);
          c && typeof c == "object" && "result" in c && c.result === 0 && (r = c.targetPath);
        } catch {
        }
    }
    function i(s) {
      const a = s.replace(/[\\/]/g, xe.sep);
      return xe.normalize(a);
    }
    let o;
    return e.thumb_path !== void 0 ? o = xe.normalize(e.thumb_path) : o = i(r), await this.core.apis.FlashApi.createFlashTransferUploadTask(n, o, e.name || "");
  }
}
const ZSe = p.Object({
  fileset_id: p.String({ description: "文件集 ID" }),
  user_id: p.Optional(p.String({ description: "用户 QQ" })),
  group_id: p.Optional(p.String({ description: "群号" }))
});
class e_e extends le {
  actionName = re.SendFlashMsg;
  payloadSchema = ZSe;
  returnSchema = p.Any({ description: "发送结果" });
  actionSummary = "发送闪传消息";
  actionTags = ["文件扩展"];
  payloadExample = {
    fileset_id: "set_123",
    user_id: "123456789"
  };
  returnExample = {
    message_id: 123456
  };
  async _handle(e) {
    let n;
    if (e.group_id)
      n = { chatType: Ne.KCHATTYPEGROUP, peerUid: e.group_id.toString() };
    else if (e.user_id) {
      const r = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString());
      if (!r) throw new Error("User not found");
      n = {
        chatType: await this.core.apis.FriendApi.isBuddy(r) ? Ne.KCHATTYPEC2C : Ne.KCHATTYPETEMPC2CFROMGROUP,
        peerUid: r
      };
    } else
      throw new Error("user_id or group_id is required");
    return await this.core.apis.FlashApi.sendFlashMessage(e.fileset_id, n);
  }
}
const t_e = p.Object({
  fileset_id: p.String({ description: "文件集 ID" })
});
class n_e extends le {
  actionName = re.GetFlashFileList;
  payloadSchema = t_e;
  returnSchema = p.Any({ description: "文件列表" });
  actionSummary = "获取闪传文件列表";
  actionTags = ["文件扩展"];
  payloadExample = {
    fileset_id: "set_123"
  };
  returnExample = [
    {
      file_name: "test.jpg",
      size: 1024
    }
  ];
  async _handle(e) {
    return await this.core.apis.FlashApi.getFileListBySetId(e.fileset_id);
  }
}
const r_e = p.Object({
  fileset_id: p.String({ description: "文件集 ID" }),
  file_name: p.Optional(p.String({ description: "文件名" })),
  file_index: p.Optional(p.Number({ description: "文件索引" }))
});
class i_e extends le {
  actionName = re.GetFlashFileUrl;
  payloadSchema = r_e;
  returnSchema = p.Any({ description: "文件下载链接" });
  actionSummary = "获取闪传文件链接";
  actionTags = ["文件扩展"];
  payloadExample = {
    fileset_id: "set_123"
  };
  returnExample = {
    url: "http://example.com/flash.jpg"
  };
  async _handle(e) {
    return await this.core.apis.FlashApi.getFileTransUrl(e.fileset_id, {
      fileName: e.file_name,
      fileIndex: e.file_index
    });
  }
}
const o_e = p.Object({
  fileset_id: p.String({ description: "文件集 ID" })
});
class s_e extends le {
  actionName = re.GetShareLink;
  payloadSchema = o_e;
  returnSchema = p.Any({ description: "分享链接" });
  actionSummary = "获取文件分享链接";
  actionTags = ["文件扩展"];
  payloadExample = {
    fileset_id: "set_123"
  };
  returnExample = "http://example.com/share";
  async _handle(e) {
    return await this.core.apis.FlashApi.getShareLinkBySetId(e.fileset_id);
  }
}
const a_e = p.Object({
  fileset_id: p.String({ description: "文件集 ID" })
});
class c_e extends le {
  actionName = re.GetFilesetInfo;
  payloadSchema = a_e;
  returnSchema = p.Any({ description: "文件集信息" });
  actionSummary = "获取文件集信息";
  actionTags = ["文件扩展"];
  payloadExample = {
    fileset_id: "set_123"
  };
  returnExample = {
    fileset_id: "set_123",
    file_list: []
  };
  async _handle(e) {
    return await this.core.apis.FlashApi.getFileSetIndoBySetId(e.fileset_id);
  }
}
const u_e = p.Object({
  fileset_id: p.String({ description: "文件集 ID" })
});
class l_e extends le {
  actionName = re.DownloadFileset;
  payloadSchema = u_e;
  returnSchema = p.Any({ description: "下载结果" });
  actionSummary = "下载文件集";
  actionTags = ["文件扩展"];
  payloadExample = {
    fileset_id: "set_123"
  };
  returnExample = null;
  async _handle(e) {
    return await this.core.apis.FlashApi.downloadFileSetBySetId(e.fileset_id);
  }
}
const p_e = p.Object({
  user_id: p.String({ description: "用户 QQ" })
});
class d_e extends le {
  actionName = re.GetOnlineFileMessages;
  payloadSchema = p_e;
  returnSchema = p.Any({ description: "在线文件消息列表" });
  actionSummary = "获取在线文件消息";
  actionTags = ["文件扩展"];
  payloadExample = {
    user_id: "123456789"
  };
  returnExample = [];
  async _handle(e) {
    const n = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString());
    if (!n) throw new Error("User not found");
    const r = { chatType: Ne.KCHATTYPEC2C, peerUid: n };
    return await this.core.apis.OnlineApi.getOnlineFileMsg(r);
  }
}
const f_e = p.Object({
  user_id: p.String({ description: "用户 QQ" }),
  file_path: p.String({ description: "本地文件路径" }),
  file_name: p.Optional(p.String({ description: "文件名 (可选)" }))
});
class h_e extends le {
  actionName = re.SendOnlineFile;
  payloadSchema = f_e;
  returnSchema = p.Any({ description: "发送结果" });
  actionSummary = "发送在线文件";
  actionTags = ["文件扩展"];
  payloadExample = {
    user_id: "123456789",
    file_path: "C:\\path\\to\\file.txt",
    file_name: "test.txt"
  };
  returnExample = null;
  async _handle(e) {
    const n = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString());
    if (!n) throw new Error("User not found");
    const r = { chatType: Ne.KCHATTYPEC2C, peerUid: n }, i = e.file_name || "";
    return await this.core.apis.OnlineApi.sendOnlineFile(r, e.file_path, i);
  }
}
const m_e = p.Object({
  user_id: p.String({ description: "用户 QQ" }),
  folder_path: p.String({ description: "本地文件夹路径" }),
  folder_name: p.Optional(p.String({ description: "文件夹名称 (可选)" }))
});
class g_e extends le {
  actionName = re.SendOnlineFolder;
  payloadSchema = m_e;
  returnSchema = p.Any({ description: "发送结果" });
  actionSummary = "发送在线文件夹";
  actionTags = ["文件扩展"];
  payloadExample = {
    user_id: "123456789",
    folder_path: "C:\\path\\to\\folder"
  };
  returnExample = null;
  async _handle(e) {
    const n = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString());
    if (!n) throw new Error("User not found");
    const r = { chatType: Ne.KCHATTYPEC2C, peerUid: n };
    return await this.core.apis.OnlineApi.sendOnlineFolder(r, e.folder_path, e.folder_name);
  }
}
const y_e = p.Object({
  user_id: p.String({ description: "用户 QQ" }),
  msg_id: p.String({ description: "消息 ID" })
});
class v_e extends le {
  actionName = re.CancelOnlineFile;
  payloadSchema = y_e;
  returnSchema = p.Any({ description: "取消结果" });
  actionSummary = "取消在线文件";
  actionTags = ["文件扩展"];
  payloadExample = {
    user_id: "123456789",
    msg_id: "123"
  };
  returnExample = null;
  async _handle(e) {
    const n = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString());
    if (!n) throw new Error("User not found");
    const r = { chatType: Ne.KCHATTYPEC2C, peerUid: n };
    return await this.core.apis.OnlineApi.cancelMyOnlineFileMsg(r, e.msg_id);
  }
}
const b_e = p.Object({
  user_id: p.String({ description: "用户 QQ" }),
  msg_id: p.String({ description: "消息 ID" }),
  element_id: p.String({ description: "元素 ID" })
});
class x_e extends le {
  actionName = re.ReceiveOnlineFile;
  payloadSchema = b_e;
  returnSchema = p.Any({ description: "接收结果" });
  actionSummary = "接收在线文件";
  actionTags = ["文件扩展"];
  payloadExample = {
    user_id: "123456789",
    msg_id: "123",
    save_path: "C:\\save"
  };
  returnExample = null;
  async _handle(e) {
    const n = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString());
    if (!n) throw new Error("User not found");
    const r = { chatType: Ne.KCHATTYPEC2C, peerUid: n };
    return await this.core.apis.OnlineApi.receiveOnlineFileOrFolder(r, e.msg_id, e.element_id);
  }
}
const w_e = p.Object({
  user_id: p.String({ description: "用户 QQ" }),
  msg_id: p.String({ description: "消息 ID" }),
  element_id: p.String({ description: "元素 ID" })
});
class S_e extends le {
  actionName = re.RefuseOnlineFile;
  payloadSchema = w_e;
  returnSchema = p.Any({ description: "拒绝结果" });
  actionSummary = "拒绝在线文件";
  actionTags = ["文件扩展"];
  payloadExample = {
    user_id: "123456789",
    msg_id: "123"
  };
  returnExample = null;
  async _handle(e) {
    const n = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString());
    if (!n) throw new Error("User not found");
    const r = { chatType: Ne.KCHATTYPEC2C, peerUid: n };
    return await this.core.apis.OnlineApi.refuseOnlineFileMsg(r, e.msg_id, e.element_id);
  }
}
const __e = p.Object({
  share_code: p.String({ description: "分享码或分享链接" })
});
class E_e extends le {
  actionName = re.GetFilesetId;
  payloadSchema = __e;
  returnSchema = p.Object({
    fileset_id: p.String({ description: "文件集 ID" })
  });
  actionSummary = "获取文件集 ID";
  actionTags = ["文件扩展"];
  payloadExample = {
    share_code: "123456"
  };
  returnExample = {
    fileset_id: "set_123"
  };
  async _handle(e) {
    const n = e.share_code.includes("=") ? e.share_code.split("=").slice(1).join("=") : e.share_code;
    return { fileset_id: (await this.core.apis.FlashApi.fromShareLinkFindSetId(n)).fileSetId };
  }
}
const A_e = p.Object({
  message_id: p.Union([p.Number(), p.String()], { description: "消息ID" })
}), I_e = p.Object({ text: p.String({ description: "得到的文本" }) });
class C_e extends le {
  actionName = re.FetchPttText;
  actionSummary = "获取语音转文字结果";
  actionTags = ["消息扩展"];
  payloadExample = Qu.FetchPttText.payload;
  returnExample = Qu.FetchPttText.response;
  payloadSchema = A_e;
  returnSchema = I_e;
  async _handle(e) {
    if (!e.message_id)
      throw Error("参数message_id不能为空");
    const n = rt.getShortIdByMsgId(e.message_id.toString()), r = rt.getMsgIdAndPeerByShortId(n ?? +e.message_id);
    if (!r)
      throw new Error("消息不存在");
    const i = { guildId: "", peerUid: r?.Peer.peerUid, chatType: r.Peer.chatType }, o = this.obContext.configLoader.configData.timeout.baseTimeout, a = (await Ys(
      this.core.apis.MsgApi.getMsgsByMsgId(i, [r?.MsgId || e.message_id.toString()]),
      o
    ).catch((f) => {
      throw f instanceof Error && f.message.startsWith("PromiseTimer:") ? new Error(`消息不存在或已被撤回: ${f.message || String(f)}`) : f;
    })).msgList[0];
    if (!a) throw Error("消息不存在或已被撤回");
    const c = a.elements.find(
      (f) => f.elementType === _e.PTT
    );
    if (!c)
      throw Error("消息中不包含语音");
    const u = this.obContext.configLoader.configData.timeout.baseTimeout;
    await Ys(
      this.core.context.session.getMsgService().translatePtt2Text(r.MsgId, r.Peer, c),
      u
    ).catch((f) => {
      throw f instanceof Error && f.message.startsWith("PromiseTimer:") ? new Error(`获取语音转文字结果失败: ${f.message || String(f)}`) : f;
    });
    const d = (await Ys(
      this.core.apis.MsgApi.getMsgsByMsgId(i, [r?.MsgId || e.message_id.toString()]),
      o
    ).catch((f) => {
      throw f instanceof Error && f.message.startsWith("PromiseTimer:") ? new Error(`消息不存在或已被撤回: ${f.message || String(f)}`) : f;
    })).msgList[0];
    if (!d) throw Error("消息不存在或已被撤回");
    for (const f of d.elements)
      if (f.elementType === _e.PTT && f.pttElement?.text)
        return { text: f.pttElement?.text };
    throw new Error("获取语音转文字结果失败");
  }
}
const T_e = p.Object({
  group_id: p.Union([p.String(), p.Number()], { description: "群号" })
}), k_e = p.Array(
  p.Object({
    user_id: p.Number({ description: "打卡者QQ" }),
    nick: p.String({ description: "打卡者昵称" }),
    time: p.Number({ description: "打卡时间" }),
    rank: p.Number({ description: "打卡排名" })
  }),
  { description: "群组今日打卡列表" }
);
class N_e extends le {
  actionName = re.GetGroupSignedList;
  actionSummary = "获取群组今日打卡列表";
  actionTags = ["群组扩展"];
  payloadExample = {
    group_id: "123456"
  };
  returnExample = {};
  payloadSchema = T_e;
  returnSchema = k_e;
  async _handle(e) {
    const n = await this.core.apis.WebApi.getDaySignedList(e.group_id.toString());
    if (!n.response.page) throw new Error("无法获取该群组打卡列表");
    return n.response.page[0]?.infos?.map((r) => ({
      user_id: +r.uid,
      nick: r.uidGroupNick,
      time: +r.signedTimeStamp,
      rank: (r.signInRank - 1) / 2 + 1
    })) ?? [];
  }
}
function P_e(t, e) {
  return [
    new LSe(t, e),
    new QSe(t, e),
    new qSe(t, e),
    new WSe(t, e),
    new KSe(t, e),
    new Qi(t, e),
    new USe(t, e),
    new OSe(t, e),
    new MSe(t, e),
    new NSe(t, e),
    new FSe(t, e),
    new ASe(t, e),
    new TSe(t, e),
    new SSe(t, e),
    new xSe(t, e),
    new wSe(t, e),
    new fSe(t, e),
    new lSe(t, e),
    new tSe(t, e),
    new aSe(t, e),
    new iSe(t, e),
    new Ywe(t, e),
    new Xwe(t, e),
    new Kwe(t, e),
    new Hwe(t, e),
    new Gwe(t, e),
    new Dwe(t, e),
    new Mbe(t, e),
    new wbe(t, e),
    new Ebe(t, e),
    new C_e(t, e),
    new s1e(t, e),
    new Ave(t, e),
    new Pve(t, e),
    new kve(t, e),
    new Dve(t, e),
    new Fve(t, e),
    new Rve(t, e),
    new Lve(t, e),
    new J1e(t, e),
    new X1e(t, e),
    new d1e(t, e),
    new p1e(t, e),
    new x1e(t, e),
    new _ve(t, e),
    new Ybe(t, e),
    new Txe(t, e),
    new kxe(t, e),
    new nwe(t, e),
    new Mwe(t, e),
    new Qwe(t, e),
    new Uwe(t, e),
    new N_e(t, e),
    // onebot11
    new Pye(t, e),
    new Y0e(t, e),
    new Z0e(t, e),
    new nye(t, e),
    new oye(t, e),
    new cye(t, e),
    new vxe(t, e),
    new pye(t, e),
    new dye(t, e),
    new fye(t, e),
    new $0e(t, e),
    new gye(t, e),
    new Oye(t, e),
    new Lye(t, e),
    new Bye(t, e),
    new vye(t, e),
    new xye(t, e),
    new wye(t, e),
    new _ye(t, e),
    new $ye(t, e),
    new Kye(t, e),
    new Jye(t, e),
    new e1e(t, e),
    new Hye(t, e),
    new r1e(t, e),
    new a1e(t, e),
    new l1e(t, e),
    new U1e(t, e),
    new M1e(t, e),
    new G1e(t, e),
    new j1e(t, e),
    new eve(t, e),
    // 以下为go-cqhttp api
    new jxe(t, e),
    new YF(t, e),
    new gve(t, e),
    new bve(t, e),
    new xve(t, e),
    new ove(t, e),
    new nve(t, e),
    new z1e(t, e),
    new Y1e(t, e),
    new Dxe(t, e),
    new Eye(t, e),
    new Iye(t, e),
    new Aye(t, e),
    new kye(t, e),
    new _1e(t, e),
    new Zxe(t, e),
    new f1e(t, e),
    new y1e(t, e),
    new I1e(t, e),
    new k1e(t, e),
    new D1e(t, e),
    new lve(t, e),
    new fve(t, e),
    new $ve(t, e),
    new Hve(t, e),
    new Kve(t, e),
    new h1e(t, e),
    new Jve(t, e),
    new ebe(t, e),
    new rbe(t, e),
    new sbe(t, e),
    new ube(t, e),
    new dbe(t, e),
    new mbe(t, e),
    new vbe(t, e),
    new ewe(t, e),
    new Bxe(t, e),
    new Uxe(t, e),
    new YF(t, e),
    new Cbe(t, e),
    new kbe(t, e),
    new Exe(t, e),
    new Dbe(t, e),
    new Ube(t, e),
    new Qbe(t, e),
    new qbe(t, e),
    new zbe(t, e),
    new Zbe(t, e),
    new ixe(t, e),
    new Axe(t, e),
    new cwe(t, e),
    new uwe(t, e),
    new axe(t, e),
    new uxe(t, e),
    new dxe(t, e),
    new dwe(t, e),
    // new UploadForwardMsg(obContext, core),
    new mxe(t, e),
    new wxe(t, e),
    new Gxe(t, e),
    new Wxe(t, e),
    new Vxe(t, e),
    new Xxe(t, e),
    new owe(t, e),
    new awe(t, e),
    new nxe(t, e),
    new fwe(t, e),
    new gwe(t, e),
    new bwe(t, e),
    new kwe(t, e),
    new Wwe(t, e),
    new mSe(t, e),
    new vSe(t, e),
    new XSe(t, e),
    new n_e(t, e),
    new i_e(t, e),
    new e_e(t, e),
    new s_e(t, e),
    new c_e(t, e),
    new d_e(t, e),
    new h_e(t, e),
    new g_e(t, e),
    new x_e(t, e),
    new S_e(t, e),
    new v_e(t, e),
    new l_e(t, e),
    new E_e(t, e)
  ];
}
function D_e(t, e) {
  const n = P_e(t, e), r = /* @__PURE__ */ new Map();
  n.forEach((s) => {
    r.set(s.actionName, s), r.set(`${s.actionName}_async`, s), r.set(`${s.actionName}_rate_limited`, s);
  }), OR.forEach((s) => {
    const a = new s(t, e), c = a.actionName;
    r.set(c, a), r.set(`${c}_async`, a), r.set(`${c}_rate_limited`, a);
  });
  function i(s) {
    return r.get(s);
  }
  async function o(s, a, c, u) {
    const l = r.get(s);
    if (!l)
      throw new Error(`Action ${String(s)} not found`);
    const d = await l.handle(a, c, u);
    if (d.status !== "ok" || !d.data)
      throw new Error(`Action ${String(s)} failed: ${d.message || "No data returned"}`);
    return d.data;
  }
  return { get: i, call: o };
}
class F_e extends Ps {
  notice_type = "notify";
  sub_type = "input_status";
  status_text = "对方正在输入...";
  event_type = 1;
  user_id = 0;
  group_id = 0;
  constructor(e, n, r, i) {
    super(e), this.user_id = n, this.event_type = r, this.status_text = i;
  }
}
class O_e extends PU {
  request_type = "friend";
  user_id;
  comment;
  flag;
  constructor(e, n, r, i) {
    super(e), this.user_id = n, this.comment = r, this.flag = i;
  }
}
class M_e extends Ps {
  notice_type = "friend_recall";
  user_id;
  message_id;
  constructor(e, n, r) {
    super(e), this.user_id = n, this.message_id = r;
  }
}
class R_e extends xo {
  notice_type = "group_recall";
  operator_id;
  message_id;
  constructor(e, n, r, i, o) {
    super(e, n, r), this.group_id = n, this.user_id = r, this.operator_id = i, this.message_id = o;
  }
}
class B_e extends Ps {
  notice_type = "bot_offline";
  user_id;
  tag = "BotOfflineEvent";
  message = "BotOfflineEvent";
  constructor(e, n, r) {
    super(e), this.user_id = +e.selfInfo.uin, this.tag = n, this.message = r;
  }
}
class tO extends B_ {
  sseClients = [];
  get isActive() {
    return this.isEnable && (this.sseClients.length > 0 || super.isActive);
  }
  async handleRequest(e, n) {
    e.path === "/_events" ? this.createSseSupport(e, n) : super.httpApiRequest(e, n, !0);
  }
  async createSseSupport(e, n) {
    n.setHeader("Content-Type", "text/event-stream"), n.setHeader("Cache-Control", "no-cache"), n.setHeader("Connection", "keep-alive"), n.flushHeaders(), this.sseClients.push(n), e.on("close", () => {
      this.sseClients = this.sseClients.filter((r) => r !== n);
    });
  }
  async onEvent(e) {
    super.onEvent(e);
    const n = [];
    this.sseClients.forEach((r) => {
      n.push(new Promise((i, o) => {
        r.write(`data: ${JSON.stringify(e)}

`, (s) => {
          s ? o(s) : i();
        });
      }));
    }), await Promise.allSettled(n);
  }
}
class U_e {
  core;
  context;
  configLoader;
  apis;
  networkManager;
  actions;
  bootTime = Date.now() / 1e3;
  recallEventCache = /* @__PURE__ */ new Map();
  constructor(e, n, r) {
    this.core = e, this.context = n, this.configLoader = new Qae(e, r.configPath, Lae), this.apis = {
      GroupApi: new Uge(this, e),
      UserApi: new Hge(this, e),
      FriendApi: new hge(this, e),
      MsgApi: new U0e(this, e),
      QuickActionApi: new G0e(this, e),
      FileApi: new z0e(this, e)
    }, this.actions = D_e(this, e), this.networkManager = new Xhe();
  }
  async creatOneBotLog(e) {
    let n = `[network] 配置加载
`;
    for (const r of e.network.httpServers)
      n += `HTTP服务: ${r.host}:${r.port}, : ${r.enable ? "已启动" : "未启动"}
`;
    for (const r of e.network.httpSseServers)
      n += `HTTP-SSE服务: ${r.host}:${r.port}, : ${r.enable ? "已启动" : "未启动"}
`;
    for (const r of e.network.httpClients)
      n += `HTTP上报服务: ${r.url}, : ${r.enable ? "已启动" : "未启动"}
`;
    for (const r of e.network.websocketServers)
      n += `WebSocket服务: ${r.host}:${r.port}, : ${r.enable ? "已启动" : "未启动"}
`;
    for (const r of e.network.websocketClients)
      n += `WebSocket反向服务: ${r.url}, : ${r.enable ? "已启动" : "未启动"}
`;
    return n;
  }
  async InitOneBot() {
    const e = this.core.selfInfo, n = this.configLoader.configData;
    this.core.apis.UserApi.getUserDetailInfo(e.uid, !1).then(async (i) => {
      if (e.nick = i.nick, this.context.logger.setLogSelfInfo(e), j_) {
        this.context.logger.log("[NapCat] [OneBot] 🔐 检测到待发送的WebUI Token，开始发送");
        try {
          await this.core.apis.MsgApi.sendMsg(
            { chatType: Ne.KCHATTYPEC2C, peerUid: e.uid, guildId: "" },
            [{
              elementType: _e.TEXT,
              elementId: "",
              textElement: {
                content: `[NapCat] 温馨提示:
WebUI密码为默认密码，已进行强制修改
新密码: ` + j_,
                atType: Mr.ATTYPEUNKNOWN,
                atUid: "",
                atTinyId: "",
                atNtUid: ""
              }
            }],
            5e3
          ), this.context.logger.log("[NapCat] [OneBot] ✅ WebUI Token 消息发送成功");
        } catch (o) {
          this.context.logger.logError("[NapCat] [OneBot] ❌ WebUI Token 消息发送失败:", o);
        }
      }
      ve.getQQLoginCallback()(!0);
    }).catch((i) => this.context.logger.logError(i));
    const r = await this.creatOneBotLog(n);
    this.context.logger.log(`[Notice] [OneBot11] ${r}`), sr(this.context.pathWrapper.pluginPath) && (this.context.logger.log("[Plugins] 插件目录存在，开始加载插件"), this.networkManager.registerAdapter(
      new vU("plugin_manager", this.core, this, this.actions)
    ));
    for (const i of n.network.httpServers)
      i.enable && this.networkManager.registerAdapter(
        new B_(i.name, i, this.core, this, this.actions)
      );
    for (const i of n.network.httpSseServers)
      i.enable && this.networkManager.registerAdapter(
        new tO(i.name, i, this.core, this, this.actions)
      );
    for (const i of n.network.httpClients)
      i.enable && this.networkManager.registerAdapter(
        new tF(i.name, i, this.core, this, this.actions)
      );
    for (const i of n.network.websocketServers)
      i.enable && this.networkManager.registerAdapter(
        new aF(
          i.name,
          i,
          this.core,
          this,
          this.actions
        )
      );
    for (const i of n.network.websocketClients)
      i.enable && this.networkManager.registerAdapter(
        new nF(
          i.name,
          i,
          this.core,
          this,
          this.actions
        )
      );
    await this.networkManager.openAllAdapters(), this.initMsgListener(), this.initBuddyListener(), this.initGroupListener(), ve.setQQVersion(this.core.context.basicInfoWrapper.getFullQQVersion()), ve.setQQLoginInfo(e), ve.setQQLoginStatus(!0), ve.setOnOB11ConfigChanged(async (i) => {
      const o = this.configLoader.configData;
      this.configLoader.save(i), await this.reloadNetwork(o, i);
    }), this.apis.GroupApi.registerParseGroupReactEventByCore().catch(
      (i) => this.context.logger.logError("注册群消息反应表情失败", i)
    );
  }
  async reloadNetwork(e, n) {
    const r = await this.creatOneBotLog(e), i = await this.creatOneBotLog(n);
    this.context.logger.log(`[Notice] [OneBot11] 配置变更前:
${r}`), this.context.logger.log(`[Notice] [OneBot11] 配置变更后:
${i}`), await this.handleConfigChange(e.network.httpServers, n.network.httpServers, B_), await this.handleConfigChange(e.network.httpClients, n.network.httpClients, tF), await this.handleConfigChange(e.network.httpSseServers, n.network.httpSseServers, tO), await this.handleConfigChange(e.network.websocketServers, n.network.websocketServers, aF), await this.handleConfigChange(e.network.websocketClients, n.network.websocketClients, nF);
  }
  async handleConfigChange(e, n, r) {
    for (const i of e)
      if (!n.find((s) => s.name === i.name)) {
        const s = this.networkManager.findSomeAdapter(i.name);
        s && await this.networkManager.closeSomeAdaterWhenOpen([s]);
      }
    for (const i of n) {
      const o = this.networkManager.findSomeAdapter(i.name);
      if (o)
        await o.reload(i) === rn.NetWorkClose && await this.networkManager.closeSomeAdaterWhenOpen([o]);
      else if (i.enable) {
        const s = new r(i.name, i, this.core, this, this.actions);
        await this.networkManager.registerAdapterAndOpen(s);
      }
    }
  }
  initMsgListener() {
    const e = new DR();
    e.onRecvSysMsg = (n) => {
      this.apis.MsgApi.parseSysMessage(n).then((r) => {
        r && this.networkManager.emitEvent(r);
      }).catch(
        (r) => this.context.logger.logError(
          "constructSysMessage error: ",
          r,
          `
 Parse Hex:`,
          Buffer.from(n).toString("hex")
        )
      );
    }, e.onInputStatusPush = async (n) => {
      const r = await this.core.apis.UserApi.getUinByUidV2(n.fromUin);
      this.context.logger.log(`[Notice] [输入状态] ${r} ${n.statusText}`), await this.networkManager.emitEvent(
        new F_e(this.core, parseInt(r), n.eventType, n.statusText)
      );
    }, e.onRecvMsg = async (n) => {
      if (this.networkManager.hasActiveAdapters())
        for (const r of n) {
          if (this.bootTime > parseInt(r.msgTime)) {
            this.context.logger.logDebug(`消息时间${r.msgTime}早于启动时间${this.bootTime}，忽略上报`);
            continue;
          }
          r.id = rt.createUniqueMsgId(
            {
              chatType: r.chatType,
              peerUid: r.peerUid,
              guildId: ""
            },
            r.msgId
          ), await this.emitMsg(r).catch(
            (i) => this.context.logger.logError("处理消息失败", i)
          );
        }
    }, e.onRecvOnlineFileMsg = async (n) => {
      if (this.networkManager.hasActiveAdapters())
        for (const r of n) {
          if (this.bootTime > parseInt(r.msgTime)) {
            this.context.logger.logDebug(`在线文件消息时间${r.msgTime}早于启动时间${this.bootTime}，忽略上报`);
            continue;
          }
          r.id = rt.createUniqueMsgId(
            {
              chatType: r.chatType,
              peerUid: r.peerUid,
              guildId: ""
            },
            r.msgId
          ), await this.emitMsg(r).catch(
            (i) => this.context.logger.logError("处理在线文件消息失败", i)
          );
        }
    }, e.onAddSendMsg = async (n) => {
      try {
        if (n.sendStatus === Dp.KSEND_STATUS_SENDING) {
          const [r] = await this.core.eventWrapper.registerListen("NodeIKernelMsgListener/onMsgInfoListUpdate", (o) => !!o.find(
            (a) => a.senderUin === this.core.selfInfo.uin && a.sendStatus !== Dp.KSEND_STATUS_SENDING && a.msgId === n.msgId
          ), 1, 6e5), i = r.find((o) => o.msgId === n.msgId);
          i?.sendStatus === Dp.KSEND_STATUS_SUCCESS && (i.id = rt.createUniqueMsgId(
            {
              chatType: i.chatType,
              peerUid: i.peerUid,
              guildId: ""
            },
            i.msgId
          ), this.emitMsg(i));
        }
      } catch (r) {
        this.context.logger.logError("处理发送消息失败", r);
      }
    }, e.onMsgRecall = async (n, r, i) => {
      const o = {
        chatType: n,
        peerUid: r,
        guildId: ""
      };
      let s = (await this.core.apis.MsgApi.queryMsgsWithFilterExWithSeq(o, i)).msgList.find((c) => c.msgType === Gs.KMSGTYPEGRAYTIPS);
      const a = s?.elements.find((c) => !!c.grayTipElement?.revokeElement);
      if (s && a?.grayTipElement?.revokeElement.isSelfOperate && this.recallEventCache.has(s.msgId) && await this.core.eventWrapper.registerListen(
        "NodeIKernelMsgListener/onMsgRecall",
        (u, l, d) => u === s?.chatType && l === s?.peerUid && d === s?.msgSeq
      ).catch(() => {
        s = void 0, this.context.logger.logDebug("自操作消息撤回事件");
      }), s && a) {
        const c = await this.emitRecallMsg(s, a);
        try {
          c && await this.networkManager.emitEvent(c);
        } catch (u) {
          this.context.logger.logError("处理消息撤回失败", u);
        }
      }
    }, e.onKickedOffLine = async (n) => {
      ve.setQQLoginStatus(!1);
      const r = new B_e(this.core, n.tipsTitle, n.tipsDesc);
      this.networkManager.emitEvent(r).catch((i) => this.context.logger.logError("处理Bot掉线失败", i));
    }, this.context.session.getMsgService().addKernelMsgListener(su(e, this.context.logger));
  }
  initBuddyListener() {
    const e = new Wse();
    e.onBuddyReqChange = async (n) => {
      this.core.apis.FriendApi.clearBuddyReqUnreadCnt();
      for (let r = 0; r < n.unreadNums; r++) {
        const i = n.buddyReqs[r];
        if (i && !(i.isInitiator || i.isDecide && i.reqType !== r6.KMEINITIATORWAITPEERCONFIRM || !i.isUnread))
          try {
            const o = await this.core.apis.UserApi.getUinByUidV2(i.friendUid);
            await this.networkManager.emitEvent(
              new O_e(
                this.core,
                +o,
                i.extWords,
                i.reqTime
              )
            );
          } catch (o) {
            this.context.logger.logDebug("获取加好友者QQ号失败", o);
          }
      }
    }, this.context.session.getBuddyService().addKernelBuddyListener(su(e, this.context.logger));
  }
  initGroupListener() {
    const e = new Hse();
    e.onGroupNotifiesUpdated = async (n, r) => {
      if (await this.core.apis.GroupApi.clearGroupNotifiesUnreadCount(!1), !!r[0]?.type && ![
        Fa.SET_ADMIN,
        Fa.CANCEL_ADMIN_NOTIFY_CANCELED,
        Fa.CANCEL_ADMIN_NOTIFY_ADMIN
      ].includes(r[0]?.type))
        for (const i of r) {
          if (parseInt(i.seq) / 1e3 / 1e3 < this.bootTime)
            continue;
          const s = i.seq;
          if (this.context.logger.logDebug("收到群通知", i), [Fa.REQUEST_JOIN_NEED_ADMINI_STRATOR_PASS].includes(i.type) && i.status === Ga.KUNHANDLE) {
            this.context.logger.logDebug("有加群请求");
            try {
              const a = await this.core.apis.UserApi.getUinByUidV2(i.user1.uid), c = new hm(
                this.core,
                parseInt(i.group.groupCode),
                parseInt(a),
                "add",
                i.postscript,
                s
              );
              this.networkManager.emitEvent(c).catch(
                (u) => this.context.logger.logError("处理加群请求失败", u)
              );
            } catch (a) {
              this.context.logger.logError(
                "获取加群人QQ号失败 Uid:",
                i.user1.uid,
                a
              );
            }
          } else if (i.type === Fa.INVITED_BY_MEMBER && i.status === Ga.KUNHANDLE) {
            this.context.logger.logDebug(`收到邀请我加群通知:${i}`);
            const a = new hm(
              this.core,
              +i.group.groupCode,
              +await this.core.apis.UserApi.getUinByUidV2(i.user2.uid),
              "invite",
              i.postscript,
              s
            );
            this.networkManager.emitEvent(a).catch(
              (c) => this.context.logger.logError("处理邀请本人加群失败", c)
            );
          } else if (i.type === Fa.INVITED_NEED_ADMINI_STRATOR_PASS && i.status === Ga.KUNHANDLE) {
            this.context.logger.logDebug(`收到群员邀请加群通知:${i}`);
            const a = new hm(
              this.core,
              +i.group.groupCode,
              +await this.core.apis.UserApi.getUinByUidV2(i.user1.uid),
              "add",
              i.postscript,
              s
            );
            this.networkManager.emitEvent(a).catch(
              (c) => this.context.logger.logError("处理邀请本人加群失败", c)
            );
          }
        }
    }, this.context.session.getGroupService().addKernelGroupListener(su(e, this.context.logger));
  }
  async emitMsg(e) {
    this.context.logger.logDebug("收到新消息 RawMessage", e), await Promise.allSettled([
      this.handleMsg(e),
      e.chatType === Ne.KCHATTYPEGROUP ? this.handleGroupEvent(e) : this.handlePrivateMsgEvent(e)
    ]);
  }
  async handleMsg(e) {
    if (e.msgType !== Gs.KMSGTYPENULL)
      try {
        const n = await this.apis.MsgApi.parseMessageV2(e, this.configLoader.configData.parseMultMsg);
        if (n) {
          const r = this.isSelfMessage(n);
          if (this.context.logger.logDebug("转化为 OB11Message", n), r || e.chatType !== Ne.KCHATTYPEGROUP) {
            const o = parseInt(e.peerUin);
            n.stringMsg.target_id = o, n.arrayMsg.target_id = o;
          }
          const i = /* @__PURE__ */ new Map();
          for (const o of this.networkManager.adapters.values()) {
            if (!o.isActive) continue;
            const s = o.config;
            if (r && (!("reportSelfMessage" in s) || !s.reportSelfMessage))
              continue;
            const a = s.messagePostFormat === "string" ? n.stringMsg : n.arrayMsg;
            if (s.debug) {
              const c = structuredClone(a);
              c.raw = e, i.set(o.name, c);
            } else
              i.set(o.name, a);
          }
          i.size > 0 ? this.networkManager.emitEventByNames(i) : this.networkManager.hasActiveAdapters() && this.context.logger.logDebug("没有可用的网络适配器发送消息，消息内容:", e);
        }
      } catch (n) {
        this.context.logger.logError("constructMessage error: ", n);
      }
  }
  isSelfMessage(e) {
    return e.stringMsg.user_id.toString() === this.core.selfInfo.uin || e.arrayMsg.user_id.toString() === this.core.selfInfo.uin;
  }
  async handleGroupEvent(e) {
    try {
      if (e.senderUin && e.senderUin !== "0") {
        const n = await this.apis.GroupApi.parseCardChangedEvent(e);
        n && await this.networkManager.emitEvent(n);
      }
      if (e.msgType === Gs.KMSGTYPEFILE) {
        const n = e.elements.find((r) => !!r.fileElement);
        if (n?.fileElement) {
          const r = await this.apis.GroupApi.parseGroupUploadFileEvene(e, n.fileElement, n);
          r && await this.networkManager.emitEvent(r);
        }
      } else if (e.msgType === Gs.KMSGTYPEGRAYTIPS) {
        const n = e.elements[0]?.grayTipElement;
        if (n) {
          const r = await this.apis.GroupApi.parseGrayTipElement(e, n);
          r && await this.networkManager.emitEvent(r);
        }
      }
    } catch (n) {
      this.context.logger.logError("constructGroupEvent error: ", n);
    }
  }
  async handlePrivateMsgEvent(e) {
    try {
      if (e.msgType === Gs.KMSGTYPEGRAYTIPS) {
        const n = e.elements[0]?.grayTipElement;
        if (n) {
          const r = await this.apis.MsgApi.parsePrivateMsgEvent(e, n);
          r && await this.networkManager.emitEvent(r);
        }
      }
    } catch (n) {
      this.context.logger.logError("constructPrivateEvent error: ", n);
    }
  }
  async emitRecallMsg(e, n) {
    const r = { chatType: e.chatType, peerUid: e.peerUid, guildId: "" }, i = rt.getShortIdByMsgId(e.msgId) ?? rt.createUniqueMsgId(r, e.msgId);
    if (e.chatType === Ne.KCHATTYPEC2C)
      return await this.emitFriendRecallMsg(e, i, n);
    if (e.chatType === Ne.KCHATTYPEGROUP)
      return await this.emitGroupRecallMsg(e, i, n);
  }
  async emitFriendRecallMsg(e, n, r) {
    if (r.grayTipElement?.revokeElement.operatorUid)
      return new M_e(
        this.core,
        +e.senderUin,
        n
      );
  }
  async emitGroupRecallMsg(e, n, r) {
    const i = r.grayTipElement?.revokeElement.operatorUid;
    if (!i) return;
    const o = await this.core.apis.UserApi.getUinByUidV2(i);
    return new R_e(
      this.core,
      +e.peerUin,
      +e.senderUin,
      +o,
      n
    );
  }
}
const L_e = p.Object({
  name: p.String({ default: "napcat-ws-server" }),
  enable: p.Boolean({ default: !1 }),
  host: p.String({ default: "127.0.0.1" }),
  port: p.Number({ default: 6700 }),
  token: p.String({ default: "" }),
  heartInterval: p.Number({ default: 3e4 }),
  debug: p.Boolean({ default: !1 })
}), j_e = p.Object({
  name: p.String({ default: "napcat-ws-client" }),
  enable: p.Boolean({ default: !1 }),
  url: p.String({ default: "ws://localhost:6701" }),
  token: p.String({ default: "" }),
  reconnectInterval: p.Number({ default: 5e3 }),
  heartInterval: p.Number({ default: 3e4 }),
  debug: p.Boolean({ default: !1 })
}), Q_e = p.Object({
  name: p.String({ default: "napcat-http-server" }),
  enable: p.Boolean({ default: !1 }),
  host: p.String({ default: "127.0.0.1" }),
  port: p.Number({ default: 6702 }),
  token: p.String({ default: "" }),
  enableCors: p.Boolean({ default: !0 }),
  debug: p.Boolean({ default: !1 })
}), $_e = p.Object({
  httpServers: p.Array(Q_e, { default: [] }),
  websocketServers: p.Array(L_e, { default: [] }),
  websocketClients: p.Array(j_e, { default: [] })
}, { default: {} }), G_e = p.Object({
  enable: p.Boolean({ default: !1 }),
  // 默认关闭
  network: $_e
});
class q_e extends fA {
  constructor(e, n) {
    super("napcat_protocol", e, n, G_e);
  }
}
class H_e {
  adapters = /* @__PURE__ */ new Map();
  async openAllAdapters() {
    return Promise.all(Array.from(this.adapters.values()).map((e) => e.open()));
  }
  async emitEvent(e) {
    return Promise.all(Array.from(this.adapters.values()).map(async (n) => {
      if (n.isActive)
        return await n.onEvent(e);
    }));
  }
  async emitEvents(e) {
    return Promise.all(e.map((n) => this.emitEvent(n)));
  }
  async emitEventByName(e, n) {
    return Promise.all(e.map(async (r) => {
      const i = this.adapters.get(r);
      if (i && i.isActive)
        return await i.onEvent(n);
    }));
  }
  async emitEventByNames(e) {
    return Promise.all(Array.from(e.entries()).map(async ([n, r]) => {
      const i = this.adapters.get(n);
      if (i && i.isActive)
        return await i.onEvent(r);
    }));
  }
  registerAdapter(e) {
    this.adapters.set(e.name, e);
  }
  async registerAdapterAndOpen(e) {
    this.registerAdapter(e), await e.open();
  }
  async closeSomeAdapters(e) {
    for (const n of e)
      this.adapters.delete(n.name), await n.close();
  }
  async closeSomeAdapterWhenOpen(e) {
    for (const n of e)
      this.adapters.delete(n.name), n.isEnable && await n.close();
  }
  findSomeAdapter(e) {
    return this.adapters.get(e);
  }
  async closeAdapterByPredicate(e) {
    const n = Array.from(this.adapters.values()).filter(e);
    await this.closeSomeAdapters(n);
  }
  async closeAllAdapters() {
    await Promise.all(Array.from(this.adapters.values()).map((e) => e.close())), this.adapters.clear();
  }
  async reloadAdapter(e, n) {
    const r = this.adapters.get(e);
    r && await r.reload(n);
  }
  async reloadSomeAdapters(e) {
    await Promise.all(Array.from(e.entries()).map(([n, r]) => this.reloadAdapter(n, r)));
  }
  hasActiveAdapters() {
    return Array.from(this.adapters.values()).some((e) => e.isActive);
  }
  async getAllConfig() {
    return Array.from(this.adapters.values()).map((e) => e.config);
  }
}
class Iy {
  adapter;
  core;
  constructor(e, n) {
    this.adapter = e, this.core = n;
  }
}
class W_e extends Iy {
  // 消息相关 API 方法可以在这里实现
}
class z_e extends Iy {
  // 用户相关 API 方法可以在这里实现
}
class K_e extends Iy {
  // 群组相关 API 方法可以在这里实现
}
class V_e extends Iy {
  // 好友相关 API 方法可以在这里实现
}
function Y_e(t, e) {
  return /* @__PURE__ */ new Map();
}
class J_e {
  core;
  context;
  configLoader;
  apis;
  networkManager;
  actions;
  constructor(e, n, r) {
    this.core = e, this.context = n, this.configLoader = new q_e(e, r.configPath), this.apis = {
      MsgApi: new W_e(this, e),
      UserApi: new z_e(this, e),
      GroupApi: new K_e(this, e),
      FriendApi: new V_e(this, e)
    }, this.actions = Y_e(), this.networkManager = new H_e();
  }
  // 检查协议是否启用
  isEnabled() {
    return this.configLoader.configData.enable;
  }
  async createProtocolLog(e) {
    let n = `[NapCat Protocol] 配置加载
`;
    if (n += `协议状态: ${e.enable ? "已启用" : "已禁用"}
`, e.enable) {
      for (const r of e.network.httpServers)
        n += `HTTP服务: ${r.host}:${r.port}, : ${r.enable ? "已启动" : "未启动"}
`;
      for (const r of e.network.websocketServers)
        n += `WebSocket服务: ${r.host}:${r.port}, : ${r.enable ? "已启动" : "未启动"}
`;
      for (const r of e.network.websocketClients)
        n += `WebSocket客户端: ${r.url}, : ${r.enable ? "已启动" : "未启动"}
`;
    }
    return n;
  }
  async initProtocol() {
    const e = this.configLoader.configData;
    if (!e.enable) {
      this.context.logger.log("[NapCat Protocol] 协议未启用，跳过初始化");
      return;
    }
    const n = this.core.selfInfo, r = await this.createProtocolLog(e);
    this.context.logger.log(`[Notice] ${r}`), await this.networkManager.openAllAdapters(), this.context.logger.log(`[NapCat Protocol] 初始化完成，Bot: ${n.uin}`);
  }
  async close() {
    await this.networkManager.closeAllAdapters(), this.context.logger.log("[NapCat Protocol] 已关闭所有网络适配器");
  }
}
class X_e {
  name = "onebot11";
  adapter;
  constructor(e) {
    this.adapter = e;
  }
  get enabled() {
    return !0;
  }
  async init() {
    await this.adapter.InitOneBot();
  }
  async close() {
    await this.adapter.networkManager.closeAllAdapters();
  }
  getAdapter() {
    return this.adapter;
  }
}
class Z_e {
  name = "napcat-protocol";
  adapter;
  constructor(e) {
    this.adapter = e;
  }
  get enabled() {
    return this.adapter.isEnabled();
  }
  async init() {
    await this.adapter.initProtocol();
  }
  async close() {
    await this.adapter.close();
  }
  getAdapter() {
    return this.adapter;
  }
}
class eEe {
  core;
  context;
  pathWrapper;
  // 协议适配器实例
  onebotAdapter = null;
  napcatProtocolAdapter = null;
  // 所有已注册的适配器
  adapters = /* @__PURE__ */ new Map();
  constructor(e, n, r) {
    this.core = e, this.context = n, this.pathWrapper = r;
  }
  // 初始化所有协议适配器
  async initAdapters() {
    this.context.logger.log("[AdapterManager] 开始初始化协议适配器...");
    try {
      const e = new U_e(this.core, this.context, this.pathWrapper);
      this.onebotAdapter = new X_e(e), this.adapters.set("onebot11", this.onebotAdapter), await this.onebotAdapter.init(), this.context.logger.log("[AdapterManager] OneBot11 适配器初始化完成");
    } catch (e) {
      this.context.logger.logError("[AdapterManager] OneBot11 适配器初始化失败:", e);
    }
    try {
      const e = new J_e(this.core, this.context, this.pathWrapper);
      this.napcatProtocolAdapter = new Z_e(e), this.adapters.set("napcat-protocol", this.napcatProtocolAdapter), this.napcatProtocolAdapter.enabled ? (await this.napcatProtocolAdapter.init(), this.context.logger.log("[AdapterManager] NapCat Protocol 适配器初始化完成")) : this.context.logger.log("[AdapterManager] NapCat Protocol 适配器未启用，跳过初始化");
    } catch (e) {
      this.context.logger.logError("[AdapterManager] NapCat Protocol 适配器初始化失败:", e);
    }
    this.context.logger.log(`[AdapterManager] 协议适配器初始化完成，已加载 ${this.adapters.size} 个适配器`);
  }
  // 获取 OneBot11 适配器
  getOneBotAdapter() {
    return this.onebotAdapter?.getAdapter() ?? null;
  }
  // 获取 NapCat Protocol 适配器
  getNapCatProtocolAdapter() {
    return this.napcatProtocolAdapter?.getAdapter() ?? null;
  }
  // 获取指定适配器
  getAdapter(e) {
    return this.adapters.get(e);
  }
  // 获取所有已启用的适配器
  getEnabledAdapters() {
    return Array.from(this.adapters.values()).filter((e) => e.enabled);
  }
  // 获取所有适配器
  getAllAdapters() {
    return Array.from(this.adapters.values());
  }
  // 关闭所有适配器
  async closeAllAdapters() {
    this.context.logger.log("[AdapterManager] 开始关闭所有协议适配器...");
    for (const [e, n] of this.adapters)
      try {
        await n.close(), this.context.logger.log(`[AdapterManager] ${e} 适配器已关闭`);
      } catch (r) {
        this.context.logger.logError(`[AdapterManager] 关闭 ${e} 适配器失败:`, r);
      }
    this.adapters.clear(), this.context.logger.log("[AdapterManager] 所有协议适配器已关闭");
  }
  // 重新加载指定适配器
  async reloadAdapter(e) {
    const n = this.adapters.get(e);
    n && (await n.close(), await n.init(), this.context.logger.log(`[AdapterManager] ${e} 适配器已重新加载`));
  }
}
class tEe {
  getOnAmgomDataPiece(...e) {
  }
}
const nEe = {
  "3.2.12-28418-x64": { recv: "A0723E0", send: "A06EAE0" },
  "9.9.15-28418-x64": { recv: "37A9004", send: "37A4BD0" },
  "6.9.56-28418-x64": { send: "4471360", recv: "4473BCC" },
  "6.9.56-28418-arm64": { send: "3FBDBF8", recv: "3FC0410" },
  "9.9.15-28498-x64": { recv: "37A9004", send: "37A4BD0" },
  "9.9.16-28788-x64": { send: "38076D0", recv: "380BB04" },
  "3.2.13-28788-x64": { send: "A0CEC20", recv: "A0D2520" },
  "3.2.13-28788-arm64": { send: "6E91018", recv: "6E94850" },
  "9.9.16-28971-x64": { send: "38079F0", recv: "380BE24" },
  "3.2.13-28971-x64": { send: "A0CEF60", recv: "A0D2860" },
  "3.2.12-28971-arm64": { send: "6E91318", recv: "6E94B50" },
  "6.9.58-28971-x64": { send: "449ACA0", recv: "449D50C" },
  "6.9.58-28971-arm64": { send: "3FE0DB0", recv: "3FE35C8" },
  "9.9.16-29271-x64": { send: "3833510", recv: "3837944" },
  "3.2.13-29271-x64": { send: "A11E680", recv: "A121F80" },
  "3.2.13-29271-arm64": { send: "6ECA098", recv: "6ECD8D0" },
  "9.9.16-29456-x64": { send: "3835CD0", recv: "383A104" },
  "3.2.13-29456-x64": { send: "A11E820", recv: "A122120" },
  "3.2.13-29456-arm64": { send: "6ECA130", recv: "6ECD968" },
  "6.9.59-29456-x64": { send: "44C57A0", recv: "44C800C" },
  "6.9.59-29456-arm64": { send: "4005FE8", recv: "4008800" },
  "9.9.16-29927-x64": { send: "3869C50", recv: "386E084" },
  "3.2.13-29927-x64": { send: "A1913A0", recv: "A194CA0" },
  "3.2.13-29927-arm64": { send: "6F1C7E0", recv: "6F20018" },
  "6.9.61-29927-x64": { send: "44FCC60", recv: "44FF4CC" },
  "6.9.61-29927-arm64": { send: "4038740", recv: "403AF58" },
  "9.9.17-30366-x64": { send: "39AB0B0", recv: "39AF4E4" },
  "3.2.15-30366-x64": { send: "A402380", recv: "A405C80" },
  "3.2.15-30366-arm64": { send: "70C3FA8", recv: "70C77E0" },
  "6.9.62-30366-x64": { send: "4669760", recv: "466BFCC" },
  "6.9.62-30366-arm64": { send: "4189770", recv: "418BF88" },
  "9.9.17-30483-x64": { send: "39AC1B0", recv: "39B05E4" },
  "6.9.62-30483-arm64": { send: "41896B0", recv: "418bec8" },
  "6.9.62-30483-x64": { send: "4669460", recv: "466BCCC" },
  "3.2.15-30483-x64": { send: "A402540", recv: "A405E40" },
  "3.2.15-30483-arm64": { send: "70C40E8", recv: "70C7920" },
  "9.9.17-30594-x64": { send: "39AC1B0", recv: "39B05E4" },
  "6.9.62-30594-arm64": { send: "41896B0", recv: "418bec8" },
  "6.9.62-30594-x64": { send: "4669460", recv: "466BCCC" },
  "3.2.15-30594-x64": { send: "A402540", recv: "A405E40" },
  "3.2.15-30594-arm64": { send: "70C40E8", recv: "70C7920" },
  "9.9.17-30851-x64": { send: "395C150", recv: "3960584" },
  "3.2.15-30851-x64": { send: "A4A03E0", recv: "A4A3CE0" },
  "3.2.15-30851-arm64": { send: "713A318", recv: "713DB50" },
  "6.9.63-30851-x64": { send: "46C8040", recv: "46CA8AC" },
  "6.9.63-30851-arm64": { send: "41DCBD8", recv: "41DF3F0" },
  "9.9.17-30899-x64": { send: "395C150", recv: "3960584" },
  "3.2.15-30899-x64": { send: "A4A03E0", recv: "A4A3CE0" },
  "3.2.15-30899-arm64": { send: "713A318", recv: "713DB50" },
  "6.9.63-30899-x64": { send: "46C8040", recv: "46CA8AC" },
  "6.9.63-30899-arm64": { send: "41DCBD8", recv: "41DF3F0" },
  "9.9.17-31219-x64": { send: "39C1350", recv: "39C5784" },
  "9.9.17-31245-x64": { send: "39C1350", recv: "39C5784" },
  "6.9.63-31245-x64": { send: "4720A40", recv: "47232AC" },
  "6.9.63-31245-arm64": { send: "41DCBD8", recv: "422D4E8" },
  "3.2.15-31245-x64": { send: "A550F80", recv: "A554880" },
  "3.2.15-31245-arm64": { send: "71BEBB8", recv: "71C23F0" },
  "9.9.17-31363-x64": { send: "39C1910", recv: "39C5d44" },
  "3.2.15-31363-x64": { send: "A554500", recv: "A557E00" },
  "3.2.15-31363-arm64": { send: "71BFD48", recv: "71C3580" },
  "6.9.65-31363-x64": { send: "4720E80", recv: "47236EC" },
  "6.9.65-31363-arm64": { send: "422CEF8", recv: "422F710" },
  "9.9.18-32690-x64": { send: "39F9630", recv: "39FDE30" },
  "3.2.16-32690-x64": { send: "A5E24C0", recv: "A5E5EE0" },
  "3.2.16-32690-arm64": { send: "7226630", recv: "7229F60" },
  "3.2.16-32721-x64": { send: "A5E24C0", recv: "A5E5EE0" },
  "3.2.16-32721-arm64": { send: "7226630", recv: "7229F60" },
  "9.9.18-32793-x64": { send: "39F9A30", recv: "39FE230" },
  "3.2.16-32793-x64": { send: "A5E24C0", recv: "A5E5EE0" },
  "3.2.16-32793-arm64": { send: "7226630", recv: "7229F60" },
  "9.9.18-32869-x64": { send: "39F9A30", recv: "39FE230" },
  "3.2.16-32869-x64": { send: "A5E24C0", recv: "A5E5EE0" },
  "3.2.16-32869-arm64": { send: "7226630", recv: "7229F60" },
  "9.9.18-33139-x64": { send: "39F5870", recv: "39FA070" },
  "3.2.16-33139-x64": { send: "A634F60", recv: "A638980" },
  "3.2.16-33139-arm64": { send: "7262BB0", recv: "72664E0" },
  "9.9.18-33800-x64": { send: "39F5870", recv: "39FA070" },
  "3.2.16-33800-x64": { send: "A634F60", recv: "A638980" },
  "3.2.16-33800-arm64": { send: "7262BB0", recv: "72664E0" },
  "9.9.19-34231-x64": { send: "3BD73D0", recv: "3BDBBD0" },
  "3.2.17-34231-x64": { send: "AD787E0", recv: "AD7C200" },
  "3.2.17-34231-arm64": { send: "770CDC0", recv: "77106F0" },
  "9.9.19-34362-x64": { send: "3BD80D0", recv: "3BDC8D0" },
  "9.9.19-34467-x64": { send: "3BD8690", recv: "3BDCE90" },
  "9.9.19-34566-x64": { send: "3BDA110", recv: "3BDE910" },
  "9.9.19-34606-x64": { send: "3BDA110", recv: "3BDE910" },
  "3.2.17-34606-x64": { send: "AD7DC60", recv: "AD81680" },
  "3.2.17-34606-arm64": { send: "7711270", recv: "7714BA0" },
  "9.9.19-34740-x64": { send: "3BDD8D0", recv: "3BE20D0" },
  "3.2.17-34740-x64": { send: "ADDF0A0", recv: "ADE2AC0" },
  "3.2.17-34740-arm64": { send: "7753BB8", recv: "77574E8" },
  "9.9.19-34958-x64": { send: "3BDD8D0", recv: "3BE20D0" },
  "3.2.17-35184-x64": { send: "AE0DDE0", recv: "AE11800" },
  "3.2.17-35184-arm64": { send: "7776028", recv: "7779958" },
  "9.9.19-35184-x64": { send: "3BE5A10", recv: "3BEA210" },
  "9.9.19-35341-x64": { send: "3BF1D50", recv: "3BF6550" },
  "9.9.19-35469-x64": { send: "3BF1D50", recv: "3BF6550" },
  "3.2.17-35341-x64": { send: "AE2F700", recv: "AE33120" },
  "3.2.17-35341-arm64": { send: "778D840", recv: "7791170" },
  "9.9.20-35951-x64": { send: "3034BAC", recv: "3038354" },
  "3.2.18-35951-x64": { send: "AFBBB00", recv: "AFBF520" },
  "9.9.20-36580-x64": { send: "30824B8", recv: "3085C5C" },
  "3.2.18-36580-x64": { send: "B0853E0", recv: "B088E60" },
  "3.2.18-36580-arm64": { send: "793DAC8", recv: "7941458" },
  "3.2.18-37012-x64": { send: "B20F960", recv: "B2133E0" },
  "3.2.18-37012-arm64": { send: "7A19E00", recv: "7A1D790" },
  "9.9.20-37012-x64": { send: "30CC958", recv: "30D00FC" },
  "3.2.18-37051-x64": { send: "B20F960", recv: "B2133E0" },
  "3.2.18-37051-arm64": { send: "7A19E00", recv: "7A1D790" },
  "9.9.20-37051-x64": { send: "30CC958", recv: "30D00FC" },
  "9.9.20-37475-x64": { send: "30D30D8", recv: "30D687C" },
  "3.2.18-37475-x64": { send: "B238EC0", recv: "B23C940" },
  "3.2.18-37475-arm64": { send: "7A34B38", recv: "7A384C8" },
  "9.9.20-37625-x64": { send: "30D39D8", recv: "30D717C" },
  "3.2.18-37625-x64": { send: "B2397E0", recv: "B23D260" },
  "3.2.18-37625-arm64": { send: "7A350D8", recv: "7A38A68" },
  "9.9.21-38503-x64": { send: "3105F38", recv: "31096DC" },
  "3.2.19-38503-x64": { send: "B2C1A60", recv: "B2C54E0" },
  "3.2.19-38626-x64": { send: "B2C1BE0", recv: "B2C5660" },
  "9.9.21-38626-x64": { send: "310A758", recv: "310DEFC" },
  "3.2.19-38626-arm64": { send: "7A8A490", recv: "7A8DE20" },
  "9.9.21-38711-x64": { send: "310A758", recv: "310DEFC" },
  "3.2.19-38960-x64": { send: "B3740E0", recv: "B377B60" },
  "9.9.21-38960-x64": { send: "313F7D8", recv: "3142F7C" },
  "3.2.19-38960-arm64": { send: "7B01D98", recv: "7B05728" },
  "3.2.19-39038-x64": { send: "B3759E0", recv: "B379460" },
  "3.2.19-39038-arm64": { send: "7B025C8", recv: "7B05F58" },
  "9.9.21-39038-x64": { send: "313FB58", recv: "31432FC" },
  "9.9.22-40362-x64": { send: "31C0EB8", recv: "31C465C" },
  "3.2.20-40768-x64": { send: "B69CFE0", recv: "B6A0A60" },
  "9.9.22-40768-x64": { send: "31C1838", recv: "31C4FDC" },
  "3.2.20-40768-arm64": { send: "7D49B18", recv: "7D4D4A8" },
  "6.9.82-40768-arm64": { send: "202A198", recv: "202B718" },
  "9.9.22-40824-x64": { send: "31C1838", recv: "31C4FDC" },
  "3.2.20-40824-arm64": { send: "7D49B18", recv: "7D4D4A8" },
  "6.9.82-40824-arm64": { send: "202A198", recv: "202B718" },
  "3.2.20-40990-x64": { send: "B69CFE0", recv: "B6A0A60" },
  "3.2.20-40990-arm64": { send: "7D49B18", recv: "7D4D4A8" },
  "9.9.22-40990-x64": { send: "31C1838", recv: "31C4FDC" },
  "6.9.82-40990-arm64": { send: "202A198", recv: "202B718" },
  "9.9.23-41679-x64": { send: "2C94520", recv: "2C97AA0" },
  "6.9.83-41679-arm64": { send: "3D718F8", recv: "3D74208" },
  "9.9.23-41785-x64": { send: "2C944A0", recv: "2C97A20" },
  "6.9.83-41785-arm64": { send: "3D6DA28", recv: "3D70338" },
  "6.9.83-41857-arm64": { send: "3D74610", recv: "3D76F20" },
  "3.2.21-41857-x64": { send: "A7B40A0", recv: "A7B7B20" },
  "9.9.23-41857-x64": { send: "2C98F00", recv: "2C9C480" },
  "3.2.21-41857-arm64": { send: "6B159F8", recv: "6B19388" },
  "9.9.23-42086-x64": { send: "2C99800", recv: "2C9CD80" },
  "3.2.21-42086-x64": { send: "A7B1060", recv: "A7B4AE0" },
  "3.2.21-42086-arm64": { send: "6B13038", recv: "6B169C8" },
  "9.9.23-42430-x64": { send: "2C9A4A0", recv: "2C9DA20" },
  "9.9.25-42744-x64": { send: "2CD8E40", recv: "2CDC3C0" },
  "6.9.86-42744-arm64": { send: "3DCC840", recv: "3DCF150" },
  "9.9.25-42905-x64": { send: "2CE46A0", recv: "2CE7C20" },
  "6.9.86-42905-arm64": { send: "3DD6098", recv: "3DD89A8" },
  "3.2.22-42941-x64": { send: "A8AD8A0", recv: "A8B1320" },
  "9.9.25-42941-x64": { send: "2CE4DA0", recv: "2CE8320" },
  "3.2.22-42941-arm64": { send: "6BC95E8", recv: "6BCCF78" },
  "6.9.86-42941-arm64": { send: "3DDDAD0", recv: "3DE03E0" },
  "9.9.26-44175-x64": { send: "2CD84A0", recv: "2CDBA20" },
  "3.2.23-44343-x64": { send: "A46F140", recv: "A472BE0" },
  "9.9.26-44343-x64": { send: "2CD8EE0", recv: "2CDC460" },
  "3.2.23-44343-arm64": { send: "6926F60", recv: "692A910" },
  "9.9.26-44498-x64": { send: "2CDAE40", recv: "2CDE3C0" },
  "9.9.26-44725-x64": { send: "2CEBB20", recv: "2CEF0A0" },
  "9.9.27-45627-x64": { send: "2E59CC0", recv: "2E5D240" },
  "6.9.88-44725-x64": { send: "451FE90", recv: "4522A40" },
  "6.9.88-44725-arm64": { send: "3D79168", recv: "3D7BA78" },
  "3.2.25-45758-x64": { send: "AAC4E00", recv: "AAC88A0" },
  "9.9.27-45758-x64": { send: "2E5C4A0", recv: "2E5FA20" },
  "3.2.25-45758-arm64": { send: "6D6F9A0", recv: "6D73350" },
  "3.2.26-46494-x64": { send: "AB341C0", recv: "AB37C60" },
  "9.9.28-46494-x64": { send: "2E77C20", recv: "2E7B1A0" },
  "3.2.26-46494-arm64": { send: "6DBBBB0", recv: "6DBF560" },
  "3.2.26-46928-arm64": { send: "6DBBBB0", recv: "6DBF560" },
  "3.2.26-46928-x64": { send: "AB341C0", recv: "AB37C60" },
  "9.9.28-46928-x64": { send: "2E77C20", recv: "2E7B1A0" },
  "3.2.27-47354-x64": { send: "AB6A6C0", recv: "AB6E160" },
  "3.2.27-47354-arm64": { send: "6DE1438", recv: "6DE4DE8" },
  "9.9.29-47354-x64": { send: "2E84920", recv: "2E87EA0" },
  "6.9.93-47354-arm64": { send: "3FD1E98", recv: "3FD47A8" },
  "6.9.93-47354-x64": { send: "47CD940", recv: "47D04F0" },
  "3.2.28-48517-x64": { send: "AD7C280", recv: "AD7FD20" },
  "9.9.30-48517-x64": { send: "2F3B960", recv: "2F3EEE0" },
  "3.2.28-48517-arm64": { send: "6F48B70", recv: "6F4C520" },
  "9.9.30-48762-x64": { send: "2F3B960", recv: "2F3EEE0" },
  "9.9.31-49599-x64": { send: "3082C40", recv: "30861C8" },
  "9.9.31-49738-x64": { send: "3086C80", recv: "308A208" },
  "3.2.29-49738-x64": { send: "B3B20A0", recv: "B3B5B40" },
  "3.2.29-49738-arm64": { send: "7342800", recv: "73461B0" },
  "9.9.32-50828-x64": { send: "3155200", recv: "3158788" },
  "9.9.32-50828-arm64": { send: "4327764", recv: "15E3184" },
  "3.2.30-50828-x64": { send: "B5D0FC0", recv: "B5D4A60" }
}, nO = nEe;
class rEe {
  supportedPlatforms = ["win32.x64", "linux.x64", "linux.arm64", "darwin.x64", "darwin.arm64"];
  MoeHooExport = { exports: {} };
  logger;
  loaded = !1;
  // 统一的监听器存储 - key: 'all' | 'type:0' | 'type:1' | 'cmd:xxx' | 'exact:type:cmd'
  listeners = /* @__PURE__ */ new Map();
  constructor({ logger: e }) {
    this.logger = e;
    try {
      const n = process.platform + "." + process.arch, r = be.join($u(hc(import.meta.url)), "./native/packet/MoeHoo." + n + ".node");
      de.existsSync(r) || (this.logger.logWarn(`NativePacketClient: 缺失运行时文件: ${r}`), this.loaded = !1), process.dlopen(this.MoeHooExport, r, dO.dlopen.RTLD_LAZY), this.loaded = !0, this.logger.log("[PacketHandler] 加载成功");
    } catch (n) {
      this.logger.logError("NativePacketClient 加载出错:", n), this.loaded = !1;
    }
  }
  /**
     * 添加监听器的通用方法
     */
  addListener(e, n, r = !1) {
    this.listeners.has(e) || this.listeners.set(e, /* @__PURE__ */ new Set());
    const i = { callback: n, once: r };
    return this.listeners.get(e).add(i), () => this.removeListener(e, n);
  }
  /**
     * 移除监听器的通用方法
     */
  removeListener(e, n) {
    const r = this.listeners.get(e);
    if (!r) return !1;
    for (const i of r)
      if (i.callback === n)
        return r.delete(i);
    return !1;
  }
  // ===== 永久监听器 =====
  /** 监听所有数据包 */
  onAll(e) {
    return this.addListener("all", e);
  }
  /** 监听特定类型的数据包 (0: send, 1: recv) */
  onType(e, n) {
    return this.addListener(`type:${e}`, n);
  }
  /** 监听所有发送的数据包 */
  onSend(e) {
    return this.onType(0, e);
  }
  /** 监听所有接收的数据包 */
  onRecv(e) {
    return this.onType(1, e);
  }
  /** 监听特定cmd的数据包(不限type) */
  onCmd(e, n) {
    return this.addListener(`cmd:${e}`, n);
  }
  /** 监听特定type和cmd的数据包(精确匹配) */
  onExact(e, n, r) {
    return this.addListener(`exact:${e}:${n}`, r);
  }
  // ===== 一次性监听器 =====
  /** 一次性监听所有数据包 */
  onceAll(e) {
    return this.addListener("all", e, !0);
  }
  /** 一次性监听特定类型的数据包 */
  onceType(e, n) {
    return this.addListener(`type:${e}`, n, !0);
  }
  /** 一次性监听所有发送的数据包 */
  onceSend(e) {
    return this.onceType(0, e);
  }
  /** 一次性监听所有接收的数据包 */
  onceRecv(e) {
    return this.onceType(1, e);
  }
  /** 一次性监听特定cmd的数据包 */
  onceCmd(e, n) {
    return this.addListener(`cmd:${e}`, n, !0);
  }
  /** 一次性监听特定type和cmd的数据包 */
  onceExact(e, n, r) {
    return this.addListener(`exact:${e}:${n}`, r, !0);
  }
  // ===== 移除监听器 =====
  /** 移除特定的全局监听器 */
  off(e, n) {
    return this.removeListener(e, n);
  }
  /** 移除特定key下的所有监听器 */
  offAll(e) {
    this.listeners.delete(e);
  }
  /** 移除所有监听器 */
  removeAllListeners() {
    this.listeners.clear();
  }
  /**
     * 触发监听器 - 按优先级触发: 精确匹配 > cmd匹配 > type匹配 > 全局
     */
  emitPacket(e, n, r, i, o) {
    const s = [
      `exact:${e}:${r}`,
      // 精确匹配
      `cmd:${r}`,
      // cmd匹配
      `type:${e}`,
      // type匹配
      "all"
      // 全局
    ];
    for (const a of s) {
      const c = this.listeners.get(a);
      if (!c) continue;
      const u = [];
      for (const l of c)
        try {
          l.callback({ type: e, uin: n, cmd: r, seq: i, hex_data: o }), l.once && u.push(l);
        } catch (d) {
          this.logger.logError("监听器回调执行出错:", d);
        }
      for (const l of u)
        c.delete(l);
    }
  }
  async init(e, n = !1) {
    const r = e + "-" + process.arch;
    try {
      if (!this.loaded)
        return this.logger.logWarn("NativePacketClient 未成功加载，无法初始化"), !1;
      const i = nO[r]?.send, o = nO[r]?.recv;
      if (!i || !o)
        return this.logger.logWarn(`NativePacketClient: 未找到对应版本的偏移数据: ${r}`), !1;
      const s = process.platform + "." + process.arch;
      return this.supportedPlatforms.includes(s) ? (this.MoeHooExport.exports.initHook?.(i, o, (a, c, u, l, d) => {
        this.emitPacket(a, c, u, l, d);
      }, n), this.logger.log("[PacketHandler] 初始化成功"), !0) : (this.logger.logWarn(`NativePacketClient: 不支持的平台: ${s}`), !1);
    } catch (i) {
      return this.logger.logError("NativePacketClient 初始化出错:", i), !1;
    }
  }
}
class iEe {
  supportedPlatforms = ["win32.x64", "linux.x64", "linux.arm64", "darwin.x64", "darwin.arm64"];
  exports = { exports: {} };
  logger;
  _loaded = !1;
  constructor({ logger: e }) {
    this.logger = e, this.load();
  }
  load() {
    const e = process.platform + "." + process.arch;
    if (!this.supportedPlatforms.includes(e)) {
      this.logger.logWarn(`Napi2NativeLoader: 不支持的平台: ${e}`), this._loaded = !1;
      return;
    }
    const n = be.join(
      $u(hc(import.meta.url)),
      "./native/napi2native/napi2native." + e + ".node"
    );
    if (!de.existsSync(n)) {
      this.logger.logWarn(`Napi2NativeLoader: 缺失运行时文件: ${n}`), this._loaded = !1;
      return;
    }
    try {
      process.dlopen(this.exports, n, dO.dlopen.RTLD_LAZY), this._loaded = !0, this.logger.log("[Napi2NativeLoader] 加载成功");
    } catch (r) {
      this.logger.logError("Napi2NativeLoader 加载出错:", r), this._loaded = !1;
    }
  }
  get loaded() {
    return this._loaded;
  }
  get nativeExports() {
    return this.exports.exports;
  }
  /**
   * 初始化 Hook
   * @param send send 偏移地址
   * @param recv recv 偏移地址
   * @returns 是否初始化成功
   */
  initHook(e, n) {
    if (!this._loaded)
      return this.logger.logWarn("Napi2NativeLoader 未成功加载，无法初始化 Hook"), !1;
    try {
      return this.nativeExports.initHook?.(e, n) ?? !1;
    } catch (r) {
      return this.logger.logError("Napi2NativeLoader initHook 出错:", r), !1;
    }
  }
}
class oEe {
  psCpuUsage = process.cpuUsage();
  psCurrentTime = process.hrtime();
  cpuTimes = dt.cpus().map((e) => e.times);
  replaceNaN(e) {
    return isNaN(e) ? 0 : e;
  }
  sysCpuInfo() {
    const e = dt.cpus().map((i) => i.times), { total: n, active: r } = e.map((i, o) => {
      const s = this.cpuTimes[o], a = i.user + i.nice + i.sys + i.idle + i.irq, c = (s?.user ?? 0) + (s?.nice ?? 0) + (s?.sys ?? 0) + (s?.idle ?? 0) + (s?.irq ?? 0), u = a - i.idle, l = c - (s?.idle ?? 0);
      return {
        total: a - c,
        active: u - l
      };
    }).reduce((i, o) => ({
      total: i.total + o.total,
      active: i.active + o.active
    }), { total: 0, active: 0 });
    return this.cpuTimes = e, {
      usage: this.replaceNaN(r / n * 100).toFixed(2),
      model: dt.cpus()[0]?.model ?? "none",
      speed: dt.cpus()[0]?.speed ?? 0,
      core: dt.cpus().length
    };
  }
  sysMemoryUsage() {
    const { total: e, free: n } = { total: dt.totalmem(), free: dt.freemem() };
    return ((e - n) / 1024 / 1024).toFixed(2);
  }
  qqUsage() {
    const e = process.memoryUsage(), n = dt.cpus().length, r = process.cpuUsage(this.psCpuUsage), i = process.hrtime(this.psCurrentTime);
    this.psCpuUsage = process.cpuUsage(), this.psCurrentTime = process.hrtime();
    const o = (r.user + r.system) / 1e3, s = i[0] * 1e3 + i[1] / 1e6, a = o / s / n * 100;
    return {
      cpu: this.replaceNaN(a).toFixed(2),
      memory: ((e.heapTotal + e.external + e.arrayBuffers) / 1024 / 1024).toFixed(2)
    };
  }
  systemStatus() {
    const e = this.qqUsage(), n = this.sysCpuInfo();
    return {
      cpu: {
        core: n.core,
        model: n.model,
        speed: (n.speed / 1e3).toFixed(2),
        usage: {
          system: n.usage,
          qq: e.cpu
        }
      },
      memory: {
        total: (dt.totalmem() / 1024 / 1024).toFixed(2),
        usage: {
          system: this.sysMemoryUsage(),
          qq: e.memory
        }
      },
      arch: `${dt.platform()} ${dt.arch()} ${dt.release()}`
    };
  }
}
class sEe extends wO {
  statusHelper;
  interval = null;
  constructor(e = 3e3) {
    super(), this.statusHelper = new oEe(), this.on("newListener", (n) => {
      n === "statusUpdate" && this.listenerCount("statusUpdate") === 0 && this.startInterval(e);
    }), this.on("removeListener", (n) => {
      n === "statusUpdate" && this.listenerCount("statusUpdate") === 0 && this.stopInterval();
    });
  }
  startInterval(e) {
    this.interval ??= setInterval(() => {
      const n = this.statusHelper.systemStatus();
      this.emit("statusUpdate", n);
    }, e);
  }
  stopInterval() {
    this.interval && (clearInterval(this.interval), this.interval = null);
  }
}
const aEe = new sEe();
function qU(t, e = 5e3) {
  return new Promise((n, r) => {
    if (wo.platform !== "win32")
      return n({ disconnect: () => {
      } });
    const o = `\\\\.\\pipe\\NapCat_${wo.pid}`, s = setTimeout(() => {
      r(new Error(`连接命名管道超时: ${o}`));
    }, e);
    try {
      const a = wo.stdout.write.bind(wo.stdout), c = jL.connect(o, () => {
        clearTimeout(s), c.setNoDelay(!0), t.log(`[StdOut] 已重定向到命名管道: ${o}`);
        const u = new ML({
          highWaterMark: 1024 * 64,
          // 64KB 高水位线
          write(d, f, m) {
            return c.writable ? (c.write(d, f, () => {
            }) ? wo.nextTick(m) : c.once("drain", () => {
              m();
            }), !0) : (t.log("[StdOut] 管道不可写，回退到控制台输出"), a(d, f, m));
          }
        });
        wo.stdout.write = (d, f, m) => (typeof f == "function" && (m = f, f = void 0), u.write(d, f, m)), n({ disconnect: () => {
          wo.stdout.write = a, c.end(), t.log(`已手动断开命名管道连接: ${o}`);
        } });
      });
      c.on("error", (u) => {
        clearTimeout(s), wo.stdout.write = a, t.log(`连接命名管道 ${o} 时出错:`, u), r(u);
      }), c.on("end", () => {
        wo.stdout.write = a, t.log("命名管道连接已关闭");
      }), c.on("close", () => {
        wo.stdout.write = a, t.log("命名管道连接已关闭");
      });
    } catch (a) {
      clearTimeout(s), t.log(`尝试连接命名管道 ${o} 时发生异常:`, a), r(a);
    }
  });
}
async function cEe(t) {
  process.on("uncaughtException", (e) => {
    t.logError("[NapCat] [Error] Unhandled Exception:", e.message);
  }), process.on("unhandledRejection", (e) => {
    t.logError("[NapCat] [Error] unhandledRejection:", e);
  });
}
function uEe(t) {
  if (Pn.platform() === "darwin") {
    const r = Pn.homedir(), i = be.resolve(r, "./Library/Application Support/QQ");
    return [i, be.join(i, "global")];
  }
  let e = t.NodeQQNTWrapperUtil.getNTUserDataInfoConfig();
  e || (e = be.resolve(Pn.homedir(), "./.config/QQ"), de.mkdirSync(e, { recursive: !0 }));
  const n = be.resolve(e, "./nt_qq/global");
  return [e, n];
}
function lEe() {
  return {
    win32: rs.KWINDOWS,
    darwin: rs.KMAC,
    linux: rs.KLINUX
  }[Pn.platform()] ?? rs.KWINDOWS;
}
async function pEe(t, e, n, r, i) {
  t.initWithDeskTopConfig(
    {
      base_path_prefix: "",
      platform_type: r,
      app_type: 4,
      app_version: e.getFullQQVersion(),
      os_version: i,
      use_xlog: !1,
      qua: e.QQVersionQua ?? "",
      global_path_config: {
        desktopGlobalPath: n
      },
      thumb_config: { maxSide: 324, minSide: 48, longLimit: 6, density: 2 }
    },
    new fae()
  );
}
async function dEe(t, e, n, r, i) {
  t.initConfig({
    machineId: "",
    appid: e.QQVersionAppid ?? "",
    platVer: r,
    commonPath: n,
    clientVer: e.getFullQQVersion(),
    hostName: i,
    externalVersion: !1
  });
}
async function fEe(t, e, n, r, i) {
  const o = { isLogined: !1 };
  let s;
  const a = new Promise((u) => {
    s = u;
  }), c = new qse();
  return c.onUserLoggedIn = (u) => {
    const l = `当前账号(${u})已登录,无法重复登录`;
    e.logError(l), ve.setQQLoginError(l);
  }, c.onQRCodeLoginSucceed = async (u) => {
    o.isLogined = !0, ve.setQQLoginStatus(!0), s({
      uid: u.uid,
      uin: u.uin,
      nick: "",
      online: !0
    });
  }, c.onLoginConnected = () => {
    yEe(t, e).then(() => {
      hEe(o, e, t, r, i).then().catch((u) => e.logError(u)), c.onLoginConnected = () => {
      };
    });
  }, c.onQRCodeGetPicture = ({ pngBase64QrcodeData: u, qrcodeUrl: l }) => {
    ve.setQQLoginQrcodeURL(l);
    const d = u.replace(/^data:image\/\w+;base64,/, ""), f = Buffer.from(d, "base64");
    e.logWarn("请扫描下面的二维码，然后在手Q上授权登录：");
    const m = be.join(n.cachePath, "qrcode.png");
    Nae.generate(l, { small: !0 }, (h) => {
      e.logWarn([
        `
`,
        h,
        "二维码解码URL: " + l,
        "如果控制台二维码无法扫码，可以复制解码url到二维码生成网站生成二维码再扫码，也可以打开下方的二维码路径图片进行扫码。"
      ].join(`
`)), de.writeFile(m, f, {}, () => {
        e.logWarn("二维码已保存到", m);
      });
    });
  }, c.onQRCodeSessionFailed = (u, l) => {
    o.isLogined || (e.logError("[Core] [Login] Login Error,ErrType: ", u, " ErrCode:", l), u === 1 && l === 3 && ve.setQQLoginError("二维码已过期，请刷新"), t.getQRCodePicture());
  }, c.onLoginFailed = (...u) => {
    const l = JSON.stringify(u);
    e.logError("[Core] [Login] Login Error , ErrInfo: ", l), ve.setQQLoginError(`登录失败: ${l}`);
  }, t.addKernelLoginListener(su(c, e)), t.connect(), await a;
}
async function hEe(t, e, n, r, i) {
  const o = () => {
    const a = process.env.NAPCAT_QUICK_PASSWORD_MD5?.trim();
    if (a) {
      if (/^[a-fA-F0-9]{32}$/.test(a))
        return a.toLowerCase();
      e.logError("NAPCAT_QUICK_PASSWORD_MD5 格式无效（需为 32 位 MD5）");
    }
    const c = process.env.NAPCAT_QUICK_PASSWORD;
    if (typeof c == "string" && c.length > 0)
      return e.log("检测到 NAPCAT_QUICK_PASSWORD，已在内存中计算 MD5 用于回退登录"), _d("md5").update(c, "utf8").digest("hex");
  };
  ve.setRefreshQRCodeCallback(async () => {
    n.getQRCodePicture();
  }), ve.setQuickLoginCall(async (a) => await new Promise((c) => {
    a ? (e.log("正在快速登录 ", a), n.quickLoginWithUin(a).then((u) => {
      if (u.result === "0" && !u.loginErrorInfo?.errMsg)
        ve.setQQLoginStatus(!0), ve.setQQLoginError(""), c({ result: !0, message: "" });
      else {
        const d = u.loginErrorInfo?.errMsg || `快速登录失败，错误码: ${u.result}`;
        ve.setQQLoginError(d), n.getQRCodePicture(), c({ result: !1, message: d });
      }
    }).catch((u) => {
      e.logError(u), ve.setQQLoginError("快速登录发生错误"), n.getQRCodePicture(), c({ result: !1, message: "快速登录发生错误" });
    })) : c({ result: !1, message: "快速登录失败" });
  })), ve.setPasswordLoginCall(async (a, c) => await new Promise((u) => {
    a && c ? (e.log("正在密码登录 ", a), n.passwordLogin({
      uin: a,
      passwordMd5: c,
      step: 0,
      newDeviceLoginSig: new Uint8Array(),
      proofWaterSig: new Uint8Array(),
      proofWaterRand: new Uint8Array(),
      proofWaterSid: new Uint8Array(),
      unusualDeviceCheckSig: new Uint8Array()
    }).then((l) => {
      if (l.result === "140022008") {
        const d = l.loginErrorInfo?.proofWaterUrl || "";
        e.log("需要验证码, proofWaterUrl: ", d), u({
          result: !1,
          message: "需要验证码",
          needCaptcha: !0,
          proofWaterUrl: d
        });
      } else if (l.result === "140022010") {
        const d = l.loginErrorInfo?.jumpUrl || "", f = l.loginErrorInfo?.newDevicePullQrCodeSig || "";
        e.log("新设备需要扫码验证, jumpUrl: ", d), u({
          result: !1,
          message: "新设备需要扫码验证",
          needNewDevice: !0,
          jumpUrl: d,
          newDevicePullQrCodeSig: f
        });
      } else if (l.result === "140022011") {
        const d = l.loginErrorInfo?.jumpUrl || "", f = l.loginErrorInfo?.newDevicePullQrCodeSig || "";
        e.log("异常设备需要验证, jumpUrl: ", d), u({
          result: !1,
          message: "异常设备需要验证",
          needNewDevice: !0,
          jumpUrl: d,
          newDevicePullQrCodeSig: f
        });
      } else if (l.result !== "0") {
        const d = l.loginErrorInfo?.errMsg || "密码登录失败";
        ve.setQQLoginError(d), n.getQRCodePicture(), u({ result: !1, message: d });
      } else
        ve.setQQLoginStatus(!0), ve.setQQLoginError(""), u({ result: !0, message: "" });
    }).catch((l) => {
      e.logError(l), ve.setQQLoginError("密码登录发生错误"), n.getQRCodePicture(), u({ result: !1, message: "密码登录发生错误" });
    })) : u({ result: !1, message: "密码登录失败：参数不完整" });
  }));
  const s = async (a) => {
    const c = o();
    if (!c)
      return e.log(`QQ ${a} 未配置回退密码环境变量，建议优先使用 ACCOUNT + NAPCAT_QUICK_PASSWORD（NAPCAT_QUICK_PASSWORD_MD5 作为备用），将使用二维码登录方式`), { success: !1, attempted: !1 };
    e.log("正在尝试密码回退登录 ", a);
    const u = await ve.requestPasswordLogin(a, c);
    if (u.result)
      return e.log("密码回退登录成功 ", a), { success: !0, attempted: !0 };
    if (u.needCaptcha) {
      const l = u.proofWaterUrl ? `密码回退需要验证码，请在 WebUi 中继续完成验证：${u.proofWaterUrl}` : "密码回退需要验证码，请在 WebUi 中继续完成验证";
      return e.logWarn(l), ve.setQQLoginError("密码回退需要验证码，请在 WebUi 中继续完成验证"), { success: !1, attempted: !0 };
    }
    if (u.needNewDevice) {
      const l = u.jumpUrl ? `密码回退需要新设备验证，请在 WebUi 中继续完成验证：${u.jumpUrl}` : "密码回退需要新设备验证，请在 WebUi 中继续完成验证";
      return e.logWarn(l), ve.setQQLoginError("密码回退需要新设备验证，请在 WebUi 中继续完成验证"), { success: !1, attempted: !0 };
    }
    return e.logError("密码回退登录失败：", u.message), { success: !1, attempted: !0 };
  };
  if (ve.setCaptchaLoginCall(async (a, c, u, l, d) => await new Promise((f) => {
    a && c && u ? (e.log("正在验证码登录 ", a), n.passwordLogin({
      uin: a,
      passwordMd5: c,
      step: 1,
      newDeviceLoginSig: new Uint8Array(),
      proofWaterSig: new TextEncoder().encode(u),
      proofWaterRand: new TextEncoder().encode(l),
      proofWaterSid: new TextEncoder().encode(d),
      unusualDeviceCheckSig: new Uint8Array()
    }).then((m) => {
      if (console.log("验证码登录结果: ", m), m.result === "140022010") {
        const h = m.loginErrorInfo?.jumpUrl || "", y = m.loginErrorInfo?.newDevicePullQrCodeSig || "";
        e.log("验证码登录后需要新设备验证, jumpUrl: ", h), f({
          result: !1,
          message: "新设备需要扫码验证",
          needNewDevice: !0,
          jumpUrl: h,
          newDevicePullQrCodeSig: y
        });
      } else if (m.result === "140022011") {
        const h = m.loginErrorInfo?.jumpUrl || "", y = m.loginErrorInfo?.newDevicePullQrCodeSig || "";
        e.log("验证码登录后需要异常设备验证, jumpUrl: ", h), f({
          result: !1,
          message: "异常设备需要验证",
          needNewDevice: !0,
          jumpUrl: h,
          newDevicePullQrCodeSig: y
        });
      } else if (m.result !== "0") {
        const h = m.loginErrorInfo?.errMsg || "验证码登录失败";
        ve.setQQLoginError(h), n.getQRCodePicture(), f({ result: !1, message: h });
      } else
        ve.setQQLoginStatus(!0), ve.setQQLoginError(""), f({ result: !0, message: "" });
    }).catch((m) => {
      e.logError(m), ve.setQQLoginError("验证码登录发生错误"), n.getQRCodePicture(), f({ result: !1, message: "验证码登录发生错误" });
    })) : f({ result: !1, message: "验证码登录失败：参数不完整" });
  })), ve.setNewDeviceLoginCall(async (a, c, u) => await new Promise((l) => {
    a && c && u ? (e.log("正在新设备验证登录 ", a), n.passwordLogin({
      uin: a,
      passwordMd5: c,
      step: 2,
      newDeviceLoginSig: new TextEncoder().encode(u),
      proofWaterSig: new Uint8Array(),
      proofWaterRand: new Uint8Array(),
      proofWaterSid: new Uint8Array(),
      unusualDeviceCheckSig: new Uint8Array()
    }).then((d) => {
      if (d.result === "140022011") {
        const f = d.loginErrorInfo?.jumpUrl || "", m = d.loginErrorInfo?.newDevicePullQrCodeSig || "";
        e.log("新设备验证后需要异常设备验证, jumpUrl: ", f), l({
          result: !1,
          message: "异常设备需要验证",
          needNewDevice: !0,
          jumpUrl: f,
          newDevicePullQrCodeSig: m
        });
      } else if (d.result !== "0") {
        const f = d.loginErrorInfo?.errMsg || "新设备验证登录失败";
        ve.setQQLoginError(f), n.getQRCodePicture(), l({ result: !1, message: f });
      } else
        ve.setQQLoginStatus(!0), ve.setQQLoginError(""), l({ result: !0, message: "" });
    }).catch((d) => {
      e.logError(d), ve.setQQLoginError("新设备验证登录发生错误"), n.getQRCodePicture(), l({ result: !1, message: "新设备验证登录发生错误" });
    })) : l({ result: !1, message: "新设备验证登录失败：参数不完整" });
  })), r)
    if (i.some((a) => a.uin === r))
      e.log("正在快速登录 ", r), n.quickLoginWithUin(r).then(async (a) => {
        if (!(a.result === "0" && !a.loginErrorInfo?.errMsg)) {
          const u = a.loginErrorInfo?.errMsg || `快速登录失败，错误码: ${a.result}`;
          e.logError("快速登录错误：", u), ve.setQQLoginError(u);
          const { success: l, attempted: d } = await s(r);
          !l && !d && !t.isLogined && n.getQRCodePicture();
        }
      }).catch(async (a) => {
        e.logError("快速登录异常：", a), ve.setQQLoginError("快速登录发生错误");
        const { success: c, attempted: u } = await s(r);
        !c && !u && !t.isLogined && n.getQRCodePicture();
      });
    else {
      e.logError("快速登录失败，未找到该 QQ 历史登录记录，将尝试密码回退登录");
      const { success: a, attempted: c } = await s(r);
      !a && !c && !t.isLogined && n.getQRCodePicture();
    }
  else {
    e.log("没有 -q 指令指定快速登录，将使用二维码登录方式"), i.length > 0 && e.log(`可用于快速登录 of QQ：
${i.map((c, u) => `${u + 1}. ${c.uin} ${c.nickName}`).join(`
`)}`);
    let a = !1;
    try {
      const c = ve.getQQQuickLoginList() || [];
      (process.env.NAPCAT_QUICK_ACCOUNT || c.length > 0 || process.env.NAPCAT_QUICK_PASSWORD || process.env.NAPCAT_QUICK_PASSWORD_MD5) && (a = !0), await ve.runWebUiConfigQuickFunction();
    } catch (c) {
      e.logError("WebUi 快速登录失败 执行失败", c);
    }
    !a && !t.isLogined && n.getQRCodePicture();
  }
  n.getLoginList().then((a) => {
    const c = a.LocalLoginInfoList.filter((u) => u.isQuickLogin);
    ve.setQQQuickLoginList(c.map((u) => u.uin.toString())), ve.setQQNewLoginList(c);
  });
}
async function mEe(t, e, n) {
  return new Promise((r, i) => {
    const o = new Gse();
    if (o.onOpentelemetryInit = (s) => {
      s.is_init ? r() : i(new Error("opentelemetry init failed"));
    }, t.init(
      e,
      new pae(),
      new dae(),
      o
    ), n)
      n.start();
    else
      try {
        t.startNT(0);
      } catch {
        try {
          t.startNT();
        } catch (s) {
          i(new Error("init failed " + s.message));
        }
      }
  });
}
async function gEe(t, e) {
  process.env.NAPCAT_PROXY_PORT ? (t.getMSFService().setNetworkProxy({
    userName: "",
    userPwd: "",
    address: process.env.NAPCAT_PROXY_ADDRESS || "127.0.0.1",
    port: +process.env.NAPCAT_PROXY_PORT,
    proxyType: 2,
    domain: "",
    isSocket: !0
  }), e.logWarn("已设置代理", process.env.NAPCAT_PROXY_ADDRESS, process.env.NAPCAT_PROXY_PORT)) : process.env.NAPCAT_PROXY_CLOSE && t.getMSFService().setNetworkProxy({
    userName: "",
    userPwd: "",
    address: "",
    port: 0,
    proxyType: 0,
    domain: "",
    isSocket: !1
  });
}
async function yEe(t, e) {
  let n = !1;
  for (; !n; )
    n = t.getMsfStatus() !== 3, e.log("等待网络连接..."), await Kp(500);
  return e.log("网络已连接"), n;
}
async function HU() {
  console.log("NapCat Shell App Loading...");
  const t = new RR(), e = new rM(t.logsPath);
  process.env.NAPCAT_WORKER_PROCESS !== "1" && process.env.NAPCAT_DISABLE_MULTI_PROCESS !== "1" && process.env.NAPCAT_DISABLE_MULTIPROCESSING !== "1" && e.setFileLogEnabled(!1), cEe(e), await Ghe(t, e);
  const n = new Xse({ logger: e }), r = new rEe({ logger: e }), i = new iEe({ logger: e });
  await ns.init(t.binaryPath, e), process.env.NAPCAT_DISABLE_PIPE === "1" || process.env.NAPCAT_WORKER_PROCESS === "1" || await qU(e).catch((W) => e.logError("命名管道连接失败", W));
  const o = Zse(n.QQMainPath, n.getFullQQVersion()), s = Qse(t.configPath);
  await r.init(n.getFullQQVersion(), s.o3HookMode === 1);
  let a;
  if (r.onCmd("OidbSvcTrpcTcp.0xcde_2", ({ type: W, hex_data: G }) => {
    if (W === 1)
      try {
        const J = Buffer.from(G, "hex"), B = new fe(Gw).decode(J);
        if (B.body && B.body.length > 0) {
          const D = new fe(wq).decode(B.body);
          D.inner?.value && (a = D.inner.value, e.log("[NapCat] 已启用数据库辅助支持能力"));
        }
      } catch (J) {
        e.logError("[NapCat] [0xCDE_2] 解析失败:", J);
      }
  }), process.env.NAPCAT_ENABLE_VERBOSE_LOG === "1" && i.nativeExports.setVerbose?.(!0), process.env.NAPCAT_DISABLE_BYPASS !== "1") {
    const W = s.bypass ?? {};
    i.nativeExports.enableAllBypasses?.(W);
  } else
    e.log("[NapCat] Napi2NativeLoader: Bypass已通过环境变量禁用");
  const c = o.NodeIO3MiscService.get();
  c.addO3MiscListener(new tEe()), e.log("[NapCat] [Core] NapCat.Core Version: " + Hu), ve.setWorkingEnv(CA.Shell), lge(e, t, nM, aEe).then().catch((W) => e.logError(W));
  const u = o.NodeIQQNTWrapperEngine.get(), l = o.NodeIKernelLoginService.get();
  let d, f = null;
  try {
    f = o.NodeIQQNTStartupSessionWrapper.create(), d = o.NodeIQQNTWrapperSession.getNTWrapperSession("nt_1");
  } catch (W) {
    try {
      d = o.NodeIQQNTWrapperSession.create();
    } catch (G) {
      throw e.logError("创建 StartupSession 失败", W), e.logError("创建 Session 失败", G), G;
    }
  }
  const [m, h] = uEe(o);
  ve.setQQDataPath(m);
  const y = lEe();
  if (!n.QQVersionAppid || !n.QQVersionQua) throw new Error("QQVersionAppid or QQVersionQua  is not defined");
  await pEe(u, n, h, y, Dm), await dEe(l, n, h, Dm, fM), gEe(d, e);
  let x;
  try {
    const W = process.argv, G = W.findIndex((J) => J === "-q" || J === "--qq");
    G !== -1 && G + 1 < W.length && (x = W[G + 1]);
  } catch (W) {
    e.logWarn("解析命令行参数失败，无法使用快速登录功能", W);
  }
  const g = (await l.getLoginList()).LocalLoginInfoList, v = (/* @__PURE__ */ new Date()).getTime().toString();
  c.reportAmgomWeather("login", "a1", [v, "0", "0"]);
  const S = await fEe(l, e, t, x, g);
  typeof process.send == "function" && (process.send({ type: "login-success" }), e.log("[NapCat] 已通知主进程登录成功"));
  const E = "eb1fd6ac257461580dc7438eb099f23aae04ca679f4d88f53072dc56e3bb1129";
  c.setAmgomDataPiece(n.QQVersionAppid, new Uint8Array(Buffer.from(E, "hex")));
  let T = l.getMachineGuid();
  T = T.slice(0, 8) + "-" + T.slice(8, 12) + "-" + T.slice(12, 16) + "-" + T.slice(16, 20) + "-" + T.slice(20), c.reportAmgomWeather("login", "a6", [v, "184", "329"]);
  const j = await tae(
    T,
    n.QQVersionAppid,
    n.getFullQQVersion(),
    S.uin,
    S.uid,
    m
  );
  await mEe(d, j, f);
  const q = be.resolve(m, "./NapCat/data");
  if (m !== "/" && /^[a-zA-Z]:\\$/.test(m) === !1)
    try {
      de.mkdirSync(q, { recursive: !0 });
    } catch (W) {
      e.logError("创建accountDataPath失败", W);
    }
  e.logDebug("本账号数据/缓存目录：", q);
  const Y = new vEe(
    o,
    d,
    e,
    S,
    n,
    t,
    r,
    i
  );
  a && (Y.core.dbPassphrase = a), await Y.InitNapCat();
}
class vEe {
  core;
  context;
  constructor(e, n, r, i, o, s, a, c) {
    this.context = {
      packetHandler: a,
      napi2nativeLoader: c,
      workingEnv: CA.Shell,
      wrapper: e,
      session: n,
      logger: r,
      basicInfoWrapper: o,
      pathWrapper: s
    }, this.core = new S0(this.context, i);
  }
  async InitNapCat() {
    await this.core.initCore(), this.core.event.on("KickedOffLine", (r) => {
      ve.setQQLoginStatus(!1), ve.setQQLoginError(r);
    });
    const e = new eEe(this.core, this.context, this.context.pathWrapper);
    await e.initAdapters().catch((r) => this.context.logger.logError("初始化协议适配器失败", r));
    const n = e.getOneBotAdapter();
    n && ve.setOneBotContext(n);
  }
}
class bEe {
  utilityProcess;
  constructor(e) {
    this.utilityProcess = e;
  }
  createWorker(e, n, r) {
    const i = this.utilityProcess.fork(e, n, r);
    return {
      get pid() {
        return i.pid;
      },
      stdout: i.stdout,
      stderr: i.stderr,
      postMessage(o) {
        i.postMessage(o);
      },
      kill() {
        return i.kill();
      },
      on(o, s) {
        i.on(o, s);
      },
      once(o, s) {
        i.once(o, s);
      },
      off(o, s) {
        i.off(o, s);
      }
    };
  }
  onParentMessage(e) {
    process.parentPort && process.parentPort.on("message", (n) => {
      e(n.data);
    });
  }
  sendToParent(e) {
    return process.parentPort ? (process.parentPort.postMessage(e), !0) : !1;
  }
}
class xEe {
  forkFn;
  constructor(e) {
    this.forkFn = e;
  }
  createWorker(e, n, r) {
    const i = this.forkFn(e, n, r);
    return {
      get pid() {
        return i.pid;
      },
      stdout: i.stdout,
      stderr: i.stderr,
      postMessage(o) {
        i.send && i.send(o);
      },
      kill() {
        return i.kill();
      },
      on(o, s) {
        i.on(o, s);
      },
      once(o, s) {
        i.once(o, s);
      },
      off(o, s) {
        i.off(o, s);
      }
    };
  }
  onParentMessage(e) {
    process.on("message", (n) => {
      e(n);
    });
  }
  sendToParent(e) {
    return process.send ? (process.send(e), !0) : !1;
  }
}
async function wEe() {
  if (typeof process.versions.electron < "u") {
    const e = await import("electron");
    return e.app && !e.app.isReady() && await e.app.whenReady(), {
      manager: new bEe(e.utilityProcess),
      isElectron: !0
    };
  } else {
    const { fork: e } = await import("child_process");
    return {
      manager: new xEe(e),
      isElectron: !1
    };
  }
}
const WU = hc(import.meta.url), G_ = be.dirname(WU), SEe = new RR(), rO = be.join(G_, "config", ".env");
if (de.existsSync(rO))
  try {
    de.readFileSync(rO, "utf8").split(/\r?\n/).forEach((e) => {
      if (e = e.trim(), e && !e.startsWith("#")) {
        const n = e.split("="), r = n[0]?.trim(), i = n.slice(1).join("=").trim();
        r && i && (process.env[r] = i);
      }
    });
  } catch (t) {
    console.log("[NapCat] Failed to load .env file:", t);
  }
const Sd = {
  isWorkerProcess: process.env.NAPCAT_WORKER_PROCESS === "1",
  isMultiProcessDisabled: process.env.NAPCAT_DISABLE_MULTI_PROCESS === "1" || process.env.NAPCAT_DISABLE_MULTIPROCESSING === "1",
  isPipeDisabled: process.env.NAPCAT_DISABLE_PIPE === "1"
}, Xt = new rM(SEe.logsPath);
!Sd.isWorkerProcess && !Sd.isMultiProcessDisabled && Xt.setFileLogEnabled(!1);
let uu = null, wi = null, Ef = !1, mm = !1, zU = !1;
const jc = [], iO = 1e4, Cw = 3;
function _Ee() {
  return Ef ? "UtilityProcess" : "Fork";
}
function EEe() {
  return WU.endsWith(".mjs") ? be.join(G_, "napcat.mjs") : be.join(G_, "napcat.js");
}
function oO(t) {
  try {
    return process.kill(t, 0), !0;
  } catch {
    return !1;
  }
}
function AEe(t) {
  try {
    process.kill(t, "SIGKILL");
  } catch (e) {
    if (process.platform === "win32")
      try {
        require("child_process").execSync(`taskkill /F /PID ${t}`, { stdio: "ignore" });
      } catch {
        Xt.logError(`[NapCat] [Process] 强制终止进程失败: PID ${t}`);
      }
    else
      Xt.logError("[NapCat] [Process] 强制终止进程失败:", e);
  }
}
async function IEe(t) {
  if (Ef)
    try {
      const e = await import("electron");
      if (e.app && typeof e.app.getAppMetrics == "function") {
        const n = e.app.getAppMetrics(), r = process.pid;
        for (const i of n) {
          const o = i.pid;
          if (!(o === r || t.includes(o)))
            try {
              process.kill(o, "SIGTERM"), Xt.log(`[NapCat] [Process] 已清理残留进程: PID ${o} (${i.type})`);
            } catch {
            }
        }
      }
    } catch (e) {
      Xt.logDebug?.("[NapCat] [Process] 清理残留进程时出错:", e);
    }
}
async function CEe(t, e) {
  if (mm = !0, !wi) {
    Xt.logWarn("[NapCat] [Process] 没有运行中的Worker进程"), await kg(!1), mm = !1;
    return;
  }
  const n = wi.pid;
  if (wi.postMessage({ type: "restart-prepare" }), await new Promise((r) => {
    const i = setTimeout(() => {
      Xt.logWarn("[NapCat] [Process] Worker进程未在 5 秒内退出，尝试发送强制关闭信号"), wi?.postMessage({ type: "shutdown" }), setTimeout(() => {
        Xt.logWarn("[NapCat] [Process] Worker进程仍未退出，尝试 kill"), wi?.kill(), r();
      }, 2e3);
    }, 5e3);
    wi?.once("exit", () => {
      clearTimeout(i), r();
    });
  }), n && oO(n) && (Xt.logWarn(`[NapCat] [Process] 进程 ${n} 仍在运行，尝试强制杀掉`), AEe(n), await new Promise((r) => setTimeout(r, 1e3)), oO(n) && Xt.logError(`[NapCat] [Process] 进程 ${n} 无法终止，可能需要手动处理`)), await new Promise((r) => setTimeout(r, 3e3)), await kg(!1, t, e), Ef && wi?.pid) {
    const r = [process.pid, wi.pid];
    await IEe(r);
  }
  mm = !1;
}
async function kg(t = !0, e, n) {
  if (!uu)
    throw new Error("进程管理器未初始化");
  const r = EEe(), i = _Ee(), o = [];
  if (t) {
    const a = process.argv.slice(2), c = a.findIndex((u) => u === "-q" || u === "--qq");
    if (c !== -1 && c + 1 < a.length) {
      const u = a[c], l = a[c + 1];
      u && l && o.push(u, l);
    }
  }
  const s = uu.createWorker(r, o, {
    env: {
      ...process.env,
      NAPCAT_WORKER_PROCESS: "1",
      ...e ? { NAPCAT_WEBUI_JWT_SECRET_KEY: e } : {},
      ...n ? { NAPCAT_WEBUI_PREFERRED_PORT: String(n) } : {}
    },
    stdio: Ef ? "pipe" : ["inherit", "pipe", "pipe", "ipc"]
  });
  wi = s, s.stdout && s.stdout.on("data", (a) => {
    process.stdout.write(a);
  }), s.stderr && s.stderr.on("data", (a) => {
    process.stderr.write(a);
  }), s.on("message", (a) => {
    if (typeof a == "object" && a !== null && "type" in a) {
      const c = a;
      c.type === "restart" ? CEe(c.secretKey, c.port).catch((u) => {
        Xt.logError(`[NapCat] [${i}] 重启Worker进程失败:`, u);
      }) : c.type === "login-success" && Xt.log(`[NapCat] [${i}] Worker进程已登录成功，切换到正常重试策略`);
    }
  }), s.on("exit", (a) => {
    const c = typeof a == "number" ? a : 0;
    if (c !== 0 && Xt.logError(`[NapCat] [${i}] Worker进程退出，退出码: ${c}`), !mm && !zU) {
      const u = Date.now();
      for (; jc.length > 0 && u - jc[0] > iO; )
        jc.shift();
      jc.push(u), jc.length >= Cw && (Xt.logError(`[NapCat] [${i}] Worker进程在 ${iO / 1e3} 秒内异常退出 ${Cw} 次，主进程退出`), process.exit(1)), Xt.logWarn(`[NapCat] [${i}] Worker进程意外退出 (${jc.length}/${Cw})，正在尝试重新拉起...`), kg(!0).catch((l) => {
        Xt.logError(`[NapCat] [${i}] 重新拉起Worker进程失败:`, l);
      });
    }
  }), await new Promise((a, c) => {
    const u = () => {
      s.off("error", l), a();
    }, l = (...d) => {
      const f = d[0];
      Xt.logError(`[NapCat] [${i}] Worker进程启动失败:`, f), s.off("spawn", u), c(f);
    };
    s.once("spawn", u), s.once("error", l);
  });
}
async function TEe() {
  Sd.isPipeDisabled || await qU(Xt).catch(
    (e) => Xt.logError("命名管道连接失败", e)
  ), await kg();
  const t = () => {
    zU = !0, wi ? (wi.postMessage({ type: "shutdown" }), setTimeout(() => {
      wi?.kill(), process.exit(0);
    }, 1e3)) : process.exit(0);
  };
  process.on("SIGINT", () => t()), process.on("SIGTERM", () => t());
}
async function kEe() {
  if (!uu)
    throw new Error("进程管理器未初始化");
  const t = process.env.NAPCAT_PRELOAD_NODE_ADDON_PATH;
  if (t)
    try {
      const e = await import("os");
      process.dlopen({ exports: {} }, t, e.constants.dlopen.RTLD_NOW | e.constants.dlopen.RTLD_GLOBAL), Xt.log(`[NapCat] [Worker] 已预加载 Node Addon: ${t}`);
    } catch (e) {
      Xt.logError(`[NapCat] [Worker] 预加载 Node Addon 失败: ${t}`, e);
    }
  uu.onParentMessage((e) => {
    typeof e == "object" && e !== null && "type" in e && (e.type === "restart-prepare" || e.type === "shutdown") && setTimeout(() => {
      process.exit(0);
    }, 100);
  }), ve.setRestartProcessCall(async () => {
    try {
      return uu.sendToParent({
        type: "restart",
        secretKey: nn.getSecretKey(),
        port: AU
      }) ? { result: !0, message: "进程重启请求已发送" } : { result: !1, message: "无法与主进程通信" };
    } catch (e) {
      return Xt.logError("[NapCat] [Process] 发送重启请求失败:", e), {
        result: !1,
        message: "发送重启请求失败: " + e.message
      };
    }
  }), await HU();
}
async function NEe() {
  if (Sd.isMultiProcessDisabled) {
    await HU();
    return;
  }
  const t = await wEe();
  uu = t.manager, Ef = t.isElectron, Sd.isWorkerProcess ? await kEe() : await TEe();
}
NEe().catch((t) => {
  Xt.logError("[NapCat] [Process] 启动失败:", t), process.exit(1);
});
export {
  CEe as restartWorker
};
